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.84k stars 429 forks source link

Sparse texture (& buffer?) support? #1700

Open oscarbg opened 2 years ago

oscarbg commented 2 years ago

Hi,

would like to make an updated call for sparse texture support in MoltenVK.. seems all I can find about sparse tex support is from a issue three years ago (https://github.com/KhronosGroup/MoltenVK/issues/631).. a SPIRV-Cross issue was opened: https://github.com/KhronosGroup/SPIRV-Cross/issues/1014 but no real progress since then.. sparse texture now is available also on MacOS also seems from Metal 2.3 (at least for M1 Macs).. also on A15 and M2 additional sparse stencil and depth format support.. don't know on Macos on AMD GPUs.. at least this is info from this Metal sparse sample: https://developer.apple.com/documentation/metal/metal_sample_code_library/streaming_large_images_with_metal_sparse_textures I have seen also new:

define __HAVE_SPARSE_SAMPLE_COMPARE_GRADIENTCUBE_OVERLOAD__ 1

vs last time 3 years ago in metal shader compiler headers.. finally seems no sparse buffer support (you can create sparse MLTHeaps from which create MTLTexture's but not MTLBuffer's ?) see: https://developer.apple.com/documentation/metal/textures/creating_sparse_heaps_and_sparse_textures).. hope somebody fills a bug with Apple for sparse buffer support.. similarly don't know if sparse 3D textures are supported.. @billhollings @cdavis5e @spnda do you know about current Metal sparse support? (sparse buffers, sparse 3D textures, supported on AMD GPUs on Macos?) thanks..

cdavis5e commented 2 years ago

Part of the problem is that Metal doesn't let you place sparse tiles at specific locations inside of sparse heaps, whereas Vulkan and D3D12 do.

oscarbg commented 2 years ago

thanks for the insight.. so does basically avoid an "easy" implementation of sparse texture support on MoltenVK, right now? in that case has this limitation been pointed to Apple devs (filed a ticket on Apple bug tracker)?

Wangsh09 commented 1 year ago

any update on this?

oscarbg commented 1 year ago

Curious how game porting toolkit enables support for this (and also execute indirect funtionality).. new related features on Metal 3.1?..

K0bin commented 1 year ago

@oscarbg It doesn't. A bunch of games don't work because of the limited sparse support.