if (!state->error && !shader->ir->is_empty()) {
struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[shader->Stage];
+ &ctx->Const.ShaderCompilerOptions[shader->Stage];
/* Do some optimization at compile time to reduce shader IR size
* and reduce later work if the same shader is linked multiple times
* class must behave specially to account for the fact that gl_ClipDistance
* is converted from a float[8] to a vec4[2].
*/
- if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance &&
+ if (ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance &&
strcmp(this->var_name, "gl_ClipDistance") == 0) {
this->is_clip_distance_mesa = true;
}
if (!prog->LinkStatus)
goto done;
- if (ctx->ShaderCompilerOptions[i].LowerClipDistance) {
+ if (ctx->Const.ShaderCompilerOptions[i].LowerClipDistance) {
lower_clip_distance(prog->_LinkedShaders[i]);
}
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false,
- &ctx->ShaderCompilerOptions[i],
+ &ctx->Const.ShaderCompilerOptions[i],
ctx->Const.NativeIntegers))
;
}
options.DefaultPragmas.Optimize = true;
for (int sh = 0; sh < MESA_SHADER_STAGES; ++sh)
- memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options));
+ memcpy(&ctx->Const.ShaderCompilerOptions[sh], &options, sizeof(options));
}
if (!state->error) {
GLboolean progress;
const struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader_type)];
+ &ctx->Const.ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader_type)];
do {
progress = do_optimization_passes(shader->ir, &argv[optind],
argc - optind, quiet != 0, options);
/* FINISHME: Are there other options that should be enabled for software
* FINISHME: vertex shaders?
*/
- ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = true;
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = true;
struct gl_shader_compiler_options *const fs_options =
- & ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
+ & ctx->Const.ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
fs_options->MaxIfDepth = 0;
fs_options->EmitNoNoise = true;
fs_options->EmitNoPow = true;
/* We want the GLSL compiler to emit code that uses condition codes */
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
- ctx->ShaderCompilerOptions[i].MaxIfDepth = brw->gen < 6 ? 16 : UINT_MAX;
- ctx->ShaderCompilerOptions[i].EmitCondCodes = true;
- ctx->ShaderCompilerOptions[i].EmitNoNoise = true;
- ctx->ShaderCompilerOptions[i].EmitNoMainReturn = true;
- ctx->ShaderCompilerOptions[i].EmitNoIndirectInput = true;
- ctx->ShaderCompilerOptions[i].EmitNoIndirectOutput =
+ ctx->Const.ShaderCompilerOptions[i].MaxIfDepth = brw->gen < 6 ? 16 : UINT_MAX;
+ ctx->Const.ShaderCompilerOptions[i].EmitCondCodes = true;
+ ctx->Const.ShaderCompilerOptions[i].EmitNoNoise = true;
+ ctx->Const.ShaderCompilerOptions[i].EmitNoMainReturn = true;
+ ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectInput = true;
+ ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectOutput =
(i == MESA_SHADER_FRAGMENT);
- ctx->ShaderCompilerOptions[i].EmitNoIndirectTemp =
+ ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectTemp =
(i == MESA_SHADER_FRAGMENT);
- ctx->ShaderCompilerOptions[i].EmitNoIndirectUniform = false;
- ctx->ShaderCompilerOptions[i].LowerClipDistance = true;
+ ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectUniform = false;
+ ctx->Const.ShaderCompilerOptions[i].LowerClipDistance = true;
}
- ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;
- ctx->ShaderCompilerOptions[MESA_SHADER_GEOMETRY].OptimizeForAOS = true;
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_GEOMETRY].OptimizeForAOS = true;
/* ARB_viewport_array */
if (brw->gen >= 7 && ctx->API == API_OPENGL_CORE) {
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
const struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[stage];
+ &ctx->Const.ShaderCompilerOptions[stage];
struct brw_shader *shader =
(struct brw_shader *)shProg->_LinkedShaders[stage];
ctx->Const.MaxDrawBuffers = 1;
ctx->Const.MaxColorAttachments = 1;
- ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
/* Install the customized pipeline:
*/
ctx->Const.MaxColorAttachments = 1;
ctx->Const.MaxRenderbufferSize = 2048;
- ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;
/* Install the customized pipeline:
*/
validate_ir_tree(p.shader->ir);
const struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
+ &ctx->Const.ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
while (do_common_optimization(p.shader->ir, false, false, options,
ctx->Const.NativeIntegers))
return NULL;
create_new_program( &key, prog,
- ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS,
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS,
ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps );
#if 0
GLfloat MaxFragmentInterpolationOffset;
GLboolean FakeSWMSAA;
+
+ struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_STAGES];
};
*/
struct gl_pipeline_object *_Shader;
- struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_STAGES];
-
struct gl_query_state Query; /**< occlusion, timer queries */
struct gl_transform_feedback_state TransformFeedback;
options.DefaultPragmas.Optimize = GL_TRUE;
for (sh = 0; sh < MESA_SHADER_STAGES; ++sh)
- memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options));
+ memcpy(&ctx->Const.ShaderCompilerOptions[sh], &options, sizeof(options));
ctx->Shader.Flags = _mesa_get_shader_flags();
if (!sh)
return;
- options = &ctx->ShaderCompilerOptions[sh->Stage];
+ options = &ctx->Const.ShaderCompilerOptions[sh->Stage];
/* set default pragma state for shader */
sh->Pragmas = options->DefaultPragmas;
GLenum target = _mesa_shader_stage_to_program(shader->Stage);
const char *target_string = _mesa_shader_stage_to_string(shader->Stage);
struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[shader->Stage];
+ &ctx->Const.ShaderCompilerOptions[shader->Stage];
validate_ir_tree(shader->ir);
bool progress;
exec_list *ir = prog->_LinkedShaders[i]->ir;
const struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[prog->_LinkedShaders[i]->Stage];
+ &ctx->Const.ShaderCompilerOptions[prog->_LinkedShaders[i]->Stage];
do {
progress = false;
void
_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
{
- if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS)
+ if (ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS)
_mesa_insert_mvp_dp4_code( ctx, vprog );
else
_mesa_insert_mvp_mad_code( ctx, vprog );
* driver prefers DP4 or MUL/MAD for vertex transformation.
*/
if (debug_get_option_mesa_mvp_dp4())
- ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
+ ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
return st_create_context_priv(ctx, pipe, options);
}
switch (sh) {
case PIPE_SHADER_FRAGMENT:
pc = &c->Program[MESA_SHADER_FRAGMENT];
- options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
+ options = &c->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
break;
case PIPE_SHADER_VERTEX:
pc = &c->Program[MESA_SHADER_VERTEX];
- options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX];
+ options = &c->ShaderCompilerOptions[MESA_SHADER_VERTEX];
break;
case PIPE_SHADER_GEOMETRY:
pc = &c->Program[MESA_SHADER_GEOMETRY];
- options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_GEOMETRY];
+ options = &c->ShaderCompilerOptions[MESA_SHADER_GEOMETRY];
break;
default:
/* compute shader, etc. */
GLenum target = _mesa_shader_stage_to_program(shader->Stage);
bool progress;
struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader->Type)];
+ &ctx->Const.ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader->Type)];
struct pipe_screen *pscreen = ctx->st->pipe->screen;
unsigned ptarget = shader_stage_to_ptarget(shader->Stage);
bool progress;
exec_list *ir = prog->_LinkedShaders[i]->ir;
const struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(prog->_LinkedShaders[i]->Type)];
+ &ctx->Const.ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(prog->_LinkedShaders[i]->Type)];
/* If there are forms of indirect addressing that the driver
* cannot handle, perform the lowering pass.