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

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: 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
Index: src/gpu/vk/GrVkCaps.cpp
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index d8ac8757e5c378315dd14b45f58a764634e47c2c..f0b593de546f83519f398ae2230acb3ea88d76df 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -39,25 +39,19 @@ 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);
}
void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* vkInterface,
VkPhysicalDevice physDev) {
+ VkPhysicalDeviceProperties properties;
+ GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &properties));
- this->initGLSLCaps(vkInterface, physDev);
+ this->initGLSLCaps(vkInterface, physDev, properties);
this->initConfigTexturableTable(vkInterface, physDev);
this->initConfigRenderableTable(vkInterface, physDev);
this->initStencilFormats(vkInterface, physDev);
- VkPhysicalDeviceProperties properties;
- GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &properties));
-
// We could actually querey and get a max size for each config, however maxImageDimension2D will
// give the minimum max size across all configs. So for simplicity we will use that for now.
fMaxRenderTargetSize = properties.limits.maxImageDimension2D;
@@ -65,9 +59,6 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
this->initSampleCount(properties);
- fMaxSampledTextures = SkTMin(properties.limits.maxPerStageDescriptorSampledImages,
- properties.limits.maxPerStageDescriptorSamplers);
-
this->applyOptionsOverrides(contextOptions);
// need to friend GrVkCaps in GrGLSLCaps.h
// GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get());
@@ -105,7 +96,8 @@ void GrVkCaps::initSampleCount(const VkPhysicalDeviceProperties& properties) {
fMaxStencilSampleCount = get_max_sample_count(stencilSamples);
}
-void GrVkCaps::initGLSLCaps(const GrVkInterface* interface, VkPhysicalDevice physDev) {
+void GrVkCaps::initGLSLCaps(const GrVkInterface* interface, VkPhysicalDevice physDev,
+ const VkPhysicalDeviceProperties& properties) {
GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get());
// TODO: actually figure out a correct version here
glslCaps->fVersionDeclString = "#version 140\n";
@@ -122,6 +114,14 @@ void GrVkCaps::initGLSLCaps(const GrVkInterface* interface, VkPhysicalDevice phy
}
glslCaps->fShaderDerivativeSupport = 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,

Powered by Google App Engine
This is Rietveld 408576698