2 * Mesa 3-D graphics library
5 * Copyright (C) 2006 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #if !defined SLANG_EXPORT_H
26 #define SLANG_EXPORT_H
28 #include "slang_utility.h"
30 #if defined __cplusplus
35 * Basic data quantity to transfer between application and assembly.
36 * The <size> is the actual size of the data quantity including padding, if any. It is
37 * used to calculate offsets from the beginning of the data.
38 * The <array_len> is not 0, the data quantity is an array of <array_len> size.
39 * If the <structure> is not NULL, the data quantity is a struct. The <basic_type> is
40 * invalid and the <field_count> holds the size of the <structure> array.
41 * The <basic_type> values match those of <type> parameter for glGetActiveUniformARB.
44 typedef struct slang_export_data_quant_
49 struct slang_export_data_quant_
*structure
;
55 } slang_export_data_quant
;
57 GLvoid
slang_export_data_quant_ctr (slang_export_data_quant
*);
58 GLvoid
slang_export_data_quant_dtr (slang_export_data_quant
*);
59 slang_export_data_quant
*slang_export_data_quant_add_field (slang_export_data_quant
*);
62 * Data access pattern. Specifies how data is accessed at what frequency.
70 } slang_export_data_access
;
73 * Data export entry. Holds the data type information, access pattern and base address.
78 slang_export_data_quant quant
;
79 slang_export_data_access access
;
81 } slang_export_data_entry
;
83 GLvoid
slang_export_data_entry_ctr (slang_export_data_entry
*);
84 GLvoid
slang_export_data_entry_dtr (slang_export_data_entry
*);
92 slang_export_data_entry
*entries
;
94 slang_atom_pool
*atoms
;
95 } slang_export_data_table
;
97 GLvoid
slang_export_data_table_ctr (slang_export_data_table
*);
98 GLvoid
slang_export_data_table_dtr (slang_export_data_table
*);
99 slang_export_data_entry
*slang_export_data_table_add (slang_export_data_table
*);
102 * Code export entry. Contains label name and its entry point (label, address).
109 } slang_export_code_entry
;
117 slang_export_code_entry
*entries
;
119 slang_atom_pool
*atoms
;
120 } slang_export_code_table
;
122 GLvoid
slang_export_code_table_ctr (slang_export_code_table
*);
123 GLvoid
slang_export_code_table_dtr (slang_export_code_table
*);
124 slang_export_code_entry
*slang_export_code_table_add (slang_export_code_table
*);
127 * _slang_find_exported_data()
129 * Parses the name string and returns corresponding data entry, data quantity and offset.
130 * Returns GL_TRUE if the data is found, returns GL_FALSE otherwise.
133 GLboolean
_slang_find_exported_data (slang_export_data_table
*, const char *,
134 slang_export_data_entry
**, slang_export_data_quant
**, GLuint
*);