summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar Subv2018-03-16 19:23:11 -0500
committerGravatar Subv2018-03-16 19:23:11 -0500
commitcbec739e7b26c2197872b32e88f2c954d272a531 (patch)
tree51ea6c2911ca9270bd3eaaaa917117d2b21cc167 /src/video_core
parentMerge pull request #236 from bunnei/refactor-process-creation (diff)
downloadyuzu-cbec739e7b26c2197872b32e88f2c954d272a531.tar.gz
yuzu-cbec739e7b26c2197872b32e88f2c954d272a531.tar.xz
yuzu-cbec739e7b26c2197872b32e88f2c954d272a531.zip
GPU: Added Maxwell registers for Shader Program control.
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/engines/maxwell_3d.h57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 93f7698a0..a2ad28732 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -30,9 +30,37 @@ public:
30 Sync = 1, 30 Sync = 1,
31 }; 31 };
32 32
33 static constexpr size_t MaxShaderProgram = 6;
34 enum class ShaderProgram : u32 {
35 VertexA = 0,
36 VertexB = 1,
37 TesselationControl = 2,
38 TesselationEval = 3,
39 Geometry = 4,
40 Fragment = 5,
41 };
42
43 enum class ShaderType : u32 {
44 Vertex = 0,
45 TesselationControl = 1,
46 TesselationEval = 2,
47 Geometry = 3,
48 Fragment = 4,
49 };
50
33 union { 51 union {
34 struct { 52 struct {
35 INSERT_PADDING_WORDS(0x585); 53 INSERT_PADDING_WORDS(0x582);
54 struct {
55 u32 code_address_high;
56 u32 code_address_low;
57
58 GPUVAddr CodeAddress() const {
59 return static_cast<GPUVAddr>(
60 (static_cast<GPUVAddr>(code_address_high) << 32) | code_address_low);
61 }
62 } code_address;
63 INSERT_PADDING_WORDS(1);
36 struct { 64 struct {
37 u32 vertex_end_gl; 65 u32 vertex_end_gl;
38 u32 vertex_begin_gl; 66 u32 vertex_begin_gl;
@@ -54,7 +82,28 @@ public:
54 (static_cast<GPUVAddr>(query_address_high) << 32) | query_address_low); 82 (static_cast<GPUVAddr>(query_address_high) << 32) | query_address_low);
55 } 83 }
56 } query; 84 } query;
57 INSERT_PADDING_WORDS(0x772); 85
86 INSERT_PADDING_WORDS(0x13C);
87
88 struct {
89 union {
90 BitField<0, 1, u32> enable;
91 BitField<4, 4, ShaderProgram> program;
92 };
93 u32 start_id;
94 INSERT_PADDING_WORDS(1);
95 u32 gpr_alloc;
96 ShaderType type;
97 INSERT_PADDING_WORDS(9);
98 } shader_config[6];
99
100 INSERT_PADDING_WORDS(0x5D0);
101
102 struct {
103 u32 shader_code_call;
104 u32 shader_code_args;
105 } shader_code;
106 INSERT_PADDING_WORDS(0x10);
58 }; 107 };
59 std::array<u32, NUM_REGS> reg_array; 108 std::array<u32, NUM_REGS> reg_array;
60 }; 109 };
@@ -76,7 +125,11 @@ private:
76 static_assert(offsetof(Maxwell3D::Regs, field_name) == position * 4, \ 125 static_assert(offsetof(Maxwell3D::Regs, field_name) == position * 4, \
77 "Field " #field_name " has invalid position") 126 "Field " #field_name " has invalid position")
78 127
128ASSERT_REG_POSITION(code_address, 0x582);
129ASSERT_REG_POSITION(draw, 0x585);
79ASSERT_REG_POSITION(query, 0x6C0); 130ASSERT_REG_POSITION(query, 0x6C0);
131ASSERT_REG_POSITION(shader_config[0], 0x800);
132ASSERT_REG_POSITION(shader_code, 0xE24);
80 133
81#undef ASSERT_REG_POSITION 134#undef ASSERT_REG_POSITION
82 135