i965: Mostly fix glsl-max-varyings.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_defines.h
index 2bb3448da7cab40730b9a252d67df6e17dd378f6..dba500c56217c6d7d5e13b425b06a466797c7849 100644 (file)
 #define BRW_MASK_ENABLE   0
 #define BRW_MASK_DISABLE  1
 
+/* Sandybridge is WECtrl (Write enable control) */
+#define BRW_WE_NORMAL          0
+#define BRW_WE_KILL_PRED       1
+
 #define BRW_OPCODE_MOV        1
 #define BRW_OPCODE_SEL        2
 #define BRW_OPCODE_NOT        4
 #define BRW_OPCODE_DP2        87
 #define BRW_OPCODE_DPA2       88
 #define BRW_OPCODE_LINE       89
+#define BRW_OPCODE_PLN        90
 #define BRW_OPCODE_NOP        126
 
 #define BRW_PREDICATE_NONE             0
 #define BRW_POLYGON_FACING_BACK       1
 
 #define BRW_MESSAGE_TARGET_NULL               0
-#define BRW_MESSAGE_TARGET_MATH               1
+#define BRW_MESSAGE_TARGET_MATH               1 /* reserved on GEN6 */
 #define BRW_MESSAGE_TARGET_SAMPLER            2
 #define BRW_MESSAGE_TARGET_GATEWAY            3
-#define BRW_MESSAGE_TARGET_DATAPORT_READ      4
-#define BRW_MESSAGE_TARGET_DATAPORT_WRITE     5
+#define BRW_MESSAGE_TARGET_DATAPORT_READ      4 /* sampler cache on GEN6 */
+#define BRW_MESSAGE_TARGET_DATAPORT_WRITE     5 /* render cache on Gen6 */
 #define BRW_MESSAGE_TARGET_URB                6
 #define BRW_MESSAGE_TARGET_THREAD_SPAWNER     7
+#define BRW_MESSAGE_TARGET_CONST_CACHE       9 /* GEN6 */
 
 #define BRW_SAMPLER_RETURN_FORMAT_FLOAT32     0
 #define BRW_SAMPLER_RETURN_FORMAT_UINT32      2
 #define BRW_SAMPLER_MESSAGE_SIMD8_LD                  3
 #define BRW_SAMPLER_MESSAGE_SIMD16_LD                 3
 
-#define BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG            0
-#define BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG       1
-#define BRW_SAMPLER_MESSAGE_SAMPLE_LOD_IGDNG        2
-#define BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG    3
+#define BRW_SAMPLER_MESSAGE_SAMPLE_GEN5            0
+#define BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_GEN5       1
+#define BRW_SAMPLER_MESSAGE_SAMPLE_LOD_GEN5        2
+#define BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_GEN5    3
 
-/* for IGDNG only */
+/* for GEN5 only */
 #define BRW_SAMPLER_SIMD_MODE_SIMD4X2                   0
 #define BRW_SAMPLER_SIMD_MODE_SIMD8                     1
 #define BRW_SAMPLER_SIMD_MODE_SIMD16                    2
 #define BRW_DATAPORT_DWORD_SCATTERED_BLOCK_16DWORDS  3
 
 #define BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ          0
-#define BRW_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ     1
-#define BRW_DATAPORT_READ_MESSAGE_DWORD_BLOCK_READ          2
-#define BRW_DATAPORT_READ_MESSAGE_DWORD_SCATTERED_READ      3
+/* GEN6 */
+#define BRW_DATAPORT_READ_MESSAGE_RENDER_UNORM_READ        1
+#define BRW_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ     2
+#define BRW_DATAPORT_READ_MESSAGE_DWORD_BLOCK_READ          4
+/* GEN6 */
+#define BRW_DATAPORT_READ_MESSAGE_OWORD_UNALIGN_BLOCK_READ  5
+#define BRW_DATAPORT_READ_MESSAGE_DWORD_SCATTERED_READ      6
 
 #define BRW_DATAPORT_READ_TARGET_DATA_CACHE      0
 #define BRW_DATAPORT_READ_TARGET_RENDER_CACHE    1
 #define BRW_DATAPORT_WRITE_MESSAGE_STREAMED_VERTEX_BUFFER_WRITE     5
 #define BRW_DATAPORT_WRITE_MESSAGE_FLUSH_RENDER_CACHE               7
 
+/* GEN6 */
+#define BRW_DATAPORT_WRITE_MESSAGE_DWORD_ATOMIC_WRITE_GEN6             7
+#define BRW_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE_GEN6              8
+#define BRW_DATAPORT_WRITE_MESSAGE_OWORD_DUAL_BLOCK_WRITE_GEN6         9
+#define BRW_DATAPORT_WRITE_MESSAGE_MEDIA_BLOCK_WRITE_GEN6              10
+#define BRW_DATAPORT_WRITE_MESSAGE_DWORLD_SCATTERED_WRITE_GEN6         11
+#define BRW_DATAPORT_WRITE_MESSAGE_RENDER_TARGET_WRITE_GEN6            12
+#define BRW_DATAPORT_WRITE_MESSAGE_STREAMED_VB_WRITE_GEN6              13
+#define BRW_DATAPORT_WRITE_MESSAGE_RENDER_TARGET_UNORM_WRITE_GEN6      14
+
 #define BRW_MATH_FUNCTION_INV                              1
 #define BRW_MATH_FUNCTION_LOG                              2
 #define BRW_MATH_FUNCTION_EXP                              3
 #define CMD_BINDING_TABLE_PTRS        0x7801
 # define GEN6_BINDING_TABLE_MODIFY_VS  (1 << 8)
 # define GEN6_BINDING_TABLE_MODIFY_GS  (1 << 9)
-# define GEN6_BINDING_TABLE_MODIFY_PS  (1 << 10)
+# define GEN6_BINDING_TABLE_MODIFY_PS  (1 << 12)
 
 #define CMD_3D_SAMPLER_STATE_POINTERS                  0x7802 /* SNB+ */
 # define PS_SAMPLER_STATE_CHANGE                               (1 << 12)
 # define GEN6_VE0_INDEX_SHIFT          26
 # define BRW_VE0_FORMAT_SHIFT          16
 # define BRW_VE0_VALID                 (1 << 26)
-# define GEN6_VE0_VALID                        (0 << 25)
+# define GEN6_VE0_VALID                        (1 << 25)
 # define BRW_VE0_SRC_OFFSET_SHIFT      0
 # define BRW_VE1_COMPONENT_NOSTORE     0
 # define BRW_VE1_COMPONENT_STORE_SRC   1
 #define CMD_URB                                        0x7805 /* GEN6+ */
 # define GEN6_URB_VS_SIZE_SHIFT                                16
 # define GEN6_URB_VS_ENTRIES_SHIFT                     0
-# define GEN6_URB_GS_SIZE_SHIFT                                8
-# define GEN6_URB_GS_ENTRIES_SHIFT                     0
+# define GEN6_URB_GS_ENTRIES_SHIFT                     8
+# define GEN6_URB_GS_SIZE_SHIFT                                0
 
 #define CMD_VIEWPORT_STATE_POINTERS                    0x780d /* GEN6+ */
 # define GEN6_CC_VIEWPORT_MODIFY                       (1 << 12)
 # define GEN6_CLIP_STATISTICS_ENABLE                   (1 << 10)
 /* DW2 */
 # define GEN6_CLIP_ENABLE                              (1 << 31)
-# define GEN6_CLIP_API_OGL                             (1 << 30)
+# define GEN6_CLIP_API_OGL                             (0 << 30)
+# define GEN6_CLIP_API_D3D                             (1 << 30)
 # define GEN6_CLIP_XY_TEST                             (1 << 28)
 # define GEN6_CLIP_Z_TEST                              (1 << 27)
 # define GEN6_CLIP_GB_TEST                             (1 << 26)
 # define GEN6_WM_LINE_AA_WIDTH_2_0                     (2 << 14)
 # define GEN6_WM_LINE_AA_WIDTH_4_0                     (3 << 14)
 # define GEN6_WM_POLYGON_STIPPLE_ENABLE                        (1 << 13)
-# define GEN6_WM_LINE_STIPPLE_ENABLE                   (1 << 12)
+# define GEN6_WM_LINE_STIPPLE_ENABLE                   (1 << 11)
 # define GEN6_WM_OMASK_TO_RENDER_TARGET                        (1 << 9)
 # define GEN6_WM_USES_SOURCE_W                         (1 << 8)
 # define GEN6_WM_DUAL_SOURCE_BLEND_ENABLE              (1 << 7)