Remove sample shading and dest color override

Both of these features are unused (though Chrome still installs a GL
function in the interface, so the function pointer needs to stick around
until that's removed).

Bug: skia:
Change-Id: Id061e83042b0dd5f583a850de182c29cd27fab1f
Reviewed-on: https://skia-review.googlesource.com/c/175423
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2018-12-06 15:54:53 -05:00 committed by Skia Commit-Bot
parent 7a3805c348
commit a63593a10c
16 changed files with 5 additions and 92 deletions

View File

@ -311,7 +311,7 @@ public:
GrGLFunction<GrGLCoverageModulationFn> fCoverageModulation;
/* ARB_sample_shading */
GrGLFunction<GrGLMinSampleShadingFn> fMinSampleShading;
GrGLFunction<GrGLMinSampleShadingFn> fMinSampleShading; // Unused
/* ARB_sync */
GrGLFunction<GrGLFenceSyncFn> fFenceSync;

View File

@ -34,7 +34,6 @@ GrCaps::GrCaps(const GrContextOptions& options) {
fPreferFullscreenClears = false;
fMustClearUploadedBufferData = false;
fSupportsAHardwareBufferImages = false;
fSampleShadingSupport = false;
fFenceSyncSupport = false;
fCrossContextTextureSupport = false;
fHalfFloatVertexAttributeSupport = false;
@ -179,7 +178,6 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
writer->appendBool("Prefer fullscreen clears", fPreferFullscreenClears);
writer->appendBool("Must clear buffer memory", fMustClearUploadedBufferData);
writer->appendBool("Supports importing AHardwareBuffers", fSupportsAHardwareBufferImages);
writer->appendBool("Sample shading support", fSampleShadingSupport);
writer->appendBool("Fence sync support", fFenceSyncSupport);
writer->appendBool("Cross context texture support", fCrossContextTextureSupport);
writer->appendBool("Half float vertex attribute support", fHalfFloatVertexAttributeSupport);

View File

@ -239,8 +239,6 @@ public:
bool wireframeMode() const { return fWireframeMode; }
bool sampleShadingSupport() const { return fSampleShadingSupport; }
bool fenceSyncSupport() const { return fFenceSyncSupport; }
bool crossContextTextureSupport() const { return fCrossContextTextureSupport; }
/**
@ -358,7 +356,6 @@ protected:
// ANGLE performance workaround
bool fPreferVRAMUseOverFlushes : 1;
bool fSampleShadingSupport : 1;
// TODO: this may need to be an enum to support different fence types
bool fFenceSyncSupport : 1;

View File

@ -21,23 +21,12 @@ class GrGeometryProcessor : public GrPrimitiveProcessor {
public:
GrGeometryProcessor(ClassID classID)
: INHERITED(classID)
, fWillUseGeoShader(false)
, fSampleShading(0.0) {}
, fWillUseGeoShader(false) {}
bool willUseGeoShader() const final { return fWillUseGeoShader; }
/**
* Returns the minimum fraction of samples for which the fragment shader will be run. For
* instance, if sampleShading is 0.5 in MSAA16 mode, the fragment shader will run a minimum of
* 8 times per pixel. The default value is zero.
*/
float getSampleShading() const final { return fSampleShading; }
protected:
void setWillUseGeoShader() { fWillUseGeoShader = true; }
void setSampleShading(float sampleShading) {
fSampleShading = sampleShading;
}
// GPs that need to use either half-float or ubyte colors can just call this to get a correctly
// configured Attribute struct
@ -49,7 +38,6 @@ protected:
private:
bool fWillUseGeoShader;
float fSampleShading;
typedef GrPrimitiveProcessor INHERITED;
};

View File

@ -210,13 +210,6 @@ public:
virtual bool isPathRendering() const { return false; }
/**
* If non-null, overrides the dest color returned by GrGLSLFragmentShaderBuilder::dstColor().
*/
virtual const char* getDestColorOverride() const { return nullptr; }
virtual float getSampleShading() const { return 0.0; }
protected:
void setVertexAttributes(const Attribute* attrs, int attrCount) {
fVertexAttributes.init(attrs, attrCount);

View File

@ -386,10 +386,6 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc g
GET_EGL_PROC_SUFFIX(DestroyImage, KHR);
}
if (glVer >= GR_GL_VER(4, 0) || extensions.has("GL_ARB_sample_shading")) {
GET_PROC(MinSampleShading);
}
if (glVer >= GR_GL_VER(3, 2) || extensions.has("GL_ARB_sync")) {
GET_PROC(FenceSync);
GET_PROC(IsSync);
@ -827,10 +823,6 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc
GET_EGL_PROC_SUFFIX(DestroyImage, KHR);
}
if (extensions.has("GL_OES_sample_shading")) {
GET_PROC_SUFFIX(MinSampleShading, OES);
}
if (version >= GR_GL_VER(3, 0)) {
GET_PROC(FenceSync);
GET_PROC(IsSync);

View File

@ -545,14 +545,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fDrawRangeElementsSupport = version >= GR_GL_VER(3,0);
}
if (kGL_GrGLStandard == standard) {
if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_shading"))) {
fSampleShadingSupport = true;
}
} else if (ctxInfo.hasExtension("GL_OES_sample_shading")) {
fSampleShadingSupport = true;
}
// TODO: support CHROMIUM_sync_point and maybe KHR_fence_sync
if (kGL_GrGLStandard == standard) {
if (version >= GR_GL_VER(3, 2) || ctxInfo.hasExtension("GL_ARB_sync")) {
@ -2506,10 +2498,6 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
fUseDrawInsteadOfAllRenderTargetWrites = true;
}
if (kGL_GrGLStandard == ctxInfo.standard() && kIntel_GrGLVendor == ctxInfo.vendor() ) {
fSampleShadingSupport = false;
}
#ifdef SK_BUILD_FOR_MAC
static constexpr bool isMAC = true;
#else

View File

@ -331,8 +331,7 @@ GrGLGpu::GrGLGpu(std::unique_ptr<GrGLContext> ctx, GrContext* context)
, fHWProgramID(0)
, fTempSrcFBOID(0)
, fTempDstFBOID(0)
, fStencilClearFBOID(0)
, fHWMinSampleShading(0.0) {
, fStencilClearFBOID(0) {
SkASSERT(fGLContext);
GrGLClearErr(this->glInterface());
fCaps = sk_ref_sp(fGLContext->caps());
@ -1790,19 +1789,6 @@ void GrGLGpu::disableWindowRectangles() {
#endif
}
void GrGLGpu::flushMinSampleShading(float minSampleShading) {
if (fHWMinSampleShading != minSampleShading) {
if (minSampleShading > 0.0) {
GL_CALL(Enable(GR_GL_SAMPLE_SHADING));
GL_CALL(MinSampleShading(minSampleShading));
}
else {
GL_CALL(Disable(GR_GL_SAMPLE_SHADING));
}
fHWMinSampleShading = minSampleShading;
}
}
void GrGLGpu::resolveAndGenerateMipMapsForProcessorTextures(
const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
@ -1871,7 +1857,6 @@ bool GrGLGpu::flushGLState(const GrPrimitiveProcessor& primProc,
pipeline.getXferProcessor().getBlendInfo(&blendInfo);
this->flushColorWrite(blendInfo.fWriteColor);
this->flushMinSampleShading(primProc.getSampleShading());
this->flushProgram(std::move(program));

View File

@ -375,8 +375,6 @@ private:
// rt is used only if useHWAA is true.
void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool stencilEnabled);
void flushMinSampleShading(float minSampleShading);
void flushFramebufferSRGB(bool enable);
// helper for onCreateTexture and writeTexturePixels
@ -629,7 +627,6 @@ private:
return (wide ? 0x2 : 0x0) | (tall ? 0x1 : 0x0);
}
float fHWMinSampleShading;
GrPrimitiveType fLastPrimitiveType;
class SamplerObjectCache;

View File

@ -581,17 +581,6 @@ bool GrGLInterface::validate() const {
}
}
if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,0)) ||
fExtensions.has("GL_ARB_sample_shading")) {
if (!fFunctions.fMinSampleShading) {
RETURN_FALSE_INTERFACE;
}
} else if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_OES_sample_shading")) {
if (!fFunctions.fMinSampleShading) {
RETURN_FALSE_INTERFACE;
}
}
if (kGL_GrGLStandard == fStandard) {
if (glVer >= GR_GL_VER(3, 2) || fExtensions.has("GL_ARB_sync")) {
if (!fFunctions.fFenceSync ||

View File

@ -120,7 +120,6 @@ GrGLTestInterface::GrGLTestInterface() {
fFunctions.fMapBufferRange = bind_to_member(this, &GrGLTestInterface::mapBufferRange);
fFunctions.fMapBufferSubData = bind_to_member(this, &GrGLTestInterface::mapBufferSubData);
fFunctions.fMapTexSubImage2D = bind_to_member(this, &GrGLTestInterface::mapTexSubImage2D);
fFunctions.fMinSampleShading = bind_to_member(this, &GrGLTestInterface::minSampleShading);
fFunctions.fPixelStorei = bind_to_member(this, &GrGLTestInterface::pixelStorei);
fFunctions.fPolygonMode = bind_to_member(this, &GrGLTestInterface::polygonMode);
fFunctions.fPopGroupMarker = bind_to_member(this, &GrGLTestInterface::popGroupMarker);

View File

@ -121,7 +121,6 @@ public:
virtual GrGLvoid* mapBufferRange(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length, GrGLbitfield access) { return nullptr; }
virtual GrGLvoid* mapBufferSubData(GrGLuint target, GrGLintptr offset, GrGLsizeiptr size, GrGLenum access) { return nullptr; }
virtual GrGLvoid* mapTexSubImage2D(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLenum access) { return nullptr; }
virtual GrGLvoid minSampleShading(GrGLfloat value) {}
virtual GrGLvoid pixelStorei(GrGLenum pname, GrGLint param) {}
virtual GrGLvoid polygonMode(GrGLenum face, GrGLenum mode) {}
virtual GrGLvoid popGroupMarker() {}

View File

@ -95,11 +95,6 @@ SkString GrGLSLFragmentShaderBuilder::ensureCoords2D(const GrShaderVar& coords)
const char* GrGLSLFragmentShaderBuilder::dstColor() {
SkDEBUGCODE(fHasReadDstColor = true;)
const char* override = fProgramBuilder->primitiveProcessor().getDestColorOverride();
if (override != nullptr) {
return override;
}
const GrShaderCaps* shaderCaps = fProgramBuilder->shaderCaps();
if (shaderCaps->fbFetchSupport()) {
this->addFeature(1 << kFramebufferFetch_GLSLPrivateFeature,

View File

@ -229,10 +229,6 @@ void GrMtlCaps::initGrCaps(const id<MTLDevice> device) {
fOversizedStencilSupport = true;
// Looks like there is a field called rasterSampleCount labeled as beta in the Metal docs. This
// may be what we eventually need here, but it has no description.
fSampleShadingSupport = false;
fSRGBSupport = true; // always available in Metal
fSRGBWriteControl = false;
fMipMapSupport = true; // always available in Metal

View File

@ -445,7 +445,6 @@ void GrVkCaps::initGrCaps(const GrVkInterface* vkInterface,
fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag;
fOversizedStencilSupport = true;
fSampleShadingSupport = features.features.sampleRateShading;
if (extensions.hasExtension(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, 2) &&
this->supportsPhysicalDeviceProperties2()) {

View File

@ -287,10 +287,8 @@ static void setup_multisample_state(const GrPrimitiveProcessor& primProc,
int numSamples = pipeline.proxy()->numColorSamples();
SkAssertResult(GrSampleCountToVkSampleCount(numSamples,
&multisampleInfo->rasterizationSamples));
float sampleShading = primProc.getSampleShading();
SkASSERT(sampleShading == 0.0f || caps->sampleShadingSupport());
multisampleInfo->sampleShadingEnable = sampleShading > 0.0f;
multisampleInfo->minSampleShading = sampleShading;
multisampleInfo->sampleShadingEnable = VK_FALSE;
multisampleInfo->minSampleShading = 0.0f;
multisampleInfo->pSampleMask = nullptr;
multisampleInfo->alphaToCoverageEnable = VK_FALSE;
multisampleInfo->alphaToOneEnable = VK_FALSE;