tgsi_translate: Make the procType public when translating.

This means that tgsi_translate users can check the PIPE_SHADER stage
without having to separately tgsi_scan().

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
This commit is contained in:
Emma Anholt 2021-10-26 13:13:34 -07:00 committed by Marge Bot
parent e5405e6400
commit af19774dd4
2 changed files with 4 additions and 3 deletions

View File

@ -108,7 +108,6 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
uint max_tokens_out,
struct tgsi_transform_context *ctx)
{
uint procType;
boolean first_instruction = TRUE;
boolean epilog_emitted = FALSE;
int cond_stack = 0;
@ -139,7 +138,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
debug_printf("tgsi_parse_init() failed in tgsi_transform_shader()!\n");
return -1;
}
procType = parse.FullHeader.Processor.Processor;
ctx->processor = parse.FullHeader.Processor.Processor;
/**
** Setup output shader
@ -148,7 +147,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
*ctx->header = tgsi_build_header();
processor = (struct tgsi_processor *) (tokens_out + 1);
*processor = tgsi_build_processor( procType, ctx->header );
*processor = tgsi_build_processor( ctx->processor, ctx->header );
ctx->ti = 2;

View File

@ -29,6 +29,7 @@
#define TGSI_TRANSFORM_H
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_build.h"
@ -68,6 +69,7 @@ struct tgsi_transform_context
*/
void (*epilog)(struct tgsi_transform_context *ctx);
enum pipe_shader_type processor;
/*** PRIVATE ***/