Burn wipe doesn't work with Vulkan renderer

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Burn wipe doesn't work with Vulkan renderer

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Thu May 09, 2019 10:44 am

You're welcome. :)

Re: Burn wipe doesn't work with Vulkan renderer

by Firebrand » Thu May 09, 2019 10:41 am

I can confirm that this wipe style now works properly on Vulkan :) , thank you for your work!

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Thu May 09, 2019 9:57 am

Fixed this one.

Turns out there were two bugs. First, the hwrenderer layer added the layer to the wrong material - probably only worked on OpenGL because texture state lingers. And secondly there was the recreation of a texture each frame as Graf mentioned.

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Thu May 09, 2019 9:16 am

It looks like somehow F2DDrawer::DTF_Burn gets applied to the wrong command. If a breakpoint is set in line 184 in Draw2D the material only has one layer. Interestingly, the prev command in the list points at the material created in Wiper_Burn::SetTexture but that draw command does not have the burn flag set.

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Thu May 09, 2019 9:03 am

Looking a bit closer at this I'm not sure the problem is with the descriptor itself. Wiper_Burn::SetTextures is only called once (when burn is started) and when the 2D drawer renders the effect for the first time mat->GetLayers() returns 1 (should return 2 according to the shader) when creating the descriptor.

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Tue May 07, 2019 2:32 pm

The Vulkan backend assumes that the material is static and doesn't change. It could validate that the descriptor is up to date, but that would be spending time on that in a time critical part of the renderer. I suppose the best way would be that the burn thing tells the hardware texture that its descriptor needs to be recreated.

Re: Burn wipe doesn't work with Vulkan renderer

by Graf Zahl » Tue May 07, 2019 1:37 pm

The actual material being used to render it is patched together in Wiper_Burn::SetTextures. But this isn't like a real material because the burn texture is not a static texture abd actually recreated for every frame. How does the Vulkan backend handle this? If it depends on a descriptor set that doesn't change it cannot really work.

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Tue May 07, 2019 1:15 pm

Can you give me a link to the lines adding the second texture in the hwrenderer layer? It is quite plausible it doesn't handle the situation if it is unique.

Re: Burn wipe doesn't work with Vulkan renderer

by Graf Zahl » Tue May 07, 2019 9:40 am

The burn shader is a bit of a hack to get the second texture in because it doesn't use a regular material for it. Can it be that you overlooked that part?

Re: Burn wipe doesn't work with Vulkan renderer

by dpJudas » Tue May 07, 2019 7:59 am

Assuming slot 1.1 means set 1, binding 1 the error means that the shader is using "layout(set = 1, binding = 1) uniform sampler2D texture2;" but the bound material does not have a second layer texture.

Looking at burn.fp the shader indeed does use texture2, so the error must be that the second layer texture is not bound. I'm not sure why that might be.

Burn wipe doesn't work with Vulkan renderer

by _mental_ » Tue May 07, 2019 7:23 am

Depending on hardware, burn wipe may produce no visible effect or just render some random garbage.

Validation layers reported the following error:

Code: Select all

Shader uses descriptor slot 1.1 (expected `VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER`) but not declared in pipeline layout

Top