spirv: Remove dependencies on Environment when generating SPIR-V
This commit is contained in:
parent
cb6039ccea
commit
675a82416d
5 changed files with 15 additions and 16 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
@ -19,6 +20,7 @@ struct Program {
|
|||
BlockList post_order_blocks;
|
||||
Info info;
|
||||
Stage stage{};
|
||||
std::array<u32, 3> workgroup_size{};
|
||||
};
|
||||
|
||||
[[nodiscard]] std::string DumpProgram(const Program& program);
|
||||
|
|
|
@ -33,6 +33,9 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
|
|||
program.blocks = VisitAST(inst_pool, block_pool, env, cfg);
|
||||
program.post_order_blocks = PostOrder(program.blocks);
|
||||
program.stage = env.ShaderStage();
|
||||
if (program.stage == Stage::Compute) {
|
||||
program.workgroup_size = env.WorkgroupSize();
|
||||
}
|
||||
RemoveUnreachableBlocks(program);
|
||||
|
||||
// Replace instructions before the SSA rewrite
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue