@@ -365,6 +365,10 @@ bool CoreChecks::ValidateBeginCommandBufferInheritanceInfo(const vvl::CommandBuf
365365 }
366366 }
367367
368+ if (enabled_features.tileShading ) {
369+ skip |= ValidateBeginCommandBufferRenderPassTileShadingCreateInfo (cb_state, info, begin_flags, inheritance_loc);
370+ }
371+
368372 return skip;
369373}
370374
@@ -469,6 +473,76 @@ bool CoreChecks::ValidateBeginCommandBufferRenderingInheritanceInfo(const vvl::C
469473 return skip;
470474}
471475
476+ bool CoreChecks::ValidateBeginCommandBufferRenderPassTileShadingCreateInfo (const vvl::CommandBuffer& cb_state,
477+ const VkCommandBufferInheritanceInfo& info,
478+ const VkCommandBufferUsageFlags begin_flags,
479+ const Location& inheritance_loc) const {
480+ bool skip = false ;
481+ const bool has_rp_continue_bit = (begin_flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) != 0 ;
482+ const auto * rp_tile_shading_ci = vku::FindStructInPNextChain<VkRenderPassTileShadingCreateInfoQCOM>(info.pNext );
483+ const bool has_rp_enable_bit = rp_tile_shading_ci ?
484+ (rp_tile_shading_ci->flags & VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM) != 0 : false ;
485+ const auto rp_state = Get<vvl::RenderPass>(info.renderPass );
486+ const bool rp_enabled_tile_shading = rp_state ? rp_state->has_tile_shading_enabled : false ;
487+
488+ if (has_rp_continue_bit && rp_enabled_tile_shading && !has_rp_enable_bit) {
489+ std::stringstream conditional_ss{};
490+ if (rp_tile_shading_ci) {
491+ conditional_ss << " (" << string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags )
492+ << " )" << " doesn't contain VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM bit, " ;
493+ }
494+ else {
495+ conditional_ss << " doesn't include VkRenderPassTileShadingCreateInfoQCOM instance, " ;
496+ }
497+ conditional_ss << " but VkCommandBufferBeginInfo::flags (" << string_VkCommandBufferUsageFlags (begin_flags)
498+ << " ) contains VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT bit and "
499+ << " VkCommandBufferInheritanceInfo::renderPass has been created with tile shading enabled." ;
500+
501+ const LogObjectList objlist (cb_state.Handle (), rp_state->Handle ());
502+ const Location error_loc = rp_tile_shading_ci ?
503+ inheritance_loc.pNext (Struct::VkRenderPassTileShadingCreateInfoQCOM, Field::flags) : inheritance_loc.dot (Field::pNext);
504+ skip |= LogError (" VUID-VkCommandBufferBeginInfo-flags-10617" , objlist, error_loc,
505+ " %s" , conditional_ss.str ().c_str ());
506+ }
507+
508+ if (!has_rp_continue_bit && !rp_enabled_tile_shading && has_rp_enable_bit) {
509+ std::stringstream conditional_ss{};
510+ conditional_ss << " but VkCommandBufferBeginInfo::flags is ( " << string_VkCommandBufferUsageFlags (begin_flags) << " )" ;
511+ if (!info.renderPass ) {
512+ conditional_ss << " and VkCommandBufferInheritanceInfo::renderPass is VK_NULL_HANDLE." ;
513+ }
514+ else {
515+ conditional_ss << " and VkCommandBufferInheritanceInfo::renderPass hasn't been created with tile shading enabled. "
516+ " (Can be enabled by using VkRenderPassTileShadingCreateInfoQCOM)" ;
517+ }
518+
519+ skip |= LogError (" VUID-VkCommandBufferBeginInfo-flags-10618" , cb_state.Handle (),
520+ inheritance_loc.pNext (Struct::VkRenderPassTileShadingCreateInfoQCOM, Field::flags),
521+ " (%s) contains VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM bit, %s" ,
522+ string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags ).c_str (),
523+ conditional_ss.str ().c_str ());
524+ }
525+
526+ if (has_rp_enable_bit && rp_enabled_tile_shading) {
527+ const auto * rp_tile_shading_ci_of_rp =
528+ vku::FindStructInPNextChain<VkRenderPassTileShadingCreateInfoQCOM>(rp_state->create_info .pNext );
529+ if (rp_tile_shading_ci->tileApronSize .width != rp_tile_shading_ci_of_rp->tileApronSize .width ||
530+ rp_tile_shading_ci->tileApronSize .height != rp_tile_shading_ci_of_rp->tileApronSize .height ) {
531+ const LogObjectList objlist (cb_state.Handle (), rp_state->Handle ());
532+ skip |= LogError (" VUID-VkCommandBufferBeginInfo-flags-10619" , objlist,
533+ inheritance_loc.pNext (Struct::VkRenderPassTileShadingCreateInfoQCOM, Field::flags),
534+ " (%s) contains VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM bit, but "
535+ " tileApronSize (%s) aren't equal to that "
536+ " tileApronSize (%s) used to create VkCommandBufferInheritanceInfo::renderPass." ,
537+ string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags ).c_str (),
538+ string_VkExtent2D (rp_tile_shading_ci->tileApronSize ).c_str (),
539+ string_VkExtent2D (rp_tile_shading_ci_of_rp->tileApronSize ).c_str ());
540+ }
541+ }
542+
543+ return skip;
544+ }
545+
472546bool CoreChecks::PreCallValidateEndCommandBuffer (VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const {
473547 bool skip = false ;
474548 auto cb_state_ptr = GetRead<vvl::CommandBuffer>(commandBuffer);
@@ -1318,6 +1392,18 @@ bool CoreChecks::PreCallValidateCmdExecuteCommands(VkCommandBuffer commandBuffer
13181392 " the vkBeginCommandBuffer() was called." ,
13191393 FormatHandle (secondary_cb).c_str ());
13201394 }
1395+ if (secondary_cb_state.has_inheritance ) {
1396+ const auto * rp_tile_shading_ci =
1397+ vku::FindStructInPNextChain<VkRenderPassTileShadingCreateInfoQCOM>(secondary_cb_state.inheritance_info .pNext );
1398+ if (rp_tile_shading_ci &&
1399+ (rp_tile_shading_ci->tileApronSize .width != 0 || rp_tile_shading_ci->tileApronSize .height != 0 )) {
1400+ const LogObjectList objlist (commandBuffer, secondary_cb);
1401+ skip |= LogError (" VUID-vkCmdExecuteCommands-tileApronSize-10625" , objlist, secondary_cb_loc,
1402+ " has been recorded with VkRenderPassTileShadingCreateInfoQCOM::tileApronSize "
1403+ " (%s) for non-render-pass scenario." ,
1404+ string_VkExtent2D (rp_tile_shading_ci->tileApronSize ).c_str ());
1405+ }
1406+ }
13211407 } else if (rp_state) {
13221408 const vvl::RenderPass* secondary_rp_state = secondary_cb_state.active_render_pass .get ();
13231409 if (secondary_rp_state) {
@@ -1762,6 +1848,78 @@ bool CoreChecks::ValidateCmdExecuteCommandsRenderPassInheritance(const vvl::Comm
17621848 }
17631849 }
17641850
1851+ const auto * rp_tile_shading_ci = vku::FindStructInPNextChain<VkRenderPassTileShadingCreateInfoQCOM>(inheritance_info.pNext );
1852+ const bool has_rp_enable_bit = (rp_tile_shading_ci) ?
1853+ (rp_tile_shading_ci->flags & VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM) != 0 : false ;
1854+ const bool has_rp_per_tile_exec_bit = (rp_tile_shading_ci) ?
1855+ (rp_tile_shading_ci->flags & VK_TILE_SHADING_RENDER_PASS_PER_TILE_EXECUTION_BIT_QCOM) != 0 : false ;
1856+ if (rp_state.has_tile_shading_enabled ) {
1857+ if (!has_rp_enable_bit) {
1858+ std::stringstream conditional_ss{};
1859+ if (rp_tile_shading_ci) {
1860+ conditional_ss << " has been recorded with VkRenderPassTileShadingCreateInfoQCOM::flags ("
1861+ << string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags )
1862+ << " ) doesn't include VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM bit, " ;
1863+ } else {
1864+ conditional_ss << " hasn't been recorded with VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM bit since "
1865+ << " VkCommandBufferInheritanceInfo::pNext doesn't include "
1866+ << " VkRenderPassTileShadingCreateInfoQCOM instance, " ;
1867+ }
1868+ conditional_ss << " but the render pass has tile shading enabled." ;
1869+ const LogObjectList objlist (cb_state.Handle (), secondary_cb_state.Handle (), rp_state.Handle ());
1870+ skip |= LogError (" VUID-vkCmdExecuteCommands-pCommandBuffers-10620" , objlist, secondary_cb_loc,
1871+ " %s" , conditional_ss.str ().c_str ());
1872+ }
1873+
1874+ const auto *rp_tile_shading_ci_of_rp =
1875+ vku::FindStructInPNextChain<VkRenderPassTileShadingCreateInfoQCOM>(rp_state.create_info .pNext );
1876+ if (rp_tile_shading_ci &&
1877+ (rp_tile_shading_ci_of_rp->tileApronSize .width != rp_tile_shading_ci->tileApronSize .width ||
1878+ rp_tile_shading_ci_of_rp->tileApronSize .height != rp_tile_shading_ci->tileApronSize .height )) {
1879+ const LogObjectList objlist (cb_state.Handle (), secondary_cb_state.Handle (), rp_state.Handle ());
1880+ skip |= LogError (" VUID-vkCmdExecuteCommands-tileApronSize-10622" , objlist, secondary_cb_loc,
1881+ " has been recorded with VkRenderPassTileShadingCreateInfoQCOM::tileApronSize "
1882+ " (%s) that isn't equal to that tileApronSize (%s) used to create the render pass." ,
1883+ string_VkExtent2D (rp_tile_shading_ci->tileApronSize ).c_str (),
1884+ string_VkExtent2D (rp_tile_shading_ci_of_rp->tileApronSize ).c_str ());
1885+ }
1886+ }
1887+
1888+ if (has_rp_enable_bit && !rp_state.has_tile_shading_enabled ) {
1889+ const LogObjectList objlist (cb_state.Handle (), secondary_cb_state.Handle (), rp_state.Handle ());
1890+ skip |= LogError (" VUID-vkCmdExecuteCommands-pCommandBuffers-10623" , objlist, secondary_cb_loc,
1891+ " has been recorded with VkRenderPassTileShadingCreateInfoQCOM::flags (%s) "
1892+ " that includes VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM bit, but "
1893+ " the render pass doesn't have tile shading enabled. "
1894+ " (Can be enabled by using VkRenderPassTileShadingCreateInfoQCOM)" ,
1895+ string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags ).c_str ());
1896+ }
1897+
1898+ if (cb_state.per_tile_execution_model_enabled && !has_rp_per_tile_exec_bit) {
1899+ std::stringstream conditional_ss{};
1900+ if (rp_tile_shading_ci) {
1901+ conditional_ss << " has been recorded with VkRenderPassTileShadingCreateInfoQCOM::flags ("
1902+ << string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags )
1903+ << " ) doesn't include VK_TILE_SHADING_RENDER_PASS_PER_TILE_EXECUTION_BIT_QCOM bit, " ;
1904+ } else {
1905+ conditional_ss << " hasn't been recorded with VK_TILE_SHADING_RENDER_PASS_PER_TILE_EXECUTION_BIT_QCOM "
1906+ << " bit since VkCommandBufferInheritanceInfo::pNext doesn't include "
1907+ << " VkRenderPassTileShadingCreateInfoQCOM instance, " ;
1908+ }
1909+ conditional_ss << " but the per-tile execution model is enabled in the command buffer." ;
1910+ const LogObjectList objlist (cb_state.Handle (), secondary_cb_state.Handle (), rp_state.Handle ());
1911+ skip |= LogError (" VUID-vkCmdExecuteCommands-pCommandBuffers-10621" , objlist, secondary_cb_loc,
1912+ " %s" , conditional_ss.str ().c_str ());
1913+ } else if (!cb_state.per_tile_execution_model_enabled && has_rp_per_tile_exec_bit) {
1914+ const LogObjectList objlist (cb_state.Handle (), secondary_cb_state.Handle (), rp_state.Handle ());
1915+ skip |= LogError (" VUID-vkCmdExecuteCommands-pCommandBuffers-10624" , objlist, secondary_cb_loc,
1916+ " has been recorded with VkRenderPassTileShadingCreateInfoQCOM::flags (%s) "
1917+ " includes VK_TILE_SHADING_RENDER_PASS_PER_TILE_EXECUTION_BIT_QCOM bit, but "
1918+ " the per-tile execution model isn't enabled in the command buffer. "
1919+ " (Can be enabled by calling vkCmdBeginPerTileExecutionQCOM)" ,
1920+ string_VkTileShadingRenderPassFlagsQCOM (rp_tile_shading_ci->flags ).c_str ());
1921+ }
1922+
17651923 return skip;
17661924}
17671925
@@ -2113,12 +2271,28 @@ bool CoreChecks::PreCallValidateCmdEndPerTileExecutionQCOM(VkCommandBuffer comma
21132271bool CoreChecks::PreCallValidateCmdDebugMarkerBeginEXT (VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo,
21142272 const ErrorObject& error_obj) const {
21152273 auto cb_state = GetRead<vvl::CommandBuffer>(commandBuffer);
2116- return ValidateCmd (*cb_state, error_obj.location );
2274+ bool skip = ValidateCmd (*cb_state, error_obj.location );
2275+
2276+ if (cb_state->per_tile_execution_model_enabled ) {
2277+ skip |= LogError (" VUID-vkCmdDebugMarkerBeginEXT-None-10614" , commandBuffer, error_obj.location ,
2278+ " the per-tile execution model has been enabled in this command buffer. "
2279+ " (Don't call vkCmdBeginPerTileExecutionQCOM before vkCmdDebugMarkerBeginEXT)" );
2280+ }
2281+
2282+ return skip;
21172283}
21182284
21192285bool CoreChecks::PreCallValidateCmdDebugMarkerEndEXT (VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const {
21202286 auto cb_state = GetRead<vvl::CommandBuffer>(commandBuffer);
2121- return ValidateCmd (*cb_state, error_obj.location );
2287+ bool skip = ValidateCmd (*cb_state, error_obj.location );
2288+
2289+ if (cb_state->per_tile_execution_model_enabled ) {
2290+ skip |= LogError (" VUID-vkCmdDebugMarkerEndEXT-None-10615" , commandBuffer, error_obj.location ,
2291+ " the per-tile execution model has been enabled in this command buffer. "
2292+ " (Don't call vkCmdBeginPerTileExecutionQCOM before vkCmdDebugMarkerEndEXT)" );
2293+ }
2294+
2295+ return skip;
21222296}
21232297
21242298bool CoreChecks::PreCallValidateCmdDebugMarkerInsertEXT (VkCommandBuffer commandBuffer,
@@ -2358,6 +2532,12 @@ bool CoreChecks::PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer com
23582532 }
23592533 }
23602534
2535+ if (cb_state->per_tile_execution_model_enabled ) {
2536+ skip |= LogError (" VUID-vkCmdBeginTransformFeedbackEXT-None-10656" , commandBuffer, error_obj.location ,
2537+ " the per-tile execution model has been enabled in this command buffer. "
2538+ " (Don't call vkCmdBeginPerTileExecutionQCOM before vkCmdBeginTransformFeedbackEXT)" );
2539+ }
2540+
23612541 return skip;
23622542}
23632543
@@ -2438,6 +2618,12 @@ bool CoreChecks::PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer comma
24382618 }
24392619 }
24402620
2621+ if (cb_state->per_tile_execution_model_enabled ) {
2622+ skip |= LogError (" VUID-vkCmdEndTransformFeedbackEXT-None-10657" , commandBuffer, error_obj.location ,
2623+ " the per-tile execution model has been enabled in this command buffer. "
2624+ " (Don't call vkCmdBeginPerTileExecutionQCOM before vkCmdEndTransformFeedbackEXT)" );
2625+ }
2626+
24412627 return skip;
24422628}
24432629
0 commit comments