[Fixed] Burn wipe doesn't work with Vulkan renderer

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Burn wipe doesn't work with Vulkan renderer

Postby _mental_ » Tue May 07, 2019 8: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 allExpand view
Shader uses descriptor slot 1.1 (expected `VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER`) but not declared in pipeline layout
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Tue May 07, 2019 8: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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Burn wipe doesn't work with Vulkan renderer

Postby Graf Zahl » Tue May 07, 2019 10: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?
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Tue May 07, 2019 2: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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Burn wipe doesn't work with Vulkan renderer

Postby Graf Zahl » Tue May 07, 2019 2: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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Tue May 07, 2019 3: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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Thu May 09, 2019 10: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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Thu May 09, 2019 10: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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Thu May 09, 2019 10: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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Burn wipe doesn't work with Vulkan renderer

Postby Firebrand » Thu May 09, 2019 11:41 am

I can confirm that this wipe style now works properly on Vulkan :) , thank you for your work!
User avatar
Firebrand
Korax' Heritage Team Member
 
Joined: 16 Jul 2003
Location: Mexico
Discord: Firebrand#4002

Re: Burn wipe doesn't work with Vulkan renderer

Postby dpJudas » Thu May 09, 2019 11:44 am

You're welcome. :)
dpJudas
 
 
 
Joined: 28 May 2016


Return to Closed Bugs

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest