2010-03-10 21:58:12 +00:00
|
|
|
/* -*- c++ -*- */
|
2010-02-22 21:19:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2009 Intel Corporation
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
* Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#ifndef GLSL_TYPES_H
|
|
|
|
#define GLSL_TYPES_H
|
|
|
|
|
2010-03-09 23:17:37 +00:00
|
|
|
#include <cstring>
|
2010-03-26 18:43:36 +00:00
|
|
|
#include <cassert>
|
2010-03-09 23:17:37 +00:00
|
|
|
|
2010-06-24 03:04:45 +01:00
|
|
|
extern "C" {
|
2010-06-25 22:27:07 +01:00
|
|
|
#include "GL/gl.h"
|
2010-06-24 03:04:45 +01:00
|
|
|
#include <talloc.h>
|
|
|
|
}
|
|
|
|
|
2010-06-28 19:01:57 +01:00
|
|
|
struct _mesa_glsl_parse_state;
|
2010-08-14 15:35:57 +01:00
|
|
|
struct glsl_symbol_table;
|
2010-06-28 19:01:57 +01:00
|
|
|
|
|
|
|
extern "C" void
|
|
|
|
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state);
|
|
|
|
|
2010-06-28 21:17:18 +01:00
|
|
|
extern "C" void
|
|
|
|
_mesa_glsl_release_types(void);
|
|
|
|
|
2010-11-11 07:20:47 +00:00
|
|
|
enum glsl_base_type {
|
|
|
|
GLSL_TYPE_UINT = 0,
|
|
|
|
GLSL_TYPE_INT,
|
|
|
|
GLSL_TYPE_FLOAT,
|
|
|
|
GLSL_TYPE_BOOL,
|
|
|
|
GLSL_TYPE_SAMPLER,
|
|
|
|
GLSL_TYPE_STRUCT,
|
|
|
|
GLSL_TYPE_ARRAY,
|
|
|
|
GLSL_TYPE_VOID,
|
|
|
|
GLSL_TYPE_ERROR
|
|
|
|
};
|
2010-02-22 21:19:34 +00:00
|
|
|
|
2010-03-09 23:17:37 +00:00
|
|
|
enum glsl_sampler_dim {
|
|
|
|
GLSL_SAMPLER_DIM_1D = 0,
|
|
|
|
GLSL_SAMPLER_DIM_2D,
|
|
|
|
GLSL_SAMPLER_DIM_3D,
|
|
|
|
GLSL_SAMPLER_DIM_CUBE,
|
|
|
|
GLSL_SAMPLER_DIM_RECT,
|
|
|
|
GLSL_SAMPLER_DIM_BUF
|
|
|
|
};
|
2010-02-22 21:19:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct glsl_type {
|
2010-06-25 22:27:07 +01:00
|
|
|
GLenum gl_type;
|
2010-11-11 07:20:47 +00:00
|
|
|
glsl_base_type base_type;
|
2010-02-22 21:19:34 +00:00
|
|
|
|
|
|
|
unsigned sampler_dimensionality:3;
|
|
|
|
unsigned sampler_shadow:1;
|
|
|
|
unsigned sampler_array:1;
|
|
|
|
unsigned sampler_type:2; /**< Type of data returned using this sampler.
|
|
|
|
* only \c GLSL_TYPE_FLOAT, \c GLSL_TYPE_INT,
|
|
|
|
* and \c GLSL_TYPE_UINT are valid.
|
|
|
|
*/
|
|
|
|
|
2010-06-24 03:04:45 +01:00
|
|
|
/* Callers of this talloc-based new need not call delete. It's
|
2010-08-04 04:05:53 +01:00
|
|
|
* easier to just talloc_free 'mem_ctx' (or any of its ancestors). */
|
2010-06-28 20:19:52 +01:00
|
|
|
static void* operator new(size_t size)
|
2010-06-24 03:04:45 +01:00
|
|
|
{
|
2010-08-04 04:05:53 +01:00
|
|
|
if (glsl_type::mem_ctx == NULL) {
|
|
|
|
glsl_type::mem_ctx = talloc_init("glsl_type");
|
|
|
|
assert(glsl_type::mem_ctx != NULL);
|
2010-06-28 20:19:52 +01:00
|
|
|
}
|
|
|
|
|
2010-06-24 03:04:45 +01:00
|
|
|
void *type;
|
|
|
|
|
2010-08-04 04:05:53 +01:00
|
|
|
type = talloc_size(glsl_type::mem_ctx, size);
|
2010-06-24 03:04:45 +01:00
|
|
|
assert(type != NULL);
|
|
|
|
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the user *does* call delete, that's OK, we will just
|
|
|
|
* talloc_free in that case. */
|
|
|
|
static void operator delete(void *type)
|
|
|
|
{
|
|
|
|
talloc_free(type);
|
|
|
|
}
|
|
|
|
|
2010-03-26 18:43:36 +00:00
|
|
|
/**
|
|
|
|
* \name Vector and matrix element counts
|
|
|
|
*
|
|
|
|
* For scalars, each of these values will be 1. For non-numeric types
|
|
|
|
* these will be 0.
|
|
|
|
*/
|
|
|
|
/*@{*/
|
|
|
|
unsigned vector_elements:3; /**< 1, 2, 3, or 4 vector elements. */
|
|
|
|
unsigned matrix_columns:3; /**< 1, 2, 3, or 4 matrix columns. */
|
|
|
|
/*@}*/
|
2010-02-22 21:19:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the data type
|
|
|
|
*
|
|
|
|
* This may be \c NULL for anonymous structures, for arrays, or for
|
|
|
|
* function types.
|
|
|
|
*/
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For \c GLSL_TYPE_ARRAY, this is the length of the array. For
|
|
|
|
* \c GLSL_TYPE_STRUCT, it is the number of elements in the structure and
|
|
|
|
* the number of values pointed to by \c fields.structure (below).
|
|
|
|
*/
|
|
|
|
unsigned length;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Subtype of composite data types.
|
|
|
|
*/
|
|
|
|
union {
|
|
|
|
const struct glsl_type *array; /**< Type of array elements. */
|
|
|
|
const struct glsl_type *parameters; /**< Parameters to function. */
|
2010-07-21 00:47:25 +01:00
|
|
|
struct glsl_struct_field *structure; /**< List of struct fields. */
|
2010-02-22 21:19:34 +00:00
|
|
|
} fields;
|
2010-03-09 23:17:37 +00:00
|
|
|
|
|
|
|
|
2010-03-26 21:33:41 +00:00
|
|
|
/**
|
|
|
|
* \name Pointers to various public type singletons
|
|
|
|
*/
|
|
|
|
/*@{*/
|
|
|
|
static const glsl_type *const error_type;
|
2010-12-13 19:19:38 +00:00
|
|
|
static const glsl_type *const void_type;
|
2010-03-26 21:33:41 +00:00
|
|
|
static const glsl_type *const int_type;
|
2010-06-03 23:07:34 +01:00
|
|
|
static const glsl_type *const ivec4_type;
|
2010-03-26 21:33:41 +00:00
|
|
|
static const glsl_type *const uint_type;
|
2010-10-08 00:05:39 +01:00
|
|
|
static const glsl_type *const uvec2_type;
|
|
|
|
static const glsl_type *const uvec3_type;
|
2010-06-03 23:07:34 +01:00
|
|
|
static const glsl_type *const uvec4_type;
|
2010-03-26 21:33:41 +00:00
|
|
|
static const glsl_type *const float_type;
|
2010-04-22 17:47:27 +01:00
|
|
|
static const glsl_type *const vec2_type;
|
|
|
|
static const glsl_type *const vec3_type;
|
|
|
|
static const glsl_type *const vec4_type;
|
2010-03-26 21:33:41 +00:00
|
|
|
static const glsl_type *const bool_type;
|
2010-04-26 22:59:16 +01:00
|
|
|
static const glsl_type *const mat2_type;
|
|
|
|
static const glsl_type *const mat2x3_type;
|
|
|
|
static const glsl_type *const mat2x4_type;
|
|
|
|
static const glsl_type *const mat3x2_type;
|
|
|
|
static const glsl_type *const mat3_type;
|
|
|
|
static const glsl_type *const mat3x4_type;
|
|
|
|
static const glsl_type *const mat4x2_type;
|
|
|
|
static const glsl_type *const mat4x3_type;
|
|
|
|
static const glsl_type *const mat4_type;
|
2010-03-26 21:33:41 +00:00
|
|
|
/*@}*/
|
|
|
|
|
|
|
|
|
2010-03-24 00:31:39 +00:00
|
|
|
/**
|
|
|
|
* For numeric and boolean derrived types returns the basic scalar type
|
|
|
|
*
|
|
|
|
* If the type is a numeric or boolean scalar, vector, or matrix type,
|
|
|
|
* this function gets the scalar type of the individual components. For
|
|
|
|
* all other types, including arrays of numeric or boolean types, the
|
|
|
|
* error type is returned.
|
|
|
|
*/
|
|
|
|
const glsl_type *get_base_type() const;
|
|
|
|
|
2010-04-02 01:17:34 +01:00
|
|
|
/**
|
|
|
|
* Query the type of elements in an array
|
|
|
|
*
|
|
|
|
* \return
|
|
|
|
* Pointer to the type of elements in the array for array types, or \c NULL
|
|
|
|
* for non-array types.
|
|
|
|
*/
|
|
|
|
const glsl_type *element_type() const
|
|
|
|
{
|
|
|
|
return is_array() ? fields.array : NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-25 00:11:30 +00:00
|
|
|
/**
|
|
|
|
* Get the instance of a built-in scalar, vector, or matrix type
|
|
|
|
*/
|
|
|
|
static const glsl_type *get_instance(unsigned base_type, unsigned rows,
|
|
|
|
unsigned columns);
|
|
|
|
|
2010-03-31 00:58:19 +01:00
|
|
|
/**
|
|
|
|
* Get the instance of an array type
|
|
|
|
*/
|
2010-07-20 23:33:40 +01:00
|
|
|
static const glsl_type *get_array_instance(const glsl_type *base,
|
2010-03-31 00:58:19 +01:00
|
|
|
unsigned elements);
|
|
|
|
|
2010-06-28 19:54:57 +01:00
|
|
|
/**
|
|
|
|
* Get the instance of a record type
|
|
|
|
*/
|
|
|
|
static const glsl_type *get_record_instance(const glsl_struct_field *fields,
|
|
|
|
unsigned num_fields,
|
|
|
|
const char *name);
|
2010-04-01 00:30:56 +01:00
|
|
|
|
2010-03-26 18:13:43 +00:00
|
|
|
/**
|
|
|
|
* Query the total number of scalars that make up a scalar, vector or matrix
|
|
|
|
*/
|
|
|
|
unsigned components() const
|
|
|
|
{
|
2010-03-26 18:43:36 +00:00
|
|
|
return vector_elements * matrix_columns;
|
2010-03-26 18:13:43 +00:00
|
|
|
}
|
|
|
|
|
2010-06-22 00:05:00 +01:00
|
|
|
/**
|
|
|
|
* Calculate the number of components slots required to hold this type
|
|
|
|
*
|
|
|
|
* This is used to determine how many uniform or varying locations a type
|
|
|
|
* might occupy.
|
|
|
|
*/
|
|
|
|
unsigned component_slots() const;
|
|
|
|
|
|
|
|
|
2010-03-09 23:51:22 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a scalar (non-vector and non-matrix).
|
|
|
|
*/
|
|
|
|
bool is_scalar() const
|
|
|
|
{
|
2010-03-26 18:43:36 +00:00
|
|
|
return (vector_elements == 1)
|
2010-03-09 23:51:22 +00:00
|
|
|
&& (base_type >= GLSL_TYPE_UINT)
|
|
|
|
&& (base_type <= GLSL_TYPE_BOOL);
|
|
|
|
}
|
2010-02-22 21:19:34 +00:00
|
|
|
|
2010-03-09 23:55:16 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a vector
|
|
|
|
*/
|
|
|
|
bool is_vector() const
|
|
|
|
{
|
2010-03-26 18:43:36 +00:00
|
|
|
return (vector_elements > 1)
|
|
|
|
&& (matrix_columns == 1)
|
2010-03-09 23:55:16 +00:00
|
|
|
&& (base_type >= GLSL_TYPE_UINT)
|
|
|
|
&& (base_type <= GLSL_TYPE_BOOL);
|
|
|
|
}
|
2010-02-22 21:19:34 +00:00
|
|
|
|
2010-03-09 23:58:52 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a matrix
|
|
|
|
*/
|
|
|
|
bool is_matrix() const
|
|
|
|
{
|
|
|
|
/* GLSL only has float matrices. */
|
2010-03-26 18:43:36 +00:00
|
|
|
return (matrix_columns > 1) && (base_type == GLSL_TYPE_FLOAT);
|
2010-03-09 23:58:52 +00:00
|
|
|
}
|
2010-03-23 19:28:28 +00:00
|
|
|
|
2010-03-24 00:31:03 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a non-array numeric type
|
|
|
|
*/
|
|
|
|
bool is_numeric() const
|
|
|
|
{
|
|
|
|
return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT);
|
|
|
|
}
|
|
|
|
|
2010-03-26 21:38:37 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is an integral type
|
|
|
|
*/
|
|
|
|
bool is_integer() const
|
|
|
|
{
|
|
|
|
return (base_type == GLSL_TYPE_UINT) || (base_type == GLSL_TYPE_INT);
|
|
|
|
}
|
|
|
|
|
2010-03-30 00:17:15 +01:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a float type
|
|
|
|
*/
|
|
|
|
bool is_float() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_FLOAT;
|
|
|
|
}
|
|
|
|
|
2010-03-24 00:31:03 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a non-array boolean type
|
|
|
|
*/
|
|
|
|
bool is_boolean() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_BOOL;
|
|
|
|
}
|
|
|
|
|
2010-03-23 22:03:46 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a sampler
|
|
|
|
*/
|
|
|
|
bool is_sampler() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_SAMPLER;
|
|
|
|
}
|
|
|
|
|
2010-03-30 00:17:15 +01:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is an array
|
|
|
|
*/
|
|
|
|
bool is_array() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_ARRAY;
|
|
|
|
}
|
|
|
|
|
2010-06-10 01:17:47 +01:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is a record
|
|
|
|
*/
|
|
|
|
bool is_record() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_STRUCT;
|
|
|
|
}
|
|
|
|
|
2010-03-23 19:28:28 +00:00
|
|
|
/**
|
|
|
|
* Query whether or not a type is the void type singleton.
|
|
|
|
*/
|
|
|
|
bool is_void() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_VOID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query whether or not a type is the error type singleton.
|
|
|
|
*/
|
|
|
|
bool is_error() const
|
|
|
|
{
|
|
|
|
return base_type == GLSL_TYPE_ERROR;
|
|
|
|
}
|
2010-03-25 00:05:09 +00:00
|
|
|
|
2010-03-25 18:42:45 +00:00
|
|
|
/**
|
|
|
|
* Query the full type of a matrix row
|
|
|
|
*
|
|
|
|
* \return
|
2010-03-26 21:33:41 +00:00
|
|
|
* If the type is not a matrix, \c glsl_type::error_type is returned.
|
|
|
|
* Otherwise a type matching the rows of the matrix is returned.
|
2010-03-25 18:42:45 +00:00
|
|
|
*/
|
|
|
|
const glsl_type *row_type() const
|
|
|
|
{
|
|
|
|
return is_matrix()
|
2010-03-25 20:19:13 +00:00
|
|
|
? get_instance(base_type, matrix_columns, 1)
|
2010-03-26 21:33:41 +00:00
|
|
|
: error_type;
|
2010-03-25 18:42:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query the full type of a matrix column
|
|
|
|
*
|
|
|
|
* \return
|
2010-03-26 21:33:41 +00:00
|
|
|
* If the type is not a matrix, \c glsl_type::error_type is returned.
|
|
|
|
* Otherwise a type matching the columns of the matrix is returned.
|
2010-03-25 18:42:45 +00:00
|
|
|
*/
|
|
|
|
const glsl_type *column_type() const
|
|
|
|
{
|
|
|
|
return is_matrix()
|
|
|
|
? get_instance(base_type, vector_elements, 1)
|
2010-03-26 21:33:41 +00:00
|
|
|
: error_type;
|
2010-03-25 18:42:45 +00:00
|
|
|
}
|
|
|
|
|
2010-04-19 23:40:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the type of a structure field
|
|
|
|
*
|
|
|
|
* \return
|
|
|
|
* Pointer to the type of the named field. If the type is not a structure
|
|
|
|
* or the named field does not exist, \c glsl_type::error_type is returned.
|
|
|
|
*/
|
|
|
|
const glsl_type *field_type(const char *name) const;
|
|
|
|
|
|
|
|
|
2010-06-10 01:27:31 +01:00
|
|
|
/**
|
|
|
|
* Get the location of a filed within a record type
|
|
|
|
*/
|
|
|
|
int field_index(const char *name) const;
|
|
|
|
|
|
|
|
|
2010-04-02 01:17:34 +01:00
|
|
|
/**
|
|
|
|
* Query the number of elements in an array type
|
|
|
|
*
|
|
|
|
* \return
|
|
|
|
* The number of elements in the array for array types or -1 for non-array
|
|
|
|
* types. If the number of elements in the array has not yet been declared,
|
|
|
|
* zero is returned.
|
|
|
|
*/
|
|
|
|
int array_size() const
|
|
|
|
{
|
|
|
|
return is_array() ? length : -1;
|
|
|
|
}
|
|
|
|
|
2010-08-02 19:35:14 +01:00
|
|
|
private:
|
2010-06-28 20:19:52 +01:00
|
|
|
/**
|
|
|
|
* talloc context for all glsl_type allocations
|
|
|
|
*
|
|
|
|
* Set on the first call to \c glsl_type::new.
|
|
|
|
*/
|
2010-08-04 04:05:53 +01:00
|
|
|
static void *mem_ctx;
|
2010-06-28 20:19:52 +01:00
|
|
|
|
2010-08-02 19:35:14 +01:00
|
|
|
void init_talloc_type_ctx(void);
|
|
|
|
|
2010-06-28 19:09:40 +01:00
|
|
|
/** Constructor for vector and matrix types */
|
|
|
|
glsl_type(GLenum gl_type,
|
2010-11-11 07:20:47 +00:00
|
|
|
glsl_base_type base_type, unsigned vector_elements,
|
2010-06-28 19:09:40 +01:00
|
|
|
unsigned matrix_columns, const char *name);
|
|
|
|
|
|
|
|
/** Constructor for sampler types */
|
|
|
|
glsl_type(GLenum gl_type,
|
|
|
|
enum glsl_sampler_dim dim, bool shadow, bool array,
|
|
|
|
unsigned type, const char *name);
|
|
|
|
|
2010-06-28 19:57:38 +01:00
|
|
|
/** Constructor for record types */
|
|
|
|
glsl_type(const glsl_struct_field *fields, unsigned num_fields,
|
|
|
|
const char *name);
|
|
|
|
|
2010-06-28 19:09:40 +01:00
|
|
|
/** Constructor for array types */
|
2010-07-20 23:33:40 +01:00
|
|
|
glsl_type(const glsl_type *array, unsigned length);
|
2010-03-31 22:37:42 +01:00
|
|
|
|
2010-03-31 00:58:19 +01:00
|
|
|
/** Hash table containing the known array types. */
|
|
|
|
static struct hash_table *array_types;
|
|
|
|
|
2010-06-28 19:54:57 +01:00
|
|
|
/** Hash table containing the known record types. */
|
|
|
|
static struct hash_table *record_types;
|
|
|
|
|
|
|
|
static int record_key_compare(const void *a, const void *b);
|
|
|
|
static unsigned record_key_hash(const void *key);
|
|
|
|
|
2010-06-28 19:01:57 +01:00
|
|
|
/**
|
|
|
|
* \name Pointers to various type singletons
|
|
|
|
*/
|
|
|
|
/*@{*/
|
|
|
|
static const glsl_type _error_type;
|
2010-12-13 19:19:38 +00:00
|
|
|
static const glsl_type _void_type;
|
2010-06-28 19:01:57 +01:00
|
|
|
static const glsl_type builtin_core_types[];
|
|
|
|
static const glsl_type builtin_structure_types[];
|
|
|
|
static const glsl_type builtin_110_deprecated_structure_types[];
|
2010-08-07 10:03:00 +01:00
|
|
|
static const glsl_type builtin_110_types[];
|
2010-06-28 19:01:57 +01:00
|
|
|
static const glsl_type builtin_120_types[];
|
|
|
|
static const glsl_type builtin_130_types[];
|
|
|
|
static const glsl_type builtin_ARB_texture_rectangle_types[];
|
|
|
|
static const glsl_type builtin_EXT_texture_array_types[];
|
|
|
|
static const glsl_type builtin_EXT_texture_buffer_object_types[];
|
|
|
|
/*@}*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \name Methods to populate a symbol table with built-in types.
|
|
|
|
*
|
|
|
|
* \internal
|
|
|
|
* This is one of the truely annoying things about C++. Methods that are
|
|
|
|
* completely internal and private to a type still have to be advertised to
|
|
|
|
* the world in a public header file.
|
|
|
|
*/
|
|
|
|
/*@{*/
|
2010-08-07 10:03:00 +01:00
|
|
|
static void generate_100ES_types(glsl_symbol_table *);
|
2010-08-14 15:35:57 +01:00
|
|
|
static void generate_110_types(glsl_symbol_table *);
|
|
|
|
static void generate_120_types(glsl_symbol_table *);
|
|
|
|
static void generate_130_types(glsl_symbol_table *);
|
2010-08-07 10:03:00 +01:00
|
|
|
static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool);
|
|
|
|
static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);
|
2010-06-28 21:17:18 +01:00
|
|
|
/*@}*/
|
|
|
|
|
2010-06-28 19:01:57 +01:00
|
|
|
/**
|
2010-06-28 21:17:18 +01:00
|
|
|
* \name Friend functions.
|
|
|
|
*
|
|
|
|
* These functions are friends because they must have C linkage and the
|
|
|
|
* need to call various private methods or access various private static
|
|
|
|
* data.
|
2010-06-28 19:01:57 +01:00
|
|
|
*/
|
2010-06-28 21:17:18 +01:00
|
|
|
/*@{*/
|
2010-06-28 19:01:57 +01:00
|
|
|
friend void _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *);
|
2010-06-28 21:17:18 +01:00
|
|
|
friend void _mesa_glsl_release_types(void);
|
2010-06-28 19:01:57 +01:00
|
|
|
/*@}*/
|
2010-03-09 23:58:52 +00:00
|
|
|
};
|
2010-02-22 21:19:34 +00:00
|
|
|
|
|
|
|
struct glsl_struct_field {
|
|
|
|
const struct glsl_type *type;
|
|
|
|
const char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GLSL_TYPES_H */
|