{
char str[MAX_DEBUG_MESSAGE_LENGTH];
struct anv_device *device = (struct anv_device *)data;
+ struct anv_instance *instance = device->physical->instance;
- if (list_is_empty(&device->instance->debug_report_callbacks.callbacks))
+ if (list_is_empty(&instance->debug_report_callbacks.callbacks))
return;
va_list args;
(void) vsnprintf(str, MAX_DEBUG_MESSAGE_LENGTH, fmt, args);
va_end(args);
- vk_debug_report(&device->instance->debug_report_callbacks,
+ vk_debug_report(&instance->debug_report_callbacks,
VK_DEBUG_REPORT_DEBUG_BIT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
0, 0, 0, "anv", str);
static void
anv_device_init_dispatch(struct anv_device *device)
{
+ const struct anv_instance *instance = device->physical->instance;
+
const struct anv_device_dispatch_table *genX_table;
switch (device->info.gen) {
case 12:
/* Vulkan requires that entrypoints for extensions which have not been
* enabled must not be advertised.
*/
- if (!anv_device_entrypoint_is_enabled(i, device->instance->app_info.api_version,
- &device->instance->enabled_extensions,
+ if (!anv_device_entrypoint_is_enabled(i, instance->app_info.api_version,
+ &instance->enabled_extensions,
&device->enabled_extensions)) {
device->dispatch.entrypoints[i] = NULL;
} else if (genX_table->entrypoints[i]) {
}
device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
- device->instance = physical_device->instance;
device->physical = physical_device;
device->chipset_id = physical_device->chipset_id;
device->no_hw = physical_device->no_hw;
const char *message)
{
struct anv_spirv_debug_data *debug_data = private_data;
+ struct anv_instance *instance = debug_data->device->physical->instance;
+
static const VkDebugReportFlagsEXT vk_flags[] = {
[NIR_SPIRV_DEBUG_LEVEL_INFO] = VK_DEBUG_REPORT_INFORMATION_BIT_EXT,
[NIR_SPIRV_DEBUG_LEVEL_WARNING] = VK_DEBUG_REPORT_WARNING_BIT_EXT,
snprintf(buffer, sizeof(buffer), "SPIR-V offset %lu: %s", (unsigned long) spirv_offset, message);
- vk_debug_report(&debug_data->device->instance->debug_report_callbacks,
+ vk_debug_report(&instance->debug_report_callbacks,
vk_flags[level],
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
(uint64_t) (uintptr_t) debug_data->module,
*/
assert(found < __builtin_popcount(pipeline->active_stages));
- vk_debug_report(&pipeline->device->instance->debug_report_callbacks,
+ vk_debug_report(&pipeline->device->physical->instance->debug_report_callbacks,
VK_DEBUG_REPORT_WARNING_BIT_EXT |
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT,
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
anv_pipeline_cache_init(cache, device,
- device->instance->pipeline_cache_enabled);
+ device->physical->instance->pipeline_cache_enabled);
if (pCreateInfo->initialDataSize > 0)
anv_pipeline_cache_load(cache,
#ifdef ENABLE_SHADER_CACHE
struct disk_cache *disk_cache = device->physical->disk_cache;
- if (disk_cache && device->instance->pipeline_cache_enabled) {
+ if (disk_cache && device->physical->instance->pipeline_cache_enabled) {
cache_key cache_key;
disk_cache_compute_key(disk_cache, key_data, key_size, cache_key);
VkAllocationCallbacks alloc;
- struct anv_instance * instance;
struct anv_physical_device * physical;
uint32_t chipset_id;
bool no_hw;
is_dual_src_blend_factor(a->dstColorBlendFactor) ||
is_dual_src_blend_factor(a->srcAlphaBlendFactor) ||
is_dual_src_blend_factor(a->dstAlphaBlendFactor))) {
- vk_debug_report(&device->instance->debug_report_callbacks,
+ vk_debug_report(&device->physical->instance->debug_report_callbacks,
VK_DEBUG_REPORT_WARNING_BIT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
(uint64_t)(uintptr_t)device,
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO);
/* Use the default pipeline cache if none is specified */
- if (cache == NULL && device->instance->pipeline_cache_enabled)
+ if (cache == NULL && device->physical->instance->pipeline_cache_enabled)
cache = &device->default_pipeline_cache;
pipeline = vk_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8,
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO);
/* Use the default pipeline cache if none is specified */
- if (cache == NULL && device->instance->pipeline_cache_enabled)
+ if (cache == NULL && device->physical->instance->pipeline_cache_enabled)
cache = &device->default_pipeline_cache;
pipeline = vk_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8,