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

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

Issue 1916563002: Add automatic generation of mipmaps to Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 8 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/GrVkImageView.cpp ('k') | src/gpu/vk/GrVkRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipelineState.cpp
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 0194e290ad351aeb980114885be973768836700e..4fe292917a17475284a855658c1b4116b6d06a30 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -8,6 +8,7 @@
#include "GrVkPipelineState.h"
#include "GrPipeline.h"
+#include "GrTexturePriv.h"
#include "GrVkCommandBuffer.h"
#include "GrVkDescriptorPool.h"
#include "GrVkGpu.h"
@@ -21,6 +22,7 @@
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLXferProcessor.h"
+#include "SkMipmap.h"
GrVkPipelineState::GrVkPipelineState(GrVkGpu* gpu,
const GrVkPipelineState::Desc& desc,
@@ -290,9 +292,17 @@ void GrVkPipelineState::writeSamplers(GrVkGpu* gpu,
for (int i = 0; i < textureBindings.count(); ++i) {
const GrTextureParams& params = textureBindings[i]->getParams();
- fSamplers.push(gpu->resourceProvider().findOrCreateCompatibleSampler(params));
GrVkTexture* texture = static_cast<GrVkTexture*>(textureBindings[i]->getTexture());
+ if (GrTextureParams::kMipMap_FilterMode == params.filterMode()) {
+ if (texture->texturePriv().mipMapsAreDirty()) {
+ gpu->generateMipmap(texture);
+ texture->texturePriv().dirtyMipMaps(false);
+ }
+ }
+
+ fSamplers.push(gpu->resourceProvider().findOrCreateCompatibleSampler(params,
+ texture->texturePriv().maxMipMapLevel()));
const GrVkImage::Resource* textureResource = texture->resource();
textureResource->ref();
« no previous file with comments | « src/gpu/vk/GrVkImageView.cpp ('k') | src/gpu/vk/GrVkRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698