Small fixes, validation is now clean except for a false positive

This commit is contained in:
Sascha Willems 2021-11-20 12:29:27 +01:00
parent 089edad01c
commit 41a52bda4c
3 changed files with 9 additions and 5 deletions

View file

@ -21,6 +21,4 @@ void main()
float specular = pow(max(dot(R, V), 0.0), 16.0) * color.a;
outFragColor = vec4(diffuse * color.rgb + specular, 1.0);
outFragColor = texture(samplerColor, inUV);
}

View file

@ -42,6 +42,7 @@ public:
camera.setRotation(glm::vec3(-7.5f, 72.0f, 0.0f));
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
enabledDeviceExtensions.push_back(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
}
@ -61,6 +62,11 @@ public:
renderPass = VK_NULL_HANDLE;
}
void setupFrameBuffer()
{
// With VK_KHR_dynamic_rendering we no longer need a frame buffer, so skip the sample base framebuffer setup
}
// Enable physical device features required for this example
virtual void getEnabledFeatures()
{
@ -103,14 +109,14 @@ public:
VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
vks::tools::insertImageMemoryBarrier(
drawCmdBuffers[i],
swapChain.buffers[i].image,
depthStencil.image,
0,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VkImageSubresourceRange{ VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1 });
VkImageSubresourceRange{ VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, 0, 1, 0, 1 });
// New structures are used to define the attachments used in dynamic rendering
VkRenderingAttachmentInfoKHR colorAttachment{};