mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[hlsl-out] Fix panic with shader with multiple entry points without argument
This commit is contained in:
committed by
Dzmitry Malyshau
parent
1c5d538ab4
commit
c9a782f8d6
@@ -542,7 +542,15 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
}
|
||||
back::FunctionType::EntryPoint(index) => {
|
||||
// EntryPoint arguments wrapped into structure
|
||||
if !self.ep_inputs.is_empty() {
|
||||
// We need to ensure that entry points have arguments too.
|
||||
// For the case when we working with multiple entry points
|
||||
// for example vertex shader with arguments and fragment shader without arguments.
|
||||
if !self.ep_inputs.is_empty()
|
||||
&& !module.entry_points[index as usize]
|
||||
.function
|
||||
.arguments
|
||||
.is_empty()
|
||||
{
|
||||
if let Some(ref ep_input) = self.ep_inputs[index as usize] {
|
||||
write!(
|
||||
self.out,
|
||||
|
||||
Reference in New Issue
Block a user