"{\n"
" gl_Position = position;\n"
"}\n");
-
- programCollection.glslSources.add("color_frag") << glu::FragmentSource(
- "#version 310 es\n"
- "void main (void)\n"
- "{\n"
- "}\n");
}
}
}
// Shader modules
- m_vertexShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_vert"), 0);
- m_fragmentShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_frag"), 0);
+ m_vertexShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_vert"), 0);
+ if (m_colorAttachmentEnable)
+ m_fragmentShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_frag"), 0);
// Create pipeline
{
m_depthBoundsMax, // float maxDepthBounds;
};
+ // Make sure rasterization is not disabled when the fragment shader is missing.
+ const vk::VkPipelineRasterizationStateCreateInfo rasterizationStateParams =
+ {
+ vk::VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, // VkStructureType sType;
+ nullptr, // const void* pNext;
+ 0u, // VkPipelineRasterizationStateCreateFlags flags;
+ VK_FALSE, // VkBool32 depthClampEnable;
+ VK_FALSE, // VkBool32 rasterizerDiscardEnable;
+ vk::VK_POLYGON_MODE_FILL, // VkPolygonMode polygonMode;
+ vk::VK_CULL_MODE_NONE, // VkCullModeFlags cullMode;
+ vk::VK_FRONT_FACE_COUNTER_CLOCKWISE, // VkFrontFace frontFace;
+ VK_FALSE, // VkBool32 depthBiasEnable;
+ 0.0f, // float depthBiasConstantFactor;
+ 0.0f, // float depthBiasClamp;
+ 0.0f, // float depthBiasSlopeFactor;
+ 1.0f, // float lineWidth;
+ };
+
for (int quadNdx = 0; quadNdx < DepthTest::QUAD_COUNT; quadNdx++)
{
depthStencilStateParams.depthCompareOp = depthCompareOps[quadNdx];
0u, // const deUint32 subpass
0u, // const deUint32 patchControlPoints
&vertexInputStateParams, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
- DE_NULL, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
+ &rasterizationStateParams, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
DE_NULL, // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
&depthStencilStateParams); // const VkPipelineDepthStencilStateCreateInfo* depthStencilStateCreateInfo
}
};
const VkStencilOpState stencilOpState = makeStencilOpState(
- VK_STENCIL_OP_REPLACE, // stencil fail
- VK_STENCIL_OP_REPLACE, // depth & stencil pass
- VK_STENCIL_OP_REPLACE, // depth only fail
+ useColor ? VK_STENCIL_OP_KEEP : VK_STENCIL_OP_REPLACE, // stencil fail
+ useColor ? VK_STENCIL_OP_KEEP : VK_STENCIL_OP_REPLACE, // depth & stencil pass
+ useColor ? VK_STENCIL_OP_KEEP : VK_STENCIL_OP_REPLACE, // depth only fail
useColor ? VK_COMPARE_OP_EQUAL : VK_COMPARE_OP_NEVER, // compare op
useColor ? 0xffu : 0u, // compare mask
useColor ? 0u : 0xffu, // write mask
"{\n"
" gl_Position = position;\n"
"}\n");
-
- sourceCollections.glslSources.add("color_frag") << glu::FragmentSource(
- "#version 310 es\n"
- "void main (void)\n"
- "{\n"
- "}\n");
}
}
m_pipelineLayout = createPipelineLayout(vk, vkDevice, &pipelineLayoutParams);
}
- m_vertexShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_vert"), 0);
- m_fragmentShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_frag"), 0);
+ m_vertexShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_vert"), 0);
+ if (m_colorAttachmentEnable)
+ m_fragmentShaderModule = createShaderModule(vk, vkDevice, m_context.getBinaryCollection().get("color_frag"), 0);
// Create pipeline
{
1.0f // float maxDepthBounds;
};
+ // Make sure rasterization is not disabled when the fragment shader is missing.
+ const vk::VkPipelineRasterizationStateCreateInfo rasterizationStateParams =
+ {
+ vk::VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, // VkStructureType sType;
+ nullptr, // const void* pNext;
+ 0u, // VkPipelineRasterizationStateCreateFlags flags;
+ VK_FALSE, // VkBool32 depthClampEnable;
+ VK_FALSE, // VkBool32 rasterizerDiscardEnable;
+ vk::VK_POLYGON_MODE_FILL, // VkPolygonMode polygonMode;
+ vk::VK_CULL_MODE_NONE, // VkCullModeFlags cullMode;
+ vk::VK_FRONT_FACE_COUNTER_CLOCKWISE, // VkFrontFace frontFace;
+ VK_FALSE, // VkBool32 depthBiasEnable;
+ 0.0f, // float depthBiasConstantFactor;
+ 0.0f, // float depthBiasClamp;
+ 0.0f, // float depthBiasSlopeFactor;
+ 1.0f, // float lineWidth;
+ };
+
// Setup different stencil masks and refs in each quad
for (int quadNdx = 0; quadNdx < StencilTest::QUAD_COUNT; quadNdx++)
{
0u, // const deUint32 subpass
0u, // const deUint32 patchControlPoints
&vertexInputStateParams, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
- DE_NULL, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
+ &rasterizationStateParams, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
DE_NULL, // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
&depthStencilStateParams); // const VkPipelineDepthStencilStateCreateInfo* depthStencilStateCreateInfo
}