Mesa (7.10): glsl: Expose a public glsl_type::void_type const pointer.
Ian Romanick
idr at kemper.freedesktop.org
Sat Feb 5 00:14:06 UTC 2011
Module: Mesa
Branch: 7.10
Commit: 32786b8a33cd39da2cd6cbd39e047bbecf72a5ea
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=32786b8a33cd39da2cd6cbd39e047bbecf72a5ea
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Mon Dec 13 11:19:38 2010 -0800
glsl: Expose a public glsl_type::void_type const pointer.
This is analogous to glsl_type::int_type and all the others.
(cherry picked from commit 5c229e5fbd8ffa573ab2c1225f182036792a75af)
---
src/glsl/builtin_types.h | 3 ++-
src/glsl/glsl_types.cpp | 4 ++--
src/glsl/glsl_types.h | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/glsl/builtin_types.h b/src/glsl/builtin_types.h
index 443ae16..8ccbf6e 100644
--- a/src/glsl/builtin_types.h
+++ b/src/glsl/builtin_types.h
@@ -24,10 +24,11 @@
const glsl_type glsl_type::_error_type =
glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, "");
-const glsl_type glsl_type::void_type =
+const glsl_type glsl_type::_void_type =
glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void");
const glsl_type *const glsl_type::error_type = & glsl_type::_error_type;
+const glsl_type *const glsl_type::void_type = & glsl_type::_void_type;
/** \name Core built-in types
*
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 8c33cfa..95b8592 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -120,7 +120,7 @@ glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
add_types_to_symbol_table(symtab, builtin_structure_types,
Elements(builtin_structure_types),
false);
- add_types_to_symbol_table(symtab, &void_type, 1, false);
+ add_types_to_symbol_table(symtab, void_type, 1, false);
}
void
@@ -279,7 +279,7 @@ const glsl_type *
glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
{
if (base_type == GLSL_TYPE_VOID)
- return &void_type;
+ return void_type;
if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
return error_type;
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index d62d493..57e7b09 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -142,6 +142,7 @@ struct glsl_type {
*/
/*@{*/
static const glsl_type *const error_type;
+ static const glsl_type *const void_type;
static const glsl_type *const int_type;
static const glsl_type *const ivec4_type;
static const glsl_type *const uint_type;
@@ -424,7 +425,7 @@ private:
*/
/*@{*/
static const glsl_type _error_type;
- static const glsl_type void_type;
+ static const glsl_type _void_type;
static const glsl_type builtin_core_types[];
static const glsl_type builtin_structure_types[];
static const glsl_type builtin_110_deprecated_structure_types[];
More information about the mesa-commit
mailing list