From: Rob Clark Date: Thu, 8 Jul 2021 16:01:12 +0000 (-0700) Subject: turnip: Get storage_16bit from fd_dev_info X-Git-Tag: upstream/21.2.3~411 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06000f42ede8efef4225b6d1a27756c629c75787;p=platform%2Fupstream%2Fmesa.git turnip: Get storage_16bit from fd_dev_info Removing more gpu_id checks that will become bogus as we add more a6xx. Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/common/freedreno_dev_info.h b/src/freedreno/common/freedreno_dev_info.h index bed3c2c..6bfef29 100644 --- a/src/freedreno/common/freedreno_dev_info.h +++ b/src/freedreno/common/freedreno_dev_info.h @@ -68,6 +68,11 @@ struct fd_dev_info { bool tess_use_shared; + /* newer a6xx allows using 16-bit descriptor for both 16-bit + * and 32-bit access + */ + bool storage_16bit; + struct { uint32_t RB_UNKNOWN_8E04_blit; uint32_t PC_UNKNOWN_9805; diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py index 4de74d6..29e98b0 100644 --- a/src/freedreno/common/freedreno_devices.py +++ b/src/freedreno/common/freedreno_devices.py @@ -193,6 +193,7 @@ a6xx_gen3 = dict( supports_multiview_mask = True, has_z24uint_s8uint = True, tess_use_shared = True, + storage_16bit = True, ) add_gpus([ diff --git a/src/freedreno/vulkan/tu_descriptor_set.c b/src/freedreno/vulkan/tu_descriptor_set.c index 8081075..508d9b3 100644 --- a/src/freedreno/vulkan/tu_descriptor_set.c +++ b/src/freedreno/vulkan/tu_descriptor_set.c @@ -726,7 +726,7 @@ write_buffer_descriptor(const struct tu_device *device, uint64_t va = tu_buffer_iova(buffer) + buffer_info->offset; uint32_t range = get_range(buffer, buffer_info->offset, buffer_info->range); /* newer a6xx allows using 16-bit descriptor for both 16-bit and 32-bit access */ - if (device->physical_device->gpu_id >= 650) { + if (device->physical_device->info->a6xx.storage_16bit) { dst[0] = A6XX_IBO_0_TILE_MODE(TILE6_LINEAR) | A6XX_IBO_0_FMT(FMT6_16_UINT); dst[1] = DIV_ROUND_UP(range, 2); } else { diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index cb571c7..e1f58cf 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -113,7 +113,7 @@ get_device_extensions(const struct tu_physical_device *device, struct vk_device_extension_table *ext) { *ext = (struct vk_device_extension_table) { - .KHR_16bit_storage = device->gpu_id >= 650, + .KHR_16bit_storage = device->info->a6xx.storage_16bit, .KHR_bind_memory2 = true, .KHR_create_renderpass2 = true, .KHR_dedicated_allocation = true, @@ -480,7 +480,7 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, switch (ext->sType) { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: { VkPhysicalDeviceVulkan11Features *features = (void *) ext; - features->storageBuffer16BitAccess = pdevice->gpu_id >= 650; + features->storageBuffer16BitAccess = pdevice->info->a6xx.storage_16bit; features->uniformAndStorageBuffer16BitAccess = false; features->storagePushConstant16 = false; features->storageInputOutput16 = false; @@ -576,7 +576,7 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: { VkPhysicalDevice16BitStorageFeatures *features = (VkPhysicalDevice16BitStorageFeatures *) ext; - features->storageBuffer16BitAccess = pdevice->gpu_id >= 650; + features->storageBuffer16BitAccess = pdevice->info->a6xx.storage_16bit; features->uniformAndStorageBuffer16BitAccess = false; features->storagePushConstant16 = false; features->storageInputOutput16 = false; diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c index 31fe825..25d720b 100644 --- a/src/freedreno/vulkan/tu_shader.c +++ b/src/freedreno/vulkan/tu_shader.c @@ -76,7 +76,7 @@ tu_spirv_to_nir(struct tu_device *dev, .float_controls = true, .float16 = true, .int16 = true, - .storage_16bit = dev->physical_device->gpu_id >= 650, + .storage_16bit = dev->physical_device->info->a6xx.storage_16bit, .demote_to_helper_invocation = true, .vk_memory_model = true, .vk_memory_model_device_scope = true,