tgsi: Remove tgsi_version token.

This commit is contained in:
Michal Krol 2009-11-27 10:06:41 +01:00
parent 5455e88f1c
commit e6133564bf
11 changed files with 18 additions and 72 deletions

View file

@ -30,21 +30,6 @@
#include "tgsi_build.h"
#include "tgsi_parse.h"
/*
* version
*/
struct tgsi_version
tgsi_build_version( void )
{
struct tgsi_version version;
version.Major = 1;
version.Minor = 1;
version.Padding = 0;
return version;
}
/*
* header

View file

@ -36,12 +36,6 @@ struct tgsi_token;
extern "C" {
#endif
/*
* version
*/
struct tgsi_version
tgsi_build_version( void );
/*
* header

View file

@ -477,9 +477,6 @@ prolog(
{
struct dump_ctx *ctx = (struct dump_ctx *) iter;
ENM( iter->processor.Processor, processor_type_names );
UID( iter->version.Major );
CHR( '.' );
UID( iter->version.Minor );
EOL();
return TRUE;
}

View file

@ -405,12 +405,6 @@ tgsi_dump_c(
TXT( "tgsi-dump begin -----------------" );
TXT( "\nMajor: " );
UID( parse.FullVersion.Version.Major );
TXT( "\nMinor: " );
UID( parse.FullVersion.Version.Minor );
EOL();
TXT( "\nHeaderSize: " );
UID( parse.FullHeader.Header.HeaderSize );
TXT( "\nBodySize : " );

View file

@ -39,7 +39,6 @@ tgsi_iterate_shader(
return FALSE;
ctx->processor = parse.FullHeader.Processor;
ctx->version = parse.FullVersion.Version;
if (ctx->prolog)
if (!ctx->prolog( ctx ))

View file

@ -61,7 +61,6 @@ struct tgsi_iterate_context
struct tgsi_iterate_context *ctx );
struct tgsi_processor processor;
struct tgsi_version version;
};
boolean

View file

@ -35,21 +35,16 @@ tgsi_parse_init(
struct tgsi_parse_context *ctx,
const struct tgsi_token *tokens )
{
ctx->FullVersion.Version = *(struct tgsi_version *) &tokens[0];
if( ctx->FullVersion.Version.Major > 1 ) {
return TGSI_PARSE_ERROR;
}
ctx->FullHeader.Header = *(struct tgsi_header *) &tokens[1];
ctx->FullHeader.Header = *(struct tgsi_header *) &tokens[0];
if( ctx->FullHeader.Header.HeaderSize >= 2 ) {
ctx->FullHeader.Processor = *(struct tgsi_processor *) &tokens[2];
ctx->FullHeader.Processor = *(struct tgsi_processor *) &tokens[1];
}
else {
return TGSI_PARSE_ERROR;
}
ctx->Tokens = tokens;
ctx->Position = 1 + ctx->FullHeader.Header.HeaderSize;
ctx->Position = ctx->FullHeader.Header.HeaderSize;
return TGSI_PARSE_OK;
}

View file

@ -34,11 +34,6 @@
extern "C" {
#endif
struct tgsi_full_version
{
struct tgsi_version Version;
};
struct tgsi_full_header
{
struct tgsi_header Header;
@ -97,7 +92,6 @@ struct tgsi_parse_context
{
const struct tgsi_token *Tokens;
unsigned Position;
struct tgsi_full_version FullVersion;
struct tgsi_full_header FullHeader;
union tgsi_full_token FullToken;
};

View file

@ -172,29 +172,25 @@ static void report_error( struct translate_ctx *ctx, const char *msg )
/* Parse shader header.
* Return TRUE for one of the following headers.
* FRAG1.1
* GEOM1.1
* VERT1.1
* FRAG
* GEOM
* VERT
*/
static boolean parse_header( struct translate_ctx *ctx )
{
uint processor;
if (str_match_no_case( &ctx->cur, "FRAG1.1" ))
if (str_match_no_case( &ctx->cur, "FRAG" ))
processor = TGSI_PROCESSOR_FRAGMENT;
else if (str_match_no_case( &ctx->cur, "VERT1.1" ))
else if (str_match_no_case( &ctx->cur, "VERT" ))
processor = TGSI_PROCESSOR_VERTEX;
else if (str_match_no_case( &ctx->cur, "GEOM1.1" ))
else if (str_match_no_case( &ctx->cur, "GEOM" ))
processor = TGSI_PROCESSOR_GEOMETRY;
else {
report_error( ctx, "Unknown header" );
return FALSE;
}
if (ctx->tokens_cur >= ctx->tokens_end)
return FALSE;
*(struct tgsi_version *) ctx->tokens_cur++ = tgsi_build_version();
if (ctx->tokens_cur >= ctx->tokens_end)
return FALSE;
ctx->header = (struct tgsi_header *) ctx->tokens_cur++;

View file

@ -130,15 +130,13 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
/**
** Setup output shader
**/
*(struct tgsi_version *) &tokens_out[0] = tgsi_build_version();
ctx->header = (struct tgsi_header *) (tokens_out + 1);
ctx->header = (struct tgsi_header *)tokens_out;
*ctx->header = tgsi_build_header();
processor = (struct tgsi_processor *) (tokens_out + 2);
processor = (struct tgsi_processor *) (tokens_out + 1);
*processor = tgsi_build_processor( procType, ctx->header );
ctx->ti = 3;
ctx->ti = 2;
/**
@ -215,7 +213,7 @@ tgsi_transform_foo( struct tgsi_token *tokens_out,
uint max_tokens_out )
{
const char *text =
"FRAG1.1\n"
"FRAG\n"
"DCL IN[0], COLOR, CONSTANT\n"
"DCL OUT[0], COLOR\n"
" 0: MOV OUT[0], IN[0]\n"

View file

@ -37,7 +37,6 @@
#include "util/u_math.h"
union tgsi_any_token {
struct tgsi_version version;
struct tgsi_header header;
struct tgsi_processor processor;
struct tgsi_token token;
@ -1062,17 +1061,13 @@ fixup_header_size(struct ureg_program *ureg)
static void
emit_header( struct ureg_program *ureg )
{
union tgsi_any_token *out = get_tokens( ureg, DOMAIN_DECL, 3 );
union tgsi_any_token *out = get_tokens( ureg, DOMAIN_DECL, 2 );
out[0].version.Major = 1;
out[0].version.Minor = 1;
out[0].version.Padding = 0;
out[0].header.HeaderSize = 2;
out[0].header.BodySize = 0;
out[1].header.HeaderSize = 2;
out[1].header.BodySize = 0;
out[2].processor.Processor = ureg->processor;
out[2].processor.Padding = 0;
out[1].processor.Processor = ureg->processor;
out[1].processor.Padding = 0;
}