Move<VkPipelineLayout> buildPipelineLayout (const VkDescriptorSetLayout* setLayouts = DE_NULL) const;
Move<VkPipeline> buildGraphicsPipeline (deUint32 subpass,
VkRenderPass renderPass,
+ VkFormat cbFormat,
VkPipelineLayout layout,
VkShaderModule vertShader,
VkShaderModule fragShader,
const VkRenderPass renderPass,
const VkFramebuffer framebuffer,
const VkRect2D& renderArea,
- const std::vector<FBAttachmentInfo>& attachmentInfo) const;
+ const std::vector<FBAttachmentInfo>& attachmentInfo,
+ const deUint32 srTileWidth = 0,
+ const deUint32 srTileHeight = 0) const;
void finishRendering (const VkCommandBuffer commandBuffer) const;
bool verifyUsingAtomicChecks (deUint32 tileWidth,
return createPipelineLayout(m_context.getDeviceInterface(), device, &pipelineLayoutCreateInfo, NULL);
}
-Move<VkPipeline> AttachmentRateInstance::buildGraphicsPipeline(deUint32 subpass, VkRenderPass renderPass, VkPipelineLayout pipelineLayout,
+Move<VkPipeline> AttachmentRateInstance::buildGraphicsPipeline(deUint32 subpass, VkRenderPass renderPass, VkFormat cbFormat, VkPipelineLayout pipelineLayout,
VkShaderModule vertShader, VkShaderModule fragShader, bool useShadingRate) const
{
std::vector<VkPipelineShaderStageCreateInfo> pipelineShaderStageParams(2,
pNext,
0u,
1u,
- &m_cbFormat,
+ &cbFormat,
VK_FORMAT_UNDEFINED,
VK_FORMAT_UNDEFINED
};
if (m_params->useDynamicRendering)
pNext = &renderingCreateInfo;
- const VkGraphicsPipelineCreateInfo pipelineCreateInfo
+ VkGraphicsPipelineCreateInfo pipelineCreateInfo
{
VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, // VkStructureType sType
pNext, // const void* pNext
0 // deInt32 basePipelineIndex;
};
+ if (useShadingRate && m_params->useDynamicRendering)
+ pipelineCreateInfo.flags |= VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR;
+
VkDevice device = m_device.get() ? *m_device : m_context.getDevice();
return createGraphicsPipeline(m_context.getDeviceInterface(), device, DE_NULL, &pipelineCreateInfo);
}
const VkRenderPass renderPass,
const VkFramebuffer framebuffer,
const VkRect2D& renderArea,
- const std::vector<FBAttachmentInfo>& attachmentInfo) const
+ const std::vector<FBAttachmentInfo>& attachmentInfo,
+ const deUint32 srTileWidth,
+ const deUint32 srTileHeight) const
{
const DeviceInterface& vk (m_context.getDeviceInterface());
std::vector<VkClearValue> clearColor (attachmentInfo.size(), makeClearValueColorU32(0, 0, 0, 0));
(attachmentInfo[1].usage & VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR))
{
shadingRateAttachmentInfo.imageView = attachmentInfo[1].view;
- shadingRateAttachmentInfo.shadingRateAttachmentTexelSize = { attachmentInfo[1].width, attachmentInfo[1].height };
+ shadingRateAttachmentInfo.shadingRateAttachmentTexelSize = { srTileWidth, srTileHeight };
renderingInfo.pNext = &shadingRateAttachmentInfo;
}
Move<VkPipelineLayout> graphicsPipelineLayout = buildPipelineLayout(&(*m_counterBufferDescriptorSetLayout));
Move<VkPipeline> computePipeline = buildComputePipeline(*compShader, *computePipelineLayout);
Move<VkRenderPass> renderPass = buildRenderPass(m_cbFormat, tileWidth, tileHeight);
- Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, *graphicsPipelineLayout, *vertShader, *fragShader);
+ Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, m_cbFormat, *graphicsPipelineLayout, *vertShader, *fragShader);
std::vector<FBAttachmentInfo> attachmentInfo
{
m_defaultImageSubresourceRange);
vk.cmdPipelineBarrier(*cmdBuffer, srcStageMask, dstStageMask, 0, 0, DE_NULL, 0, DE_NULL, 1, &cbImageBarrier);
- startRendering(*cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo);
+ startRendering(*cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo, tileWidth, tileHeight);
// draw single triangle to cb
vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelineLayout, 0, 1, &(*m_counterBufferDescriptorSet), 0, DE_NULL);
Move<VkPipelineLayout> ratePipelineLayout = buildPipelineLayout(&(*m_counterBufferDescriptorSetLayout));
Move<VkRenderPass> setupRenderPass = buildRenderPass(m_params->srFormat);
Move<VkRenderPass> rateRenderPass = buildRenderPass(m_cbFormat, tileWidth, tileHeight);
- Move<VkPipeline> setupPipeline = buildGraphicsPipeline(0, *setupRenderPass, *setupPipelineLayout, *vertSetupShader, *fragSetupShader, DE_FALSE);
- Move<VkPipeline> ratePipeline = buildGraphicsPipeline(0, *rateRenderPass, *ratePipelineLayout, *vertShader, *fragShader);
+ Move<VkPipeline> setupPipeline = buildGraphicsPipeline(0, *setupRenderPass, m_params->srFormat, *setupPipelineLayout, *vertSetupShader, *fragSetupShader, DE_FALSE);
+ Move<VkPipeline> ratePipeline = buildGraphicsPipeline(0, *rateRenderPass, m_cbFormat, *ratePipelineLayout, *vertShader, *fragShader);
std::vector<FBAttachmentInfo> setupAttachmentInfo
{
m_defaultImageSubresourceRange);
vk.cmdPipelineBarrier(*cmdBuffer, srcStageMask, dstStageMask, 0, 0, DE_NULL, 0, DE_NULL, 1, &cbImageBarrier);
- startRendering(*cmdBuffer, *rateRenderPass, *rateFramebuffer, makeRect2D(m_cbWidth, m_cbHeight), rateAttachmentInfo);
+ startRendering(*cmdBuffer, *rateRenderPass, *rateFramebuffer, makeRect2D(m_cbWidth, m_cbHeight), rateAttachmentInfo, tileWidth, tileHeight);
// draw single triangle to cb
vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *ratePipelineLayout, 0, 1, &(*m_counterBufferDescriptorSet), 0, DE_NULL);
Move<VkPipelineLayout> graphicsPipelineLayout = buildPipelineLayout(&(*m_counterBufferDescriptorSetLayout));
Move<VkRenderPass> renderPass = buildRenderPass(m_cbFormat, tileWidth, tileHeight);
- Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, *graphicsPipelineLayout, *vertShader, *fragShader);
+ Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, m_cbFormat, *graphicsPipelineLayout, *vertShader, *fragShader);
std::vector<FBAttachmentInfo> attachmentInfo
{
m_defaultImageSubresourceRange);
vk.cmdPipelineBarrier(*cmdBuffer, srcStageMask, dstStageMask, 0, 0, DE_NULL, 0, DE_NULL, 1, &cbImageBarrier);
- startRendering(*cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo);
+ startRendering(*cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo, tileWidth, tileHeight);
// draw single triangle to cb
vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelineLayout, 0, 1, &(*m_counterBufferDescriptorSet), 0, DE_NULL);
Move<VkPipelineLayout> graphicsPipelineLayout = buildPipelineLayout(&(*m_counterBufferDescriptorSetLayout));
Move<VkRenderPass> renderPass = buildRenderPass(m_cbFormat, tileWidth, tileHeight);
- Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, *graphicsPipelineLayout, *vertShader, *fragShader);
+ Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, m_cbFormat, *graphicsPipelineLayout, *vertShader, *fragShader);
std::vector<FBAttachmentInfo> attachmentInfo
{
m_defaultImageSubresourceRange);
vk.cmdPipelineBarrier(*graphicsCmdBuffer, srcStageMask, dstStageMask, 0, 0, DE_NULL, 0, DE_NULL, 1, &cbImageBarrier);
- startRendering(*graphicsCmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo);
+ startRendering(*graphicsCmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo, tileWidth, tileHeight);
// draw single triangle to cb
vk.cmdBindDescriptorSets(*graphicsCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelineLayout, 0, 1, &(*m_counterBufferDescriptorSet), 0, DE_NULL);
Move<VkPipelineLayout> graphicsPipelineLayout = buildPipelineLayout(&(*m_counterBufferDescriptorSetLayout));
Move<VkRenderPass> renderPass = buildRenderPass(m_cbFormat, tileWidth, tileHeight);
- Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, *graphicsPipelineLayout, *vertShader, *fragShader);
+ Move<VkPipeline> graphicsPipeline = buildGraphicsPipeline(0, *renderPass, m_cbFormat, *graphicsPipelineLayout, *vertShader, *fragShader);
std::vector<FBAttachmentInfo> attachmentInfo
{
m_defaultImageSubresourceRange);
vk.cmdPipelineBarrier(*cmdBuffer, srcStageMask, dstStageMask, 0, 0, DE_NULL, 0, DE_NULL, 1, &cbImageBarrier);
- startRendering(*cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo);
+ startRendering(*cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), attachmentInfo, tileWidth, tileHeight);
// draw single triangle to cb
vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelineLayout, 0, 1, &(*m_counterBufferDescriptorSet), 0, DE_NULL);
Move<VkRenderPass> renderPass = buildRenderPass(m_cbFormat, m_minTileSize.width, m_minTileSize.height, m_maxTileSize.width, m_maxTileSize.height);
Move<VkPipelineLayout> pipelineLayout = buildPipelineLayout(&(*m_counterBufferDescriptorSetLayout));
- Move<VkPipeline> graphicsPipeline0 = buildGraphicsPipeline(0, *renderPass, *pipelineLayout, *vertShader0, *fragShader);
- Move<VkPipeline> graphicsPipeline1 = buildGraphicsPipeline(1, *renderPass, *pipelineLayout, *vertShader1, *fragShader);
+ Move<VkPipeline> graphicsPipeline0 = buildGraphicsPipeline(0, *renderPass, m_cbFormat, *pipelineLayout, *vertShader0, *fragShader);
+ Move<VkPipeline> graphicsPipeline1 = buildGraphicsPipeline(1, *renderPass, m_cbFormat, *pipelineLayout, *vertShader1, *fragShader);
std::vector<FBAttachmentInfo> attachmentInfo
{