summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-07 01:42:32 +0200
committerbunnei <bunneidev@gmail.com>2018-06-07 01:47:41 +0200
commit00c830405bb8f9cbc8725473b6d244a3f32aee0e (patch)
tree7ff6c4fb63590bb8aaecb4a0bc9ecd8f7454012a
parentshader_bytecode: Add instruction decodings for BFE, IMNMX, and XMAD. (diff)
downloadyuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.tar
yuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.tar.gz
yuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.tar.bz2
yuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.tar.lz
yuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.tar.xz
yuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.tar.zst
yuzu-00c830405bb8f9cbc8725473b6d244a3f32aee0e.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 3067ce3b3..999b1e561 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1112,13 +1112,11 @@ private:
break;
}
case OpCode::Type::Memory: {
- const Attribute::Index attribute = instr.attribute.fmt20.index;
-
switch (opcode->GetId()) {
case OpCode::Id::LD_A: {
ASSERT_MSG(instr.attribute.fmt20.size == 0, "untested");
regs.SetRegisterToInputAttibute(instr.gpr0, instr.attribute.fmt20.element,
- attribute);
+ instr.attribute.fmt20.index);
break;
}
case OpCode::Id::LD_C: {
@@ -1150,12 +1148,11 @@ private:
}
case OpCode::Id::ST_A: {
ASSERT_MSG(instr.attribute.fmt20.size == 0, "untested");
- regs.SetOutputAttributeToRegister(attribute, instr.attribute.fmt20.element,
- instr.gpr0);
+ regs.SetOutputAttributeToRegister(instr.attribute.fmt20.index,
+ instr.attribute.fmt20.element, instr.gpr0);
break;
}
case OpCode::Id::TEX: {
- ASSERT_MSG(instr.attribute.fmt20.size == 4, "untested");
const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8);
const std::string op_b = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
const std::string sampler = GetSampler(instr.sampler);
@@ -1168,7 +1165,7 @@ private:
const std::string texture = "texture(" + sampler + ", coords)";
size_t dest_elem{};
- for (size_t elem = 0; elem < instr.attribute.fmt20.size; ++elem) {
+ for (size_t elem = 0; elem < 4; ++elem) {
if (!instr.tex.IsComponentEnabled(elem)) {
// Skip disabled components
continue;
@@ -1181,7 +1178,6 @@ private:
break;
}
case OpCode::Id::TEXS: {
- ASSERT_MSG(instr.attribute.fmt20.size == 4, "untested");
const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8);
const std::string op_b = regs.GetRegisterAsFloat(instr.gpr20);
const std::string sampler = GetSampler(instr.sampler);