I have 2 valid shader objects vert, and frag, but whenever I try to use vkCmdDraw I get hit with this
VUID-vkCmdDraw-None-08607(ERROR / SPEC): msgNum: 481152932 - Validation Error: [ VUID-vkCmdDraw-None-08607 ] Object 0: handle = 0x297485654f0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x1cadcfa4 | vkCmdDraw(): A valid VK_PIPELINE_BIND_POINT_GRAPHICS pipeline must be bound with vkCmdBindPipeline or shader objects with vkCmdBindShadersEXT before calling this command. The Vulkan spec states: If the shaderObject is enabled, either a valid pipeline must be bound to the pipeline bind point used by this command, or a valid combination of valid and VK_NULL_HANDLE shader objects must be bound to every supported shader stage corresponding to the pipeline bind point used by this command (https://vulkan.lunarg.com/doc/view/1.3.290.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-None-08607)
My code is as such
void bindPipeline(Pipeline pline, VkCommandBuffer cBuf)
{
VkBool32 cbEnable = pline.colorBlending;
vkCmdSetColorWriteMaskEXT_(cBuf, 0, 1, &pline.colorWriteMask);
vkCmdSetColorBlendEnableEXT_(cBuf, 0, 1, &cbEnable);
vkCmdSetLogicOpEnableEXT_(cBuf, pline.logicOpEnable);
vkCmdSetDepthTestEnable(cBuf, pline.depthTestEnable);
vkCmdSetDepthBiasEnable(cBuf, pline.depthBiasEnable);
vkCmdSetDepthClampEnableEXT_(cBuf, pline.depthClampEnable);
vkCmdSetDepthClipEnableEXT_(cBuf, pline.depthClipEnable);
vkCmdSetStencilTestEnable(cBuf, pline.stencilTestEnable);
vkCmdSetDepthWriteEnable(cBuf, pline.depthWriteEnable);
vkCmdSetDepthBoundsTestEnable(cBuf, pline.depthBoundsEnable);
vkCmdSetAlphaToCoverageEnableEXT_(cBuf, pline.alphaToCoverageEnable);
vkCmdSetAlphaToOneEnableEXT_(cBuf, pline.alphaToOneEnable);
vkCmdSetColorWriteMaskEXT_(cBuf, 0, 1, &pline.colorWriteMask);
vkCmdSetPolygonModeEXT_(cBuf, pline.polyMode);
vkCmdSetPrimitiveTopology(cBuf, pline.topology);
vkCmdSetRasterizerDiscardEnable(cBuf, pline.reasterizerDiscardEnable);
vkCmdSetPrimitiveRestartEnable(cBuf, pline.primitiveRestartEnable);
vkCmdSetRasterizationSamplesEXT_(cBuf, pline.rastSampleCount);
vkCmdSetFrontFace(cBuf, pline.frontFace);
vkCmdSetCullMode(cBuf, pline.cullMode);
if (pline.colorBlending == VK_TRUE)
vkCmdSetColorBlendEquationEXT_(cBuf, 0, 1, &pline.colorBlendEq);
if (pline.logicOpEnable == VK_TRUE)
vkCmdSetLogicOpEXT_(cBuf, pline.logicOp);
if (pline.depthTestEnable == VK_TRUE)
{
vkCmdSetDepthBounds(cBuf, pline.minDepth, pline.maxDepth);
vkCmdSetDepthCompareOp(cBuf, pline.depthCompareOp);
}
vkCmdSetSampleMaskEXT_(cBuf, 1, pline.sampleMask);
vkCmdBindShadersEXT_(cBuf, 1, (VkShaderStageFlagBits[1]){VK_SHADER_STAGE_VERTEX_BIT}, &pline.vert.shader);
vkCmdBindShadersEXT_(cBuf, 1, (VkShaderStageFlagBits[1]){VK_SHADER_STAGE_FRAGMENT_BIT}, &pline.frag.shader);
int vertexDescCount = pline.vert.VertexDescriptons;
vkCmdSetVertexInputEXT_(cBuf, vertexDescCount, pline.vert.bindingDesc, vertexDescCount, pline.vert.attrDesc);
}
void unBindPipeline(VkCommandBuffer cBuf)
{
vkCmdBindShadersEXT_(cBuf, 1, (VkShaderStageFlagBits[1]){VK_SHADER_STAGE_VERTEX_BIT}, VK_NULL_HANDLE);
vkCmdBindShadersEXT_(cBuf, 1, (VkShaderStageFlagBits[1]){VK_SHADER_STAGE_FRAGMENT_BIT}, VK_NULL_HANDLE);
}
which should satisfy the conditions required for this right?
my execution callback for the given renderpass is as so
void helloTriangleCallback(RenderPass pass, VkCommandBuffer cBuf)
{
bindPipeline(pass.pl, cBuf);
vkCmdDraw(cBuf, 3, 1, 0, 0);
unBindPipeline(cBuf);
}
Why would this create such a result?