((major << 22) | (minor << 12) | patch)
// Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 170, 1)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 170, 2)
#if defined(__cplusplus) && (_MSC_VER >= 1800 || __cplusplus >= 201103L)
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO = 44,
VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 45,
+ VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 46,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
- VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
- VK_STRUCTURE_TYPE_NUM = (VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
+ VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
+ VK_STRUCTURE_TYPE_NUM = (VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
} VkStructureType;
VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF
} VkBlendOp;
+typedef enum {
+ VK_DYNAMIC_STATE_VIEWPORT = 0,
+ VK_DYNAMIC_STATE_SCISSOR = 1,
+ VK_DYNAMIC_STATE_LINE_WIDTH = 2,
+ VK_DYNAMIC_STATE_DEPTH_BIAS = 3,
+ VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4,
+ VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5,
+ VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6,
+ VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7,
+ VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8,
+ VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT,
+ VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE,
+ VK_DYNAMIC_STATE_NUM = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1),
+ VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF
+} VkDynamicState;
+
typedef enum {
VK_TEX_FILTER_NEAREST = 0,
VK_TEX_FILTER_LINEAR = 1,
VkStructureType sType;
const void* pNext;
uint32_t viewportCount;
+ const VkViewport* pViewports;
+ uint32_t scissorCount;
+ const VkRect2D* pScissors;
} VkPipelineViewportStateCreateInfo;
typedef struct {
VkCullMode cullMode;
VkFrontFace frontFace;
VkBool32 depthBiasEnable;
+ float depthBias;
+ float depthBiasClamp;
+ float slopeScaledDepthBias;
+ float lineWidth;
} VkPipelineRasterStateCreateInfo;
typedef struct {
VkStencilOp stencilPassOp;
VkStencilOp stencilDepthFailOp;
VkCompareOp stencilCompareOp;
+ uint32_t stencilCompareMask;
+ uint32_t stencilWriteMask;
+ uint32_t stencilReference;
} VkStencilOpState;
typedef struct {
VkBool32 stencilTestEnable;
VkStencilOpState front;
VkStencilOpState back;
+ float minDepthBounds;
+ float maxDepthBounds;
} VkPipelineDepthStencilStateCreateInfo;
typedef struct {
VkLogicOp logicOp;
uint32_t attachmentCount;
const VkPipelineColorBlendAttachmentState* pAttachments;
+ float blendConst[4];
} VkPipelineColorBlendStateCreateInfo;
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t dynamicStateCount;
+ const VkDynamicState* pDynamicStates;
+} VkPipelineDynamicStateCreateInfo;
+
typedef struct {
VkStructureType sType;
const void* pNext;
const VkPipelineMultisampleStateCreateInfo* pMultisampleState;
const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState;
const VkPipelineColorBlendStateCreateInfo* pColorBlendState;
+ const VkPipelineDynamicStateCreateInfo* pDynamicState;
VkPipelineCreateFlags flags;
VkPipelineLayout layout;
VkRenderPass renderPass;
if (pCB->state == CB_UPDATE_ACTIVE) {
pCB->drawCount[DRAW]++;
skipCall |= validate_draw_state(pCB, VK_FALSE);
- /* TODO: Check that scissor and viewport counts are the same */
+ /* TODOVV: Check that scissor and viewport counts are the same */
+ /* TODOVV: Do we need to check that viewportCount given in pipeline's
+ * VkPipelineViewportStateCreateInfo matches scissor & viewport counts
+ * given as dynamic state? Or is the count given in VkPipelineViewportStateCreateInfo
+ * simply indicate the number of viewport / scissor to use at this time?
+ */
// TODO : Need to pass cmdBuffer as srcObj here
skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
"vkCmdDraw() call #%lu, reporting DS state:", g_drawCount[DRAW]++);