diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-08-01 18:57:45 -0300 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:29 +0100 |
commit | e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf (patch) | |
tree | 0107548906df0b9d42e89451489be6a54ed71bf3 /src/shader_recompiler/backend/spirv/emit_spirv.h | |
parent | fc9bb3c3fed4721b06bda46deea3770e5285b104 (diff) |
shader: Properly scale image reads and add GL SPIR-V support
Thanks for everything!
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv.h')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index 7b0d8d9800..db0998ad6f 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h @@ -16,15 +16,23 @@ namespace Shader::Backend::SPIRV { +constexpr u32 NUM_TEXTURE_SCALING_WORDS = 4; +constexpr u32 NUM_IMAGE_SCALING_WORDS = 2; +constexpr u32 NUM_TEXTURE_AND_IMAGE_SCALING_WORDS = + NUM_TEXTURE_SCALING_WORDS + NUM_IMAGE_SCALING_WORDS; + +struct RescalingLayout { + u32 down_factor; + std::array<u32, NUM_TEXTURE_SCALING_WORDS> rescaling_textures; + std::array<u32, NUM_IMAGE_SCALING_WORDS> rescaling_images; +}; + [[nodiscard]] std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program, Bindings& bindings); [[nodiscard]] inline std::vector<u32> EmitSPIRV(const Profile& profile, IR::Program& program) { - RuntimeInfo runtime_info{}; - runtime_info.num_textures = Shader::NumDescriptors(program.info.texture_descriptors); - Bindings binding; - return EmitSPIRV(profile, runtime_info, program, binding); + return EmitSPIRV(profile, {}, program, binding); } } // namespace Shader::Backend::SPIRV |