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

Small updates to match spec more closely #96

Merged
merged 3 commits into from
Aug 23, 2021

Conversation

kainino0x
Copy link
Collaborator

Also adds the chain of types used by WGPUCompilationInfo (but still no
way to actually use it), and makes them extensible. #82 #87

Also adds the chain of types used by WGPUCompilationInfo (but still no
way to actually use it), and makes them extensible.
WGPUTextureFormat_Depth16unorm = 0x00000026,
WGPUTextureFormat_Depth24Plus = 0x00000027,
WGPUTextureFormat_Depth24PlusStencil8 = 0x00000028,
WGPUTextureFormat_Depth32Float = 0x00000029,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave any space in the texture format list? Or should we just add new ones to the end? I know holes can be bad for switch performance.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want all formats for v1 in a reasonable order then add at the end when new ones come up?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically speaking, we never match on a texture format in hot code where this difference would matter

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might internally though. It would be annoying to have to translate to an internal packed enum (but probably ok if we want to block these out.

I was thinking 0x000 for core color formats, 0x100 for depth/stencil formats, 0x200 for extensions, or something like that. I wonder if compilers can handle a few blocks of values well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no real opinion here: texture formats should be relatively cold code in Dawn too since we cache a pointer to dawn_native::Format in the texture and could do the same in pipeline if we wanted.

@kainino0x kainino0x requested review from Kangz and kvark August 23, 2021 18:16
WGPUTextureFormat_Depth16unorm = 0x00000026,
WGPUTextureFormat_Depth24Plus = 0x00000027,
WGPUTextureFormat_Depth24PlusStencil8 = 0x00000028,
WGPUTextureFormat_Depth32Float = 0x00000029,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want all formats for v1 in a reasonable order then add at the end when new ones come up?

WGPUTextureFormat_Depth16unorm = 0x00000026,
WGPUTextureFormat_Depth24Plus = 0x00000027,
WGPUTextureFormat_Depth24PlusStencil8 = 0x00000028,
WGPUTextureFormat_Depth32Float = 0x00000029,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically speaking, we never match on a texture format in hot code where this difference would matter

@kainino0x kainino0x merged commit 9c9e9d5 into webgpu-native:main Aug 23, 2021
@kainino0x kainino0x deleted the updates branch August 23, 2021 22:25
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.

3 participants