Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / gallium / drivers / i965simple / brw_shader_info.c
1
2 #include "brw_context.h"
3 #include "brw_state.h"
4 #include "util/u_memory.h"
5 #include "pipe/p_shader_tokens.h"
6 #include "tgsi/tgsi_parse.h"
7
8
9 /**
10 * XXX this obsolete new and no longer compiled.
11 */
12 void brw_shader_info(const struct tgsi_token *tokens,
13 struct brw_shader_info *info )
14 {
15 struct tgsi_parse_context parse;
16 int done = 0;
17
18 tgsi_parse_init( &parse, tokens );
19
20 while( !done &&
21 !tgsi_parse_end_of_tokens( &parse ) )
22 {
23 tgsi_parse_token( &parse );
24
25 switch( parse.FullToken.Token.Type ) {
26 case TGSI_TOKEN_TYPE_DECLARATION:
27 {
28 const struct tgsi_full_declaration *decl = &parse.FullToken.FullDeclaration;
29 unsigned last = decl->DeclarationRange.Last;
30
31 // Broken by crazy wpos init:
32 //assert( info->nr_regs[decl->Declaration.File] <= last);
33
34 info->nr_regs[decl->Declaration.File] = MAX2(info->nr_regs[decl->Declaration.File],
35 last+1);
36 break;
37 }
38 case TGSI_TOKEN_TYPE_IMMEDIATE:
39 case TGSI_TOKEN_TYPE_INSTRUCTION:
40 default:
41 done = 1;
42 break;
43 }
44 }
45
46 tgsi_parse_free (&parse);
47
48 }