follow the convention of other enums.
Reviewed-by: Neha Bhende <bhenden@vmware.com>
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, ap);
va_end(ap);
- prog->data->LinkStatus = linking_failure;
+ prog->data->LinkStatus = LINKING_FAILURE;
}
_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;
}
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:
}
/* 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
} 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,
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);
&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);
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))
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++) {
&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);
}
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: "
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);
}
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);
}
/**
- * 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.
*/
};
/**
- * 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
};
/**
binary, length);
if (payload == NULL) {
- sh_prog->data->LinkStatus = linking_failure;
+ sh_prog->data->LinkStatus = LINKING_FAILURE;
return;
}
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;
}
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;
}
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 */
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);
* 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);
/* 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
}
* "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;
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) {
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) {
ralloc_vasprintf_append(&prog->data->InfoLog, fmt, args);
va_end(args);
- prog->data->LinkStatus = linking_failure;
+ prog->data->LinkStatus = LINKING_FAILURE;
}
int
/* 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++) {