summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorNguyen Dac Nam <nam.kazt.91@gmail.com>2020-03-09 13:33:26 +0100
committernamkazy <nam.kazt.91@gmail.com>2020-04-05 05:31:26 +0200
commit6d235b8631697b81b08ee6f10f2fc79dc2956a50 (patch)
treeb37823bea3b0e818728b94063730524679f61740 /src/video_core
parentci: Update to Windows Server 2019 and Visual Studio 2019 (diff)
downloadyuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.tar
yuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.tar.gz
yuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.tar.bz2
yuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.tar.lz
yuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.tar.xz
yuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.tar.zst
yuzu-6d235b8631697b81b08ee6f10f2fc79dc2956a50.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/shader/decode/image.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/video_core/shader/decode/image.cpp b/src/video_core/shader/decode/image.cpp
index d2fe4ec5d..02bfef524 100644
--- a/src/video_core/shader/decode/image.cpp
+++ b/src/video_core/shader/decode/image.cpp
@@ -53,7 +53,6 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
switch (opcode->get().GetId()) {
case OpCode::Id::SULD: {
- UNIMPLEMENTED_IF(instr.suldst.mode != Tegra::Shader::SurfaceDataMode::P);
UNIMPLEMENTED_IF(instr.suldst.out_of_bounds_store !=
Tegra::Shader::OutOfBoundsStore::Ignore);
@@ -62,17 +61,34 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
: GetBindlessImage(instr.gpr39, type)};
image.MarkRead();
- u32 indexer = 0;
- for (u32 element = 0; element < 4; ++element) {
- if (!instr.suldst.IsComponentEnabled(element)) {
- continue;
+ if (instr.suldst.mode == Tegra::Shader::SurfaceDataMode::P) {
+ u32 indexer = 0;
+ for (u32 element = 0; element < 4; ++element) {
+ if (!instr.suldst.IsComponentEnabled(element)) {
+ continue;
+ }
+ MetaImage meta{image, {}, element};
+ Node value = Operation(OperationCode::ImageLoad, meta, GetCoordinates(type));
+ SetTemporary(bb, indexer++, std::move(value));
+ }
+ for (u32 i = 0; i < indexer; ++i) {
+ SetRegister(bb, instr.gpr0.Value() + i, GetTemporary(i));
+ }
+ } else if (instr.suldst.mode == Tegra::Shader::SurfaceDataMode::D_BA) {
+ UNIMPLEMENTED_IF(instr.suldst.GetStoreDataLayout() != StoreType::Bits32);
+
+ switch (instr.suldst.GetStoreDataLayout()) {
+ case StoreType::Bits32: {
+ MetaImage meta{image, {}, {}};
+ Node value = Operation(OperationCode::ImageLoad, meta, GetCoordinates(type));
+ SetTemporary(bb, 0, std::move(value));
+ SetRegister(bb, instr.gpr0.Value(), GetTemporary(0));
+ break;
+ }
+ default:
+ UNREACHABLE();
+ break;
}
- MetaImage meta{image, {}, element};
- Node value = Operation(OperationCode::ImageLoad, meta, GetCoordinates(type));
- SetTemporary(bb, indexer++, std::move(value));
- }
- for (u32 i = 0; i < indexer; ++i) {
- SetRegister(bb, instr.gpr0.Value() + i, GetTemporary(i));
}
break;
}