diff options
author | Jason Ekstrand <[email protected]> | 2015-10-19 22:06:59 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-20 13:02:03 -0700 |
commit | a71e614d33e8d869bbaced8948349a7180783ab7 (patch) | |
tree | 0194c7cf955a3c4f15c67cab53b388389a828574 /src/vulkan/anv_device.c | |
parent | 2d9e899e3576120f1a671c6cc38835b41269e607 (diff) |
anv: Completely rework shader compilation
Now that we have a decent interface in upstream mesa, we can get rid of all
our hacks. As of this commit, we no longer use any fake GL state objects
and all of shader compilation is moved into anv_pipeline.c. This should
make way for actually implementing a shader cache one of these days.
As a nice side-benifit, this commit also gains us an extra 300 passing CTS
tests because we're actually filling out the texture swizzle information
for vertex shaders.
Diffstat (limited to 'src/vulkan/anv_device.c')
-rw-r--r-- | src/vulkan/anv_device.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index e0bb7f6e4bc..fd87c85b0ce 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -33,6 +33,22 @@ struct anv_dispatch_table dtable; +static void +compiler_debug_log(void *data, const char *fmt, ...) +{ } + +static void +compiler_perf_log(void *data, const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + if (unlikely(INTEL_DEBUG & DEBUG_PERF)) + vfprintf(stderr, fmt, args); + + va_end(args); +} + static VkResult anv_physical_device_init(struct anv_physical_device *device, struct anv_instance *instance, @@ -91,11 +107,15 @@ anv_physical_device_init(struct anv_physical_device *device, close(fd); + brw_process_intel_debug_variable(); + device->compiler = brw_compiler_create(NULL, device->info); if (device->compiler == NULL) { result = vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); goto fail; } + device->compiler->shader_debug_log = compiler_debug_log; + device->compiler->shader_perf_log = compiler_perf_log; return VK_SUCCESS; @@ -146,7 +166,6 @@ static const VkExtensionProperties device_extensions[] = { }, }; - VkResult anv_CreateInstance( const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance) @@ -633,8 +652,6 @@ VkResult anv_CreateDevice( device->info = *physical_device->info; - device->compiler = anv_compiler_create(device); - anv_queue_init(device, &device->queue); anv_device_init_meta(device); @@ -658,8 +675,6 @@ void anv_DestroyDevice( { ANV_FROM_HANDLE(anv_device, device, _device); - anv_compiler_destroy(device->compiler); - anv_queue_finish(&device->queue); anv_device_finish_meta(device); |