This patch contains fixes to structure layout for draws.
These structures are accessed by HW and must be in a specific order.
This change also includes reordering of the parameters for
vkCmdDraw and vkCmdDrawIndexed.
vkCmdSetStencilWriteMask(cmd_buf, VK_STENCIL_FACE_FRONT_BIT | VK_STENCIL_FACE_BACK_BIT, 0xff);
vkCmdSetStencilReference(cmd_buf, VK_STENCIL_FACE_FRONT_BIT | VK_STENCIL_FACE_BACK_BIT, 0);
- vkCmdDraw(cmd_buf, 0, 12 * 3, 0, 1);
+ vkCmdDraw(cmd_buf, 12 * 3, 1, 0, 0);
vkCmdEndRenderPass(cmd_buf);
err = vkEndCommandBuffer(cmd_buf);
VkDeviceSize offsets[1] = {0};
vkCmdBindVertexBuffers(demo->draw_cmd, VERTEX_BUFFER_BIND_ID, 1, &demo->vertices.buf, offsets);
- vkCmdDraw(demo->draw_cmd, 0, 3, 0, 1);
+ vkCmdDraw(demo->draw_cmd, 3, 1, 0, 0);
vkCmdEndRenderPass(demo->draw_cmd);
err = vkEndCommandBuffer(demo->draw_cmd);
}
ICD_EXPORT void VKAPI vkCmdDraw(
- VkCmdBuffer cmdBuffer,
- uint32_t firstVertex,
+ VkCmdBuffer cmdBuffer,
uint32_t vertexCount,
- uint32_t firstInstance,
- uint32_t instanceCount)
+ uint32_t instanceCount,
+ uint32_t firstVertex,
+ uint32_t firstInstance)
{
NULLDRV_LOG_FUNC;
}
ICD_EXPORT void VKAPI vkCmdDrawIndexed(
VkCmdBuffer cmdBuffer,
- uint32_t firstIndex,
uint32_t indexCount,
+ uint32_t instanceCount,
+ uint32_t firstIndex,
int32_t vertexOffset,
- uint32_t firstInstance,
- uint32_t instanceCount)
+ uint32_t firstInstance)
{
NULLDRV_LOG_FUNC;
}
uint32_t stencil;
} VkClearDepthStencilValue;
-typedef union {
- VkClearColorValue color;
- VkClearDepthStencilValue depthStencil;
-} VkClearValue;
-
typedef struct {
VkOffset3D offset;
VkExtent3D extent;
VkExtent3D extent;
} VkImageResolve;
+typedef union {
+ VkClearColorValue color;
+ VkClearDepthStencilValue depthStencil;
+} VkClearValue;
+
typedef struct {
VkStructureType sType;
const void* pNext;
} VkDispatchIndirectCmd;
typedef struct {
- uint32_t firstIndex;
uint32_t indexCount;
+ uint32_t instanceCount;
+ uint32_t firstIndex;
int32_t vertexOffset;
uint32_t firstInstance;
- uint32_t instanceCount;
} VkDrawIndexedIndirectCmd;
typedef struct {
- uint32_t firstVertex;
uint32_t vertexCount;
- uint32_t firstInstance;
uint32_t instanceCount;
+ uint32_t firstVertex;
+ uint32_t firstInstance;
} VkDrawIndirectCmd;
typedef struct {
typedef void (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
typedef void (VKAPI *PFN_vkCmdBindIndexBuffer)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
typedef void (VKAPI *PFN_vkCmdBindVertexBuffers)(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
-typedef void (VKAPI *PFN_vkCmdDraw)(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount);
-typedef void (VKAPI *PFN_vkCmdDrawIndexed)(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount);
+typedef void (VKAPI *PFN_vkCmdDraw)(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
+typedef void (VKAPI *PFN_vkCmdDrawIndexed)(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance);
typedef void (VKAPI *PFN_vkCmdDrawIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
typedef void (VKAPI *PFN_vkCmdDrawIndexedIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
typedef void (VKAPI *PFN_vkCmdDispatch)(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z);
void VKAPI vkCmdDraw(
VkCmdBuffer cmdBuffer,
- uint32_t firstVertex,
uint32_t vertexCount,
- uint32_t firstInstance,
- uint32_t instanceCount);
+ uint32_t instanceCount,
+ uint32_t firstVertex,
+ uint32_t firstInstance);
void VKAPI vkCmdDrawIndexed(
VkCmdBuffer cmdBuffer,
- uint32_t firstIndex,
uint32_t indexCount,
+ uint32_t instanceCount,
+ uint32_t firstIndex,
int32_t vertexOffset,
- uint32_t firstInstance,
- uint32_t instanceCount);
+ uint32_t firstInstance);
void VKAPI vkCmdDrawIndirect(
VkCmdBuffer cmdBuffer,
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets);
}
-VK_LAYER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount)
+VK_LAYER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
{
VkBool32 skipCall = VK_FALSE;
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
}
}
if (VK_FALSE == skipCall)
- get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
+ get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
}
-VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount)
+VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance)
{
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
VkBool32 skipCall = VK_FALSE;
}
}
if (VK_FALSE == skipCall)
- get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
+ get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
}
VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride)
VK_LAYER_EXPORT void VKAPI vkCmdDraw(
VkCmdBuffer cmdBuffer,
- uint32_t firstVertex,
uint32_t vertexCount,
- uint32_t firstInstance,
- uint32_t instanceCount)
+ uint32_t instanceCount,
+ uint32_t firstVertex,
+ uint32_t firstInstance)
{
- get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
+ get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
}
VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed(
VkCmdBuffer cmdBuffer,
- uint32_t firstIndex,
uint32_t indexCount,
+ uint32_t instanceCount,
+ uint32_t firstIndex,
int32_t vertexOffset,
- uint32_t firstInstance,
- uint32_t instanceCount)
+ uint32_t firstInstance)
{
- get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
+ get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
}
disp->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets);
}
-LOADER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount)
+LOADER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
{
const VkLayerDispatchTable *disp;
disp = loader_get_dispatch(cmdBuffer);
- disp->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
+ disp->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
}
-LOADER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount)
+LOADER_EXPORT void VKAPI vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance)
{
const VkLayerDispatchTable *disp;
disp = loader_get_dispatch(cmdBuffer);
- disp->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
+ disp->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
}
LOADER_EXPORT void VKAPI vkCmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride)
Proto("void", "CmdDraw",
[Param("VkCmdBuffer", "cmdBuffer"),
- Param("uint32_t", "firstVertex"),
Param("uint32_t", "vertexCount"),
- Param("uint32_t", "firstInstance"),
- Param("uint32_t", "instanceCount")]),
+ Param("uint32_t", "instanceCount"),
+ Param("uint32_t", "firstVertex"),
+ Param("uint32_t", "firstInstance")]),
Proto("void", "CmdDrawIndexed",
[Param("VkCmdBuffer", "cmdBuffer"),
- Param("uint32_t", "firstIndex"),
Param("uint32_t", "indexCount"),
+ Param("uint32_t", "instanceCount"),
+ Param("uint32_t", "firstIndex"),
Param("int32_t", "vertexOffset"),
- Param("uint32_t", "firstInstance"),
- Param("uint32_t", "instanceCount")]),
+ Param("uint32_t", "firstInstance")]),
Proto("void", "CmdDrawIndirect",
[Param("VkCmdBuffer", "cmdBuffer"),