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

David R Robison drrobison at openroadsconsulting.com
Thu Aug 29 12:47:49 CEST 2013


See in line... I will make some changes and resubmit the patch as a text 
only e-mail. I really want to participate and help but am having a lot 
of trouble acclimating to this project. I hope these comments help. David

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison at openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526

On 8/27/2013 10:13 AM, Jean-Baptiste Kempf wrote:
> On 27 Aug, David R Robison wrote :
>>    mode change 100644 => 100755 modules/video_output/msw/glwin32.c
> No.
I fixed this in the latest patch
>
>> +#define GLEW_NO_GLU
>> +#define GLEW_STATIC
> What is this for? Where is the includes?
As stated this it to force static linking of the GLEW libraries
>
>> +#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 ?
The description has been changed in the latest patch
>
>> +#undef wglEnumGpusNV
>> +#undef wglCreateAffinityDCNV
>> +#undef wglDeleteDCNV
>> +static PFNWGLENUMGPUSNVPROC wglEnumGpusNV;
>> +static PFNWGLCREATEAFFINITYDCNVPROC wglCreateAffinityDCNV;
>> +static PFNWGLDELETEDCNVPROC wglDeleteDCNV;
> Why?
I need to execute these functions outside of an active OpenGL context, 
however, with the standard headers they are only available inside an 
active context. The function creates a "dummy" context and cached these 
funciton pointers. I tried making them static so I have to only do this 
once, but since open is not called too often I'll make them local variables
>
>> +static HDC AffinityHDC;
> Why a static for that?
Left over code. was removed in latest patch
>
>> +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.
Fixed indentation in latest patch
>
>> +    msg_Dbg(vd, "GL Extensions = %s", extensions );
> No, please don't spam the outputs.
Fixed in latest patch
>
> Why do you need a new HDC instead of using hGLDC ?
Answered in previous e-mail
>
> Best regards,
>



This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.
If you are not the intended recipient, please delete this email immediately.




More information about the vlc-devel mailing list