Chromium Code Reviews| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 bool configCanBeSrcofBlit(GrPixelConfig config, bool linearTiled) const { | 55 bool configCanBeSrcofBlit(GrPixelConfig config, bool linearTiled) const { |
| 56 const uint16_t& flags = linearTiled ? fConfigTable[config].fLinearFlags : | 56 const uint16_t& flags = linearTiled ? fConfigTable[config].fLinearFlags : |
| 57 fConfigTable[config].fOptimalFlags ; | 57 fConfigTable[config].fOptimalFlags ; |
| 58 return SkToBool(ConfigInfo::kBlitSrc_Flag & flags); | 58 return SkToBool(ConfigInfo::kBlitSrc_Flag & flags); |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool canUseGLSLForShaderModule() const { | 61 bool canUseGLSLForShaderModule() const { |
| 62 return fCanUseGLSLForShaderModule; | 62 return fCanUseGLSLForShaderModule; |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool mustDoCopiesFromOrigin() const { | |
| 66 return fMustDoCopiesFromOrigin; | |
| 67 } | |
| 68 | |
| 65 /** | 69 /** |
| 66 * Returns both a supported and most prefered stencil format to use in draws . | 70 * Returns both a supported and most prefered stencil format to use in draws . |
| 67 */ | 71 */ |
| 68 const StencilFormat& preferedStencilFormat() const { | 72 const StencilFormat& preferedStencilFormat() const { |
| 69 return fPreferedStencilFormat; | 73 return fPreferedStencilFormat; |
| 70 } | 74 } |
| 71 | 75 |
| 72 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC aps.get()); } | 76 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC aps.get()); } |
| 73 | 77 |
| 74 private: | 78 private: |
| 79 enum VkVendor { | |
| 80 kQualcomm_VkVendor = 20803, | |
| 81 }; | |
| 82 | |
| 75 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt erface, | 83 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt erface, |
| 76 VkPhysicalDevice device, uint32_t featureFlags, uint32_t extension Flags); | 84 VkPhysicalDevice device, uint32_t featureFlags, uint32_t extension Flags); |
| 77 void initGrCaps(const VkPhysicalDeviceProperties&, | 85 void initGrCaps(const VkPhysicalDeviceProperties&, |
| 78 const VkPhysicalDeviceMemoryProperties&, | 86 const VkPhysicalDeviceMemoryProperties&, |
| 79 uint32_t featureFlags); | 87 uint32_t featureFlags); |
| 80 void initGLSLCaps(const VkPhysicalDeviceProperties&, uint32_t featureFlags); | 88 void initGLSLCaps(const VkPhysicalDeviceProperties&, uint32_t featureFlags); |
| 81 void initSampleCount(const VkPhysicalDeviceProperties& properties); | 89 void initSampleCount(const VkPhysicalDeviceProperties& properties); |
| 82 | 90 |
| 83 | 91 |
| 84 void initConfigTable(const GrVkInterface*, VkPhysicalDevice); | 92 void initConfigTable(const GrVkInterface*, VkPhysicalDevice); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 100 uint16_t fOptimalFlags; | 108 uint16_t fOptimalFlags; |
| 101 uint16_t fLinearFlags; | 109 uint16_t fLinearFlags; |
| 102 }; | 110 }; |
| 103 ConfigInfo fConfigTable[kGrPixelConfigCnt]; | 111 ConfigInfo fConfigTable[kGrPixelConfigCnt]; |
| 104 | 112 |
| 105 StencilFormat fPreferedStencilFormat; | 113 StencilFormat fPreferedStencilFormat; |
| 106 | 114 |
| 107 // Tells of if we can pass in straight GLSL string into vkCreateShaderModule | 115 // Tells of if we can pass in straight GLSL string into vkCreateShaderModule |
| 108 bool fCanUseGLSLForShaderModule; | 116 bool fCanUseGLSLForShaderModule; |
| 109 | 117 |
| 118 // On Adreno vulkan, they do no respect the imageOffset parameter at least i ng | |
|
Brian Osman
2016/09/09 18:57:50
s/no/not/ ... s/ing/in/
| |
| 119 // copyImageToBuffer. This flag says that we must do the copy starting from the origin always. | |
| 120 bool fMustDoCopiesFromOrigin; | |
| 121 | |
| 110 typedef GrCaps INHERITED; | 122 typedef GrCaps INHERITED; |
| 111 }; | 123 }; |
| 112 | 124 |
| 113 #endif | 125 #endif |
| OLD | NEW |