Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1188)

Unified Diff: src/gpu/vk/GrVkProgram.cpp

Issue 1765523002: Add a cache of GrVkSamplers in GrVkResourceProvider. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkProgram.h ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkProgram.cpp
diff --git a/src/gpu/vk/GrVkProgram.cpp b/src/gpu/vk/GrVkProgram.cpp
index 0e1e201c2b5bd6405f61dddbe436f6e0f7df5bde..92adde86a991f0446de0b01ad6e8dd7a66f35b20 100644
--- a/src/gpu/vk/GrVkProgram.cpp
+++ b/src/gpu/vk/GrVkProgram.cpp
@@ -163,7 +163,7 @@ static void append_texture_bindings(const GrProcessor& processor,
}
}
-void GrVkProgram::setData(const GrVkGpu* gpu,
+void GrVkProgram::setData(GrVkGpu* gpu,
const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline) {
// This is here to protect against someone calling setData multiple times in a row without
@@ -255,12 +255,13 @@ void GrVkProgram::writeUniformBuffers(const GrVkGpu* gpu) {
}
}
-void GrVkProgram::writeSamplers(const GrVkGpu* gpu,
+void GrVkProgram::writeSamplers(GrVkGpu* gpu,
const SkTArray<const GrTextureAccess*>& textureBindings) {
SkASSERT(fNumSamplers == textureBindings.count());
for (int i = 0; i < textureBindings.count(); ++i) {
- fSamplers.push(GrVkSampler::Create(gpu, *textureBindings[i]));
+ const GrTextureParams& params = textureBindings[i]->getParams();
+ fSamplers.push(gpu->resourceProvider().findOrCreateCompatibleSampler(params));
GrVkTexture* texture = static_cast<GrVkTexture*>(textureBindings[i]->getTexture());
« no previous file with comments | « src/gpu/vk/GrVkProgram.h ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698