mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 12:30:11 +01:00
gallium: add a cull distance semantic
cull distance is analogous to clip distance. If a register is given this semantic, then the values in it are assumed to be a float32 distance to a plane. Primitives will be completely discarded if the plane distance for all of the vertices in the primitive are < 0. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
0a3779d955
commit
3d08eada34
5 changed files with 20 additions and 2 deletions
|
|
@ -200,6 +200,10 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
|
|||
fulldecl->Semantic.Name == TGSI_SEMANTIC_CLIPDIST) {
|
||||
info->num_written_clipdistance += util_bitcount(fulldecl->Declaration.UsageMask);
|
||||
}
|
||||
if ((procType == TGSI_PROCESSOR_VERTEX || procType == TGSI_PROCESSOR_GEOMETRY) &&
|
||||
fulldecl->Semantic.Name == TGSI_SEMANTIC_CULLDIST) {
|
||||
info->num_written_culldistance += util_bitcount(fulldecl->Declaration.UsageMask);
|
||||
}
|
||||
/* extra info for special outputs */
|
||||
if (procType == TGSI_PROCESSOR_FRAGMENT &&
|
||||
fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION)
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ struct tgsi_shader_info
|
|||
boolean writes_viewport_index;
|
||||
boolean writes_layer;
|
||||
|
||||
unsigned num_written_culldistance;
|
||||
unsigned num_written_clipdistance;
|
||||
/**
|
||||
* Bitmask indicating which register files are accessed with
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
|
|||
"TEXCOORD",
|
||||
"PCOORD",
|
||||
"VIEWPORT_INDEX",
|
||||
"LAYER"
|
||||
"LAYER",
|
||||
"CULLDIST"
|
||||
};
|
||||
|
||||
const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
|
||||
|
|
|
|||
|
|
@ -2425,6 +2425,17 @@ contains the layer value to use for the color and depth/stencil surfaces.
|
|||
Only the X value is used. (Also known as rendertarget array index.)
|
||||
|
||||
|
||||
TGSI_SEMANTIC_CULLDIST
|
||||
""""""""""""""""""""""
|
||||
|
||||
Used as distance to plane for performing application-defined culling
|
||||
of individual primitives against a plane. When components of vertex
|
||||
elements are given this label, these values are assumed to be a
|
||||
float32 signed distance to a plane. Primitives will be completely
|
||||
discarded if the plane distance for all of the vertices in the
|
||||
primitive are < 0. If a vertex has a cull distance of NaN, that
|
||||
vertex counts as "out" (as if its < 0);
|
||||
|
||||
|
||||
Declaration Interpolate
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -166,7 +166,8 @@ struct tgsi_declaration_interp
|
|||
#define TGSI_SEMANTIC_PCOORD 20 /**< point sprite coordinate */
|
||||
#define TGSI_SEMANTIC_VIEWPORT_INDEX 21 /**< viewport index */
|
||||
#define TGSI_SEMANTIC_LAYER 22 /**< layer (rendertarget index) */
|
||||
#define TGSI_SEMANTIC_COUNT 23 /**< number of semantic values */
|
||||
#define TGSI_SEMANTIC_CULLDIST 23
|
||||
#define TGSI_SEMANTIC_COUNT 24 /**< number of semantic values */
|
||||
|
||||
struct tgsi_declaration_semantic
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue