summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/vertexshader9.h
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-05-11 21:32:57 +0200
committerAxel Davy <[email protected]>2015-08-21 22:21:47 +0200
commit69de5d626f2e67e74e4de94ce13f7ac50fa52161 (patch)
tree40f314701d177f3a1b0705d8f7ce94dfc8b2aa65 /src/gallium/state_trackers/nine/vertexshader9.h
parent854778ea0fea474eea0c984f1c0fc32aed91f10e (diff)
st/nine: Rework shader states
Separate state setting and commit Changes how the shader key is computed 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.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/vertexshader9.h b/src/gallium/state_trackers/nine/vertexshader9.h
index 6e2810c989c..6cf7749e0ac 100644
--- a/src/gallium/state_trackers/nine/vertexshader9.h
+++ b/src/gallium/state_trackers/nine/vertexshader9.h
@@ -25,6 +25,7 @@
#include "iunknown.h"
#include "nine_shader.h"
+#include "nine_state.h"
struct NineVertexShader9
{
@@ -54,6 +55,12 @@ struct NineVertexShader9
const struct pipe_stream_output_info *so;
uint64_t ff_key[2];
+ void *ff_cso;
+
+ uint32_t last_key;
+ void *last_cso;
+
+ uint32_t next_key;
};
static inline struct NineVertexShader9 *
NineVertexShader9( void *data )
@@ -61,9 +68,26 @@ NineVertexShader9( void *data )
return (struct NineVertexShader9 *)data;
}
+static inline BOOL
+NineVertexShader9_UpdateKey( struct NineVertexShader9 *vs,
+ struct nine_state *state )
+{
+ uint8_t samplers_shadow;
+ uint32_t key;
+ BOOL res;
+
+ samplers_shadow = (uint8_t)((state->samplers_shadow & NINE_VS_SAMPLERS_MASK) >> NINE_SAMPLER_VS(0));
+ samplers_shadow &= vs->sampler_mask;
+ key = samplers_shadow;
+
+ res = vs->last_key != key;
+ if (res)
+ vs->next_key = key;
+ return res;
+}
+
void *
-NineVertexShader9_GetVariant( struct NineVertexShader9 *vs,
- uint32_t key );
+NineVertexShader9_GetVariant( struct NineVertexShader9 *vs );
/*** public ***/