diff options
author | Axel Davy <[email protected]> | 2016-03-06 15:54:50 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-05-18 23:37:14 +0200 |
commit | 89344a80fc4479fa3ac466cb17706cf12070afe1 (patch) | |
tree | c5e26137ac7846d29c889e34b4f855d524ff53ed /src/gallium/state_trackers/nine/vertexshader9.h | |
parent | ae0fdd8a4078a2ba7edc2f0a12cb285a08921c8d (diff) |
st/nine: Fix Pointsize in programmable shader
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/vertexshader9.h')
-rw-r--r-- | src/gallium/state_trackers/nine/vertexshader9.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/vertexshader9.h b/src/gallium/state_trackers/nine/vertexshader9.h index c89d4a1ee24..3c9db7990a0 100644 --- a/src/gallium/state_trackers/nine/vertexshader9.h +++ b/src/gallium/state_trackers/nine/vertexshader9.h @@ -23,7 +23,10 @@ #ifndef _NINE_VERTEXSHADER9_H_ #define _NINE_VERTEXSHADER9_H_ +#include "util/u_half.h" + #include "iunknown.h" +#include "nine_helpers.h" #include "nine_shader.h" #include "nine_state.h" @@ -57,10 +60,10 @@ struct NineVertexShader9 uint64_t ff_key[3]; void *ff_cso; - uint32_t last_key; + uint64_t last_key; void *last_cso; - uint32_t next_key; + uint64_t next_key; }; static inline struct NineVertexShader9 * NineVertexShader9( void *data ) @@ -73,7 +76,7 @@ NineVertexShader9_UpdateKey( struct NineVertexShader9 *vs, struct nine_state *state ) { uint8_t samplers_shadow; - uint32_t key; + uint64_t key; BOOL res; samplers_shadow = (uint8_t)((state->samplers_shadow & NINE_VS_SAMPLERS_MASK) >> NINE_SAMPLER_VS(0)); @@ -81,7 +84,15 @@ NineVertexShader9_UpdateKey( struct NineVertexShader9 *vs, key = samplers_shadow; if (vs->byte_code.version < 0x30) - key |= state->rs[D3DRS_FOGENABLE] << 8; + key |= (uint32_t) (state->rs[D3DRS_FOGENABLE] << 8); + + /* We want to use a 64 bits key for performance. + * Use compressed float16 values for the pointsize min/max in the key. + * Shaders do not usually output psize.*/ + if (vs->point_size) { + key |= ((uint64_t)util_float_to_half(asfloat(state->rs[D3DRS_POINTSIZE_MIN]))) << 32; + key |= ((uint64_t)util_float_to_half(asfloat(state->rs[D3DRS_POINTSIZE_MAX]))) << 48; + } res = vs->last_key != key; if (res) |