Commit c0347705 authored by Gregory Hainaut's avatar Gregory Hainaut Committed by Ian Romanick

mesa/sso: rename Shader to the pointer _Shader

Basically a sed but shaderapi.c and get.c.
get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior
shaderapi.c => the old api stil update the Shader object directly

V2: formatting improvement

V3 (idr):
* Rebase fixes after a block of code was moved from ir_to_mesa.cpp to
  shaderapi.c.
* Trivial reformatting.
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
parent b2bddaf7
......@@ -537,10 +537,10 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
for (i = 0; i < MESA_SHADER_STAGES; i++) {
_mesa_reference_shader_program(ctx, &save->Shader[i],
ctx->Shader.CurrentProgram[i]);
ctx->_Shader->CurrentProgram[i]);
}
_mesa_reference_shader_program(ctx, &save->ActiveShader,
ctx->Shader.ActiveProgram);
ctx->_Shader->ActiveProgram);
_mesa_UseProgram(0);
}
......@@ -893,7 +893,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_use_shader_program(ctx, GL_FRAGMENT_SHADER,
save->Shader[MESA_SHADER_FRAGMENT]);
_mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram,
_mesa_reference_shader_program(ctx, &ctx->_Shader->ActiveProgram,
save->ActiveShader);
for (i = 0; i < MESA_SHADER_STAGES; i++)
......
......@@ -187,7 +187,7 @@ static void populate_key(struct brw_context *brw,
/* BRW_NEW_TRANSFORM_FEEDBACK */
if (_mesa_is_xfb_active_and_unpaused(ctx)) {
const struct gl_shader_program *shaderprog =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
const struct gl_transform_feedback_info *linked_xfb_info =
&shaderprog->LinkedTransformFeedback;
int i;
......
......@@ -70,7 +70,7 @@ brw_upload_gs_ubo_surfaces(struct brw_context *brw)
/* _NEW_PROGRAM */
struct gl_shader_program *prog =
ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY];
ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
if (!prog)
return;
......@@ -95,7 +95,7 @@ brw_upload_gs_abo_surfaces(struct brw_context *brw)
struct gl_context *ctx = &brw->ctx;
/* _NEW_PROGRAM */
struct gl_shader_program *prog =
ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY];
ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
if (prog) {
/* CACHE_NEW_GS_PROG */
......
......@@ -248,7 +248,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
_mesa_reference_program(ctx, &prog, NULL);
if (ctx->Shader.Flags & GLSL_DUMP) {
if (ctx->_Shader->Flags & GLSL_DUMP) {
fprintf(stderr, "\n");
fprintf(stderr, "GLSL IR for linked %s program %d:\n",
_mesa_shader_stage_to_string(shader->base.Stage),
......@@ -258,7 +258,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
}
}
if ((ctx->Shader.Flags & GLSL_DUMP) && shProg->Name != 0) {
if ((ctx->_Shader->Flags & GLSL_DUMP) && shProg->Name != 0) {
for (unsigned i = 0; i < shProg->NumShaders; i++) {
const struct gl_shader *sh = shProg->Shaders[i];
if (!sh)
......
......@@ -306,7 +306,7 @@ brw_upload_gs_prog(struct brw_context *brw)
&key, sizeof(key),
&stage_state->prog_offset, &brw->gs.prog_data)) {
bool success =
do_gs_prog(brw, ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY], gp,
do_gs_prog(brw, ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY], gp,
&key);
assert(success);
}
......
......@@ -147,7 +147,7 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map,
*/
gl_clip_plane *brw_select_clip_planes(struct gl_context *ctx)
{
if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]) {
if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX]) {
/* There is currently a GLSL vertex shader, so clip according to GLSL
* rules, which means compare gl_ClipVertex (or gl_Position, if
* gl_ClipVertex wasn't assigned) against the eye-coordinate clip planes
......@@ -484,7 +484,7 @@ static void brw_upload_vs_prog(struct brw_context *brw)
&key, sizeof(key),
&brw->vs.base.prog_offset, &brw->vs.prog_data)) {
bool success =
do_vs_prog(brw, ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX], vp,
do_vs_prog(brw, ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX], vp,
&key);
(void) success;
assert(success);
......
......@@ -131,7 +131,7 @@ brw_upload_vs_ubo_surfaces(struct brw_context *brw)
struct gl_context *ctx = &brw->ctx;
/* _NEW_PROGRAM */
struct gl_shader_program *prog =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
if (!prog)
return;
......@@ -156,7 +156,7 @@ brw_upload_vs_abo_surfaces(struct brw_context *brw)
struct gl_context *ctx = &brw->ctx;
/* _NEW_PROGRAM */
struct gl_shader_program *prog =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
if (prog) {
/* CACHE_NEW_VS_PROG */
......
......@@ -579,7 +579,7 @@ brw_upload_wm_prog(struct brw_context *brw)
if (!brw_search_cache(&brw->cache, BRW_WM_PROG,
&key, sizeof(key),
&brw->wm.base.prog_offset, &brw->wm.prog_data)) {
bool success = do_wm_prog(brw, ctx->Shader._CurrentFragmentProgram, fp,
bool success = do_wm_prog(brw, ctx->_Shader->_CurrentFragmentProgram, fp,
&key);
(void) success;
assert(success);
......
......@@ -881,7 +881,7 @@ brw_upload_wm_ubo_surfaces(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
/* _NEW_PROGRAM */
struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram;
struct gl_shader_program *prog = ctx->_Shader->_CurrentFragmentProgram;
if (!prog)
return;
......
......@@ -43,7 +43,7 @@ gen6_update_sol_surfaces(struct brw_context *brw)
ctx->TransformFeedback.CurrentObject;
/* BRW_NEW_VERTEX_PROGRAM */
const struct gl_shader_program *shaderprog =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
const struct gl_transform_feedback_info *linked_xfb_info =
&shaderprog->LinkedTransformFeedback;
int i;
......@@ -89,7 +89,7 @@ brw_gs_upload_binding_table(struct brw_context *brw)
struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_VERTEX_PROGRAM */
const struct gl_shader_program *shaderprog =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
bool has_surfaces = false;
uint32_t *bind;
......@@ -175,7 +175,7 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
{
struct brw_context *brw = brw_context(ctx);
const struct gl_shader_program *vs_prog =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
const struct gl_transform_feedback_info *linked_xfb_info =
&vs_prog->LinkedTransformFeedback;
struct gl_transform_feedback_object *xfb_obj =
......
......@@ -158,7 +158,7 @@ upload_vs_state(struct brw_context *brw)
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
*/
if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] == NULL)
if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] == NULL)
floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
BEGIN_BATCH(6);
......
......@@ -140,7 +140,7 @@ upload_wm_state(struct brw_context *brw)
* rendering, CurrentProgram[MESA_SHADER_FRAGMENT] is used for this check
* to differentiate between the GLSL and non-GLSL cases.
*/
if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] == NULL)
if (ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT] == NULL)
dw2 |= GEN6_WM_FLOATING_POINT_MODE_ALT;
/* CACHE_NEW_SAMPLER */
......
......@@ -87,7 +87,7 @@ upload_vs_state(struct brw_context *brw)
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
*/
if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] == NULL)
if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] == NULL)
floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
BEGIN_BATCH(6);
......
......@@ -168,7 +168,7 @@ upload_ps_state(struct brw_context *brw)
* to differentiate between the GLSL and non-GLSL cases.
*/
/* BRW_NEW_FRAGMENT_PROGRAM */
if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] == NULL)
if (ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT] == NULL)
dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
/* Haswell requires the sample mask to be set in this packet as well as
......
......@@ -129,7 +129,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
case API_OPENGL_CORE:
{
const struct gl_shader_program *vsProg =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
GLboolean haveVertexShader = (vsProg && vsProg->LinkStatus);
GLboolean haveVertexProgram = ctx->VertexProgram._Enabled;
if (haveVertexShader || haveVertexProgram) {
......@@ -270,9 +270,9 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
* TRIANGLES_ADJACENCY_ARB or TRIANGLE_STRIP_ADJACENCY_ARB.
*
*/
if (ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]) {
if (ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY]) {
const GLenum geom_mode =
ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]->Geom.InputType;
ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY]->Geom.InputType;
switch (mode) {
case GL_POINTS:
valid_enum = (geom_mode == GL_POINTS);
......@@ -331,8 +331,8 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
if (_mesa_is_xfb_active_and_unpaused(ctx)) {
GLboolean pass = GL_TRUE;
if(ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]) {
switch (ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]->Geom.OutputType) {
if(ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY]) {
switch (ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY]->Geom.OutputType) {
case GL_POINTS:
pass = ctx->TransformFeedback.Mode == GL_POINTS;
break;
......
......@@ -1855,7 +1855,7 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
_mesa_update_state(ctx);
for (i = 0; i < MESA_SHADER_COMPUTE; i++) {
if (!shader_linked_or_absent(ctx, ctx->Shader.CurrentProgram[i],
if (!shader_linked_or_absent(ctx, ctx->_Shader->CurrentProgram[i],
&from_glsl_shader[i], where))
return GL_FALSE;
}
......@@ -1903,8 +1903,8 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
}
#ifdef DEBUG
if (ctx->Shader.Flags & GLSL_LOG) {
struct gl_shader_program **shProg = ctx->Shader.CurrentProgram;
if (ctx->_Shader->Flags & GLSL_LOG) {
struct gl_shader_program **shProg = ctx->_Shader->CurrentProgram;
gl_shader_stage i;
for (i = 0; i < MESA_SHADER_STAGES; i++) {
......
......@@ -317,9 +317,9 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
{
/* _NEW_PROGRAM */
const GLboolean vertexShader =
(ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] &&
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]->LinkStatus &&
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]->_LinkedShaders[MESA_SHADER_VERTEX]);
(ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] &&
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX]->LinkStatus &&
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX]->_LinkedShaders[MESA_SHADER_VERTEX]);
const GLboolean vertexProgram = ctx->VertexProgram._Enabled;
GLbitfield fp_inputs = 0x0;
......@@ -383,7 +383,7 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
* validation (see additional comments in state.c).
*/
if (vertexShader)
vprog = ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
vprog = ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX]->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
else
vprog = &ctx->VertexProgram.Current->Base;
......
......@@ -873,6 +873,18 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_int = ctx->TransformFeedback.CurrentObject->Name;
break;
case GL_CURRENT_PROGRAM:
/* The Changelog of the ARB_separate_shader_objects spec says:
*
* 24 25 Jul 2011 pbrown Remove the language erroneously deleting
* CURRENT_PROGRAM. In the EXT extension, this
* token was aliased to ACTIVE_PROGRAM_EXT, and
* was used to indicate the last program set by
* either ActiveProgramEXT or UseProgram. In
* the ARB extension, the SSO active programs
* are now program pipeline object state and
* CURRENT_PROGRAM should still be used to query
* the last program set by UseProgram (bug 7822).
*/
v->value_int =
ctx->Shader.ActiveProgram ? ctx->Shader.ActiveProgram->Name : 0;
break;
......
......@@ -468,8 +468,8 @@ static GLuint
get_handle(struct gl_context *ctx, GLenum pname)
{
if (pname == GL_PROGRAM_OBJECT_ARB) {
if (ctx->Shader.ActiveProgram)
return ctx->Shader.ActiveProgram->Name;
if (ctx->_Shader->ActiveProgram)
return ctx->_Shader->ActiveProgram->Name;
else
return 0;
}
......@@ -840,7 +840,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
*/
sh->CompileStatus = GL_FALSE;
} else {
if (ctx->Shader.Flags & GLSL_DUMP) {
if (ctx->_Shader->Flags & GLSL_DUMP) {
fprintf(stderr, "GLSL source for %s shader %d:\n",
_mesa_shader_stage_to_string(sh->Stage), sh->Name);
fprintf(stderr, "%s\n", sh->Source);
......@@ -852,11 +852,11 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
*/
_mesa_glsl_compile_shader(ctx, sh, false, false);
if (ctx->Shader.Flags & GLSL_LOG) {
if (ctx->_Shader->Flags & GLSL_LOG) {
_mesa_write_shader_to_file(sh);
}
if (ctx->Shader.Flags & GLSL_DUMP) {
if (ctx->_Shader->Flags & GLSL_DUMP) {
if (sh->CompileStatus) {
fprintf(stderr, "GLSL IR for shader %d:\n", sh->Name);
_mesa_print_ir(stderr, sh->ir, NULL);
......@@ -874,7 +874,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
}
if (!sh->CompileStatus) {
if (ctx->Shader.Flags & GLSL_DUMP_ON_ERROR) {
if (ctx->_Shader->Flags & GLSL_DUMP_ON_ERROR) {
fprintf(stderr, "GLSL source for %s shader %d:\n",
_mesa_shader_stage_to_string(sh->Stage), sh->Name);
fprintf(stderr, "%s\n", sh->Source);
......@@ -882,7 +882,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
fflush(stderr);
}
if (ctx->Shader.Flags & GLSL_REPORT_ERRORS) {
if (ctx->_Shader->Flags & GLSL_REPORT_ERRORS) {
_mesa_debug(ctx, "Error compiling shader %u:\n%s\n",
sh->Name, sh->InfoLog);
}
......@@ -918,7 +918,7 @@ link_program(struct gl_context *ctx, GLuint program)
_mesa_glsl_link_shader(ctx, shProg);
if (shProg->LinkStatus == GL_FALSE &&
(ctx->Shader.Flags & GLSL_REPORT_ERRORS)) {
(ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
_mesa_debug(ctx, "Error linking program %u:\n%s\n",
shProg->Name, shProg->InfoLog);
}
......@@ -994,7 +994,7 @@ use_shader_program(struct gl_context *ctx, GLenum type,
struct gl_shader_program **target;
gl_shader_stage stage = _mesa_shader_enum_to_shader_stage(type);
target = &ctx->Shader.CurrentProgram[stage];
target = &ctx->_Shader->CurrentProgram[stage];
if ((shProg == NULL) || (shProg->_LinkedShaders[stage] == NULL))
shProg = NULL;
......@@ -1016,9 +1016,9 @@ use_shader_program(struct gl_context *ctx, GLenum type,
/* Empty for now. */
break;
case GL_FRAGMENT_SHADER:
if (*target == ctx->Shader._CurrentFragmentProgram) {
if (*target == ctx->_Shader->_CurrentFragmentProgram) {
_mesa_reference_shader_program(ctx,
&ctx->Shader._CurrentFragmentProgram,
&ctx->_Shader->_CurrentFragmentProgram,
NULL);
}
break;
......@@ -1536,7 +1536,7 @@ _mesa_UseProgram(GLhandleARB program)
}
/* debug code */
if (ctx->Shader.Flags & GLSL_USE_PROG) {
if (ctx->_Shader->Flags & GLSL_USE_PROG) {
print_shader_info(shProg);
}
}
......@@ -1862,9 +1862,9 @@ _mesa_UseShaderProgramEXT(GLenum type, GLuint program)
_mesa_use_shader_program(ctx, type, shProg);
/* Nothing remains current */
if (!ctx->Shader.CurrentVertexProgram &&
!ctx->Shader.CurrentGeometryProgram &&
!ctx->Shader.CurrentFragmentProgram &&
if (!ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] &&
!ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY] &&
!ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] &&
!ctx->Shader.ActiveProgram) {
/* Unattach shader_state binding point */
......@@ -1910,8 +1910,10 @@ _mesa_ActiveProgramEXT(GLuint program)
_mesa_active_program(ctx, shProg, "glActiveProgramEXT");
/* Nothing remains current */
if (!ctx->Shader.CurrentVertexProgram && !ctx->Shader.CurrentGeometryProgram &&
!ctx->Shader.CurrentFragmentProgram && !ctx->Shader.ActiveProgram) {
if (!ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] &&
!ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY] &&
!ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] &&
!ctx->Shader.ActiveProgram) {
/* Unattach shader_state binding point */
_mesa_reference_pipeline_object(ctx, &ctx->_Shader, ctx->Pipeline.Default);
......
......@@ -95,11 +95,11 @@ static GLbitfield
update_program(struct gl_context *ctx)
{
const struct gl_shader_program *vsProg =
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
const struct gl_shader_program *gsProg =
ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY];
ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
struct gl_shader_program *fsProg =
ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT];
ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT];
const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current;
......@@ -125,7 +125,7 @@ update_program(struct gl_context *ctx)
&& fsProg->_LinkedShaders[MESA_SHADER_FRAGMENT]) {
/* Use GLSL fragment shader */
_mesa_reference_shader_program(ctx,
&ctx->Shader._CurrentFragmentProgram,
&ctx->_Shader->_CurrentFragmentProgram,
fsProg);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
gl_fragment_program(fsProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program));
......@@ -135,7 +135,7 @@ update_program(struct gl_context *ctx)
else if (ctx->FragmentProgram._Enabled) {
/* Use user-defined fragment program */
_mesa_reference_shader_program(ctx,
&ctx->Shader._CurrentFragmentProgram,
&ctx->_Shader->_CurrentFragmentProgram,
NULL);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
ctx->FragmentProgram.Current);
......@@ -147,7 +147,7 @@ update_program(struct gl_context *ctx)
struct gl_shader_program *f = _mesa_get_fixed_func_fragment_program(ctx);
_mesa_reference_shader_program(ctx,
&ctx->Shader._CurrentFragmentProgram,
&ctx->_Shader->_CurrentFragmentProgram,
f);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
gl_fragment_program(f->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program));
......@@ -310,7 +310,7 @@ update_multisample(struct gl_context *ctx)
static void
update_twoside(struct gl_context *ctx)
{
if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] ||
if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] ||
ctx->VertexProgram._Enabled) {
ctx->VertexProgram._TwoSideEnabled = ctx->VertexProgram.TwoSideEnabled;
} else {
......
......@@ -532,9 +532,9 @@ update_texture_state( struct gl_context *ctx )
int i;
for (i = 0; i < MESA_SHADER_STAGES; i++) {
if (ctx->Shader.CurrentProgram[i] &&
ctx->Shader.CurrentProgram[i]->LinkStatus) {
prog[i] = ctx->Shader.CurrentProgram[i]->_LinkedShaders[i]->Program;
if (ctx->_Shader->CurrentProgram[i] &&
ctx->_Shader->CurrentProgram[i]->LinkStatus) {
prog[i] = ctx->_Shader->CurrentProgram[i]->_LinkedShaders[i]->Program;
} else {
if (i == MESA_SHADER_FRAGMENT && ctx->FragmentProgram._Enabled)
prog[i] = &ctx->FragmentProgram.Current->Base;
......
......@@ -388,8 +388,8 @@ get_xfb_source(struct gl_context *ctx)
{
int i;
for (i = MESA_SHADER_GEOMETRY; i >= MESA_SHADER_VERTEX; i--) {
if (ctx->Shader.CurrentProgram[i] != NULL)
return ctx->Shader.CurrentProgram[i];
if (ctx->_Shader->CurrentProgram[i] != NULL)
return ctx->_Shader->CurrentProgram[i];
}
return NULL;
}
......
......@@ -698,7 +698,7 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
return;
}
if (ctx->Shader.Flags & GLSL_UNIFORMS) {
if (ctx->_Shader->Flags & GLSL_UNIFORMS) {
log_uniform(values, basicType, components, 1, count,
false, shProg, location, uni);
}
......@@ -920,7 +920,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
}
}
if (ctx->Shader.Flags & GLSL_UNIFORMS) {
if (ctx->_Shader->Flags & GLSL_UNIFORMS) {
log_uniform(values, GLSL_TYPE_FLOAT, components, vectors, count,
bool(transpose), shProg, location, uni);
}
......
This diff is collapsed.
......@@ -2917,7 +2917,7 @@ get_mesa_program(struct gl_context *ctx,
set_branchtargets(&v, mesa_instructions, num_instructions);
if (ctx->Shader.Flags & GLSL_DUMP) {
if (ctx->_Shader->Flags & GLSL_DUMP) {
fprintf(stderr, "\n");
fprintf(stderr, "GLSL IR for linked %s program %d:\n", target_string,
shader_program->Name);
......@@ -2953,7 +2953,7 @@ get_mesa_program(struct gl_context *ctx,
_mesa_reference_program(ctx, &shader->Program, prog);
if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
if ((ctx->_Shader->Flags & GLSL_NO_OPT) == 0) {
_mesa_optimize_program(ctx, prog);
}
......@@ -3096,7 +3096,7 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
}
}
if (ctx->Shader.Flags & GLSL_DUMP) {
if (ctx->_Shader->Flags & GLSL_DUMP) {
if (!prog->LinkStatus) {
fprintf(stderr, "GLSL shader program %d failed to link\n", prog->Name);
}
......
......@@ -52,7 +52,7 @@ static void update_clip( struct st_context *st )
/* if we have a vertex shader that writes clip vertex we need to pass
the pre-projection transformed coordinates into the driver. */
if (st->vp) {
if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX])
if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX])
use_eye = TRUE;
}
......
......@@ -219,7 +219,7 @@ static void st_bind_ubos(struct st_context *st,
static void bind_vs_ubos(struct st_context *st)
{
struct gl_shader_program *prog =
st->ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
st->ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
if (!prog)
return;
......@@ -239,7 +239,7 @@ const struct st_tracked_state st_bind_vs_ubos = {
static void bind_fs_ubos(struct st_context *st)
{
struct gl_shader_program *prog =
st->ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT];
st->ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT];
if (!prog)
return;
......@@ -259,7 +259,7 @@ const struct st_tracked_state st_bind_fs_ubos = {
static void bind_gs_ubos(struct st_context *st)
{
struct gl_shader_program *prog =
st->ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY];
st->ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
if (!prog)
return;
......
......@@ -1364,7 +1364,7 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
!ctx->Stencil.Enabled &&
!ctx->FragmentProgram.Enabled &&
!ctx->VertexProgram.Enabled &&
!ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] &&
!ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT] &&
ctx->DrawBuffer->_NumColorDrawBuffers == 1 &&
!ctx->Query.CondRenderQuery &&
!ctx->Query.CurrentOcclusionObject) {
......
......@@ -131,7 +131,7 @@ setup_index_buffer(struct st_context *st,
static void
check_uniforms(struct gl_context *ctx)
{
struct gl_shader_program **shProg = ctx->Shader.CurrentProgram;
struct gl_shader_program **shProg = ctx->_Shader->CurrentProgram;
unsigned j;
for (j = 0; j < 3; j++) {
......
......@@ -5198,7 +5198,7 @@ get_mesa_program(struct gl_context *ctx,
/* Write the END instruction. */
v->emit(NULL, TGSI_OPCODE_END);
if (ctx->Shader.Flags & GLSL_DUMP) {
if (ctx->_Shader->Flags & GLSL_DUMP) {
printf("\n");
printf("GLSL IR for linked %s program %d:\n",
_mesa_shader_stage_to_string(shader->Stage),
......
......@@ -1204,7 +1204,7 @@ st_get_gp_variant(struct st_context *st,
void
st_print_shaders(struct gl_context *ctx)
{
struct gl_shader_program **shProg = ctx->Shader.CurrentProgram;
struct gl_shader_program **shProg = ctx->_Shader->CurrentProgram;
unsigned j;
for (j = 0; j < 3; j++) {
......
......@@ -182,7 +182,7 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
machine->Samplers = program->Base.SamplerUnits;
/* if running a GLSL program (not ARB_fragment_program) */
if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT]) {
if (ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT]) {
/* Store front/back facing value */
machine->Attribs[VARYING_SLOT_FACE][col][0] = 1.0F - span->facing;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment