Set up conservative rasterization pNext when setting up pipeline info

This commit is contained in:
baldurk
2018-04-25 17:50:39 +01:00
parent af94c429ea
commit 5695f3e76f
3 changed files with 18 additions and 1 deletions
+1
View File
@@ -213,6 +213,7 @@ private:
enum
{
VkCheckExt_AMD_neg_viewport,
VkCheckExt_EXT_conserv_rast,
VkCheckExt_Max,
};
+13 -1
View File
@@ -390,7 +390,8 @@ void VulkanShaderCache::MakeGraphicsPipelineInfo(VkGraphicsPipelineCreateInfo &p
RDCASSERT(ARRAY_COUNT(scissors) >= pipeInfo.scissors.size());
static VkPipelineRasterizationStateCreateInfo rs = {
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO};
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
};
rs.depthClampEnable = pipeInfo.depthClampEnable;
rs.rasterizerDiscardEnable = pipeInfo.rasterizerDiscardEnable,
@@ -403,6 +404,17 @@ void VulkanShaderCache::MakeGraphicsPipelineInfo(VkGraphicsPipelineCreateInfo &p
rs.depthBiasSlopeFactor = pipeInfo.depthBiasSlopeFactor;
rs.lineWidth = pipeInfo.lineWidth;
static VkPipelineRasterizationConservativeStateCreateInfoEXT conservRast = {
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT,
};
if(m_pDriver->m_ExtensionsEnabled[VkCheckExt_EXT_conserv_rast])
{
conservRast.conservativeRasterizationMode = pipeInfo.conservativeRasterizationMode;
conservRast.extraPrimitiveOverestimationSize = pipeInfo.extraPrimitiveOverestimationSize;
rs.pNext = &conservRast;
}
static VkPipelineMultisampleStateCreateInfo msaa = {
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO};
@@ -985,6 +985,10 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME) != Extensions.end())
m_ExtensionsEnabled[VkCheckExt_AMD_neg_viewport] = true;
if(std::find(Extensions.begin(), Extensions.end(),
VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME) != Extensions.end())
m_ExtensionsEnabled[VkCheckExt_EXT_conserv_rast] = true;
std::vector<string> Layers;
for(uint32_t i = 0; i < createInfo.enabledLayerCount; i++)
Layers.push_back(createInfo.ppEnabledLayerNames[i]);