-
Notifications
You must be signed in to change notification settings - Fork 28
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
src: Add vk_format_utils to UtilityHeaders #89
Conversation
82e4221
to
1256e07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess before we merge here, a good exercise would be go in the Validation Layers
- Remove the current format utils (so it doesn't generate)
- Replace the header with this file
- Make sure CI will pass and this didn't forget anything subtle a test there would have caught
(the goal not being to merge that PR, but to prove this new interface works)
I started to do that on Friday and did not have much trouble with the conversion but had a lot of trouble running tests (w and w/o mock icd). It felt like I setup the repo wrong but I was on a different machine than I normally develop on, so I’ll try again come the morn on that machine. |
inline bool FormatIsUSCALED(VkFormat format); | ||
|
||
// Returns whether a format type is any type from "Interpretation of Numeric Format" table (OpTypeInt) | ||
inline bool FormatIsSampledInt(VkFormat format); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "Interpretation of Numeric Format" table about the formats that can be sampled? Not sure I understand semantics of this function and in which scenarios it can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't super clear on that myself - but I'll look at the format table in question and double check that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so for the formats, awhile ago I tried to unify the wording
https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-numericformat
in short:
- Numeric Format = [
SFLOAT
,SINT
,SNORM
,SRGB
,SSCALED
,UFLOAT
,UINT
,UNORM
,USCALED
] - Numeric Type = [float, signed int, unsigned int]
- SPIR-V Type = [ [
OpTypeFloat
,OpTypeInt
], width, sign ]
.... basically we should re-write this comment to whatever @charles-lunarg thinks "makes sense" as I am now to tainted with spec lawyer knowledge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if the comments make more sense now.
Did some minimal integration testing with VulkanTools. Looks good on that front 👍🏾 |
1256e07
to
815fdc8
Compare
bd36e90
to
659a524
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require updating BUILD.gn
659a524
to
97fccae
Compare
97fccae
to
6030460
Compare
a749af3
to
2376416
Compare
Apologies for the force push spam - the C compatibility tests & add_subdirectory/find_package tests are easy to forget about since they aren't compiled normally. The build.gn file should be correct now as well @juan-lunarg |
The library originates from Vulkan-ValidationLayers, but is being moved into this repo to make it easier for others to use it. The library has also been modified to be header only and C compatible, which allows more developers to be able to use it. This does require some changes, but only affects the vkuFormatElementSize and vkuFormatTexelSize functions which used default parameters. Two new functions, vkuFormatElementSizeWithAspect and vkuFormatTexelSizeWithAspect have been added to handle the non-default image aspect case (the default was COLOR_BIT). Renaming was done using the following convention: * public header files begin with `vk_` * enums begin with VKU_FORMAT_ * functions begin with vku
2376416
to
b267b0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The library originates from Vulkan-ValidationLayers, but is being moved into this repo to make it easier for others to use it.
The library has also been modified to be header only and C compatible, which allows more developers to be able to use it. This does require some changes, but only affects the FormatElementSize and FormatTexelSize functions which used default parameters. Two new functions, FormatElementSizeWithAspect and FormatTexelSizeWithAspect have been added to handle the non-default image aspect case (the default was COLOR_BIT).