summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_context.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-31 07:12:52 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:37 +0200
commit3a024b302622068f4842715a7f0b31652898a606 (patch)
treed49557bf93c1a201c535db48c203b3331e4cec91 /src/shader_recompiler/backend/glsl/emit_context.cpp
parentglsl: SHFL fix and prefer shift operations over divide in glsl shader (diff)
downloadyuzu-3a024b302622068f4842715a7f0b31652898a606.tar
yuzu-3a024b302622068f4842715a7f0b31652898a606.tar.gz
yuzu-3a024b302622068f4842715a7f0b31652898a606.tar.bz2
yuzu-3a024b302622068f4842715a7f0b31652898a606.tar.lz
yuzu-3a024b302622068f4842715a7f0b31652898a606.tar.xz
yuzu-3a024b302622068f4842715a7f0b31652898a606.tar.zst
yuzu-3a024b302622068f4842715a7f0b31652898a606.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index 8de33b582..2a5ec7414 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -126,6 +126,8 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
void EmitContext::SetupExtensions(std::string&) {
// TODO: track this usage
header += "#extension GL_ARB_sparse_texture2 : enable\n";
+ header += "#extension GL_ARB_shader_viewport_layer_array : enable\n";
+ header += "#extension GL_NV_viewport_array2 : enable\n";
header += "#extension GL_EXT_texture_shadow_lod : enable\n";
if (info.uses_int64) {
header += "#extension GL_ARB_gpu_shader_int64 : enable\n";
@@ -243,9 +245,13 @@ void EmitContext::SetupImages(Bindings& bindings) {
}
texture_buffer_bindings.reserve(info.texture_buffer_descriptors.size());
for (const auto& desc : info.texture_buffer_descriptors) {
- throw NotImplementedException("TextureType::Buffer");
-
texture_buffer_bindings.push_back(bindings.texture);
+ const auto sampler_type{SamplerType(TextureType::Buffer, false)};
+ const auto indices{bindings.texture + desc.count};
+ for (u32 index = bindings.texture; index < indices; ++index) {
+ header += fmt::format("layout(binding={}) uniform {} tex{};", bindings.texture,
+ sampler_type, index);
+ }
bindings.texture += desc.count;
}
texture_bindings.reserve(info.texture_descriptors.size());