diff options
| author | 2018-03-18 21:04:29 -0400 | |
|---|---|---|
| committer | 2018-03-18 21:04:29 -0400 | |
| commit | 2332a44b681473509ca67438b5b3a2bddc91a60b (patch) | |
| tree | 5545b96de601215931683edc9f24e841b4b99528 /src | |
| parent | Merge pull request #248 from Subv/cb_data (diff) | |
| parent | GPU: Implement macro 0xE1A BindTextureInfoBuffer in HLE. (diff) | |
| download | yuzu-2332a44b681473509ca67438b5b3a2bddc91a60b.tar.gz yuzu-2332a44b681473509ca67438b5b3a2bddc91a60b.tar.xz yuzu-2332a44b681473509ca67438b5b3a2bddc91a60b.zip | |
Merge pull request #249 from Subv/macro_E1A
GPU: Implement macro 0xE1A BindTextureInfoBuffer in HLE.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 18 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 12 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 3a4e88e4e..4fdea0fdc 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -12,6 +12,7 @@ namespace Engines { | |||
| 12 | constexpr u32 MacroRegistersStart = 0xE00; | 12 | constexpr u32 MacroRegistersStart = 0xE00; |
| 13 | 13 | ||
| 14 | const std::unordered_map<u32, Maxwell3D::MethodInfo> Maxwell3D::method_handlers = { | 14 | const std::unordered_map<u32, Maxwell3D::MethodInfo> Maxwell3D::method_handlers = { |
| 15 | {0xE1A, {"BindTextureInfoBuffer", 1, &Maxwell3D::BindTextureInfoBuffer}}, | ||
| 15 | {0xE24, {"SetShader", 5, &Maxwell3D::SetShader}}, | 16 | {0xE24, {"SetShader", 5, &Maxwell3D::SetShader}}, |
| 16 | {0xE2A, {"BindStorageBuffer", 1, &Maxwell3D::BindStorageBuffer}}, | 17 | {0xE2A, {"BindStorageBuffer", 1, &Maxwell3D::BindStorageBuffer}}, |
| 17 | }; | 18 | }; |
| @@ -160,6 +161,23 @@ void Maxwell3D::DrawArrays() { | |||
| 160 | LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring"); | 161 | LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring"); |
| 161 | } | 162 | } |
| 162 | 163 | ||
| 164 | void Maxwell3D::BindTextureInfoBuffer(const std::vector<u32>& parameters) { | ||
| 165 | /** | ||
| 166 | * Parameters description: | ||
| 167 | * [0] = Shader stage, usually 4 for FragmentShader | ||
| 168 | */ | ||
| 169 | |||
| 170 | u32 stage = parameters[0]; | ||
| 171 | |||
| 172 | // Perform the same operations as the real macro code. | ||
| 173 | GPUVAddr address = static_cast<GPUVAddr>(regs.tex_info_buffers.address[stage]) << 8; | ||
| 174 | u32 size = regs.tex_info_buffers.size[stage]; | ||
| 175 | |||
| 176 | regs.const_buffer.cb_size = size; | ||
| 177 | regs.const_buffer.cb_address_high = address >> 32; | ||
| 178 | regs.const_buffer.cb_address_low = address & 0xFFFFFFFF; | ||
| 179 | } | ||
| 180 | |||
| 163 | void Maxwell3D::SetShader(const std::vector<u32>& parameters) { | 181 | void Maxwell3D::SetShader(const std::vector<u32>& parameters) { |
| 164 | /** | 182 | /** |
| 165 | * Parameters description: | 183 | * Parameters description: |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 3e97d9045..5d9b0043b 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -178,7 +178,14 @@ public: | |||
| 178 | } | 178 | } |
| 179 | } ssbo_info; | 179 | } ssbo_info; |
| 180 | 180 | ||
| 181 | INSERT_PADDING_WORDS(0x11D); | 181 | INSERT_PADDING_WORDS(0x11); |
| 182 | |||
| 183 | struct { | ||
| 184 | u32 address[MaxShaderStage]; | ||
| 185 | u32 size[MaxShaderStage]; | ||
| 186 | } tex_info_buffers; | ||
| 187 | |||
| 188 | INSERT_PADDING_WORDS(0x102); | ||
| 182 | }; | 189 | }; |
| 183 | std::array<u32, NUM_REGS> reg_array; | 190 | std::array<u32, NUM_REGS> reg_array; |
| 184 | }; | 191 | }; |
| @@ -240,6 +247,7 @@ private: | |||
| 240 | void DrawArrays(); | 247 | void DrawArrays(); |
| 241 | 248 | ||
| 242 | /// Method call handlers | 249 | /// Method call handlers |
| 250 | void BindTextureInfoBuffer(const std::vector<u32>& parameters); | ||
| 243 | void SetShader(const std::vector<u32>& parameters); | 251 | void SetShader(const std::vector<u32>& parameters); |
| 244 | void BindStorageBuffer(const std::vector<u32>& parameters); | 252 | void BindStorageBuffer(const std::vector<u32>& parameters); |
| 245 | 253 | ||
| @@ -266,6 +274,8 @@ ASSERT_REG_POSITION(const_buffer, 0x8E0); | |||
| 266 | ASSERT_REG_POSITION(cb_bind[0], 0x904); | 274 | ASSERT_REG_POSITION(cb_bind[0], 0x904); |
| 267 | ASSERT_REG_POSITION(tex_cb_index, 0x982); | 275 | ASSERT_REG_POSITION(tex_cb_index, 0x982); |
| 268 | ASSERT_REG_POSITION(ssbo_info, 0xD18); | 276 | ASSERT_REG_POSITION(ssbo_info, 0xD18); |
| 277 | ASSERT_REG_POSITION(tex_info_buffers.address[0], 0xD2A); | ||
| 278 | ASSERT_REG_POSITION(tex_info_buffers.size[0], 0xD2F); | ||
| 269 | 279 | ||
| 270 | #undef ASSERT_REG_POSITION | 280 | #undef ASSERT_REG_POSITION |
| 271 | 281 | ||