1
0
Fork 0
forked from suyu/suyu

emit_spirv: Fix RescalingLayout alignment

This commit is contained in:
ameerj 2021-08-04 00:30:16 -04:00 committed by Fernando Sahmkow
parent e66d5b88a6
commit dc28284437
2 changed files with 3 additions and 3 deletions

View file

@ -23,8 +23,8 @@ constexpr u32 NUM_TEXTURE_AND_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;
alignas(16) std::array<u32, NUM_TEXTURE_SCALING_WORDS> rescaling_textures;
alignas(16) std::array<u32, NUM_IMAGE_SCALING_WORDS> rescaling_images;
};
[[nodiscard]] std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,

View file

@ -479,7 +479,7 @@ void GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling) {
}
if (update_rescaling) {
const f32 config_down_factor{Settings::values.resolution_info.down_factor};
const float scale_down_factor{is_rescaling ? config_down_factor : 1.0f};
const f32 scale_down_factor{is_rescaling ? config_down_factor : 1.0f};
cmdbuf.PushConstants(*pipeline_layout, VK_SHADER_STAGE_ALL_GRAPHICS, 0,
sizeof(scale_down_factor), &scale_down_factor);
}