summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2024-03-12 18:33:37 +0100
committerGitHub <noreply@github.com>2024-03-12 10:33:37 -0700
commit8dc635ae72031d34bd36ed80874c568d6d43d587 (patch)
treee8b896b863f92bc6fa6bd3c81dd2a1c20058c233
parent1c4e1acdd48779b94c1008ba2456c63975e5fb7d (diff)
gfx: return error when vulkan fails to create buffer/pipeline (#3741)
* return buffer creation errors in vulkan * return pipeline creation errors in vulkan --------- Co-authored-by: Yong He <yonghe@outlook.com>
-rw-r--r--tools/gfx/vulkan/vk-buffer.cpp6
-rw-r--r--tools/gfx/vulkan/vk-pipeline-state.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/gfx/vulkan/vk-buffer.cpp b/tools/gfx/vulkan/vk-buffer.cpp
index 32c14bcb9..721886d9f 100644
--- a/tools/gfx/vulkan/vk-buffer.cpp
+++ b/tools/gfx/vulkan/vk-buffer.cpp
@@ -41,7 +41,7 @@ Result VKBufferHandleRAII::init(
bufferCreateInfo.pNext = &externalMemoryBufferCreateInfo;
}
- SLANG_VK_CHECK(api.vkCreateBuffer(api.m_device, &bufferCreateInfo, nullptr, &m_buffer));
+ SLANG_VK_RETURN_ON_FAIL(api.vkCreateBuffer(api.m_device, &bufferCreateInfo, nullptr, &m_buffer));
VkMemoryRequirements memoryReqs = {};
api.vkGetBufferMemoryRequirements(api.m_device, m_buffer, &memoryReqs);
@@ -87,8 +87,8 @@ Result VKBufferHandleRAII::init(
allocateInfo.pNext = &flagInfo;
}
- SLANG_VK_CHECK(api.vkAllocateMemory(api.m_device, &allocateInfo, nullptr, &m_memory));
- SLANG_VK_CHECK(api.vkBindBufferMemory(api.m_device, m_buffer, m_memory, 0));
+ SLANG_VK_RETURN_ON_FAIL(api.vkAllocateMemory(api.m_device, &allocateInfo, nullptr, &m_memory));
+ SLANG_VK_RETURN_ON_FAIL(api.vkBindBufferMemory(api.m_device, m_buffer, m_memory, 0));
return SLANG_OK;
}
diff --git a/tools/gfx/vulkan/vk-pipeline-state.cpp b/tools/gfx/vulkan/vk-pipeline-state.cpp
index d861a343c..2e7bb1c0a 100644
--- a/tools/gfx/vulkan/vk-pipeline-state.cpp
+++ b/tools/gfx/vulkan/vk-pipeline-state.cpp
@@ -284,7 +284,7 @@ Result PipelineStateImpl::createVKGraphicsPipelineState()
}
else
{
- SLANG_VK_CHECK(m_device->m_api.vkCreateGraphicsPipelines(
+ SLANG_VK_RETURN_ON_FAIL(m_device->m_api.vkCreateGraphicsPipelines(
m_device->m_device, pipelineCache, 1, &pipelineInfo, nullptr, &m_pipeline));
}
@@ -316,7 +316,7 @@ Result PipelineStateImpl::createVKComputePipelineState()
else
{
VkPipelineCache pipelineCache = VK_NULL_HANDLE;
- SLANG_VK_CHECK(m_device->m_api.vkCreateComputePipelines(
+ SLANG_VK_RETURN_ON_FAIL(m_device->m_api.vkCreateComputePipelines(
m_device->m_device, pipelineCache, 1, &computePipelineInfo, nullptr, &m_pipeline));
}
return SLANG_OK;
@@ -455,7 +455,7 @@ Result RayTracingPipelineStateImpl::createVKRayTracingPipelineState()
}
VkPipelineCache pipelineCache = VK_NULL_HANDLE;
- SLANG_VK_CHECK(m_device->m_api.vkCreateRayTracingPipelinesKHR(
+ SLANG_VK_RETURN_ON_FAIL(m_device->m_api.vkCreateRayTracingPipelinesKHR(
m_device->m_device,
VK_NULL_HANDLE,
pipelineCache,