summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index bd40356a1..14c009535 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -327,11 +327,12 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
327 327
328 for (size_t index = 0; index < info.input_generics.size(); ++index) { 328 for (size_t index = 0; index < info.input_generics.size(); ++index) {
329 const auto& generic{info.input_generics[index]}; 329 const auto& generic{info.input_generics[index]};
330 if (generic.used) { 330 if (!generic.used || !runtime_info.previous_stage_stores_generic[index]) {
331 header += fmt::format("layout(location={}){}in vec4 in_attr{}{};", index, 331 continue;
332 InterpDecorator(generic.interpolation), index,
333 InputArrayDecorator(stage));
334 } 332 }
333 header +=
334 fmt::format("layout(location={}){}in vec4 in_attr{}{};", index,
335 InterpDecorator(generic.interpolation), index, InputArrayDecorator(stage));
335 } 336 }
336 for (size_t index = 0; index < info.uses_patches.size(); ++index) { 337 for (size_t index = 0; index < info.uses_patches.size(); ++index) {
337 if (!info.uses_patches[index]) { 338 if (!info.uses_patches[index]) {
@@ -349,10 +350,10 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
349 } 350 }
350 } 351 }
351 for (size_t index = 0; index < info.stores_generics.size(); ++index) { 352 for (size_t index = 0; index < info.stores_generics.size(); ++index) {
352 // TODO: Properly resolve attribute issues 353 if (!info.stores_generics[index]) {
353 if (info.stores_generics[index] || StageInitializesVaryings()) { 354 continue;
354 DefineGenericOutput(index, program.invocations);
355 } 355 }
356 DefineGenericOutput(index, program.invocations);
356 } 357 }
357 DefineConstantBuffers(bindings); 358 DefineConstantBuffers(bindings);
358 DefineStorageBuffers(bindings); 359 DefineStorageBuffers(bindings);
@@ -362,17 +363,6 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
362 DefineConstants(); 363 DefineConstants();
363} 364}
364 365
365bool EmitContext::StageInitializesVaryings() const noexcept {
366 switch (stage) {
367 case Stage::VertexA:
368 case Stage::VertexB:
369 case Stage::Geometry:
370 return true;
371 default:
372 return false;
373 }
374}
375
376void EmitContext::SetupExtensions() { 366void EmitContext::SetupExtensions() {
377 if (info.uses_shadow_lod && profile.support_gl_texture_shadow_lod) { 367 if (info.uses_shadow_lod && profile.support_gl_texture_shadow_lod) {
378 header += "#extension GL_EXT_texture_shadow_lod : enable\n"; 368 header += "#extension GL_EXT_texture_shadow_lod : enable\n";