Jump to content
  • Advertisement
Sign in to follow this  

Vulkan Input attachment reads as black.

Recommended Posts

Trying to figure out why input attachment reads as black with NSight VS plugin - and failing.

This is what i can see at the invocation point of the shader:

* attachment is filled with correct data (just a clear to bright red in previous renderpass) and used by the fragment shader:

// SPIR-V decompiled to GLSL
#version 450

layout(binding = 0) uniform sampler2D accum;
// originally: layout(input_attachment_index=0, set=0, binding=0) uniform subpassInput accum;

layout(location = 0) out vec4 fbFinal;

void main(){
    fbFinal = vec4(texelFetch(accum, ivec2(gl_FragCoord.xy), 0).xyz + vec3(0.0, 0.0, 1.0), 1.0);
    // originally: fbFinal = vec4(subpassLoad(accum).rgb + vec3(0.0, 0.0, 1.0), 1.0);

* the resulting image is bright blue - instead of the expected bright purple (red+blue)

How can this happen?

'fbFinal' format is B8G8R8A8_UNORM and 'accum' format is R16G16B16A16_UNORM - ie. nothing weird.

Share this post

Link to post
Share on other sites

New day, new ideas.

My VulkanSDK was a bit outdated and since i use the validation layers it provides i though to be worth updating - maybe it sees what i do not.

And it did. Found a few seemingly minor things. After fixing thous - everything started working as intended again. Apparently not as minor as i though. Hard to tell which one or combination of caused this.

So, all i can really recommend is to check your validation layers are the latest and greatest when facing bizarre problems with vulkan.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!