| 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 #include "GrVkCaps.h" | 8 #include "GrVkCaps.h" |
| 9 | 9 |
| 10 #include "GrVkUtil.h" | 10 #include "GrVkUtil.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 fStencilWrapOpsSupport = false; //TODO: figure this out | 22 fStencilWrapOpsSupport = false; //TODO: figure this out |
| 23 fDiscardRenderTargetSupport = false; //TODO: figure this out | 23 fDiscardRenderTargetSupport = false; //TODO: figure this out |
| 24 fReuseScratchTextures = true; //TODO: figure this out | 24 fReuseScratchTextures = true; //TODO: figure this out |
| 25 fGpuTracingSupport = false; //TODO: figure this out | 25 fGpuTracingSupport = false; //TODO: figure this out |
| 26 fCompressedTexSubImageSupport = false; //TODO: figure this out | 26 fCompressedTexSubImageSupport = false; //TODO: figure this out |
| 27 fOversizedStencilSupport = false; //TODO: figure this out | 27 fOversizedStencilSupport = false; //TODO: figure this out |
| 28 | 28 |
| 29 fUseDrawInsteadOfClear = false; //TODO: figure this out | 29 fUseDrawInsteadOfClear = false; //TODO: figure this out |
| 30 | 30 |
| 31 fMapBufferFlags = kNone_MapFlags; //TODO: figure this out | 31 fMapBufferFlags = kNone_MapFlags; //TODO: figure this out |
| 32 fGeometryBufferMapThreshold = SK_MaxS32; //TODO: figure this out | 32 fBufferMapThreshold = SK_MaxS32; //TODO: figure this out |
| 33 | 33 |
| 34 fMaxRenderTargetSize = 4096; // minimum required by spec | 34 fMaxRenderTargetSize = 4096; // minimum required by spec |
| 35 fMaxTextureSize = 4096; // minimum required by spec | 35 fMaxTextureSize = 4096; // minimum required by spec |
| 36 fMaxColorSampleCount = 4; // minimum required by spec | 36 fMaxColorSampleCount = 4; // minimum required by spec |
| 37 fMaxStencilSampleCount = 4; // minimum required by spec | 37 fMaxStencilSampleCount = 4; // minimum required by spec |
| 38 | 38 |
| 39 | 39 |
| 40 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); | 40 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); |
| 41 | 41 |
| 42 this->init(contextOptions, vkInterface, physDev); | 42 this->init(contextOptions, vkInterface, physDev); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 const VkPhysicalDeviceMemoryProperties& memoryProperit
es) { | 104 const VkPhysicalDeviceMemoryProperties& memoryProperit
es) { |
| 105 // We could actually query and get a max size for each config, however maxIm
ageDimension2D will | 105 // We could actually query and get a max size for each config, however maxIm
ageDimension2D will |
| 106 // give the minimum max size across all configs. So for simplicity we will u
se that for now. | 106 // give the minimum max size across all configs. So for simplicity we will u
se that for now. |
| 107 fMaxRenderTargetSize = properties.limits.maxImageDimension2D; | 107 fMaxRenderTargetSize = properties.limits.maxImageDimension2D; |
| 108 fMaxTextureSize = properties.limits.maxImageDimension2D; | 108 fMaxTextureSize = properties.limits.maxImageDimension2D; |
| 109 | 109 |
| 110 this->initSampleCount(properties); | 110 this->initSampleCount(properties); |
| 111 | 111 |
| 112 // Assuming since we will always map in the end to upload the data we might
as well just map | 112 // Assuming since we will always map in the end to upload the data we might
as well just map |
| 113 // from the get go. There is no hard data to suggest this is faster or slowe
r. | 113 // from the get go. There is no hard data to suggest this is faster or slowe
r. |
| 114 fGeometryBufferMapThreshold = 0; | 114 fBufferMapThreshold = 0; |
| 115 | 115 |
| 116 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; | 116 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; |
| 117 | 117 |
| 118 fStencilWrapOpsSupport = true; | 118 fStencilWrapOpsSupport = true; |
| 119 fOversizedStencilSupport = true; | 119 fOversizedStencilSupport = true; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceFeatures& features, | 122 void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceFeatures& features, |
| 123 const VkPhysicalDeviceProperties& properties) { | 123 const VkPhysicalDeviceProperties& properties) { |
| 124 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 124 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 // internal Format stencil bits total bits
packed? | 270 // internal Format stencil bits total bits
packed? |
| 271 gS8 = { VK_FORMAT_S8_UINT, 8, 8,
false }, | 271 gS8 = { VK_FORMAT_S8_UINT, 8, 8,
false }, |
| 272 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32,
true }; | 272 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32,
true }; |
| 273 | 273 |
| 274 // I'm simply assuming that these two will be supported since they are used
in example code. | 274 // I'm simply assuming that these two will be supported since they are used
in example code. |
| 275 // TODO: Actaully figure this out | 275 // TODO: Actaully figure this out |
| 276 SET_CONFIG_CAN_STENCIL(gS8); | 276 SET_CONFIG_CAN_STENCIL(gS8); |
| 277 SET_CONFIG_CAN_STENCIL(gD24S8); | 277 SET_CONFIG_CAN_STENCIL(gD24S8); |
| 278 } | 278 } |
| 279 | 279 |
| OLD | NEW |