diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-08-01 23:57:45 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:29 +0100 |
commit | e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf (patch) | |
tree | 0107548906df0b9d42e89451489be6a54ed71bf3 /src/video_core/renderer_opengl/gl_compute_pipeline.cpp | |
parent | shader: Properly blacklist and scale image loads (diff) | |
download | yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.gz yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.bz2 yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.lz yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.xz yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.zst yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_compute_pipeline.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp index 60c65047b..9af61c340 100644 --- a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp @@ -181,33 +181,40 @@ void ComputePipeline::Configure() { texture_binding += num_texture_buffers; image_binding += num_image_buffers; - u32 scaling_mask{}; + u32 texture_scaling_mask{}; for (const auto& desc : info.texture_descriptors) { for (u32 index = 0; index < desc.count; ++index) { ImageView& image_view{texture_cache.GetImageView((views_it++)->id)}; textures[texture_binding] = image_view.Handle(desc.type); if (texture_cache.IsRescaling(image_view)) { - scaling_mask |= 1u << texture_binding; + texture_scaling_mask |= 1u << texture_binding; } ++texture_binding; } } + u32 image_scaling_mask{}; for (const auto& desc : info.image_descriptors) { for (u32 index = 0; index < desc.count; ++index) { ImageView& image_view{texture_cache.GetImageView((views_it++)->id)}; if (desc.is_written) { texture_cache.MarkModification(image_view.image_id); } - images[image_binding++] = image_view.StorageView(desc.type, desc.format); + images[image_binding] = image_view.StorageView(desc.type, desc.format); + if (texture_cache.IsRescaling(image_view)) { + image_scaling_mask |= 1u << image_binding; + } + ++image_binding; } } if (info.uses_rescaling_uniform) { - const f32 float_scaling_mask{Common::BitCast<f32>(scaling_mask)}; + const f32 float_texture_scaling_mask{Common::BitCast<f32>(texture_scaling_mask)}; + const f32 float_image_scaling_mask{Common::BitCast<f32>(image_scaling_mask)}; if (assembly_program.handle != 0) { - glProgramLocalParameter4fARB(GL_COMPUTE_PROGRAM_NV, 0, float_scaling_mask, 0.0f, 0.0f, - 0.0f); + glProgramLocalParameter4fARB(GL_COMPUTE_PROGRAM_NV, 0, float_texture_scaling_mask, + float_image_scaling_mask, 0.0f, 0.0f); } else { - glProgramUniform4f(source_program.handle, 0, float_scaling_mask, 0.0f, 0.0f, 0.0f); + glProgramUniform4f(source_program.handle, 0, float_texture_scaling_mask, + float_image_scaling_mask, 0.0f, 0.0f); } } if (texture_binding != 0) { |