Remove some unused sample count caps
Change-Id: I4acb620b4b7b4c5bd83d7c7d65808ca8ebbd6804 Reviewed-on: https://skia-review.googlesource.com/101360 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
488fbd13a6
commit
7f1a074600
@ -241,8 +241,6 @@ protected:
|
|||||||
int fMaxVertexAttributes;
|
int fMaxVertexAttributes;
|
||||||
int fMaxTextureSize;
|
int fMaxTextureSize;
|
||||||
int fMaxTileSize;
|
int fMaxTileSize;
|
||||||
int fMaxColorSampleCount;
|
|
||||||
int fMaxStencilSampleCount;
|
|
||||||
int fMaxRasterSamples;
|
int fMaxRasterSamples;
|
||||||
int fMaxWindowRectangles;
|
int fMaxWindowRectangles;
|
||||||
int fMaxClipAnalyticFPs;
|
int fMaxClipAnalyticFPs;
|
||||||
|
@ -70,8 +70,6 @@ GrCaps::GrCaps(const GrContextOptions& options) {
|
|||||||
fMaxVertexAttributes = 0;
|
fMaxVertexAttributes = 0;
|
||||||
fMaxRenderTargetSize = 1;
|
fMaxRenderTargetSize = 1;
|
||||||
fMaxTextureSize = 1;
|
fMaxTextureSize = 1;
|
||||||
fMaxColorSampleCount = 0;
|
|
||||||
fMaxStencilSampleCount = 0;
|
|
||||||
fMaxRasterSamples = 0;
|
fMaxRasterSamples = 0;
|
||||||
fMaxWindowRectangles = 0;
|
fMaxWindowRectangles = 0;
|
||||||
|
|
||||||
@ -180,8 +178,6 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
|
|||||||
writer->appendS32("Max Vertex Attributes", fMaxVertexAttributes);
|
writer->appendS32("Max Vertex Attributes", fMaxVertexAttributes);
|
||||||
writer->appendS32("Max Texture Size", fMaxTextureSize);
|
writer->appendS32("Max Texture Size", fMaxTextureSize);
|
||||||
writer->appendS32("Max Render Target Size", fMaxRenderTargetSize);
|
writer->appendS32("Max Render Target Size", fMaxRenderTargetSize);
|
||||||
writer->appendS32("Max Color Sample Count", fMaxColorSampleCount);
|
|
||||||
writer->appendS32("Max Stencil Sample Count", fMaxStencilSampleCount);
|
|
||||||
writer->appendS32("Max Raster Samples", fMaxRasterSamples);
|
writer->appendS32("Max Raster Samples", fMaxRasterSamples);
|
||||||
writer->appendS32("Max Window Rectangles", fMaxWindowRectangles);
|
writer->appendS32("Max Window Rectangles", fMaxWindowRectangles);
|
||||||
writer->appendS32("Max Clip Analytic Fragment Processors", fMaxClipAnalyticFPs);
|
writer->appendS32("Max Clip Analytic Fragment Processors", fMaxClipAnalyticFPs);
|
||||||
|
@ -1012,19 +1012,10 @@ void GrGLCaps::initFSAASupport(const GrContextOptions& contextOptions, const GrG
|
|||||||
fMSFBOType = kNone_MSFBOType;
|
fMSFBOType = kNone_MSFBOType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) {
|
|
||||||
GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxStencilSampleCount);
|
|
||||||
} else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) {
|
|
||||||
GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxStencilSampleCount);
|
|
||||||
}
|
|
||||||
// We only have a use for raster multisample if there is coverage modulation from mixed samples.
|
// We only have a use for raster multisample if there is coverage modulation from mixed samples.
|
||||||
if (fUsesMixedSamples && ctxInfo.hasExtension("GL_EXT_raster_multisample")) {
|
if (fUsesMixedSamples && ctxInfo.hasExtension("GL_EXT_raster_multisample")) {
|
||||||
GR_GL_GetIntegerv(gli, GR_GL_MAX_RASTER_SAMPLES, &fMaxRasterSamples);
|
GR_GL_GetIntegerv(gli, GR_GL_MAX_RASTER_SAMPLES, &fMaxRasterSamples);
|
||||||
// This is to guard against platforms that may not support as many samples for
|
|
||||||
// glRasterSamples as they do for framebuffers.
|
|
||||||
fMaxStencilSampleCount = SkTMin(fMaxStencilSampleCount, fMaxRasterSamples);
|
|
||||||
}
|
}
|
||||||
fMaxColorSampleCount = fMaxStencilSampleCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) {
|
void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) {
|
||||||
@ -1989,10 +1980,19 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
|
|||||||
delete[] temp;
|
delete[] temp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
static const int kDefaultSamples[] = {0,1,2,4,8};
|
// Fake out the table using some semi-standard counts up to the max allowed sample
|
||||||
|
// count.
|
||||||
|
int maxSampleCnt = 0;
|
||||||
|
if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) {
|
||||||
|
GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &maxSampleCnt);
|
||||||
|
} else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) {
|
||||||
|
GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &maxSampleCnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr int kDefaultSamples[] = {0, 1, 2, 4, 8};
|
||||||
int count = SK_ARRAY_COUNT(kDefaultSamples);
|
int count = SK_ARRAY_COUNT(kDefaultSamples);
|
||||||
for (; count > 0; --count) {
|
for (; count > 0; --count) {
|
||||||
if (kDefaultSamples[count-1] <= fMaxColorSampleCount) {
|
if (kDefaultSamples[count - 1] <= maxSampleCnt) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,6 @@ private:
|
|||||||
|
|
||||||
void initGrCaps(const id<MTLDevice> device);
|
void initGrCaps(const id<MTLDevice> device);
|
||||||
void initShaderCaps();
|
void initShaderCaps();
|
||||||
void initSampleCount();
|
|
||||||
void initConfigTable();
|
void initConfigTable();
|
||||||
|
|
||||||
struct ConfigInfo {
|
struct ConfigInfo {
|
||||||
|
@ -162,9 +162,6 @@ void GrMtlCaps::initGrCaps(const id<MTLDevice> device) {
|
|||||||
|
|
||||||
fFenceSyncSupport = true; // always available in Metal
|
fFenceSyncSupport = true; // always available in Metal
|
||||||
fCrossContextTextureSupport = false;
|
fCrossContextTextureSupport = false;
|
||||||
|
|
||||||
fMaxColorSampleCount = 4; // minimum required by spec
|
|
||||||
fMaxStencilSampleCount = 4; // minimum required by spec
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int GrMtlCaps::getSampleCount(int requestedCount, GrPixelConfig config) const {
|
int GrMtlCaps::getSampleCount(int requestedCount, GrPixelConfig config) const {
|
||||||
|
@ -46,8 +46,6 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
|
|||||||
|
|
||||||
fMaxRenderTargetSize = 4096; // minimum required by spec
|
fMaxRenderTargetSize = 4096; // minimum required by spec
|
||||||
fMaxTextureSize = 4096; // minimum required by spec
|
fMaxTextureSize = 4096; // minimum required by spec
|
||||||
fMaxColorSampleCount = 4; // minimum required by spec
|
|
||||||
fMaxStencilSampleCount = 4; // minimum required by spec
|
|
||||||
|
|
||||||
fShaderCaps.reset(new GrShaderCaps(contextOptions));
|
fShaderCaps.reset(new GrShaderCaps(contextOptions));
|
||||||
|
|
||||||
@ -148,17 +146,6 @@ int get_max_sample_count(VkSampleCountFlags flags) {
|
|||||||
return 64;
|
return 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrVkCaps::initSampleCount(const VkPhysicalDeviceProperties& properties) {
|
|
||||||
VkSampleCountFlags colorSamples = properties.limits.framebufferColorSampleCounts;
|
|
||||||
VkSampleCountFlags stencilSamples = properties.limits.framebufferStencilSampleCounts;
|
|
||||||
|
|
||||||
fMaxColorSampleCount = get_max_sample_count(colorSamples);
|
|
||||||
if (kImagination_VkVendor == properties.vendorID) {
|
|
||||||
fMaxColorSampleCount = 0;
|
|
||||||
}
|
|
||||||
fMaxStencilSampleCount = get_max_sample_count(stencilSamples);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
|
void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
|
||||||
const VkPhysicalDeviceMemoryProperties& memoryProperties,
|
const VkPhysicalDeviceMemoryProperties& memoryProperties,
|
||||||
uint32_t featureFlags) {
|
uint32_t featureFlags) {
|
||||||
@ -178,8 +165,6 @@ void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
|
|||||||
fMaxRenderTargetSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);
|
fMaxRenderTargetSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);
|
||||||
fMaxTextureSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);
|
fMaxTextureSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);
|
||||||
|
|
||||||
this->initSampleCount(properties);
|
|
||||||
|
|
||||||
// Assuming since we will always map in the end to upload the data we might as well just map
|
// Assuming since we will always map in the end to upload the data we might as well just map
|
||||||
// from the get go. There is no hard data to suggest this is faster or slower.
|
// from the get go. There is no hard data to suggest this is faster or slower.
|
||||||
fBufferMapThreshold = 0;
|
fBufferMapThreshold = 0;
|
||||||
|
@ -130,8 +130,6 @@ private:
|
|||||||
const VkPhysicalDeviceMemoryProperties&,
|
const VkPhysicalDeviceMemoryProperties&,
|
||||||
uint32_t featureFlags);
|
uint32_t featureFlags);
|
||||||
void initShaderCaps(const VkPhysicalDeviceProperties&, uint32_t featureFlags);
|
void initShaderCaps(const VkPhysicalDeviceProperties&, uint32_t featureFlags);
|
||||||
void initSampleCount(const VkPhysicalDeviceProperties& properties);
|
|
||||||
|
|
||||||
|
|
||||||
void initConfigTable(const GrVkInterface*, VkPhysicalDevice, const VkPhysicalDeviceProperties&);
|
void initConfigTable(const GrVkInterface*, VkPhysicalDevice, const VkPhysicalDeviceProperties&);
|
||||||
void initStencilFormat(const GrVkInterface* iface, VkPhysicalDevice physDev);
|
void initStencilFormat(const GrVkInterface* iface, VkPhysicalDevice physDev);
|
||||||
|
Loading…
Reference in New Issue
Block a user