[Mesa-dev] [PATCH] gallium: add support for layered rendering
sroland at vmware.com
sroland at vmware.com
Fri May 31 14:43:24 PDT 2013
From: Roland Scheidegger <sroland at vmware.com>
Since pipe_surface already has all the necessary fields no interface
changes are necessary except adding a new shader semantic value
(TGSI_SEMANTIC_LAYER), though add a pipe capability bit for it as well.
(Note that what GL knows as "gl_Layer" variable d3d10 is naming
"RENDER_TARGET_ARRAY_INDEX")
---
src/gallium/docs/source/screen.rst | 2 ++
src/gallium/include/pipe/p_defines.h | 3 ++-
src/gallium/include/pipe/p_shader_tokens.h | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index 683080c..b74b237 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -168,6 +168,8 @@ The integer capabilities:
since they are linked) a driver can support. Returning 0 is equivalent
to returning 1 because every driver has to support at least a single
viewport/scissor combination.
+* ``PIPE_CAP_LAYERED_RENDERING``: Whether rendering to multiple layers is
+ supported using layer selection by the TGSI_SEMANTIC_LAYER shader variable.
.. _pipe_capf:
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 8af1a84..c359a9e 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -508,7 +508,8 @@ enum pipe_cap {
PIPE_CAP_QUERY_PIPELINE_STATISTICS = 81,
PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK = 82,
PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE = 83,
- PIPE_CAP_MAX_VIEWPORTS = 84
+ PIPE_CAP_MAX_VIEWPORTS = 84,
+ PIPE_CAP_MULTIPLE_LAYERS = 85
};
#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index b33cf1d..c984d50 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -165,7 +165,8 @@ struct tgsi_declaration_interp
#define TGSI_SEMANTIC_TEXCOORD 19 /**< texture or sprite coordinates */
#define TGSI_SEMANTIC_PCOORD 20 /**< point sprite coordinate */
#define TGSI_SEMANTIC_VIEWPORT_INDEX 21 /**< viewport index */
-#define TGSI_SEMANTIC_COUNT 22 /**< number of semantic values */
+#define TGSI_SEMANTIC_LAYER 22 /**< layer (rendertarget index) */
+#define TGSI_SEMANTIC_COUNT 23 /**< number of semantic values */
struct tgsi_declaration_semantic
{
--
1.7.9.5
More information about the mesa-dev
mailing list