Don't flush pipeline state when querying sample locations in GL
This was a relic from back when we could use EXT_raster_multisample.
Since MSAA is now always baked into the framebuffer attachments, this
is no longer necessary.
Bug: skia:
Change-Id: I47c66fcdbd008e057dab5eae457bb70ec8e6bb9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp
index e663fd1..a80b088 100644
--- a/src/gpu/GrGpuCommandBuffer.cpp
+++ b/src/gpu/GrGpuCommandBuffer.cpp
@@ -15,6 +15,7 @@
#include "GrMesh.h"
#include "GrPrimitiveProcessor.h"
#include "GrRenderTarget.h"
+#include "GrRenderTargetPriv.h"
#include "SkRect.h"
void GrGpuRTCommandBuffer::clear(const GrFixedClip& clip, const SkPMColor4f& color) {
@@ -99,5 +100,17 @@
}
this->onDraw(primProc, pipeline, fixedDynamicState, dynamicStateArrays, meshes, meshCount,
bounds);
+#ifdef SK_DEBUG
+ GrProcessor::CustomFeatures processorFeatures = primProc.requestedFeatures();
+ for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) {
+ processorFeatures |= pipeline.getFragmentProcessor(i).requestedFeatures();
+ }
+ processorFeatures |= pipeline.getXferProcessor().requestedFeatures();
+ if (GrProcessor::CustomFeatures::kSampleLocations & processorFeatures) {
+ // Verify we always have the same sample pattern key, regardless of graphics state.
+ SkASSERT(this->gpu()->findOrAssignSamplePatternKey(fRenderTarget)
+ == fRenderTarget->renderTargetPriv().getSamplePatternKey());
+ }
+#endif
return true;
}