st/nine: Split NINE_STATE_FF_OTHER
authorAxel Davy <davyaxel0@gmail.com>
Sat, 22 Sep 2018 09:05:19 +0000 (11:05 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Tue, 25 Sep 2018 20:05:24 +0000 (22:05 +0200)
NINE_STATE_FF_OTHER was mostly ff vs states.

Rename it to NINE_STATE_FF_VS_OTHER and
move common states with ps to
NINE_STATE_FF_PS_CONSTS (renamed from
NINE_STATE_FF_PSSTAGES).

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/nine_ff.c
src/gallium/state_trackers/nine/nine_state.c
src/gallium/state_trackers/nine/nine_state.h
src/gallium/state_trackers/nine/stateblock9.c

index 37fcba875ff3b98818edd3b1d7caa3ea305aa35b..51e49ac43039d6ebb1501c426423bb75665c38a1 100644 (file)
@@ -2350,7 +2350,7 @@ NineDevice9_CreateStateBlock( struct NineDevice9 *This,
     if (Type == D3DSBT_ALL || Type == D3DSBT_PIXELSTATE) {
        dst->changed.group |=
           NINE_STATE_PS | NINE_STATE_PS_CONST | NINE_STATE_BLEND |
-          NINE_STATE_FF_OTHER | NINE_STATE_FF_PSSTAGES | NINE_STATE_PS_CONST |
+          NINE_STATE_FF_VS_OTHER | NINE_STATE_FF_PS_CONSTS | NINE_STATE_PS_CONST |
           NINE_STATE_FB | NINE_STATE_DSA | NINE_STATE_MULTISAMPLE |
           NINE_STATE_RASTERIZER | NINE_STATE_STENCIL_REF;
        memcpy(dst->changed.rs,
@@ -2539,7 +2539,7 @@ NineDevice9_SetTextureStageState( struct NineDevice9 *This,
     if (unlikely(This->is_recording)) {
         if (Type == D3DTSS_TEXTURETRANSFORMFLAGS)
             state->changed.group |= NINE_STATE_PS_PARAMS_MISC;
-        state->changed.group |= NINE_STATE_FF_PSSTAGES;
+        state->changed.group |= NINE_STATE_FF_PS_CONSTS;
         state->ff.changed.tex_stage[Stage][Type / 32] |= 1 << (Type % 32);
     } else
         nine_context_set_texture_stage_state(This, Stage, Type, Value);
index 453f280c9fc92aff0265e307b66da2ba217a5adc..addea3dde1fce9c5ad6b9af64300e7885e38e448 100644 (file)
@@ -1949,7 +1949,7 @@ nine_ff_load_point_and_fog_params(struct NineDevice9 *device)
     struct nine_context *context = &device->context;
     struct fvec4 *dst = (struct fvec4 *)device->ff.vs_const;
 
-    if (!(context->changed.group & NINE_STATE_FF_OTHER))
+    if (!(context->changed.group & NINE_STATE_FF_VS_OTHER))
         return;
     dst[26].x = asfloat(context->rs[D3DRS_POINTSIZE_MIN]);
     dst[26].y = asfloat(context->rs[D3DRS_POINTSIZE_MAX]);
@@ -1986,7 +1986,7 @@ nine_ff_load_ps_params(struct NineDevice9 *device)
     struct fvec4 *dst = (struct fvec4 *)device->ff.ps_const;
     unsigned s;
 
-    if (!(context->changed.group & (NINE_STATE_FF_PSSTAGES | NINE_STATE_FF_OTHER)))
+    if (!(context->changed.group & NINE_STATE_FF_PS_CONSTS))
         return;
 
     for (s = 0; s < 8; ++s)
index cb62c28b7b7eb84ec0fbbed2a69d156ebd6b8916..3db9a07fbf454416eb546fea7399f897276fee7c 100644 (file)
@@ -1870,7 +1870,7 @@ CSMT_ITEM_NO_WAIT(nine_context_set_texture_stage_state,
         context->changed.group |= NINE_STATE_PS_CONST;
     }
 
-    context->changed.group |= NINE_STATE_FF_PSSTAGES;
+    context->changed.group |= NINE_STATE_FF_PS_CONSTS;
     context->ff.changed.tex_stage[Stage][Type / 32] |= 1 << (Type % 32);
 }
 
@@ -2073,7 +2073,7 @@ nine_context_apply_stateblock(struct NineDevice9 *device,
     if (src->changed.group & NINE_STATE_FF_MATERIAL)
         context->ff.material = src->ff.material;
 
-    if (src->changed.group & NINE_STATE_FF_PSSTAGES) {
+    if (src->changed.group & NINE_STATE_FF_PS_CONSTS) {
         unsigned s;
         for (s = 0; s < NINE_MAX_TEXTURE_STAGES; ++s) {
             for (i = 0; i < NINED3DTSS_COUNT; ++i)
@@ -2266,7 +2266,7 @@ nine_context_apply_stateblock(struct NineDevice9 *device,
     if (src->changed.group & NINE_STATE_FF_MATERIAL)
         nine_context_set_material(device, &src->ff.material);
 
-    if (src->changed.group & NINE_STATE_FF_PSSTAGES) {
+    if (src->changed.group & NINE_STATE_FF_PS_CONSTS) {
         unsigned s;
         for (s = 0; s < NINE_MAX_TEXTURE_STAGES; ++s) {
             for (i = 0; i < NINED3DTSS_COUNT; ++i)
@@ -3531,11 +3531,11 @@ const uint32_t nine_render_state_group[NINED3DRS_LAST + 1] =
     [D3DRS_ALPHABLENDENABLE] = NINE_STATE_BLEND,
     [D3DRS_FOGENABLE] = NINE_STATE_FF_SHADER | NINE_STATE_VS_PARAMS_MISC | NINE_STATE_PS_PARAMS_MISC | NINE_STATE_PS_CONST,
     [D3DRS_SPECULARENABLE] = NINE_STATE_FF_LIGHTING,
-    [D3DRS_FOGCOLOR] = NINE_STATE_FF_OTHER | NINE_STATE_PS_CONST,
+    [D3DRS_FOGCOLOR] = NINE_STATE_FF_PS_CONSTS | NINE_STATE_PS_CONST,
     [D3DRS_FOGTABLEMODE] = NINE_STATE_FF_SHADER | NINE_STATE_PS_PARAMS_MISC | NINE_STATE_PS_CONST,
-    [D3DRS_FOGSTART] = NINE_STATE_FF_OTHER | NINE_STATE_PS_CONST,
-    [D3DRS_FOGEND] = NINE_STATE_FF_OTHER | NINE_STATE_PS_CONST,
-    [D3DRS_FOGDENSITY] = NINE_STATE_FF_OTHER | NINE_STATE_PS_CONST,
+    [D3DRS_FOGSTART] = NINE_STATE_FF_VS_OTHER | NINE_STATE_FF_PS_CONSTS | NINE_STATE_PS_CONST,
+    [D3DRS_FOGEND] = NINE_STATE_FF_VS_OTHER | NINE_STATE_FF_PS_CONSTS | NINE_STATE_PS_CONST,
+    [D3DRS_FOGDENSITY] = NINE_STATE_FF_VS_OTHER | NINE_STATE_FF_PS_CONSTS | NINE_STATE_PS_CONST,
     [D3DRS_RANGEFOGENABLE] = NINE_STATE_FF_SHADER,
     [D3DRS_STENCILENABLE] = NINE_STATE_DSA | NINE_STATE_MULTISAMPLE,
     [D3DRS_STENCILFAIL] = NINE_STATE_DSA,
@@ -3545,7 +3545,7 @@ const uint32_t nine_render_state_group[NINED3DRS_LAST + 1] =
     [D3DRS_STENCILREF] = NINE_STATE_STENCIL_REF,
     [D3DRS_STENCILMASK] = NINE_STATE_DSA,
     [D3DRS_STENCILWRITEMASK] = NINE_STATE_DSA,
-    [D3DRS_TEXTUREFACTOR] = NINE_STATE_FF_PSSTAGES,
+    [D3DRS_TEXTUREFACTOR] = NINE_STATE_FF_PS_CONSTS,
     [D3DRS_WRAP0] = NINE_STATE_UNHANDLED, /* cylindrical wrap is crazy */
     [D3DRS_WRAP1] = NINE_STATE_UNHANDLED,
     [D3DRS_WRAP2] = NINE_STATE_UNHANDLED,
@@ -3567,21 +3567,21 @@ const uint32_t nine_render_state_group[NINED3DRS_LAST + 1] =
     [D3DRS_EMISSIVEMATERIALSOURCE] = NINE_STATE_FF_LIGHTING,
     [D3DRS_VERTEXBLEND] = NINE_STATE_FF_SHADER,
     [D3DRS_CLIPPLANEENABLE] = NINE_STATE_RASTERIZER,
-    [D3DRS_POINTSIZE] = NINE_STATE_RASTERIZER | NINE_STATE_FF_OTHER,
-    [D3DRS_POINTSIZE_MIN] = NINE_STATE_RASTERIZER | NINE_STATE_FF_OTHER | NINE_STATE_VS_PARAMS_MISC,
+    [D3DRS_POINTSIZE] = NINE_STATE_RASTERIZER | NINE_STATE_FF_VS_OTHER,
+    [D3DRS_POINTSIZE_MIN] = NINE_STATE_RASTERIZER | NINE_STATE_FF_VS_OTHER | NINE_STATE_VS_PARAMS_MISC,
     [D3DRS_POINTSPRITEENABLE] = NINE_STATE_RASTERIZER,
     [D3DRS_POINTSCALEENABLE] = NINE_STATE_FF_SHADER,
-    [D3DRS_POINTSCALE_A] = NINE_STATE_FF_OTHER,
-    [D3DRS_POINTSCALE_B] = NINE_STATE_FF_OTHER,
-    [D3DRS_POINTSCALE_C] = NINE_STATE_FF_OTHER,
+    [D3DRS_POINTSCALE_A] = NINE_STATE_FF_VS_OTHER,
+    [D3DRS_POINTSCALE_B] = NINE_STATE_FF_VS_OTHER,
+    [D3DRS_POINTSCALE_C] = NINE_STATE_FF_VS_OTHER,
     [D3DRS_MULTISAMPLEANTIALIAS] = NINE_STATE_MULTISAMPLE,
     [D3DRS_MULTISAMPLEMASK] = NINE_STATE_SAMPLE_MASK,
     [D3DRS_PATCHEDGESTYLE] = NINE_STATE_UNHANDLED,
     [D3DRS_DEBUGMONITORTOKEN] = NINE_STATE_UNHANDLED,
-    [D3DRS_POINTSIZE_MAX] = NINE_STATE_RASTERIZER | NINE_STATE_FF_OTHER | NINE_STATE_VS_PARAMS_MISC,
+    [D3DRS_POINTSIZE_MAX] = NINE_STATE_RASTERIZER | NINE_STATE_FF_VS_OTHER | NINE_STATE_VS_PARAMS_MISC,
     [D3DRS_INDEXEDVERTEXBLENDENABLE] = NINE_STATE_FF_SHADER,
     [D3DRS_COLORWRITEENABLE] = NINE_STATE_BLEND,
-    [D3DRS_TWEENFACTOR] = NINE_STATE_FF_OTHER,
+    [D3DRS_TWEENFACTOR] = NINE_STATE_FF_VS_OTHER,
     [D3DRS_BLENDOP] = NINE_STATE_BLEND,
     [D3DRS_POSITIONDEGREE] = NINE_STATE_UNHANDLED,
     [D3DRS_NORMALDEGREE] = NINE_STATE_UNHANDLED,
index 77823655efa3b75ac70d7629c71561b0c1f893ee..a3cc66ef8b561fa2854b7b2fd1460b7e749e0f2b 100644 (file)
 #define NINE_STATE_SAMPLE_MASK (1 << 19)
 #define NINE_STATE_FF          (0x1f << 20)
 #define NINE_STATE_FF_VS       (0x17 << 20)
-#define NINE_STATE_FF_PS       (0x18 << 20)
+#define NINE_STATE_FF_PS       (0x08 << 20)
 #define NINE_STATE_FF_LIGHTING (1 << 20)
 #define NINE_STATE_FF_MATERIAL (1 << 21)
 #define NINE_STATE_FF_VSTRANSF (1 << 22)
-#define NINE_STATE_FF_PSSTAGES (1 << 23)
-#define NINE_STATE_FF_OTHER    (1 << 24)
+#define NINE_STATE_FF_PS_CONSTS (1 << 23)
+#define NINE_STATE_FF_VS_OTHER  (1 << 24)
 #define NINE_STATE_VS_PARAMS_MISC  (1 << 25)
 #define NINE_STATE_PS_PARAMS_MISC (1 << 26)
 #define NINE_STATE_MULTISAMPLE (1 << 27)
index 54bf1e3c9558f2210c9e617549a0a90605cc5918..ebfd622ff916204576a83ed9277dcf9fac0d88a6 100644 (file)
@@ -293,7 +293,7 @@ nine_state_copy_common(struct NineDevice9 *device,
     if (mask->changed.group & NINE_STATE_FF_MATERIAL)
         dst->ff.material = src->ff.material;
 
-    if (mask->changed.group & NINE_STATE_FF_PSSTAGES) {
+    if (mask->changed.group & NINE_STATE_FF_PS_CONSTS) {
         for (s = 0; s < NINE_MAX_TEXTURE_STAGES; ++s) {
             for (i = 0; i < NINED3DTSS_COUNT; ++i)
                 if (mask->ff.changed.tex_stage[s][i / 32] & (1 << (i % 32)))