mesa: change gl_link_status enums to uppercase

follow the convention of other enums.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
This commit is contained in:
Brian Paul 2018-01-25 12:50:12 -07:00
parent aff5d9c256
commit bacf72a18d
18 changed files with 35 additions and 35 deletions

View File

@ -456,7 +456,7 @@ linker_error(gl_shader_program *prog, const char *fmt, ...)
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, ap);
va_end(ap);
prog->data->LinkStatus = linking_failure;
prog->data->LinkStatus = LINKING_FAILURE;
}
@ -2282,7 +2282,7 @@ link_intrastage_shaders(void *mem_ctx,
_mesa_shader_stage_to_program(shader_list[0]->Stage),
prog->Name, false);
if (!gl_prog) {
prog->data->LinkStatus = linking_failure;
prog->data->LinkStatus = LINKING_FAILURE;
_mesa_delete_linked_shader(ctx, linked);
return NULL;
}
@ -4748,7 +4748,7 @@ linker_optimisation_loop(struct gl_context *ctx, exec_list *ir,
void
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
{
prog->data->LinkStatus = linking_success; /* All error paths will set this to false */
prog->data->LinkStatus = LINKING_SUCCESS; /* All error paths will set this to false */
prog->data->Validated = false;
/* Section 7.3 (Program Objects) of the OpenGL 4.5 Core Profile spec says:

View File

@ -248,7 +248,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
}
/* This is used to flag a shader retrieved from cache */
prog->data->LinkStatus = linking_skipped;
prog->data->LinkStatus = LINKING_SKIPPED;
/* Since the program load was successful, CompileStatus of all shaders at
* this point should normally be compile_skipped. However because of how

View File

@ -520,7 +520,7 @@ standalone_compile_shader(const struct standalone_options *_options,
} else {
const gl_shader_stage stage = whole_program->Shaders[0]->Stage;
whole_program->data->LinkStatus = linking_success;
whole_program->data->LinkStatus = LINKING_SUCCESS;
whole_program->_LinkedShaders[stage] =
link_intrastage_shaders(whole_program /* mem_ctx */,
ctx,

View File

@ -62,7 +62,7 @@ brw_codegen_cs_prog(struct brw_context *brw,
memset(&prog_data, 0, sizeof(prog_data));
if (cp->program.info.cs.shared_size > 64 * 1024) {
cp->program.sh.data->LinkStatus = linking_failure;
cp->program.sh.data->LinkStatus = LINKING_FAILURE;
const char *error_str =
"Compute shader used more than 64KB of shared variables";
ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
@ -94,7 +94,7 @@ brw_codegen_cs_prog(struct brw_context *brw,
&prog_data, cp->program.nir, st_index,
&error_str);
if (program == NULL) {
cp->program.sh.data->LinkStatus = linking_failure;
cp->program.sh.data->LinkStatus = LINKING_FAILURE;
ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
_mesa_problem(NULL, "Failed to compile compute shader: %s\n", error_str);

View File

@ -263,7 +263,7 @@ brw_disk_cache_upload_program(struct brw_context *brw, gl_shader_stage stage)
if (brw->ctx._Shader->Flags & GLSL_CACHE_FALLBACK)
goto fail;
if (prog->sh.data->LinkStatus != linking_skipped)
if (prog->sh.data->LinkStatus != LINKING_SKIPPED)
goto fail;
if (!read_and_upload(brw, cache, prog, stage))

View File

@ -225,7 +225,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
unsigned int stage;
struct shader_info *infos[MESA_SHADER_STAGES] = { 0, };
if (shProg->data->LinkStatus == linking_skipped)
if (shProg->data->LinkStatus == LINKING_SKIPPED)
return GL_TRUE;
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {

View File

@ -232,7 +232,7 @@ brw_codegen_tcs_prog(struct brw_context *brw, struct brw_program *tcp,
&error_str);
if (program == NULL) {
if (tep) {
tep->program.sh.data->LinkStatus = linking_failure;
tep->program.sh.data->LinkStatus = LINKING_FAILURE;
ralloc_strcat(&tep->program.sh.data->InfoLog, error_str);
}

View File

@ -106,7 +106,7 @@ brw_codegen_tes_prog(struct brw_context *brw,
brw_compile_tes(compiler, brw, mem_ctx, key, &input_vue_map, &prog_data,
nir, &tep->program, st_index, &error_str);
if (program == NULL) {
tep->program.sh.data->LinkStatus = linking_failure;
tep->program.sh.data->LinkStatus = LINKING_FAILURE;
ralloc_strcat(&tep->program.sh.data->InfoLog, error_str);
_mesa_problem(NULL, "Failed to compile tessellation evaluation shader: "

View File

@ -224,7 +224,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
st_index, &error_str);
if (program == NULL) {
if (!vp->program.is_arb_asm) {
vp->program.sh.data->LinkStatus = linking_failure;
vp->program.sh.data->LinkStatus = LINKING_FAILURE;
ralloc_strcat(&vp->program.sh.data->InfoLog, error_str);
}

View File

@ -181,7 +181,7 @@ brw_codegen_wm_prog(struct brw_context *brw,
if (program == NULL) {
if (!fp->program.is_arb_asm) {
fp->program.sh.data->LinkStatus = linking_failure;
fp->program.sh.data->LinkStatus = LINKING_FAILURE;
ralloc_strcat(&fp->program.sh.data->InfoLog, error_str);
}

View File

@ -2603,7 +2603,7 @@ struct gl_linked_shader
/**
* Compile status enum. compile_skipped is used to indicate the compile
* Compile status enum. COMPILE_SKIPPED is used to indicate the compile
* was skipped due to the shader matching one that's been seen before by
* the on-disk cache.
*/
@ -2895,14 +2895,14 @@ struct gl_program_resource
};
/**
* Link status enum. linking_skipped is used to indicate linking
* Link status enum. LINKING_SKIPPED is used to indicate linking
* was skipped due to the shader being loaded from the on-disk cache.
*/
enum gl_link_status
{
linking_failure = 0,
linking_success,
linking_skipped
LINKING_FAILURE = 0,
LINKING_SUCCESS,
LINKING_SKIPPED
};
/**

View File

@ -275,7 +275,7 @@ _mesa_program_binary(struct gl_context *ctx, struct gl_shader_program *sh_prog,
binary, length);
if (payload == NULL) {
sh_prog->data->LinkStatus = linking_failure;
sh_prog->data->LinkStatus = LINKING_FAILURE;
return;
}
@ -283,9 +283,9 @@ _mesa_program_binary(struct gl_context *ctx, struct gl_shader_program *sh_prog,
blob_reader_init(&blob, payload, length - header_size);
if (!read_program_payload(ctx, &blob, binary_format, sh_prog)) {
sh_prog->data->LinkStatus = linking_failure;
sh_prog->data->LinkStatus = LINKING_FAILURE;
return;
}
sh_prog->data->LinkStatus = linking_success;
sh_prog->data->LinkStatus = LINKING_SUCCESS;
}

View File

@ -76,7 +76,7 @@ lookup_linked_program(GLuint program, const char *caller)
if (!prog)
return NULL;
if (prog->data->LinkStatus == linking_failure) {
if (prog->data->LinkStatus == LINKING_FAILURE) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(program not linked)",
caller);
return NULL;

View File

@ -870,7 +870,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
}
case GL_PROGRAM_SEPARABLE:
/* If the program has not been linked, return initial value 0. */
*params = (shProg->data->LinkStatus == linking_failure) ? 0 : shProg->SeparateShader;
*params = (shProg->data->LinkStatus == LINKING_FAILURE) ? 0 : shProg->SeparateShader;
return;
/* ARB_tessellation_shader */
@ -1252,7 +1252,7 @@ link_program(struct gl_context *ctx, struct gl_shader_program *shProg,
ralloc_free(filename);
}
if (shProg->data->LinkStatus == linking_failure &&
if (shProg->data->LinkStatus == LINKING_FAILURE &&
(ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
_mesa_debug(ctx, "Error linking program %u:\n%s\n",
shProg->Name, shProg->data->InfoLog);
@ -2304,7 +2304,7 @@ _mesa_ProgramBinary(GLuint program, GLenum binaryFormat,
* Since any value of binaryFormat passed "is not one of those specified as
* allowable for [this] command, an INVALID_ENUM error is generated."
*/
shProg->data->LinkStatus = linking_failure;
shProg->data->LinkStatus = LINKING_FAILURE;
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramBinary");
} else {
_mesa_program_binary(ctx, shProg, binaryFormat, binary, length);
@ -2521,7 +2521,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count,
/* Possibly... */
if (active-user-defined-varyings-in-linked-program) {
append-error-to-info-log;
shProg->data->LinkStatus = linking_failure;
shProg->data->LinkStatus = LINKING_FAILURE;
}
#endif
}

View File

@ -1016,7 +1016,7 @@ _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name)
* "If program has not been successfully linked, the error
* INVALID_OPERATION is generated."
*/
if (shProg->data->LinkStatus == linking_failure) {
if (shProg->data->LinkStatus == LINKING_FAILURE) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetUniformLocation(program not linked)");
return -1;

View File

@ -3088,7 +3088,7 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
prog->data = _mesa_create_shader_program_data();
prog->data->LinkStatus = linking_success;
prog->data->LinkStatus = LINKING_SUCCESS;
for (i = 0; i < prog->NumShaders; i++) {
if (!prog->Shaders[i]->CompileStatus) {
@ -3114,21 +3114,21 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
link_shaders(ctx, prog);
}
/* If LinkStatus is linking_success, then reset sampler validated to true.
/* If LinkStatus is LINKING_SUCCESS, then reset sampler validated to true.
* Validation happens via the LinkShader call below. If LinkStatus is
* linking_skipped, then SamplersValidated will have been restored from the
* LINKING_SKIPPED, then SamplersValidated will have been restored from the
* shader cache.
*/
if (prog->data->LinkStatus == linking_success) {
if (prog->data->LinkStatus == LINKING_SUCCESS) {
prog->SamplersValidated = GL_TRUE;
}
if (prog->data->LinkStatus && !ctx->Driver.LinkShader(ctx, prog)) {
prog->data->LinkStatus = linking_failure;
prog->data->LinkStatus = LINKING_FAILURE;
}
/* Return early if we are loading the shader from on-disk cache */
if (prog->data->LinkStatus == linking_skipped)
if (prog->data->LinkStatus == LINKING_SKIPPED)
return;
if (ctx->_Shader->Flags & GLSL_DUMP) {

View File

@ -363,7 +363,7 @@ fail_link(struct gl_shader_program *prog, const char *fmt, ...)
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, args);
va_end(args);
prog->data->LinkStatus = linking_failure;
prog->data->LinkStatus = LINKING_FAILURE;
}
int

View File

@ -289,7 +289,7 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx,
/* If we didn't load the GLSL metadata from cache then we could not have
* loaded the tgsi either.
*/
if (prog->data->LinkStatus != linking_skipped)
if (prog->data->LinkStatus != LINKING_SKIPPED)
return false;
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {