MVKPixelFormats: Add getName() for MTLVertexFormat

This commit is contained in:
Jan Sikorski 2020-10-22 18:37:29 +02:00
parent 9097890688
commit 9ee50b526a
2 changed files with 7 additions and 0 deletions

View File

@ -342,6 +342,9 @@ public:
/** Returns the name of the specified Metal pixel format. */
const char* getName(MTLPixelFormat mtlFormat);
/** Returns the name of the specified Metal vertex format. */
const char* getName(MTLVertexFormat mtlFormat);
/**
* Returns the MTLClearColor value corresponding to the color value in the VkClearValue,
* extracting the color value that is VkFormat for the VkFormat.

View File

@ -375,6 +375,10 @@ const char* MVKPixelFormats::getName(MTLPixelFormat mtlFormat) {
return getMTLPixelFormatDesc(mtlFormat).name;
}
const char* MVKPixelFormats::getName(MTLVertexFormat mtlFormat) {
return getMTLVertexFormatDesc(mtlFormat).name;
}
void MVKPixelFormats::enumerateSupportedFormats(VkFormatProperties properties, bool any, std::function<bool(VkFormat)> func) {
static const auto areFeaturesSupported = [any](uint32_t a, uint32_t b) {
if (b == 0) return true;