📄 r300_reg.h
字号:
# define R300_ALPHA_TEST_FAIL (0 << 8)# define R300_ALPHA_TEST_LESS (1 << 8)# define R300_ALPHA_TEST_LEQUAL (3 << 8)# define R300_ALPHA_TEST_EQUAL (2 << 8)# define R300_ALPHA_TEST_GEQUAL (6 << 8)# define R300_ALPHA_TEST_GREATER (4 << 8)# define R300_ALPHA_TEST_NEQUAL (5 << 8)# define R300_ALPHA_TEST_PASS (7 << 8)# define R300_ALPHA_TEST_OP_MASK (7 << 8)# define R300_ALPHA_TEST_ENABLE (1 << 11)/* gap *//* Fragment program parameters in 7.16 floating point */#define R300_PFS_PARAM_0_X 0x4C00#define R300_PFS_PARAM_0_Y 0x4C04#define R300_PFS_PARAM_0_Z 0x4C08#define R300_PFS_PARAM_0_W 0x4C0C/* GUESS: PARAM_31 is last, based on native limits reported by fglrx */#define R300_PFS_PARAM_31_X 0x4DF0#define R300_PFS_PARAM_31_Y 0x4DF4#define R300_PFS_PARAM_31_Z 0x4DF8#define R300_PFS_PARAM_31_W 0x4DFC/* Notes:// - AFAIK fglrx always sets BLEND_UNKNOWN when blending is used in the application// - AFAIK fglrx always sets BLEND_NO_SEPARATE when CBLEND and ABLEND are set to the same// function (both registers are always set up completely in any case)// - Most blend flags are simply copied from R200 and not tested yet */#define R300_RB3D_CBLEND 0x4E04#define R300_RB3D_ABLEND 0x4E08 /* the following only appear in CBLEND */# define R300_BLEND_ENABLE (1 << 0)# define R300_BLEND_UNKNOWN (3 << 1)# define R300_BLEND_NO_SEPARATE (1 << 3) /* the following are shared between CBLEND and ABLEND */# define R300_FCN_MASK (3 << 12)# define R300_COMB_FCN_ADD_CLAMP (0 << 12)# define R300_COMB_FCN_ADD_NOCLAMP (1 << 12)# define R300_COMB_FCN_SUB_CLAMP (2 << 12)# define R300_COMB_FCN_SUB_NOCLAMP (3 << 12)# define R300_SRC_BLEND_GL_ZERO (32 << 16)# define R300_SRC_BLEND_GL_ONE (33 << 16)# define R300_SRC_BLEND_GL_SRC_COLOR (34 << 16)# define R300_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)# define R300_SRC_BLEND_GL_DST_COLOR (36 << 16)# define R300_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)# define R300_SRC_BLEND_GL_SRC_ALPHA (38 << 16)# define R300_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)# define R300_SRC_BLEND_GL_DST_ALPHA (40 << 16)# define R300_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)# define R300_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16)# define R300_SRC_BLEND_MASK (63 << 16)# define R300_DST_BLEND_GL_ZERO (32 << 24)# define R300_DST_BLEND_GL_ONE (33 << 24)# define R300_DST_BLEND_GL_SRC_COLOR (34 << 24)# define R300_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)# define R300_DST_BLEND_GL_DST_COLOR (36 << 24)# define R300_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)# define R300_DST_BLEND_GL_SRC_ALPHA (38 << 24)# define R300_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)# define R300_DST_BLEND_GL_DST_ALPHA (40 << 24)# define R300_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)# define R300_DST_BLEND_MASK (63 << 24)#define R300_RB3D_COLORMASK 0x4E0C# define R300_COLORMASK0_B (1<<0)# define R300_COLORMASK0_G (1<<1)# define R300_COLORMASK0_R (1<<2)# define R300_COLORMASK0_A (1<<3)/* gap */#define R300_RB3D_COLOROFFSET0 0x4E28# define R300_COLOROFFSET_MASK 0xFFFFFFF0 /* GUESS */#define R300_RB3D_COLOROFFSET1 0x4E2C /* GUESS */#define R300_RB3D_COLOROFFSET2 0x4E30 /* GUESS */#define R300_RB3D_COLOROFFSET3 0x4E34 /* GUESS *//* gap *//* Bit 16: Larger tiles// Bit 17: 4x2 tiles// Bit 18: Extremely weird tile like, but some pixels duplicated? */#define R300_RB3D_COLORPITCH0 0x4E38# define R300_COLORPITCH_MASK 0x00001FF8 /* GUESS */# define R300_COLOR_TILE_ENABLE (1 << 16) /* GUESS */# define R300_COLOR_MICROTILE_ENABLE (1 << 17) /* GUESS */# define R300_COLOR_ENDIAN_NO_SWAP (0 << 18) /* GUESS */# define R300_COLOR_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */# define R300_COLOR_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS */# define R300_COLOR_FORMAT_RGB565 (2 << 22)# define R300_COLOR_FORMAT_ARGB8888 (3 << 22)#define R300_RB3D_COLORPITCH1 0x4E3C /* GUESS */#define R300_RB3D_COLORPITCH2 0x4E40 /* GUESS */#define R300_RB3D_COLORPITCH3 0x4E44 /* GUESS *//* gap *//* Guess by Vladimir.// Set to 0A before 3D operations, set to 02 afterwards. */#define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C# define R300_RB3D_DSTCACHE_02 0x00000002# define R300_RB3D_DSTCACHE_0A 0x0000000A/* gap *//* There seems to be no "write only" setting, so use Z-test = ALWAYS for this. *//* Bit (1<<8) is the "test" bit. so plain write is 6 - vd */#define R300_RB3D_ZSTENCIL_CNTL_0 0x4F00# define R300_RB3D_Z_DISABLED_1 0x00000010 /* GUESS */# define R300_RB3D_Z_DISABLED_2 0x00000014 /* GUESS */# define R300_RB3D_Z_TEST 0x00000012# define R300_RB3D_Z_TEST_AND_WRITE 0x00000016# define R300_RB3D_Z_WRITE_ONLY 0x00000006# define R300_RB3D_Z_TEST 0x00000012# define R300_RB3D_Z_TEST_AND_WRITE 0x00000016# define R300_RB3D_Z_WRITE_ONLY 0x00000006# define R300_RB3D_STENCIL_ENABLE 0x00000001#define R300_RB3D_ZSTENCIL_CNTL_1 0x4F04 /* functions */# define R300_ZS_NEVER 0# define R300_ZS_LESS 1# define R300_ZS_LEQUAL 2# define R300_ZS_EQUAL 3# define R300_ZS_GEQUAL 4# define R300_ZS_GREATER 5# define R300_ZS_NOTEQUAL 6# define R300_ZS_ALWAYS 7# define R300_ZS_MASK 7 /* operations */# define R300_ZS_KEEP 0# define R300_ZS_ZERO 1# define R300_ZS_REPLACE 2# define R300_ZS_INCR 3# define R300_ZS_DECR 4# define R300_ZS_INVERT 5# define R300_ZS_INCR_WRAP 6# define R300_ZS_DECR_WRAP 7 /* front and back refer to operations done for front and back faces, i.e. separate stencil function support */# define R300_RB3D_ZS1_DEPTH_FUNC_SHIFT 0# define R300_RB3D_ZS1_FRONT_FUNC_SHIFT 3# define R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT 6# define R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT 9# define R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT 12# define R300_RB3D_ZS1_BACK_FUNC_SHIFT 15# define R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT 18# define R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT 21# define R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT 24#define R300_RB3D_ZSTENCIL_CNTL_2 0x4F08# define R300_RB3D_ZS2_STENCIL_REF_SHIFT 0# define R300_RB3D_ZS2_STENCIL_MASK 0xFF# define R300_RB3D_ZS2_STENCIL_MASK_SHIFT 8# define R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT 16/* gap */#define R300_RB3D_ZSTENCIL_FORMAT 0x4F10# define R300_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)# define R300_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)/* gap */#define R300_RB3D_DEPTHOFFSET 0x4F20#define R300_RB3D_DEPTHPITCH 0x4F24# define R300_DEPTHPITCH_MASK 0x00001FF8 /* GUESS */# define R300_DEPTH_TILE_ENABLE (1 << 16) /* GUESS */# define R300_DEPTH_MICROTILE_ENABLE (1 << 17) /* GUESS */# define R300_DEPTH_ENDIAN_NO_SWAP (0 << 18) /* GUESS */# define R300_DEPTH_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */# define R300_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS *//* BEGIN: Vertex program instruction set// Every instruction is four dwords long:// DWORD 0: output and opcode// DWORD 1: first argument// DWORD 2: second argument// DWORD 3: third argument//// Notes:// - ABS r, a is implemented as MAX r, a, -a// - MOV is implemented as ADD to zero// - XPD is implemented as MUL + MAD// - FLR is implemented as FRC + ADD// - apparently, fglrx tries to schedule instructions so that there is at least// one instruction between the write to a temporary and the first read// from said temporary; however, violations of this scheduling are allowed// - register indices seem to be unrelated with OpenGL aliasing to conventional state// - only one attribute and one parameter can be loaded at a time; however, the// same attribute/parameter can be used for more than one argument// - the second software argument for POW is the third hardware argument (no idea why)// - MAD with only temporaries as input seems to use VPI_OUT_SELECT_MAD_2//// There is some magic surrounding LIT:// The single argument is replicated across all three inputs, but swizzled:// First argument: xyzy// Second argument: xyzx// Third argument: xyzw// Whenever the result is used later in the fragment program, fglrx forces x and w// to be 1.0 in the input selection; I don't know whether this is strictly necessary */#define R300_VPI_OUT_OP_DOT (1 << 0)#define R300_VPI_OUT_OP_MUL (2 << 0)#define R300_VPI_OUT_OP_ADD (3 << 0)#define R300_VPI_OUT_OP_MAD (4 << 0)#define R300_VPI_OUT_OP_DST (5 << 0)#define R300_VPI_OUT_OP_FRC (6 << 0)#define R300_VPI_OUT_OP_MAX (7 << 0)#define R300_VPI_OUT_OP_MIN (8 << 0)#define R300_VPI_OUT_OP_SGE (9 << 0)#define R300_VPI_OUT_OP_SLT (10 << 0)#define R300_VPI_OUT_OP_UNK12 (12 << 0) /* Used in GL_POINT_DISTANCE_ATTENUATION_ARB, vector(scalar, vector) */#define R300_VPI_OUT_OP_EXP (65 << 0)#define R300_VPI_OUT_OP_LOG (66 << 0)#define R300_VPI_OUT_OP_UNK67 (67 << 0) /* Used in fog computations, scalar(scalar) */#define R300_VPI_OUT_OP_LIT (68 << 0)#define R300_VPI_OUT_OP_POW (69 << 0)#define R300_VPI_OUT_OP_RCP (70 << 0)#define R300_VPI_OUT_OP_RSQ (72 << 0)#define R300_VPI_OUT_OP_UNK73 (73 << 0) /* Used in GL_POINT_DISTANCE_ATTENUATION_ARB, scalar(scalar) */#define R300_VPI_OUT_OP_EX2 (75 << 0)#define R300_VPI_OUT_OP_LG2 (76 << 0)#define R300_VPI_OUT_OP_MAD_2 (128 << 0)#define R300_VPI_OUT_OP_UNK129 (129 << 0) /* all temps, vector(scalar, vector, vector) */#define R300_VPI_OUT_REG_CLASS_TEMPORARY (0 << 8)#define R300_VPI_OUT_REG_CLASS_RESULT (2 << 8)#define R300_VPI_OUT_REG_CLASS_MASK (31 << 8)#define R300_VPI_OUT_REG_INDEX_SHIFT 13#define R300_VPI_OUT_REG_INDEX_MASK (31 << 13) /* GUESS based on fglrx native limits */#define R300_VPI_OUT_WRITE_X (1 << 20)#define R300_VPI_OUT_WRITE_Y (1 << 21)#define R300_VPI_OUT_WRITE_Z (1 << 22)#define R300_VPI_OUT_WRITE_W (1 << 23)#define R300_VPI_IN_REG_CLASS_TEMPORARY (0 << 0)#define R300_VPI_IN_REG_CLASS_ATTRIBUTE (1 << 0)#define R300_VPI_IN_REG_CLASS_PARAMETER (2 << 0)#define R300_VPI_IN_REG_CLASS_NONE (9 << 0)#define R300_VPI_IN_REG_CLASS_MASK (31 << 0) /* GUESS */#define R300_VPI_IN_REG_INDEX_SHIFT 5#define R300_VPI_IN_REG_INDEX_MASK (255 << 5) /* GUESS based on fglrx native limits *//* The R300 can select components from the input register arbitrarily.// Use the following constants, shifted by the component shift you// want to select */#define R300_VPI_IN_SELECT_X 0#define R300_VPI_IN_SELECT_Y 1#define R300_VPI_IN_SELECT_Z 2#define R300_VPI_IN_SELECT_W 3#define R300_VPI_IN_SELECT_ZERO 4#define R300_VPI_IN_SELECT_ONE 5#define R300_VPI_IN_SELECT_MASK 7#define R300_VPI_IN_X_SHIFT 13#define R300_VPI_IN_Y_SHIFT 16#define R300_VPI_IN_Z_SHIFT 19#define R300_VPI_IN_W_SHIFT 22#define R300_VPI_IN_NEG_X (1 << 25)#define R300_VPI_IN_NEG_Y (1 << 26)#define R300_VPI_IN_NEG_Z (1 << 27)#define R300_VPI_IN_NEG_W (1 << 28)/* END *///BEGIN: Packet 3 commands// A primitive emission dword.#define R300_PRI
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -