本文整理汇总了C++中GrVkRenderTarget::renderTargetPriv方法的典型用法代码示例。如果您正苦于以下问题:C++ GrVkRenderTarget::renderTargetPriv方法的具体用法?C++ GrVkRenderTarget::renderTargetPriv怎么用?C++ GrVkRenderTarget::renderTargetPriv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrVkRenderTarget
的用法示例。
在下文中一共展示了GrVkRenderTarget::renderTargetPriv方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copySurfaceAsDraw
//.........这里部分代码省略.........
0, nullptr));
VkDescriptorSet vkDescSets[] = { uniformDS->descriptorSet(), samplerDS->descriptorSet() };
GrVkRenderTarget* texRT = static_cast<GrVkRenderTarget*>(srcTex->asRenderTarget());
if (texRT) {
gpu->resolveRenderTargetNoFlush(texRT);
}
// TODO: Make tighter bounds and then adjust bounds for origin and granularity if we see
// any perf issues with using the whole bounds
SkIRect bounds = SkIRect::MakeWH(rt->width(), rt->height());
// Change layouts of rt and texture. We aren't blending so we don't need color attachment read
// access for blending.
GrVkImage* targetImage = rt->msaaImage() ? rt->msaaImage() : rt;
VkAccessFlags dstAccessFlags = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
if (!canDiscardOutsideDstRect) {
// We need to load the color attachment so need to be able to read it.
dstAccessFlags |= VK_ACCESS_COLOR_ATTACHMENT_READ_BIT;
}
targetImage->setImageLayout(gpu,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
dstAccessFlags,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
false);
srcTex->setImageLayout(gpu,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_ACCESS_SHADER_READ_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
false);
GrStencilAttachment* stencil = rt->renderTargetPriv().getStencilAttachment();
if (stencil) {
GrVkStencilAttachment* vkStencil = (GrVkStencilAttachment*)stencil;
// We aren't actually using the stencil but we still load and store it so we need
// appropriate barriers.
// TODO: Once we refactor surface and how we conntect stencil to RTs, we should not even
// have the stencil on this render pass if possible.
vkStencil->setImageLayout(gpu,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT,
false);
}
VkAttachmentLoadOp loadOp = canDiscardOutsideDstRect ? VK_ATTACHMENT_LOAD_OP_DONT_CARE
: VK_ATTACHMENT_LOAD_OP_LOAD;
GrVkRenderPass::LoadStoreOps vkColorOps(loadOp, VK_ATTACHMENT_STORE_OP_STORE);
GrVkRenderPass::LoadStoreOps vkStencilOps(VK_ATTACHMENT_LOAD_OP_LOAD,
VK_ATTACHMENT_STORE_OP_STORE);
const GrVkRenderPass* renderPass;
const GrVkResourceProvider::CompatibleRPHandle& rpHandle = rt->compatibleRenderPassHandle();
if (rpHandle.isValid()) {
renderPass = gpu->resourceProvider().findRenderPass(rpHandle,
vkColorOps,
vkStencilOps);
} else {
renderPass = gpu->resourceProvider().findRenderPass(*rt,
vkColorOps,
vkStencilOps);
}
SkASSERT(renderPass->isCompatible(*rt->simpleRenderPass()));