Skip to content

Commit

Permalink
[graphite] Ref texture resources in a DispatchGroup
Browse files Browse the repository at this point in the history
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 <[email protected]>
Commit-Queue: Arman Uguray <[email protected]>
  • Loading branch information
armansito authored and SkCQ committed Apr 29, 2023
1 parent c7b3371 commit b0473c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gpu/graphite/compute/DispatchGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b0473c7

Please sign in to comment.