maxwell_3d: Use correct const buffer size and check bounds.
- Fixes mem corruption with Super Mario Odyssey and Pokkén Tournament DX.
This commit is contained in:
		| @@ -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(); | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bunnei
					bunnei