| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrVkCaps_DEFINED | 8 #ifndef GrVkCaps_DEFINED |
| 9 #define GrVkCaps_DEFINED | 9 #define GrVkCaps_DEFINED |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 /** | 60 /** |
| 61 * Gets an array of legal stencil formats. These formats are not guaranteed
to be supported by | 61 * Gets an array of legal stencil formats. These formats are not guaranteed
to be supported by |
| 62 * the driver but are legal VK_TEXTURE_FORMATs. | 62 * the driver but are legal VK_TEXTURE_FORMATs. |
| 63 */ | 63 */ |
| 64 const SkTArray<StencilFormat, true>& linearStencilFormats() const { | 64 const SkTArray<StencilFormat, true>& linearStencilFormats() const { |
| 65 return fLinearStencilFormats; | 65 return fLinearStencilFormats; |
| 66 } | 66 } |
| 67 | 67 |
| 68 /** | |
| 69 * Returns the max number of sampled textures we can use in a program. This
number is the max of | |
| 70 * max samplers and max sampled images. This number is technically the max s
ampled textures we | |
| 71 * can have per stage, but we'll use it for the whole program since for now
we only do texture | |
| 72 * lookups in the fragment shader. | |
| 73 */ | |
| 74 int maxSampledTextures() const { | |
| 75 return fMaxSampledTextures; | |
| 76 } | |
| 77 | |
| 78 | |
| 79 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC
aps.get()); } | 68 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC
aps.get()); } |
| 80 | 69 |
| 81 private: | 70 private: |
| 82 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt
erface, | 71 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt
erface, |
| 83 VkPhysicalDevice device); | 72 VkPhysicalDevice device); |
| 84 void initSampleCount(const VkPhysicalDeviceProperties& properties); | 73 void initSampleCount(const VkPhysicalDeviceProperties& properties); |
| 85 void initGLSLCaps(const GrVkInterface* interface, VkPhysicalDevice physDev); | 74 void initGLSLCaps(const GrVkInterface* interface, VkPhysicalDevice physDev, |
| 75 const VkPhysicalDeviceProperties&); |
| 86 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); | 76 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); |
| 87 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); | 77 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); |
| 88 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy
sDev); | 78 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy
sDev); |
| 89 | 79 |
| 90 | 80 |
| 91 bool fConfigTextureSupport[kGrPixelConfigCnt]; | 81 bool fConfigTextureSupport[kGrPixelConfigCnt]; |
| 92 // For Vulkan we track whether a config is supported linearly (without need
for swizzling) | 82 // For Vulkan we track whether a config is supported linearly (without need
for swizzling) |
| 93 bool fConfigLinearTextureSupport[kGrPixelConfigCnt]; | 83 bool fConfigLinearTextureSupport[kGrPixelConfigCnt]; |
| 94 | 84 |
| 95 // The first entry for each config is without msaa and the second is with. | 85 // The first entry for each config is without msaa and the second is with. |
| 96 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 86 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
| 97 // The first entry for each config is without msaa and the second is with. | 87 // The first entry for each config is without msaa and the second is with. |
| 98 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2]; | 88 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2]; |
| 99 | 89 |
| 100 SkTArray<StencilFormat, true> fLinearStencilFormats; | 90 SkTArray<StencilFormat, true> fLinearStencilFormats; |
| 101 SkTArray<StencilFormat, true> fStencilFormats; | 91 SkTArray<StencilFormat, true> fStencilFormats; |
| 102 | 92 |
| 103 int fMaxSampledTextures; | |
| 104 | |
| 105 typedef GrCaps INHERITED; | 93 typedef GrCaps INHERITED; |
| 106 }; | 94 }; |
| 107 | 95 |
| 108 #endif | 96 #endif |
| OLD | NEW |