Skip to content

Commit

Permalink
fix: Correct number of allocated VGPRs.
Browse files Browse the repository at this point in the history
  • Loading branch information
squidbus committed Feb 13, 2025
1 parent 5f2467b commit c9d425d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/video_core/amdgpu/liverpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ struct Liverpool {
const u32 num_dwords = bininfo.length / sizeof(u32);
return std::span{code, num_dwords};
}

[[nodiscard]] u32 NumVgprs() const {
// Each increment allocates 4 registers, where 0 = 4 registers.
return (settings.num_vgprs + 1) * 4;
}
};

struct HsTessFactorClamp {
Expand Down
2 changes: 1 addition & 1 deletion src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Shader::RuntimeInfo& PipelineCache::BuildRuntimeInfo(Stage stage, LogicalS
const auto BuildCommon = [&](const auto& program) {
info.num_user_data = program.settings.num_user_regs;
info.num_input_vgprs = program.settings.vgpr_comp_cnt;
info.num_allocated_vgprs = program.settings.num_vgprs * 4;
info.num_allocated_vgprs = program.NumVgprs();
info.fp_denorm_mode32 = program.settings.fp_denorm_mode32;
info.fp_round_mode32 = program.settings.fp_round_mode32;
};
Expand Down

0 comments on commit c9d425d

Please sign in to comment.