Skip to content

Commit

Permalink
use best supported depth stencil format, should fix running with amd …
Browse files Browse the repository at this point in the history
…cards
  • Loading branch information
jagoly committed Mar 5, 2024
1 parent 96f660d commit d9ff199
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/render/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ void Renderer::impl_create_render_targets()
// create images and samplers
{
images.depthStencil.initialise_2D (
ctx, vk::Format::eD24UnormS8Uint, renderSize, 1u, vk::SampleCountFlagBits::e1,
ctx, ctx.limits.depthStencilFormat, renderSize, 1u, vk::SampleCountFlagBits::e1,
vk::ImageUsageFlagBits::eDepthStencilAttachment | vk::ImageUsageFlagBits::eSampled, false,
{}, vk::ImageAspectFlagBits::eDepth | vk::ImageAspectFlagBits::eStencil
);

images.depthView = ctx.create_image_view (
images.depthStencil.image, vk::ImageViewType::e2D, vk::Format::eD24UnormS8Uint,
images.depthStencil.image, vk::ImageViewType::e2D, ctx.limits.depthStencilFormat,
{}, vk::ImageAspectFlagBits::eDepth, 0u, 1u, 0u, 1u
);

Expand Down Expand Up @@ -272,7 +272,7 @@ void Renderer::impl_create_render_targets()
vk::ImageLayout::eUndefined, vk::ImageLayout::eShaderReadOnlyOptimal
},
vk::AttachmentDescription { // depth, stencil
{}, vk::Format::eD24UnormS8Uint, vk::SampleCountFlagBits::e1,
{}, ctx.limits.depthStencilFormat, vk::SampleCountFlagBits::e1,
vk::AttachmentLoadOp::eClear, vk::AttachmentStoreOp::eStore,
vk::AttachmentLoadOp::eClear, vk::AttachmentStoreOp::eStore,
vk::ImageLayout::eUndefined, vk::ImageLayout::eDepthStencilReadOnlyOptimal
Expand Down Expand Up @@ -317,7 +317,7 @@ void Renderer::impl_create_render_targets()
vk::ImageLayout::eUndefined, vk::ImageLayout::eShaderReadOnlyOptimal
},
vk::AttachmentDescription {
{}, vk::Format::eD24UnormS8Uint, vk::SampleCountFlagBits::e1,
{}, ctx.limits.depthStencilFormat, vk::SampleCountFlagBits::e1,
vk::AttachmentLoadOp::eLoad, vk::AttachmentStoreOp::eStore,
vk::AttachmentLoadOp::eLoad, vk::AttachmentStoreOp::eStore,
vk::ImageLayout::eDepthStencilReadOnlyOptimal, vk::ImageLayout::eDepthStencilReadOnlyOptimal
Expand Down

0 comments on commit d9ff199

Please sign in to comment.