Removed unnecessary preserve attachment and shader attachment writes (fixes validation)

This commit is contained in:
saschawillems 2017-06-16 21:44:53 +02:00
parent 60721b71e1
commit fa00daac41
3 changed files with 2 additions and 13 deletions

View file

@ -9,10 +9,7 @@ layout (input_attachment_index = 2, binding = 2) uniform subpassInput samplerAlb
layout (location = 0) in vec2 inUV;
layout (location = 0) out vec4 outFragcolor;
layout (location = 1) out vec4 outPosition;
layout (location = 2) out vec4 outNormal;
layout (location = 3) out vec4 outAlbedo;
layout (location = 0) out vec4 outColor;
layout (constant_id = 0) const int NUM_LIGHTS = 64;
@ -72,10 +69,5 @@ void main()
fragcolor += diff;// + spec;
}
outFragcolor = vec4(fragcolor, 1.0);
// Write G-Buffer attachments to avoid undefined behaviour (validation error)
outPosition = vec4(0.0);
outNormal = vec4(0.0);
outAlbedo = vec4(0.0);
outColor = vec4(fragcolor, 1.0);
}

View file

@ -365,9 +365,6 @@ public:
// Use the color attachments filled in the first pass as input attachments
subpassDescriptions[1].inputAttachmentCount = 3;
subpassDescriptions[1].pInputAttachments = inputReferences;
// Preserve attachment 1 (position + depth) for next subpass
subpassDescriptions[1].preserveAttachmentCount = 1;
subpassDescriptions[1].pPreserveAttachments = &preserveAttachmentIndex;
// Third subpass: Forward transparency
// ----------------------------------------------------------------------------------------