Revert "Round up DMSAA attachments to pow2 if supported."

This reverts commit c3e8a7eeb6.

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>
This commit is contained in:
Greg Daniel 2021-05-14 20:47:01 +00:00 committed by Skia Commit-Bot
parent 259553c942
commit fe788f9cd2
7 changed files with 13 additions and 18 deletions

View File

@ -23,7 +23,7 @@ GrCaps::GrCaps(const GrContextOptions& options) {
fReuseScratchTextures = true;
fReuseScratchBuffers = true;
fGpuTracingSupport = false;
fOversizedAttachmentSupport = false;
fOversizedStencilSupport = false;
fTextureBarrierSupport = false;
fSampleLocationsSupport = false;
fMultisampleDisableSupport = false;
@ -193,7 +193,7 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
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);

View File

@ -48,7 +48,7 @@ public:
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 @@ protected:
bool fReuseScratchTextures : 1;
bool fReuseScratchBuffers : 1;
bool fGpuTracingSupport : 1;
bool fOversizedAttachmentSupport : 1;
bool fOversizedStencilSupport : 1;
bool fTextureBarrierSupport : 1;
bool fSampleLocationsSupport : 1;
bool fMultisampleDisableSupport : 1;

View File

@ -516,7 +516,7 @@ bool GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt, bool useMSA
GrUniqueKey sbKey;
#if 0
if (this->caps()->oversizedAttachmentSupport()) {
if (this->caps()->oversizedStencilSupport()) {
width = SkNextPow2(width);
height = SkNextPow2(height);
}
@ -548,7 +548,6 @@ bool GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt, bool useMSA
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 @@ sk_sp<GrAttachment> GrResourceProvider::getDiscardableMSAAAttachment(SkISize dim
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 @@ sk_sp<GrAttachment> GrResourceProvider::getDiscardableMSAAAttachment(SkISize dim
if (msaaAttachment) {
return msaaAttachment;
}
msaaAttachment = this->makeMSAAAttachment(dimensions, format, sampleCnt, isProtected);
if (msaaAttachment) {
this->assignUniqueKeyToResource(key, msaaAttachment.get());

View File

@ -31,7 +31,7 @@ GrD3DCaps::GrD3DCaps(const GrContextOptions& contextOptions, IDXGIAdapter1* adap
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 @@ void GrD3DCaps::initGrCaps(const D3D12_FEATURE_DATA_D3D12_OPTIONS& optionsDesc,
fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag | kAsyncRead_MapFlag;
fOversizedAttachmentSupport = true;
fOversizedStencilSupport = true;
fTwoSidedStencilRefsAndMasksMustMatch = true;

View File

@ -589,18 +589,18 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
// 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)) {

View File

@ -320,7 +320,7 @@ void GrMtlCaps::initGrCaps(id<MTLDevice> device) {
// 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

View File

@ -44,6 +44,7 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
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 @@ void GrVkCaps::initGrCaps(const GrVkInterface* vkInterface,
fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag | kAsyncRead_MapFlag;
fOversizedAttachmentSupport = true;
fOversizedStencilSupport = true;
if (extensions.hasExtension(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, 2) &&
this->supportsPhysicalDeviceProperties2()) {