From b38b973efb6ac12c444b8b60cd23763691a64ccd Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Mon, 23 Sep 2024 19:04:15 -0500 Subject: [PATCH] wined3d: Account for HLSL FFP shaders in find_ps_compile_args(). In most cases, it is possible to construct a D3D shader which behaves identically to a given FFP pipeline. There are two exceptions, related to fog and texture transforms, where the FFP pipeline has special behaviour that cannot be emulated with shaders, and we handle those here by checking whether our shader is actually an FFP replacement shader. --- dlls/wined3d/shader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index e3f758f4b9d..2a67f3944bd 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2854,6 +2854,7 @@ void find_gs_compile_args(const struct wined3d_state *state, const struct wined3 void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context) { + const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX]; const struct wined3d_d3d_info *d3d_info = context->d3d_info; struct wined3d_shader_resource_view *view; struct wined3d_texture *texture; @@ -2881,7 +2882,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 { uint32_t tex_transform = flags & ~WINED3D_TTFF_PROJECTED; - if (!state->shader[WINED3D_SHADER_TYPE_VERTEX]) + if (!vs || vs->is_ffp_vs) { enum wined3d_shader_resource_type resource_type = shader->reg_maps.resource_info[i].type; unsigned int j; @@ -3051,7 +3052,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 switch (state->render_states[WINED3D_RS_FOGTABLEMODE]) { case WINED3D_FOG_NONE: - if (position_transformed || use_vs(state)) + if (position_transformed || (vs && !vs->is_ffp_vs)) { args->fog = WINED3D_FFP_PS_FOG_LINEAR; break;