mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
[glsl-out] Set workgroup_size for compute shaders
This commit is contained in:
1 parent
04b1f44396
commit
6e37f336bd
2 files changed
+12
No files matched your search
@@ -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