From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/adapter_vk.c | 21 --------------------- dlls/wined3d/context_gl.c | 6 ------ dlls/wined3d/cs.c | 11 ----------- dlls/wined3d/directx.c | 21 --------------------- dlls/wined3d/ffp_gl.c | 25 ------------------------- dlls/wined3d/texture.c | 15 --------------- dlls/wined3d/utils.c | 2 -- dlls/wined3d/view.c | 6 ------ dlls/wined3d/wined3d_private.h | 6 +----- 9 files changed, 1 insertion(+), 112 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 10c62c3b7ca..9cdd731bcf5 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -100,27 +100,6 @@ static const struct wined3d_state_entry_template misc_state_template_vk[] = {STATE_RENDER(WINED3D_RS_LINEPATTERN), {STATE_RENDER(WINED3D_RS_LINEPATTERN), state_nop}}, {STATE_RENDER(WINED3D_RS_DITHERENABLE), {STATE_RENDER(WINED3D_RS_DITHERENABLE), state_nop}}, {STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), {STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_nop}}, - /* Samplers */ - {STATE_SAMPLER(0), {STATE_SAMPLER(0), state_nop}}, - {STATE_SAMPLER(1), {STATE_SAMPLER(1), state_nop}}, - {STATE_SAMPLER(2), {STATE_SAMPLER(2), state_nop}}, - {STATE_SAMPLER(3), {STATE_SAMPLER(3), state_nop}}, - {STATE_SAMPLER(4), {STATE_SAMPLER(4), state_nop}}, - {STATE_SAMPLER(5), {STATE_SAMPLER(5), state_nop}}, - {STATE_SAMPLER(6), {STATE_SAMPLER(6), state_nop}}, - {STATE_SAMPLER(7), {STATE_SAMPLER(7), state_nop}}, - {STATE_SAMPLER(8), {STATE_SAMPLER(8), state_nop}}, - {STATE_SAMPLER(9), {STATE_SAMPLER(9), state_nop}}, - {STATE_SAMPLER(10), {STATE_SAMPLER(10), state_nop}}, - {STATE_SAMPLER(11), {STATE_SAMPLER(11), state_nop}}, - {STATE_SAMPLER(12), {STATE_SAMPLER(12), state_nop}}, - {STATE_SAMPLER(13), {STATE_SAMPLER(13), state_nop}}, - {STATE_SAMPLER(14), {STATE_SAMPLER(14), state_nop}}, - {STATE_SAMPLER(15), {STATE_SAMPLER(15), state_nop}}, - {STATE_SAMPLER(16), /* Vertex sampler 0 */ {STATE_SAMPLER(16), state_nop}}, - {STATE_SAMPLER(17), /* Vertex sampler 1 */ {STATE_SAMPLER(17), state_nop}}, - {STATE_SAMPLER(18), /* Vertex sampler 2 */ {STATE_SAMPLER(18), state_nop}}, - {STATE_SAMPLER(19), /* Vertex sampler 3 */ {STATE_SAMPLER(19), state_nop}}, {STATE_BASEVERTEXINDEX, {STATE_STREAMSRC}}, {STATE_FRAMEBUFFER, {STATE_FRAMEBUFFER, state_nop}}, {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), state_nop}}, diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index a894bc588c9..d1181c3cb1f 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -3206,7 +3206,6 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + sampler)); context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)); } - context_invalidate_state(context, STATE_SAMPLER(sampler)); } context_invalidate_compute_state(context, STATE_COMPUTE_SHADER_RESOURCE_BINDING); context_invalidate_state(context, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); @@ -3319,7 +3318,6 @@ void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_ { if (sampler < WINED3D_MAX_FFP_TEXTURES) context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)); - context_invalidate_state(context, STATE_SAMPLER(sampler)); } }
@@ -3708,7 +3706,6 @@ static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_contex if (context_gl->tex_unit_map[i] != i) { wined3d_context_gl_map_stage(context_gl, i, i); - context_invalidate_state(&context_gl->c, STATE_SAMPLER(i)); context_invalidate_state(&context_gl->c, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); context_invalidate_texture_stage(&context_gl->c, i); } @@ -3724,7 +3721,6 @@ static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_contex if (context_gl->tex_unit_map[i] != tex) { wined3d_context_gl_map_stage(context_gl, i, tex); - context_invalidate_state(&context_gl->c, STATE_SAMPLER(i)); context_invalidate_state(&context_gl->c, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); context_invalidate_texture_stage(&context_gl->c, i); } @@ -3745,7 +3741,6 @@ static void wined3d_context_gl_map_psamplers(struct wined3d_context_gl *context_ if (resource_info[i].type && context_gl->tex_unit_map[i] != i) { wined3d_context_gl_map_stage(context_gl, i, i); - context_invalidate_state(&context_gl->c, STATE_SAMPLER(i)); context_invalidate_state(&context_gl->c, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); if (i < d3d_info->ffp_fragment_caps.max_blend_stages) context_invalidate_texture_stage(&context_gl->c, i); @@ -3808,7 +3803,6 @@ static void wined3d_context_gl_map_vsamplers(struct wined3d_context_gl *context_ if (context_gl->tex_unit_map[vsampler_idx] != start) { wined3d_context_gl_map_stage(context_gl, vsampler_idx, start); - context_invalidate_state(&context_gl->c, STATE_SAMPLER(vsampler_idx)); context_invalidate_state(&context_gl->c, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); }
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 5ee4c8d1538..ebccc53951e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1575,10 +1575,6 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) } }
- if (op->shader_type == WINED3D_SHADER_TYPE_VERTEX) - device_invalidate_state(cs->c.device, STATE_SAMPLER(WINED3D_VERTEX_SAMPLER_OFFSET + op->bind_index)); - else - device_invalidate_state(cs->c.device, STATE_SAMPLER(op->bind_index)); device_invalidate_state(cs->c.device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING);
if (new_use_color_key != old_use_color_key) @@ -1696,15 +1692,8 @@ static void wined3d_cs_exec_set_samplers(struct wined3d_cs *cs, const void *data unsigned int i;
for (i = 0; i < op->count; ++i) - { cs->state.sampler[op->type][op->start_idx + i] = op->samplers[i];
- if (op->type == WINED3D_SHADER_TYPE_PIXEL && i < WINED3D_MAX_FRAGMENT_SAMPLERS) - device_invalidate_state(cs->c.device, STATE_SAMPLER(i)); - else if (op->type == WINED3D_SHADER_TYPE_VERTEX && i < WINED3D_MAX_VERTEX_SAMPLERS) - device_invalidate_state(cs->c.device, STATE_SAMPLER(WINED3D_VERTEX_SAMPLER_OFFSET + i)); - } - if (op->type != WINED3D_SHADER_TYPE_COMPUTE) device_invalidate_state(cs->c.device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b11d284c10b..67fd4b9d680 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2823,27 +2823,6 @@ static const struct wined3d_state_entry_template misc_state_template_no3d[] = {STATE_RENDER(WINED3D_RS_ZFUNC), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_DITHERENABLE), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), {STATE_VDECL}}, - /* Samplers */ - {STATE_SAMPLER(0), {STATE_VDECL}}, - {STATE_SAMPLER(1), {STATE_VDECL}}, - {STATE_SAMPLER(2), {STATE_VDECL}}, - {STATE_SAMPLER(3), {STATE_VDECL}}, - {STATE_SAMPLER(4), {STATE_VDECL}}, - {STATE_SAMPLER(5), {STATE_VDECL}}, - {STATE_SAMPLER(6), {STATE_VDECL}}, - {STATE_SAMPLER(7), {STATE_VDECL}}, - {STATE_SAMPLER(8), {STATE_VDECL}}, - {STATE_SAMPLER(9), {STATE_VDECL}}, - {STATE_SAMPLER(10), {STATE_VDECL}}, - {STATE_SAMPLER(11), {STATE_VDECL}}, - {STATE_SAMPLER(12), {STATE_VDECL}}, - {STATE_SAMPLER(13), {STATE_VDECL}}, - {STATE_SAMPLER(14), {STATE_VDECL}}, - {STATE_SAMPLER(15), {STATE_VDECL}}, - {STATE_SAMPLER(16), /* Vertex sampler 0 */ {STATE_VDECL}}, - {STATE_SAMPLER(17), /* Vertex sampler 1 */ {STATE_VDECL}}, - {STATE_SAMPLER(18), /* Vertex sampler 2 */ {STATE_VDECL}}, - {STATE_SAMPLER(19), /* Vertex sampler 3 */ {STATE_VDECL}}, {STATE_BASEVERTEXINDEX, {STATE_VDECL}}, {STATE_FRAMEBUFFER, {STATE_VDECL}}, {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), {STATE_VDECL}}, diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index c708197bf8e..ab0e5afab24 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -1032,10 +1032,6 @@ static void state_sample_mask_w(struct wined3d_context *context, const struct wi WARN("Unsupported in local OpenGL implementation: glSampleMaski.\n"); }
-static void sampler(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ -} - static void state_compute_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_COMPUTE; @@ -1575,27 +1571,6 @@ const struct wined3d_state_entry_template misc_state_template_gl[] = { STATE_RENDER(WINED3D_RS_DITHERENABLE), { STATE_RENDER(WINED3D_RS_DITHERENABLE), state_ditherenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa }, ARB_MULTISAMPLE }, { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE }, - /* Samplers */ - { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(2), { STATE_SAMPLER(2), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(3), { STATE_SAMPLER(3), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(4), { STATE_SAMPLER(4), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(5), { STATE_SAMPLER(5), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(6), { STATE_SAMPLER(6), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(7), { STATE_SAMPLER(7), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(8), { STATE_SAMPLER(8), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(9), { STATE_SAMPLER(9), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(10), { STATE_SAMPLER(10), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(11), { STATE_SAMPLER(11), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(12), { STATE_SAMPLER(12), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(13), { STATE_SAMPLER(13), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(14), { STATE_SAMPLER(14), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(15), { STATE_SAMPLER(15), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(16), /* Vertex sampler 0 */ { STATE_SAMPLER(16), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(17), /* Vertex sampler 1 */ { STATE_SAMPLER(17), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(18), /* Vertex sampler 2 */ { STATE_SAMPLER(18), sampler }, WINED3D_GL_EXT_NONE }, - { STATE_SAMPLER(19), /* Vertex sampler 3 */ { STATE_SAMPLER(19), sampler }, WINED3D_GL_EXT_NONE }, { STATE_BASEVERTEXINDEX, { STATE_BASEVERTEXINDEX, state_nop, }, ARB_DRAW_ELEMENTS_BASE_VERTEX }, { STATE_BASEVERTEXINDEX, { STATE_STREAMSRC, NULL, }, WINED3D_GL_EXT_NONE }, { STATE_FRAMEBUFFER, { STATE_FRAMEBUFFER, context_state_fb }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index b2f076264c6..49832f9fabf 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1403,21 +1403,6 @@ GLuint wined3d_texture_gl_prepare_gl_texture(struct wined3d_texture_gl *texture_ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, BOOL srgb) { - /* We don't need a specific texture unit, but after binding the texture - * the current unit is dirty. Read the unit back instead of switching to - * 0, this avoids messing around with the state manager's GL states. The - * current texture unit should always be a valid one. - * - * To be more specific, this is tricky because we can implicitly be - * called from sampler() in state.c. This means we can't touch anything - * other than whatever happens to be the currently active texture, or we - * would risk marking already applied sampler states dirty again. */ - if (context_gl->active_texture < ARRAY_SIZE(context_gl->rev_tex_unit_map)) - { - unsigned int active_sampler = context_gl->rev_tex_unit_map[context_gl->active_texture]; - if (active_sampler != WINED3D_UNMAPPED_STAGE) - context_invalidate_state(&context_gl->c, STATE_SAMPLER(active_sampler)); - } /* FIXME: Ideally we'd only do this when touching a binding that's used by * a shader. */ context_invalidate_compute_state(&context_gl->c, STATE_COMPUTE_SHADER_RESOURCE_BINDING); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 5e33066c8b8..2d576b77c66 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5347,8 +5347,6 @@ const char *debug_d3dstate(uint32_t state) return wine_dbg_sprintf("STATE_TEXTURESTAGE(%#x, %s)", texture_stage, debug_d3dtexturestate(texture_state)); } - if (STATE_IS_SAMPLER(state)) - return wine_dbg_sprintf("STATE_SAMPLER(%#x)", state - STATE_SAMPLER(0)); if (STATE_IS_COMPUTE_SHADER(state)) return wine_dbg_sprintf("STATE_SHADER(%s)", debug_shader_type(WINED3D_SHADER_TYPE_COMPUTE)); if (STATE_IS_GRAPHICS_SHADER(state)) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 0f597be397a..ca97f6258eb 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1310,12 +1310,6 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl static void shader_resource_view_gl_bind_and_dirtify(struct wined3d_shader_resource_view_gl *view_gl, struct wined3d_context_gl *context_gl) { - if (context_gl->active_texture < ARRAY_SIZE(context_gl->rev_tex_unit_map)) - { - unsigned int active_sampler = context_gl->rev_tex_unit_map[context_gl->active_texture]; - if (active_sampler != WINED3D_UNMAPPED_STAGE) - context_invalidate_state(&context_gl->c, STATE_SAMPLER(active_sampler)); - } /* FIXME: Ideally we'd only do this when touching a binding that's used by * a shader. */ context_invalidate_compute_state(&context_gl->c, STATE_COMPUTE_SHADER_RESOURCE_BINDING); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 757c6638645..35002309a42 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1729,11 +1729,7 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state #define STATE_IS_TEXTURESTAGE(a) \ ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE))
-/* + 1 because samplers start with 0 */ -#define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num)) -#define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(WINED3D_MAX_COMBINED_SAMPLERS - 1)) - -#define STATE_GRAPHICS_SHADER(a) (STATE_SAMPLER(WINED3D_MAX_COMBINED_SAMPLERS) + (a)) +#define STATE_GRAPHICS_SHADER(a) (STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (a)) #define STATE_IS_GRAPHICS_SHADER(a) \ ((a) >= STATE_GRAPHICS_SHADER(0) && (a) < STATE_GRAPHICS_SHADER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT))
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/adapter_vk.c | 1 - dlls/wined3d/context_gl.c | 6 ++++++ dlls/wined3d/directx.c | 1 - dlls/wined3d/ffp_gl.c | 23 ----------------------- dlls/wined3d/utils.c | 2 -- dlls/wined3d/wined3d_private.h | 5 +---- 6 files changed, 7 insertions(+), 31 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 9cdd731bcf5..1b0a402b233 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -44,7 +44,6 @@ static const struct wined3d_state_entry_template misc_state_template_vk[] = {STATE_DEPTH_BOUNDS, {STATE_DEPTH_BOUNDS, state_nop}}, {STATE_RASTERIZER, {STATE_RASTERIZER, state_nop}}, {STATE_SCISSORRECT, {STATE_SCISSORRECT, state_nop}}, - {STATE_POINTSPRITECOORDORIGIN, {STATE_POINTSPRITECOORDORIGIN, state_nop}},
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), state_nop}}, {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01), {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00)}}, diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index d1181c3cb1f..d066e7293a6 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2230,6 +2230,12 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi } }
+ if (!gl_info->supported[ARB_CLIP_CONTROL] && gl_info->supported[WINED3D_GL_VERSION_2_0]) + { + GL_EXTCALL(glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT)); + checkGLcall("glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT)"); + } + if (gl_info->supported[ARB_PROVOKING_VERTEX]) { GL_EXTCALL(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION)); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 67fd4b9d680..9df95bdea55 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2766,7 +2766,6 @@ static const struct wined3d_state_entry_template misc_state_template_no3d[] = {STATE_VDECL, {STATE_VDECL, state_nop}}, {STATE_RASTERIZER, {STATE_VDECL}}, {STATE_SCISSORRECT, {STATE_VDECL}}, - {STATE_POINTSPRITECOORDORIGIN, {STATE_VDECL}},
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}}, {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}}, diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index ab0e5afab24..e2b9be647d0 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -1318,25 +1318,6 @@ static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_ line_antialias(r, gl_info); }
-static void psorigin_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - static BOOL warned; - - if (!warned) - { - WARN("Point sprite coordinate origin switching not supported.\n"); - warned = TRUE; - } -} - -static void psorigin(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; - - GL_EXTCALL(glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT)); - checkGLcall("glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, ...)"); -} - void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; @@ -1510,9 +1491,6 @@ const struct wined3d_state_entry_template misc_state_template_gl[] = { STATE_RASTERIZER, { STATE_RASTERIZER, rasterizer_cc }, ARB_CLIP_CONTROL }, { STATE_RASTERIZER, { STATE_RASTERIZER, rasterizer }, WINED3D_GL_EXT_NONE }, { STATE_SCISSORRECT, { STATE_SCISSORRECT, scissorrect }, WINED3D_GL_EXT_NONE }, - { STATE_POINTSPRITECOORDORIGIN, { STATE_POINTSPRITECOORDORIGIN, state_nop }, ARB_CLIP_CONTROL }, - { STATE_POINTSPRITECOORDORIGIN, { STATE_POINTSPRITECOORDORIGIN, psorigin }, WINED3D_GL_VERSION_2_0 }, - { STATE_POINTSPRITECOORDORIGIN, { STATE_POINTSPRITECOORDORIGIN, psorigin_w }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), shader_bumpenv }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, WINED3D_GL_EXT_NONE }, @@ -1752,7 +1730,6 @@ static void validate_state_table(struct wined3d_state_entry *state_table) STATE_LIGHT_TYPE, STATE_SCISSORRECT, STATE_RASTERIZER, - STATE_POINTSPRITECOORDORIGIN, STATE_BASEVERTEXINDEX, STATE_FRAMEBUFFER, STATE_POINT_ENABLE, diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 2d576b77c66..642c5e64eee 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5387,8 +5387,6 @@ const char *debug_d3dstate(uint32_t state) return "STATE_RASTERIZER"; if (STATE_IS_DEPTH_BOUNDS(state)) return "STATE_DEPTH_BOUNDS"; - if (STATE_IS_POINTSPRITECOORDORIGIN(state)) - return "STATE_POINTSPRITECOORDORIGIN"; if (STATE_IS_BASEVERTEXINDEX(state)) return "STATE_BASEVERTEXINDEX"; if (STATE_IS_FRAMEBUFFER(state)) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 35002309a42..96762351f21 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1778,10 +1778,7 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state #define STATE_DEPTH_BOUNDS (STATE_RASTERIZER + 1) #define STATE_IS_DEPTH_BOUNDS(a) ((a) == STATE_DEPTH_BOUNDS)
-#define STATE_POINTSPRITECOORDORIGIN (STATE_DEPTH_BOUNDS + 1) -#define STATE_IS_POINTSPRITECOORDORIGIN(a) ((a) == STATE_POINTSPRITECOORDORIGIN) - -#define STATE_BASEVERTEXINDEX (STATE_POINTSPRITECOORDORIGIN + 1) +#define STATE_BASEVERTEXINDEX (STATE_DEPTH_BOUNDS + 1) #define STATE_IS_BASEVERTEXINDEX(a) ((a) == STATE_BASEVERTEXINDEX)
#define STATE_FRAMEBUFFER (STATE_BASEVERTEXINDEX + 1)
From: Elizabeth Figura zfigura@codeweavers.com
The GLSL blitter covers a superset of the same functionality. --- dlls/wined3d/context_gl.c | 143 ------------------------ dlls/wined3d/texture.c | 226 +------------------------------------- dlls/wined3d/wined3d_gl.h | 5 - 3 files changed, 6 insertions(+), 368 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index d066e7293a6..0692f957cb9 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -3261,107 +3261,6 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, checkGLcall("blit state application"); }
-static void wined3d_context_gl_apply_blit_projection(const struct wined3d_context_gl *context_gl, - unsigned int w, unsigned int h) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - const GLdouble projection[] = - { - 2.0 / w, 0.0, 0.0, 0.0, - 0.0, 2.0 / h, 0.0, 0.0, - 0.0, 0.0, 2.0, 0.0, - -1.0, -1.0, -1.0, 1.0, - }; - - gl_info->gl_ops.gl.p_glMatrixMode(GL_PROJECTION); - gl_info->gl_ops.gl.p_glLoadMatrixd(projection); -} - -/* Setup OpenGL states for fixed-function blitting. */ -/* Context activation is done by the caller. */ -void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_gl, - const struct wined3d_device *device) -{ - struct wined3d_context *context = &context_gl->c; - const struct wined3d_gl_info *gl_info; - unsigned int i, sampler; - - gl_info = context_gl->gl_info; - if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) - ERR("Applying fixed-function state without legacy context support.\n"); - - if (context->last_was_ffp_blit) - { - SIZE rt_size; - - wined3d_context_gl_get_rt_size(context_gl, &rt_size); - if (context_gl->blit_size.cx != rt_size.cx || context_gl->blit_size.cy != rt_size.cy) - wined3d_context_gl_apply_blit_projection(context_gl, rt_size.cx, rt_size.cy); - wined3d_context_gl_apply_blit_state(context_gl, device); - - checkGLcall("ffp blit state application"); - return; - } - context->last_was_ffp_blit = TRUE; - - wined3d_context_gl_apply_blit_state(context_gl, device); - - /* Disable all textures. The caller can then bind a texture it wants to blit - * from. */ - for (i = gl_info->limits.ffp_textures - 1; i > 0 ; --i) - { - wined3d_context_gl_active_texture(context_gl, gl_info, i); - - if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB); - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D); - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D); - - gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - - sampler = context_gl->rev_tex_unit_map[i]; - if (sampler != WINED3D_UNMAPPED_STAGE) - { - if (sampler < WINED3D_MAX_FFP_TEXTURES) - context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)); - } - } - - wined3d_context_gl_active_texture(context_gl, gl_info, 0); - - if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB); - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D); - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D); - - gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - if (gl_info->supported[EXT_TEXTURE_LOD_BIAS]) - gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0.0f); - - gl_info->gl_ops.gl.p_glMatrixMode(GL_TEXTURE); - gl_info->gl_ops.gl.p_glLoadIdentity(); - - /* Setup transforms. */ - gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW); - gl_info->gl_ops.gl.p_glLoadIdentity(); - context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0))); - wined3d_context_gl_apply_blit_projection(context_gl, context_gl->blit_size.cx, context_gl->blit_size.cy); - context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION)); - - /* Other misc states. */ - gl_info->gl_ops.gl.p_glDisable(GL_LIGHTING); - context_invalidate_state(context, STATE_RENDER(WINED3D_RS_LIGHTING)); - gl_info->p_glDisableWINE(GL_FOG); - context_invalidate_state(context, STATE_RENDER(WINED3D_RS_FOGENABLE)); - - if (gl_info->supported[EXT_SECONDARY_COLOR]) - { - gl_info->gl_ops.gl.p_glDisable(GL_COLOR_SUM_EXT); - context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SPECULARENABLE)); - } - checkGLcall("ffp blit state application"); -} - static BOOL have_framebuffer_attachment(unsigned int rt_count, struct wined3d_rendertarget_view * const *rts, const struct wined3d_rendertarget_view *ds) { @@ -5959,45 +5858,3 @@ void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, texture_gl->t.level_count - 1); wined3d_context_gl_bind_texture(context_gl, info.bind_target, 0); } - -/* Context activation is done by the caller. */ -void wined3d_context_gl_draw_textured_quad(struct wined3d_context_gl *context_gl, - struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - struct wined3d_blt_info info; - unsigned int level; - - texture2d_get_blt_info(texture_gl, sub_resource_idx, src_rect, &info); - - gl_info->gl_ops.gl.p_glEnable(info.bind_target); - checkGLcall("glEnable(bind_target)"); - - level = sub_resource_idx % texture_gl->t.level_count; - wined3d_context_gl_bind_texture(context_gl, info.bind_target, texture_gl->texture_rgb.name); - apply_texture_blit_state(gl_info, &texture_gl->texture_rgb, info.bind_target, level, filter); - gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, level); - gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - checkGLcall("glTexEnvi"); - - wined3d_context_gl_pause_transform_feedback(context_gl, FALSE); - - /* Draw a quad. */ - gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP); - gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[0].x); - gl_info->gl_ops.gl.p_glVertex2i(dst_rect->left, dst_rect->top); - - gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[1].x); - gl_info->gl_ops.gl.p_glVertex2i(dst_rect->right, dst_rect->top); - - gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[2].x); - gl_info->gl_ops.gl.p_glVertex2i(dst_rect->left, dst_rect->bottom); - - gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[3].x); - gl_info->gl_ops.gl.p_glVertex2i(dst_rect->right, dst_rect->bottom); - gl_info->gl_ops.gl.p_glEnd(); - - gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, texture_gl->t.level_count - 1); - wined3d_context_gl_bind_texture(context_gl, info.bind_target, 0); -} diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 49832f9fabf..86e4b603663 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -5612,91 +5612,6 @@ static void ffp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_ free(blitter); }
-static bool ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context, - const struct wined3d_resource *src_resource, DWORD src_location, - const struct wined3d_resource *dst_resource, DWORD dst_location) -{ - const struct wined3d_format *src_format = src_resource->format; - const struct wined3d_format *dst_format = dst_resource->format; - bool decompress; - - if (src_resource->type != WINED3D_RTYPE_TEXTURE_2D) - return false; - - decompress = (src_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) - && !(dst_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED); - if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) - { - TRACE("Source or destination resource is not GPU accessible.\n"); - return false; - } - - if (blit_op == WINED3D_BLIT_OP_RAW_BLIT && dst_format->id == src_format->id) - { - if (dst_format->depth_size || dst_format->stencil_size) - blit_op = WINED3D_BLIT_OP_DEPTH_BLIT; - else - blit_op = WINED3D_BLIT_OP_COLOR_BLIT; - } - - switch (blit_op) - { - case WINED3D_BLIT_OP_COLOR_BLIT_CKEY: - if (context->d3d_info->ffp_fragment_caps.color_key) - { - TRACE("Colour keying requires converted textures.\n"); - return false; - } - case WINED3D_BLIT_OP_COLOR_BLIT: - case WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST: - if (!wined3d_context_gl_const(context)->gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) - return false; - - if (TRACE_ON(d3d)) - { - TRACE("Checking support for fixup:\n"); - dump_color_fixup_desc(src_format->color_fixup); - } - - /* We only support identity conversions. */ - if (!is_identity_fixup(src_format->color_fixup) - || !is_identity_fixup(dst_format->color_fixup)) - { - if (dst_format->id == src_format->id && dst_location == WINED3D_LOCATION_DRAWABLE) - { - if (context->device->shader_backend == &none_shader_backend) - WARN("Claiming fixup support because of no shader backend.\n"); - return true; - } - else - { - TRACE("Fixups are not supported.\n"); - return false; - } - } - - if (!(dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET)) - { - if (dst_format->id == src_format->id && dst_location == WINED3D_LOCATION_DRAWABLE) - { - if (context->device->shader_backend == &none_shader_backend) - WARN("Claiming !render_target support because of no shader backend.\n"); - return true; - } - else - { - TRACE("Can only blit to render targets.\n"); - return false; - } - } - return true; - - default: - TRACE("Unsupported blit operation %#x.\n", blit_op); - return false; - } -} - static bool is_full_clear(const struct wined3d_rendertarget_view *rtv, const RECT *draw_rect, const RECT *clear_rect) { unsigned int height = rtv->height; @@ -6057,146 +5972,17 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format) { - struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture); - struct wined3d_context_gl *context_gl = wined3d_context_gl(context); - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - struct wined3d_resource *src_resource, *dst_resource; - struct wined3d_texture *staging_texture = NULL; - struct wined3d_color_key old_blt_key; - struct wined3d_device *device; struct wined3d_blitter *next; - DWORD old_colour_key_flags; - RECT r; - - src_resource = &src_texture->resource; - dst_resource = &dst_texture->resource; - device = dst_resource->device; - - if (!ffp_blit_supported(op, context, src_resource, src_location, dst_resource, dst_location)) - { - if ((next = blitter->next)) - return next->ops->blitter_blit(next, op, context, src_texture, src_sub_resource_idx, src_location, - src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key, filter, - resolve_format); - } - - TRACE("Blt from texture %p, %u to rendertarget %p, %u.\n", - src_texture, src_sub_resource_idx, dst_texture, dst_sub_resource_idx); - - old_blt_key = src_texture->async.src_blt_color_key; - old_colour_key_flags = src_texture->async.color_key_flags; - wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT, colour_key); - - if (!(src_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU)) - { - struct wined3d_resource_desc desc; - struct wined3d_box upload_box; - unsigned int src_level; - HRESULT hr; - - TRACE("Source texture is not GPU accessible, creating a staging texture.\n"); - - src_level = src_sub_resource_idx % src_texture->level_count; - desc.resource_type = WINED3D_RTYPE_TEXTURE_2D; - desc.format = src_texture->resource.format->id; - desc.multisample_type = src_texture->resource.multisample_type; - desc.multisample_quality = src_texture->resource.multisample_quality; - desc.usage = WINED3DUSAGE_CS; - desc.bind_flags = 0; - desc.access = WINED3D_RESOURCE_ACCESS_GPU; - desc.width = wined3d_texture_get_level_width(src_texture, src_level); - desc.height = wined3d_texture_get_level_height(src_texture, src_level); - desc.depth = 1; - desc.size = 0; - - if (FAILED(hr = wined3d_texture_create(device, &desc, 1, 1, 0, - NULL, NULL, &wined3d_null_parent_ops, &staging_texture))) - { - ERR("Failed to create staging texture, hr %#lx.\n", hr); - return dst_location; - } - - wined3d_box_set(&upload_box, 0, 0, desc.width, desc.height, 0, desc.depth); - wined3d_texture_upload_from_texture(staging_texture, 0, 0, 0, 0, - src_texture, src_sub_resource_idx, &upload_box); - - src_texture = staging_texture; - src_texture_gl = wined3d_texture_gl(src_texture); - src_sub_resource_idx = 0; - } - else - { - /* Make sure the surface is up-to-date. This should probably use - * surface_load_location() and worry about the destination surface - * too, unless we're overwriting it completely. */ - wined3d_texture_load(src_texture, context, FALSE); - } - - if (wined3d_texture_is_full_rect(dst_texture, dst_sub_resource_idx % dst_texture->level_count, dst_rect)) - wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location); - else - wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, dst_location);
- context_gl_apply_texture_draw_state(context_gl, dst_texture, dst_sub_resource_idx, dst_location); - wined3d_context_gl_apply_ffp_blit_state(context_gl, device); - - if (dst_location == WINED3D_LOCATION_DRAWABLE) - { - r = *dst_rect; - wined3d_texture_translate_drawable_coords(dst_texture, context_gl->window, &r); - dst_rect = &r; - } - - gl_info->gl_ops.gl.p_glEnable(src_texture_gl->target); - checkGLcall("glEnable(target)"); - - if (op == WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST || colour_key) - { - gl_info->gl_ops.gl.p_glEnable(GL_ALPHA_TEST); - checkGLcall("glEnable(GL_ALPHA_TEST)"); - } - - if (colour_key) - { - /* For P8 surfaces, the alpha component contains the palette index. - * Which means that the colourkey is one of the palette entries. In - * other cases pixels that should be masked away have alpha set to 0. */ - if (src_texture->resource.format->id == WINED3DFMT_P8_UINT) - gl_info->gl_ops.gl.p_glAlphaFunc(GL_NOTEQUAL, - (float)src_texture->async.src_blt_color_key.color_space_low_value / 255.0f); - else - gl_info->gl_ops.gl.p_glAlphaFunc(GL_NOTEQUAL, 0.0f); - checkGLcall("glAlphaFunc"); - } - - wined3d_context_gl_draw_textured_quad(context_gl, src_texture_gl, - src_sub_resource_idx, src_rect, dst_rect, filter); - - if (op == WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST || colour_key) - { - gl_info->gl_ops.gl.p_glDisable(GL_ALPHA_TEST); - checkGLcall("glDisable(GL_ALPHA_TEST)"); - } - - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D); - checkGLcall("glDisable(GL_TEXTURE_2D)"); - if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) + if (!(next = blitter->next)) { - gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB); - checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)"); + ERR("No blitter to handle blit op %#x.\n", op); + return dst_location; }
- if (dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture) - gl_info->gl_ops.gl.p_glFlush(); - - /* Restore the colour key parameters */ - wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT, - (old_colour_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); - - if (staging_texture) - wined3d_texture_decref(staging_texture); - - return dst_location; + return next->ops->blitter_blit(next, op, context, src_texture, src_sub_resource_idx, src_location, + src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key, filter, + resolve_format); }
static const struct wined3d_blitter_ops ffp_blitter_ops = diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 49e68d09b3a..52d3b01b8cd 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -736,8 +736,6 @@ BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl, void wined3d_context_gl_apply_fbo_state_explicit(struct wined3d_context_gl *context_gl, GLenum target, struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location); -void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_gl, - const struct wined3d_device *device); void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name); void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *context_gl); void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name); @@ -750,9 +748,6 @@ void wined3d_context_gl_destroy_bo(struct wined3d_context_gl *context_gl, struct void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter); -void wined3d_context_gl_draw_textured_quad(struct wined3d_context_gl *context_gl, - struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter); void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t mask); void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *context_gl); void wined3d_context_gl_flush_bo_address(struct wined3d_context_gl *context_gl,
From: Elizabeth Figura zfigura@codeweavers.com
Only the FFP vertex pipe needed these. --- dlls/wined3d/context_gl.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 0692f957cb9..ad6334016ec 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -3174,7 +3174,6 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, { struct wined3d_context *context = &context_gl->c; const struct wined3d_gl_info *gl_info; - unsigned int sampler; SIZE rt_size;
TRACE("Setting up context %p for blitting.\n", context); @@ -3204,15 +3203,6 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, GL_EXTCALL(glBindSampler(0, 0)); wined3d_context_gl_active_texture(context_gl, gl_info, 0);
- sampler = context_gl->rev_tex_unit_map[0]; - if (sampler != WINED3D_UNMAPPED_STAGE) - { - if (sampler < WINED3D_MAX_FFP_TEXTURES) - { - context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + sampler)); - context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)); - } - } context_invalidate_compute_state(context, STATE_COMPUTE_SHADER_RESOURCE_BINDING); context_invalidate_state(context, STATE_GRAPHICS_SHADER_RESOURCE_BINDING);
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/glsl_shader.c | 1 - dlls/wined3d/utils.c | 120 ++++++++++----------------------- dlls/wined3d/wined3d_private.h | 1 - 3 files changed, 34 insertions(+), 88 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index bf6f49d3f62..24bbe1cc6a8 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -12132,7 +12132,6 @@ static void glsl_fragment_pipe_get_caps(const struct wined3d_adapter *adapter, s const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
memset(caps, 0, sizeof(*caps)); - caps->proj_control = true; caps->srgb_write = true; caps->color_key = true; caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 642c5e64eee..91355438378 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5701,7 +5701,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
/* Setup this textures matrix according to the texture flags. */ static void compute_texture_matrix(const struct wined3d_matrix *matrix, uint32_t flags, BOOL calculated_coords, - BOOL transformed, enum wined3d_format_id format_id, BOOL ffp_proj_control, struct wined3d_matrix *out_matrix) + BOOL transformed, enum wined3d_format_id format_id, struct wined3d_matrix *out_matrix) { struct wined3d_matrix mat;
@@ -5719,92 +5719,41 @@ static void compute_texture_matrix(const struct wined3d_matrix *matrix, uint32_t
mat = *matrix;
- if (flags & WINED3D_TTFF_PROJECTED) + /* Under Direct3D the R/Z coord can be used for translation, under + * OpenGL we use the Q coord instead. */ + if (!(flags & WINED3D_TTFF_PROJECTED) && !calculated_coords) { - if (!ffp_proj_control) + switch (format_id) { - switch (flags & ~WINED3D_TTFF_PROJECTED) - { - case WINED3D_TTFF_COUNT2: - mat._14 = mat._12; - mat._24 = mat._22; - mat._34 = mat._32; - mat._44 = mat._42; - mat._12 = mat._22 = mat._32 = mat._42 = 0.0f; - break; - case WINED3D_TTFF_COUNT3: - mat._14 = mat._13; - mat._24 = mat._23; - mat._34 = mat._33; - mat._44 = mat._43; - mat._13 = mat._23 = mat._33 = mat._43 = 0.0f; - break; - } - } - } - else - { - /* Under Direct3D the R/Z coord can be used for translation, under - * OpenGL we use the Q coord instead. */ - if (!calculated_coords) - { - switch (format_id) - { - /* Direct3D passes the default 1.0 in the 2nd coord, while GL - * passes it in the 4th. Swap 2nd and 4th coord. No need to - * store the value of mat._41 in mat._21 because the input - * value to the transformation will be 0, so the matrix value - * is irrelevant. */ - case WINED3DFMT_R32_FLOAT: - mat._41 = mat._21; - mat._42 = mat._22; - mat._43 = mat._23; - mat._44 = mat._24; - break; - /* See above, just 3rd and 4th coord. */ - case WINED3DFMT_R32G32_FLOAT: - mat._41 = mat._31; - mat._42 = mat._32; - mat._43 = mat._33; - mat._44 = mat._34; - break; - case WINED3DFMT_R32G32B32_FLOAT: /* Opengl defaults match dx defaults */ - case WINED3DFMT_R32G32B32A32_FLOAT: /* No defaults apply, all app defined */ + /* Direct3D passes the default 1.0 in the 2nd coord, while GL + * passes it in the 4th. Swap 2nd and 4th coord. No need to + * store the value of mat._41 in mat._21 because the input + * value to the transformation will be 0, so the matrix value + * is irrelevant. */ + case WINED3DFMT_R32_FLOAT: + mat._41 = mat._21; + mat._42 = mat._22; + mat._43 = mat._23; + mat._44 = mat._24; + break; + /* See above, just 3rd and 4th coord. */ + case WINED3DFMT_R32G32_FLOAT: + mat._41 = mat._31; + mat._42 = mat._32; + mat._43 = mat._33; + mat._44 = mat._34; + break; + case WINED3DFMT_R32G32B32_FLOAT: /* Opengl defaults match dx defaults */ + case WINED3DFMT_R32G32B32A32_FLOAT: /* No defaults apply, all app defined */
- /* This is to prevent swapping the matrix lines and put the default 4th coord = 1.0 - * into a bad place. The division elimination below will apply to make sure the - * 1.0 doesn't do anything bad. The caller will set this value if the stride is 0 - */ - case WINED3DFMT_UNKNOWN: /* No texture coords, 0/0/0/1 defaults are passed */ - break; - default: - FIXME("Unexpected fixed function texture coord input\n"); - } - } - if (!ffp_proj_control) - { - switch (flags & ~WINED3D_TTFF_PROJECTED) - { - /* case WINED3D_TTFF_COUNT1: Won't ever get here. */ - case WINED3D_TTFF_COUNT2: - mat._13 = mat._23 = mat._33 = mat._43 = 0.0f; - /* OpenGL divides the first 3 vertex coordinates by the 4th by - * default, which is essentially the same as D3DTTFF_PROJECTED. - * Make sure that the 4th coordinate evaluates to 1.0 to - * eliminate that. - * - * If the fixed function pipeline is used, the 4th value - * remains unused, so there is no danger in doing this. With - * vertex shaders we have a problem. Should an application hit - * that problem, the code here would have to check for pixel - * shaders, and the shader has to undo the default GL divide. - * - * A more serious problem occurs if the application passes 4 - * coordinates in, and the 4th is != 1.0 (OpenGL default). - * This would have to be fixed with immediate mode draws. */ - default: - mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f; - } + /* This is to prevent swapping the matrix lines and put the default 4th coord = 1.0 + * into a bad place. The division elimination below will apply to make sure the + * 1.0 doesn't do anything bad. The caller will set this value if the stride is 0 + */ + case WINED3DFMT_UNKNOWN: /* No texture coords, 0/0/0/1 defaults are passed */ + break; + default: + FIXME("Unexpected fixed function texture coord input\n"); } }
@@ -5824,8 +5773,7 @@ void get_texture_matrix(const struct wined3d_context *context, const struct wine generated, context->stream_info.position_transformed, context->stream_info.use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)) ? context->stream_info.elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->id - : WINED3DFMT_UNKNOWN, - context->d3d_info->ffp_fragment_caps.proj_control, mat); + : WINED3DFMT_UNKNOWN, mat); }
void get_pointsize_minmax(const struct wined3d_context *context, const struct wined3d_state *state, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 96762351f21..1c70b65dd8c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -197,7 +197,6 @@ struct fragment_caps unsigned int TextureOpCaps; unsigned int max_blend_stages; unsigned int max_textures; - bool proj_control; bool srgb_write; bool color_key; };
This merge request was approved by Jan Sikorski.