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

Unified Diff: include/gpu/GrTypes.h

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: Rebase on top of text context patch 2 Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 3f02c62bfd07aab21c647c673beef0850a782c32..fc85956288dfaa79bde9f7966fa02bddd7ceda9c 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -423,6 +423,32 @@ enum GrSurfaceOrigin {
};
/**
+ * Sample config clarifies the meaning of samples count.
+ * In default kUnified_GrSampleConfig sample count refers to MSAA sample count.
+ * If NV_framebuffer_mixed_samples is available and sample config is chosen to be
+ * kStencil_GrSampleConfig, sample count refers to the stencil sample count only,
+ * and the color sample count is assumed to be zero.
+ */
+enum GrSampleConfig {
+ kUnified_GrSampleConfig,
+ kStencil_GrSampleConfig,
+};
+
+/**
+ * Pipeline stage serves as a query parameter to render target's isMultisampled
+ * and numSamples methods. It signifies whether the caller is interested in
+ * multisampling in color buffer or stencil buffer specifically, both, or any of
+ * the two. Used by the NV_framebuffer_mixed_samples implementation.
+ */
Chris Dalton 2015/03/19 12:07:41 I think this enum belongs inside the GrRenderTarge
+enum GrPipelineStage {
+ kColorBuffer_GrPipelineStage,
+ kStencilBuffer_GrPipelineStage,
+ kEverywhere_GrPipelineStage = kColorBuffer_GrPipelineStage,
+ kAnywhere_GrPipelineStage = kStencilBuffer_GrPipelineStage,
+ kRaster_GrPipelineStage = kStencilBuffer_GrPipelineStage
Chris Dalton 2015/03/19 12:07:41 We maybe don't have to include kRaster for now. So
+};
+
+/**
* Describes a surface to be created.
*/
struct GrSurfaceDesc {
@@ -549,6 +575,13 @@ struct GrBackendRenderTargetDesc {
*/
int fSampleCnt;
/**
+ * If fSampleCnt is > 1, which buffers are multisampled (color and stencil,
+ * or just stencil?). The default is both. Note that mixing multisampled
+ * and aliased buffers is only possible if NV_framebuffer_mixed_samples is
+ * available.
+ */
+ GrSampleConfig fSampleConfig;
+ /**
* Number of bits of stencil per-pixel.
*/
int fStencilBits;

Powered by Google App Engine
This is Rietveld 408576698