OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrCaps.h" | 9 #include "GrCaps.h" |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 fTwoSidedStencilSupport = false; | 84 fTwoSidedStencilSupport = false; |
85 fStencilWrapOpsSupport = false; | 85 fStencilWrapOpsSupport = false; |
86 fDiscardRenderTargetSupport = false; | 86 fDiscardRenderTargetSupport = false; |
87 fReuseScratchTextures = true; | 87 fReuseScratchTextures = true; |
88 fReuseScratchBuffers = true; | 88 fReuseScratchBuffers = true; |
89 fGpuTracingSupport = false; | 89 fGpuTracingSupport = false; |
90 fCompressedTexSubImageSupport = false; | 90 fCompressedTexSubImageSupport = false; |
91 fOversizedStencilSupport = false; | 91 fOversizedStencilSupport = false; |
92 fTextureBarrierSupport = false; | 92 fTextureBarrierSupport = false; |
93 fUsesMixedSamples = false; | 93 fUsesMixedSamples = false; |
| 94 fRasterMultisampleSupport = false; |
94 fSupportsInstancedDraws = false; | 95 fSupportsInstancedDraws = false; |
95 fFullClearIsFree = false; | 96 fFullClearIsFree = false; |
96 fMustClearUploadedBufferData = false; | 97 fMustClearUploadedBufferData = false; |
97 | 98 |
98 fUseDrawInsteadOfClear = false; | 99 fUseDrawInsteadOfClear = false; |
99 | 100 |
100 fBlendEquationSupport = kBasic_BlendEquationSupport; | 101 fBlendEquationSupport = kBasic_BlendEquationSupport; |
101 fAdvBlendEqBlacklist = 0; | 102 fAdvBlendEqBlacklist = 0; |
102 | 103 |
103 fMapBufferFlags = kNone_MapFlags; | 104 fMapBufferFlags = kNone_MapFlags; |
104 | 105 |
105 fMaxRenderTargetSize = 1; | 106 fMaxRenderTargetSize = 1; |
106 fMaxTextureSize = 1; | 107 fMaxTextureSize = 1; |
107 fMaxColorSampleCount = 0; | 108 fMaxColorSampleCount = 0; |
108 fMaxStencilSampleCount = 0; | 109 fMaxStencilSampleCount = 0; |
| 110 fMaxRasterSamples = 0; |
109 | 111 |
110 fSuppressPrints = options.fSuppressPrints; | 112 fSuppressPrints = options.fSuppressPrints; |
111 fImmediateFlush = options.fImmediateMode; | 113 fImmediateFlush = options.fImmediateMode; |
112 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; | 114 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
113 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; | 115 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; |
114 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; | 116 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; |
115 | 117 |
116 fPreferVRAMUseOverFlushes = true; | 118 fPreferVRAMUseOverFlushes = true; |
117 } | 119 } |
118 | 120 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); | 157 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); |
156 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 158 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
157 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 159 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
158 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 160 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
159 r.appendf("Reuse Scratch Buffers : %s\n", gNY[fReuseScratchBuff
ers]); | 161 r.appendf("Reuse Scratch Buffers : %s\n", gNY[fReuseScratchBuff
ers]); |
160 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 162 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
161 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 163 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
162 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 164 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
163 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); | 165 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); |
164 r.appendf("Uses Mixed Samples : %s\n", gNY[fUsesMixedSamples
]); | 166 r.appendf("Uses Mixed Samples : %s\n", gNY[fUsesMixedSamples
]); |
| 167 r.appendf("Raster Multisample Support : %s\n", gNY[fRasterMultisampl
eSupport]); |
165 r.appendf("Supports instanced draws : %s\n", gNY[fSupportsInstance
dDraws]); | 168 r.appendf("Supports instanced draws : %s\n", gNY[fSupportsInstance
dDraws]); |
166 r.appendf("Full screen clear is free : %s\n", gNY[fFullClearIsFree]
); | 169 r.appendf("Full screen clear is free : %s\n", gNY[fFullClearIsFree]
); |
167 r.appendf("Must clear buffer memory : %s\n", gNY[fMustClearUploade
dBufferData]); | 170 r.appendf("Must clear buffer memory : %s\n", gNY[fMustClearUploade
dBufferData]); |
168 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); | 171 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); |
169 r.appendf("Draw Instead of TexSubImage [workaround] : %s\n", | 172 r.appendf("Draw Instead of TexSubImage [workaround] : %s\n", |
170 gNY[fUseDrawInsteadOfPartialRenderTargetWrite]); | 173 gNY[fUseDrawInsteadOfPartialRenderTargetWrite]); |
171 r.appendf("Prefer VRAM Use over flushes [workaround] : %s\n", gNY[fPreferVRA
MUseOverFlushes]); | 174 r.appendf("Prefer VRAM Use over flushes [workaround] : %s\n", gNY[fPreferVRA
MUseOverFlushes]); |
172 | 175 |
173 if (this->advancedBlendEquationSupport()) { | 176 if (this->advancedBlendEquationSupport()) { |
174 r.appendf("Advanced Blend Equation Blacklist : 0x%x\n", fAdvBlendEqBlac
klist); | 177 r.appendf("Advanced Blend Equation Blacklist : 0x%x\n", fAdvBlendEqBlac
klist); |
175 } | 178 } |
176 | 179 |
177 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); | 180 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); |
178 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; | 181 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; |
179 r.appendf("Max Color Sample Count : %d\n", fMaxColorSampleCount)
; | 182 r.appendf("Max Color Sample Count : %d\n", fMaxColorSampleCount)
; |
180 r.appendf("Max Stencil Sample Count : %d\n", fMaxStencilSampleCoun
t); | 183 r.appendf("Max Stencil Sample Count : %d\n", fMaxStencilSampleCoun
t); |
| 184 if (this->rasterMultisampleSupport()) { |
| 185 r.appendf("Max Raster Samples : %d\n", fMaxRasterSamples
); |
| 186 } |
181 | 187 |
182 static const char* kBlendEquationSupportNames[] = { | 188 static const char* kBlendEquationSupportNames[] = { |
183 "Basic", | 189 "Basic", |
184 "Advanced", | 190 "Advanced", |
185 "Advanced Coherent", | 191 "Advanced Coherent", |
186 }; | 192 }; |
187 GR_STATIC_ASSERT(0 == kBasic_BlendEquationSupport); | 193 GR_STATIC_ASSERT(0 == kBasic_BlendEquationSupport); |
188 GR_STATIC_ASSERT(1 == kAdvanced_BlendEquationSupport); | 194 GR_STATIC_ASSERT(1 == kAdvanced_BlendEquationSupport); |
189 GR_STATIC_ASSERT(2 == kAdvancedCoherent_BlendEquationSupport); | 195 GR_STATIC_ASSERT(2 == kAdvancedCoherent_BlendEquationSupport); |
190 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kBlendEquationSupportNames) == kLast_BlendEq
uationSupport + 1); | 196 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kBlendEquationSupportNames) == kLast_BlendEq
uationSupport + 1); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 249 |
244 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 250 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
245 GrPixelConfig config = static_cast<GrPixelConfig>(i); | 251 GrPixelConfig config = static_cast<GrPixelConfig>(i); |
246 r.appendf("%s is uploadable to a texture: %s\n", | 252 r.appendf("%s is uploadable to a texture: %s\n", |
247 kConfigNames[i], | 253 kConfigNames[i], |
248 gNY[this->isConfigTexturable(config)]); | 254 gNY[this->isConfigTexturable(config)]); |
249 } | 255 } |
250 | 256 |
251 return r; | 257 return r; |
252 } | 258 } |
OLD | NEW |