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: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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);
}
_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++)
/* 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;
/* _NEW_PROGRAM */
struct gl_shader_program *prog =
- ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY];
+ ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
if (!prog)
return;
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 */
_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),
}
}
- 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)
&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);
}
*/
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
&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);
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;
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 */
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);
{
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;
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;
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;
{
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 =
/* 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);
* 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 */
/* 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);
* 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
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) {
* 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);
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;
_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;
}
}
#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++) {
{
/* _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;
* 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;
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;
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;
}
*/
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);
*/
_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);
}
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);
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);
}
_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);
}
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;
/* 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;
}
/* debug code */
- if (ctx->Shader.Flags & GLSL_USE_PROG) {
+ if (ctx->_Shader->Flags & GLSL_USE_PROG) {
print_shader_info(shProg);
}
}
_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 */
_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);
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;
&& 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));
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);
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));
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 {
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;
{
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;
}
return;
}
- if (ctx->Shader.Flags & GLSL_UNIFORMS) {
+ if (ctx->_Shader->Flags & GLSL_UNIFORMS) {
log_uniform(values, basicType, components, 1, count,
false, shProg, location, uni);
}
}
}
- 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);
}
_mesa_Uniform1f(GLint location, GLfloat v0)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_FLOAT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_FLOAT);
}
void GLAPIENTRY
GLfloat v[2];
v[0] = v0;
v[1] = v1;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
}
void GLAPIENTRY
v[0] = v0;
v[1] = v1;
v[2] = v2;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
}
void GLAPIENTRY
v[1] = v1;
v[2] = v2;
v[3] = v3;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
}
void GLAPIENTRY
_mesa_Uniform1i(GLint location, GLint v0)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_INT);
}
void GLAPIENTRY
GLint v[2];
v[0] = v0;
v[1] = v1;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC2);
}
void GLAPIENTRY
v[0] = v0;
v[1] = v1;
v[2] = v2;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC3);
}
void GLAPIENTRY
v[1] = v1;
v[2] = v2;
v[3] = v3;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC4);
}
void GLAPIENTRY
_mesa_Uniform1fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT);
}
void GLAPIENTRY
_mesa_Uniform2fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC2);
}
void GLAPIENTRY
_mesa_Uniform3fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC3);
}
void GLAPIENTRY
_mesa_Uniform4fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC4);
}
void GLAPIENTRY
_mesa_Uniform1iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT);
}
void GLAPIENTRY
_mesa_Uniform2iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC2);
}
void GLAPIENTRY
_mesa_Uniform3iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC3);
}
void GLAPIENTRY
_mesa_Uniform4iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC4);
}
/** Same as above with direct state access **/
_mesa_Uniform1ui(GLint location, GLuint v0)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
}
void GLAPIENTRY
GLuint v[2];
v[0] = v0;
v[1] = v1;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
}
void GLAPIENTRY
v[0] = v0;
v[1] = v1;
v[2] = v2;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
}
void GLAPIENTRY
v[1] = v1;
v[2] = v2;
v[3] = v3;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
}
void GLAPIENTRY
_mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT);
}
void GLAPIENTRY
_mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
}
void GLAPIENTRY
_mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
}
void GLAPIENTRY
_mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
}
const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
2, 2, location, count, transpose, value);
}
const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
3, 3, location, count, transpose, value);
}
const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
4, 4, location, count, transpose, value);
}
const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
2, 3, location, count, transpose, value);
}
const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
3, 2, location, count, transpose, value);
}
const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
2, 4, location, count, transpose, value);
}
const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
4, 2, location, count, transpose, value);
}
const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
3, 4, location, count, transpose, value);
}
const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
4, 3, location, count, transpose, value);
}
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);
_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);
}
}
}
- 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);
}
/* 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;
}
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;
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;
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;
!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) {
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++) {
/* 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),
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++) {
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;
}