mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 16:20:13 +01:00
radv,driconf: Add radv_force_64k_sparse_alignment config
Needed by DOOM: The Dark Ages.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34944>
(cherry picked from commit e32a90b57c)
This commit is contained in:
parent
63e9748a4f
commit
4c95ff61ca
5 changed files with 14 additions and 2 deletions
|
|
@ -464,7 +464,7 @@
|
|||
"description": "radv,driconf: Add radv_force_64k_sparse_alignment config",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ radv_get_buffer_memory_requirements(struct radv_device *device, VkDeviceSize siz
|
|||
VkBufferUsageFlags2 usage, VkMemoryRequirements2 *pMemoryRequirements)
|
||||
{
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
const struct radv_instance *instance = radv_physical_device_instance(pdev);
|
||||
|
||||
pMemoryRequirements->memoryRequirements.memoryTypeBits =
|
||||
((1u << pdev->memory_properties.memoryTypeCount) - 1u) & ~pdev->memory_types_32bit;
|
||||
|
|
@ -203,7 +204,10 @@ radv_get_buffer_memory_requirements(struct radv_device *device, VkDeviceSize siz
|
|||
pMemoryRequirements->memoryRequirements.memoryTypeBits = pdev->memory_types_32bit;
|
||||
|
||||
if (flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) {
|
||||
pMemoryRequirements->memoryRequirements.alignment = 4096;
|
||||
if (instance->drirc.force_64k_sparse_alignment)
|
||||
pMemoryRequirements->memoryRequirements.alignment = 65536;
|
||||
else
|
||||
pMemoryRequirements->memoryRequirements.alignment = 4096;
|
||||
} else {
|
||||
if (usage & VK_BUFFER_USAGE_2_PREPROCESS_BUFFER_BIT_EXT)
|
||||
pMemoryRequirements->memoryRequirements.alignment = radv_dgc_get_buffer_alignment(device);
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ static const driOptionDescription radv_dri_options[] = {
|
|||
DRI_CONF_RADV_SSBO_NON_UNIFORM(false)
|
||||
DRI_CONF_RADV_LOWER_TERMINATE_TO_DISCARD(false)
|
||||
DRI_CONF_RADV_APP_LAYER()
|
||||
DRI_CONF_RADV_FORCE_64K_SPARSE_ALIGNMENT(false)
|
||||
DRI_CONF_SECTION_END
|
||||
};
|
||||
// clang-format on
|
||||
|
|
@ -288,6 +289,8 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
|
||||
instance->drirc.lower_terminate_to_discard =
|
||||
driQueryOptionb(&instance->drirc.options, "radv_lower_terminate_to_discard");
|
||||
|
||||
instance->drirc.force_64k_sparse_alignment = driQueryOptionb(&instance->drirc.options, "radv_force_64k_sparse_alignment");
|
||||
}
|
||||
|
||||
static const struct vk_instance_extension_table radv_instance_extensions_supported = {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ struct radv_instance {
|
|||
bool disable_dcc_mips;
|
||||
bool disable_dcc_stores;
|
||||
bool lower_terminate_to_discard;
|
||||
bool force_64k_sparse_alignment;
|
||||
char *app_layer;
|
||||
uint8_t override_graphics_shader_version;
|
||||
uint8_t override_compute_shader_version;
|
||||
|
|
|
|||
|
|
@ -785,6 +785,10 @@
|
|||
#define DRI_CONF_RADV_DISABLE_NGG_GS(def) \
|
||||
DRI_CONF_OPT_B(radv_disable_ngg_gs, def, "Disable NGG GS on GFX10/GFX10.3.")
|
||||
|
||||
#define DRI_CONF_RADV_FORCE_64K_SPARSE_ALIGNMENT(def) \
|
||||
DRI_CONF_OPT_B(radv_force_64k_sparse_alignment, def, \
|
||||
"Force the alignment of sparse buffers to 64KiB")
|
||||
|
||||
/**
|
||||
* \brief ANV specific configuration options
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue