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)); |
egdaniel
2016/03/11 14:22:27
Are you rebased to Tot? I believe this should be i
|
- 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, |