aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkPipelineState.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-26 15:48:41 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-26 20:59:00 +0000
commit2890fbfe1400b81e4d6af98d14dfe757fec93650 (patch)
treebbc22dc56d4cdb0b1f6b06740c68738808506f67 /src/gpu/vk/GrVkPipelineState.cpp
parent480c90afc4382d03fa7cda534a702459ace72953 (diff)
Make GrPipeline hold a GrRenderTargetProxy (instead of a GrRenderTarget)
In a future world where GrSurface no longer has an origin it will be useful for the GrPipeline to be holding the GrRenderTargetProxy (which will still have an origin). Change-Id: I743a8cc07b6b92f8116227fb77b7c37da43cde8a Reviewed-on: https://skia-review.googlesource.com/26804 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkPipelineState.cpp')
-rw-r--r--src/gpu/vk/GrVkPipelineState.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index e4f6faf624..083d225ff8 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -236,7 +236,7 @@ void GrVkPipelineState::setData(GrVkGpu* gpu,
// freeing the tempData between calls.
this->freeTempResources(gpu);
- this->setRenderTargetState(pipeline.getRenderTarget());
+ this->setRenderTargetState(pipeline.proxy());
SkSTArray<8, const GrResourceIOProcessor::TextureSampler*> textureBindings;
SkSTArray<8, const GrResourceIOProcessor::BufferAccess*> bufferAccesses;
@@ -461,7 +461,9 @@ void GrVkPipelineState::writeTexelBuffers(
}
}
-void GrVkPipelineState::setRenderTargetState(const GrRenderTarget* rt) {
+void GrVkPipelineState::setRenderTargetState(const GrRenderTargetProxy* proxy) {
+ GrRenderTarget* rt = proxy->priv().peekRenderTarget();
+
// Load the RT height uniform if it is needed to y-flip gl_FragCoord.
if (fBuiltinUniformHandles.fRTHeightUni.isValid() &&
fRenderTargetState.fRenderTargetSize.fHeight != rt->height()) {
@@ -472,10 +474,10 @@ void GrVkPipelineState::setRenderTargetState(const GrRenderTarget* rt) {
SkISize size;
size.set(rt->width(), rt->height());
SkASSERT(fBuiltinUniformHandles.fRTAdjustmentUni.isValid());
- if (fRenderTargetState.fRenderTargetOrigin != rt->origin() ||
+ if (fRenderTargetState.fRenderTargetOrigin != proxy->origin() ||
fRenderTargetState.fRenderTargetSize != size) {
fRenderTargetState.fRenderTargetSize = size;
- fRenderTargetState.fRenderTargetOrigin = rt->origin();
+ fRenderTargetState.fRenderTargetOrigin = proxy->origin();
float rtAdjustmentVec[4];
fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec);
@@ -576,7 +578,7 @@ bool GrVkPipelineState::Desc::Build(Desc* desc,
}
GrProcessorKeyBuilder b(&desc->key());
- GrVkRenderTarget* vkRT = (GrVkRenderTarget*)pipeline.getRenderTarget();
+ GrVkRenderTarget* vkRT = (GrVkRenderTarget*)pipeline.renderTarget();
vkRT->simpleRenderPass()->genKey(&b);
stencil.genKey(&b);