summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-08 19:16:34 -0400
committerGravatar GitHub2018-08-08 19:16:34 -0400
commit9ceceb212f1381cdae4f1df769e44216cd70dedb (patch)
tree2f9a3c36756c4b15f099870f350bd961cd8ae639 /src/video_core/engines
parentMerge pull request #978 from bunnei/fixioctl (diff)
parentmaxwell_3d: Use correct const buffer size and check bounds. (diff)
downloadyuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.gz
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.xz
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.zip
Merge pull request #981 from bunnei/cbuf-corrupt
maxwell_3d: Use correct const buffer size and check bounds.
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp2
-rw-r--r--src/video_core/engines/maxwell_3d.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 5c0ae8009..ed22a2090 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -238,6 +238,8 @@ void Maxwell3D::ProcessCBBind(Regs::ShaderStage stage) {
238 238
239 auto& buffer = shader.const_buffers[bind_data.index]; 239 auto& buffer = shader.const_buffers[bind_data.index];
240 240
241 ASSERT(bind_data.index < Regs::MaxConstBuffers);
242
241 buffer.enabled = bind_data.valid.Value() != 0; 243 buffer.enabled = bind_data.valid.Value() != 0;
242 buffer.index = bind_data.index; 244 buffer.index = bind_data.index;
243 buffer.address = regs.const_buffer.BufferAddress(); 245 buffer.address = regs.const_buffer.BufferAddress();
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 4d0ff96a5..0506ac8fe 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -44,7 +44,7 @@ public:
44 static constexpr size_t MaxShaderProgram = 6; 44 static constexpr size_t MaxShaderProgram = 6;
45 static constexpr size_t MaxShaderStage = 5; 45 static constexpr size_t MaxShaderStage = 5;
46 // Maximum number of const buffers per shader stage. 46 // Maximum number of const buffers per shader stage.
47 static constexpr size_t MaxConstBuffers = 16; 47 static constexpr size_t MaxConstBuffers = 18;
48 48
49 enum class QueryMode : u32 { 49 enum class QueryMode : u32 {
50 Write = 0, 50 Write = 0,