summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar bunnei2019-06-17 22:35:04 -0400
committerGravatar GitHub2019-06-17 22:35:04 -0400
commitc7b5c245e1e6c8ec27e26cd767a34eeb8531580b (patch)
treeb0139c242f5a609e73e253e5d717dc5149527bfb /src/video_core/engines
parentMerge pull request #2538 from ReinUsesLisp/ssy-pbk (diff)
parentgl_rasterizer: Remove unused parameters in descriptor uploads (diff)
downloadyuzu-c7b5c245e1e6c8ec27e26cd767a34eeb8531580b.tar.gz
yuzu-c7b5c245e1e6c8ec27e26cd767a34eeb8531580b.tar.xz
yuzu-c7b5c245e1e6c8ec27e26cd767a34eeb8531580b.zip
Merge pull request #2562 from ReinUsesLisp/split-cbuf-upload
video_core/engines: Move ConstBufferInfo out of Maxwell3D
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/const_buffer_info.h17
-rw-r--r--src/video_core/engines/maxwell_3d.cpp4
-rw-r--r--src/video_core/engines/maxwell_3d.h8
3 files changed, 19 insertions, 10 deletions
diff --git a/src/video_core/engines/const_buffer_info.h b/src/video_core/engines/const_buffer_info.h
new file mode 100644
index 000000000..d8f672462
--- /dev/null
+++ b/src/video_core/engines/const_buffer_info.h
@@ -0,0 +1,17 @@
1// Copyright 2019 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "common/common_types.h"
8
9namespace Tegra::Engines {
10
11struct ConstBufferInfo {
12 GPUVAddr address;
13 u32 size;
14 bool enabled;
15};
16
17} // namespace Tegra::Engines
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 39968d403..08d553696 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -396,12 +396,10 @@ void Maxwell3D::ProcessCBBind(Regs::ShaderStage stage) {
396 auto& shader = state.shader_stages[static_cast<std::size_t>(stage)]; 396 auto& shader = state.shader_stages[static_cast<std::size_t>(stage)];
397 auto& bind_data = regs.cb_bind[static_cast<std::size_t>(stage)]; 397 auto& bind_data = regs.cb_bind[static_cast<std::size_t>(stage)];
398 398
399 auto& buffer = shader.const_buffers[bind_data.index];
400
401 ASSERT(bind_data.index < Regs::MaxConstBuffers); 399 ASSERT(bind_data.index < Regs::MaxConstBuffers);
400 auto& buffer = shader.const_buffers[bind_data.index];
402 401
403 buffer.enabled = bind_data.valid.Value() != 0; 402 buffer.enabled = bind_data.valid.Value() != 0;
404 buffer.index = bind_data.index;
405 buffer.address = regs.const_buffer.BufferAddress(); 403 buffer.address = regs.const_buffer.BufferAddress();
406 buffer.size = regs.const_buffer.cb_size; 404 buffer.size = regs.const_buffer.cb_size;
407} 405}
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index f342c78e6..13e314944 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -15,6 +15,7 @@
15#include "common/common_funcs.h" 15#include "common/common_funcs.h"
16#include "common/common_types.h" 16#include "common/common_types.h"
17#include "common/math_util.h" 17#include "common/math_util.h"
18#include "video_core/engines/const_buffer_info.h"
18#include "video_core/engines/engine_upload.h" 19#include "video_core/engines/engine_upload.h"
19#include "video_core/gpu.h" 20#include "video_core/gpu.h"
20#include "video_core/macro_interpreter.h" 21#include "video_core/macro_interpreter.h"
@@ -1112,13 +1113,6 @@ public:
1112 static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable"); 1113 static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable");
1113 1114
1114 struct State { 1115 struct State {
1115 struct ConstBufferInfo {
1116 GPUVAddr address;
1117 u32 index;
1118 u32 size;
1119 bool enabled;
1120 };
1121
1122 struct ShaderStageInfo { 1116 struct ShaderStageInfo {
1123 std::array<ConstBufferInfo, Regs::MaxConstBuffers> const_buffers; 1117 std::array<ConstBufferInfo, Regs::MaxConstBuffers> const_buffers;
1124 }; 1118 };