Mesa (master): gallium: Add cylindrical wrap info to TGSI declaration.
MichaŠKról
michal at kemper.freedesktop.org
Tue Feb 9 14:35:32 UTC 2010
Module: Mesa
Branch: master
Commit: 6f6d740c851aa8bedc7c51dbd5db14de338787f1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f6d740c851aa8bedc7c51dbd5db14de338787f1
Author: Michal Krol <michal at vmware.com>
Date: Wed Feb 3 15:28:03 2010 +0100
gallium: Add cylindrical wrap info to TGSI declaration.
---
src/gallium/auxiliary/tgsi/tgsi_build.c | 5 ++++-
src/gallium/auxiliary/tgsi/tgsi_build.h | 1 +
src/gallium/auxiliary/tgsi/tgsi_dump.c | 16 ++++++++++++++++
src/gallium/include/pipe/p_shader_tokens.h | 9 +++++++--
4 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c
index e38b0be..0890078 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -107,7 +107,7 @@ tgsi_default_declaration( void )
declaration.Semantic = 0;
declaration.Centroid = 0;
declaration.Invariant = 0;
- declaration.Padding = 0;
+ declaration.CylindricalWrap = 0;
return declaration;
}
@@ -121,6 +121,7 @@ tgsi_build_declaration(
unsigned semantic,
unsigned centroid,
unsigned invariant,
+ unsigned cylindrical_wrap,
struct tgsi_header *header )
{
struct tgsi_declaration declaration;
@@ -136,6 +137,7 @@ tgsi_build_declaration(
declaration.Semantic = semantic;
declaration.Centroid = centroid;
declaration.Invariant = invariant;
+ declaration.CylindricalWrap = cylindrical_wrap;
header_bodysize_grow( header );
@@ -190,6 +192,7 @@ tgsi_build_full_declaration(
full_decl->Declaration.Semantic,
full_decl->Declaration.Centroid,
full_decl->Declaration.Invariant,
+ full_decl->Declaration.CylindricalWrap,
header );
if (maxsize <= size)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.h b/src/gallium/auxiliary/tgsi/tgsi_build.h
index ebee4ce..13d7f52 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.h
@@ -68,6 +68,7 @@ tgsi_build_declaration(
unsigned semantic,
unsigned centroid,
unsigned invariant,
+ unsigned cylindrical_wrap,
struct tgsi_header *header );
struct tgsi_full_declaration
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index dd36555..5703141 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -342,6 +342,22 @@ iter_declaration(
TXT( ", INVARIANT" );
}
+ if (decl->Declaration.CylindricalWrap) {
+ TXT(", CYLWRAP_");
+ if (decl->Declaration.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_X) {
+ CHR('X');
+ }
+ if (decl->Declaration.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_Y) {
+ CHR('Y');
+ }
+ if (decl->Declaration.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_Z) {
+ CHR('Z');
+ }
+ if (decl->Declaration.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_W) {
+ CHR('W');
+ }
+ }
+
EOL();
return TRUE;
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 21581a4..c5c480f 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -1,7 +1,7 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright 2009 VMware, Inc.
+ * Copyright 2009-2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -102,6 +102,11 @@ enum tgsi_file_type {
#define TGSI_INTERPOLATE_PERSPECTIVE 2
#define TGSI_INTERPOLATE_COUNT 3
+#define TGSI_CYLINDRICAL_WRAP_X (1 << 0)
+#define TGSI_CYLINDRICAL_WRAP_Y (1 << 1)
+#define TGSI_CYLINDRICAL_WRAP_Z (1 << 2)
+#define TGSI_CYLINDRICAL_WRAP_W (1 << 3)
+
struct tgsi_declaration
{
unsigned Type : 4; /**< TGSI_TOKEN_TYPE_DECLARATION */
@@ -113,7 +118,7 @@ struct tgsi_declaration
unsigned Semantic : 1; /**< BOOL, any semantic info? */
unsigned Centroid : 1; /**< centroid sampling? */
unsigned Invariant : 1; /**< invariant optimization? */
- unsigned Padding : 4;
+ unsigned CylindricalWrap:4; /**< TGSI_CYLINDRICAL_WRAP_x flags */
};
struct tgsi_declaration_range
More information about the mesa-commit
mailing list