[spv] write down workgroup size

This commit is contained in:
Dzmitry Malyshau
2020-12-06 15:23:58 -05:00
committed by Dzmitry Malyshau
parent b597bc5af6
commit e0c2178b3f
2 changed files with 16 additions and 3 deletions

View File

@@ -93,10 +93,14 @@ pub(super) fn instruction_entry_point(
pub(super) fn instruction_execution_mode(
entry_point_id: Word,
execution_mode: spirv::ExecutionMode,
args: &[Word],
) -> Instruction {
let mut instruction = Instruction::new(Op::ExecutionMode);
instruction.add_operand(entry_point_id);
instruction.add_operand(execution_mode as u32);
for arg in args {
instruction.add_operand(*arg);
}
instruction
}

View File

@@ -421,11 +421,20 @@ impl Writer {
crate::ShaderStage::Vertex => {}
crate::ShaderStage::Fragment => {
let execution_mode = spirv::ExecutionMode::OriginUpperLeft;
self.try_add_capabilities(execution_mode.required_capabilities());
super::instructions::instruction_execution_mode(function_id, execution_mode)
//self.try_add_capabilities(execution_mode.required_capabilities());
super::instructions::instruction_execution_mode(function_id, execution_mode, &[])
.to_words(&mut self.logical_layout.execution_modes);
}
crate::ShaderStage::Compute => {}
crate::ShaderStage::Compute => {
let execution_mode = spirv::ExecutionMode::LocalSize;
//self.try_add_capabilities(execution_mode.required_capabilities());
super::instructions::instruction_execution_mode(
function_id,
execution_mode,
&entry_point.workgroup_size,
)
.to_words(&mut self.logical_layout.execution_modes);
}
}
if self.writer_flags.contains(WriterFlags::DEBUG) {