Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: src/gpu/vk/GrVkCaps.cpp

Issue 1782583002: Add support for vertex and geometry shader textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkCaps.h ('k') | src/gpu/vk/GrVkProgramBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkCaps.cpp
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index ca9cf359acd98ed85a59c77dad79afd821cc224f..9dbc40ce7fe5423f634ccc74bc1387cd6bc95ab5 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -39,11 +39,6 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
fShaderCaps.reset(new GrGLSLCaps(contextOptions));
- /**************************************************************************
- * GrVkCaps fields
- **************************************************************************/
- fMaxSampledTextures = 16; // Spec requires a minimum of 16 sampled textures per stage
-
this->init(contextOptions, vkInterface, physDev);
}
@@ -60,7 +55,7 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryProperties));
this->initGrCaps(properties, features, memoryProperties);
- this->initGLSLCaps(features);
+ this->initGLSLCaps(features, properties);
this->initConfigTexturableTable(vkInterface, physDev);
this->initConfigRenderableTable(vkInterface, physDev);
this->initStencilFormats(vkInterface, physDev);
@@ -114,9 +109,6 @@ void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
this->initSampleCount(properties);
- fMaxSampledTextures = SkTMin(properties.limits.maxPerStageDescriptorSampledImages,
- properties.limits.maxPerStageDescriptorSamplers);
-
// 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.
fGeometryBufferMapThreshold = 0;
@@ -127,7 +119,8 @@ void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
fOversizedStencilSupport = true;
}
-void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceFeatures& features) {
+void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceFeatures& features,
+ const VkPhysicalDeviceProperties& properties) {
GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get());
glslCaps->fVersionDeclString = "#version 310 es\n";
@@ -155,6 +148,13 @@ void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceFeatures& features) {
glslCaps->fDualSourceBlendingSupport = features.dualSrcBlend;
#endif
glslCaps->fIntegerSupport = true;
+
+ glslCaps->fMaxVertexSamplers =
+ glslCaps->fMaxGeometrySamplers =
+ glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescriptorSampledImages,
+ properties.limits.maxPerStageDescriptorSamplers);
+ glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSampledImages,
+ properties.limits.maxDescriptorSetSamplers);
}
static void format_supported_for_feature(const GrVkInterface* interface,
« no previous file with comments | « src/gpu/vk/GrVkCaps.h ('k') | src/gpu/vk/GrVkProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698