diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-18 06:07:01 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-21 22:32:48 +0200 |
commit | 675f23aedc9a3a99925068e952cbcb3faf88296a (patch) | |
tree | 01b3101c3837428903bb91f29d02fa2c099468a6 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | shader_bytecode: Add SULD encoding (diff) | |
download | yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.tar yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.tar.gz yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.tar.bz2 yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.tar.lz yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.tar.xz yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.tar.zst yuzu-675f23aedc9a3a99925068e952cbcb3faf88296a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 76439e7ab..70ce6572b 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -19,6 +19,7 @@ #include "video_core/renderer_opengl/gl_device.h" #include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_shader_decompiler.h" +#include "video_core/shader/node.h" #include "video_core/shader/shader_ir.h" namespace OpenGL::GLShader { @@ -398,8 +399,6 @@ public: usage.is_read, usage.is_written); } entries.clip_distances = ir.GetClipDistances(); - entries.shader_viewport_layer_array = - IsVertexShader(stage) && (ir.UsesLayer() || ir.UsesViewportIndex()); entries.shader_length = ir.GetLength(); return entries; } @@ -1801,6 +1800,19 @@ private: return {tmp, Type::Float}; } + Expression ImageLoad(Operation operation) { + if (!device.HasImageLoadFormatted()) { + LOG_ERROR(Render_OpenGL, + "Device lacks GL_EXT_shader_image_load_formatted, stubbing image load"); + return {"0", Type::Int}; + } + + const auto meta{std::get<MetaImage>(operation.GetMeta())}; + return {fmt::format("imageLoad({}, {}){}", GetImage(meta.image), + BuildIntegerCoordinates(operation), GetSwizzle(meta.element)), + Type::Float}; + } + Expression ImageStore(Operation operation) { const auto meta{std::get<MetaImage>(operation.GetMeta())}; code.AddLine("imageStore({}, {}, {});", GetImage(meta.image), @@ -2164,6 +2176,7 @@ private: &GLSLDecompiler::TextureQueryLod, &GLSLDecompiler::TexelFetch, + &GLSLDecompiler::ImageLoad, &GLSLDecompiler::ImageStore, &GLSLDecompiler::AtomicImageAdd, &GLSLDecompiler::AtomicImageMin, |