📄 r300_reg.h
字号:
/* Programmable Stream Control Signed Normalize Control */#define R300_VAP_PSC_SGN_NORM_CNTL 0x21dc# define SGN_NORM_ZERO 0# define SGN_NORM_ZERO_CLAMP_MINUS_ONE 1# define SGN_NORM_NO_ZERO 2/* gap *//* Words parallel to INPUT_ROUTE_0; All words that are active in INPUT_ROUTE_0 * are set to a swizzling bit pattern, other words are 0. * * In immediate mode, the pattern is always set to xyzw. In vertex array * mode, the swizzling pattern is e.g. used to set zw components in texture * coordinates with only tweo components. */#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0# define R300_SWIZZLE0_SHIFT 0# define R300_SWIZZLE_SELECT_X_SHIFT 0# define R300_SWIZZLE_SELECT_Y_SHIFT 3# define R300_SWIZZLE_SELECT_Z_SHIFT 6# define R300_SWIZZLE_SELECT_W_SHIFT 9# define R300_SWIZZLE_SELECT_X 0# define R300_SWIZZLE_SELECT_Y 1# define R300_SWIZZLE_SELECT_Z 2# define R300_SWIZZLE_SELECT_W 3# define R300_SWIZZLE_SELECT_FP_ZERO 4# define R300_SWIZZLE_SELECT_FP_ONE 5/* alternate forms for r300_emit.c */# define R300_INPUT_ROUTE_SELECT_X 0# define R300_INPUT_ROUTE_SELECT_Y 1# define R300_INPUT_ROUTE_SELECT_Z 2# define R300_INPUT_ROUTE_SELECT_W 3# define R300_INPUT_ROUTE_SELECT_ZERO 4# define R300_INPUT_ROUTE_SELECT_ONE 5# define R300_WRITE_ENA_SHIFT 12# define R300_WRITE_ENA_X 1# define R300_WRITE_ENA_Y 2# define R300_WRITE_ENA_Z 4# define R300_WRITE_ENA_W 8# define R300_SWIZZLE1_SHIFT 16#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4#define R300_VAP_PROG_STREAM_CNTL_EXT_2 0x21e8#define R300_VAP_PROG_STREAM_CNTL_EXT_3 0x21ec#define R300_VAP_PROG_STREAM_CNTL_EXT_4 0x21f0#define R300_VAP_PROG_STREAM_CNTL_EXT_5 0x21f4#define R300_VAP_PROG_STREAM_CNTL_EXT_6 0x21f8#define R300_VAP_PROG_STREAM_CNTL_EXT_7 0x21fc/* END: Vertex data assembly *//* gap *//* BEGIN: Upload vertex program and data *//* * The programmable vertex shader unit has a memory bank of unknown size * that can be written to in 16 byte units by writing the address into * UPLOAD_ADDRESS, followed by data in UPLOAD_DATA (multiples of 4 DWORDs). * * Pointers into the memory bank are always in multiples of 16 bytes. * * The memory bank is divided into areas with fixed meaning. * * Starting at address UPLOAD_PROGRAM: Vertex program instructions. * Native limits reported by drivers from ATI suggest size 256 (i.e. 4KB), * whereas the difference between known addresses suggests size 512. * * Starting at address UPLOAD_PARAMETERS: Vertex program parameters. * Native reported limits and the VPI layout suggest size 256, whereas * difference between known addresses suggests size 512. * * At address UPLOAD_POINTSIZE is a vector (0, 0, ps, 0), where ps is the * floating point pointsize. The exact purpose of this state is uncertain, * as there is also the R300_RE_POINTSIZE register. * * Multiple vertex programs and parameter sets can be loaded at once, * which could explain the size discrepancy. */#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200# define R300_PVS_CODE_START 0# define R300_MAX_PVS_CODE_LINES 256# define R500_MAX_PVS_CODE_LINES 1024# define R300_PVS_CONST_START 512# define R500_PVS_CONST_START 1024# define R300_MAX_PVS_CONST_VECS 256# define R500_MAX_PVS_CONST_VECS 1024# define R300_PVS_UCP_START 1024# define R500_PVS_UCP_START 1536# define R300_POINT_VPORT_SCALE_OFFSET 1030# define R500_POINT_VPORT_SCALE_OFFSET 1542# define R300_POINT_GEN_TEX_OFFSET 1031# define R500_POINT_GEN_TEX_OFFSET 1543/* * These are obsolete defines form r300_context.h, but they might give some * clues when investigating the addresses further... */#if 0#define VSF_DEST_PROGRAM 0x0#define VSF_DEST_MATRIX0 0x200#define VSF_DEST_MATRIX1 0x204#define VSF_DEST_MATRIX2 0x208#define VSF_DEST_VECTOR0 0x20c#define VSF_DEST_VECTOR1 0x20d#define VSF_DEST_UNKNOWN1 0x400#define VSF_DEST_UNKNOWN2 0x406#endif/* gap */#define R300_VAP_PVS_UPLOAD_DATA 0x2208/* END: Upload vertex program and data *//* gap *//* I do not know the purpose of this register. However, I do know that * it is set to 221C_CLEAR for clear operations and to 221C_NORMAL * for normal rendering. * * 2007-11-05: This register is the user clip plane control register, but there * also seems to be a rendering mode control; the NORMAL/CLEAR defines. * * See bug #9871. http://bugs.freedesktop.org/attachment.cgi?id=10672&action=view */#define R300_VAP_CLIP_CNTL 0x221C# define R300_VAP_UCP_ENABLE_0 (1 << 0)# define R300_VAP_UCP_ENABLE_1 (1 << 1)# define R300_VAP_UCP_ENABLE_2 (1 << 2)# define R300_VAP_UCP_ENABLE_3 (1 << 3)# define R300_VAP_UCP_ENABLE_4 (1 << 4)# define R300_VAP_UCP_ENABLE_5 (1 << 5)# define R300_PS_UCP_MODE_DIST_COP (0 << 14)# define R300_PS_UCP_MODE_RADIUS_COP (1 << 14)# define R300_PS_UCP_MODE_RADIUS_COP_CLIP (2 << 14)# define R300_PS_UCP_MODE_CLIP_AS_TRIFAN (3 << 14)# define R300_CLIP_DISABLE (1 << 16)# define R300_UCP_CULL_ONLY_ENABLE (1 << 17)# define R300_BOUNDARY_EDGE_FLAG_ENABLE (1 << 18)# define R500_COLOR2_IS_TEXTURE (1 << 20)# define R500_COLOR3_IS_TEXTURE (1 << 21)/* These seem to be per-pixel and per-vertex X and Y clipping planes. The first * plane is per-pixel and the second plane is per-vertex. * * This was determined by experimentation alone but I believe it is correct. * * These registers are called X_QUAD0_1_FL to X_QUAD0_4_FL by glxtest. */#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220#define R300_VAP_GB_VERT_DISC_ADJ 0x2224#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c/* gap *//* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between * rendering commands and overwriting vertex program parameters. * Therefore, I suspect writing zero to 0x2284 synchronizes the engine and * avoids bugs caused by still running shaders reading bad data from memory. */#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284/* This register is used to define the number of core clocks to wait for a * vertex to be received by the VAP input controller (while the primitive * path is backed up) before forcing any accumulated vertices to be submitted * to the vertex processing path. */#define VAP_PVS_VTX_TIMEOUT_REG 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 * R300_PVS_CNTL_1_POS_END_SHIFT 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_CODE_CNTL_0 0x22D0# define R300_PVS_FIRST_INST_SHIFT 0# define R300_PVS_XYZW_VALID_INST_SHIFT 10# define R300_PVS_LAST_INST_SHIFT 20/* Addresses are relative the the vertex program parameters area. */#define R300_VAP_PVS_CONST_CNTL 0x22D4# define R300_PVS_CONST_BASE_OFFSET_SHIFT 0# define R300_PVS_MAX_CONST_ADDR_SHIFT 16#define R300_VAP_PVS_CODE_CNTL_1 0x22D8# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22DC/* 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/* write 0 to indicate end of packet? */#define R300_VAP_VTX_END_OF_PKT 0x24AC/* 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 * Specifies top of Raster pipe specific enable controls. */#define R300_GB_ENABLE 0x4008# define R300_GB_POINT_STUFF_DISABLE (0 << 0)# define R300_GB_POINT_STUFF_ENABLE (1 << 0) /* Specifies if points will have stuffed texture coordinates. */# define R300_GB_LINE_STUFF_DISABLE (0 << 1)# define R300_GB_LINE_STUFF_ENABLE (1 << 1) /* Specifies if lines will have stuffed texture coordinates. */# define R300_GB_TRIANGLE_STUFF_DISABLE (0 << 2)# define R300_GB_TRIANGLE_STUFF_ENABLE (1 << 2) /* Specifies if triangles will have stuffed texture coordinates. */# define R300_GB_STENCIL_AUTO_DISABLE (0 << 4)# define R300_GB_STENCIL_AUTO_ENABLE (1 << 4) /* Enable stencil auto inc/dec based on triangle cw/ccw, force into dzy low bit. */# define R300_GB_STENCIL_AUTO_FORCE (2 << 4) /* Force 0 into dzy low bit. */ /* each of the following is 2 bits wide */#define R300_GB_TEX_REPLICATE 0 /* Replicate VAP source texture coordinates (S,T,[R,Q]). */#define R300_GB_TEX_ST 1 /* Stuff with source texture coordinates (S,T). */#define R300_GB_TEX_STR 2 /* Stuff with source texture coordinates (S,T,R). */# 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -