📄 r300_reg.h
字号:
/* Absolutely no clue what this register is about. */#define R300_VAP_UNKNOWN_2288 0x2288# define R300_2288_R300 0x00750000 /* -- nh */# define R300_2288_RV350 0x0000FFFF /* -- Vladimir *//* gap *//* Addresses are relative to the vertex program instruction area of the// memory bank. PROGRAM_END points to the last instruction of the active// program//// The meaning of the two UNKNOWN fields is obviously not known. However,// experiments so far have shown that both *must* point to an instruction// inside the vertex program, otherwise the GPU locks up.// fglrx usually sets CNTL_3_UNKNOWN to the end of the program and// CNTL_1_UNKNOWN points to instruction where last write to position takes place.// Most likely this is used to ignore rest of the program in cases where group of verts arent visible.// For some reason this "section" is sometimes accepted other instruction that have// no relationship with position calculations.*/#define R300_VAP_PVS_CNTL_1 0x22D0# define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0# define R300_PVS_CNTL_1_POS_END_SHIFT 10# define R300_PVS_CNTL_1_PROGRAM_END_SHIFT 20/* Addresses are relative the the vertex program parameters area. */#define R300_VAP_PVS_CNTL_2 0x22D4# define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0# define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT 16#define R300_VAP_PVS_CNTL_3 0x22D8# define R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT 10# define R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT 0/* The entire range from 0x2300 to 0x2AC inclusive seems to be used for// immediate vertices */#define R300_VAP_VTX_COLOR_R 0x2464#define R300_VAP_VTX_COLOR_G 0x2468#define R300_VAP_VTX_COLOR_B 0x246C#define R300_VAP_VTX_POS_0_X_1 0x2490 /* used for glVertex2*() */#define R300_VAP_VTX_POS_0_Y_1 0x2494#define R300_VAP_VTX_COLOR_PKD 0x249C /* RGBA */#define R300_VAP_VTX_POS_0_X_2 0x24A0 /* used for glVertex3*() */#define R300_VAP_VTX_POS_0_Y_2 0x24A4#define R300_VAP_VTX_POS_0_Z_2 0x24A8#define R300_VAP_VTX_END_OF_PKT 0x24AC /* write 0 to indicate end of packet? *//* gap *//* These are values from r300_reg/r300_reg.h - they are known to be correct and are here so we can use one register file instead of several - Vladimir */#define R300_GB_VAP_RASTER_VTX_FMT_0 0x4000# define R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT (1<<0)# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_0_PRESENT (1<<1)# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_1_PRESENT (1<<2)# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_2_PRESENT (1<<3)# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_3_PRESENT (1<<4)# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_SPACE (0xf<<5)# define R300_GB_VAP_RASTER_VTX_FMT_0__PT_SIZE_PRESENT (0x1<<16)#define R300_GB_VAP_RASTER_VTX_FMT_1 0x4004 /* each of the following is 3 bits wide, specifies number of components */# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21/* UNK30 seems to enables point to quad transformation on textures (or something closely related to that). This bit is rather fatal at the time being due to lackings at pixel shader side */#define R300_GB_ENABLE 0x4008# define R300_GB_POINT_STUFF_ENABLE (1<<0)# define R300_GB_LINE_STUFF_ENABLE (1<<1)# define R300_GB_TRIANGLE_STUFF_ENABLE (1<<2)# define R300_GB_STENCIL_AUTO_ENABLE (1<<4)# define R300_GB_UNK30 (1<<30) /* each of the following is 2 bits wide */#define R300_GB_TEX_REPLICATE 0#define R300_GB_TEX_ST 1#define R300_GB_TEX_STR 2# define R300_GB_TEX0_SOURCE_SHIFT 16# define R300_GB_TEX1_SOURCE_SHIFT 18# define R300_GB_TEX2_SOURCE_SHIFT 20# define R300_GB_TEX3_SOURCE_SHIFT 22# define R300_GB_TEX4_SOURCE_SHIFT 24# define R300_GB_TEX5_SOURCE_SHIFT 26# define R300_GB_TEX6_SOURCE_SHIFT 28# define R300_GB_TEX7_SOURCE_SHIFT 30/* MSPOS - positions for multisample antialiasing (?) */#define R300_GB_MSPOS0 0x4010 /* shifts - each of the fields is 4 bits */# define R300_GB_MSPOS0__MS_X0_SHIFT 0# define R300_GB_MSPOS0__MS_Y0_SHIFT 4# define R300_GB_MSPOS0__MS_X1_SHIFT 8# define R300_GB_MSPOS0__MS_Y1_SHIFT 12# define R300_GB_MSPOS0__MS_X2_SHIFT 16# define R300_GB_MSPOS0__MS_Y2_SHIFT 20# define R300_GB_MSPOS0__MSBD0_Y 24# define R300_GB_MSPOS0__MSBD0_X 28#define R300_GB_MSPOS1 0x4014# define R300_GB_MSPOS1__MS_X3_SHIFT 0# define R300_GB_MSPOS1__MS_Y3_SHIFT 4# define R300_GB_MSPOS1__MS_X4_SHIFT 8# define R300_GB_MSPOS1__MS_Y4_SHIFT 12# define R300_GB_MSPOS1__MS_X5_SHIFT 16# define R300_GB_MSPOS1__MS_Y5_SHIFT 20# define R300_GB_MSPOS1__MSBD1 24#define R300_GB_TILE_CONFIG 0x4018# define R300_GB_TILE_ENABLE (1<<0)# define R300_GB_TILE_PIPE_COUNT_RV300 0# define R300_GB_TILE_PIPE_COUNT_R300 (3<<1)# define R300_GB_TILE_PIPE_COUNT_R420 (7<<1)# define R300_GB_TILE_SIZE_8 0# define R300_GB_TILE_SIZE_16 (1<<4)# define R300_GB_TILE_SIZE_32 (2<<4)# define R300_GB_SUPER_SIZE_1 (0<<6)# define R300_GB_SUPER_SIZE_2 (1<<6)# define R300_GB_SUPER_SIZE_4 (2<<6)# define R300_GB_SUPER_SIZE_8 (3<<6)# define R300_GB_SUPER_SIZE_16 (4<<6)# define R300_GB_SUPER_SIZE_32 (5<<6)# define R300_GB_SUPER_SIZE_64 (6<<6)# define R300_GB_SUPER_SIZE_128 (7<<6)# define R300_GB_SUPER_X_SHIFT 9 /* 3 bits wide */# define R300_GB_SUPER_Y_SHIFT 12 /* 3 bits wide */# define R300_GB_SUPER_TILE_A 0# define R300_GB_SUPER_TILE_B (1<<15)# define R300_GB_SUBPIXEL_1_12 0# define R300_GB_SUBPIXEL_1_16 (1<<16)#define R300_GB_FIFO_SIZE 0x4024 /* each of the following is 2 bits wide */#define R300_GB_FIFO_SIZE_32 0#define R300_GB_FIFO_SIZE_64 1#define R300_GB_FIFO_SIZE_128 2#define R300_GB_FIFO_SIZE_256 3# define R300_SC_IFIFO_SIZE_SHIFT 0# define R300_SC_TZFIFO_SIZE_SHIFT 2# define R300_SC_BFIFO_SIZE_SHIFT 4# define R300_US_OFIFO_SIZE_SHIFT 12# define R300_US_WFIFO_SIZE_SHIFT 14 /* the following use the same constants as above, but meaning is is times 2 (i.e. instead of 32 words it means 64 */# define R300_RS_TFIFO_SIZE_SHIFT 6# define R300_RS_CFIFO_SIZE_SHIFT 8# define R300_US_RAM_SIZE_SHIFT 10 /* watermarks, 3 bits wide */# define R300_RS_HIGHWATER_COL_SHIFT 16# define R300_RS_HIGHWATER_TEX_SHIFT 19# define R300_OFIFO_HIGHWATER_SHIFT 22 /* two bits only */# define R300_CUBE_FIFO_HIGHWATER_COL_SHIFT 24#define R300_GB_SELECT 0x401C# define R300_GB_FOG_SELECT_C0A 0# define R300_GB_FOG_SELECT_C1A 1# define R300_GB_FOG_SELECT_C2A 2# define R300_GB_FOG_SELECT_C3A 3# define R300_GB_FOG_SELECT_1_1_W 4# define R300_GB_FOG_SELECT_Z 5# define R300_GB_DEPTH_SELECT_Z 0# define R300_GB_DEPTH_SELECT_1_1_W (1<<3)# define R300_GB_W_SELECT_1_W 0# define R300_GB_W_SELECT_1 (1<<4)#define R300_GB_AA_CONFIG 0x4020# define R300_AA_ENABLE 0x01# define R300_AA_SUBSAMPLES_2 0# define R300_AA_SUBSAMPLES_3 (1<<1)# define R300_AA_SUBSAMPLES_4 (2<<1)# define R300_AA_SUBSAMPLES_6 (3<<1)/* END *//* gap *//* The upper enable bits are guessed, based on fglrx reported limits. */#define R300_TX_ENABLE 0x4104# define R300_TX_ENABLE_0 (1 << 0)# define R300_TX_ENABLE_1 (1 << 1)# define R300_TX_ENABLE_2 (1 << 2)# define R300_TX_ENABLE_3 (1 << 3)# define R300_TX_ENABLE_4 (1 << 4)# define R300_TX_ENABLE_5 (1 << 5)# define R300_TX_ENABLE_6 (1 << 6)# define R300_TX_ENABLE_7 (1 << 7)# define R300_TX_ENABLE_8 (1 << 8)# define R300_TX_ENABLE_9 (1 << 9)# define R300_TX_ENABLE_10 (1 << 10)# define R300_TX_ENABLE_11 (1 << 11)# define R300_TX_ENABLE_12 (1 << 12)# define R300_TX_ENABLE_13 (1 << 13)# define R300_TX_ENABLE_14 (1 << 14)# define R300_TX_ENABLE_15 (1 << 15)/* The pointsize is given in multiples of 6. The pointsize can be// enormous: Clear() renders a single point that fills the entire// framebuffer. */#define R300_RE_POINTSIZE 0x421C# define R300_POINTSIZE_Y_SHIFT 0# define R300_POINTSIZE_Y_MASK (0xFFFF << 0) /* GUESS */# define R300_POINTSIZE_X_SHIFT 16# define R300_POINTSIZE_X_MASK (0xFFFF << 16) /* GUESS */# define R300_POINTSIZE_MAX (R300_POINTSIZE_Y_MASK / 6)/* The line width is given in multiples of 6. In default mode lines are classified as vertical lines. HO: horizontal VE: vertical or horizontal HO & VE: no classification*/#define R300_RE_LINE_CNT 0x4234# define R300_LINESIZE_SHIFT 0# define R300_LINESIZE_MASK (0xFFFF << 0) /* GUESS */# define R300_LINESIZE_MAX (R300_LINESIZE_MASK / 6)# define R300_LINE_CNT_HO (1 << 16)# define R300_LINE_CNT_VE (1 << 17)/* Some sort of scale or clamp value for texcoordless textures. */#define R300_RE_UNK4238 0x4238#define R300_RE_SHADE_MODEL 0x4278# define R300_RE_SHADE_MODEL_SMOOTH 0x3aaaa# define R300_RE_SHADE_MODEL_FLAT 0x39595/* Dangerous */#define R300_RE_POLYGON_MODE 0x4288# define R300_PM_ENABLED (1 << 0)# define R300_PM_FRONT_POINT (0 << 0)# define R300_PM_BACK_POINT (0 << 0)# define R300_PM_FRONT_LINE (1 << 4)# define R300_PM_FRONT_FILL (1 << 5)# define R300_PM_BACK_LINE (1 << 7)# define R300_PM_BACK_FILL (1 << 8)/* Not sure why there are duplicate of factor and constant values. My best guess so far is that there are seperate zbiases for test and write. Ordering might be wrong. Some of the tests indicate that fgl has a fallback implementation of zbias via pixel shaders. */#define R300_RE_ZBIAS_T_FACTOR 0x42A4#define R300_RE_ZBIAS_T_CONSTANT 0x42A8#define R300_RE_ZBIAS_W_FACTOR 0x42AC#define R300_RE_ZBIAS_W_CONSTANT 0x42B0/* This register needs to be set to (1<<1) for RV350 to correctly perform depth test (see --vb-triangles in r300_demo) Don't know about other chips. - Vladimir This is set to 3 when GL_POLYGON_OFFSET_FILL is on. My guess is that there are two bits for each zbias primitive (FILL, LINE, POINT). One to enable depth test and one for depth write. Yet this doesnt explain why depth writes work ... */#define R300_RE_OCCLUSION_CNTL 0x42B4# define R300_OCCLUSION_ON (1<<1)#define R300_RE_CULL_CNTL 0x42B8# define R300_CULL_FRONT (1 << 0)# define R300_CULL_BACK (1 << 1)# define R300_FRONT_FACE_CCW (0 << 2)# define R300_FRONT_FACE_CW (1 << 2)/* BEGIN: Rasterization / Interpolators - many guesses// 0_UNKNOWN_18 has always been set except for clear operations.// TC_CNT is the number of incoming texture coordinate sets (i.e. it depends
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -