amber icon indicating copy to clipboard operation
amber copied to clipboard

Support enabling ScalarBlockLayout in Vulkan

Open seanbaxter opened this issue 4 years ago • 8 comments

spirv-val is generating its old Invalid shader thing about Block offsets. DEVICE_EXTENSION VK_EXT_scalar_block_layout isn't stopping it. How do I get amber to accept my shader's scalar block layout?

seanbaxter avatar Dec 14 '20 18:12 seanbaxter

If this is fixed in SPIRV-Tools you can update the dependency in Amber and rebuild. If it isn't, you can use --disable-spirv-val to disable spirv-val usage in Amber.

dj2 avatar Dec 14 '20 18:12 dj2

I'm still getting a scalar_block_layout validation error with --disable-spirv-val. But now it looks like it comes from the Vulkan validator itself.

https://gist.github.com/seanbaxter/5c76583f1f56803794eead0ba4c252c3

seanbaxter avatar Dec 14 '20 19:12 seanbaxter

The validation layers in Amber are built with the same version of spirv-tools. There is a -d flag to disable vulkan validation as well.

If this passes with those disabled, and the fix is already in SPIRV-Tools we can create an issue to roll the dependencies of Amber.

dj2 avatar Dec 14 '20 19:12 dj2

I just built amber from source this morning, so this fix isn't there. I've never understood this aspect part of spirv-tools. Shouldn't the presence of GL_EXT_scalar_block_layout disable those alignment checks?

seanbaxter avatar Dec 14 '20 19:12 seanbaxter

https://github.com/KhronosGroup/SPIRV-Tools/issues/3763

seanbaxter avatar Dec 14 '20 19:12 seanbaxter

Not sure how you built Amber, but if you used git-sync-deps, then Amber has a pinned version of SPIRV-Tools which is not tip-of-tree.

It looks like scalar block layout has to be enabled through Vulkan which Amber doesn't know how to do at this point: https://github.com/google/amber/blob/main/samples/config_helper_vulkan.cc#L1001

dj2 avatar Dec 14 '20 19:12 dj2

I just built SPIRV-Tools from top of tree. The issue is still there. It's ignoring GL_EXT_scalar_block_layout and requires --scalar-block-layout not to fail.

seanbaxter avatar Dec 14 '20 19:12 seanbaxter

I've updated the title of this to add support into Amber for enabling the scalar block layout in the vulkan structures. Between that and fixing SPIRV-Tools, hopefully that's all that would be needed.

dj2 avatar Dec 14 '20 19:12 dj2