Revert "Round up DMSAA attachments to pow2 if supported."
This reverts commit c3e8a7eeb69a8e294cbf782a17d2b906429de819.
Reason for revert: breaks dmsaa clip_shader_persp and complexclip4_aa
Original change's description:
> Round up DMSAA attachments to pow2 if supported.
>
> Change-Id: I03f5ea649209b9894753c981872edbd7d718288c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408643
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com
Change-Id: I3ff0931d7d00b064b5721a2593d2e9865e8edebc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408896
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index 51154a4..e1e911d 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -23,7 +23,7 @@
fReuseScratchTextures = true;
fReuseScratchBuffers = true;
fGpuTracingSupport = false;
- fOversizedAttachmentSupport = false;
+ fOversizedStencilSupport = false;
fTextureBarrierSupport = false;
fSampleLocationsSupport = false;
fMultisampleDisableSupport = false;
@@ -193,7 +193,7 @@
writer->appendBool("Reuse Scratch Textures", fReuseScratchTextures);
writer->appendBool("Reuse Scratch Buffers", fReuseScratchBuffers);
writer->appendBool("Gpu Tracing Support", fGpuTracingSupport);
- writer->appendBool("Oversized Attachment Support", fOversizedAttachmentSupport);
+ writer->appendBool("Oversized Stencil Support", fOversizedStencilSupport);
writer->appendBool("Texture Barrier Support", fTextureBarrierSupport);
writer->appendBool("Sample Locations Support", fSampleLocationsSupport);
writer->appendBool("Multisample disable support", fMultisampleDisableSupport);
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index 9d0dbaa..33bbdf2 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -48,7 +48,7 @@
bool mipmapSupport() const { return fMipmapSupport; }
bool gpuTracingSupport() const { return fGpuTracingSupport; }
- bool oversizedAttachmentSupport() const { return fOversizedAttachmentSupport; }
+ bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
bool textureBarrierSupport() const { return fTextureBarrierSupport; }
bool sampleLocationsSupport() const { return fSampleLocationsSupport; }
bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
@@ -504,7 +504,7 @@
bool fReuseScratchTextures : 1;
bool fReuseScratchBuffers : 1;
bool fGpuTracingSupport : 1;
- bool fOversizedAttachmentSupport : 1;
+ bool fOversizedStencilSupport : 1;
bool fTextureBarrierSupport : 1;
bool fSampleLocationsSupport : 1;
bool fMultisampleDisableSupport : 1;
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index b4d486f..38738a5 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -516,7 +516,7 @@
GrUniqueKey sbKey;
#if 0
- if (this->caps()->oversizedAttachmentSupport()) {
+ if (this->caps()->oversizedStencilSupport()) {
width = SkNextPow2(width);
height = SkNextPow2(height);
}
@@ -548,7 +548,6 @@
stencil->numSamples() == num_stencil_samples(rt, useMSAASurface, *this->caps()));
return stencil != nullptr;
}
-
sk_sp<GrAttachment> GrResourceProvider::getDiscardableMSAAAttachment(SkISize dimensions,
const GrBackendFormat& format,
int sampleCnt,
@@ -561,10 +560,6 @@
return nullptr;
}
- if (this->caps()->oversizedAttachmentSupport()) {
- dimensions = MakeApprox(dimensions);
- }
-
if (!fCaps->validateSurfaceParams(
dimensions, format, GrRenderable::kYes, sampleCnt, GrMipmapped::kNo)) {
return nullptr;
@@ -583,7 +578,6 @@
if (msaaAttachment) {
return msaaAttachment;
}
-
msaaAttachment = this->makeMSAAAttachment(dimensions, format, sampleCnt, isProtected);
if (msaaAttachment) {
this->assignUniqueKeyToResource(key, msaaAttachment.get());
diff --git a/src/gpu/d3d/GrD3DCaps.cpp b/src/gpu/d3d/GrD3DCaps.cpp
index a7cf162..9bd72bf 100644
--- a/src/gpu/d3d/GrD3DCaps.cpp
+++ b/src/gpu/d3d/GrD3DCaps.cpp
@@ -31,7 +31,7 @@
fNPOTTextureTileSupport = true; // available in feature level 10_0 and up
fReuseScratchTextures = true; //TODO: figure this out
fGpuTracingSupport = false; //TODO: figure this out
- fOversizedAttachmentSupport = false; //TODO: figure this out
+ fOversizedStencilSupport = false; //TODO: figure this out
fDrawInstancedSupport = true;
fNativeDrawIndirectSupport = true;
@@ -213,7 +213,7 @@
fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag | kAsyncRead_MapFlag;
- fOversizedAttachmentSupport = true;
+ fOversizedStencilSupport = true;
fTwoSidedStencilRefsAndMasksMustMatch = true;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index aa3dc7a..e2f43a4 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -589,18 +589,18 @@
// ARB allows mixed size FBO attachments, EXT does not.
if (version >= GR_GL_VER(3, 0) ||
ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
- fOversizedAttachmentSupport = true;
+ fOversizedStencilSupport = true;
} else {
SkASSERT(ctxInfo.hasExtension("GL_EXT_framebuffer_object"));
}
} else if (GR_IS_GR_GL_ES(standard)) {
// ES 3.0 supports mixed size FBO attachments, 2.0 does not.
- fOversizedAttachmentSupport = version >= GR_GL_VER(3, 0);
+ fOversizedStencilSupport = version >= GR_GL_VER(3, 0);
} else if (GR_IS_GR_WEBGL(standard)) {
// WebGL 1.0 has some constraints for FBO attachments:
// https://www.khronos.org/registry/webgl/specs/1.0/index.html#6.6
// These constraints "no longer apply in WebGL 2"
- fOversizedAttachmentSupport = version >= GR_GL_VER(2, 0);
+ fOversizedStencilSupport = version >= GR_GL_VER(2, 0);
}
if (GR_IS_GR_GL(standard)) {
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 617a929..486f046 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -320,7 +320,7 @@
// Buffers are always fully mapped.
fMapBufferFlags = kCanMap_MapFlag | kAsyncRead_MapFlag;
- fOversizedAttachmentSupport = true;
+ fOversizedStencilSupport = true;
fMipmapSupport = true; // always available in Metal
fNPOTTextureTileSupport = true; // always available in Metal
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index a1a9e94..223b361 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -44,6 +44,7 @@
fNPOTTextureTileSupport = true; // always available in Vulkan
fReuseScratchTextures = true; //TODO: figure this out
fGpuTracingSupport = false; //TODO: figure this out
+ fOversizedStencilSupport = false; //TODO: figure this out
fDrawInstancedSupport = true;
fSemaphoreSupport = true; // always available in Vulkan
@@ -643,7 +644,7 @@
fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag | kAsyncRead_MapFlag;
- fOversizedAttachmentSupport = true;
+ fOversizedStencilSupport = true;
if (extensions.hasExtension(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, 2) &&
this->supportsPhysicalDeviceProperties2()) {