📄 r300_reg.h
字号:
/**************************************************************************Copyright (C) 2004-2005 Nicolai Haehnle et al.Permission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the "Software"),to deal in the Software without restriction, including without limitationon the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whomthe Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice (including the nextparagraph) shall be included in all copies or substantial portions of theSoftware.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALLTHE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OROTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THEUSE OR OTHER DEALINGS IN THE SOFTWARE.**************************************************************************//* *INDENT-OFF* */#ifndef _R300_REG_H#define _R300_REG_H#define R300_MC_INIT_MISC_LAT_TIMER 0x180# define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0# define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4# define R300_MC_MISC__MC_DISP0R_INIT_LAT_SHIFT 8# define R300_MC_MISC__MC_DISP1R_INIT_LAT_SHIFT 12# define R300_MC_MISC__MC_FIXED_INIT_LAT_SHIFT 16# define R300_MC_MISC__MC_E2R_INIT_LAT_SHIFT 20# define R300_MC_MISC__MC_SAME_PAGE_PRIO_SHIFT 24# define R300_MC_MISC__MC_GLOBW_INIT_LAT_SHIFT 28#define R300_MC_INIT_GFX_LAT_TIMER 0x154# define R300_MC_MISC__MC_G3D0R_INIT_LAT_SHIFT 0# define R300_MC_MISC__MC_G3D1R_INIT_LAT_SHIFT 4# define R300_MC_MISC__MC_G3D2R_INIT_LAT_SHIFT 8# define R300_MC_MISC__MC_G3D3R_INIT_LAT_SHIFT 12# define R300_MC_MISC__MC_TX0R_INIT_LAT_SHIFT 16# define R300_MC_MISC__MC_TX1R_INIT_LAT_SHIFT 20# define R300_MC_MISC__MC_GLOBR_INIT_LAT_SHIFT 24# define R300_MC_MISC__MC_GLOBW_FULL_LAT_SHIFT 28/* * This file contains registers and constants for the R300. They have been * found mostly by examining command buffers captured using glxtest, as well * as by extrapolating some known registers and constants from the R200. * I am fairly certain that they are correct unless stated otherwise * in comments. */#define R300_SE_VPORT_XSCALE 0x1D98#define R300_SE_VPORT_XOFFSET 0x1D9C#define R300_SE_VPORT_YSCALE 0x1DA0#define R300_SE_VPORT_YOFFSET 0x1DA4#define R300_SE_VPORT_ZSCALE 0x1DA8#define R300_SE_VPORT_ZOFFSET 0x1DAC/* * Vertex Array Processing (VAP) Control */#define R300_VAP_CNTL 0x2080# define R300_PVS_NUM_SLOTS_SHIFT 0# define R300_PVS_NUM_CNTLRS_SHIFT 4# define R300_PVS_NUM_FPUS_SHIFT 8# define R300_VF_MAX_VTX_NUM_SHIFT 18# define R300_GL_CLIP_SPACE_DEF (0 << 22)# define R300_DX_CLIP_SPACE_DEF (1 << 22)# define R500_TCL_STATE_OPTIMIZATION (1 << 23)/* This register is written directly and also starts data section * in many 3d CP_PACKET3's */#define R300_VAP_VF_CNTL 0x2084# define R300_VAP_VF_CNTL__PRIM_TYPE__SHIFT 0# define R300_VAP_VF_CNTL__PRIM_NONE (0<<0)# define R300_VAP_VF_CNTL__PRIM_POINTS (1<<0)# define R300_VAP_VF_CNTL__PRIM_LINES (2<<0)# define R300_VAP_VF_CNTL__PRIM_LINE_STRIP (3<<0)# define R300_VAP_VF_CNTL__PRIM_TRIANGLES (4<<0)# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN (5<<0)# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP (6<<0)# define R300_VAP_VF_CNTL__PRIM_LINE_LOOP (12<<0)# define R300_VAP_VF_CNTL__PRIM_QUADS (13<<0)# define R300_VAP_VF_CNTL__PRIM_QUAD_STRIP (14<<0)# define R300_VAP_VF_CNTL__PRIM_POLYGON (15<<0)# define R300_VAP_VF_CNTL__PRIM_WALK__SHIFT 4 /* State based - direct writes to registers trigger vertex generation */# define R300_VAP_VF_CNTL__PRIM_WALK_STATE_BASED (0<<4)# define R300_VAP_VF_CNTL__PRIM_WALK_INDICES (1<<4)# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST (2<<4)# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED (3<<4) /* I don't think I saw these three used.. */# define R300_VAP_VF_CNTL__COLOR_ORDER__SHIFT 6# define R300_VAP_VF_CNTL__TCL_OUTPUT_CTL_ENA__SHIFT 9# define R300_VAP_VF_CNTL__PROG_STREAM_ENA__SHIFT 10 /* index size - when not set the indices are assumed to be 16 bit */# define R300_VAP_VF_CNTL__INDEX_SIZE_32bit (1<<11) /* number of vertices */# define R300_VAP_VF_CNTL__NUM_VERTICES__SHIFT 16#define R500_VAP_INDEX_OFFSET 0x208c#define R300_VAP_OUTPUT_VTX_FMT_0 0x2090# define R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT (1<<0)# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT (1<<1)# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT (1<<2)# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT (1<<3)# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT (1<<4)# define R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT (1<<16)#define R300_VAP_OUTPUT_VTX_FMT_1 0x2094 /* each of the following is 3 bits wide, specifies number of components */# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21# define R300_VAP_OUTPUT_VTX_FMT_1__NOT_PRESENT 0# define R300_VAP_OUTPUT_VTX_FMT_1__1_COMPONENT 1# define R300_VAP_OUTPUT_VTX_FMT_1__2_COMPONENTS 2# define R300_VAP_OUTPUT_VTX_FMT_1__3_COMPONENTS 3# define R300_VAP_OUTPUT_VTX_FMT_1__4_COMPONENTS 4#define R300_SE_VTE_CNTL 0x20b0# define R300_VPORT_X_SCALE_ENA (1 << 0)# define R300_VPORT_X_OFFSET_ENA (1 << 1)# define R300_VPORT_Y_SCALE_ENA (1 << 2)# define R300_VPORT_Y_OFFSET_ENA (1 << 3)# define R300_VPORT_Z_SCALE_ENA (1 << 4)# define R300_VPORT_Z_OFFSET_ENA (1 << 5)# define R300_VTX_XY_FMT (1 << 8)# define R300_VTX_Z_FMT (1 << 9)# define R300_VTX_W0_FMT (1 << 10)# define R300_SERIAL_PROC_ENA (1 << 11)/* BEGIN: Vertex data assembly - lots of uncertainties *//* gap *//* Maximum Vertex Indx Clamp */#define R300_VAP_VF_MAX_VTX_INDX 0x2134/* Minimum Vertex Indx Clamp */#define R300_VAP_VF_MIN_VTX_INDX 0x2138/** Vertex assembler/processor control status */#define R300_VAP_CNTL_STATUS 0x2140/* No swap at all (default) */# define R300_VC_NO_SWAP (0 << 0)/* 16-bit swap: 0xAABBCCDD becomes 0xBBAADDCC */# define R300_VC_16BIT_SWAP (1 << 0)/* 32-bit swap: 0xAABBCCDD becomes 0xDDCCBBAA */# define R300_VC_32BIT_SWAP (2 << 0)/* Half-dword swap: 0xAABBCCDD becomes 0xCCDDAABB */# define R300_VC_HALF_DWORD_SWAP (3 << 0)/* The TCL engine will not be used (as it is logically or even physically removed) */# define R300_VAP_TCL_BYPASS (1 << 8)/* Read only flag if TCL engine is busy. */# define R300_VAP_PVS_BUSY (1 << 11)/* TODO: gap for MAX_MPS *//* Read only flag if the vertex store is busy. */# define R300_VAP_VS_BUSY (1 << 24)/* Read only flag if the reciprocal engine is busy. */# define R300_VAP_RCP_BUSY (1 << 25)/* Read only flag if the viewport transform engine is busy. */# define R300_VAP_VTE_BUSY (1 << 26)/* Read only flag if the memory interface unit is busy. */# define R300_VAP_MUI_BUSY (1 << 27)/* Read only flag if the vertex cache is busy. */# define R300_VAP_VC_BUSY (1 << 28)/* Read only flag if the vertex fetcher is busy. */# define R300_VAP_VF_BUSY (1 << 29)/* Read only flag if the register pipeline is busy. */# define R300_VAP_REGPIPE_BUSY (1 << 30)/* Read only flag if the VAP engine is busy. */# define R300_VAP_VAP_BUSY (1 << 31)/* gap *//* Where do we get our vertex data? * * Vertex data either comes either from immediate mode registers or from * vertex arrays. * There appears to be no mixed mode (though we can force the pitch of * vertex arrays to 0, effectively reusing the same element over and over * again). * * Immediate mode is controlled by the INPUT_CNTL registers. I am not sure * if these registers influence vertex array processing. * * Vertex arrays are controlled via the 3D_LOAD_VBPNTR packet3. * * In both cases, vertex attributes are then passed through INPUT_ROUTE. * * Beginning with INPUT_ROUTE_0_0 is a list of WORDs that route vertex data * into the vertex processor's input registers. * The first word routes the first input, the second word the second, etc. * The corresponding input is routed into the register with the given index. * The list is ended by a word with INPUT_ROUTE_END set. * * Always set COMPONENTS_4 in immediate mode. */#define R300_VAP_PROG_STREAM_CNTL_0 0x2150# define R300_DATA_TYPE_0_SHIFT 0# define R300_DATA_TYPE_FLOAT_1 0# define R300_DATA_TYPE_FLOAT_2 1# define R300_DATA_TYPE_FLOAT_3 2# define R300_DATA_TYPE_FLOAT_4 3# define R300_DATA_TYPE_BYTE 4# define R300_DATA_TYPE_D3DCOLOR 5# define R300_DATA_TYPE_SHORT_2 6# define R300_DATA_TYPE_SHORT_4 7# define R300_DATA_TYPE_VECTOR_3_TTT 8# define R300_DATA_TYPE_VECTOR_3_EET 9# define R300_SKIP_DWORDS_SHIFT 4# define R300_DST_VEC_LOC_SHIFT 8# define R300_LAST_VEC (1 << 13)# define R300_SIGNED (1 << 14)# define R300_NORMALIZE (1 << 15)# define R300_DATA_TYPE_1_SHIFT 16#define R300_VAP_PROG_STREAM_CNTL_1 0x2154#define R300_VAP_PROG_STREAM_CNTL_2 0x2158#define R300_VAP_PROG_STREAM_CNTL_3 0x215C#define R300_VAP_PROG_STREAM_CNTL_4 0x2160#define R300_VAP_PROG_STREAM_CNTL_5 0x2164#define R300_VAP_PROG_STREAM_CNTL_6 0x2168#define R300_VAP_PROG_STREAM_CNTL_7 0x216C/* gap *//* Notes: * - always set up to produce at least two attributes: * if vertex program uses only position, fglrx will set normal, too * - INPUT_CNTL_0_COLOR and INPUT_CNTL_COLOR bits are always equal. */#define R300_VAP_VTX_STATE_CNTL 0x2180# define R300_COLOR_0_ASSEMBLY_SHIFT 0# define R300_SEL_COLOR 0# define R300_SEL_USER_COLOR_0 1# define R300_SEL_USER_COLOR_1 2# define R300_COLOR_1_ASSEMBLY_SHIFT 2# define R300_COLOR_2_ASSEMBLY_SHIFT 4# define R300_COLOR_3_ASSEMBLY_SHIFT 6# define R300_COLOR_4_ASSEMBLY_SHIFT 8# define R300_COLOR_5_ASSEMBLY_SHIFT 10# define R300_COLOR_6_ASSEMBLY_SHIFT 12# define R300_COLOR_7_ASSEMBLY_SHIFT 14# define R300_UPDATE_USER_COLOR_0_ENA (1 << 16)/* * Each bit in this field applies to the corresponding vector in the VSM * memory (i.e. Bit 0 applies to VECTOR_0 (POSITION), etc.). If the bit * is set, then the corresponding 4-Dword Vector is output into the Vertex Stream. */#define R300_VAP_VSM_VTX_ASSM 0x2184# define R300_INPUT_CNTL_POS 0x00000001# define R300_INPUT_CNTL_NORMAL 0x00000002# define R300_INPUT_CNTL_COLOR 0x00000004# define R300_INPUT_CNTL_TC0 0x00000400# define R300_INPUT_CNTL_TC1 0x00000800# define R300_INPUT_CNTL_TC2 0x00001000 /* GUESS */# define R300_INPUT_CNTL_TC3 0x00002000 /* GUESS */# define R300_INPUT_CNTL_TC4 0x00004000 /* GUESS */# define R300_INPUT_CNTL_TC5 0x00008000 /* GUESS */# define R300_INPUT_CNTL_TC6 0x00010000 /* GUESS */# define R300_INPUT_CNTL_TC7 0x00020000 /* GUESS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -