diff --git a/src/vkcv/ShaderProgram.cpp b/src/vkcv/ShaderProgram.cpp
index dabd5ab1380811f2cb6bc107232d07bd8d2f0518..5185b8b402eae5cd514689ba51a06e1a437271bf 100644
--- a/src/vkcv/ShaderProgram.cpp
+++ b/src/vkcv/ShaderProgram.cpp
@@ -110,22 +110,24 @@ namespace vkcv {
         spirv_cross::Compiler comp(move(shaderCode));
         spirv_cross::ShaderResources resources = comp.get_shader_resources();
 
-        std::vector<VertexInputAttachment> inputVec;
-        uint32_t offset = 0;
-
-        for (uint32_t i = 0; i < resources.stage_inputs.size() ; i++){
-            auto &u = resources.stage_inputs[i];
-            const spirv_cross::SPIRType &base_type = comp.get_type(u.base_type_id);
-
-            VertexInputAttachment input = VertexInputAttachment(comp.get_decoration(u.id,spv::DecorationLocation),
-                                                                0,
-                                                                convertFormat(base_type.basetype, base_type.vecsize),
-                                                                offset);
-            inputVec.push_back(input);
-            offset += base_type.vecsize * base_type.width/8;
-        }
-
-        m_VertexLayout = VertexLayout(inputVec);
+		if (shaderStage == ShaderStage::VERTEX) {
+			std::vector<VertexInputAttachment> inputVec;
+			uint32_t offset = 0;
+
+			for (uint32_t i = 0; i < resources.stage_inputs.size(); i++) {
+				auto& u = resources.stage_inputs[i];
+				const spirv_cross::SPIRType& base_type = comp.get_type(u.base_type_id);
+
+				VertexInputAttachment input = VertexInputAttachment(comp.get_decoration(u.id, spv::DecorationLocation),
+					0,
+					convertFormat(base_type.basetype, base_type.vecsize),
+					offset);
+				inputVec.push_back(input);
+				offset += base_type.vecsize * base_type.width / 8;
+			}
+
+			m_VertexLayout = VertexLayout(inputVec);
+		}
     }
 
     const VertexLayout& ShaderProgram::getVertexLayout() const{