wined3d: Get rid of the WINED3DSAMPLERSTATETYPE typedef.

This commit is contained in:
Henri Verbeet 2012-01-08 21:14:59 +01:00 committed by Alexandre Julliard
parent f1e2c5df93
commit 08545dc739
9 changed files with 129 additions and 130 deletions

View File

@ -1746,19 +1746,19 @@ tss_lookup[] =
{FALSE, WINED3DTSS_BUMPENVMAT11}, /* 10, D3DTSS_BUMPENVMAT11 */
{FALSE, WINED3DTSS_TEXCOORDINDEX}, /* 11, D3DTSS_TEXCOORDINDEX */
{FALSE, WINED3DTSS_FORCE_DWORD}, /* 12, unused */
{TRUE, WINED3DSAMP_ADDRESSU}, /* 13, D3DTSS_ADDRESSU */
{TRUE, WINED3DSAMP_ADDRESSV}, /* 14, D3DTSS_ADDRESSV */
{TRUE, WINED3DSAMP_BORDERCOLOR}, /* 15, D3DTSS_BORDERCOLOR */
{TRUE, WINED3DSAMP_MAGFILTER}, /* 16, D3DTSS_MAGFILTER */
{TRUE, WINED3DSAMP_MINFILTER}, /* 17, D3DTSS_MINFILTER */
{TRUE, WINED3DSAMP_MIPFILTER}, /* 18, D3DTSS_MIPFILTER */
{TRUE, WINED3DSAMP_MIPMAPLODBIAS}, /* 19, D3DTSS_MIPMAPLODBIAS */
{TRUE, WINED3DSAMP_MAXMIPLEVEL}, /* 20, D3DTSS_MAXMIPLEVEL */
{TRUE, WINED3DSAMP_MAXANISOTROPY}, /* 21, D3DTSS_MAXANISOTROPY */
{TRUE, WINED3D_SAMP_ADDRESS_U}, /* 13, D3DTSS_ADDRESSU */
{TRUE, WINED3D_SAMP_ADDRESS_V}, /* 14, D3DTSS_ADDRESSV */
{TRUE, WINED3D_SAMP_BORDER_COLOR}, /* 15, D3DTSS_BORDERCOLOR */
{TRUE, WINED3D_SAMP_MAG_FILTER}, /* 16, D3DTSS_MAGFILTER */
{TRUE, WINED3D_SAMP_MIN_FILTER}, /* 17, D3DTSS_MINFILTER */
{TRUE, WINED3D_SAMP_MIP_FILTER}, /* 18, D3DTSS_MIPFILTER */
{TRUE, WINED3D_SAMP_MIPMAP_LOD_BIAS}, /* 19, D3DTSS_MIPMAPLODBIAS */
{TRUE, WINED3D_SAMP_MAX_MIP_LEVEL}, /* 20, D3DTSS_MAXMIPLEVEL */
{TRUE, WINED3D_SAMP_MAX_ANISOTROPY}, /* 21, D3DTSS_MAXANISOTROPY */
{FALSE, WINED3DTSS_BUMPENVLSCALE}, /* 22, D3DTSS_BUMPENVLSCALE */
{FALSE, WINED3DTSS_BUMPENVLOFFSET}, /* 23, D3DTSS_BUMPENVLOFFSET */
{FALSE, WINED3DTSS_TEXTURETRANSFORMFLAGS}, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
{TRUE, WINED3DSAMP_ADDRESSW}, /* 25, D3DTSS_ADDRESSW */
{TRUE, WINED3D_SAMP_ADDRESS_W}, /* 25, D3DTSS_ADDRESSW */
{FALSE, WINED3DTSS_COLORARG0}, /* 26, D3DTSS_COLORARG0 */
{FALSE, WINED3DTSS_ALPHAARG0}, /* 27, D3DTSS_ALPHAARG0 */
{FALSE, WINED3DTSS_RESULTARG}, /* 28, D3DTSS_RESULTARG */

View File

