diff options
Diffstat (limited to 'src')
4 files changed, 19 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp index 807494063..77ee6dc0e 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -211,8 +211,7 @@ void EmitYDirection(EmitContext& ctx, IR::Inst& inst) { | |||
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) { | 213 | void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) { |
| 214 | UNIMPLEMENTED(); | 214 | ctx.Add("MOV.F {}.x,program.env[0].x;", inst); |
| 215 | ctx.Add("MOV.F {}.x,1;", inst); | ||
| 216 | } | 215 | } |
| 217 | 216 | ||
| 218 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) { | 217 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) { |
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index 4e6f2c0fe..7c9ed9159 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -393,6 +393,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile | |||
| 393 | DefineGenericOutput(index, program.invocations); | 393 | DefineGenericOutput(index, program.invocations); |
| 394 | } | 394 | } |
| 395 | } | 395 | } |
| 396 | if (info.uses_rescaling_uniform) { | ||
| 397 | header += "layout(location=0) uniform float down_factor;"; | ||
| 398 | } | ||
| 396 | DefineConstantBuffers(bindings); | 399 | DefineConstantBuffers(bindings); |
| 397 | DefineStorageBuffers(bindings); | 400 | DefineStorageBuffers(bindings); |
| 398 | SetupImages(bindings); | 401 | SetupImages(bindings); |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp index f4ed090e3..3db3083f9 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp | |||
| @@ -446,8 +446,7 @@ void EmitYDirection(EmitContext& ctx, IR::Inst& inst) { | |||
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) { | 448 | void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) { |
| 449 | UNIMPLEMENTED(); | 449 | ctx.AddF32("{}=down_factor;", inst); |
| 450 | ctx.AddF32("{}=1.0f;", inst); | ||
| 451 | } | 450 | } |
| 452 | 451 | ||
| 453 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) { | 452 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) { |
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index 0bbda7951..92fda9af0 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | |||
| @@ -443,11 +443,24 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 443 | if (!is_built.load(std::memory_order::relaxed)) { | 443 | if (!is_built.load(std::memory_order::relaxed)) { |
| 444 | WaitForBuild(); | 444 | WaitForBuild(); |
| 445 | } | 445 | } |
| 446 | if (assembly_programs[0].handle != 0) { | 446 | const bool use_assembly{assembly_programs[0].handle != 0}; |
| 447 | const bool is_rescaling{texture_cache.IsRescaling()}; | ||
| 448 | const f32 config_down_factor{Settings::values.resolution_info.down_factor}; | ||
| 449 | const f32 down_factor{is_rescaling ? config_down_factor : 1.0f}; | ||
| 450 | if (use_assembly) { | ||
| 447 | program_manager.BindAssemblyPrograms(assembly_programs, enabled_stages_mask); | 451 | program_manager.BindAssemblyPrograms(assembly_programs, enabled_stages_mask); |
| 448 | } else { | 452 | } else { |
| 449 | program_manager.BindSourcePrograms(source_programs); | 453 | program_manager.BindSourcePrograms(source_programs); |
| 450 | } | 454 | } |
| 455 | for (size_t stage = 0; stage < source_programs.size(); ++stage) { | ||
| 456 | if (stage_infos[stage].uses_rescaling_uniform) { | ||
| 457 | if (use_assembly) { | ||
| 458 | glProgramEnvParameter4fARB(AssemblyStage(stage), 0, down_factor, 0.0f, 0.0f, 1.0f); | ||
| 459 | } else { | ||
| 460 | glProgramUniform1f(source_programs[stage].handle, 0, down_factor); | ||
| 461 | } | ||
| 462 | } | ||
| 463 | } | ||
| 451 | const VideoCommon::ImageViewInOut* views_it{views.data()}; | 464 | const VideoCommon::ImageViewInOut* views_it{views.data()}; |
| 452 | GLsizei texture_binding = 0; | 465 | GLsizei texture_binding = 0; |
| 453 | GLsizei image_binding = 0; | 466 | GLsizei image_binding = 0; |