Remove unsized gl stencil support.
We don't believe this is needed anymore and was mostly here to support old desktop GL Bug: skia:10727 Change-Id: Iab35ec7d6ed64d817aed57c38864932cc417c68e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321541 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
326f1d702b
commit
17b0c755b4
@ -1092,9 +1092,6 @@ void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
const GrGLuint kUnknownBitCount = GrGLStencilAttachment::kUnknownBitCount;
|
||||
} // namespace
|
||||
|
||||
void GrGLCaps::initStencilSupport(const GrGLContextInfo& ctxInfo) {
|
||||
|
||||
@ -1108,8 +1105,7 @@ void GrGLCaps::initStencilSupport(const GrGLContextInfo& ctxInfo) {
|
||||
// internal Format stencil bits total bits packed?
|
||||
gS8 = {GR_GL_STENCIL_INDEX8, 8, 8, false},
|
||||
gS16 = {GR_GL_STENCIL_INDEX16, 16, 16, false},
|
||||
gD24S8 = {GR_GL_DEPTH24_STENCIL8, 8, 32, true },
|
||||
gDS = {GR_GL_DEPTH_STENCIL, kUnknownBitCount, kUnknownBitCount, true };
|
||||
gD24S8 = {GR_GL_DEPTH24_STENCIL8, 8, 32, true };
|
||||
|
||||
if (GR_IS_GR_GL(ctxInfo.standard())) {
|
||||
bool supportsPackedDS =
|
||||
@ -1119,17 +1115,15 @@ void GrGLCaps::initStencilSupport(const GrGLContextInfo& ctxInfo) {
|
||||
|
||||
// S1 thru S16 formats are in GL 3.0+, EXT_FBO, and ARB_FBO since we
|
||||
// require FBO support we can expect these are legal formats and don't
|
||||
// check. These also all support the unsized GL_STENCIL_INDEX.
|
||||
// check.
|
||||
fStencilFormats.push_back() = gS8;
|
||||
fStencilFormats.push_back() = gS16;
|
||||
if (supportsPackedDS) {
|
||||
fStencilFormats.push_back() = gD24S8;
|
||||
fStencilFormats.push_back() = gDS;
|
||||
}
|
||||
} else if (GR_IS_GR_GL_ES(ctxInfo.standard())) {
|
||||
// ES2 has STENCIL_INDEX8 without extensions but requires extensions
|
||||
// for other formats.
|
||||
// ES doesn't support using the unsized format.
|
||||
|
||||
fStencilFormats.push_back() = gS8;
|
||||
if (ctxInfo.version() >= GR_GL_VER(3,0) ||
|
||||
|
@ -1533,32 +1533,6 @@ bool GrGLGpu::onUpdateCompressedBackendTexture(const GrBackendTexture& backendTe
|
||||
return result;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
const GrGLuint kUnknownBitCount = GrGLStencilAttachment::kUnknownBitCount;
|
||||
|
||||
void inline get_stencil_rb_sizes(const GrGLInterface* gl,
|
||||
GrGLStencilAttachment::Format* format) {
|
||||
|
||||
// we shouldn't ever know one size and not the other
|
||||
SkASSERT((kUnknownBitCount == format->fStencilBits) ==
|
||||
(kUnknownBitCount == format->fTotalBits));
|
||||
if (kUnknownBitCount == format->fStencilBits) {
|
||||
GR_GL_GetRenderbufferParameteriv(gl, GR_GL_RENDERBUFFER,
|
||||
GR_GL_RENDERBUFFER_STENCIL_SIZE,
|
||||
(GrGLint*)&format->fStencilBits);
|
||||
if (format->fPacked) {
|
||||
GR_GL_GetRenderbufferParameteriv(gl, GR_GL_RENDERBUFFER,
|
||||
GR_GL_RENDERBUFFER_DEPTH_SIZE,
|
||||
(GrGLint*)&format->fTotalBits);
|
||||
format->fTotalBits += format->fStencilBits;
|
||||
} else {
|
||||
format->fTotalBits = format->fStencilBits;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int GrGLGpu::getCompatibleStencilIndex(GrGLFormat format) {
|
||||
static const int kSize = 16;
|
||||
SkASSERT(this->glCaps().canFormatBeFBOColorAttachment(format));
|
||||
@ -1757,15 +1731,12 @@ GrStencilAttachment* GrGLGpu::createStencilAttachmentForRenderTarget(
|
||||
}
|
||||
}
|
||||
fStats.incStencilAttachmentCreates();
|
||||
// After sized formats we attempt an unsized format and take
|
||||
// whatever sizes GL gives us. In that case we query for the size.
|
||||
GrGLStencilAttachment::Format format = sFmt;
|
||||
get_stencil_rb_sizes(this->glInterface(), &format);
|
||||
|
||||
GrGLStencilAttachment* stencil = new GrGLStencilAttachment(this,
|
||||
sbDesc,
|
||||
dimensions,
|
||||
numStencilSamples,
|
||||
format);
|
||||
sFmt);
|
||||
return stencil;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
class GrGLStencilAttachment : public GrStencilAttachment {
|
||||
public:
|
||||
static const GrGLenum kUnknownInternalFormat = ~0U;
|
||||
static const GrGLuint kUnknownBitCount = ~0U;
|
||||
struct Format {
|
||||
GrGLenum fInternalFormat;
|
||||
GrGLuint fStencilBits;
|
||||
|
Loading…
Reference in New Issue
Block a user