* DEALINGS IN THE SOFTWARE.
*/
+#include "glsl_parser_extras.h"
#include "ir.h"
#include "ir_uniform.h"
#include "linker.h"
struct gl_shader_program *prog)
{
STATIC_ASSERT(MESA_SHADER_TYPES == 3);
- static const char *shader_names[MESA_SHADER_TYPES] = {
- "vertex", "geometry", "fragment"
- };
const unsigned max_atomic_counters[MESA_SHADER_TYPES] = {
ctx->Const.VertexProgram.MaxAtomicCounters,
ctx->Const.GeometryProgram.MaxAtomicCounters,
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
if (atomic_counters[i] > max_atomic_counters[i])
linker_error(prog, "Too many %s shader atomic counters",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
if (atomic_buffers[i] > max_atomic_buffers[i])
linker_error(prog, "Too many %s shader atomic counter buffers",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
}
if (total_atomic_counters > ctx->Const.MaxCombinedAtomicCounters)
static void
check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
{
- static const char *const shader_names[MESA_SHADER_TYPES] = {
- "vertex", "geometry", "fragment"
- };
-
const unsigned max_samplers[MESA_SHADER_TYPES] = {
ctx->Const.VertexProgram.MaxTextureImageUnits,
ctx->Const.GeometryProgram.MaxTextureImageUnits,
if (sh->num_samplers > max_samplers[i]) {
linker_error(prog, "Too many %s shader texture samplers",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
}
if (sh->num_uniform_components > max_default_uniform_components[i]) {
"components, but the driver will try to optimize "
"them out; this is non-portable out-of-spec "
"behavior\n",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
} else {
linker_error(prog, "Too many %s shader default uniform block "
"components",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
}
}
linker_warning(prog, "Too many %s shader uniform components, "
"but the driver will try to optimize them out; "
"this is non-portable out-of-spec behavior\n",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
} else {
linker_error(prog, "Too many %s shader uniform components",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
}
}
}
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
if (blocks[i] > max_uniform_blocks[i]) {
linker_error(prog, "Too many %s uniform blocks (%d/%d)",
- shader_names[i],
+ _mesa_shader_type_to_string(i),
blocks[i],
max_uniform_blocks[i]);
break;