Module: wine Branch: master Commit: 02b3a8cb7b7bcb3b1d375c66aa65a7a7b1e7cc99 URL: https://gitlab.winehq.org/wine/wine/-/commit/02b3a8cb7b7bcb3b1d375c66aa65a7a...
Author: Zebediah Figura zfigura@codeweavers.com Date: Tue Nov 21 12:51:41 2023 -0600
wined3d: Revert uses of wined3d_state_get_ffp_texture() for non-FFP textures.
This fixes a crash when loading a world in Spore.
Fixes: 831a41ee34b6ed5974db7a0864e7aeac34c936a9
---
dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 4941fd40057..6169d0d0c02 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -490,7 +490,7 @@ static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info while (active) { i = wined3d_bit_scan(&active); - if (!(tex = wined3d_state_get_ffp_texture(state, i))) + if (!(tex = state->textures[i])) { ERR("Nonexistent texture is flagged for NP2 texcoord fixup.\n"); continue; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index ba84131b9d8..ed6f2bb8e83 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1299,7 +1299,7 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps
for (i = 0; fixup; fixup >>= 1, ++i) { - const struct wined3d_texture *tex = wined3d_state_get_ffp_texture(state, i); + const struct wined3d_texture *tex = state->textures[i]; unsigned char idx = ps->np2_fixup_info->idx[i];
if (!tex) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index ee58559a96c..b58546db875 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2858,7 +2858,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 /* Treat unbound textures as 2D. The dummy texture will provide * the proper sample value. The tex_types bitmap defaults to * 2D because of the memset. */ - if (!(texture = wined3d_state_get_ffp_texture(state, i))) + if (!(texture = state->textures[i])) continue;
switch (wined3d_texture_gl(texture)->target) @@ -2900,7 +2900,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 break; }
- if ((texture = wined3d_state_get_ffp_texture(state, i))) + if ((texture = state->textures[i])) { /* Star Wars: The Old Republic uses mismatched samplers for rendering water. */ if (texture->resource.type == WINED3D_RTYPE_TEXTURE_2D @@ -2930,7 +2930,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 if (!shader->reg_maps.resource_info[i].type) continue;
- if (!(texture = wined3d_state_get_ffp_texture(state, i))) + if (!(texture = state->textures[i])) { args->color_fixup[i] = COLOR_FIXUP_IDENTITY; continue;