diff options
| author | 2018-03-17 00:04:31 -0400 | |
|---|---|---|
| committer | 2018-03-17 00:04:31 -0400 | |
| commit | c2869217397deb0acab99beaf9fdea67c64a1d1c (patch) | |
| tree | 1fae055e600226d320adf4d9a7a78ab4aa308886 /src | |
| parent | Merge pull request #241 from Subv/gpu_method_call (diff) | |
| parent | GPU: Added the vertex array registers. (diff) | |
| download | yuzu-c2869217397deb0acab99beaf9fdea67c64a1d1c.tar.gz yuzu-c2869217397deb0acab99beaf9fdea67c64a1d1c.tar.xz yuzu-c2869217397deb0acab99beaf9fdea67c64a1d1c.zip | |
Merge pull request #243 from Subv/vertex_buffer
GPU: Added the vertex array registers.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 8870ef119..b3f45c85b 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -34,12 +34,14 @@ public: | |||
| 34 | struct Regs { | 34 | struct Regs { |
| 35 | static constexpr size_t NUM_REGS = 0xE36; | 35 | static constexpr size_t NUM_REGS = 0xE36; |
| 36 | 36 | ||
| 37 | static constexpr size_t NumVertexArrays = 32; | ||
| 38 | static constexpr size_t MaxShaderProgram = 6; | ||
| 39 | |||
| 37 | enum class QueryMode : u32 { | 40 | enum class QueryMode : u32 { |
| 38 | Write = 0, | 41 | Write = 0, |
| 39 | Sync = 1, | 42 | Sync = 1, |
| 40 | }; | 43 | }; |
| 41 | 44 | ||
| 42 | static constexpr size_t MaxShaderProgram = 6; | ||
| 43 | enum class ShaderProgram : u32 { | 45 | enum class ShaderProgram : u32 { |
| 44 | VertexA = 0, | 46 | VertexA = 0, |
| 45 | VertexB = 1, | 47 | VertexB = 1, |
| @@ -92,7 +94,34 @@ public: | |||
| 92 | } | 94 | } |
| 93 | } query; | 95 | } query; |
| 94 | 96 | ||
| 95 | INSERT_PADDING_WORDS(0x13C); | 97 | INSERT_PADDING_WORDS(0x3C); |
| 98 | |||
| 99 | struct { | ||
| 100 | union { | ||
| 101 | BitField<0, 12, u32> stride; | ||
| 102 | BitField<12, 1, u32> enable; | ||
| 103 | }; | ||
| 104 | u32 start_high; | ||
| 105 | u32 start_low; | ||
| 106 | u32 divisor; | ||
| 107 | |||
| 108 | GPUVAddr StartAddress() const { | ||
| 109 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(start_high) << 32) | | ||
| 110 | start_low); | ||
| 111 | } | ||
| 112 | } vertex_array[NumVertexArrays]; | ||
| 113 | |||
| 114 | INSERT_PADDING_WORDS(0x40); | ||
| 115 | |||
| 116 | struct { | ||
| 117 | u32 limit_high; | ||
| 118 | u32 limit_low; | ||
| 119 | |||
| 120 | GPUVAddr LimitAddress() const { | ||
| 121 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(limit_high) << 32) | | ||
| 122 | limit_low); | ||
| 123 | } | ||
| 124 | } vertex_array_limit[NumVertexArrays]; | ||
| 96 | 125 | ||
| 97 | struct { | 126 | struct { |
| 98 | union { | 127 | union { |
| @@ -148,6 +177,8 @@ private: | |||
| 148 | ASSERT_REG_POSITION(code_address, 0x582); | 177 | ASSERT_REG_POSITION(code_address, 0x582); |
| 149 | ASSERT_REG_POSITION(draw, 0x585); | 178 | ASSERT_REG_POSITION(draw, 0x585); |
| 150 | ASSERT_REG_POSITION(query, 0x6C0); | 179 | ASSERT_REG_POSITION(query, 0x6C0); |
| 180 | ASSERT_REG_POSITION(vertex_array[0], 0x700); | ||
| 181 | ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0); | ||
| 151 | ASSERT_REG_POSITION(shader_config[0], 0x800); | 182 | ASSERT_REG_POSITION(shader_config[0], 0x800); |
| 152 | ASSERT_REG_POSITION(shader_code, 0xE24); | 183 | ASSERT_REG_POSITION(shader_code, 0xE24); |
| 153 | 184 | ||