From: Elizabeth Figura zfigura@codeweavers.com
We still need to pass them through the CS, for the sake of wined3d_ffp_vs_settings and ffp_frag_settings. --- dlls/wined3d/shader.c | 9 ++++----- dlls/wined3d/stateblock.c | 6 ++++++ dlls/wined3d/wined3d_private.h | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 6c198f9d23b..728a5204f39 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2893,7 +2893,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 { for (i = 0; i < shader->limits->sampler; ++i) { - uint32_t flags = state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS]; + uint32_t flags = state->extra_ps_args.texture_transform_flags[i];
if (flags & WINED3D_TTFF_PROJECTED) { @@ -2903,7 +2903,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 { enum wined3d_shader_resource_type resource_type = shader->reg_maps.resource_info[i].type; unsigned int j; - unsigned int index = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; + unsigned int index = state->extra_ps_args.texcoord_index[i]; uint32_t max_valid = WINED3D_TTFF_COUNT4;
for (j = 0; j < state->vertex_declaration->element_count; ++j) @@ -3095,10 +3095,9 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 else { const struct wined3d_stream_info *si = &context->stream_info; - unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; + unsigned int coord_idx = state->extra_ps_args.texcoord_index[i];
- if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT) - & WINED3D_FFP_TCI_MASK + if (((state->extra_ps_args.texcoord_index[i] >> WINED3D_FFP_TCI_SHIFT) & WINED3D_FFP_TCI_MASK) || (coord_idx < WINED3D_MAX_FFP_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) args->texcoords_initialized |= 1u << i; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index c4f0ae1fed0..c89fa9df0c6 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1781,6 +1781,7 @@ void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock case WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS: stateblock->changed.texture_matrices = 1; stateblock->changed.ffp_ps_settings = 1; + stateblock->changed.extra_ps_args = 1; break;
case WINED3D_TSS_ALPHA_ARG0: @@ -3970,6 +3971,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, args.fog_enable = state->rs[WINED3D_RS_FOGENABLE]; args.fog_mode = state->rs[WINED3D_RS_FOGTABLEMODE]; args.alpha_func = state->rs[WINED3D_RS_ALPHATESTENABLE] ? state->rs[WINED3D_RS_ALPHAFUNC] : WINED3D_CMP_ALWAYS; + for (unsigned int i = 0; i < 4; ++i) + { + args.texture_transform_flags[i] = state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS]; + args.texcoord_index[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; + } wined3d_device_context_emit_set_extra_ps_args(context, &args); }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d9f8c939194..0bb86cc8b9c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2880,6 +2880,9 @@ struct wined3d_extra_ps_args bool fog_enable; enum wined3d_fog_mode fog_mode; enum wined3d_cmp_func alpha_func; + uint32_t texcoord_index[WINED3D_MAX_FFP_TEXTURES]; + /* These flags are only relevant to 1.1-1.3, which only allow 4 textures. */ + uint32_t texture_transform_flags[4]; };
struct wined3d_blend_state