#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <llvm/Config/llvm-config.h>
#include "radv_debug.h"
#include "radv_private.h"
#include "radv_shader.h"
radv_get_driver_uuid(&device->driver_uuid);
radv_get_device_uuid(&device->rad_info, &device->device_uuid);
- if (device->rad_info.family == CHIP_STONEY ||
- device->rad_info.chip_class >= GFX9) {
- device->has_rbplus = true;
- device->rbplus_allowed = device->rad_info.family == CHIP_STONEY ||
- device->rad_info.family == CHIP_VEGA12 ||
- device->rad_info.family == CHIP_RAVEN ||
- device->rad_info.family == CHIP_RAVEN2 ||
- device->rad_info.family == CHIP_RENOIR;
- }
-
- device->cpdma_prefetch_writes_memory = device->rad_info.chip_class <= GFX8;
-
- /* Vega10/Raven need a special workaround for a hardware bug. */
- device->has_scissor_bug = device->rad_info.family == CHIP_VEGA10 ||
- device->rad_info.family == CHIP_RAVEN;
-
- device->has_tc_compat_zrange_bug = device->rad_info.chip_class < GFX10;
-
- /* Out-of-order primitive rasterization. */
- device->has_out_of_order_rast = device->rad_info.chip_class >= GFX8 &&
- device->rad_info.max_se >= 2;
- device->out_of_order_rast_allowed = device->has_out_of_order_rast &&
+ device->out_of_order_rast_allowed = device->rad_info.has_out_of_order_rast &&
!(device->instance->debug_flags & RADV_DEBUG_NO_OUT_OF_ORDER);
device->dcc_msaa_allowed =
(device->instance->perftest_flags & RADV_PERFTEST_DCC_MSAA);
- /* TODO: Figure out how to use LOAD_CONTEXT_REG on GFX6-GFX7. */
- device->has_load_ctx_reg_pkt = device->rad_info.chip_class >= GFX9 ||
- (device->rad_info.chip_class >= GFX8 &&
- device->rad_info.me_fw_feature >= 41);
-
- device->has_dcc_constant_encode = device->rad_info.family == CHIP_RAVEN2 ||
- device->rad_info.family == CHIP_RENOIR ||
- device->rad_info.chip_class >= GFX10;
-
device->use_shader_ballot = device->rad_info.chip_class >= GFX8 &&
device->instance->perftest_flags & RADV_PERFTEST_SHADER_BALLOT;
* load/store memory operations.
* See https://reviews.llvm.org/D61313
*/
- if (HAVE_LLVM < 0x900)
+ if (LLVM_VERSION_MAJOR < 9)
instance->debug_flags |= RADV_DEBUG_NO_LOAD_STORE_OPT;
} else if (!strcmp(name, "Wolfenstein: Youngblood")) {
if (!(instance->debug_flags & RADV_DEBUG_NO_SHADER_BALLOT)) {
static const char radv_dri_options_xml[] =
DRI_CONF_BEGIN
- DRI_CONF_SECTION_QUALITY
+ DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC("true")
+ DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
DRI_CONF_SECTION_END
DRI_CONF_END;
driParseOptionInfo(&instance->available_dri_options, radv_dri_options_xml);
driParseConfigFiles(&instance->dri_options,
&instance->available_dri_options,
- 0, "radv", NULL);
+ 0, "radv", NULL,
+ instance->engineName,
+ instance->engineVersion);
}
VkResult radv_CreateInstance(
client_version = VK_API_VERSION_1_0;
}
+ const char *engine_name = NULL;
+ uint32_t engine_version = 0;
+ if (pCreateInfo->pApplicationInfo) {
+ engine_name = pCreateInfo->pApplicationInfo->pEngineName;
+ engine_version = pCreateInfo->pApplicationInfo->engineVersion;
+ }
+
instance = vk_zalloc2(&default_alloc, pAllocator, sizeof(*instance), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!instance)
return vk_error(instance, result);
}
+ instance->engineName = vk_strdup(&instance->alloc, engine_name,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+ instance->engineVersion = engine_version;
+
_mesa_locale_init();
glsl_type_singleton_init_or_ref();
radv_physical_device_finish(instance->physicalDevices + i);
}
+ vk_free(&instance->alloc, instance->engineName);
+
VG(VALGRIND_DESTROY_MEMPOOL(instance));
glsl_type_singleton_decref();
features->storageBuffer16BitAccess = enabled;
features->uniformAndStorageBuffer16BitAccess = enabled;
features->storagePushConstant16 = enabled;
- features->storageInputOutput16 = enabled && HAVE_LLVM >= 0x900;
+ features->storageInputOutput16 = enabled && LLVM_VERSION_MAJOR >= 9;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: {
VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *features =
(VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *)ext;
- features->shaderBufferInt64Atomics = HAVE_LLVM >= 0x0900;
- features->shaderSharedInt64Atomics = HAVE_LLVM >= 0x0900;
+ features->shaderBufferInt64Atomics = LLVM_VERSION_MAJOR >= 9;
+ features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
/* SGPR. */
properties->sgprsPerSimd =
- ac_get_num_physical_sgprs(pdevice->rad_info.chip_class);
+ ac_get_num_physical_sgprs(&pdevice->rad_info);
properties->minSgprAllocation =
pdevice->rad_info.chip_class >= GFX8 ? 16 : 8;
properties->maxSgprAllocation =