Skip to content

Commit 44c213b

Browse files
correct bad validations, KHR instead of coe func usage etc.
1 parent 7e44e1a commit 44c213b

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/nbl/video/CVulkanCommandBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ bool CVulkanCommandBuffer::bindDescriptorSets_impl(const asset::E_PIPELINE_BIND_
431431
}
432432
}
433433
// with K slots you need at most (K+1)/2 calls
434-
assert(bindCallsCount < (IGPUPipelineLayout::DESCRIPTOR_SET_COUNT-1)/2);
434+
assert(bindCallsCount <= (IGPUPipelineLayout::DESCRIPTOR_SET_COUNT+1)/2);
435435
return true;
436436
}
437437

src/nbl/video/CVulkanLogicalDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ auto CVulkanLogicalDevice::waitForSemaphores(const std::span<const SSemaphoreWai
8181
waitInfo.semaphoreCount = semaphores.size();
8282
waitInfo.pSemaphores = semaphores.data();
8383
waitInfo.pValues = values.data();
84-
switch (m_devf.vk.vkWaitSemaphoresKHR(m_vkdev,&waitInfo,timeout))
84+
switch (m_devf.vk.vkWaitSemaphores(m_vkdev,&waitInfo,timeout))
8585
{
8686
case VK_SUCCESS:
8787
return WAIT_RESULT::SUCCESS;

src/nbl/video/CVulkanQueue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ auto CVulkanQueue::submit_impl(const std::span<const IQueue::SSubmitInfo> _submi
6060
core::vector<VkSubmitInfo2> submits(_submits.size(),{VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR,/*No interesting extensions*/nullptr,/*No protected stuff yet*/0});
6161
core::vector<VkSemaphoreSubmitInfoKHR> waitSemaphores(waitSemCnt);
6262
core::vector<VkCommandBufferSubmitInfoKHR> commandBuffers(cmdBufCnt,{VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR,nullptr});
63-
core::vector<VkSemaphoreSubmitInfoKHR> signalSemaphores(waitSemCnt);
63+
core::vector<VkSemaphoreSubmitInfoKHR> signalSemaphores(signalSemCnt);
6464

6565
auto outSubmitInfo = submits.data();
6666
auto outWaitSemaphoreInfo = waitSemaphores.data();
@@ -84,7 +84,7 @@ auto CVulkanQueue::submit_impl(const std::span<const IQueue::SSubmitInfo> _submi
8484
outSubmitInfo->signalSemaphoreInfoCount = fillSemaphoreInfo(submit.signalSemaphores,outSignalSemaphoreInfo);
8585
outSubmitInfo++;
8686
}
87-
const auto vk_result = static_cast<const CVulkanLogicalDevice*>(m_originDevice)->getFunctionTable()->vk.vkQueueSubmit2KHR(m_vkQueue,submits.size(),submits.data(),VK_NULL_HANDLE);
87+
const auto vk_result = static_cast<const CVulkanLogicalDevice*>(m_originDevice)->getFunctionTable()->vk.vkQueueSubmit2(m_vkQueue,submits.size(),submits.data(),VK_NULL_HANDLE);
8888
return getResultFrom(vk_result);
8989
}
9090

src/nbl/video/IGPUCommandBuffer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ bool IGPUCommandBuffer::reset(const core::bitflag<RESET_FLAGS> flags)
164164
bool IGPUCommandBuffer::end()
165165
{
166166
const bool whollyInsideRenderpass = m_recordingFlags.hasFlags(USAGE::RENDER_PASS_CONTINUE_BIT);
167-
if (!checkStateBeforeRecording(whollyInsideRenderpass ? queue_flags_t::GRAPHICS_BIT:queue_flags_t::NONE,whollyInsideRenderpass ? RENDERPASS_SCOPE::INSIDE:RENDERPASS_SCOPE::OUTSIDE))
167+
auto allowedQueueCaps = queue_flags_t::GRAPHICS_BIT;
168+
if (!whollyInsideRenderpass)
169+
allowedQueueCaps |= queue_flags_t::COMPUTE_BIT|queue_flags_t::TRANSFER_BIT;
170+
if (!checkStateBeforeRecording(allowedQueueCaps,whollyInsideRenderpass ? RENDERPASS_SCOPE::INSIDE:RENDERPASS_SCOPE::OUTSIDE))
168171
return false;
169172

170173
m_state = STATE::EXECUTABLE;

0 commit comments

Comments
 (0)