summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i965simple/brw_shader_info.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-12-13 20:38:56 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2007-12-13 20:39:31 +0000
commit568fcf64c774f5f8e9f65bb86c121f5d550b1632 (patch)
tree60bac5b746779a1e85d52853a71545e2864ee30a /src/mesa/pipe/i965simple/brw_shader_info.c
parentc605a55e9f771a2f0e85d69ff60059f7ea95320f (diff)
965: get fragment shader compiler compiling
Don't think that it will run though.
Diffstat (limited to 'src/mesa/pipe/i965simple/brw_shader_info.c')
-rw-r--r--src/mesa/pipe/i965simple/brw_shader_info.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/mesa/pipe/i965simple/brw_shader_info.c b/src/mesa/pipe/i965simple/brw_shader_info.c
new file mode 100644
index 0000000000..431b45466a
--- /dev/null
+++ b/src/mesa/pipe/i965simple/brw_shader_info.c
@@ -0,0 +1,49 @@
+
+#include "brw_context.h"
+#include "brw_state.h"
+#include "pipe/p_util.h"
+#include "pipe/p_shader_tokens.h"
+#include "pipe/tgsi/util/tgsi_parse.h"
+
+
+
+
+void brw_shader_info(const struct tgsi_token *tokens,
+ struct brw_shader_info *info )
+{
+ struct tgsi_parse_context parse;
+ int done = 0;
+
+ tgsi_parse_init( &parse, tokens );
+
+ while( !done &&
+ !tgsi_parse_end_of_tokens( &parse ) )
+ {
+ tgsi_parse_token( &parse );
+
+ switch( parse.FullToken.Token.Type ) {
+ case TGSI_TOKEN_TYPE_DECLARATION:
+ {
+ const struct tgsi_full_declaration *decl = &parse.FullToken.FullDeclaration;
+ unsigned last = decl->u.DeclarationRange.Last;
+
+ assert( decl->Declaration.Declare == TGSI_DECLARE_RANGE );
+
+ // Broken by crazy wpos init:
+ //assert( info->nr_regs[decl->Declaration.File] <= last);
+
+ info->nr_regs[decl->Declaration.File] = MAX2(info->nr_regs[decl->Declaration.File],
+ last+1);
+ break;
+ }
+ case TGSI_TOKEN_TYPE_IMMEDIATE:
+ case TGSI_TOKEN_TYPE_INSTRUCTION:
+ default:
+ done = 1;
+ break;
+ }
+ }
+
+ tgsi_parse_free (&parse);
+
+}