Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSL] Support sparse image residency operations in MSL 2.2 #1014

Open
cdavis5e opened this issue Jun 6, 2019 · 9 comments
Open

[MSL] Support sparse image residency operations in MSL 2.2 #1014

cdavis5e opened this issue Jun 6, 2019 · 9 comments
Labels
enhancement New feature to SPIRV-Cross is desired.

Comments

@cdavis5e
Copy link
Contributor

cdavis5e commented Jun 6, 2019

MSL 2.2 on iOS at least adds new methods for reading and sampling textures that additionally return whether or not the texture memory was resident. These correspond to OpImageSparseXxx in SPIR-V. It should now be possible to implement those operations.

@cdavis5e
Copy link
Contributor Author

It looks like Apple removed this incomplete feature from the MSL 2.2 headers. Maybe the next version will support it.

@oscarbg
Copy link

oscarbg commented Sep 10, 2019

yep.. but we should reopen as it should have returned today in Xcode 11 GM as it's a new feature of A13 GPU..
see (https://twitter.com/gavkar/status/1171494278545018882)

@cdavis5e cdavis5e reopened this Sep 10, 2019
@cdavis5e
Copy link
Contributor Author

They are indeed restored to the MSL 2.2 headers. I guess Apple didn't want anybody poking at this while they finished up this super-secret feature.

@Degerz
Copy link

Degerz commented Sep 11, 2019

Any format limitations with sparse textures on A13 ?

Also, it seems to be implied that the tile mappings are updated from the GPU rather than the CPU ? Is that true ?

@cdavis5e
Copy link
Contributor Author

cdavis5e commented Sep 11, 2019

Any format limitations with sparse textures on A13 ?

There might be. See -[MTLDevice sparseTileSizeWithTextureType:pixelFormat:sampleCount:].

Also, it seems to be implied that the tile mappings are updated from the GPU rather than the CPU ? Is that true ?

That's true. It's actually true of Vulkan as well--see vkQueueBindSparse().

@Degerz
Copy link

Degerz commented Sep 11, 2019

There might be. See -[MTLDevice sparseTileSizeWithTextureType:pixelFormat:sampleCount:].

I wish Apple would just publicly document the allowed pixel formats like Microsoft does with D3D12 instead. It'd be way more useful this way to see if Metal supports sparse volume textures or sparse MSAA textures ...

I see that there's an individual sampleCount parameter for sparseTileSize so there might be hope after all to support MSAA textures on at least Intel devices but it would be a big disappointment if all configurations returned 1 ...

That's true. It's actually true of Vulkan as well--see vkQueueBindSparse().

I don't mean being able to update the page table into device memory since that's really ugly performance wise. I want the ability to specifically update tile mappings via from the GPU but it looks like that'll remain exclusive to Intel HW so I guess I misinterpreted the tweet ...

Edit: Same question was asked on twitter ...

@cdavis5e
Copy link
Contributor Author

I want the ability to specifically update tile mappings via from the GPU

Metal can kinda sorta do GPU-driven sparse updates. See -[MTLResourceStateCommandEncoder updateTextureMapping:mode:indirectBuffer:indirectBufferOffset:]. I guess it's not what you were hoping for, which in Metal terms would be an indirect command buffer that supported resource state commands.

@oscarbg
Copy link

oscarbg commented Aug 25, 2022

any update on this?

@Wangsh09
Copy link

Wangsh09 commented Jun 8, 2023

any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature to SPIRV-Cross is desired.
Projects
None yet
Development

No branches or pull requests

5 participants