diff options
author | 2015-11-03 09:33:21 -0800 | |
---|---|---|
committer | 2015-11-03 09:33:21 -0800 | |
commit | 98cad6219b430eddf5528473311279f21dbd2e10 (patch) | |
tree | f916fd04a62011942b8ac0e7dec371d90fd789c1 /src/gpu/gl/GrGLGpu.cpp | |
parent | 4036674952f341dab0695c3b054fefa5bb8cdec1 (diff) |
Fix setColocatedSampleLocations on ES and GL < 4.5
Updates setColocatedSampleLocations to use glFramebufferParameteri when
the DSA version glNamedFramebufferParameteri is not present.
BUG=skia:
Review URL: https://codereview.chromium.org/1415503008
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 815fd02b19..0a8f98a8b4 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2035,9 +2035,17 @@ void GrGLGpu::setColocatedSampleLocations(GrRenderTarget* rt, bool useColocatedS return; } - GL_CALL(NamedFramebufferParameteri(target->renderFBOID(), - GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS, - useColocatedSampleLocations)); + if (kGL_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(4,5)) { + GL_CALL(NamedFramebufferParameteri(target->renderFBOID(), + GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS, + useColocatedSampleLocations)); + } else { + GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, target->renderFBOID())); + GL_CALL(FramebufferParameteri(GR_GL_FRAMEBUFFER, + GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS, + useColocatedSampleLocations)); + fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; + } target->flagAsUsingColocatedSampleLocations(useColocatedSampleLocations); } |