Commit 02b3a8cb authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Revert uses of wined3d_state_get_ffp_texture() for non-FFP textures.

This fixes a crash when loading a world in Spore. Fixes: 831a41ee
parent bdc61326
...@@ -490,7 +490,7 @@ static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info ...@@ -490,7 +490,7 @@ static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info
while (active) while (active)
{ {
i = wined3d_bit_scan(&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"); ERR("Nonexistent texture is flagged for NP2 texcoord fixup.\n");
continue; continue;
......
...@@ -1299,7 +1299,7 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps ...@@ -1299,7 +1299,7 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps
for (i = 0; fixup; fixup >>= 1, ++i) 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]; unsigned char idx = ps->np2_fixup_info->idx[i];
if (!tex) if (!tex)
......
...@@ -2858,7 +2858,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 ...@@ -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 /* Treat unbound textures as 2D. The dummy texture will provide
* the proper sample value. The tex_types bitmap defaults to * the proper sample value. The tex_types bitmap defaults to
* 2D because of the memset. */ * 2D because of the memset. */
if (!(texture = wined3d_state_get_ffp_texture(state, i))) if (!(texture = state->textures[i]))
continue; continue;
switch (wined3d_texture_gl(texture)->target) switch (wined3d_texture_gl(texture)->target)
...@@ -2900,7 +2900,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 ...@@ -2900,7 +2900,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
break; 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. */ /* Star Wars: The Old Republic uses mismatched samplers for rendering water. */
if (texture->resource.type == WINED3D_RTYPE_TEXTURE_2D 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 ...@@ -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) if (!shader->reg_maps.resource_info[i].type)
continue; continue;
if (!(texture = wined3d_state_get_ffp_texture(state, i))) if (!(texture = state->textures[i]))
{ {
args->color_fixup[i] = COLOR_FIXUP_IDENTITY; args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment