• Ivan Gyurdiev's avatar
    wined3d: Rework shader mode selection. · 77162369
    Ivan Gyurdiev authored
    - currently half the shader selection code (GLSL vs ARB) is in
    fillGLcaps. The parts that check for software shaders are in
    GetDeviceCaps. That placement, will work, but is definitely not optimal.
    FillGLcaps should detect support - it should not make decision as to
    what's used, because that's not what the purpose of the function is.
    GetDeviceCaps should report support as it has already been selected.
    Instead, select shader mode in its own function, called in the
    appropriate places.
    
    - unifying pixel and vertex shaders into a single selection is a
    mistake. A software vertex shader can be coupled with a hardware arb or
    glsl pixel shader, or no shader at all. Split them back into two and add
    a SHADER_NONE variant.
    
    - drawprim is doing support checks for ARB_PROGRAM, and making shader
    decisions based on that - that's wrong, support has already been
    checked, and decided upon, and shaders can be implemented via software,
    ARB_PROGRAm or GLSL, so that support check isn't valid.
    
    - Store the shader selected mode into the shader itself. Different types
    of shaders can be combined, so this is an improvement. In fact, storing
    the mode into the settings globally is a mistake as well - it should be
    done per device, since different cards have different capabilities.
    77162369
directx.c 81.2 KB