aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/nine_state.h
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-10-19 23:06:05 +0200
committerAxel Davy <[email protected]>2016-12-20 23:44:22 +0100
commitc5af96aebd2be165e29124c1e5d5bb3b7021bb30 (patch)
tree7c4778700863624468e82ad92cc5c7c3611c679c /src/gallium/state_trackers/nine/nine_state.h
parent4a6d83ebc29546e8a70b4187bf1b66f6d745ef2e (diff)
st/nine: Put ff data in a separate structure
And make nine_state_access_transform take this new structure as input. Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/nine_state.h')
-rw-r--r--src/gallium/state_trackers/nine/nine_state.h46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_trackers/nine/nine_state.h
index a6f20ab5dd3..d73c40681f8 100644
--- a/src/gallium/state_trackers/nine/nine_state.h
+++ b/src/gallium/state_trackers/nine/nine_state.h
@@ -137,6 +137,28 @@
#define NINE_PS_SAMPLERS_MASK 0x00ffff
#define NINE_VS_SAMPLERS_MASK 0x1e0000
+struct nine_ff_state {
+ struct {
+ uint32_t tex_stage[NINE_MAX_TEXTURE_STAGES][(NINED3DTSS_COUNT + 31) / 32];
+ uint32_t transform[(NINED3DTS_COUNT + 31) / 32];
+ } changed;
+
+ D3DMATRIX *transform; /* access only via nine_state_access_transform */
+ unsigned num_transforms;
+
+ /* XXX: Do state blocks just change the set of active lights or do we
+ * have to store which lights have been disabled, too ?
+ */
+ D3DLIGHT9 *light;
+ uint16_t active_light[NINE_MAX_LIGHTS_ACTIVE]; /* 8 */
+ unsigned num_lights;
+ unsigned num_lights_active;
+
+ D3DMATERIAL9 material;
+
+ DWORD tex_stage[NINE_MAX_TEXTURE_STAGES][NINED3DTSS_COUNT];
+};
+
struct nine_state
{
struct {
@@ -192,27 +214,7 @@ struct nine_state
DWORD samp_advertised[NINE_MAX_SAMPLERS][D3DSAMP_COUNT];
- struct {
- struct {
- uint32_t tex_stage[NINE_MAX_TEXTURE_STAGES][(NINED3DTSS_COUNT + 31) / 32];
- uint32_t transform[(NINED3DTS_COUNT + 31) / 32];
- } changed;
-
- D3DMATRIX *transform; /* access only via nine_state_access_transform */
- unsigned num_transforms;
-
- /* XXX: Do state blocks just change the set of active lights or do we
- * have to store which lights have been disabled, too ?
- */
- D3DLIGHT9 *light;
- uint16_t active_light[NINE_MAX_LIGHTS_ACTIVE]; /* 8 */
- unsigned num_lights;
- unsigned num_lights_active;
-
- D3DMATERIAL9 material;
-
- DWORD tex_stage[NINE_MAX_TEXTURE_STAGES][NINED3DTSS_COUNT];
- } ff;
+ struct nine_ff_state ff;
};
struct nine_context {
@@ -457,7 +459,7 @@ void nine_state_destroy_sw(struct NineDevice9 *device);
* Therefore, do not modify if you set alloc to FALSE !
*/
D3DMATRIX *
-nine_state_access_transform(struct nine_state *, D3DTRANSFORMSTATETYPE,
+nine_state_access_transform(struct nine_ff_state *, D3DTRANSFORMSTATETYPE,
boolean alloc);
const char *nine_d3drs_to_string(DWORD State);