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:
parent
e5405e6400
commit
af19774dd4
|
@ -108,7 +108,6 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
|
||||||
uint max_tokens_out,
|
uint max_tokens_out,
|
||||||
struct tgsi_transform_context *ctx)
|
struct tgsi_transform_context *ctx)
|
||||||
{
|
{
|
||||||
uint procType;
|
|
||||||
boolean first_instruction = TRUE;
|
boolean first_instruction = TRUE;
|
||||||
boolean epilog_emitted = FALSE;
|
boolean epilog_emitted = FALSE;
|
||||||
int cond_stack = 0;
|
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");
|
debug_printf("tgsi_parse_init() failed in tgsi_transform_shader()!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
procType = parse.FullHeader.Processor.Processor;
|
ctx->processor = parse.FullHeader.Processor.Processor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** Setup output shader
|
** Setup output shader
|
||||||
|
@ -148,7 +147,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
|
||||||
*ctx->header = tgsi_build_header();
|
*ctx->header = tgsi_build_header();
|
||||||
|
|
||||||
processor = (struct tgsi_processor *) (tokens_out + 1);
|
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;
|
ctx->ti = 2;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#define TGSI_TRANSFORM_H
|
#define TGSI_TRANSFORM_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "pipe/p_defines.h"
|
||||||
#include "pipe/p_shader_tokens.h"
|
#include "pipe/p_shader_tokens.h"
|
||||||
#include "tgsi/tgsi_parse.h"
|
#include "tgsi/tgsi_parse.h"
|
||||||
#include "tgsi/tgsi_build.h"
|
#include "tgsi/tgsi_build.h"
|
||||||
|
@ -68,6 +69,7 @@ struct tgsi_transform_context
|
||||||
*/
|
*/
|
||||||
void (*epilog)(struct tgsi_transform_context *ctx);
|
void (*epilog)(struct tgsi_transform_context *ctx);
|
||||||
|
|
||||||
|
enum pipe_shader_type processor;
|
||||||
|
|
||||||
/*** PRIVATE ***/
|
/*** PRIVATE ***/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue