KhronosGroup / MoltenVK

MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.64k stars 402 forks source link

Development support for future VK_KHR_portability_subset_metal extension. #2190

Closed billhollings closed 3 months ago

billhollings commented 3 months ago
billhollings commented 3 months ago

GitHub CI is failing because it doesn't have access to the private Khronos repo. This is expected.

alyssarosenzweig commented 3 months ago

shaderImageGatherExtendedConstOffsets

This is straightforward to lower, as most native drivers do? https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/compiler/nir/nir_lower_tex.c?ref_type=heads#L1253

cdavis5e commented 3 months ago

shaderImageGatherExtendedConstOffsets

This is straightforward to lower, as most native drivers do? https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/compiler/nir/nir_lower_tex.c?ref_type=heads#L1253

Sadly, not as straightforward as one would like. It's simple enough to expand it to four texture::read() calls, but the problem is handling sampler coordinate wrapping. We can't introspect the sampler object for its wrap modes, so we'd have to pass this information alongside the sampler. This becomes particularly problematic when not using argument buffers, which we don't at all by default.

alyssarosenzweig commented 3 months ago

shaderImageGatherExtendedConstOffsets

This is straightforward to lower, as most native drivers do? https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/compiler/nir/nir_lower_tex.c?ref_type=heads#L1253

Sadly, not as straightforward as one would like. It's simple enough to expand it to four texture::read() calls, but the problem is handling sampler coordinate wrapping. We can't introspect the sampler object for its wrap modes, so we'd have to pass this information alongside the sampler. This becomes particularly problematic when not using argument buffers, which we don't at all by default.

See the linked lowering. You turn it into 4 gathers

billhollings commented 3 months ago

See the linked lowering. You turn it into 4 gathers

Thanks for the suggestion, and example. I've added it to the full issue discussion.

billhollings commented 1 month ago

See the linked lowering. You turn it into 4 gathers

Thanks for the suggestion, and example. I've added it to the full issue discussion.

SPIRV-Cross PR #2325 adds support for image gather with ConstOffsets.