{ .img_format = V_008F0C_IMG_FORMAT_##_img_format, \
##__VA_ARGS__ }
-static const struct gfx10_format gfx10_format_table[VK_FORMAT_RANGE_SIZE] = {
% for vk_format, args in formats:
- % if args is not None:
- [${vk_format}] = FMT(${args}),
- % else:
-/* ${vk_format} is not supported */
- % endif
+ % if args is not None:
+ static const struct gfx10_format gfx10_info_${vk_format} = FMT(${args});
+ % else:
+ /* ${vk_format} is not supported */
+ % endif
% endfor
-};
+
+static const struct gfx10_format gfx10_unsupported_format = { 0 };
+
+static inline const struct gfx10_format* gfx10_format_description(VkFormat format)
+{
+ switch(format)
+ {
+ % for vk_format, args in formats:
+ % if args is not None:
+ case ${vk_format}: return &gfx10_info_${vk_format};
+ % endif
+ % endfor
+ default: return &gfx10_unsupported_format;
+ }
+}
""")
class Gfx10Format(object):
cmd_buffer->device->ws->buffer_destroy(cmd_buffer->upload.upload_bo);
cmd_buffer->device->ws->cs_destroy(cmd_buffer->cs);
- for (unsigned i = 0; i < VK_PIPELINE_BIND_POINT_RANGE_SIZE; i++)
+ for (unsigned i = 0; i < MAX_BIND_POINTS; i++)
free(cmd_buffer->descriptors[i].push_set.set.mapped_ptr);
vk_free(&cmd_buffer->pool->alloc, cmd_buffer);
memset(cmd_buffer->vertex_bindings, 0, sizeof(cmd_buffer->vertex_bindings));
- for (unsigned i = 0; i < VK_PIPELINE_BIND_POINT_RANGE_SIZE; i++) {
+ for (unsigned i = 0; i < MAX_BIND_POINTS; i++) {
cmd_buffer->descriptors[i].dirty = 0;
cmd_buffer->descriptors[i].valid = 0;
cmd_buffer->descriptors[i].push_dirty = false;
#define MAX_SO_OUTPUTS 64
#define MAX_INLINE_UNIFORM_BLOCK_SIZE (4ull * 1024 * 1024)
#define MAX_INLINE_UNIFORM_BLOCK_COUNT 64
+#define MAX_BIND_POINTS 2 /* compute + graphics */
#define NUM_DEPTH_CLEAR_PIPELINES 3
#define NUM_DEPTH_DECOMPRESS_PIPELINES 3
S_008F0C_DST_SEL_W(radv_map_swizzle(desc->swizzle[3]));
if (device->physical_device->rad_info.chip_class >= GFX10) {
- const struct gfx10_format *fmt = &gfx10_format_table[vk_format];
+ const struct gfx10_format *fmt = gfx10_format_description(vk_format);
/* OOB_SELECT chooses the out-of-bounds check:
* - 0: (index >= NUM_RECORDS) || (offset >= STRIDE)
unsigned type;
desc = vk_format_description(vk_format);
- img_format = gfx10_format_table[vk_format].img_format;
+ img_format = gfx10_format_description(vk_format)->img_format;
if (desc->colorspace == VK_FORMAT_COLORSPACE_ZS) {
const unsigned char swizzle_xxxx[4] = {0, 0, 0, 0};
VkShaderStageFlags push_constant_stages;
struct radv_descriptor_set meta_push_descriptors;
- struct radv_descriptor_state descriptors[VK_PIPELINE_BIND_POINT_RANGE_SIZE];
+ struct radv_descriptor_state descriptors[MAX_BIND_POINTS];
struct radv_cmd_buffer_upload upload;