Move top-level AST to HIR conversion to _mesa_ast_to_hir
This commit is contained in:
3
ast.h
3
ast.h
@@ -492,6 +492,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state);
|
||||||
|
|
||||||
extern struct ir_instruction *
|
extern struct ir_instruction *
|
||||||
_mesa_ast_field_selection_to_hir(const struct ast_expression *expr,
|
_mesa_ast_field_selection_to_hir(const struct ast_expression *expr,
|
||||||
exec_list *instructions,
|
exec_list *instructions,
|
||||||
|
@@ -56,6 +56,17 @@
|
|||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
#include "ir.h"
|
#include "ir.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
|
||||||
|
{
|
||||||
|
struct simple_node *ptr;
|
||||||
|
|
||||||
|
foreach (ptr, & state->translation_unit) {
|
||||||
|
((ast_node *)ptr)->hir(instructions, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static const struct glsl_type *
|
static const struct glsl_type *
|
||||||
arithmetic_result_type(const struct glsl_type *type_a,
|
arithmetic_result_type(const struct glsl_type *type_a,
|
||||||
const struct glsl_type *type_b,
|
const struct glsl_type *type_b,
|
||||||
|
@@ -718,9 +718,7 @@ main(int argc, char **argv)
|
|||||||
((ast_node *)ptr)->print();
|
((ast_node *)ptr)->print();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ptr, & state.translation_unit) {
|
_mesa_ast_to_hir(&instructions, &state);
|
||||||
((ast_node *)ptr)->hir(&instructions, &state);
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
foreach_iter(exec_list_iterator, iter, instructions) {
|
foreach_iter(exec_list_iterator, iter, instructions) {
|
||||||
|
Reference in New Issue
Block a user