mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
st/nine: Set CLAMP_TO_EDGE on cubetextures
Wine tests show that cubetextures always use PIPE_TEX_WRAP_CLAMP_TO_EDGE regardless of set sampler states. Fixes failing d3d9 wine test test_cube_wrap. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
parent
fa2574497b
commit
09edc0555f
3 changed files with 22 additions and 5 deletions
|
|
@ -220,9 +220,17 @@ nine_convert_sampler_state(struct cso_context *ctx, int idx, const DWORD *ss)
|
|||
samp.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
|
||||
}
|
||||
samp.max_lod = 15.0f;
|
||||
samp.wrap_s = d3dtextureaddress_to_pipe_tex_wrap(ss[D3DSAMP_ADDRESSU]);
|
||||
samp.wrap_t = d3dtextureaddress_to_pipe_tex_wrap(ss[D3DSAMP_ADDRESSV]);
|
||||
samp.wrap_r = d3dtextureaddress_to_pipe_tex_wrap(ss[D3DSAMP_ADDRESSW]);
|
||||
|
||||
if (ss[NINED3DSAMP_CUBETEX]) {
|
||||
/* Cube textures are always clamped to edge on D3D */
|
||||
samp.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
|
||||
samp.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
|
||||
samp.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
|
||||
} else {
|
||||
samp.wrap_s = d3dtextureaddress_to_pipe_tex_wrap(ss[D3DSAMP_ADDRESSU]);
|
||||
samp.wrap_t = d3dtextureaddress_to_pipe_tex_wrap(ss[D3DSAMP_ADDRESSV]);
|
||||
samp.wrap_r = d3dtextureaddress_to_pipe_tex_wrap(ss[D3DSAMP_ADDRESSW]);
|
||||
}
|
||||
samp.min_img_filter = (ss[D3DSAMP_MINFILTER] == D3DTEXF_POINT && !ss[NINED3DSAMP_SHADOW]) ? PIPE_TEX_FILTER_NEAREST : PIPE_TEX_FILTER_LINEAR;
|
||||
samp.mag_img_filter = (ss[D3DSAMP_MAGFILTER] == D3DTEXF_POINT && !ss[NINED3DSAMP_SHADOW]) ? PIPE_TEX_FILTER_NEAREST : PIPE_TEX_FILTER_LINEAR;
|
||||
if (ss[D3DSAMP_MINFILTER] == D3DTEXF_ANISOTROPIC ||
|
||||
|
|
|
|||
|
|
@ -714,6 +714,13 @@ update_sampler_derived(struct nine_state *state, unsigned s)
|
|||
state->samp[s][NINED3DSAMP_SHADOW] = state->texture[s]->shadow;
|
||||
}
|
||||
|
||||
if (state->samp[s][NINED3DSAMP_CUBETEX] !=
|
||||
(NineResource9(state->texture[s])->type == D3DRTYPE_CUBETEXTURE)) {
|
||||
changed = TRUE;
|
||||
state->samp[s][NINED3DSAMP_CUBETEX] =
|
||||
NineResource9(state->texture[s])->type == D3DRTYPE_CUBETEXTURE;
|
||||
}
|
||||
|
||||
if (state->samp[s][D3DSAMP_MIPFILTER] != D3DTEXF_NONE) {
|
||||
int lod = state->samp[s][D3DSAMP_MAXMIPLEVEL] - state->texture[s]->managed.lod;
|
||||
if (lod < 0)
|
||||
|
|
@ -1264,7 +1271,8 @@ static const DWORD nine_samp_state_defaults[NINED3DSAMP_LAST + 1] =
|
|||
[D3DSAMP_ELEMENTINDEX] = 0,
|
||||
[D3DSAMP_DMAPOFFSET] = 0,
|
||||
[NINED3DSAMP_MINLOD] = 0,
|
||||
[NINED3DSAMP_SHADOW] = 0
|
||||
[NINED3DSAMP_SHADOW] = 0,
|
||||
[NINED3DSAMP_CUBETEX] = 0
|
||||
};
|
||||
|
||||
void nine_state_restore_non_cso(struct NineDevice9 *device)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#define NINED3DSAMP_MINLOD (D3DSAMP_DMAPOFFSET + 1)
|
||||
#define NINED3DSAMP_SHADOW (D3DSAMP_DMAPOFFSET + 2)
|
||||
#define NINED3DSAMP_CUBETEX (D3DSAMP_DMAPOFFSET + 3)
|
||||
|
||||
#define NINED3DRS_VSPOINTSIZE (D3DRS_BLENDOPALPHA + 1)
|
||||
#define NINED3DRS_RTMASK (D3DRS_BLENDOPALPHA + 2)
|
||||
|
|
@ -42,7 +43,7 @@
|
|||
|
||||
#define D3DRS_LAST D3DRS_BLENDOPALPHA
|
||||
#define NINED3DRS_LAST NINED3DRS_MULTISAMPLE /* 214 */
|
||||
#define NINED3DSAMP_LAST NINED3DSAMP_SHADOW /* 15 */
|
||||
#define NINED3DSAMP_LAST NINED3DSAMP_CUBETEX /* 16 */
|
||||
#define NINED3DTSS_LAST D3DTSS_CONSTANT
|
||||
#define NINED3DTS_LAST D3DTS_WORLDMATRIX(255)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue