delve-framework icon indicating copy to clipboard operation
delve-framework copied to clipboard

Error: VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

Open funatsufumiya opened this issue 11 months ago • 13 comments

Errors happening when running run-passes on Windows 11, on current main (3250a6a). Is this related to #31 ?

$ zig build run-passes
Debug system initializing
Delve Framework Initialized
Registered module: passes_example
Registered module: fps_counter
Delve Framework Starting!
App platform starting
Creating Sokol App backend
Main loop starting
Sokol app starting main loop
Sokol app context initializing
Sokol setup backend: gfx.Backend.D3D11
Graphics subsystem starting
Graphics subsystem started successfully
Image zstbi init
Input subsystem starting
Registered module: subsystem.input
Initializing module: passes_example
Forest example module initializing
Sprite animation example module initializing
Loading shader yaml file: assets/shaders/built/default/default_reflection.yaml
  Found shader def: hlsl4:default
[sg][error][id:163] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16437:0:
        VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

[sg][error][id:163] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16437:0:
        VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

[sg][error][id:163] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16437:0:
        VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

[sg][panic][id:298] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16072:0:
        VALIDATION_FAILED: validation layer checks failed

ABORTING because of [panic]
run-passes
└─ run passes failure
error: the following command exited with error code 9:
C:\Users\funatsu\lab\delve-framework\.zig-cache\o\2d500b2295120fb6fd5e0bedd4080927\passes.exe

funatsufumiya avatar Jan 19 '25 21:01 funatsufumiya

Similar problem is also happening on Linux GLCORE.

$ zig build run-passes
Debug system initializing
Delve Framework Initialized
Registered module: passes_example
Registered module: fps_counter
Delve Framework Starting!
App platform starting
Creating Sokol App backend
Main loop starting
Sokol app starting main loop
[sapp][warning][id:49] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_app.h:9671:0:
        LINUX_X11_QUERY_SYSTEM_DPI_FAILED: failed to query system dpi value, assuming default 96.0

MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
Sokol app context initializing
Sokol setup backend: gfx.Backend.GLCORE
Graphics subsystem starting
Graphics subsystem started successfully
Image zstbi init
Input subsystem starting
Registered module: subsystem.input
Initializing module: passes_example
[sg][error][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8631:0:
        GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

[sg][info][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8632:0:
        normals

[sg][error][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8631:0:
        GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

[sg][info][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8632:0:
        tangents

Forest example module initializing
Sprite animation example module initializing
Loading shader yaml file: assets/shaders/built/default/default_reflection.yaml
  Found shader def: glsl430:default
[sg][error][id:149] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16362:0:
        VALIDATE_SHADERDESC_IMAGE_SAMPLER_PAIR_NAME_REQUIRED_FOR_GL: shader stage: image-sampler-pairs must be named in GL (sg_shader_desc.vs|fs.image_sampler_pairs[].name)

[sg][panic][id:298] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16072:0:
        VALIDATION_FAILED: validation layer checks failed

ABORTING because of [panic]
run-passes
└─ run passes failure
error: the following command terminated unexpectedly:
/home/fu/dev/delve-framework/.zig-cache/o/1516aaad094840b47f24b1d9d21c65fd/passes
Build Summary: 21/23 steps succeeded; 1 failed (disable with --summary none)
run-passes transitive failure
└─ run passes failure
error: the following build command failed with exit code 1:
/home/fu/dev/delve-framework/.zig-cache/o/33673f7af5db23cd34036158985c1c25/build /home/fu/.zvm/0.13.0/zig /home/fu/dev/delve-framework /home/fu/dev/delve-framework/.zig-cache /home/fu/.cache/zig --seed 0xe2742f -Zd295f2edc53c7d80 run-passes

funatsufumiya avatar Jan 19 '25 22:01 funatsufumiya

It could be - does the sprite-animation example exhibit the same error?

Interrupt avatar Jan 20 '25 00:01 Interrupt

Yes. probably the same one. (FYI, this is not happening on macOS Metal.)

Windows 11

$ zig build run-sprite-animation
Debug system initializing
Delve Framework Initialized
Registered module: animated_sprite_example
Delve Framework Starting!
App platform starting
Creating Sokol App backend
Main loop starting
Sokol app starting main loop
Sokol app context initializing
Sokol setup backend: gfx.Backend.D3D11
Graphics subsystem starting
Graphics subsystem started successfully
Image zstbi init
Input subsystem starting
Registered module: subsystem.input
Initializing module: animated_sprite_example
Sprite animation example module initializing
Loading shader yaml file: assets/shaders/built/default/default_reflection.yaml
  Found shader def: hlsl4:default
[sg][error][id:163] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16437:0:
        VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

[sg][error][id:163] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16437:0:
        VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

[sg][error][id:163] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16437:0:
        VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

[sg][panic][id:298] C:\Users\funatsu\AppData\Local\zig\p\122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b\src\sokol\c/sokol_gfx.h:16072:0:
        VALIDATION_FAILED: validation layer checks failed

ABORTING because of [panic]
run-sprite-animation
└─ run sprite-animation failure
error: the following command exited with error code 9:
C:\Users\funatsu\lab\delve-framework\.zig-cache\o\15f0c548faaccd5f1c8806aef31de1d7\sprite-animation.exe
Build Summary: 21/23 steps succeeded; 1 failed (disable with --summary none)
run-sprite-animation transitive failure
└─ run sprite-animation failure
error: the following build command failed with exit code 1:
C:\Users\funatsu\lab\delve-framework\.zig-cache\o\02db0c48a85c665bf69c059c91efc1e0\build.exe C:\Users\funatsu\AppData\Local\Microsoft\WinGet\Packages\zig.zig_Microsoft.Winget.Source_8wekyb3d8bbwe\zig-windows-x86_64-0.13.0\zig.exe C:\Users\funatsu\lab\delve-framework C:\Users\funatsu\lab\delve-framework\.zig-cache C:\Users\funatsu\AppData\Local\zig --seed 0x17789929 -Zc67b9dcd3d335dfe run-sprite-animation

Linux (Ubuntu 24.04 - WSL2)

(seems little different?)

$ zig build run-sprite-animation
Debug system initializing
Delve Framework Initialized
Registered module: animated_sprite_example
Delve Framework Starting!
App platform starting
Creating Sokol App backend
Main loop starting
Sokol app starting main loop
[sapp][warning][id:49] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_app.h:9671:0:
        LINUX_X11_QUERY_SYSTEM_DPI_FAILED: failed to query system dpi value, assuming default 96.0

MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
Sokol app context initializing
Sokol setup backend: gfx.Backend.GLCORE
Graphics subsystem starting
Graphics subsystem started successfully
Image zstbi init
Input subsystem starting
Registered module: subsystem.input
Initializing module: animated_sprite_example
Sprite animation example module initializing
Loading shader yaml file: assets/shaders/built/default/default_reflection.yaml
  Found shader def: glsl430:default
[sg][error][id:149] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16362:0:
        VALIDATE_SHADERDESC_IMAGE_SAMPLER_PAIR_NAME_REQUIRED_FOR_GL: shader stage: image-sampler-pairs must be named in GL (sg_shader_desc.vs|fs.image_sampler_pairs[].name)

[sg][panic][id:298] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16072:0:
        VALIDATION_FAILED: validation layer checks failed

ABORTING because of [panic]
run-sprite-animation
└─ run sprite-animation failure
error: the following command terminated unexpectedly:
/home/fu/dev/delve-framework/.zig-cache/o/41c688c59e8d43e18c00cba8bda48f40/sprite-animation
Build Summary: 21/23 steps succeeded; 1 failed (disable with --summary none)
run-sprite-animation transitive failure
└─ run sprite-animation failure
error: the following build command failed with exit code 1:
/home/fu/dev/delve-framework/.zig-cache/o/33673f7af5db23cd34036158985c1c25/build /home/fu/.zvm/0.13.0/zig /home/fu/dev/delve-framework /home/fu/dev/delve-framework/.zig-cache /home/fu/.cache/zig --seed 0x883034d3 -Z0d25cf3e652fad6f run-sprite-animation

funatsufumiya avatar Jan 20 '25 01:01 funatsufumiya

On Ubuntu24.04 WSL2, run-meshes has similar error. (FIY, run-meshes works well on Win/Mac, and run-sprites works perfectly on Win/Mac/Linux.)

$ zig build run-meshes
Debug system initializing
Delve Framework Initialized
Registered module: mesh_example
Delve Framework Starting!
App platform starting
Creating Sokol App backend
Main loop starting
Sokol app starting main loop
[sapp][warning][id:49] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_app.h:9671:0:
        LINUX_X11_QUERY_SYSTEM_DPI_FAILED: failed to query system dpi value, assuming default 96.0

MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
Sokol app context initializing
Sokol setup backend: gfx.Backend.GLCORE
Graphics subsystem starting
Graphics subsystem started successfully
Image zstbi init
Input subsystem starting
Registered module: subsystem.input
Initializing module: mesh_example
Mesh example module initializing
[sg][error][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8631:0:
        GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

[sg][info][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8632:0:
        normals

[sg][error][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8631:0:
        GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

[sg][info][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8632:0:
        tangents

Loaded mesh file assets/meshes/SciFiHelmet.gltf with 70074 indices
Initializing module: subsystem.input
[sg][error][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8631:0:
        GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

[sg][info][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8632:0:
        normals

[sg][error][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8631:0:
        GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

[sg][info][id:7] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:8632:0:
        tangents

[sg][error][id:243] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16732:0:
        VALIDATE_ABND_VBS: sg_apply_bindings: number of vertex buffers doesn't match number of pipeline vertex layouts

[sg][error][id:243] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16732:0:
        VALIDATE_ABND_VBS: sg_apply_bindings: number of vertex buffers doesn't match number of pipeline vertex layouts

[sg][panic][id:298] /home/fu/.cache/zig/p/122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b/src/sokol/c/sokol_gfx.h:16072:0:
        VALIDATION_FAILED: validation layer checks failed

ABORTING because of [panic]
run-meshes
└─ run meshes failure
error: the following command terminated unexpectedly:
/home/fu/dev/delve-framework/.zig-cache/o/c1f98dbee1e20c42294221a9a622f815/meshes
Build Summary: 21/23 steps succeeded; 1 failed (disable with --summary none)
run-meshes transitive failure
└─ run meshes failure
error: the following build command failed with exit code 1:
/home/fu/dev/delve-framework/.zig-cache/o/33673f7af5db23cd34036158985c1c25/build /home/fu/.zvm/0.13.0/zig /home/fu/dev/delve-framework /home/fu/dev/delve-framework/.zig-cache /home/fu/.cache/zig --seed 0x57881cc2 -Z170e95632b47126f run-meshes

funatsufumiya avatar Jan 20 '25 01:01 funatsufumiya

Pushed a potential fix for the D3D11 shaders loaded via YAML error: VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: D3D11 missing vertex attribute semantics in shader

Looks like Sokol expects there to be an attrs block in the Shader descriptor that I wasn't populating. That data does exist in the YAML reflection file for the shader, so I'm populating it now.

https://github.com/Interrupt/delve-framework/commit/f6383ce84079d045e4c291897eae9f55e82c08c0

I'm running into a very strange error on Windows where the Yaml parser is exploding on the first token and first line with an 'index out of bounds' error, so I'm not able to test it currently. For the time being, I removed the YAML shader loading from the sprite-animation example to unblock the stresstest and passes examples until I can make a separate example just for this feature.

Interrupt avatar Jan 22 '25 04:01 Interrupt

Thank you for your prompt action!

I tried current latest ( 2a382755d ). Test results are:

Windows Ubuntu Ubuntu on WSL2
passes ✅ OK ✖ NG ^1 ✖ NG ^2
sprite-animation ✅ OK ✅ OK ✅ OK
meshes ✅ OK ✅ OK ✖ NG ^3

funatsufumiya avatar Jan 22 '25 05:01 funatsufumiya

Is the error on Ubuntu still this one?

GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl)

Interrupt avatar Jan 22 '25 20:01 Interrupt

Seems so. I tried once with recompiling shaders (zig run shaders), error logs not changed: passes-log-ubuntu.txt

By the way, using latest sokol-tools-bin, some errors shown kind of like error: 'binding' : uniform/buffer blocks require layout(binding=X) (but error of default-mesh.glsl.zig seems different ). This may be related. (This errors are the same on Win/Mac/Linux.)

shaders-error-log-ubuntu.txt

I could recompile shaders using old (?) sokol-tools-bin, which I already installed before. But I don't know which version I'm using (on old version) because the folder wasn't git controlled...

funatsufumiya avatar Jan 22 '25 21:01 funatsufumiya

Could you try pulling and building this commit, and seeing if it fixes thepasses and meshes examples for you? https://github.com/Interrupt/delve-framework/pull/79/commits/229e707d0aa7ba51ab16f5dfa8ae8b1c010e6610

Interrupt avatar Feb 04 '25 19:02 Interrupt

@Interrupt OK! I tried 229e707 . Test results are:

Windows Ubuntu Ubuntu on WSL2
passes ✖ NG ^1 ✖ NG ^2 ✖ NG ^3
sprite-animation ✖ NG ^4 ✖ NG ^5 ✖ NG ^6
meshes ✅ OK ✅ OK ✖ NG ^7

funatsufumiya avatar Feb 04 '25 23:02 funatsufumiya

Ah, sorry. Looks like this was a regression as this branch was not done on the latest main. I've updated the bugfix/vert_attrib_not_found_gl branch and the latest CL for it is now: d666383a759bb0f7513893756e7ad55dea9d0502

Looking at the logs, it doesn't look like this will fix all of the examples still though.

Interrupt avatar Feb 05 '25 21:02 Interrupt

@Interrupt I checked d666383a. Test results are:

Windows Ubuntu Ubuntu on WSL2
passes ✅ OK ✅ OK ✖ NG ^1
sprite-animation ✅ OK ✅ OK ✅ OK
meshes ✅ OK ✅ OK ✖ NG ^2

funatsufumiya avatar Feb 05 '25 22:02 funatsufumiya

Okay, this definitely looks like this issue in Sokol, where OpenGL can optimize away unused shader attributes: https://github.com/floooh/sokol/issues/940

These shaders would probably run just fine, but Sokol is doing a bunch of its own validation that is getting in the way. The only way to really fix this right now will be to use the tangents and normals in the default shaders in a way that keeps them from getting optimized away. Will keep working on a fix.

Interrupt avatar Feb 06 '25 06:02 Interrupt