Skip to content

Add support for VK_KHR_shader_fma#864

Draft
rjodinchr wants to merge 21 commits into
kpet:mainfrom
rjodinchr:shader-fma
Draft

Add support for VK_KHR_shader_fma#864
rjodinchr wants to merge 21 commits into
kpet:mainfrom
rjodinchr:shader-fma

Conversation

@rjodinchr
Copy link
Copy Markdown
Contributor

No description provided.

@rjodinchr
Copy link
Copy Markdown
Contributor Author

The vulkan SDK we are using is too old. We need a newer one, but the action we are using does not seem to be able to get 1.4.329.0 which is the first to include VK_KHR_shader_fma.

@rjodinchr
Copy link
Copy Markdown
Contributor Author

Using 1.4.341.1 we can still use humbletim action.

  • macos are failing due to a validation report. I need to investigate and fix clvk.
  • android is failing because we need to update the CI to build libclc properly following libclc CMake changes
  • windows is failing because it cannot find vulkanrt.zip

When a program has multiple entry points, and only a subset of them
use image/sampler metadata, the SPIR-V shader declares a larger push
constant block that accommodates all potential metadata across the
program. Previously, the push constant range in the pipeline layout
was calculated per entry point in `cvk_entry_point::init()`. This
resulted in a mismatch between the declared SPIR-V push constant block
size and the pipeline layout's push constant range size on entry
points without metadata usage, triggering Vulkan validation layer
errors.

This commit resolves the issue by:
* Moving the complete push constant range calculation from
  `cvk_entry_point` to `cvk_program::prepare_push_constant_range()`.
* Consolidating all potential push constant sources (binary
  constants, push constant kernel arguments, image metadata, and
  sampler metadata) upfront across the entire program.
* Ensuring the pipeline layout's push constant range consistently
  covers the maximum declared SPIR-V block size across all entry
  points.
* Updating the POD buffer size assertion in `create_pod_buffer()` to
  precisely match `m_entry_point->pod_buffer_size()`.
@rjodinchr
Copy link
Copy Markdown
Contributor Author

It seems that on windows the vulkan SDK has been reduced to bin only. No more include/lib that we need. Not sure how to get those properly.

Note that while that PR is trying to add support for VK_KHR_shader_fma, the real issue here is about the Vulkan SDK update (to get updated, Vulkan-headers). Maybe we just need to clone the headers? And keep the current SDK (this would work short term, at some point we will need to update the SDK anyway I believe).

@rjodinchr
Copy link
Copy Markdown
Contributor Author

Addressing independent fixes (needed for VK_KHR_shader_fma) here:

@rjodinchr
Copy link
Copy Markdown
Contributor Author

Hum, android-ndk-r29 won't be enough anyway. Even r30-beta only gives vulkan 1.4.317 which is not enough. I guess VK_KHR_shader_fma will have to wait a bit before getting to clvk.

@rjodinchr rjodinchr marked this pull request as draft April 27, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant