mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-out] Set workgroup_size for compute shaders
This commit is contained in:
committed by
Dzmitry Malyshau
parent
04b1f44396
commit
6e37f336bd
@@ -376,6 +376,16 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
writeln!(self.out)?;
|
||||
}
|
||||
|
||||
if self.options.shader_stage == ShaderStage::Compute {
|
||||
let workgroup_size = self.entry_point.workgroup_size;
|
||||
writeln!(
|
||||
self.out,
|
||||
"layout(local_size_x = {}, local_size_y = {}, local_size_z = {}) in;",
|
||||
workgroup_size[0], workgroup_size[1], workgroup_size[2]
|
||||
)?;
|
||||
writeln!(self.out)?;
|
||||
}
|
||||
|
||||
// Enable early depth tests if needed
|
||||
if let Some(depth_test) = self.entry_point.early_depth_test {
|
||||
writeln!(self.out, "layout(early_fragment_tests) in;")?;
|
||||
|
||||
@@ -6,6 +6,8 @@ expression: string
|
||||
|
||||
precision highp float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
void main() {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user