Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: include/gpu/GrCaps.h

Issue 1666563003: Add support for GL_EXT_raster_multisample (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrCaps.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 #ifndef GrCaps_DEFINED 8 #ifndef GrCaps_DEFINED
9 #define GrCaps_DEFINED 9 #define GrCaps_DEFINED
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 only for POT textures) */ 136 only for POT textures) */
137 bool mipMapSupport() const { return fMipMapSupport; } 137 bool mipMapSupport() const { return fMipMapSupport; }
138 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } 138 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; }
139 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } 139 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; }
140 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport ; } 140 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport ; }
141 bool gpuTracingSupport() const { return fGpuTracingSupport; } 141 bool gpuTracingSupport() const { return fGpuTracingSupport; }
142 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup port; } 142 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup port; }
143 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } 143 bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
144 bool textureBarrierSupport() const { return fTextureBarrierSupport; } 144 bool textureBarrierSupport() const { return fTextureBarrierSupport; }
145 bool usesMixedSamples() const { return fUsesMixedSamples; } 145 bool usesMixedSamples() const { return fUsesMixedSamples; }
146 /** "Raster multisample" is a special HW mode where the rasterizer runs more samples than are in
147 the target framebuffer. */
148 bool rasterMultisampleSupport() const { return fRasterMultisampleSupport; }
146 149
147 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } 150 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; }
148 bool useDrawInsteadOfPartialRenderTargetWrite() const { 151 bool useDrawInsteadOfPartialRenderTargetWrite() const {
149 return fUseDrawInsteadOfPartialRenderTargetWrite; 152 return fUseDrawInsteadOfPartialRenderTargetWrite;
150 } 153 }
151 154
152 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } 155 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; }
153 156
154 /** 157 /**
155 * Indicates the capabilities of the fixed function blend unit. 158 * Indicates the capabilities of the fixed function blend unit.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 int maxStencilSampleCount() const { return fMaxStencilSampleCount; } 216 int maxStencilSampleCount() const { return fMaxStencilSampleCount; }
214 // We require the sample count to be less than maxColorSampleCount and maxSt encilSampleCount. 217 // We require the sample count to be less than maxColorSampleCount and maxSt encilSampleCount.
215 // If we are using mixed samples, we only care about stencil. 218 // If we are using mixed samples, we only care about stencil.
216 int maxSampleCount() const { 219 int maxSampleCount() const {
217 if (this->usesMixedSamples()) { 220 if (this->usesMixedSamples()) {
218 return this->maxStencilSampleCount(); 221 return this->maxStencilSampleCount();
219 } else { 222 } else {
220 return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCou nt()); 223 return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCou nt());
221 } 224 }
222 } 225 }
223 226 // This can only be called if raster multisample is supported.
227 int maxRasterSamples() const {
bsalomon 2016/02/04 21:30:01 Maybe this could be simplified and just return 0 i
228 SkASSERT(this->rasterMultisampleSupport());
229 return fMaxRasterSamples;
230 }
224 231
225 virtual bool isConfigTexturable(GrPixelConfig config) const = 0; 232 virtual bool isConfigTexturable(GrPixelConfig config) const = 0;
226 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const = 0; 233 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const = 0;
227 234
228 bool suppressPrints() const { return fSuppressPrints; } 235 bool suppressPrints() const { return fSuppressPrints; }
229 236
230 bool immediateFlush() const { return fImmediateFlush; } 237 bool immediateFlush() const { return fImmediateFlush; }
231 238
232 bool drawPathMasksToCompressedTexturesSupport() const { 239 bool drawPathMasksToCompressedTexturesSupport() const {
233 return fDrawPathMasksToCompressedTextureSupport; 240 return fDrawPathMasksToCompressedTextureSupport;
(...skipping 27 matching lines...) Expand all
261 bool fTwoSidedStencilSupport : 1; 268 bool fTwoSidedStencilSupport : 1;
262 bool fStencilWrapOpsSupport : 1; 269 bool fStencilWrapOpsSupport : 1;
263 bool fDiscardRenderTargetSupport : 1; 270 bool fDiscardRenderTargetSupport : 1;
264 bool fReuseScratchTextures : 1; 271 bool fReuseScratchTextures : 1;
265 bool fReuseScratchBuffers : 1; 272 bool fReuseScratchBuffers : 1;
266 bool fGpuTracingSupport : 1; 273 bool fGpuTracingSupport : 1;
267 bool fCompressedTexSubImageSupport : 1; 274 bool fCompressedTexSubImageSupport : 1;
268 bool fOversizedStencilSupport : 1; 275 bool fOversizedStencilSupport : 1;
269 bool fTextureBarrierSupport : 1; 276 bool fTextureBarrierSupport : 1;
270 bool fUsesMixedSamples : 1; 277 bool fUsesMixedSamples : 1;
278 bool fRasterMultisampleSupport : 1;
271 bool fSupportsInstancedDraws : 1; 279 bool fSupportsInstancedDraws : 1;
272 bool fFullClearIsFree : 1; 280 bool fFullClearIsFree : 1;
273 bool fMustClearUploadedBufferData : 1; 281 bool fMustClearUploadedBufferData : 1;
274 282
275 // Driver workaround 283 // Driver workaround
276 bool fUseDrawInsteadOfClear : 1; 284 bool fUseDrawInsteadOfClear : 1;
277 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; 285 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1;
278 286
279 // ANGLE workaround 287 // ANGLE workaround
280 bool fPreferVRAMUseOverFlushes : 1; 288 bool fPreferVRAMUseOverFlushes : 1;
281 289
282 BlendEquationSupport fBlendEquationSupport; 290 BlendEquationSupport fBlendEquationSupport;
283 uint32_t fAdvBlendEqBlacklist; 291 uint32_t fAdvBlendEqBlacklist;
284 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); 292 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32);
285 293
286 uint32_t fMapBufferFlags; 294 uint32_t fMapBufferFlags;
287 int fGeometryBufferMapThreshold; 295 int fGeometryBufferMapThreshold;
288 296
289 int fMaxRenderTargetSize; 297 int fMaxRenderTargetSize;
290 int fMaxTextureSize; 298 int fMaxTextureSize;
291 int fMaxTileSize; 299 int fMaxTileSize;
292 int fMaxColorSampleCount; 300 int fMaxColorSampleCount;
293 int fMaxStencilSampleCount; 301 int fMaxStencilSampleCount;
302 int fMaxRasterSamples;
294 303
295 private: 304 private:
296 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; 305 virtual void onApplyOptionsOverrides(const GrContextOptions&) {};
297 306
298 bool fSuppressPrints : 1; 307 bool fSuppressPrints : 1;
299 bool fImmediateFlush: 1; 308 bool fImmediateFlush: 1;
300 bool fDrawPathMasksToCompressedTextureSupport : 1; 309 bool fDrawPathMasksToCompressedTextureSupport : 1;
301 310
302 typedef SkRefCnt INHERITED; 311 typedef SkRefCnt INHERITED;
303 }; 312 };
304 313
305 #endif 314 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698