[PATCH] WineD3D: Set vertex caps in the vertex pipeline=0A=
Stefan Doesinger
stefan at codeweavers.com
Wed Sep 17 11:26:44 CDT 2008
=0A=
---=0A=
dlls/wined3d/directx.c | 36 =
+++++++++++++++---------------------=0A=
dlls/wined3d/state.c | 28 +++++++++++++++++++++++-----=0A=
dlls/wined3d/wined3d_private.h | 10 ++++++++++=0A=
3 files changed, 48 insertions(+), 26 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c=0A=
index bfc05b9..9e33a2c 100644=0A=
--- a/dlls/wined3d/directx.c=0A=
+++ b/dlls/wined3d/directx.c=0A=
@@ -3038,8 +3038,10 @@ static HRESULT WINAPI =
IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,=0A=
int ps_selected_mode;=0A=
struct shader_caps shader_caps;=0A=
struct fragment_caps fragment_caps;=0A=
+ struct vertex_caps vertex_caps;=0A=
const shader_backend_t *shader_backend;=0A=
const struct fragment_pipeline *frag_pipeline =3D NULL;=0A=
+ const struct vertex_pipeline *vertex_pipeline =3D NULL;=0A=
DWORD ckey_caps, blit_caps, fx_caps;=0A=
=0A=
TRACE_(d3d_caps)("(%p)->(Adptr:%d, DevType: %x, pCaps: %p)\n", =
This, Adapter, DeviceType, pCaps);=0A=
@@ -3360,27 +3362,9 @@ static HRESULT WINAPI =
IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,=0A=
pCaps->StencilCaps |=3D WINED3DSTENCILCAPS_TWOSIDED;=0A=
}=0A=
=0A=
- pCaps->FVFCaps =3D WINED3DFVFCAPS_PSIZE | 0x0008; /* 8 texture =
coords */=0A=
-=0A=
- pCaps->MaxUserClipPlanes =3D GL_LIMITS(clipplanes);=0A=
- pCaps->MaxActiveLights =3D GL_LIMITS(lights);=0A=
-=0A=
- pCaps->MaxVertexBlendMatrices =3D GL_LIMITS(blends);=0A=
- pCaps->MaxVertexBlendMatrixIndex =3D 0;=0A=
-=0A=
pCaps->MaxAnisotropy =3D GL_LIMITS(anisotropy);=0A=
pCaps->MaxPointSize =3D GL_LIMITS(pointsize);=0A=
=0A=
-=0A=
- pCaps->VertexProcessingCaps =3D WINED3DVTXPCAPS_DIRECTIONALLIGHTS |=0A=
- WINED3DVTXPCAPS_MATERIALSOURCE7 |=0A=
- WINED3DVTXPCAPS_POSITIONALLIGHTS |=0A=
- WINED3DVTXPCAPS_LOCALVIEWER |=0A=
- WINED3DVTXPCAPS_VERTEXFOG |=0A=
- WINED3DVTXPCAPS_TEXGEN;=0A=
- /* FIXME: Add =0A=
- D3DVTXPCAPS_TWEENING, =
D3DVTXPCAPS_TEXGEN_SPHEREMAP */=0A=
-=0A=
pCaps->MaxPrimitiveCount =3D 0xFFFFF; /* For now set 2^20-1 which =
is used by most >=3DGeforce3/Radeon8500 cards */=0A=
pCaps->MaxVertexIndex =3D 0xFFFFF;=0A=
pCaps->MaxStreams =3D MAX_STREAMS;=0A=
@@ -3397,9 +3381,9 @@ static HRESULT WINAPI =
IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,=0A=
pCaps->NumSimultaneousRTs =3D GL_LIMITS(buffers);=0A=
=0A=
pCaps->StretchRectFilterCaps =3D =
WINED3DPTFILTERCAPS_MINFPOINT |=0A=
- =
WINED3DPTFILTERCAPS_MAGFPOINT |=0A=
- =
WINED3DPTFILTERCAPS_MINFLINEAR |=0A=
- =
WINED3DPTFILTERCAPS_MAGFLINEAR;=0A=
+ =
WINED3DPTFILTERCAPS_MAGFPOINT |=0A=
+ =
WINED3DPTFILTERCAPS_MINFLINEAR |=0A=
+ =
WINED3DPTFILTERCAPS_MAGFLINEAR;=0A=
pCaps->VertexTextureFilterCaps =3D 0;=0A=
=0A=
memset(&shader_caps, 0, sizeof(shader_caps));=0A=
@@ -3410,6 +3394,10 @@ static HRESULT WINAPI =
IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,=0A=
frag_pipeline =3D select_fragment_implementation(Adapter, =
DeviceType);=0A=
frag_pipeline->get_caps(DeviceType, &GLINFO_LOCATION, =
&fragment_caps);=0A=
=0A=
+ memset(&vertex_caps, 0, sizeof(vertex_caps));=0A=
+ vertex_pipeline =3D select_vertex_implementation(Adapter, =
DeviceType);=0A=
+ vertex_pipeline->get_caps(DeviceType, &GLINFO_LOCATION, =
&vertex_caps);=0A=
+=0A=
/* Add shader misc caps. Only some of them belong to the shader =
parts of the pipeline */=0A=
pCaps->PrimitiveMiscCaps |=3D fragment_caps.PrimitiveMiscCaps;=0A=
=0A=
@@ -3438,6 +3426,12 @@ static HRESULT WINAPI =
IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,=0A=
pCaps->MaxTextureBlendStages =3D =
fragment_caps.MaxTextureBlendStages;=0A=
pCaps->MaxSimultaneousTextures =3D =
fragment_caps.MaxSimultaneousTextures;=0A=
=0A=
+ pCaps->MaxActiveLights =3D =
vertex_caps.MaxActiveLights;=0A=
+ pCaps->MaxVertexBlendMatrices =3D =
vertex_caps.MaxVertexBlendMatrices;=0A=
+ pCaps->MaxVertexBlendMatrixIndex =3D =
vertex_caps.MaxVertexBlendMatrixIndex;=0A=
+ pCaps->VertexProcessingCaps =3D =
vertex_caps.VertexProcessingCaps;=0A=
+ pCaps->FVFCaps =3D vertex_caps.FVFCaps;=0A=
+=0A=
pCaps->VS20Caps =3D shader_caps.VS20Caps;=0A=
pCaps->MaxVShaderInstructionsExecuted =3D =
shader_caps.MaxVShaderInstructionsExecuted;=0A=
pCaps->MaxVertexShader30InstructionSlots=3D =
shader_caps.MaxVertexShader30InstructionSlots;=0A=
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c=0A=
index b50b1dd..733b2c0 100644=0A=
--- a/dlls/wined3d/state.c=0A=
+++ b/dlls/wined3d/state.c=0A=
@@ -5356,11 +5356,6 @@ const struct StateEntryTemplate =
ffp_vertexstate_template[] =3D {=0A=
{0 /* Terminate */, { 0, =
0 }, 0 =
},=0A=
};=0A=
=0A=
-const struct vertex_pipeline ffp_vertex_pipeline =3D {=0A=
- ffp_vertexstate_template,=0A=
- FALSE /* The implementation cannot convert d3dcolors natively */=0A=
-};=0A=
-=0A=
static const struct StateEntryTemplate ffp_fragmentstate_template[] =3D =
{=0A=
{ STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), { =
STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), tex_colorop =
}, 0 },=0A=
{ STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG1), { =
STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), tex_colorop =
}, 0 },=0A=
@@ -5459,6 +5454,29 @@ static const struct StateEntryTemplate =
ffp_fragmentstate_template[] =3D {=0A=
#undef GLINFO_LOCATION=0A=
=0A=
#define GLINFO_LOCATION (*gl_info)=0A=
+=0A=
+static void ffp_vertex_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info =
*gl_info, struct vertex_caps *pCaps) {=0A=
+ pCaps->MaxActiveLights =3D GL_LIMITS(lights);=0A=
+ pCaps->MaxVertexBlendMatrices =3D GL_LIMITS(blends);=0A=
+ pCaps->MaxVertexBlendMatrixIndex =3D 0;=0A=
+ pCaps->MaxUserClipPlanes =3D GL_LIMITS(clipplanes);=0A=
+ pCaps->FVFCaps =3D WINED3DFVFCAPS_PSIZE | =
0x0008; /* 8 texture coords */=0A=
+=0A=
+ pCaps->VertexProcessingCaps =3D =
WINED3DVTXPCAPS_DIRECTIONALLIGHTS |=0A=
+ =
WINED3DVTXPCAPS_MATERIALSOURCE7 |=0A=
+ =
WINED3DVTXPCAPS_POSITIONALLIGHTS |=0A=
+ WINED3DVTXPCAPS_LOCALVIEWER =
|=0A=
+ WINED3DVTXPCAPS_VERTEXFOG =
|=0A=
+ WINED3DVTXPCAPS_TEXGEN;=0A=
+ /* FIXME: Add =
D3DVTXPCAPS_TWEENING, D3DVTXPCAPS_TEXGEN_SPHEREMAP */=0A=
+}=0A=
+=0A=
+const struct vertex_pipeline ffp_vertex_pipeline =3D {=0A=
+ ffp_vertexstate_template,=0A=
+ ffp_vertex_get_caps,=0A=
+ FALSE /* The implementation cannot convert d3dcolors natively */=0A=
+};=0A=
+=0A=
static void ffp_enable(IWineD3DDevice *iface, BOOL enable) { }=0A=
=0A=
static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, =
WineD3D_GL_Info *gl_info, struct fragment_caps *pCaps) {=0A=
diff --git a/dlls/wined3d/wined3d_private.h =
b/dlls/wined3d/wined3d_private.h=0A=
index 93257bc..ed68d92 100644=0A=
--- a/dlls/wined3d/wined3d_private.h=0A=
+++ b/dlls/wined3d/wined3d_private.h=0A=
@@ -645,8 +645,18 @@ struct fragment_pipeline {=0A=
BOOL ffp_proj_control;=0A=
};=0A=
=0A=
+struct vertex_caps {=0A=
+ DWORD MaxActiveLights;=0A=
+ DWORD MaxVertexBlendMatrices;=0A=
+ DWORD MaxVertexBlendMatrixIndex;=0A=
+ DWORD VertexProcessingCaps;=0A=
+ DWORD FVFCaps;=0A=
+ DWORD MaxUserClipPlanes;=0A=
+};=0A=
+=0A=
struct vertex_pipeline {=0A=
const struct StateEntryTemplate *states;=0A=
+ void (*get_caps)(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, =
struct vertex_caps *caps);=0A=
BOOL can_convert_d3dcolor;=0A=
};=0A=
=0A=
-- =0A=
1.5.6.4=0A=
=0A=
------=_NextPart_000_002F_01C94849.CE1E3B30--
More information about the wine-patches
mailing list