summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/ir_emitter.cpp
diff options
context:
space:
mode:
authorGravatar FernandoS272021-03-26 16:02:04 +0100
committerGravatar ameerj2021-07-22 21:51:24 -0400
commit742d11c2ad948c8630be15901514ec9e5e5fcd20 (patch)
tree4d9e0976f8c95fbb5c8006b46579200315b04f0f /src/shader_recompiler/frontend/ir/ir_emitter.cpp
parentshader: Fix Array Indices in TEX/TLD4 (diff)
downloadyuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.gz
yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.xz
yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.zip
shader: Implement TLD4.PTP
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.cpp')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index b365a8a6e..f49c30484 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -398,15 +398,16 @@ Value IREmitter::CompositeConstruct(const Value& e1, const Value& e2) {
398 if (e1.Type() != e2.Type()) { 398 if (e1.Type() != e2.Type()) {
399 throw InvalidArgument("Mismatching types {} and {}", e1.Type(), e2.Type()); 399 throw InvalidArgument("Mismatching types {} and {}", e1.Type(), e2.Type());
400 } 400 }
401 CompositeDecoration decor{};
401 switch (e1.Type()) { 402 switch (e1.Type()) {
402 case Type::U32: 403 case Type::U32:
403 return Inst(Opcode::CompositeConstructU32x2, e1, e2); 404 return Inst(Opcode::CompositeConstructU32x2, Flags{decor}, e1, e2);
404 case Type::F16: 405 case Type::F16:
405 return Inst(Opcode::CompositeConstructF16x2, e1, e2); 406 return Inst(Opcode::CompositeConstructF16x2, Flags{decor}, e1, e2);
406 case Type::F32: 407 case Type::F32:
407 return Inst(Opcode::CompositeConstructF32x2, e1, e2); 408 return Inst(Opcode::CompositeConstructF32x2, Flags{decor}, e1, e2);
408 case Type::F64: 409 case Type::F64:
409 return Inst(Opcode::CompositeConstructF64x2, e1, e2); 410 return Inst(Opcode::CompositeConstructF64x2, Flags{decor}, e1, e2);
410 default: 411 default:
411 ThrowInvalidType(e1.Type()); 412 ThrowInvalidType(e1.Type());
412 } 413 }
@@ -436,6 +437,7 @@ Value IREmitter::CompositeConstruct(const Value& e1, const Value& e2, const Valu
436 throw InvalidArgument("Mismatching types {}, {}, {}, and {}", e1.Type(), e2.Type(), 437 throw InvalidArgument("Mismatching types {}, {}, {}, and {}", e1.Type(), e2.Type(),
437 e3.Type(), e4.Type()); 438 e3.Type(), e4.Type());
438 } 439 }
440 CompositeDecoration decor{};
439 switch (e1.Type()) { 441 switch (e1.Type()) {
440 case Type::U32: 442 case Type::U32:
441 return Inst(Opcode::CompositeConstructU32x4, e1, e2, e3, e4); 443 return Inst(Opcode::CompositeConstructU32x4, e1, e2, e3, e4);
@@ -445,6 +447,8 @@ Value IREmitter::CompositeConstruct(const Value& e1, const Value& e2, const Valu
445 return Inst(Opcode::CompositeConstructF32x4, e1, e2, e3, e4); 447 return Inst(Opcode::CompositeConstructF32x4, e1, e2, e3, e4);
446 case Type::F64: 448 case Type::F64:
447 return Inst(Opcode::CompositeConstructF64x4, e1, e2, e3, e4); 449 return Inst(Opcode::CompositeConstructF64x4, e1, e2, e3, e4);
450 case Type::U32x2:
451 return Inst(Opcode::CompositeConstructArrayU32x2, Flags{decor}, e1, e2, e3, e4);
448 default: 452 default:
449 ThrowInvalidType(e1.Type()); 453 ThrowInvalidType(e1.Type());
450 } 454 }
@@ -1481,7 +1485,7 @@ Value IREmitter::ImageGather(const Value& handle, const Value& coords, const Val
1481} 1485}
1482 1486
1483Value IREmitter::ImageGatherDref(const Value& handle, const Value& coords, const Value& offset, 1487Value IREmitter::ImageGatherDref(const Value& handle, const Value& coords, const Value& offset,
1484 const Value& offset2, const F32& dref, TextureInstInfo info) { 1488 const Value& offset2, const F32& dref, TextureInstInfo info) {
1485 const Opcode op{handle.IsImmediate() ? Opcode::BoundImageGatherDref 1489 const Opcode op{handle.IsImmediate() ? Opcode::BoundImageGatherDref
1486 : Opcode::BindlessImageGatherDref}; 1490 : Opcode::BindlessImageGatherDref};
1487 return Inst(op, Flags{info}, handle, coords, offset, offset2, dref); 1491 return Inst(op, Flags{info}, handle, coords, offset, offset2, dref);