return result;
}
-
-VkResult
-anv_graphics_pipeline_create(
- VkDevice _device,
- VkPipelineCache _cache,
- const VkGraphicsPipelineCreateInfo *pCreateInfo,
- const VkAllocationCallbacks *pAllocator,
- VkPipeline *pPipeline)
-{
- ANV_FROM_HANDLE(anv_device, device, _device);
- ANV_FROM_HANDLE(anv_pipeline_cache, cache, _cache);
-
- switch (device->info.gen) {
- case 7:
- if (device->info.is_haswell)
- return gen75_graphics_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- else
- return gen7_graphics_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- case 8:
- return gen8_graphics_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- case 9:
- return gen9_graphics_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- default:
- unreachable("unsupported gen\n");
- }
-}
-
-VkResult anv_CreateGraphicsPipelines(
- VkDevice _device,
- VkPipelineCache pipelineCache,
- uint32_t count,
- const VkGraphicsPipelineCreateInfo* pCreateInfos,
- const VkAllocationCallbacks* pAllocator,
- VkPipeline* pPipelines)
-{
- VkResult result = VK_SUCCESS;
-
- unsigned i = 0;
- for (; i < count; i++) {
- result = anv_graphics_pipeline_create(_device,
- pipelineCache,
- &pCreateInfos[i],
- pAllocator, &pPipelines[i]);
- if (result != VK_SUCCESS) {
- for (unsigned j = 0; j < i; j++) {
- anv_DestroyPipeline(_device, pPipelines[j], pAllocator);
- }
-
- return result;
- }
- }
-
- return VK_SUCCESS;
-}
-
-static VkResult anv_compute_pipeline_create(
- VkDevice _device,
- VkPipelineCache _cache,
- const VkComputePipelineCreateInfo* pCreateInfo,
- const VkAllocationCallbacks* pAllocator,
- VkPipeline* pPipeline)
-{
- ANV_FROM_HANDLE(anv_device, device, _device);
- ANV_FROM_HANDLE(anv_pipeline_cache, cache, _cache);
-
- switch (device->info.gen) {
- case 7:
- if (device->info.is_haswell)
- return gen75_compute_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- else
- return gen7_compute_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- case 8:
- return gen8_compute_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- case 9:
- return gen9_compute_pipeline_create(_device, cache, pCreateInfo, pAllocator, pPipeline);
- default:
- unreachable("unsupported gen\n");
- }
-}
-
-VkResult anv_CreateComputePipelines(
- VkDevice _device,
- VkPipelineCache pipelineCache,
- uint32_t count,
- const VkComputePipelineCreateInfo* pCreateInfos,
- const VkAllocationCallbacks* pAllocator,
- VkPipeline* pPipelines)
-{
- VkResult result = VK_SUCCESS;
-
- unsigned i = 0;
- for (; i < count; i++) {
- result = anv_compute_pipeline_create(_device, pipelineCache,
- &pCreateInfos[i],
- pAllocator, &pPipelines[i]);
- if (result != VK_SUCCESS) {
- for (unsigned j = 0; j < i; j++) {
- anv_DestroyPipeline(_device, pPipelines[j], pAllocator);
- }
-
- return result;
- }
- }
-
- return VK_SUCCESS;
-}
#include "genxml/gen_macros.h"
#include "genxml/genX_pack.h"
-VkResult
-genX(compute_pipeline_create)(
+static VkResult
+compute_pipeline_create(
VkDevice _device,
struct anv_pipeline_cache * cache,
const VkComputePipelineCreateInfo* pCreateInfo,
return VK_SUCCESS;
}
+
+VkResult genX(CreateGraphicsPipelines)(
+ VkDevice _device,
+ VkPipelineCache pipelineCache,
+ uint32_t count,
+ const VkGraphicsPipelineCreateInfo* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipeline* pPipelines)
+{
+ ANV_FROM_HANDLE(anv_pipeline_cache, pipeline_cache, pipelineCache);
+
+ VkResult result = VK_SUCCESS;
+
+ unsigned i = 0;
+ for (; i < count; i++) {
+ result = genX(graphics_pipeline_create)(_device,
+ pipeline_cache,
+ &pCreateInfos[i],
+ pAllocator, &pPipelines[i]);
+ if (result != VK_SUCCESS) {
+ for (unsigned j = 0; j < i; j++) {
+ anv_DestroyPipeline(_device, pPipelines[j], pAllocator);
+ }
+
+ return result;
+ }
+ }
+
+ return VK_SUCCESS;
+}
+
+VkResult genX(CreateComputePipelines)(
+ VkDevice _device,
+ VkPipelineCache pipelineCache,
+ uint32_t count,
+ const VkComputePipelineCreateInfo* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipeline* pPipelines)
+{
+ ANV_FROM_HANDLE(anv_pipeline_cache, pipeline_cache, pipelineCache);
+
+ VkResult result = VK_SUCCESS;
+
+ unsigned i = 0;
+ for (; i < count; i++) {
+ result = compute_pipeline_create(_device, pipeline_cache,
+ &pCreateInfos[i],
+ pAllocator, &pPipelines[i]);
+ if (result != VK_SUCCESS) {
+ for (unsigned j = 0; j < i; j++) {
+ anv_DestroyPipeline(_device, pPipelines[j], pAllocator);
+ }
+
+ return result;
+ }
+ }
+
+ return VK_SUCCESS;
+}