[vlc-devel] [PATCH 3/3] nVidia affinity

Jean-Baptiste Kempf jb at videolan.org
Tue Aug 27 16:13:01 CEST 2013


On 27 Aug, David R Robison wrote :
>   mode change 100644 => 100755 modules/video_output/msw/glwin32.c

No.

> +#define GLEW_NO_GLU
> +#define GLEW_STATIC

What is this for? Where is the includes?

> +#define HW_NVIDIA_AFFINITY_TEXT N_("Set the nVidia affinity to this 
> adapter number")
> +#define HW_NVIDIA_AFFINITY_LONGTEXT N_(\
> +    "Identifies nVidia addapter number to use for hardware acceleration.")

No, This is too tied to nVidia, and this is way too vague:
what is "hardware acceleration" here ?

> +#undef wglEnumGpusNV
> +#undef wglCreateAffinityDCNV
> +#undef wglDeleteDCNV
> +static PFNWGLENUMGPUSNVPROC wglEnumGpusNV;
> +static PFNWGLCREATEAFFINITYDCNVPROC wglCreateAffinityDCNV;
> +static PFNWGLDELETEDCNVPROC wglDeleteDCNV;

Why?

> +static HDC AffinityHDC;

Why a static for that?

> +static void AssignNVidiaAffinity(vout_display_t *vd, UINT nVidiaAffinity) {
> +    PIXELFORMATDESCRIPTOR pfd;
> +    memset(&pfd, 0, sizeof(pfd));
> +    pfd.nSize = sizeof(pfd);
> +    pfd.nVersion = 1;
> +    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | 
> PFD_DOUBLEBUFFER;
> +    pfd.iPixelType = PFD_TYPE_RGBA;
> +    pfd.cColorBits = 24;
> +    pfd.cDepthBits = 16;
> +    pfd.iLayerType = PFD_MAIN_PLANE;
> +
> +    // initialize the wgl context
> +    if (wglEnumGpusNV == NULL) {
> +        msg_Dbg(vd, "Initialize wgl context" );
> +
> +    // create a temporary GL context
> +        HDC winDC = GetDC(vd->sys->hvideownd);
> +        SetPixelFormat(winDC, ChoosePixelFormat(winDC, &pfd), &pfd);
> +        HGLRC hGLRC = wglCreateContext(winDC);
> +        wglMakeCurrent(winDC, hGLRC);
> +
> +    // get function pointers
> +        wglEnumGpusNV = 
> (PFNWGLENUMGPUSNVPROC)wglGetProcAddress("wglEnumGpusNV");
> +        wglCreateAffinityDCNV = 
> (PFNWGLCREATEAFFINITYDCNVPROC)wglGetProcAddress("wglCreateAffinityDCNV");
> +        wglDeleteDCNV = 
> (PFNWGLDELETEDCNVPROC)wglGetProcAddress("wglDeleteDCNV");
> +
> +    // delete the temporary GL context
> +        wglDeleteContext(hGLRC);
> +    }

Comments intendation is off and not matching the file style.

> +    msg_Dbg(vd, "GL Extensions = %s", extensions );

No, please don't spam the outputs.

Why do you need a new HDC instead of using hGLDC ?

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list