From b0473c72bc04bcea70458202acbaa4645cf2d104 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Mon, 24 Apr 2023 18:12:32 -0700 Subject: [PATCH] [graphite] Ref texture resources in a DispatchGroup Texture resources that are in use during a dispatch need to be tracked during command submission. Change-Id: I49a05e6e6d9570315b049d4e98159afef31ae90f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/681137 Reviewed-by: Jim Van Verth Commit-Queue: Arman Uguray --- src/gpu/graphite/compute/DispatchGroup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gpu/graphite/compute/DispatchGroup.cpp b/src/gpu/graphite/compute/DispatchGroup.cpp index 8f67636f39a7..6d444b6695d0 100644 --- a/src/gpu/graphite/compute/DispatchGroup.cpp +++ b/src/gpu/graphite/compute/DispatchGroup.cpp @@ -16,6 +16,7 @@ #include "src/gpu/graphite/PipelineData.h" #include "src/gpu/graphite/RecorderPriv.h" #include "src/gpu/graphite/ResourceProvider.h" +#include "src/gpu/graphite/Texture.h" #include "src/gpu/graphite/UniformManager.h" namespace skgpu::graphite { @@ -55,6 +56,9 @@ void DispatchGroup::addResourceRefs(CommandBuffer* commandBuffer) const { for (int i = 0; i < fPipelines.size(); ++i) { commandBuffer->trackResource(fPipelines[i]); } + for (int i = 0; i < fTextures.size(); ++i) { + commandBuffer->trackResource(fTextures[i]->refTexture()); + } } const Texture* DispatchGroup::getTexture(TextureIndex index) const {