From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/context_gl.c | 13 ------------- dlls/wined3d/wined3d_private.h | 3 +-- 2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index d245a87526f..9a85e0a4c86 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -4883,19 +4883,6 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s WARN_(d3d_perf)("Using software emulation because not all material properties could be tracked.\n"); emulation = TRUE; } - else if (context->fog_coord && state->render_states[WINED3D_RS_FOGENABLE]) - { - static BOOL warned; - - /* Either write a pipeline replacement shader or convert the - * specular alpha from unsigned byte to a float in the vertex - * buffer. */ - if (!warned++) - FIXME("Using software emulation because manual fog coordinates are provided.\n"); - else - WARN_(d3d_perf)("Using software emulation because manual fog coordinates are provided.\n"); - emulation = TRUE; - }
if (emulation) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 17b57424839..3fc9dfb9a8e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1930,7 +1930,6 @@ struct wined3d_context DWORD uses_fbo_attached_resources : 1; DWORD transform_feedback_active : 1; DWORD transform_feedback_paused : 1; - DWORD fog_coord : 1; DWORD current : 1; DWORD destroyed : 1; DWORD destroy_delayed : 1; @@ -1938,7 +1937,7 @@ struct wined3d_context DWORD update_primitive_type : 1; DWORD update_patch_vertex_count : 1; DWORD update_multisample_state : 1; - DWORD padding : 11; + DWORD padding : 12;
DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/context_gl.c | 55 ++++----------------------------------- dlls/wined3d/wined3d_gl.h | 3 +-- 2 files changed, 6 insertions(+), 52 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 9a85e0a4c86..310473138a4 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -4704,28 +4704,6 @@ static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_ checkGLcall("draw indirect"); }
-static void remove_vbos(struct wined3d_context *context, - const struct wined3d_state *state, struct wined3d_stream_info *s) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(s->elements); ++i) - { - struct wined3d_stream_info_element *e; - - if (!(s->use_map & (1u << i))) - continue; - - e = &s->elements[i]; - if (e->data.buffer_object) - { - struct wined3d_buffer *vb = state->streams[e->stream_idx].buffer; - e->data.buffer_object = 0; - e->data.addr += (ULONG_PTR)wined3d_buffer_load_sysmem(vb, context); - } - } -} - static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); @@ -4756,14 +4734,13 @@ static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primiti void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_draw_parameters *parameters) { - BOOL emulation = FALSE, rasterizer_discard = FALSE; const struct wined3d_fb_state *fb = &state->fb; const struct wined3d_stream_info *stream_info; struct wined3d_rendertarget_view *dsv, *rtv; - struct wined3d_stream_info si_emulated; const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; struct wined3d_context *context; + bool rasterizer_discard = false; unsigned int i, idx_size = 0; const void *idx_data = NULL;
@@ -4870,28 +4847,6 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s idx_size = 4; }
- if (!use_vs(state)) - { - if (!stream_info->position_transformed && context_gl->untracked_material_count - && state->render_states[WINED3D_RS_LIGHTING]) - { - static BOOL warned; - - if (!warned++) - FIXME("Using software emulation because not all material properties could be tracked.\n"); - else - WARN_(d3d_perf)("Using software emulation because not all material properties could be tracked.\n"); - emulation = TRUE; - } - - if (emulation) - { - si_emulated = context->stream_info; - remove_vbos(context, state, &si_emulated); - stream_info = &si_emulated; - } - } - if (use_transform_feedback(state)) { const struct wined3d_shader *shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY]; @@ -4900,7 +4855,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s { glEnable(GL_RASTERIZER_DISCARD); checkGLcall("enable rasterizer discard"); - rasterizer_discard = TRUE; + rasterizer_discard = true; }
if (context->transform_feedback_paused) @@ -4952,16 +4907,16 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (parameters->indirect) { - if (!context->use_immediate_mode_draw && !emulation) + if (!context->use_immediate_mode_draw) wined3d_context_gl_draw_indirect(context_gl, state, ¶meters->u.indirect, idx_size); else - FIXME("Indirect draws with immediate mode/emulation are not supported.\n"); + FIXME("Indirect draws with immediate mode are not supported.\n"); } else { unsigned int instance_count = parameters->u.direct.instance_count;
- if (context->use_immediate_mode_draw || emulation) + if (context->use_immediate_mode_draw) draw_primitive_immediate_mode(wined3d_context_gl(context), state, stream_info, idx_data, idx_size, parameters->u.direct.base_vertex_idx, parameters->u.direct.start_idx, parameters->u.direct.index_count, instance_count); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 9a27bb5b2bf..2da6add961d 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -615,11 +615,10 @@ struct wined3d_context_gl uint32_t fog_enabled : 1; uint32_t diffuse_attrib_to_1 : 1; uint32_t rebind_fbo : 1; - uint32_t untracked_material_count : 2; /* Max value 2 */ uint32_t needs_set : 1; uint32_t internal_format_set : 1; uint32_t valid : 1; - uint32_t padding : 22; + uint32_t padding : 24;
uint32_t default_attrib_value_set;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/adapter_gl.c | 108 --------------------------------- dlls/wined3d/context.c | 2 - dlls/wined3d/context_gl.c | 82 ++----------------------- dlls/wined3d/wined3d_gl.h | 7 --- dlls/wined3d/wined3d_private.h | 3 +- 5 files changed, 6 insertions(+), 196 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 19e24aac3ca..823304600f6 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3834,69 +3834,12 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter_gl *adapter_gl, return TRUE; }
-static void WINE_GLAPI invalid_func(const void *data) -{ - ERR("Invalid vertex attribute function called.\n"); - DebugBreak(); -} - -static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data) -{ - ERR("Invalid texcoord function called.\n"); - DebugBreak(); -} - static void WINE_GLAPI invalid_generic_attrib_func(GLuint idx, const void *data) { ERR("Invalid attribute function called.\n"); DebugBreak(); }
-/* Helper functions for providing vertex data to OpenGL. The arrays are - * initialised based on the extension detection and are used in - * draw_primitive_immediate_mode(). */ -static void WINE_GLAPI position_d3dcolor(const void *data) -{ - const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info; - DWORD pos = *((const DWORD *)data); - - FIXME("Add a test for fixed function position from d3dcolor type.\n"); - gl_info->gl_ops.gl.p_glVertex4s(D3DCOLOR_B_R(pos), - D3DCOLOR_B_G(pos), - D3DCOLOR_B_B(pos), - D3DCOLOR_B_A(pos)); -} - -static void WINE_GLAPI diffuse_d3dcolor(const void *data) -{ - const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info; - DWORD diffuseColor = *((const DWORD *)data); - - gl_info->gl_ops.gl.p_glColor4ub(D3DCOLOR_B_R(diffuseColor), - D3DCOLOR_B_G(diffuseColor), - D3DCOLOR_B_B(diffuseColor), - D3DCOLOR_B_A(diffuseColor)); -} - -static void WINE_GLAPI specular_d3dcolor(const void *data) -{ - const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info; - DWORD specularColor = *((const DWORD *)data); - GLubyte d[] = - { - D3DCOLOR_B_R(specularColor), - D3DCOLOR_B_G(specularColor), - D3DCOLOR_B_B(specularColor) - }; - - gl_info->gl_ops.ext.p_glSecondaryColor3ubvEXT(d); -} - -static void WINE_GLAPI warn_no_specular_func(const void *data) -{ - WARN("GL_EXT_secondary_color not supported.\n"); -} - static void WINE_GLAPI generic_d3dcolor(GLuint idx, const void *data) { const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info; @@ -3950,58 +3893,7 @@ static void wined3d_adapter_init_ffp_attrib_ops(struct wined3d_adapter_gl *adapt unsigned int i;
for (i = 0; i < WINED3D_FFP_EMIT_COUNT; ++i) - { - ops->position[i] = invalid_func; - ops->diffuse[i] = invalid_func; - ops->specular[i] = invalid_func; - ops->normal[i] = invalid_func; - ops->texcoord[i] = invalid_texcoord_func; ops->generic[i] = invalid_generic_attrib_func; - } - - ops->position[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glVertex3fv; - ops->position[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glVertex4fv; - ops->position[WINED3D_FFP_EMIT_D3DCOLOR] = position_d3dcolor; - ops->position[WINED3D_FFP_EMIT_SHORT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glVertex2sv; - - ops->diffuse[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor3fv; - ops->diffuse[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4fv; - ops->diffuse[WINED3D_FFP_EMIT_D3DCOLOR] = diffuse_d3dcolor; - ops->diffuse[WINED3D_FFP_EMIT_UBYTE4N] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4ubv; - ops->diffuse[WINED3D_FFP_EMIT_SHORT4N] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4sv; - ops->diffuse[WINED3D_FFP_EMIT_USHORT4N] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4usv; - - /* No 4 component entry points here. */ - if (gl_info->supported[EXT_SECONDARY_COLOR]) - ops->specular[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)GL_EXTCALL(glSecondaryColor3fvEXT); - else - ops->specular[WINED3D_FFP_EMIT_FLOAT3] = warn_no_specular_func; - if (gl_info->supported[EXT_SECONDARY_COLOR]) - ops->specular[WINED3D_FFP_EMIT_D3DCOLOR] = specular_d3dcolor; - else - ops->specular[WINED3D_FFP_EMIT_D3DCOLOR] = warn_no_specular_func; - - /* Only 3 component entry points here. Test how others behave. Float4 - * normals are used by one of our tests, trying to pass it to the pixel - * shader, which fails on Windows. */ - ops->normal[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glNormal3fv; - /* Just ignore the 4th value. */ - ops->normal[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glNormal3fv; - - ops->texcoord[WINED3D_FFP_EMIT_FLOAT1] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB; - ops->texcoord[WINED3D_FFP_EMIT_FLOAT2] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB; - ops->texcoord[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB; - ops->texcoord[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB; - ops->texcoord[WINED3D_FFP_EMIT_SHORT2] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord2svARB; - ops->texcoord[WINED3D_FFP_EMIT_SHORT4] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord4svARB; - if (gl_info->supported[NV_HALF_FLOAT]) - { - /* Not supported by ARB_HALF_FLOAT_VERTEX, so check for NV_HALF_FLOAT. */ - ops->texcoord[WINED3D_FFP_EMIT_FLOAT16_2] = - (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord2hvNV; - ops->texcoord[WINED3D_FFP_EMIT_FLOAT16_4] = - (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord4hvNV; - }
ops->generic[WINED3D_FFP_EMIT_FLOAT1] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib1fv; ops->generic[WINED3D_FFP_EMIT_FLOAT2] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib2fv; diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 30f50ea23f3..1a6ad5dc79a 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -310,6 +310,4 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi
if (prev_all_vbo != stream_info->all_vbo) context_invalidate_state(context, STATE_INDEXBUFFER); - - context->use_immediate_mode_draw = FALSE; } diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 310473138a4..8072ec15500 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -4609,66 +4609,6 @@ static void wined3d_context_gl_draw_primitive_arrays(struct wined3d_context_gl * } }
-static unsigned int get_stride_idx(const void *idx_data, unsigned int idx_size, - unsigned int base_vertex_idx, unsigned int start_idx, unsigned int vertex_idx) -{ - if (!idx_data) - return start_idx + vertex_idx; - if (idx_size == 2) - return ((const WORD *)idx_data)[start_idx + vertex_idx] + base_vertex_idx; - return ((const DWORD *)idx_data)[start_idx + vertex_idx] + base_vertex_idx; -} - -/* Context activation is done by the caller. */ -static void draw_primitive_immediate_mode(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, - const struct wined3d_stream_info *si, const void *idx_data, unsigned int idx_size, - int base_vertex_idx, unsigned int start_idx, unsigned int vertex_count, unsigned int instance_count) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - const struct wined3d_ffp_attrib_ops *ops; - const void *ptr; - - static unsigned int once; - - if (!once++) - FIXME_(d3d_perf)("Drawing using immediate mode.\n"); - else - WARN_(d3d_perf)("Drawing using immediate mode.\n"); - - if (!idx_size && idx_data) - ERR("Non-NULL idx_data with 0 idx_size, this should never happen.\n"); - - if (instance_count) - FIXME("Instancing not implemented.\n"); - - /* Immediate mode drawing can't make use of indices in a VBO - get the - * data from the index buffer. */ - if (idx_size) - idx_data = (uint8_t *)wined3d_buffer_load_sysmem(state->index_buffer, &context_gl->c) + state->index_offset; - - ops = &gl_info->ffp_attrib_ops; - - gl_info->gl_ops.gl.p_glBegin(gl_primitive_type_from_d3d(state->primitive_type)); - - for (unsigned int vertex_idx = 0; vertex_idx < vertex_count; ++vertex_idx) - { - unsigned int stride_idx = get_stride_idx(idx_data, idx_size, base_vertex_idx, start_idx, vertex_idx); - unsigned int use_map = si->use_map; - - for (unsigned int element_idx = gl_info->limits.vertex_attribs - 1; use_map; - use_map &= ~(1u << element_idx), --element_idx) - { - if (!(use_map & 1u << element_idx)) - continue; - - ptr = si->elements[element_idx].data.addr + si->elements[element_idx].stride * stride_idx; - ops->generic[si->elements[element_idx].format->emit_idx](element_idx, ptr); - } - } - - gl_info->gl_ops.gl.p_glEnd(); -} - static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size) { @@ -4907,23 +4847,14 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (parameters->indirect) { - if (!context->use_immediate_mode_draw) - wined3d_context_gl_draw_indirect(context_gl, state, ¶meters->u.indirect, idx_size); - else - FIXME("Indirect draws with immediate mode are not supported.\n"); + wined3d_context_gl_draw_indirect(context_gl, state, ¶meters->u.indirect, idx_size); } else { - unsigned int instance_count = parameters->u.direct.instance_count; - - if (context->use_immediate_mode_draw) - draw_primitive_immediate_mode(wined3d_context_gl(context), state, stream_info, idx_data, - idx_size, parameters->u.direct.base_vertex_idx, - parameters->u.direct.start_idx, parameters->u.direct.index_count, instance_count); - else - wined3d_context_gl_draw_primitive_arrays(context_gl, state, idx_data, idx_size, - parameters->u.direct.base_vertex_idx, parameters->u.direct.start_idx, - parameters->u.direct.index_count, parameters->u.direct.start_instance, instance_count); + wined3d_context_gl_draw_primitive_arrays(context_gl, state, idx_data, idx_size, + parameters->u.direct.base_vertex_idx, parameters->u.direct.start_idx, + parameters->u.direct.index_count, parameters->u.direct.start_instance, + parameters->u.direct.instance_count); }
if (context->uses_uavs) @@ -5233,9 +5164,6 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state) { - if (context_gl->c.use_immediate_mode_draw) - return; - wined3d_context_gl_unload_vertex_data(context_gl); wined3d_context_gl_load_numbered_arrays(context_gl, &context_gl->c.stream_info, state); } diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 2da6add961d..1dfa4138894 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -331,17 +331,10 @@ void wined3d_gl_limits_get_uniform_block_range(const struct wined3d_gl_limits *g #define WINED3D_QUIRK_BROKEN_ARB_FOG 0x00000200 #define WINED3D_QUIRK_NO_INDEPENDENT_BIT_DEPTHS 0x00000400
-typedef void (WINE_GLAPI *wined3d_ffp_attrib_func)(const void *data); -typedef void (WINE_GLAPI *wined3d_ffp_texcoord_func)(GLenum unit, const void *data); typedef void (WINE_GLAPI *wined3d_generic_attrib_func)(GLuint idx, const void *data);
struct wined3d_ffp_attrib_ops { - wined3d_ffp_attrib_func position[WINED3D_FFP_EMIT_COUNT]; - wined3d_ffp_attrib_func diffuse[WINED3D_FFP_EMIT_COUNT]; - wined3d_ffp_attrib_func specular[WINED3D_FFP_EMIT_COUNT]; - wined3d_ffp_attrib_func normal[WINED3D_FFP_EMIT_COUNT]; - wined3d_ffp_texcoord_func texcoord[WINED3D_FFP_EMIT_COUNT]; wined3d_generic_attrib_func generic[WINED3D_FFP_EMIT_COUNT]; };
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3fc9dfb9a8e..34c820497ad 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1925,7 +1925,6 @@ struct wined3d_context DWORD lowest_disabled_stage : 4; /* Max WINED3D_MAX_FFP_TEXTURES, 8 */
DWORD fixed_function_usage_map : 8; /* WINED3D_MAX_FFP_TEXTURES, 8 */ - DWORD use_immediate_mode_draw : 1; DWORD uses_uavs : 1; DWORD uses_fbo_attached_resources : 1; DWORD transform_feedback_active : 1; @@ -1937,7 +1936,7 @@ struct wined3d_context DWORD update_primitive_type : 1; DWORD update_patch_vertex_count : 1; DWORD update_multisample_state : 1; - DWORD padding : 12; + DWORD padding : 13;
DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/adapter_gl.c | 1 - dlls/wined3d/adapter_vk.c | 1 - dlls/wined3d/ffp_gl.c | 15 --------------- dlls/wined3d/glsl_shader.c | 8 +------- dlls/wined3d/shader_spirv.c | 3 +-- dlls/wined3d/utils.c | 11 ----------- dlls/wined3d/wined3d_private.h | 5 +---- 7 files changed, 3 insertions(+), 41 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 823304600f6..56aa9b73269 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4909,7 +4909,6 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->wined3d_creation_flags = wined3d_creation_flags; d3d_info->emulated_flatshading = vertex_caps.emulated_flatshading; d3d_info->ffp_alpha_test = !!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; - d3d_info->vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING; d3d_info->shader_double_precision = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION); d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); d3d_info->viewport_array_index_any_shader = !!gl_info->supported[ARB_SHADER_VIEWPORT_LAYER_ARRAY]; diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 8e004339525..aa02d03b7a4 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2327,7 +2327,6 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_
d3d_info->emulated_flatshading = vertex_caps.emulated_flatshading; d3d_info->ffp_alpha_test = false; - d3d_info->vs_clipping = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING); d3d_info->shader_double_precision = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION); d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); d3d_info->viewport_array_index_any_shader = false; /* VK_EXT_shader_viewport_index_layer */ diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index e2b9be647d0..b1a3c56a097 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -537,21 +537,6 @@ void state_clipping(struct wined3d_context *context, const struct wined3d_state struct wined3d_context_gl *context_gl = wined3d_context_gl(context); uint32_t enable_mask;
- if (use_vs(state) && !context->d3d_info->vs_clipping) - { - static BOOL warned; - - /* The OpenGL spec says that clipping planes are disabled when using - * shaders. Direct3D planes aren't, so that is an issue. The MacOS ATI - * driver keeps clipping planes activated with shaders in some - * conditions I got sick of tracking down. The shader state handler - * disables all clip planes because of that - don't do anything here - * and keep them disabled. */ - if (state->render_states[WINED3D_RS_CLIPPLANEENABLE] && !warned++) - FIXME("Clipping not supported with vertex shaders.\n"); - return; - } - /* glEnable(GL_CLIP_PLANEx) doesn't apply to (ARB backend) vertex shaders. * The enabled / disabled planes are hardcoded into the shader. Update the * shader to update the enabled clipplanes. In case of fixed function, we diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index c114734e013..13ba1d65d13 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -9594,7 +9594,6 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * const struct wined3d_gl_info *gl_info = context_gl->gl_info; const BOOL legacy_syntax = needs_legacy_glsl_syntax(gl_info); BOOL tempreg_used = FALSE, tfactor_used = FALSE; - UINT lowest_disabled_stage; GLuint shader_id; DWORD arg0, arg1, arg2; unsigned int stage; @@ -9660,7 +9659,6 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * if (arg0 == WINED3DTA_CONSTANT || arg1 == WINED3DTA_CONSTANT || arg2 == WINED3DTA_CONSTANT) tss_const_map |= 1u << stage; } - lowest_disabled_stage = stage;
shader_glsl_add_version_declaration(buffer, gl_info);
@@ -9799,9 +9797,6 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * if (legacy_syntax && settings->fog != WINED3D_FFP_PS_FOG_OFF) shader_addline(buffer, "ffp_varying_fogcoord = gl_FogFragCoord;\n");
- if (lowest_disabled_stage < 7 && settings->emul_clipplanes) - shader_addline(buffer, "if (any(lessThan(ffp_texcoord[7], vec4(0.0)))) discard;\n"); - /* Generate texture sampling instructions */ for (stage = 0; stage < WINED3D_MAX_FFP_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage) { @@ -11373,8 +11368,7 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s /* Ideally we'd only set caps like sRGB writes here if supported by both * the shader backend and the fragment pipe, but we can get called before * shader_glsl_alloc(). */ - caps->wined3d_caps = WINED3D_SHADER_CAP_VS_CLIPPING - | WINED3D_SHADER_CAP_SRGB_WRITE; + caps->wined3d_caps = WINED3D_SHADER_CAP_SRGB_WRITE; if (needs_interpolation_qualifiers_for_shader_outputs(gl_info)) caps->wined3d_caps |= WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION; if (shader_glsl_full_ffp_varyings(gl_info)) diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index 1079c19b99b..37fc1cb22d1 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1076,8 +1076,7 @@ static void shader_spirv_get_caps(const struct wined3d_adapter *adapter, struct caps->ps_uniform_count = WINED3D_MAX_PS_CONSTS_F; caps->ps_1x_max_value = FLT_MAX; caps->varying_count = 0; - caps->wined3d_caps = WINED3D_SHADER_CAP_VS_CLIPPING - | WINED3D_SHADER_CAP_SRGB_WRITE + caps->wined3d_caps = WINED3D_SHADER_CAP_SRGB_WRITE | WINED3D_SHADER_CAP_FULL_FFP_VARYINGS; }
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 7e4fe21e727..ef95c40135a 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6491,17 +6491,6 @@ void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, const st } } settings->sRGB_write = !d3d_info->srgb_write_control && needs_srgb_write(d3d_info, state, &state->fb); - if (d3d_info->vs_clipping || !use_vs(state) || !state->render_states[WINED3D_RS_CLIPPING] - || !state->render_states[WINED3D_RS_CLIPPLANEENABLE]) - { - /* No need to emulate clipplanes if GL supports native vertex shader clipping or if - * the fixed function vertex pipeline is used(which always supports clipplanes), or - * if no clipplane is enabled - */ - settings->emul_clipplanes = 0; - } else { - settings->emul_clipplanes = 1; - }
texture = wined3d_state_get_ffp_texture(state, 0); if (state->render_states[WINED3D_RS_COLORKEYENABLE] diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 34c820497ad..c762de4b5bf 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -222,7 +222,6 @@ struct wined3d_d3d_info uint32_t wined3d_creation_flags; uint32_t emulated_flatshading : 1; uint32_t ffp_alpha_test : 1; - uint32_t vs_clipping : 1; uint32_t shader_double_precision : 1; uint32_t shader_output_interpolation : 1; uint32_t viewport_array_index_any_shader : 1; @@ -1402,7 +1401,6 @@ BOOL shader_get_stream_output_register_info(const struct wined3d_shader *shader,
typedef void (*SHADER_HANDLER)(const struct wined3d_shader_instruction *);
-#define WINED3D_SHADER_CAP_VS_CLIPPING 0x00000001u #define WINED3D_SHADER_CAP_SRGB_WRITE 0x00000002u #define WINED3D_SHADER_CAP_DOUBLE_PRECISION 0x00000004u #define WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION 0x00000008u @@ -2669,9 +2667,8 @@ struct texture_stage_op struct ffp_frag_settings { struct texture_stage_op op[WINED3D_MAX_FFP_TEXTURES]; - enum wined3d_ffp_ps_fog_mode fog; + unsigned char fog; /* enum wined3d_ffp_ps_fog_mode */ unsigned char sRGB_write; - unsigned char emul_clipplanes; unsigned char texcoords_initialized; unsigned char color_key_enabled : 1; unsigned char pointsprite : 1;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/context_gl.c | 30 ------------------------------ dlls/wined3d/wined3d_gl.h | 1 - dlls/wined3d/wined3d_private.h | 3 +-- 3 files changed, 1 insertion(+), 33 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 8072ec15500..49d54d49e33 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -4874,18 +4874,6 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s TRACE("Draw completed.\n"); }
-void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - unsigned int texture_idx; - - for (texture_idx = 0; texture_idx < gl_info->limits.texture_coords; ++texture_idx) - { - gl_info->gl_ops.ext.p_glClientActiveTextureARB(GL_TEXTURE0_ARB + texture_idx); - gl_info->gl_ops.gl.p_glDisableClientState(GL_TEXTURE_COORD_ARRAY); - } -} - static const void *get_vertex_attrib_pointer(const struct wined3d_stream_info_element *element, const struct wined3d_state *state) { @@ -4896,22 +4884,6 @@ static const void *get_vertex_attrib_pointer(const struct wined3d_stream_info_el return offset; }
-/* This should match any arrays loaded in wined3d_context_gl_load_vertex_data(). */ -static void wined3d_context_gl_unload_vertex_data(struct wined3d_context_gl *context_gl) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - - if (!context_gl->c.namedArraysLoaded) - return; - gl_info->gl_ops.gl.p_glDisableClientState(GL_VERTEX_ARRAY); - gl_info->gl_ops.gl.p_glDisableClientState(GL_NORMAL_ARRAY); - gl_info->gl_ops.gl.p_glDisableClientState(GL_COLOR_ARRAY); - if (gl_info->supported[EXT_SECONDARY_COLOR]) - gl_info->gl_ops.gl.p_glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); - wined3d_context_gl_unload_tex_coords(context_gl); - context_gl->c.namedArraysLoaded = FALSE; -} - static void wined3d_context_gl_unload_numbered_array(struct wined3d_context_gl *context_gl, unsigned int i) { const struct wined3d_gl_info *gl_info = context_gl->gl_info; @@ -5164,7 +5136,6 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state) { - wined3d_context_gl_unload_vertex_data(context_gl); wined3d_context_gl_load_numbered_arrays(context_gl, &context_gl->c.stream_info, state); }
@@ -5243,7 +5214,6 @@ void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, GL_EXTCALL(glGenBuffers(1, &context_gl->blit_vbo)); GL_EXTCALL(glBindBuffer(GL_ARRAY_BUFFER, context_gl->blit_vbo));
- wined3d_context_gl_unload_vertex_data(context_gl); wined3d_context_gl_unload_numbered_arrays(context_gl);
GL_EXTCALL(glBufferData(GL_ARRAY_BUFFER, sizeof(quad), quad, GL_STREAM_DRAW)); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 1dfa4138894..060d92318f8 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -762,7 +762,6 @@ BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl); void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_gl); void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl); -void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl); void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges); void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c762de4b5bf..2d1bab87b00 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1930,11 +1930,10 @@ struct wined3d_context DWORD current : 1; DWORD destroyed : 1; DWORD destroy_delayed : 1; - DWORD namedArraysLoaded : 1; DWORD update_primitive_type : 1; DWORD update_patch_vertex_count : 1; DWORD update_multisample_state : 1; - DWORD padding : 13; + DWORD padding : 14;
DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */