#include <fcntl.h>
#include "anv_private.h"
-#include "mesa/main/git_sha1.h"
+#include "git_sha1.h"
#include "util/strtod.h"
#include "util/debug.h"
device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
device->instance = instance;
- device->path = path;
+
+ assert(strlen(path) < ARRAY_SIZE(device->path));
+ strncpy(device->path, path, ARRAY_SIZE(device->path));
device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
if (!device->chipset_id) {
- result = vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
- "failed to get chipset id: %m");
+ result = VK_ERROR_INITIALIZATION_FAILED;
goto fail;
}
device->compiler->shader_debug_log = compiler_debug_log;
device->compiler->shader_perf_log = compiler_perf_log;
- anv_init_wsi(device);
+ result = anv_init_wsi(device);
+ if (result != VK_SUCCESS)
+ goto fail;
/* XXX: Actually detect bit6 swizzling */
isl_device_init(&device->isl_dev, device->info, swizzled);
VkResult result;
if (instance->physicalDeviceCount < 0) {
- result = anv_physical_device_init(&instance->physicalDevice,
- instance, "/dev/dri/renderD128");
+ char path[20];
+ for (unsigned i = 0; i < 8; i++) {
+ snprintf(path, sizeof(path), "/dev/dri/renderD%d", 128 + i);
+ result = anv_physical_device_init(&instance->physicalDevice,
+ instance, path);
+ if (result == VK_SUCCESS)
+ break;
+ }
+
if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
instance->physicalDeviceCount = 0;
} else if (result == VK_SUCCESS) {
.samplerAnisotropy = false, /* FINISHME */
.textureCompressionETC2 = pdevice->info->gen >= 8 ||
pdevice->info->is_baytrail,
- .textureCompressionASTC_LDR = false, /* FINISHME */
+ .textureCompressionASTC_LDR = pdevice->info->gen >= 9, /* FINISHME CHV */
.textureCompressionBC = true,
.occlusionQueryPrecise = true,
.pipelineStatisticsQuery = false,
.maxSamplerAnisotropy = 16,
.maxViewports = MAX_VIEWPORTS,
.maxViewportDimensions = { (1 << 14), (1 << 14) },
- .viewportBoundsRange = { -16384.0, 16384.0 },
+ .viewportBoundsRange = { INT16_MIN, INT16_MAX },
.viewportSubPixelBits = 13, /* We take a float? */
.minMemoryMapAlignment = 4096, /* A page */
.minTexelBufferOffsetAlignment = 1,
*/
device->can_chain_batches = device->info.gen >= 8;
+ device->robust_buffer_access = pCreateInfo->pEnabledFeatures &&
+ pCreateInfo->pEnabledFeatures->robustBufferAccess;
+
pthread_mutex_init(&device->mutex, NULL);
anv_bo_pool_init(&device->batch_bo_pool, device);