Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 08e83ec197c59b03362d7a08a17d7005cdad2c1e..960285c4b55566e8ddc10e5973b0a5249ce70712 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -373,6 +373,7 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { |
if (resetBits & kMSAAEnable_GrGLBackendState) { |
fMSAAEnabled = kUnknown_TriState; |
+ GL_CALL(CoverageModulation(GR_GL_RGBA)); |
Chris Dalton
2015/06/10 19:52:39
We need to wrap this in a check for mixedSamplesSu
|
} |
fHWActiveTextureUnitIdx = -1; // invalid |
@@ -504,6 +505,11 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe |
idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); |
idDesc.fMSColorRenderbufferID = 0; |
idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; |
+ idDesc.fSampleConfig = ((wrapDesc.fFlags & kStencilMSAAOnly_GrBackendRenderTargetFlags) && |
+ this->caps()->shaderCaps()->mixedSamplesSupport()) ? |
+ GrRenderTarget::kStencil_SampleConfig : |
+ GrRenderTarget::kUnified_SampleConfig; |
Chris Dalton
2015/06/10 19:52:39
If we block the mixed samples due to it not being
Chris Dalton
2015/06/10 20:55:56
Looks like we're taking out kStencilMSAAOnly_GrBac
|
+ |
idDesc.fLifeCycle = GrGpuResource::kWrapped_LifeCycle; |
GrSurfaceDesc desc; |
@@ -851,6 +857,7 @@ static bool renderbuffer_storage_msaa(const GrGLContext& ctx, |
switch (ctx.caps()->msFBOType()) { |
case GrGLCaps::kDesktop_ARB_MSFBOType: |
case GrGLCaps::kDesktop_EXT_MSFBOType: |
+ case GrGLCaps::kMixedSamples_MSFBOType: |
case GrGLCaps::kES_3_0_MSFBOType: |
GL_ALLOC_CALL(ctx.interface(), |
RenderbufferStorageMultisample(GR_GL_RENDERBUFFER, |
@@ -888,6 +895,9 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, |
idDesc->fRTFBOID = 0; |
idDesc->fTexFBOID = 0; |
idDesc->fLifeCycle = lifeCycle; |
+ idDesc->fSampleConfig = GrGLCaps::kMixedSamples_MSFBOType == |
+ this->glCaps().msFBOType() ? GrRenderTarget::kStencil_SampleConfig : |
+ GrRenderTarget::kUnified_SampleConfig; |
GrGLenum status; |
@@ -1170,7 +1180,7 @@ bool GrGLGpu::createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int wid |
SkASSERT(width >= rt->width()); |
SkASSERT(height >= rt->height()); |
- int samples = rt->numSamples(); |
+ int samples = rt->numStencilSamples(); |
GrGLStencilAttachment::IDDesc sbDesc; |
int stencilFmtCnt = this->glCaps().stencilFormats().count(); |
@@ -2090,7 +2100,7 @@ void GrGLGpu::flushStencil(const GrStencilSettings& stencilSettings) { |
} |
void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA) { |
- SkASSERT(!useHWAA || rt->isMultisampled()); |
+ SkASSERT(!useHWAA || rt->isStencilBufferMultisampled()); |
if (this->glCaps().multisampleDisableSupport()) { |
if (useHWAA) { |