summaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2018-11-06 13:08:32 -0800
committerKristian H. Kristensen <[email protected]>2018-12-06 16:55:43 -0800
commit2710c40e3c817e269fde6fd3bb2727e0ee8d3598 (patch)
tree966eff674ac450c8486e82e26e08c53f0fb86635 /src/gallium/include
parent1b331ae505e63033634d9f5267ca1949336f75d8 (diff)
gallium: Add new PIPE_CAP_SURFACE_SAMPLE_COUNT
This new pipe cap and the new nr_samples field in pipe_surface lets a state tracker bind a render target with a different sample count than the resource. This allows for implementing EXT_multisampled_render_to_texture and EXT_multisampled_render_to_texture2. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_defines.h1
-rw-r--r--src/gallium/include/pipe/p_state.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index e99895d30d8..6d96f1ccb5b 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -832,6 +832,7 @@ enum pipe_cap
PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS,
PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET,
PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET,
+ PIPE_CAP_SURFACE_SAMPLE_COUNT,
};
/**
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index fd670345aad..38052e5fd3d 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -443,6 +443,13 @@ struct pipe_surface
uint16_t width; /**< logical width in pixels */
uint16_t height; /**< logical height in pixels */
+ /**
+ * Number of samples for the surface. This will be 0 if rendering
+ * should use the resource's nr_samples, or another value if the resource
+ * is bound using FramebufferTexture2DMultisampleEXT.
+ */
+ unsigned nr_samples:8;
+
union pipe_surface_desc u;
};