Просмотр исходного кода

vk_shader: Implement function ImageLoad (Used by Kirby Start Allies)

 Please enter the commit message for your changes. Lines starting
Nguyen Dac Nam 6 лет назад
Родитель
Сommit
f6f0762e81
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      src/video_core/renderer_vulkan/vk_shader_decompiler.cpp

+ 6 - 2
src/video_core/renderer_vulkan/vk_shader_decompiler.cpp

@@ -1748,8 +1748,12 @@ private:
     }
     }
 
 
     Expression ImageLoad(Operation operation) {
     Expression ImageLoad(Operation operation) {
-        UNIMPLEMENTED();
-        return {};
+        const auto& meta{std::get<MetaImage>(operation.GetMeta())};
+
+        const Id coords = GetCoordinates(operation, Type::Int);
+        const Id texel = OpImageRead(t_uint4, GetImage(operation), coords);
+
+        return {OpCompositeExtract(t_uint, texel, meta.element), Type::Uint};
     }
     }
 
 
     Expression ImageStore(Operation operation) {
     Expression ImageStore(Operation operation) {