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

Data Format for Reading and Writing Depth Images #1251

Open
bashbaug opened this issue Sep 3, 2024 · 0 comments
Open

Data Format for Reading and Writing Depth Images #1251

bashbaug opened this issue Sep 3, 2024 · 0 comments

Comments

@bashbaug
Copy link
Contributor

bashbaug commented Sep 3, 2024

In the current SPIR-V environment spec, we describe the "data format for reading and writing images":

https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Env.html#_data_format_for_reading_and_writing_images

Most image channel orders return four components for reading or accept four components for writing, but depth images are different and only support reading or writing a single scalar. Depth images are currently identified as having either the "Depth" or "DepthStencil" image channel orders. Because "Depth" images are identified by their image channel order the scalar vs. vector difference cannot be checked staticially. This is because the "Image Format" field in OpTypeImage must be "Unknown" for images used in the OpenCL environment.

Should the scalar vs. vector difference be determined by the "Depth" field in OpTypeImage instead, which would allow for static checking?

I don't think this would be a behavioral difference in practice, since I suspect most OpTypeImages with "Depth=1" also have an image channel order equal to "Depth" or "DepthStencil", but I don't see this requirement explicitly documented anywhere either. Should this be explicitly documented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs WG discussion
Development

No branches or pull requests

1 participant