From 52f57c2e9793f95893d2b73987dbafba2e10ab75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Grzesik?= Date: Fri, 7 Jul 2017 14:48:10 +0200 Subject: [PATCH] Remove fallback value in execution mode --- vulkano-shaders/src/entry_point.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vulkano-shaders/src/entry_point.rs b/vulkano-shaders/src/entry_point.rs index 8b4640bc..8ebc023a 100644 --- a/vulkano-shaders/src/entry_point.rs +++ b/vulkano-shaders/src/entry_point.rs @@ -89,26 +89,26 @@ pub fn write_entry_point(doc: &parse::Spirv, instruction: &parse::Instruction) - }, enums::ExecutionModel::ExecutionModelGeometry => { - let mut execution_mode = "Points"; // fallback value - + let mut execution_mode = None; + for instruction in doc.instructions.iter() { if let &parse::Instruction::ExecutionMode { target_id, ref mode, .. } = instruction { if target_id != id { continue; } execution_mode = match mode { - &enums::ExecutionMode::ExecutionModeInputPoints => "Points", - &enums::ExecutionMode::ExecutionModeInputLines => "Lines", - &enums::ExecutionMode::ExecutionModeInputLinesAdjacency => "LinesWithAdjacency", - &enums::ExecutionMode::ExecutionModeTriangles => "Triangles", - &enums::ExecutionMode::ExecutionModeInputTrianglesAdjacency => "TrianglesWithAdjacency", + &enums::ExecutionMode::ExecutionModeInputPoints => Some("Points"), + &enums::ExecutionMode::ExecutionModeInputLines => Some("Lines"), + &enums::ExecutionMode::ExecutionModeInputLinesAdjacency => Some("LinesWithAdjacency"), + &enums::ExecutionMode::ExecutionModeTriangles => Some("Triangles"), + &enums::ExecutionMode::ExecutionModeInputTrianglesAdjacency => Some("TrianglesWithAdjacency"), _ => continue, }; break; } } - let execution_mode = format!("::vulkano::pipeline::shader::GeometryShaderExecutionMode::{0}", execution_mode); + let execution_mode = format!("::vulkano::pipeline::shader::GeometryShaderExecutionMode::{0}", execution_mode.unwrap()); let t = format!("::vulkano::pipeline::shader::GeometryShaderEntryPoint<(), {0}Input, \ {0}Output, Layout>",