Skip to content
Snippets Groups Projects
Commit 41a52bda authored by Sascha Willems's avatar Sascha Willems
Browse files

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

parent 089edad0
Branches
Tags
No related merge requests found
...@@ -21,6 +21,4 @@ void main() ...@@ -21,6 +21,4 @@ void main()
float specular = pow(max(dot(R, V), 0.0), 16.0) * color.a; float specular = pow(max(dot(R, V), 0.0), 16.0) * color.a;
outFragColor = vec4(diffuse * color.rgb + specular, 1.0); outFragColor = vec4(diffuse * color.rgb + specular, 1.0);
outFragColor = texture(samplerColor, inUV);
} }
\ No newline at end of file
No preview for this file type
...@@ -42,6 +42,7 @@ public: ...@@ -42,6 +42,7 @@ public:
camera.setRotation(glm::vec3(-7.5f, 72.0f, 0.0f)); camera.setRotation(glm::vec3(-7.5f, 72.0f, 0.0f));
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.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); enabledDeviceExtensions.push_back(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
} }
...@@ -61,6 +62,11 @@ public: ...@@ -61,6 +62,11 @@ public:
renderPass = VK_NULL_HANDLE; 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 // Enable physical device features required for this example
virtual void getEnabledFeatures() virtual void getEnabledFeatures()
{ {
...@@ -103,14 +109,14 @@ public: ...@@ -103,14 +109,14 @@ public:
VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
vks::tools::insertImageMemoryBarrier( vks::tools::insertImageMemoryBarrier(
drawCmdBuffers[i], drawCmdBuffers[i],
swapChain.buffers[i].image, depthStencil.image,
0, 0,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, 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,
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 // New structures are used to define the attachments used in dynamic rendering
VkRenderingAttachmentInfoKHR colorAttachment{}; VkRenderingAttachmentInfoKHR colorAttachment{};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment