2 * Copyright © 2016 Red Hat.
3 * Copyright © 2016 Bas Nieuwenhuizen
5 * based in part on anv driver which is:
6 * Copyright © 2015 Intel Corporation
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28 #include "tu_private.h"
30 #include "nir/nir_builder.h"
31 #include "spirv/nir_spirv.h"
32 #include "util/mesa-sha1.h"
33 #include "util/u_atomic.h"
36 #include "main/menums.h"
37 #include "util/debug.h"
38 #include "vk_format.h"
41 tu_graphics_pipeline_create(
43 VkPipelineCache _cache
,
44 const VkGraphicsPipelineCreateInfo
*pCreateInfo
,
45 const struct tu_graphics_pipeline_create_info
*extra
,
46 const VkAllocationCallbacks
*pAllocator
,
47 VkPipeline
*pPipeline
)
54 tu_CreateGraphicsPipelines(VkDevice _device
,
55 VkPipelineCache pipelineCache
,
57 const VkGraphicsPipelineCreateInfo
*pCreateInfos
,
58 const VkAllocationCallbacks
*pAllocator
,
59 VkPipeline
*pPipelines
)
61 VkResult result
= VK_SUCCESS
;
64 for (; i
< count
; i
++) {
66 r
= tu_graphics_pipeline_create(_device
,
72 if (r
!= VK_SUCCESS
) {
74 pPipelines
[i
] = VK_NULL_HANDLE
;
82 tu_compute_pipeline_create(VkDevice _device
,
83 VkPipelineCache _cache
,
84 const VkComputePipelineCreateInfo
*pCreateInfo
,
85 const VkAllocationCallbacks
*pAllocator
,
86 VkPipeline
*pPipeline
)
92 tu_CreateComputePipelines(VkDevice _device
,
93 VkPipelineCache pipelineCache
,
95 const VkComputePipelineCreateInfo
*pCreateInfos
,
96 const VkAllocationCallbacks
*pAllocator
,
97 VkPipeline
*pPipelines
)
99 VkResult result
= VK_SUCCESS
;
102 for (; i
< count
; i
++) {
104 r
= tu_compute_pipeline_create(
105 _device
, pipelineCache
, &pCreateInfos
[i
], pAllocator
, &pPipelines
[i
]);
106 if (r
!= VK_SUCCESS
) {
108 pPipelines
[i
] = VK_NULL_HANDLE
;