38enum class Register : u16 {
46#define REXGPU_REGISTER(index, type, name) name = (index),
47#include <rex/xenos/register_table.inc>
65 u32 matching_contexts : 8;
66 u32 rb_copy_dest_base_ena : 1;
67 u32 dest_base_0_ena : 1;
68 u32 dest_base_1_ena : 1;
69 u32 dest_base_2_ena : 1;
70 u32 dest_base_3_ena : 1;
71 u32 dest_base_4_ena : 1;
72 u32 dest_base_5_ena : 1;
73 u32 dest_base_6_ena : 1;
74 u32 dest_base_7_ena : 1;
76 u32 vc_action_ena : 1;
77 u32 tc_action_ena : 1;
78 u32 pglb_action_ena : 1;
82 static constexpr Register kRegisterIndex = xenos::Register::COHER_STATUS_HOST;
91 u32 wait_re_vsync : 1;
92 u32 wait_fe_vsync : 1;
94 u32 wait_dsply_id0 : 1;
95 u32 wait_dsply_id1 : 1;
96 u32 wait_dsply_id2 : 1;
100 u32 wait_2d_idle : 1;
101 u32 wait_3d_idle : 1;
102 u32 wait_2d_idleclean : 1;
103 u32 wait_3d_idleclean : 1;
105 u32 cmdfifo_entries : 4;
108 static constexpr Register kRegisterIndex = xenos::Register::WAIT_UNTIL;
110REX_STATIC_ASSERT_SIZE(
WAIT_UNTIL,
sizeof(u32));
124 u32 gen_index_pix : 1;
127 u32 ps_export_mode : 4;
128 u32 gen_index_vtx : 1;
130 static constexpr Register kRegisterIndex = xenos::Register::SQ_PROGRAM_CNTL;
138 u32 inst_pred_optimize : 1;
139 u32 sc_output_screen_xy : 1;
150 u32 perfcounter_ref : 1;
151 u32 yield_optimize : 1;
152 u32 tx_cache_sel : 1;
155 static constexpr Register kRegisterIndex = xenos::Register::SQ_CONTEXT_MISC;
163 u32 param_shade : 16;
167 static constexpr Register kRegisterIndex = xenos::Register::SQ_INTERPOLATOR_CNTL;
180 static constexpr Register kRegisterIndex = xenos::Register::SQ_VS_CONST;
193 static constexpr Register kRegisterIndex = xenos::Register::SQ_PS_CONST;
205 static constexpr Register kRegisterIndex = xenos::Register::VGT_DMA_SIZE;
217 xenos::IndexFormat index_size : 1;
220 u32 num_indices : 16;
222 static constexpr Register kRegisterIndex = xenos::Register::VGT_DRAW_INITIATOR;
233 static constexpr Register kRegisterIndex = xenos::Register::VGT_MULTI_PRIM_IB_RESET_INDX;
243 static constexpr Register kRegisterIndex = xenos::Register::VGT_INDX_OFFSET;
254 static constexpr Register kRegisterIndex = xenos::Register::VGT_MIN_VTX_INDX;
265 static constexpr Register kRegisterIndex = xenos::Register::VGT_MAX_VTX_INDX;
276 static constexpr Register kRegisterIndex = xenos::Register::VGT_OUTPUT_PATH_CNTL;
283 xenos::TessellationMode tess_mode : 2;
286 static constexpr Register kRegisterIndex = xenos::Register::VGT_HOS_CNTL;
297 static constexpr Register kRegisterIndex = xenos::Register::PA_SU_POINT_MINMAX;
308 static constexpr Register kRegisterIndex = xenos::Register::PA_SU_POINT_SIZE;
321 xenos::PolygonType polymode_front_ptype : 3;
322 xenos::PolygonType polymode_back_ptype : 3;
334 u32 provoking_vtx_last : 1;
335 u32 persp_corr_dis : 1;
338 u32 quad_order_enable : 1;
339 u32 sc_one_quad_per_clock : 1;
342 static constexpr Register kRegisterIndex = xenos::Register::PA_SU_SC_MODE_CNTL;
351 xenos::VertexQuantization quant_mode : 3;
354 static constexpr Register kRegisterIndex = xenos::Register::PA_SU_VTX_CNTL;
362 u32 mpass_pix_vec_per_pass : 20;
364 u32 mpass_ps_ena : 1;
366 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_MPASS_PS_CNTL;
374 u32 viz_query_ena : 1;
375 u32 viz_query_id : 6;
380 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_VIZ_QUERY;
397 u32 boundary_edge_flag_ena : 1;
399 u32 dis_clip_err_detect : 1;
401 u32 xy_nan_retain : 1;
402 u32 z_nan_retain : 1;
403 u32 w_nan_retain : 1;
409 static constexpr Register kRegisterIndex = xenos::Register::PA_CL_CLIP_CNTL;
426 u32 perfcounter_ref : 1;
429 static constexpr Register kRegisterIndex = xenos::Register::PA_CL_VTE_CNTL;
442 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_SCREEN_SCISSOR_TL;
455 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_SCREEN_SCISSOR_BR;
468 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_WINDOW_OFFSET;
482 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_WINDOW_SCISSOR_TL;
495 static constexpr Register kRegisterIndex = xenos::Register::PA_SC_WINDOW_SCISSOR_BR;
506 static constexpr Register kRegisterIndex = xenos::Register::RB_MODECONTROL;
519 static constexpr Register kRegisterIndex = xenos::Register::RB_SURFACE_INFO;
527 xenos::CompareFunction alpha_func : 3;
528 u32 alpha_test_enable : 1;
539 u32 alpha_to_mask_offset1 : 2;
540 u32 alpha_to_mask_offset2 : 2;
541 u32 alpha_to_mask_offset3 : 2;
543 static constexpr Register kRegisterIndex = xenos::Register::RB_COLORCONTROL;
553 u32 color_base_bit_11 : 1;
559 static constexpr Register kRegisterIndex = xenos::Register::RB_COLOR_INFO;
571 u32 write_green0 : 1;
573 u32 write_alpha0 : 1;
575 u32 write_green1 : 1;
577 u32 write_alpha1 : 1;
579 u32 write_green2 : 1;
581 u32 write_alpha2 : 1;
583 u32 write_green3 : 1;
585 u32 write_alpha3 : 1;
588 static constexpr Register kRegisterIndex = xenos::Register::RB_COLOR_MASK;
605 static constexpr Register kRegisterIndex = xenos::Register::RB_BLENDCONTROL0;
615 u32 stencil_enable : 1;
617 u32 z_write_enable : 1;
619 xenos::CompareFunction zfunc : 3;
621 xenos::CompareFunction stencilfunc : 3;
625 xenos::CompareFunction stencilfunc_bf : 3;
626 xenos::StencilOp stencilfail_bf : 3;
627 xenos::StencilOp stencilzpass_bf : 3;
628 xenos::StencilOp stencilzfail_bf : 3;
630 static constexpr Register kRegisterIndex = xenos::Register::RB_DEPTHCONTROL;
640 u32 stencilwritemask : 8;
643 static constexpr Register kRegisterIndex = xenos::Register::RB_STENCILREFMASK;
653 u32 depth_base_bit_11 : 1;
658 static constexpr Register kRegisterIndex = xenos::Register::RB_DEPTH_INFO;
670 u32 color_clear_enable : 1;
671 u32 depth_clear_enable : 1;
673 xenos::CopyCommand copy_command : 2;
676 static constexpr Register kRegisterIndex = xenos::Register::RB_COPY_CONTROL;
691 u32 copy_dest_swap : 1;
694 static constexpr Register kRegisterIndex = xenos::Register::RB_COPY_DEST_INFO;
707 static constexpr Register kRegisterIndex = xenos::Register::RB_COPY_DEST_PITCH;
718 static constexpr Register kRegisterIndex = xenos::Register::DC_LUT_RW_INDEX;
729 static constexpr Register kRegisterIndex = xenos::Register::DC_LUT_SEQ_COLOR;
745 static constexpr Register kRegisterIndex = xenos::Register::DC_LUT_PWL_DATA;
753 u32 color_10_blue : 10;
754 u32 color_10_green : 10;
755 u32 color_10_red : 10;
758 static constexpr Register kRegisterIndex = xenos::Register::DC_LUT_30_COLOR;
766namespace rex::xenos {
769 enum class Type : u8 {
805 template <
typename T>
807 return std::bit_cast<T>(values[
reg]);
815 template <
typename T>
825 template <
typename T>
827 return Get<T>(T::kRegisterIndex);
840 &values[std::to_underlying(xenos::Register::SHADER_CONSTANT_FETCH_00_0) +
841 (
sizeof(fetch) /
sizeof(u32)) * index],
856 &values[std::to_underlying(xenos::Register::SHADER_CONSTANT_FETCH_00_0) +
857 (
sizeof(fetch) /
sizeof(u32)) * index],
872 &values[std::to_underlying(xenos::Register::SHADER_CONSTANT_000_X) +
873 4 * float_constant_index],
888 case static_cast<u32
>(Register::RB_EDRAM_TIMING):
890 case static_cast<u32
>(Register::RB_BC_CONTROL):
892 case static_cast<u32
>(Register::D1MODE_V_COUNTER):
894 case static_cast<u32
>(Register::D1MODE_VBLANK_VLINE_STATUS):
896 case static_cast<u32
>(Register::AVIVO_D1MODE_VIEWPORT_SIZE):
#define REX_ASSERT(cond,...)
Definition assert.h:84
Definition register.h:777
u32 & operator[](u32 reg)
Definition register.h:793
u32 & operator[](Register reg)
Definition register.h:795
T Get() const
Definition register.h:826
T Get(Register reg) const
Definition register.h:816
xenos::MemExportStream GetMemExportStream(u32 float_constant_index) const
Definition register.h:868
const u32 & operator[](Register reg) const
Definition register.h:794
xenos::TextureFetch GetTextureFetch(u32 index) const
Definition register.h:852
T Get(u32 reg) const
Definition register.h:806
const u32 & operator[](u32 reg) const
Definition register.h:792
static const RegisterInfo * GetRegisterInfo(u32 index)
xenos::VertexFetch GetVertexFetch(u32 index) const
Definition register.h:836
static constexpr size_t kRegisterCount
Definition register.h:788
Fetch constant layouts, texture sampling enums and limits.
std::optional< u32 > ReadFixedRegister(u32 index, const VideoMode &mode)
Definition register.h:886
constexpr u32 kViewportLimit
Definition register.h:880
Xenos pipeline state, shader and EDRAM enums.
PolygonModeEnable
Definition state.h:280
SampleControl
Definition state.h:238
PrimitiveType
Definition state.h:35
BlendFactor
Definition state.h:142
MSAASamples
Definition state.h:69
BlendOp
Definition state.h:161
CopySampleSelect
Definition state.h:341
SourceSelect
Definition state.h:177
VGTOutputPath
Definition state.h:265
PixelCenter
Definition state.h:294
VertexRounding
Definition state.h:300
VertexShaderExportMode
Definition state.h:224
EDRAMMode
Definition state.h:317
MajorMode
Definition state.h:185
Definition register.h:768
u32 kill_pix_post_detail_mask
u32 window_offset_disable
u32 poly_offset_para_enable
xenos::PolygonModeEnable poly_mode
u32 poly_offset_back_enable
u32 vtx_window_offset_enable
u32 poly_offset_front_enable
xenos::PixelCenter pix_center
u32 alpha_to_mask_offset0
xenos::StencilOp stencilzfail
xenos::StencilOp stencilzpass
xenos::StencilOp stencilfail
xenos::MajorMode major_mode
Integer types, byte order wrappers and size literals.
Definition register.h:750
Definition register.h:734
Definition register.h:712
Definition register.h:723
Definition register.h:384
Definition register.h:413
Definition register.h:359
Definition register.h:447
Definition register.h:434
Definition register.h:371
Definition register.h:460
Definition register.h:487
Definition register.h:473
Definition register.h:291
Definition register.h:302
Definition register.h:313
Definition register.h:346
Definition register.h:593
static const Register kRTRegisterIndices[4]
Definition register.h:607
Definition register.h:524
Definition register.h:548
static const Register kRTRegisterIndices[4]
Definition register.h:561
Definition register.h:566
Definition register.h:663
Definition register.h:681
Definition register.h:699
Definition register.h:612
Definition register.h:648
Definition register.h:500
Definition register.h:635
Definition register.h:511
Definition register.h:135
Definition register.h:160
Definition register.h:113
Definition register.h:185
Definition register.h:172
Definition register.h:198
Definition register.h:209
Definition register.h:280
Definition register.h:237
Definition register.h:259
Definition register.h:248
Definition register.h:227
Definition register.h:270