Skip to content

ChoosePixelFormat() in wingdi.h returns system error 203 ERROR_ENVVAR_NOT_FOUND when using any software back-end. #207

Open
@tfinnegan937

Description

I am using mesa-dist-win version 24.2.7 on Windows version 9045.5131.

I am attempting to use llvmpipe for our application under single-threaded rendering.

The following call:

    int32_t pixelFormat;
    static PIXELFORMATDESCRIPTOR pfd =
    {
        sizeof(PIXELFORMATDESCRIPTOR),              // Size of this pixel format descriptor
        1,                                          // Version number
        PFD_DRAW_TO_WINDOW |                        // Format must support window
        PFD_SUPPORT_OPENGL |                        // Format must support OpenGL
        PFD_DOUBLEBUFFER,                           // Must support double buffering
        PFD_TYPE_RGBA,                              // Request an RGBA format
        32,                                         // Select our color depth
        0, 0, 0, 0, 0, 0,                           // Color bits ignored
        0,                                          // No alpha buffer
        0,                                          // Shift bit ignored
        0,                                          // No accumulation buffer
        0, 0, 0, 0,                                 // Accumulation bits ignored
        24,                                         // 32 Bit z-buffer (depth buffer)
        8,                                          // Stencil buffer
        0,                                          // No auxiliary buffer
        PFD_MAIN_PLANE,                             // Main drawing layer
        0,                                          // Reserved
        0, 0, 0                                     // Layer masks ignored
    };

    pixelFormat = ChoosePixelFormat(hdc, &pfd);

returns 0, with error 203 being the output from GetLastError().

This occurs under the the following environment variable configurations:

  1. GALLIUM_DRIVER=llvmpipe;LP_NUM_THREADS=1;
  2. GALLIUM_DRIVER=softpipe;
  3. GALLIUM_DRIVER=zink;LIBGL_ALWAYS_SOFTWARE=1

It does NOT occur with none of these variables set. This is a system with an RTX 3070 GPU.

Furthermore, if I replace PFD_DRAW_TO_WINDOW with PFD_DRAW_TO_BITMAP, I believe I run into a driver error. ChoosePixelForma() still returns 0, but no system error is generated with GetLastError().

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions