wined3d: Store max point size in d3d_info.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-08-23 14:34:04 +02:00 committed by Alexandre Julliard
parent 9320424105
commit 95a051b333
6 changed files with 19 additions and 20 deletions

View File

@ -3657,6 +3657,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
adapter->vertex_pipe = select_vertex_implementation(gl_info, adapter->shader_backend); adapter->vertex_pipe = select_vertex_implementation(gl_info, adapter->shader_backend);
adapter->fragment_pipe = select_fragment_implementation(gl_info, adapter->shader_backend); adapter->fragment_pipe = select_fragment_implementation(gl_info, adapter->shader_backend);
d3d_info->limits.pointsize_max = gl_info->limits.pointsize_max;
adapter->shader_backend->shader_get_caps(gl_info, &shader_caps); adapter->shader_backend->shader_get_caps(gl_info, &shader_caps);
d3d_info->vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING; d3d_info->vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING;
d3d_info->limits.vs_version = shader_caps.vs_version; d3d_info->limits.vs_version = shader_caps.vs_version;

View File

@ -1928,8 +1928,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
state_cleanup(&cs->state); state_cleanup(&cs->state);
memset(&cs->state, 0, sizeof(cs->state)); memset(&cs->state, 0, sizeof(cs->state));
state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info, state_init(&cs->state, &cs->fb, &adapter->d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
} }
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@ -2795,7 +2794,7 @@ static DWORD WINAPI wined3d_cs_run(void *ctx)
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
struct wined3d_cs *cs; struct wined3d_cs *cs;
if (!(cs = heap_alloc_zero(sizeof(*cs)))) if (!(cs = heap_alloc_zero(sizeof(*cs))))
@ -2804,8 +2803,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->ops = &wined3d_cs_st_ops; cs->ops = &wined3d_cs_st_ops;
cs->device = device; cs->device = device;
state_init(&cs->state, &cs->fb, gl_info, &device->adapter->d3d_info, state_init(&cs->state, &cs->fb, d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
cs->data_size = WINED3D_INITIAL_CS_SIZE; cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = heap_alloc(cs->data_size))) if (!(cs->data = heap_alloc(cs->data_size)))

View File

@ -4922,8 +4922,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_device_delete_opengl_contexts(device); wined3d_device_delete_opengl_contexts(device);
memset(&device->state, 0, sizeof(device->state)); memset(&device->state, 0, sizeof(device->state));
state_init(&device->state, &device->fb, &device->adapter->gl_info, state_init(&device->state, &device->fb, &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);
device->update_state = &device->state; device->update_state = &device->state;
device_init_swapchain_state(device, swapchain); device_init_swapchain_state(device, swapchain);
@ -5163,8 +5162,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
return hr; return hr;
} }
state_init(&device->state, &device->fb, &adapter->gl_info, state_init(&device->state, &device->fb, &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);
device->update_state = &device->state; device->update_state = &device->state;
device->max_frame_latency = 3; device->max_frame_latency = 3;

View File

@ -2186,7 +2186,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
} }
caps->MaxAnisotropy = gl_info->limits.anisotropy; caps->MaxAnisotropy = gl_info->limits.anisotropy;
caps->MaxPointSize = gl_info->limits.pointsize_max; caps->MaxPointSize = d3d_info->limits.pointsize_max;
caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */

View File

@ -1113,21 +1113,22 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
TRACE("Applied stateblock %p.\n", stateblock); TRACE("Applied stateblock %p.\n", stateblock);
} }
static void state_init_default(struct wined3d_state *state, const struct wined3d_gl_info *gl_info) static void state_init_default(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
{ {
union union
{ {
struct wined3d_line_pattern lp; struct wined3d_line_pattern lp;
DWORD d; DWORD d;
} lp; } lp;
union { union
{
float f; float f;
DWORD d; DWORD d;
} tmpfloat; } tmpfloat;
unsigned int i; unsigned int i;
struct wined3d_matrix identity; struct wined3d_matrix identity;
TRACE("state %p, gl_info %p.\n", state, gl_info); TRACE("state %p, d3d_info %p.\n", state, d3d_info);
get_identity_matrix(&identity); get_identity_matrix(&identity);
state->gl_primitive_type = ~0u; state->gl_primitive_type = ~0u;
@ -1222,7 +1223,7 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
tmpfloat.f = 1.0f; tmpfloat.f = 1.0f;
state->render_states[WINED3D_RS_PATCHSEGMENTS] = tmpfloat.d; state->render_states[WINED3D_RS_PATCHSEGMENTS] = tmpfloat.d;
state->render_states[WINED3D_RS_DEBUGMONITORTOKEN] = 0xbaadcafe; state->render_states[WINED3D_RS_DEBUGMONITORTOKEN] = 0xbaadcafe;
tmpfloat.f = gl_info->limits.pointsize_max; tmpfloat.f = d3d_info->limits.pointsize_max;
state->render_states[WINED3D_RS_POINTSIZE_MAX] = tmpfloat.d; state->render_states[WINED3D_RS_POINTSIZE_MAX] = tmpfloat.d;
state->render_states[WINED3D_RS_INDEXEDVERTEXBLENDENABLE] = FALSE; state->render_states[WINED3D_RS_INDEXEDVERTEXBLENDENABLE] = FALSE;
state->render_states[WINED3D_RS_COLORWRITEENABLE] = 0x0000000f; state->render_states[WINED3D_RS_COLORWRITEENABLE] = 0x0000000f;
@ -1316,8 +1317,7 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
} }
void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, const struct wined3d_d3d_info *d3d_info, DWORD flags)
DWORD flags)
{ {
unsigned int i; unsigned int i;
@ -1330,7 +1330,7 @@ void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
} }
if (flags & WINED3D_STATE_INIT_DEFAULT) if (flags & WINED3D_STATE_INIT_DEFAULT)
state_init_default(state, gl_info); state_init_default(state, d3d_info);
} }
static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
@ -1340,7 +1340,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
stateblock->ref = 1; stateblock->ref = 1;
stateblock->device = device; stateblock->device = device;
state_init(&stateblock->state, NULL, &device->adapter->gl_info, d3d_info, 0); state_init(&stateblock->state, NULL, d3d_info, 0);
if (type == WINED3D_SBT_RECORDED) if (type == WINED3D_SBT_RECORDED)
return WINED3D_OK; return WINED3D_OK;

View File

@ -163,6 +163,8 @@ struct wined3d_d3d_limits
unsigned int ffp_blend_stages; unsigned int ffp_blend_stages;
unsigned int ffp_vertex_blend_matrices; unsigned int ffp_vertex_blend_matrices;
unsigned int active_light_count; unsigned int active_light_count;
float pointsize_max;
}; };
typedef void (WINE_GLAPI *wined3d_ffp_attrib_func)(const void *data); typedef void (WINE_GLAPI *wined3d_ffp_attrib_func)(const void *data);
@ -3537,8 +3539,7 @@ void wined3d_state_enable_light(struct wined3d_state *state, const struct wined3
struct wined3d_light_info *wined3d_state_get_light(const struct wined3d_state *state, struct wined3d_light_info *wined3d_state_get_light(const struct wined3d_state *state,
unsigned int idx) DECLSPEC_HIDDEN; unsigned int idx) DECLSPEC_HIDDEN;
void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN;
DWORD flags) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
enum wined3d_cs_queue_id enum wined3d_cs_queue_id