summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-09 01:16:34 +0200
committerGitHub <noreply@github.com>2018-08-09 01:16:34 +0200
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
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.gz
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.bz2
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.lz
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.xz
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.tar.zst
yuzu-9ceceb212f1381cdae4f1df769e44216cd70dedb.zip
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) {
auto& buffer = shader.const_buffers[bind_data.index];
+ ASSERT(bind_data.index < Regs::MaxConstBuffers);
+
buffer.enabled = bind_data.valid.Value() != 0;
buffer.index = bind_data.index;
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:
static constexpr size_t MaxShaderProgram = 6;
static constexpr size_t MaxShaderStage = 5;
// Maximum number of const buffers per shader stage.
- static constexpr size_t MaxConstBuffers = 16;
+ static constexpr size_t MaxConstBuffers = 18;
enum class QueryMode : u32 {
Write = 0,