Vulkan Shader Issue with ScaleFX


#1

I build the following shader:

shaders = 13

shader0 = shaders_slang/dithering/shaders/mdapt/passes/mdapt-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0

shader1 = shaders_slang/dithering/shaders/mdapt/passes/mdapt-pass1.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0

shader2 = shaders_slang/dithering/shaders/mdapt/passes/mdapt-pass2.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0

shader3 = shaders_slang/dithering/shaders/mdapt/passes/mdapt-pass3.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0

shader4 = shaders_slang/dithering/shaders/mdapt/passes/mdapt-pass4.slang
filter_linear4 = false
scale_type4 = source
scale4 = 1.0

shader5 = shaders_slang/denoisers/shaders/fast-bilateral.slang
filter_linear5 = false
scale_type5 = source
scale5 = 1.0

shader6 = shaders_slang/scalefx/shaders/scalefx-pass0.slang
filter_linear6 = false
scale_type6 = source
scale6 = 1.0
float_framebuffer6 = true

shader7 = shaders_slang/scalefx/shaders/scalefx-pass1.slang
filter_linear7 = false
scale_type7 = source
scale7 = 1.0
float_framebuffer7 = true

shader8 = shaders_slang/scalefx/shaders/scalefx-pass2.slang
filter_linear8 = false
scale_type8 = source
scale8 = 1.0

shader9 = shaders_slang/scalefx/shaders/scalefx-pass3.slang
filter_linear9 = false
scale_type9 = source
scale9 = 1.0

shader10 = shaders_slang/scalefx/shaders/scalefx-pass4.slang
filter_linear10 = false
scale_type10 = source
scale10 = 3.0

shader11 = shaders_slang/anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass0.slang
filter_linear11 = false
scale_type11 = source
scale11 = 1.0

shader12 = shaders_slang/anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass1.slang
filter_linear12 = false
scale_type12 = source
scale12 = 1.0

However it seems the vulcan renderer of beetle psx does not accept it. I looked several times through the shader but it seems shader level 9 (scalefx-pass2.slang) makes issues.


#2

What’s the error it prints to the log?


#3
[INFO] [slang]: Building pass #0 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:      SourceSize (#0) (PushOffset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [slang]:     #6 (PushOffset: 52)
[INFO] [slang]:     #7 (PushOffset: 56)
[INFO] [Vulkan]: Push Constant Block: 60 bytes.
[INFO] [slang]: Building pass #1 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:      SourceSize (#0) (PushOffset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [Vulkan]: Push Constant Block: 52 bytes.
[INFO] [slang]: Building pass #2 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:      SourceSize (#0) (PushOffset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [slang]:     #6 (PushOffset: 52)
[INFO] [slang]:     #7 (PushOffset: 56)
[INFO] [slang]:     #8 (PushOffset: 60)
[INFO] [slang]:     #9 (PushOffset: 64)
[INFO] [Vulkan]: Push Constant Block: 68 bytes.
[INFO] [slang]: Building pass #3 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Original (#0)
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:      SourceSize (#0) (PushOffset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [Vulkan]: Push Constant Block: 52 bytes.
[INFO] [slang]: Building pass #4 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Original (#0)
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:      SourceSize (#0) (PushOffset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [slang]:     #6 (PushOffset: 52)
[INFO] [slang]:     #7 (PushOffset: 56)
[INFO] [slang]:     #8 (PushOffset: 60)
[INFO] [slang]:     #9 (PushOffset: 64)
[INFO] [Vulkan]: Push Constant Block: 68 bytes.
[INFO] [slang]: Building pass #5 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:      SourceSize (#0) (PushOffset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [slang]:     #6 (PushOffset: 52)
[INFO] [Vulkan]: Push Constant Block: 56 bytes.
[INFO] [slang]: Building pass #6 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [Vulkan]: Push Constant Block: 16 bytes.
[INFO] [slang]: Building pass #7 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: yes):
[INFO] [slang]:   Push Constants (Vertex: yes, Fragment: yes):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [slang]:     #6 (PushOffset: 16)
[INFO] [slang]:     #7 (PushOffset: 20)
[INFO] [Vulkan]: Push Constant Block: 24 bytes.
[INFO] [slang]: Building pass #8 (N/A)
[INFO] [Vulkan filter chain]: Creating framebuffer 1024 x 1024 (max 1 level(s)).
[ERROR] [slang]: Non-semantic textures not supported yet.
[ERROR] [slang]: Failed to reflect SPIR-V. Resource usage is inconsistent with expectations.

I also have to correct myself. The issue starts at shader level 8


#4

I think the issue is the stacking before scalefx


#5

No, you’re missing the pass aliases from the preset. If you look at the scalefx preset, it has an alias assignment on scalefx-pass0 and one on the pass right before it (refpass). Those need to be added to your custom preset, like this:

shaders = 13

shader0 = dithering/shaders/mdapt/passes/mdapt-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0

shader1 = dithering/shaders/mdapt/passes/mdapt-pass1.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0

shader2 = dithering/shaders/mdapt/passes/mdapt-pass2.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0

shader3 = dithering/shaders/mdapt/passes/mdapt-pass3.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0

shader4 = dithering/shaders/mdapt/passes/mdapt-pass4.slang
filter_linear4 = false
scale_type4 = source
scale4 = 1.0

shader5 = denoisers/shaders/fast-bilateral.slang
filter_linear5 = false
scale_type5 = source
scale5 = 1.0
alias5 = refpass

shader6 = scalefx/shaders/scalefx-pass0.slang
filter_linear6 = false
scale_type6 = source
scale6 = 1.0
float_framebuffer6 = true
alias6 = scalefx_pass0

shader7 = scalefx/shaders/scalefx-pass1.slang
filter_linear7 = false
scale_type7 = source
scale7 = 1.0
float_framebuffer7 = true

shader8 = scalefx/shaders/scalefx-pass2.slang
filter_linear8 = false
scale_type8 = source
scale8 = 1.0

shader9 = scalefx/shaders/scalefx-pass3.slang
filter_linear9 = false
scale_type9 = source
scale9 = 1.0

shader10 = scalefx/shaders/scalefx-pass4.slang
filter_linear10 = false
scale_type10 = source
scale10 = 3.0

shader11 = anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass0.slang
filter_linear11 = false
scale_type11 = source
scale11 = 1.0

shader12 = anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass1.slang
filter_linear12 = false
scale_type12 = source
scale12 = 1.0

#6

Will try it. U are awesome hunterk :+1::+1::+1: