0

I get this validation message

If a VkSampler created with magFilter or minFilter equal to VK_FILTER_LINEAR and compareEnable equal to VK_FALSE is used to sample a VkImageView as a result of this command, then the image view's format features must contain VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT

But I can't see how to set the image view format features. Any ideas?

Sean Nolan
  • 43
  • 3

1 Answers1

0

The message is telling you that you're using a linear sampler (magFilter or minFilter is VK_FILTER_LINEAR) to sample from an image view whose format doesn't have the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT feature.

There are two ways to fix this:

  1. Use a different sampler. If you don't need linear filtering, you can use a point sampler instead.

  2. Use a different image view format. If you need linear filtering, you can use a format that supports it.

Igor
  • 474
  • 2
  • 10
  • OK so I have fixed the validation message. What I am trying to do is I have an offscreen frame buffer with a red integer attachment. I am then rendering it to the screen as a second attachment along with the swap chain image. I pass it into the final shader as a sampled image. It renders fine in the offscreen buffer but when it gets to the screen buffer the colors are changed. I render only red to the off screen buffer but in the screen buffer it is more blue. – Sean Nolan Nov 01 '22 at 08:32
  • @SeanNolan To avoid this, you need to use a format that supports linear filtering for your offscreen framebuffer attachment. For example, VK_FORMAT_R32G32B32A32_SFLOAT supports linear filtering, but VK_FORMAT_R32_UINT does not. – Igor Nov 01 '22 at 08:37
  • How do I make a point sampler? – Sean Nolan Nov 02 '22 at 01:04
  • Figured out my problem. I was not returning the red value from the shader. I was trying to return the entire color. – Sean Nolan Nov 02 '22 at 05:53