From 556e12769c369d7f88b6536455639b52ba360c26 Mon Sep 17 00:00:00 2001 From: prideout Date: Mon, 21 May 2018 16:45:19 -0700 Subject: [PATCH] Disable fragment shader when generating shadow map. This fixes the following validation warning: fragment shader writes to output location 0 with no matching attachment --- examples/shadowmapping/shadowmapping.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/shadowmapping/shadowmapping.cpp b/examples/shadowmapping/shadowmapping.cpp index 48f3e649..0e7900cb 100644 --- a/examples/shadowmapping/shadowmapping.cpp +++ b/examples/shadowmapping/shadowmapping.cpp @@ -755,9 +755,9 @@ public: enablePCF = 1; VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.sceneShadowPCF)); - // Offscreen pipeline + // Offscreen pipeline (vertex shader only) shaderStages[0] = loadShader(getAssetPath() + "shaders/shadowmapping/offscreen.vert.spv", VK_SHADER_STAGE_VERTEX_BIT); - shaderStages[1] = loadShader(getAssetPath() + "shaders/shadowmapping/offscreen.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT); + pipelineCreateInfo.stageCount = 1; // No blend attachment states (no color attachments used) colorBlendState.attachmentCount = 0; // Cull front faces