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:
@@ -456,7 +456,7 @@ linker_error(gl_shader_program *prog, const char *fmt, ...)
|
|||||||
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, ap);
|
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, ap);
|
||||||
va_end(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),
|
_mesa_shader_stage_to_program(shader_list[0]->Stage),
|
||||||
prog->Name, false);
|
prog->Name, false);
|
||||||
if (!gl_prog) {
|
if (!gl_prog) {
|
||||||
prog->data->LinkStatus = linking_failure;
|
prog->data->LinkStatus = LINKING_FAILURE;
|
||||||
_mesa_delete_linked_shader(ctx, linked);
|
_mesa_delete_linked_shader(ctx, linked);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -4748,7 +4748,7 @@ linker_optimisation_loop(struct gl_context *ctx, exec_list *ir,
|
|||||||
void
|
void
|
||||||
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
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;
|
prog->data->Validated = false;
|
||||||
|
|
||||||
/* Section 7.3 (Program Objects) of the OpenGL 4.5 Core Profile spec says:
|
/* Section 7.3 (Program Objects) of the OpenGL 4.5 Core Profile spec says:
|
||||||
|
@@ -248,7 +248,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This is used to flag a shader retrieved from cache */
|
/* 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
|
/* Since the program load was successful, CompileStatus of all shaders at
|
||||||
* this point should normally be compile_skipped. However because of how
|
* this point should normally be compile_skipped. However because of how
|
||||||
|
@@ -520,7 +520,7 @@ standalone_compile_shader(const struct standalone_options *_options,
|
|||||||
} else {
|
} else {
|
||||||
const gl_shader_stage stage = whole_program->Shaders[0]->Stage;
|
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] =
|
whole_program->_LinkedShaders[stage] =
|
||||||
link_intrastage_shaders(whole_program /* mem_ctx */,
|
link_intrastage_shaders(whole_program /* mem_ctx */,
|
||||||
ctx,
|
ctx,
|
||||||
|
@@ -62,7 +62,7 @@ brw_codegen_cs_prog(struct brw_context *brw,
|
|||||||
memset(&prog_data, 0, sizeof(prog_data));
|
memset(&prog_data, 0, sizeof(prog_data));
|
||||||
|
|
||||||
if (cp->program.info.cs.shared_size > 64 * 1024) {
|
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 =
|
const char *error_str =
|
||||||
"Compute shader used more than 64KB of shared variables";
|
"Compute shader used more than 64KB of shared variables";
|
||||||
ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
|
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,
|
&prog_data, cp->program.nir, st_index,
|
||||||
&error_str);
|
&error_str);
|
||||||
if (program == NULL) {
|
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);
|
ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
|
||||||
_mesa_problem(NULL, "Failed to compile compute shader: %s\n", error_str);
|
_mesa_problem(NULL, "Failed to compile compute shader: %s\n", error_str);
|
||||||
|
|
||||||
|
@@ -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)
|
if (brw->ctx._Shader->Flags & GLSL_CACHE_FALLBACK)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (prog->sh.data->LinkStatus != linking_skipped)
|
if (prog->sh.data->LinkStatus != LINKING_SKIPPED)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!read_and_upload(brw, cache, prog, stage))
|
if (!read_and_upload(brw, cache, prog, stage))
|
||||||
|
@@ -225,7 +225,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
|
|||||||
unsigned int stage;
|
unsigned int stage;
|
||||||
struct shader_info *infos[MESA_SHADER_STAGES] = { 0, };
|
struct shader_info *infos[MESA_SHADER_STAGES] = { 0, };
|
||||||
|
|
||||||
if (shProg->data->LinkStatus == linking_skipped)
|
if (shProg->data->LinkStatus == LINKING_SKIPPED)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
||||||
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
|
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
|
||||||
|
@@ -232,7 +232,7 @@ brw_codegen_tcs_prog(struct brw_context *brw, struct brw_program *tcp,
|
|||||||
&error_str);
|
&error_str);
|
||||||
if (program == NULL) {
|
if (program == NULL) {
|
||||||
if (tep) {
|
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);
|
ralloc_strcat(&tep->program.sh.data->InfoLog, error_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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,
|
brw_compile_tes(compiler, brw, mem_ctx, key, &input_vue_map, &prog_data,
|
||||||
nir, &tep->program, st_index, &error_str);
|
nir, &tep->program, st_index, &error_str);
|
||||||
if (program == NULL) {
|
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);
|
ralloc_strcat(&tep->program.sh.data->InfoLog, error_str);
|
||||||
|
|
||||||
_mesa_problem(NULL, "Failed to compile tessellation evaluation shader: "
|
_mesa_problem(NULL, "Failed to compile tessellation evaluation shader: "
|
||||||
|
@@ -224,7 +224,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
|
|||||||
st_index, &error_str);
|
st_index, &error_str);
|
||||||
if (program == NULL) {
|
if (program == NULL) {
|
||||||
if (!vp->program.is_arb_asm) {
|
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);
|
ralloc_strcat(&vp->program.sh.data->InfoLog, error_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ brw_codegen_wm_prog(struct brw_context *brw,
|
|||||||
|
|
||||||
if (program == NULL) {
|
if (program == NULL) {
|
||||||
if (!fp->program.is_arb_asm) {
|
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);
|
ralloc_strcat(&fp->program.sh.data->InfoLog, error_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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
|
* was skipped due to the shader matching one that's been seen before by
|
||||||
* the on-disk cache.
|
* 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.
|
* was skipped due to the shader being loaded from the on-disk cache.
|
||||||
*/
|
*/
|
||||||
enum gl_link_status
|
enum gl_link_status
|
||||||
{
|
{
|
||||||
linking_failure = 0,
|
LINKING_FAILURE = 0,
|
||||||
linking_success,
|
LINKING_SUCCESS,
|
||||||
linking_skipped
|
LINKING_SKIPPED
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -275,7 +275,7 @@ _mesa_program_binary(struct gl_context *ctx, struct gl_shader_program *sh_prog,
|
|||||||
binary, length);
|
binary, length);
|
||||||
|
|
||||||
if (payload == NULL) {
|
if (payload == NULL) {
|
||||||
sh_prog->data->LinkStatus = linking_failure;
|
sh_prog->data->LinkStatus = LINKING_FAILURE;
|
||||||
return;
|
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);
|
blob_reader_init(&blob, payload, length - header_size);
|
||||||
|
|
||||||
if (!read_program_payload(ctx, &blob, binary_format, sh_prog)) {
|
if (!read_program_payload(ctx, &blob, binary_format, sh_prog)) {
|
||||||
sh_prog->data->LinkStatus = linking_failure;
|
sh_prog->data->LinkStatus = LINKING_FAILURE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sh_prog->data->LinkStatus = linking_success;
|
sh_prog->data->LinkStatus = LINKING_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -76,7 +76,7 @@ lookup_linked_program(GLuint program, const char *caller)
|
|||||||
if (!prog)
|
if (!prog)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (prog->data->LinkStatus == linking_failure) {
|
if (prog->data->LinkStatus == LINKING_FAILURE) {
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(program not linked)",
|
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(program not linked)",
|
||||||
caller);
|
caller);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -870,7 +870,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
|
|||||||
}
|
}
|
||||||
case GL_PROGRAM_SEPARABLE:
|
case GL_PROGRAM_SEPARABLE:
|
||||||
/* If the program has not been linked, return initial value 0. */
|
/* 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;
|
return;
|
||||||
|
|
||||||
/* ARB_tessellation_shader */
|
/* ARB_tessellation_shader */
|
||||||
@@ -1252,7 +1252,7 @@ link_program(struct gl_context *ctx, struct gl_shader_program *shProg,
|
|||||||
ralloc_free(filename);
|
ralloc_free(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shProg->data->LinkStatus == linking_failure &&
|
if (shProg->data->LinkStatus == LINKING_FAILURE &&
|
||||||
(ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
|
(ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
|
||||||
_mesa_debug(ctx, "Error linking program %u:\n%s\n",
|
_mesa_debug(ctx, "Error linking program %u:\n%s\n",
|
||||||
shProg->Name, shProg->data->InfoLog);
|
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
|
* Since any value of binaryFormat passed "is not one of those specified as
|
||||||
* allowable for [this] command, an INVALID_ENUM error is generated."
|
* 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");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramBinary");
|
||||||
} else {
|
} else {
|
||||||
_mesa_program_binary(ctx, shProg, binaryFormat, binary, length);
|
_mesa_program_binary(ctx, shProg, binaryFormat, binary, length);
|
||||||
@@ -2521,7 +2521,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count,
|
|||||||
/* Possibly... */
|
/* Possibly... */
|
||||||
if (active-user-defined-varyings-in-linked-program) {
|
if (active-user-defined-varyings-in-linked-program) {
|
||||||
append-error-to-info-log;
|
append-error-to-info-log;
|
||||||
shProg->data->LinkStatus = linking_failure;
|
shProg->data->LinkStatus = LINKING_FAILURE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -1016,7 +1016,7 @@ _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name)
|
|||||||
* "If program has not been successfully linked, the error
|
* "If program has not been successfully linked, the error
|
||||||
* INVALID_OPERATION is generated."
|
* INVALID_OPERATION is generated."
|
||||||
*/
|
*/
|
||||||
if (shProg->data->LinkStatus == linking_failure) {
|
if (shProg->data->LinkStatus == LINKING_FAILURE) {
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||||
"glGetUniformLocation(program not linked)");
|
"glGetUniformLocation(program not linked)");
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -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 = _mesa_create_shader_program_data();
|
||||||
|
|
||||||
prog->data->LinkStatus = linking_success;
|
prog->data->LinkStatus = LINKING_SUCCESS;
|
||||||
|
|
||||||
for (i = 0; i < prog->NumShaders; i++) {
|
for (i = 0; i < prog->NumShaders; i++) {
|
||||||
if (!prog->Shaders[i]->CompileStatus) {
|
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);
|
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
|
* 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.
|
* shader cache.
|
||||||
*/
|
*/
|
||||||
if (prog->data->LinkStatus == linking_success) {
|
if (prog->data->LinkStatus == LINKING_SUCCESS) {
|
||||||
prog->SamplersValidated = GL_TRUE;
|
prog->SamplersValidated = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prog->data->LinkStatus && !ctx->Driver.LinkShader(ctx, prog)) {
|
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 */
|
/* 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;
|
return;
|
||||||
|
|
||||||
if (ctx->_Shader->Flags & GLSL_DUMP) {
|
if (ctx->_Shader->Flags & GLSL_DUMP) {
|
||||||
|
@@ -363,7 +363,7 @@ fail_link(struct gl_shader_program *prog, const char *fmt, ...)
|
|||||||
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, args);
|
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
prog->data->LinkStatus = linking_failure;
|
prog->data->LinkStatus = LINKING_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@@ -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
|
/* If we didn't load the GLSL metadata from cache then we could not have
|
||||||
* loaded the tgsi either.
|
* loaded the tgsi either.
|
||||||
*/
|
*/
|
||||||
if (prog->data->LinkStatus != linking_skipped)
|
if (prog->data->LinkStatus != LINKING_SKIPPED)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
|
Reference in New Issue
Block a user