diff --git a/data/shaders/deferred/mrt.frag b/data/shaders/deferred/mrt.frag index 5a8f543..632f5d1 100644 --- a/data/shaders/deferred/mrt.frag +++ b/data/shaders/deferred/mrt.frag @@ -13,8 +13,8 @@ layout (location = 3) in vec3 inWorldPos; layout (location = 4) in vec3 inTangent; layout (location = 0) out vec4 outPosition; -layout (location = 1) out vec4 outNormal; -layout (location = 2) out vec4 outAlbedo; +layout (location = 2) out vec4 outNormal; +layout (location = 3) out vec4 outAlbedo; void main() { @@ -30,4 +30,4 @@ void main() outNormal = vec4(tnorm, 1.0); outAlbedo = texture(samplerColor, inUV); -} \ No newline at end of file +} diff --git a/examples/deferred/deferred.cpp b/examples/deferred/deferred.cpp index 2c9dcce..124253d 100644 --- a/examples/deferred/deferred.cpp +++ b/examples/deferred/deferred.cpp @@ -357,6 +357,7 @@ public: std::vector colorReferences; colorReferences.push_back({ 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }); + colorReferences.push_back({ VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_UNDEFINED }); colorReferences.push_back({ 1, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }); colorReferences.push_back({ 2, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }); @@ -999,7 +1000,8 @@ public: // Blend attachment states required for all color attachments // This is important, as color write mask will otherwise be 0x0 and you // won't see anything rendered to the attachment - std::array blendAttachmentStates = { + std::array blendAttachmentStates = { + vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE), vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE), vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE), vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE)