radv: Remove RANGE_SIZE usage

These were removed from the latest Vulkan headers
https://github.com/KhronosGroup/Vulkan-Docs/issues/1230

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4878>
This commit is contained in:
Joshua Ashton 2020-05-04 11:53:03 +01:00 committed by Marge Bot
parent c4d11ea3c4
commit 24f9aea770
5 changed files with 26 additions and 12 deletions

View file

@ -84,15 +84,28 @@ header_template = mako.template.Template("""\
{ .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):

View file

@ -325,7 +325,7 @@ radv_cmd_buffer_destroy(struct radv_cmd_buffer *cmd_buffer)
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);
@ -364,7 +364,7 @@ radv_reset_cmd_buffer(struct radv_cmd_buffer *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;

View file

@ -51,6 +51,7 @@
#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

View file

@ -519,7 +519,7 @@ radv_make_buffer_descriptor(struct radv_device *device,
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)
@ -747,7 +747,7 @@ gfx10_make_texture_descriptor(struct radv_device *device,
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};

View file

@ -1356,7 +1356,7 @@ struct radv_cmd_buffer {
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;