summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-05-31 17:33:21 -0300
committerGravatar ReinUsesLisp2019-06-07 19:47:15 -0300
commit2f2a61887a2830cf8a1d5c40302fa0c199c6e317 (patch)
tree17bb8b94a9f889d4163ae90b99600aea71a2738d /src/video_core/engines
parentMerge pull request #2514 from ReinUsesLisp/opengl-compat (diff)
downloadyuzu-2f2a61887a2830cf8a1d5c40302fa0c199c6e317.tar.gz
yuzu-2f2a61887a2830cf8a1d5c40302fa0c199c6e317.tar.xz
yuzu-2f2a61887a2830cf8a1d5c40302fa0c199c6e317.zip
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 };