VkInstance instance,
const char* pName)
{
- return anv_lookup_entrypoint(pName);
+ return anv_lookup_entrypoint(NULL, pName);
}
/* With version 1+ of the loader interface the ICD should expose
}
PFN_vkVoidFunction anv_GetDeviceProcAddr(
- VkDevice device,
+ VkDevice _device,
const char* pName)
{
- return anv_lookup_entrypoint(pName);
+ ANV_FROM_HANDLE(anv_device, device, _device);
+ return anv_lookup_entrypoint(&device->info, pName);
}
static VkResult
return vk_error(VK_ERROR_EXTENSION_NOT_PRESENT);
}
- anv_set_dispatch_devinfo(&physical_device->info);
-
device = anv_alloc2(&physical_device->instance->alloc, pAllocator,
sizeof(*device), 8,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
print "};\n"
print """
-static struct gen_device_info dispatch_devinfo;
-
-void
-anv_set_dispatch_devinfo(const struct gen_device_info *devinfo)
-{
- dispatch_devinfo = *devinfo;
-}
-
static void * __attribute__ ((noinline))
-anv_resolve_entrypoint(uint32_t index)
+anv_resolve_entrypoint(const struct gen_device_info *devinfo, uint32_t index)
{
- if (dispatch_devinfo.gen == 0) {
+ if (devinfo == NULL) {
return anv_layer.entrypoints[index];
}
- switch (dispatch_devinfo.gen) {
+ switch (devinfo->gen) {
case 9:
if (gen9_layer.entrypoints[index])
return gen9_layer.entrypoints[index];
return gen8_layer.entrypoints[index];
/* fall through */
case 7:
- if (dispatch_devinfo.is_haswell && gen75_layer.entrypoints[index])
+ if (devinfo->is_haswell && gen75_layer.entrypoints[index])
return gen75_layer.entrypoints[index];
if (gen7_layer.entrypoints[index])
print """
void *
-anv_lookup_entrypoint(const char *name)
+anv_lookup_entrypoint(const struct gen_device_info *devinfo, const char *name)
{
static const uint32_t prime_factor = %d;
static const uint32_t prime_step = %d;
if (strcmp(name, strings + e->name) != 0)
return NULL;
- return anv_resolve_entrypoint(i);
+ return anv_resolve_entrypoint(devinfo, i);
}
""" % (prime_factor, prime_step, hash_mask)
struct anv_bo bo;
};
-void *anv_lookup_entrypoint(const char *name);
+void *anv_lookup_entrypoint(const struct gen_device_info *devinfo,
+ const char *name);
void anv_dump_image_to_ppm(struct anv_device *device,
struct anv_image *image, unsigned miplevel,