mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[spv] write down workgroup size
This commit is contained in:
committed by
Dzmitry Malyshau
parent
b597bc5af6
commit
e0c2178b3f
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user