Henri Verbeet : wined3d: The initial value for D3DRS_POINTSIZE_MAX depends on the pointsize limit.

Alexandre Julliard julliard at winehq.org
Mon Dec 29 08:47:54 CST 2008


Module: wine
Branch: master
Commit: de494ffe3c371110201f3d8a71fcd81f33b90760
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=de494ffe3c371110201f3d8a71fcd81f33b90760

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Dec 29 09:14:29 2008 +0100

wined3d: The initial value for D3DRS_POINTSIZE_MAX depends on the pointsize limit.

---

 dlls/d3d9/tests/stateblock.c |   16 ++++++++--------
 dlls/wined3d/stateblock.c    |    2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/d3d9/tests/stateblock.c b/dlls/d3d9/tests/stateblock.c
index baec5c6..b5680aa 100644
--- a/dlls/d3d9/tests/stateblock.c
+++ b/dlls/d3d9/tests/stateblock.c
@@ -1073,6 +1073,7 @@ typedef struct render_state_data {
 
 typedef struct render_state_arg {
     D3DPRESENT_PARAMETERS* device_pparams;
+    float pointsize_max;
 } render_state_arg;
 
 typedef struct render_state_context {
@@ -1123,14 +1124,12 @@ static inline DWORD to_dword(float fl) {
     return *((DWORD*) &fl);
 }
 
-static void render_state_default_data_init(
-    D3DPRESENT_PARAMETERS* device_pparams,
-    render_state_data* data) {
-
+static void render_state_default_data_init(const struct render_state_arg *rsarg, struct render_state_data *data)
+{
+   DWORD zenable = rsarg->device_pparams->EnableAutoDepthStencil ? D3DZB_TRUE : D3DZB_FALSE;
    unsigned int idx = 0;
 
-   data->states[idx++] = device_pparams->EnableAutoDepthStencil?
-                         D3DZB_TRUE : D3DZB_FALSE;  /* ZENABLE */
+   data->states[idx++] = zenable;               /* ZENABLE */
    data->states[idx++] = D3DFILL_SOLID;         /* FILLMODE */
    data->states[idx++] = D3DSHADE_GOURAUD;      /* SHADEMODE */
    data->states[idx++] = TRUE;                  /* ZWRITEENABLE */
@@ -1195,7 +1194,7 @@ static void render_state_default_data_init(
    data->states[idx++] = 0xFFFFFFFF;            /* MULTISAMPLEMASK */
    data->states[idx++] = D3DPATCHEDGE_DISCRETE; /* PATCHEDGESTYLE */ 
    data->states[idx++] = 0xbaadcafe;            /* DEBUGMONITORTOKEN */
-   data->states[idx++] = to_dword(64.0f);       /* POINTSIZE_MAX */
+   data->states[idx++] = to_dword(rsarg->pointsize_max); /* POINTSIZE_MAX */
    data->states[idx++] = FALSE;                 /* INDEXEDVERTEXBLENDENABLE */
    data->states[idx++] = 0x0000000F;            /* COLORWRITEENABLE */
    data->states[idx++] = to_dword(0.0f);        /* TWEENFACTOR */
@@ -1372,7 +1371,7 @@ static HRESULT render_state_setup_handler(
     test->test_data_out = &ctx->test_data_buffer;
     test->poison_data = &ctx->poison_data_buffer;
 
-    render_state_default_data_init(rsarg->device_pparams, &ctx->default_data_buffer);
+    render_state_default_data_init(rsarg, &ctx->default_data_buffer);
     render_state_test_data_init(&ctx->test_data_buffer);
     render_state_poison_data_init(&ctx->poison_data_buffer);
 
@@ -1454,6 +1453,7 @@ static void test_state_management(
     tcount++;
 
     render_state_arg.device_pparams = device_pparams;
+    render_state_arg.pointsize_max = caps.MaxPointSize;
     render_states_queue_test(&tests[tcount], &render_state_arg);
     tcount++;
 
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index e1d4627..27a4d50 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1123,7 +1123,7 @@ static HRESULT  WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
     tmpfloat.f = 1.0f;
     IWineD3DDevice_SetRenderState(device, WINED3DRS_PATCHSEGMENTS,            tmpfloat.d);
     IWineD3DDevice_SetRenderState(device, WINED3DRS_DEBUGMONITORTOKEN,        0xbaadcafe);
-    tmpfloat.f = 64.0f;
+    tmpfloat.f = GL_LIMITS(pointsize);
     IWineD3DDevice_SetRenderState(device, WINED3DRS_POINTSIZE_MAX,            tmpfloat.d);
     IWineD3DDevice_SetRenderState(device, WINED3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
     IWineD3DDevice_SetRenderState(device, WINED3DRS_COLORWRITEENABLE,         0x0000000F);




More information about the wine-cvs mailing list