Burn wipe doesn't work with Vulkan renderer

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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 Reply
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Burn wipe doesn't work with Vulkan renderer

Post by _mental_ »

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
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Burn wipe doesn't work with Vulkan renderer

Post by Graf Zahl »

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?
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Burn wipe doesn't work with Vulkan renderer

Post by Graf Zahl »

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.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

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.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

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.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

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.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

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.
User avatar
Firebrand
Posts: 58
Joined: Wed Jul 16, 2003 10:54 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: Mexico
Contact:

Re: Burn wipe doesn't work with Vulkan renderer

Post by Firebrand »

I can confirm that this wipe style now works properly on Vulkan :) , thank you for your work!
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Burn wipe doesn't work with Vulkan renderer

Post by dpJudas »

You're welcome. :)
Post Reply

Return to “Closed Bugs [GZDoom]”