summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/pixelshader9.h
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2018-10-14 22:02:06 +0200
committerAxel Davy <[email protected]>2018-10-26 22:16:16 +0200
commit739c7009504b1a7b13997eda86db9afa5b8d6df9 (patch)
treeafadcc5bf4da850bd56226dcd85db7185e9bc092 /src/gallium/state_trackers/nine/pixelshader9.h
parent847861aab4f5630d5eb298f1741b4f48d79e7139 (diff)
st/nine: Enable shadow mapping for ps 1.X
We didn't implement shadow textures for ps 1.X, assuming the case couldn't happen... Well it does. Fixes: https://github.com/iXit/Mesa-3D/issues/261 Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/pixelshader9.h')
-rw-r--r--src/gallium/state_trackers/nine/pixelshader9.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/nine/pixelshader9.h b/src/gallium/state_trackers/nine/pixelshader9.h
index accd00a6a8c..bcbadd71057 100644
--- a/src/gallium/state_trackers/nine/pixelshader9.h
+++ b/src/gallium/state_trackers/nine/pixelshader9.h
@@ -68,13 +68,16 @@ NinePixelShader9_UpdateKey( struct NinePixelShader9 *ps,
struct nine_context *context )
{
uint16_t samplers_shadow;
- uint32_t samplers_ps1_types;
+ uint16_t samplers_ps1_types;
uint16_t projected;
uint64_t key;
BOOL res;
+ samplers_shadow = (uint16_t)((context->samplers_shadow & NINE_PS_SAMPLERS_MASK) >> NINE_SAMPLER_PS(0));
+ key = samplers_shadow & ps->sampler_mask;
+
if (unlikely(ps->byte_code.version < 0x20)) {
- /* no depth textures, but variable targets */
+ /* variable targets */
uint32_t m = ps->sampler_mask;
samplers_ps1_types = 0;
while (m) {
@@ -82,10 +85,9 @@ NinePixelShader9_UpdateKey( struct NinePixelShader9 *ps,
m &= ~(1 << s);
samplers_ps1_types |= (context->texture[s].enabled ? context->texture[s].pstype : 1) << (s * 2);
}
- key = samplers_ps1_types;
- } else {
- samplers_shadow = (uint16_t)((context->samplers_shadow & NINE_PS_SAMPLERS_MASK) >> NINE_SAMPLER_PS(0));
- key = samplers_shadow & ps->sampler_mask;
+ /* Note: For ps 1.X, only samplers 0 1 2 and 3 are available (except 1.4 where 4 and 5 are available).
+ * Thus there is no overflow of samplers_ps1_types. */
+ key |= samplers_ps1_types << 16;
}
if (ps->byte_code.version < 0x30) {