From 32ac83ebdc4ac967aae95a48a62c991d459dab73 Mon Sep 17 00:00:00 2001 From: Jim Van Verth Date: Mon, 28 Nov 2016 15:23:57 -0500 Subject: [PATCH] Add #define for Nsight compatibility NVIDIA's Nsight tool is not compatible with certain GL calls. This change places them behind a #define in GrGLGpu.cpp. BUG=skia: Change-Id: Id80ed291b6fe4fd777c5690b25d4fbb47de3c187 Reviewed-on: https://skia-review.googlesource.com/5281 Commit-Queue: Jim Van Verth Reviewed-by: Brian Salomon --- src/gpu/gl/GrGLGpu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index af44af4..58051f8 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -47,6 +47,8 @@ #define CHECK_ALLOC_ERROR(iface) GR_GL_NO_ERROR #endif +//#define USE_NSIGHT + /////////////////////////////////////////////////////////////////////////////// using gr_instanced::InstancedRendering; @@ -494,8 +496,8 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { fHWBufferState[kXferGpuToCpu_GrBufferType].invalidate(); fHWDrawFace = GrDrawFace::kInvalid; - if (kGL_GrGLStandard == this->glStandard()) { +#ifndef USE_NSIGHT // Desktop-only state that we never change if (!this->glCaps().isCoreProfile()) { GL_CALL(Disable(GR_GL_POINT_SMOOTH)); @@ -512,6 +514,7 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { GL_CALL(Disable(GR_GL_COLOR_TABLE)); } GL_CALL(Disable(GR_GL_POLYGON_OFFSET_FILL)); +#endif // Since ES doesn't support glPointSize at all we always use the VS to // set the point size GL_CALL(Enable(GR_GL_VERTEX_PROGRAM_POINT_SIZE)); @@ -1977,6 +1980,7 @@ void GrGLGpu::flushScissor(const GrScissorState& scissorState, void GrGLGpu::flushWindowRectangles(const GrWindowRectsState& windowState, const GrGLRenderTarget* rt) { +#ifndef USE_NSIGHT typedef GrWindowRectsState::Mode Mode; SkASSERT(!windowState.enabled() || rt->renderFBOID()); // Window rects can't be used on-screen. SkASSERT(windowState.numWindows() <= this->caps()->maxWindowRectangles()); @@ -2003,14 +2007,17 @@ void GrGLGpu::flushWindowRectangles(const GrWindowRectsState& windowState, GL_CALL(WindowRectangles(glmode, numWindows, glwindows->asInts())); fHWWindowRectsState.set(rt->origin(), rt->getViewport(), windowState); +#endif } void GrGLGpu::disableWindowRectangles() { +#ifndef USE_NSIGHT if (!this->caps()->maxWindowRectangles() || fHWWindowRectsState.knownDisabled()) { return; } GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr)); fHWWindowRectsState.setDisabled(); +#endif } void GrGLGpu::flushMinSampleShading(float minSampleShading) { -- 2.7.4