Commit de494ffe authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 664b58dc
......@@ -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++;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment