[Mesa-dev] [PATCH 2/3] st/mesa: set TGSI property NEXT_SHADER
Grazvydas Ignotas
notasas at gmail.com
Fri Mar 11 18:11:23 UTC 2016
On Thu, Mar 10, 2016 at 7:36 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 35 ++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 26e463e..27c8a47 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -6306,6 +6306,41 @@ st_translate_program(
> t->insn[t->labels[i].branch_target]);
> }
>
> + /* Set the next shader stage hint for VS and TES. */
> + switch (procType) {
> + case TGSI_PROCESSOR_VERTEX:
> + case TGSI_PROCESSOR_TESS_EVAL:
> + if (program->shader_program->SeparateShader)
> + break;
> +
> + for (i = program->shader->Stage+1; i <= MESA_SHADER_FRAGMENT; i++) {
> + if (program->shader_program->_LinkedShaders[i]) {
> + unsigned next;
> +
> + switch (i) {
> + case MESA_SHADER_TESS_CTRL:
> + next = TGSI_PROCESSOR_TESS_CTRL;
> + break;
> + case MESA_SHADER_TESS_EVAL:
> + next = TGSI_PROCESSOR_TESS_EVAL;
> + break;
> + case MESA_SHADER_GEOMETRY:
> + next = TGSI_PROCESSOR_GEOMETRY;
> + break;
> + case MESA_SHADER_FRAGMENT:
> + next = TGSI_PROCESSOR_FRAGMENT;
> + break;
> + default:
> + assert(0);
This introduces a warning in release build:
warning: ‘next’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
I think you should use unreachable() here.
Gražvydas
More information about the mesa-dev
mailing list