Ivan Gyurdiev : wined3d: Rework shader mode selection.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 6 10:44:04 CDT 2006

Module: wine
Branch: refs/heads/master
Commit: 771623692ea6a7f8070b2f96fda46d0debce42e6
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=771623692ea6a7f8070b2f96fda46d0debce42e6

Author: Ivan Gyurdiev <ivg231 at gmail.com>
Date:   Tue Jul  4 01:21:53 2006 -0600

wined3d: Rework shader mode selection.

- 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.


 dlls/wined3d/baseshader.c      |   13 ++++-
 dlls/wined3d/device.c          |    4 +-
 dlls/wined3d/directx.c         |   95 ++++++++++++++++++++++++++--------------
 dlls/wined3d/drawprim.c        |   38 ++++++++--------
 dlls/wined3d/pixelshader.c     |    9 ++--
 dlls/wined3d/vertexshader.c    |   10 +++-
 dlls/wined3d/wined3d_private.h |    8 +++
 7 files changed, 108 insertions(+), 69 deletions(-)

Diff:   http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=771623692ea6a7f8070b2f96fda46d0debce42e6

More information about the wine-cvs mailing list