mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 00:49:04 +02:00
st/nine: Fix ff SPECULARENABLE
We were (wrongly) adding specular to diffuse in vertex shaders when SPECULARENABLE was set. However the spec says specular has to be added after texture processing (which is in ps). Besides SPECULARENABLE is flagged as a pixel state. There was unused support for SPECULARENABLE in the ps ff code. Remove the vs code, and use the ps code. Signed-off-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
parent
1d7890a441
commit
ab068a78d3
1 changed files with 3 additions and 10 deletions
|
|
@ -56,9 +56,8 @@ struct nine_ff_vs_key
|
|||
uint32_t color0in_one : 1;
|
||||
uint32_t color1in_zero : 1;
|
||||
uint32_t fog : 1;
|
||||
uint32_t specular_enable : 1;
|
||||
uint32_t normalizenormals : 1;
|
||||
uint32_t pad1 : 5;
|
||||
uint32_t pad1 : 6;
|
||||
uint32_t tc_dim_input: 16; /* 8 * 2 bits */
|
||||
uint32_t pad2 : 16;
|
||||
uint32_t tc_dim_output: 24; /* 8 * 3 bits */
|
||||
|
|
@ -904,13 +903,7 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs)
|
|||
ureg_ADD(ureg, ureg_writemask(tmp, TGSI_WRITEMASK_W ), vs->mtlA, vs->mtlE);
|
||||
}
|
||||
|
||||
if (key->specular_enable) {
|
||||
/* add oCol[1] to oCol[0] */
|
||||
ureg_MAD(ureg, tmp, ureg_src(rD), vs->mtlD, ureg_src(tmp));
|
||||
ureg_MAD(ureg, oCol[0], ureg_src(rS), vs->mtlS, ureg_src(tmp));
|
||||
} else {
|
||||
ureg_MAD(ureg, oCol[0], ureg_src(rD), vs->mtlD, ureg_src(tmp));
|
||||
}
|
||||
ureg_MAD(ureg, oCol[0], ureg_src(rD), vs->mtlD, ureg_src(tmp));
|
||||
ureg_MUL(ureg, oCol[1], ureg_src(rS), vs->mtlS);
|
||||
ureg_release_temporary(ureg, rAtt);
|
||||
ureg_release_temporary(ureg, rHit);
|
||||
|
|
@ -1603,7 +1596,6 @@ nine_ff_get_vs(struct NineDevice9 *device)
|
|||
key.fog_range = state->rs[D3DRS_RANGEFOGENABLE];
|
||||
|
||||
key.localviewer = !!state->rs[D3DRS_LOCALVIEWER];
|
||||
key.specular_enable = !!state->rs[D3DRS_SPECULARENABLE];
|
||||
key.normalizenormals = !!state->rs[D3DRS_NORMALIZENORMALS];
|
||||
|
||||
if (state->rs[D3DRS_VERTEXBLEND] != D3DVBF_DISABLE) {
|
||||
|
|
@ -1741,6 +1733,7 @@ nine_ff_get_ps(struct NineDevice9 *device)
|
|||
}
|
||||
|
||||
key.projected = nine_ff_get_projected_key(state);
|
||||
key.specular = !!state->rs[D3DRS_SPECULARENABLE];
|
||||
|
||||
for (; s < 8; ++s)
|
||||
key.ts[s].colorop = key.ts[s].alphaop = D3DTOP_DISABLE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue