svga: Make use of ARRAY_SIZE macro
[mesa.git] / src / gallium / drivers / svga / svgadump / svga_shader.h
index 2fc1796a9041a5faaa53461c4543235635dba3d3..0a2e3d5f34552545e1410086d82e89c5a270abde 100644 (file)
@@ -56,7 +56,7 @@ struct sh_reg
    unsigned is_reg:1;
 };
 
-static INLINE unsigned
+static inline unsigned
 sh_reg_type( struct sh_reg reg )
 {
    return reg.type_lo | (reg.type_hi << 3);
@@ -98,21 +98,33 @@ struct sh_defi
 #define PS_TEXTURETYPE_CUBE      SVGA3DSAMP_CUBE
 #define PS_TEXTURETYPE_VOLUME    SVGA3DSAMP_VOLUME
 
-struct ps_sampleinfo
+struct sh_sampleinfo
 {
    unsigned unused:27;
    unsigned texture_type:4;
    unsigned is_reg:1;
 };
 
-struct vs_semantic
+struct sh_semantic
 {
-   unsigned usage:5;
-   unsigned unused1:11;
+   unsigned usage:4;
+   unsigned unused1:12;
    unsigned usage_index:4;
-   unsigned unused2:12;
+   unsigned unused2:11;
+   unsigned is_reg:1;
 };
 
+#define SH_WRITEMASK_0              0x1
+#define SH_WRITEMASK_1              0x2
+#define SH_WRITEMASK_2              0x4
+#define SH_WRITEMASK_3              0x8
+#define SH_WRITEMASK_ALL            0xf
+
+#define SH_DSTMOD_NONE              0x0
+#define SH_DSTMOD_SATURATE          0x1
+#define SH_DSTMOD_PARTIALPRECISION  0x2
+#define SH_DSTMOD_MSAMPCENTROID     0x4
+
 struct sh_dstreg
 {
    unsigned number:11;
@@ -126,7 +138,7 @@ struct sh_dstreg
    unsigned is_reg:1;
 };
 
-static INLINE unsigned
+static inline unsigned
 sh_dstreg_type( struct sh_dstreg reg )
 {
    return reg.type_lo | (reg.type_hi << 3);
@@ -136,17 +148,12 @@ struct sh_dcl
 {
    struct sh_op op;
    union {
-      struct {
-         struct ps_sampleinfo sampleinfo;
-      } ps;
-      struct {
-         struct vs_semantic semantic;
-      } vs;
+      struct sh_sampleinfo sampleinfo;
+      struct sh_semantic semantic;
    } u;
    struct sh_dstreg reg;
 };
 
-
 struct sh_srcreg
 {
    unsigned number:11;
@@ -162,7 +169,7 @@ struct sh_srcreg
    unsigned is_reg:1;
 };
 
-static INLINE unsigned
+static inline unsigned
 sh_srcreg_type( struct sh_srcreg reg )
 {
    return reg.type_lo | (reg.type_hi << 3);
@@ -211,4 +218,10 @@ struct sh_trinaryop
    struct sh_srcreg src2;
 };
 
+struct sh_comment
+{
+   unsigned opcode:16;
+   unsigned size:16;
+};
+
 #endif /* ST_SHADER_SVGA_H */