shader: generate SPIR-V dispatch and marshal handler arguments

This commit is contained in:
nmzik committed 2026-09-12 13:42:15 +04:00
1 parent 1d1f00bdef
commit 59ef88c959
8 files changed
+912 -637

No files matched your search

+8 -2
View File
@@ -8689,8 +8689,14 @@ void TestNewShaderRecompilerDispatcherSpillsU32x3() {
definition.Emit(IR::ValueOpcode::CompositeConstructU32x3,
{IR::Value(1u), IR::Value(2u), IR::Value(3u)});
IR::IREmitter use(program.blocks[2]);
use.Emit(IR::ValueOpcode::CompositeExtractU32x3, {vector, IR::Value(2u)});
use.Emit(IR::ValueOpcode::CompositeExtractU32x3, {vector, IR::Value(1u)});
const auto high =
use.Emit(IR::ValueOpcode::CompositeExtractU32x3, {vector, IR::Value(2u)});
const auto middle =
use.Emit(IR::ValueOpcode::CompositeExtractU32x3, {vector, IR::Value(1u)});
// Composite indices stay literal; arithmetic immediates become constant IDs.
// Resolving either arithmetic input must reuse the same dispatcher load.
const auto sum = use.Emit(IR::ValueOpcode::IAdd32, {high, IR::Value(7u)});
use.Emit(IR::ValueOpcode::IAdd32, {sum, middle});
auto spirv = ShaderRecompiler::Spirv::EmitProgram(program,
options.input_info);