@ -2356,7 +2356,7 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
{
WINED3DTEXTUREFILTERTYPE tex_mag;
hr = wined3d_device_get_sampler_state(This->wined3d_device, 0, WINED3DSAMP_MAGFILTER, &tex_mag);
hr = wined3d_device_get_sampler_state(This->wined3d_device, 0, WINED3D_SAMP_MAG_FILTER, &tex_mag);
switch (tex_mag)
{
@ -2379,14 +2379,14 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
WINED3DTEXTUREFILTERTYPE tex_mip;
hr = wined3d_device_get_sampler_state(This->wined3d_device,
0, WINED3DSAMP_MINFILTER, &tex_min);
0, WINED3D_SAMP_MIN_FILTER, &tex_min);
if (FAILED(hr))
{
wined3d_mutex_unlock();
return hr;
}
hr = wined3d_device_get_sampler_state(This->wined3d_device,
0, WINED3DSAMP_MIPFILTER, &tex_mip);
0, WINED3D_SAMP_MIP_FILTER, &tex_mip);
switch (tex_min)
{
@ -2437,11 +2437,11 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
case D3DRENDERSTATE_TEXTUREADDRESS:
case D3DRENDERSTATE_TEXTUREADDRESSU:
hr = wined3d_device_get_sampler_state(This->wined3d_device,
0, WINED3DSAMP_ADDRESSU, Value);
0, WINED3D_SAMP_ADDRESS_U, Value);
break;
case D3DRENDERSTATE_TEXTUREADDRESSV:
hr = wined3d_device_get_sampler_state(This->wined3d_device,
0, WINED3DSAMP_ADDRESSV, Value);
0, WINED3D_SAMP_ADDRESS_V, Value);
break;
case D3DRENDERSTATE_BORDERCOLOR:
@ -2688,7 +2688,7 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
break;
}
hr = wined3d_device_set_sampler_state(This->wined3d_device, 0, WINED3DSAMP_MAGFILTER, tex_mag);
hr = wined3d_device_set_sampler_state(This->wined3d_device, 0, WINED3D_SAMP_MAG_FILTER, tex_mag);
break;
}
@ -2732,23 +2732,23 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
}
wined3d_device_set_sampler_state(This->wined3d_device,
0, WINED3DSAMP_MIPFILTER, tex_mip);
0, WINED3D_SAMP_MIP_FILTER, tex_mip);
hr = wined3d_device_set_sampler_state(This->wined3d_device,
0, WINED3DSAMP_MINFILTER, tex_min);
0, WINED3D_SAMP_MIN_FILTER, tex_min);
break;
}
case D3DRENDERSTATE_TEXTUREADDRESS:
wined3d_device_set_sampler_state(This->wined3d_device,
0, WINED3DSAMP_ADDRESSV, Value);
0, WINED3D_SAMP_ADDRESS_V, Value);
/* Drop through */
case D3DRENDERSTATE_TEXTUREADDRESSU:
hr = wined3d_device_set_sampler_state(This->wined3d_device,
0, WINED3DSAMP_ADDRESSU, Value);
0, WINED3D_SAMP_ADDRESS_U, Value);
break;
case D3DRENDERSTATE_TEXTUREADDRESSV:
hr = wined3d_device_set_sampler_state(This->wined3d_device,
0, WINED3DSAMP_ADDRESSV, Value);
0, WINED3D_SAMP_ADDRESS_V, Value);
break;
case D3DRENDERSTATE_BORDERCOLOR:
@ -4794,16 +4794,16 @@ tss_lookup[] =
{FALSE, WINED3DTSS_BUMPENVMAT10}, /* 9, D3DTSS_BUMPENVMAT10 */
{FALSE, WINED3DTSS_BUMPENVMAT11}, /* 10, D3DTSS_BUMPENVMAT11 */
{FALSE, WINED3DTSS_TEXCOORDINDEX}, /* 11, D3DTSS_TEXCOORDINDEX */
{TRUE, WINED3DSAMP_ADDRESSU}, /* 12, D3DTSS_ADDRESS */
{TRUE, WINED3DSAMP_ADDRESSU}, /* 13, D3DTSS_ADDRESSU */
{TRUE, WINED3DSAMP_ADDRESSV}, /* 14, D3DTSS_ADDRESSV */
{TRUE, WINED3DSAMP_BORDERCOLOR}, /* 15, D3DTSS_BORDERCOLOR */
{TRUE, WINED3DSAMP_MAGFILTER}, /* 16, D3DTSS_MAGFILTER */
{TRUE, WINED3DSAMP_MINFILTER}, /* 17, D3DTSS_MINFILTER */
{TRUE, WINED3DSAMP_MIPFILTER}, /* 18, D3DTSS_MIPFILTER */
{TRUE, WINED3DSAMP_MIPMAPLODBIAS}, /* 19, D3DTSS_MIPMAPLODBIAS */
{TRUE, WINED3DSAMP_MAXMIPLEVEL}, /* 20, D3DTSS_MAXMIPLEVEL */
{TRUE, WINED3DSAMP_MAXANISOTROPY}, /* 21, D3DTSS_MAXANISOTROPY */
{TRUE, WINED3D_SAMP_ADDRESS_U}, /* 12, D3DTSS_ADDRESS */
{TRUE, WINED3D_SAMP_ADDRESS_U}, /* 13, D3DTSS_ADDRESSU */
{TRUE, WINED3D_SAMP_ADDRESS_V}, /* 14, D3DTSS_ADDRESSV */
{TRUE, WINED3D_SAMP_BORDER_COLOR}, /* 15, D3DTSS_BORDERCOLOR */
{TRUE, WINED3D_SAMP_MAG_FILTER}, /* 16, D3DTSS_MAGFILTER */
{TRUE, WINED3D_SAMP_MIN_FILTER}, /* 17, D3DTSS_MINFILTER */
{TRUE, WINED3D_SAMP_MIP_FILTER}, /* 18, D3DTSS_MIPFILTER */
{TRUE, WINED3D_SAMP_MIPMAP_LOD_BIAS}, /* 19, D3DTSS_MIPMAPLODBIAS */
{TRUE, WINED3D_SAMP_MAX_MIP_LEVEL}, /* 20, D3DTSS_MAXMIPLEVEL */
{TRUE, WINED3D_SAMP_MAX_ANISOTROPY}, /* 21, D3DTSS_MAXANISOTROPY */
{FALSE, WINED3DTSS_BUMPENVLSCALE}, /* 22, D3DTSS_BUMPENVLSCALE */
{FALSE, WINED3DTSS_BUMPENVLOFFSET}, /* 23, D3DTSS_BUMPENVLOFFSET */
{FALSE, WINED3DTSS_TEXTURETRANSFORMFLAGS}, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
@ -5025,7 +5025,7 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
}
case D3DTSS_ADDRESS:
wined3d_device_set_sampler_state(This->wined3d_device, Stage, WINED3DSAMP_ADDRESSV, State);
wined3d_device_set_sampler_state(This->wined3d_device, Stage, WINED3D_SAMP_ADDRESS_V, State);
break;
default:

View File

@ -465,7 +465,7 @@ static void device_preload_texture(const struct wined3d_state *state, unsigned i
enum WINED3DSRGB srgb;
if (!(texture = state->textures[idx])) return;
srgb = state->sampler_states[idx][WINED3DSAMP_SRGBTEXTURE] ? SRGB_SRGB : SRGB_RGB;
srgb = state->sampler_states[idx][WINED3D_SAMP_SRGB_TEXTURE] ? SRGB_SRGB : SRGB_RGB;
texture->texture_ops->texture_preload(texture, srgb);
}
@ -2455,7 +2455,7 @@ HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *devic
}
HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
UINT sampler_idx, WINED3DSAMPLERSTATETYPE state, DWORD value)
UINT sampler_idx, enum wined3d_sampler_state state, DWORD value)
{
DWORD old_value;
@ -2495,7 +2495,7 @@ HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
}
HRESULT CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device,
UINT sampler_idx, WINED3DSAMPLERSTATETYPE state, DWORD *value)
UINT sampler_idx, enum wined3d_sampler_state state, DWORD *value)
{
TRACE("device %p, sampler_idx %u, state %s, value %p.\n",
device, sampler_idx, debug_d3dsamplerstate(state), value);
@ -4465,12 +4465,12 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
{
if (state->sampler_states[i][WINED3DSAMP_MINFILTER] == WINED3DTEXF_NONE)
if (state->sampler_states[i][WINED3D_SAMP_MIN_FILTER] == WINED3DTEXF_NONE)
{
WARN("Sampler state %u has minfilter D3DTEXF_NONE, returning D3DERR_UNSUPPORTEDTEXTUREFILTER\n", i);
return WINED3DERR_UNSUPPORTEDTEXTUREFILTER;
}
if (state->sampler_states[i][WINED3DSAMP_MAGFILTER] == WINED3DTEXF_NONE)
if (state->sampler_states[i][WINED3D_SAMP_MAG_FILTER] == WINED3DTEXF_NONE)
{
WARN("Sampler state %u has magfilter D3DTEXF_NONE, returning D3DERR_UNSUPPORTEDTEXTUREFILTER\n", i);
return WINED3DERR_UNSUPPORTEDTEXTUREFILTER;
@ -4479,18 +4479,18 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
texture = state->textures[i];
if (!texture || texture->resource.format->flags & WINED3DFMT_FLAG_FILTERING) continue;
if (state->sampler_states[i][WINED3DSAMP_MAGFILTER] != WINED3DTEXF_POINT)
if (state->sampler_states[i][WINED3D_SAMP_MAG_FILTER] != WINED3DTEXF_POINT)
{
WARN("Non-filterable texture and mag filter enabled on samper %u, returning E_FAIL\n", i);
return E_FAIL;
}
if (state->sampler_states[i][WINED3DSAMP_MINFILTER] != WINED3DTEXF_POINT)
if (state->sampler_states[i][WINED3D_SAMP_MIN_FILTER] != WINED3DTEXF_POINT)
{
WARN("Non-filterable texture and min filter enabled on samper %u, returning E_FAIL\n", i);
return E_FAIL;
}
if (state->sampler_states[i][WINED3DSAMP_MIPFILTER] != WINED3DTEXF_NONE
&& state->sampler_states[i][WINED3DSAMP_MIPFILTER] != WINED3DTEXF_POINT)
if (state->sampler_states[i][WINED3D_SAMP_MIP_FILTER] != WINED3DTEXF_NONE
&& state->sampler_states[i][WINED3D_SAMP_MIP_FILTER] != WINED3DTEXF_POINT)
{
WARN("Non-filterable texture and mip filter enabled on samper %u, returning E_FAIL\n", i);
return E_FAIL;

View File

@ -3615,14 +3615,14 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
if (state->textures[sampler])
{
struct wined3d_texture *texture = state->textures[sampler];
BOOL srgb = state->sampler_states[sampler][WINED3DSAMP_SRGBTEXTURE];
BOOL srgb = state->sampler_states[sampler][WINED3D_SAMP_SRGB_TEXTURE];
texture->texture_ops->texture_bind(texture, context, srgb);
wined3d_texture_apply_state_changes(texture, state->sampler_states[sampler], gl_info);
if (gl_info->supported[EXT_TEXTURE_LOD_BIAS])
{
tmpvalue.d = state->sampler_states[sampler][WINED3DSAMP_MIPMAPLODBIAS];
tmpvalue.d = state->sampler_states[sampler][WINED3D_SAMP_MIPMAP_LOD_BIAS];
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,
GL_TEXTURE_LOD_BIAS_EXT,
tmpvalue.f);

View File

@ -114,18 +114,18 @@ static const DWORD pixel_states_texture[] =
static const DWORD pixel_states_sampler[] =
{
WINED3DSAMP_ADDRESSU,
WINED3DSAMP_ADDRESSV,
WINED3DSAMP_ADDRESSW,
WINED3DSAMP_BORDERCOLOR,
WINED3DSAMP_MAGFILTER,
WINED3DSAMP_MINFILTER,
WINED3DSAMP_MIPFILTER,
WINED3DSAMP_MIPMAPLODBIAS,
WINED3DSAMP_MAXMIPLEVEL,
WINED3DSAMP_MAXANISOTROPY,
WINED3DSAMP_SRGBTEXTURE,
WINED3DSAMP_ELEMENTINDEX,
WINED3D_SAMP_ADDRESS_U,
WINED3D_SAMP_ADDRESS_V,
WINED3D_SAMP_ADDRESS_W,
WINED3D_SAMP_BORDER_COLOR,
WINED3D_SAMP_MAG_FILTER,
WINED3D_SAMP_MIN_FILTER,
WINED3D_SAMP_MIP_FILTER,
WINED3D_SAMP_MIPMAP_LOD_BIAS,
WINED3D_SAMP_MAX_MIP_LEVEL,
WINED3D_SAMP_MAX_ANISOTROPY,
WINED3D_SAMP_SRGB_TEXTURE,
WINED3D_SAMP_ELEMENT_INDEX,
};
static const DWORD vertex_states_render[] =
@ -185,7 +185,7 @@ static const DWORD vertex_states_texture[] =
static const DWORD vertex_states_sampler[] =
{
WINED3DSAMP_DMAPOFFSET,
WINED3D_SAMP_DMAP_OFFSET,
};
/* Allocates the correct amount of space for pixel and vertex shader constants,
@ -1278,21 +1278,21 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
for (i = 0 ; i < MAX_COMBINED_SAMPLERS; ++i)
{
TRACE("Setting up default samplers states for sampler %u.\n", i);
state->sampler_states[i][WINED3DSAMP_ADDRESSU] = WINED3DTADDRESS_WRAP;
state->sampler_states[i][WINED3DSAMP_ADDRESSV] = WINED3DTADDRESS_WRAP;
state->sampler_states[i][WINED3DSAMP_ADDRESSW] = WINED3DTADDRESS_WRAP;
state->sampler_states[i][WINED3DSAMP_BORDERCOLOR] = 0;
state->sampler_states[i][WINED3DSAMP_MAGFILTER] = WINED3DTEXF_POINT;
state->sampler_states[i][WINED3DSAMP_MINFILTER] = WINED3DTEXF_POINT;
state->sampler_states[i][WINED3DSAMP_MIPFILTER] = WINED3DTEXF_NONE;
state->sampler_states[i][WINED3DSAMP_MIPMAPLODBIAS] = 0;
state->sampler_states[i][WINED3DSAMP_MAXMIPLEVEL] = 0;
state->sampler_states[i][WINED3DSAMP_MAXANISOTROPY] = 1;
state->sampler_states[i][WINED3DSAMP_SRGBTEXTURE] = 0;
state->sampler_states[i][WINED3D_SAMP_ADDRESS_U] = WINED3DTADDRESS_WRAP;
state->sampler_states[i][WINED3D_SAMP_ADDRESS_V] = WINED3DTADDRESS_WRAP;
state->sampler_states[i][WINED3D_SAMP_ADDRESS_W] = WINED3DTADDRESS_WRAP;
state->sampler_states[i][WINED3D_SAMP_BORDER_COLOR] = 0;
state->sampler_states[i][WINED3D_SAMP_MAG_FILTER] = WINED3DTEXF_POINT;
state->sampler_states[i][WINED3D_SAMP_MIN_FILTER] = WINED3DTEXF_POINT;
state->sampler_states[i][WINED3D_SAMP_MIP_FILTER] = WINED3DTEXF_NONE;
state->sampler_states[i][WINED3D_SAMP_MIPMAP_LOD_BIAS] = 0;
state->sampler_states[i][WINED3D_SAMP_MAX_MIP_LEVEL] = 0;
state->sampler_states[i][WINED3D_SAMP_MAX_ANISOTROPY] = 1;
state->sampler_states[i][WINED3D_SAMP_SRGB_TEXTURE] = 0;
/* TODO: Indicates which element of a multielement texture to use. */
state->sampler_states[i][WINED3DSAMP_ELEMENTINDEX] = 0;
state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0;
/* TODO: Vertex offset in the presampled displacement map. */
state->sampler_states[i][WINED3DSAMP_DMAPOFFSET] = 0;
state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0;
}
for (i = 0; i < gl_info->limits.textures; ++i)

View File

@ -277,32 +277,32 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
/* This function relies on the correct texture being bound and loaded. */
if (sampler_states[WINED3DSAMP_ADDRESSU] != gl_tex->states[WINED3DTEXSTA_ADDRESSU])
if (sampler_states[WINED3D_SAMP_ADDRESS_U] != gl_tex->states[WINED3DTEXSTA_ADDRESSU])
{
state = sampler_states[WINED3DSAMP_ADDRESSU];
state = sampler_states[WINED3D_SAMP_ADDRESS_U];
apply_wrap(gl_info, target, state, GL_TEXTURE_WRAP_S, cond_np2);
gl_tex->states[WINED3DTEXSTA_ADDRESSU] = state;
}
if (sampler_states[WINED3DSAMP_ADDRESSV] != gl_tex->states[WINED3DTEXSTA_ADDRESSV])
if (sampler_states[WINED3D_SAMP_ADDRESS_V] != gl_tex->states[WINED3DTEXSTA_ADDRESSV])
{
state = sampler_states[WINED3DSAMP_ADDRESSV];
state = sampler_states[WINED3D_SAMP_ADDRESS_V];
apply_wrap(gl_info, target, state, GL_TEXTURE_WRAP_T, cond_np2);
gl_tex->states[WINED3DTEXSTA_ADDRESSV] = state;
}
if (sampler_states[WINED3DSAMP_ADDRESSW] != gl_tex->states[WINED3DTEXSTA_ADDRESSW])
if (sampler_states[WINED3D_SAMP_ADDRESS_W] != gl_tex->states[WINED3DTEXSTA_ADDRESSW])
{
state = sampler_states[WINED3DSAMP_ADDRESSW];
state = sampler_states[WINED3D_SAMP_ADDRESS_W];
apply_wrap(gl_info, target, state, GL_TEXTURE_WRAP_R, cond_np2);
gl_tex->states[WINED3DTEXSTA_ADDRESSW] = state;
}
if (sampler_states[WINED3DSAMP_BORDERCOLOR] != gl_tex->states[WINED3DTEXSTA_BORDERCOLOR])
if (sampler_states[WINED3D_SAMP_BORDER_COLOR] != gl_tex->states[WINED3DTEXSTA_BORDERCOLOR])
{
float col[4];
state = sampler_states[WINED3DSAMP_BORDERCOLOR];
state = sampler_states[WINED3D_SAMP_BORDER_COLOR];
D3DCOLORTOGLFLOAT4(state, col);
TRACE("Setting border color for %#x to %#x.\n", target, state);
glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, &col[0]);
@ -310,11 +310,11 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
gl_tex->states[WINED3DTEXSTA_BORDERCOLOR] = state;
}
if (sampler_states[WINED3DSAMP_MAGFILTER] != gl_tex->states[WINED3DTEXSTA_MAGFILTER])
if (sampler_states[WINED3D_SAMP_MAG_FILTER] != gl_tex->states[WINED3DTEXSTA_MAGFILTER])
{
GLint gl_value;
state = sampler_states[WINED3DSAMP_MAGFILTER];
state = sampler_states[WINED3D_SAMP_MAG_FILTER];
if (state > WINED3DTEXF_ANISOTROPIC)
FIXME("Unrecognized or unsupported MAGFILTER* value %d.\n", state);
@ -326,30 +326,30 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
gl_tex->states[WINED3DTEXSTA_MAGFILTER] = state;
}
if ((sampler_states[WINED3DSAMP_MINFILTER] != gl_tex->states[WINED3DTEXSTA_MINFILTER]
|| sampler_states[WINED3DSAMP_MIPFILTER] != gl_tex->states[WINED3DTEXSTA_MIPFILTER]
|| sampler_states[WINED3DSAMP_MAXMIPLEVEL] != gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL]))
if ((sampler_states[WINED3D_SAMP_MIN_FILTER] != gl_tex->states[WINED3DTEXSTA_MINFILTER]
|| sampler_states[WINED3D_SAMP_MIP_FILTER] != gl_tex->states[WINED3DTEXSTA_MIPFILTER]
|| sampler_states[WINED3D_SAMP_MAX_MIP_LEVEL] != gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL]))
{
GLint gl_value;
gl_tex->states[WINED3DTEXSTA_MIPFILTER] = sampler_states[WINED3DSAMP_MIPFILTER];
gl_tex->states[WINED3DTEXSTA_MINFILTER] = sampler_states[WINED3DSAMP_MINFILTER];
gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] = sampler_states[WINED3DSAMP_MAXMIPLEVEL];
gl_tex->states[WINED3DTEXSTA_MIPFILTER] = sampler_states[WINED3D_SAMP_MIP_FILTER];
gl_tex->states[WINED3DTEXSTA_MINFILTER] = sampler_states[WINED3D_SAMP_MIN_FILTER];
gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] = sampler_states[WINED3D_SAMP_MAX_MIP_LEVEL];
if (gl_tex->states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC
|| gl_tex->states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC)
{
FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %#x D3DSAMP_MIPFILTER value %#x.\n",
FIXME("Unrecognized or unsupported MIN_FILTER value %#x MIP_FILTER value %#x.\n",
gl_tex->states[WINED3DTEXSTA_MINFILTER],
gl_tex->states[WINED3DTEXSTA_MIPFILTER]);
}
gl_value = wined3d_gl_min_mip_filter(texture->min_mip_lookup,
min(max(sampler_states[WINED3DSAMP_MINFILTER], WINED3DTEXF_POINT), WINED3DTEXF_LINEAR),
min(max(sampler_states[WINED3DSAMP_MIPFILTER], WINED3DTEXF_NONE), WINED3DTEXF_LINEAR));
min(max(sampler_states[WINED3D_SAMP_MIN_FILTER], WINED3DTEXF_POINT), WINED3DTEXF_LINEAR),
min(max(sampler_states[WINED3D_SAMP_MIP_FILTER], WINED3DTEXF_NONE), WINED3DTEXF_LINEAR));
TRACE("ValueMIN=%#x, ValueMIP=%#x, setting MINFILTER to %#x.\n",
sampler_states[WINED3DSAMP_MINFILTER],
sampler_states[WINED3DSAMP_MIPFILTER], gl_value);
sampler_states[WINED3D_SAMP_MIN_FILTER],
sampler_states[WINED3D_SAMP_MIP_FILTER], gl_value);
glTexParameteri(target, GL_TEXTURE_MIN_FILTER, gl_value);
checkGLcall("glTexParameter GL_TEXTURE_MIN_FILTER, ...");
@ -365,9 +365,9 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
else
gl_value = gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL];
/* Note that WINED3DSAMP_MAXMIPLEVEL specifies the largest mipmap
/* Note that WINED3D_SAMP_MAX_MIP_LEVEL specifies the largest mipmap
* (default 0), while GL_TEXTURE_MAX_LEVEL specifies the smallest
* mimap used (default 1000). So WINED3DSAMP_MAXMIPLEVEL
* mimap used (default 1000). So WINED3D_SAMP_MAX_MIP_LEVEL
* corresponds to GL_TEXTURE_BASE_LEVEL. */
glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, gl_value);
}
@ -379,7 +379,7 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
|| cond_np2)
aniso = 1;
else
aniso = sampler_states[WINED3DSAMP_MAXANISOTROPY];
aniso = sampler_states[WINED3D_SAMP_MAX_ANISOTROPY];
if (gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] != aniso)
{
@ -396,12 +396,12 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
}
/* These should always be the same unless EXT_texture_sRGB_decode is supported. */
if (sampler_states[WINED3DSAMP_SRGBTEXTURE] != gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE])
if (sampler_states[WINED3D_SAMP_SRGB_TEXTURE] != gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE])
{
glTexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
sampler_states[WINED3DSAMP_SRGBTEXTURE] ? GL_DECODE_EXT : GL_SKIP_DECODE_EXT);
sampler_states[WINED3D_SAMP_SRGB_TEXTURE] ? GL_DECODE_EXT : GL_SKIP_DECODE_EXT);
checkGLcall("glTexParameteri(GL_TEXTURE_SRGB_DECODE_EXT)");
gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE] = sampler_states[WINED3DSAMP_SRGBTEXTURE];
gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE] = sampler_states[WINED3D_SAMP_SRGB_TEXTURE];
}
if (!(texture->resource.format->flags & WINED3DFMT_FLAG_SHADOW)

View File

@ -2154,24 +2154,24 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
}
}
const char *debug_d3dsamplerstate(DWORD state)
const char *debug_d3dsamplerstate(enum wined3d_sampler_state state)
{
switch (state)
{
#define D3DSTATE_TO_STR(u) case u: return #u
D3DSTATE_TO_STR(WINED3DSAMP_BORDERCOLOR);
D3DSTATE_TO_STR(WINED3DSAMP_ADDRESSU);
D3DSTATE_TO_STR(WINED3DSAMP_ADDRESSV);
D3DSTATE_TO_STR(WINED3DSAMP_ADDRESSW);
D3DSTATE_TO_STR(WINED3DSAMP_MAGFILTER);
D3DSTATE_TO_STR(WINED3DSAMP_MINFILTER);
D3DSTATE_TO_STR(WINED3DSAMP_MIPFILTER);
D3DSTATE_TO_STR(WINED3DSAMP_MIPMAPLODBIAS);
D3DSTATE_TO_STR(WINED3DSAMP_MAXMIPLEVEL);
D3DSTATE_TO_STR(WINED3DSAMP_MAXANISOTROPY);
D3DSTATE_TO_STR(WINED3DSAMP_SRGBTEXTURE);
D3DSTATE_TO_STR(WINED3DSAMP_ELEMENTINDEX);
D3DSTATE_TO_STR(WINED3DSAMP_DMAPOFFSET);
D3DSTATE_TO_STR(WINED3D_SAMP_BORDER_COLOR);
D3DSTATE_TO_STR(WINED3D_SAMP_ADDRESS_U);
D3DSTATE_TO_STR(WINED3D_SAMP_ADDRESS_V);
D3DSTATE_TO_STR(WINED3D_SAMP_ADDRESS_W);
D3DSTATE_TO_STR(WINED3D_SAMP_MAG_FILTER);
D3DSTATE_TO_STR(WINED3D_SAMP_MIN_FILTER);
D3DSTATE_TO_STR(WINED3D_SAMP_MIP_FILTER);
D3DSTATE_TO_STR(WINED3D_SAMP_MIPMAP_LOD_BIAS);
D3DSTATE_TO_STR(WINED3D_SAMP_MAX_MIP_LEVEL);
D3DSTATE_TO_STR(WINED3D_SAMP_MAX_ANISOTROPY);
D3DSTATE_TO_STR(WINED3D_SAMP_SRGB_TEXTURE);
D3DSTATE_TO_STR(WINED3D_SAMP_ELEMENT_INDEX);
D3DSTATE_TO_STR(WINED3D_SAMP_DMAP_OFFSET);
#undef D3DSTATE_TO_STR
default:
FIXME("Unrecognized %u sampler state!\n", state);

View File

@ -2501,7 +2501,7 @@ const char *debug_d3ddeclmethod(WINED3DDECLMETHOD method) DECLSPEC_HIDDEN;
const char *debug_d3ddeclusage(BYTE usage) DECLSPEC_HIDDEN;
const char *debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type) DECLSPEC_HIDDEN;
const char *debug_d3drenderstate(enum wined3d_render_state state) DECLSPEC_HIDDEN;
const char *debug_d3dsamplerstate(DWORD state) DECLSPEC_HIDDEN;
const char *debug_d3dsamplerstate(enum wined3d_sampler_state state) DECLSPEC_HIDDEN;
const char *debug_d3dstate(DWORD state) DECLSPEC_HIDDEN;
const char *debug_d3dtexturefiltertype(WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
const char *debug_d3dtexturestate(DWORD state) DECLSPEC_HIDDEN;

View File

@ -509,24 +509,23 @@ enum wined3d_swap_effect
WINED3D_SWAP_EFFECT_COPY_VSYNC = 4,
};
typedef enum _WINED3DSAMPLERSTATETYPE
enum wined3d_sampler_state
{
WINED3DSAMP_ADDRESSU = 1,
WINED3DSAMP_ADDRESSV = 2,
WINED3DSAMP_ADDRESSW = 3,
WINED3DSAMP_BORDERCOLOR = 4,
WINED3DSAMP_MAGFILTER = 5,
WINED3DSAMP_MINFILTER = 6,
WINED3DSAMP_MIPFILTER = 7,
WINED3DSAMP_MIPMAPLODBIAS = 8,
WINED3DSAMP_MAXMIPLEVEL = 9,
WINED3DSAMP_MAXANISOTROPY = 10,
WINED3DSAMP_SRGBTEXTURE = 11,
WINED3DSAMP_ELEMENTINDEX = 12,
WINED3DSAMP_DMAPOFFSET = 13,
WINED3DSAMP_FORCE_DWORD = 0x7fffffff,
} WINED3DSAMPLERSTATETYPE;
#define WINED3D_HIGHEST_SAMPLER_STATE WINED3DSAMP_DMAPOFFSET
WINED3D_SAMP_ADDRESS_U = 1,
WINED3D_SAMP_ADDRESS_V = 2,
WINED3D_SAMP_ADDRESS_W = 3,
WINED3D_SAMP_BORDER_COLOR = 4,
WINED3D_SAMP_MAG_FILTER = 5,
WINED3D_SAMP_MIN_FILTER = 6,
WINED3D_SAMP_MIP_FILTER = 7,
WINED3D_SAMP_MIPMAP_LOD_BIAS = 8,
WINED3D_SAMP_MAX_MIP_LEVEL = 9,
WINED3D_SAMP_MAX_ANISOTROPY = 10,
WINED3D_SAMP_SRGB_TEXTURE = 11,
WINED3D_SAMP_ELEMENT_INDEX = 12,
WINED3D_SAMP_DMAP_OFFSET = 13,
};
#define WINED3D_HIGHEST_SAMPLER_STATE WINED3D_SAMP_DMAP_OFFSET
typedef enum _WINED3DMULTISAMPLE_TYPE
{
@ -2136,7 +2135,7 @@ HRESULT __cdecl wined3d_device_get_render_state(const struct wined3d_device *dev
HRESULT __cdecl wined3d_device_get_render_target(const struct wined3d_device *device,
UINT render_target_idx, struct wined3d_surface **render_target);
HRESULT __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device,
UINT sampler_idx, WINED3DSAMPLERSTATETYPE state, DWORD *value);
UINT sampler_idx, enum wined3d_sampler_state state, DWORD *value);
HRESULT __cdecl wined3d_device_get_scissor_rect(const struct wined3d_device *device, RECT *rect);
BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_device *device);
HRESULT __cdecl wined3d_device_get_stream_source(const struct wined3d_device *device,
@ -2215,7 +2214,7 @@ HRESULT __cdecl wined3d_device_set_render_state(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device,
UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport);
HRESULT __cdecl wined3d_device_set_sampler_state(struct wined3d_device *device,
UINT sampler_idx, WINED3DSAMPLERSTATETYPE state, DWORD value);
UINT sampler_idx, enum wined3d_sampler_state state, DWORD value);
HRESULT __cdecl wined3d_device_set_scissor_rect(struct wined3d_device *device, const RECT *rect);
HRESULT __cdecl wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software);
HRESULT __cdecl wined3d_device_set_stream_source(struct wined3d_device *device,