aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Salomon <bsalomon@google.com>2018-01-29 14:24:19 -0500
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2018-01-29 19:46:31 +0000
commit7f1a074600610aead91d8b5e85a5dd45370e11ea (patch)
tree866a7e547b1d65ab0e2d759ddf14a1d8b94b32b3 /src
parent488fbd13a6a241f2b74f6fa770ae3497af33dbce (diff)
downloadskqp-7f1a074600610aead91d8b5e85a5dd45370e11ea.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrCaps.cpp4
-rw-r--r--src/gpu/gl/GrGLCaps.cpp22
-rw-r--r--src/gpu/mtl/GrMtlCaps.h1
-rw-r--r--src/gpu/mtl/GrMtlCaps.mm3
-rw-r--r--src/gpu/vk/GrVkCaps.cpp15
-rw-r--r--src/gpu/vk/GrVkCaps.h2
6 files changed, 11 insertions, 36 deletions
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index 4a7dae65b6..427b20425a 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -70,8 +70,6 @@ GrCaps::GrCaps(const GrContextOptions& options) {
fMaxVertexAttributes = 0;
fMaxRenderTargetSize = 1;
fMaxTextureSize = 1;
- fMaxColorSampleCount = 0;
- fMaxStencilSampleCount = 0;
fMaxRasterSamples = 0;
fMaxWindowRectangles = 0;
@@ -180,8 +178,6 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
writer->appendS32("Max Vertex Attributes", fMaxVertexAttributes);
writer->appendS32("Max Texture Size", fMaxTextureSize);
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 Window Rectangles", fMaxWindowRectangles);
writer->appendS32("Max Clip Analytic Fragment Processors", fMaxClipAnalyticFPs);
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 77fa9573a4..44e00be747 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1012,19 +1012,10 @@ void GrGLCaps::initFSAASupport(const GrContextOptions& contextOptions, const GrG
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.
if (fUsesMixedSamples && ctxInfo.hasExtension("GL_EXT_raster_multisample")) {
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) {
@@ -1989,10 +1980,19 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
delete[] temp;
}
} 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);
for (; count > 0; --count) {
- if (kDefaultSamples[count-1] <= fMaxColorSampleCount) {
+ if (kDefaultSamples[count - 1] <= maxSampleCnt) {
break;
}
}
diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h
index 70ff74fe59..6204eaac5a 100644
--- a/src/gpu/mtl/GrMtlCaps.h
+++ b/src/gpu/mtl/GrMtlCaps.h
@@ -70,7 +70,6 @@ private:
void initGrCaps(const id<MTLDevice> device);
void initShaderCaps();
- void initSampleCount();
void initConfigTable();
struct ConfigInfo {
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 2354b85e64..2bce74a261 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -162,9 +162,6 @@ void GrMtlCaps::initGrCaps(const id<MTLDevice> device) {
fFenceSyncSupport = true; // always available in Metal
fCrossContextTextureSupport = false;
-
- fMaxColorSampleCount = 4; // minimum required by spec
- fMaxStencilSampleCount = 4; // minimum required by spec
}
int GrMtlCaps::getSampleCount(int requestedCount, GrPixelConfig config) const {
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 40cb38f0e6..4d9daaef7f 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -46,8 +46,6 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
fMaxRenderTargetSize = 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));
@@ -148,17 +146,6 @@ int get_max_sample_count(VkSampleCountFlags flags) {
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,
const VkPhysicalDeviceMemoryProperties& memoryProperties,
uint32_t featureFlags) {
@@ -178,8 +165,6 @@ void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
fMaxRenderTargetSize = 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
// from the get go. There is no hard data to suggest this is faster or slower.
fBufferMapThreshold = 0;
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index ad0faf1596..d63c2ba9b5 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -130,8 +130,6 @@ private:
const VkPhysicalDeviceMemoryProperties&,
uint32_t featureFlags);
void initShaderCaps(const VkPhysicalDeviceProperties&, uint32_t featureFlags);
- void initSampleCount(const VkPhysicalDeviceProperties& properties);
-
void initConfigTable(const GrVkInterface*, VkPhysicalDevice, const VkPhysicalDeviceProperties&);
void initStencilFormat(const GrVkInterface* iface, VkPhysicalDevice physDev);