diff options
| author | 2021-05-29 01:06:29 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:36 -0400 | |
| commit | 55e0211a5e520482246273f2cc64388c4b4eff1c (patch) | |
| tree | 1ae4461b0384924e90d2bdbaebcec1b57fdcabcd /src/shader_recompiler/backend/glsl/emit_context.cpp | |
| parent | glsl: Rework Shuffle emit instructions to align with SPIR-V (diff) | |
| download | yuzu-55e0211a5e520482246273f2cc64388c4b4eff1c.tar.gz yuzu-55e0211a5e520482246273f2cc64388c4b4eff1c.tar.xz yuzu-55e0211a5e520482246273f2cc64388c4b4eff1c.zip | |
glsl: Implement TEX ImageSample functions
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index db62ba73b..eb1d8266f 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -23,6 +23,10 @@ std::string_view InterpDecorator(Interpolation interp) { | |||
| 23 | 23 | ||
| 24 | std::string_view SamplerType(TextureType type) { | 24 | std::string_view SamplerType(TextureType type) { |
| 25 | switch (type) { | 25 | switch (type) { |
| 26 | case TextureType::Color1D: | ||
| 27 | return "sampler1D"; | ||
| 28 | case TextureType::ColorArray1D: | ||
| 29 | return "sampler1DArray"; | ||
| 26 | case TextureType::Color2D: | 30 | case TextureType::Color2D: |
| 27 | return "sampler2D"; | 31 | return "sampler2D"; |
| 28 | case TextureType::ColorArray2D: | 32 | case TextureType::ColorArray2D: |
| @@ -31,6 +35,10 @@ std::string_view SamplerType(TextureType type) { | |||
| 31 | return "sampler3D"; | 35 | return "sampler3D"; |
| 32 | case TextureType::ColorCube: | 36 | case TextureType::ColorCube: |
| 33 | return "samplerCube"; | 37 | return "samplerCube"; |
| 38 | case TextureType::ColorArrayCube: | ||
| 39 | return "samplerCubeArray"; | ||
| 40 | case TextureType::Buffer: | ||
| 41 | return "samplerBuffer"; | ||
| 34 | default: | 42 | default: |
| 35 | fmt::print("Texture type: {}", type); | 43 | fmt::print("Texture type: {}", type); |
| 36 | throw NotImplementedException("Texture type: {}", type); | 44 | throw NotImplementedException("Texture type: {}", type); |
| @@ -101,6 +109,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile | |||
| 101 | 109 | ||
| 102 | void EmitContext::SetupExtensions(std::string&) { | 110 | void EmitContext::SetupExtensions(std::string&) { |
| 103 | header += "#extension GL_ARB_separate_shader_objects : enable\n"; | 111 | header += "#extension GL_ARB_separate_shader_objects : enable\n"; |
| 112 | header += "#extension GL_ARB_sparse_texture2 : enable\n"; | ||
| 104 | // header += "#extension GL_ARB_texture_cube_map_array : enable\n"; | 113 | // header += "#extension GL_ARB_texture_cube_map_array : enable\n"; |
| 105 | if (info.uses_int64) { | 114 | if (info.uses_int64) { |
| 106 | header += "#extension GL_ARB_gpu_shader_int64 : enable\n"; | 115 | header += "#extension GL_ARB_gpu_shader_int64 : enable\n"; |