};
static void
-init_gl_program(struct gl_program *prog, bool is_arb_asm, GLenum target)
+init_gl_program(struct gl_program *prog, bool is_arb_asm, gl_shader_stage stage)
{
prog->RefCount = 1;
prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
prog->is_arb_asm = is_arb_asm;
- prog->info.stage = (gl_shader_stage)_mesa_program_enum_to_shader_stage(target);
+ prog->info.stage = stage;
}
static struct gl_program *
-new_program(UNUSED struct gl_context *ctx, GLenum target,
+new_program(UNUSED struct gl_context *ctx, gl_shader_stage stage,
UNUSED GLuint id, bool is_arb_asm)
{
- switch (target) {
- case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
- case GL_GEOMETRY_PROGRAM_NV:
- case GL_TESS_CONTROL_PROGRAM_NV:
- case GL_TESS_EVALUATION_PROGRAM_NV:
- case GL_FRAGMENT_PROGRAM_ARB:
- case GL_COMPUTE_PROGRAM_NV: {
- struct gl_program *prog = rzalloc(NULL, struct gl_program);
- init_gl_program(prog, is_arb_asm, target);
- return prog;
- }
- default:
- printf("bad target in new_program\n");
- return NULL;
- }
+ struct gl_program *prog = rzalloc(NULL, struct gl_program);
+ init_gl_program(prog, is_arb_asm, stage);
+ return prog;
}
static const struct standalone_options *options;
initialize_context(struct gl_context *ctx, gl_api api)
{
initialize_context_to_defaults(ctx, api);
- glsl_type_singleton_init_or_ref();
+ _mesa_glsl_builtin_functions_init_or_ref();
/* The standalone compiler needs to claim support for almost
* everything in order to compile the built-in functions.
initialize_context(ctx, options->glsl_version > 130 ? API_OPENGL_CORE : API_OPENGL_COMPAT);
}
+ if (options->lower_precision) {
+ for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) {
+ struct gl_shader_compiler_options *options =
+ &ctx->Const.ShaderCompilerOptions[i];
+ options->LowerPrecision = true;
+ }
+ }
+
struct gl_shader_program *whole_program;
whole_program = rzalloc (NULL, struct gl_shader_program);
delete whole_program->FragDataIndexBindings;
ralloc_free(whole_program);
- glsl_type_singleton_decref();
- _mesa_glsl_release_builtin_functions();
+ _mesa_glsl_builtin_functions_decref();
}