| 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 initGrCaps(const VkPhysicalDeviceProperties&, | 73 void initGrCaps(const VkPhysicalDeviceProperties&, |
| 85 const VkPhysicalDeviceFeatures&, | 74 const VkPhysicalDeviceFeatures&, |
| 86 const VkPhysicalDeviceMemoryProperties&); | 75 const VkPhysicalDeviceMemoryProperties&); |
| 87 void initGLSLCaps(const VkPhysicalDeviceFeatures& features); | 76 void initGLSLCaps(const VkPhysicalDeviceFeatures&, const VkPhysicalDevicePro
perties&); |
| 88 void initSampleCount(const VkPhysicalDeviceProperties& properties); | 77 void initSampleCount(const VkPhysicalDeviceProperties& properties); |
| 89 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); | 78 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); |
| 90 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); | 79 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev
ice physDev); |
| 91 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy
sDev); | 80 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy
sDev); |
| 92 | 81 |
| 93 | 82 |
| 94 bool fConfigTextureSupport[kGrPixelConfigCnt]; | 83 bool fConfigTextureSupport[kGrPixelConfigCnt]; |
| 95 // For Vulkan we track whether a config is supported linearly (without need
for swizzling) | 84 // For Vulkan we track whether a config is supported linearly (without need
for swizzling) |
| 96 bool fConfigLinearTextureSupport[kGrPixelConfigCnt]; | 85 bool fConfigLinearTextureSupport[kGrPixelConfigCnt]; |
| 97 | 86 |
| 98 // 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. |
| 99 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 88 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
| 100 // The first entry for each config is without msaa and the second is with. | 89 // The first entry for each config is without msaa and the second is with. |
| 101 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2]; | 90 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2]; |
| 102 | 91 |
| 103 SkTArray<StencilFormat, true> fLinearStencilFormats; | 92 SkTArray<StencilFormat, true> fLinearStencilFormats; |
| 104 SkTArray<StencilFormat, true> fStencilFormats; | 93 SkTArray<StencilFormat, true> fStencilFormats; |
| 105 | 94 |
| 106 int fMaxSampledTextures; | |
| 107 | |
| 108 typedef GrCaps INHERITED; | 95 typedef GrCaps INHERITED; |
| 109 }; | 96 }; |
| 110 | 97 |
| 111 #endif | 98 #endif |
| OLD | NEW |