Commit 68e0cd43 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Ignore invalid texture transform flags.

parent fdd4df44
......@@ -1911,9 +1911,28 @@ void find_ps_compile_args(const struct wined3d_state *state,
for (i = 0; i < 4; ++i)
{
DWORD flags = state->texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS];
DWORD tex_transform = flags & ~WINED3DTTFF_PROJECTED;
DWORD count, tex_transform;
/* Filter some invalid flags */
count = flags & ~WINED3DTTFF_PROJECTED;
if (count > WINED3DTTFF_COUNT4)
{
WARN("The application set an invalid TEXTURETRANSFORMFLAGS value.\n");
flags = count = 0;
}
tex_transform = count;
if (flags & WINED3DTTFF_PROJECTED)
tex_transform |= WINED3D_PSARGS_PROJECTED;
{
enum wined3d_sampler_texture_type sampler_type = shader->reg_maps.sampler_type[i];
if ((sampler_type == WINED3DSTT_1D && tex_transform > WINED3DTTFF_COUNT1)
|| (sampler_type == WINED3DSTT_2D && tex_transform > WINED3DTTFF_COUNT2)
|| (sampler_type == WINED3DSTT_VOLUME && tex_transform > WINED3DTTFF_COUNT3))
tex_transform |= WINED3D_PSARGS_PROJECTED;
else
WARN("Application requested projected texture with unsuitable texture coordinates.\n");
}
args->tex_transform |= tex_transform << i * WINED3D_PSARGS_TEXTRANSFORM_SHIFT;
}
}
......
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