vk/formats: Add a name to the metadata and better logging

This commit is contained in:
Jason Ekstrand
2015-06-02 11:03:22 -07:00
parent fbafc946c6
commit e702197e3f
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -26,7 +26,7 @@
#define UNSUPPORTED 0xffff
#define fmt(__vk_fmt, ...) \
[VK_FORMAT_##__vk_fmt] = { __VA_ARGS__ }
[VK_FORMAT_##__vk_fmt] = { .name = "VK_FORMAT_" #__vk_fmt, __VA_ARGS__ }
static const struct anv_format anv_formats[] = {
fmt(UNDEFINED, .format = RAW, .cpp = 1, .channels = 1),
@@ -234,6 +234,18 @@ struct surface_format_info {
extern const struct surface_format_info surface_formats[];
VkResult anv_validate_GetFormatInfo(
VkDevice _device,
VkFormat _format,
VkFormatInfoType infoType,
size_t* pDataSize,
void* pData)
{
const struct anv_format *format = anv_format_for_vk_format(_format);
fprintf(stderr, "vkGetFormatInfo(%s)\n", format->name);
return anv_GetFormatInfo(_device, _format, infoType, pDataSize, pData);
}
VkResult anv_GetFormatInfo(
VkDevice _device,
VkFormat _format,
+1
View File
@@ -716,6 +716,7 @@ int anv_compiler_run(struct anv_compiler *compiler, struct anv_pipeline *pipelin
void anv_compiler_free(struct anv_pipeline *pipeline);
struct anv_format {
const char * name;
uint16_t format;
uint8_t cpp;
uint8_t channels;