summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2018-08-11 02:35:47 +0200
committerDavid Marcec <dmarcecguzman@gmail.com>2018-08-11 02:35:47 +0200
commitb76ddb7647cbb390cce4143d91a1db171b0fa503 (patch)
treea6e2e334e82b035923c41458150604dd5fb31d65 /src/video_core/engines
parentAdded IsUserRegistrationRequestPermitted (diff)
parentMerge pull request #1007 from MerryMage/dynarmic (diff)
downloadyuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.tar
yuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.tar.gz
yuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.tar.bz2
yuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.tar.lz
yuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.tar.xz
yuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.tar.zst
yuzu-b76ddb7647cbb390cce4143d91a1db171b0fa503.zip
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp15
-rw-r--r--src/video_core/engines/maxwell_3d.h2
-rw-r--r--src/video_core/engines/shader_bytecode.h15
3 files changed, 18 insertions, 14 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 5c0ae8009..a46ed4bd7 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -23,12 +23,17 @@ Maxwell3D::Maxwell3D(VideoCore::RasterizerInterface& rasterizer, MemoryManager&
: memory_manager(memory_manager), rasterizer{rasterizer}, macro_interpreter(*this) {}
void Maxwell3D::CallMacroMethod(u32 method, std::vector<u32> parameters) {
- auto macro_code = uploaded_macros.find(method);
+ // Reset the current macro.
+ executing_macro = 0;
+
// The requested macro must have been uploaded already.
- ASSERT_MSG(macro_code != uploaded_macros.end(), "Macro %08X was not uploaded", method);
+ auto macro_code = uploaded_macros.find(method);
+ if (macro_code == uploaded_macros.end()) {
+ LOG_ERROR(HW_GPU, "Macro {:04X} was not uploaded", method);
+ return;
+ }
- // Reset the current macro and execute it.
- executing_macro = 0;
+ // Execute the current macro.
macro_interpreter.Execute(macro_code->second, std::move(parameters));
}
@@ -238,6 +243,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,
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index c7e3fb4b1..3d4557b7e 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -78,6 +78,8 @@ union Attribute {
// shader, and a tuple of (TessCoord.x, TessCoord.y, TessCoord.z, ~) when inside a Tess Eval
// shader.
TessCoordInstanceIDVertexID = 47,
+ // TODO(bunnei): Figure out what this is used for. Super Mario Odyssey uses this.
+ Unknown_63 = 63,
};
union {
@@ -254,20 +256,15 @@ union Instruction {
BitField<56, 1, u64> invert_b;
} lop32i;
- float GetImm20_19() const {
- float result{};
+ u32 GetImm20_19() const {
u32 imm{static_cast<u32>(imm20_19)};
imm <<= 12;
imm |= negate_imm ? 0x80000000 : 0;
- std::memcpy(&result, &imm, sizeof(imm));
- return result;
+ return imm;
}
- float GetImm20_32() const {
- float result{};
- s32 imm{static_cast<s32>(imm20_32)};
- std::memcpy(&result, &imm, sizeof(imm));
- return result;
+ u32 GetImm20_32() const {
+ return static_cast<u32>(imm20_32);
}
s32 GetSignedImm20_20() const {