From b286f63e168037c1dbf9a10614dd6a1cd6b9ef69 Mon Sep 17 00:00:00 2001 From: David Li Date: Mon, 24 Jan 2011 10:55:37 -0800 Subject: Fix bug with scalar/vector expansion. --- src/glsl/ir_to_llvm.cpp | 2 +- src/glsl/linker.cpp | 2 +- src/glsl/main.cpp | 2 +- src/talloc/hieralloc.c | 25 +++++++++++++++++++++++++ src/talloc/hieralloc.h | 2 ++ 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/glsl/ir_to_llvm.cpp b/src/glsl/ir_to_llvm.cpp index 7642ee7..f457c82 100644 --- a/src/glsl/ir_to_llvm.cpp +++ b/src/glsl/ir_to_llvm.cpp @@ -1123,7 +1123,7 @@ public: if(ir->rhs->type->vector_elements < width) { int expand_mask[4] = {-1, -1, -1, -1}; - for(unsigned i = 0; i < ir->rhs->type->vector_elements; ++i) + for(unsigned i = 0; i < ir->lhs->type->vector_elements; ++i) expand_mask[i] = i; // printf("ve: %u w %u issw: %i\n", ir->rhs->type->vector_elements, width, !!ir->rhs->as_swizzle()); rhs = llvm_shuffle(rhs, expand_mask, width, "assign.expand"); diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 078b949..80e2213 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1654,7 +1654,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT]; - demote_shader_inputs_and_outputs(sh, ir_var_in); + //demote_shader_inputs_and_outputs(sh, ir_var_in); for testing, don't demote } /* FINISHME: Assign fragment shader output locations. */ diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index bd58c86..b3fea09 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -564,6 +564,6 @@ main(int argc, char **argv) _mesa_glsl_release_functions(); puts("mesa exit"); - hieralloc_report(NULL, stdout); + hieralloc_report_brief(NULL, stdout); return status; } diff --git a/src/talloc/hieralloc.c b/src/talloc/hieralloc.c index 9e518b2..488c522 100644 --- a/src/talloc/hieralloc.c +++ b/src/talloc/hieralloc.c @@ -437,5 +437,30 @@ void hieralloc_report(const void * ptr, FILE * file) { if (NULL == ptr) ptr = &global_header + 1; + fputs("hieralloc_report: \n", file); _hieralloc_report(get_header(ptr), file, 0); } + +static void _hieralloc_report_brief(const hieralloc_header_t * header, FILE * file, unsigned * data) +{ + data[0]++; + data[1] += header->size; + data[2] += header->childCount; + data[3] += header->refCount; + const hieralloc_header_t * child = header->child; + while (child) + { + _hieralloc_report_brief(child, file, data); + child = child->nextSibling; + } +} + +void hieralloc_report_brief(const void * ptr, FILE * file) +{ + if (NULL == ptr) + ptr = &global_header + 1; + unsigned data [4] = {0}; + _hieralloc_report_brief(get_header(ptr), file, data); + fprintf(file, "hieralloc_report total: count=%d size=%d child=%d ref=%d \n", + data[0], data[1], data[2], data[3]); +} diff --git a/src/talloc/hieralloc.h b/src/talloc/hieralloc.h index f80aadb..1fb8556 100644 --- a/src/talloc/hieralloc.h +++ b/src/talloc/hieralloc.h @@ -91,4 +91,6 @@ char * hieralloc_asprintf_append(char * str, const char * fmt, ...); // report self and child allocations void hieralloc_report(const void * ptr, FILE * file); +void hieralloc_report_brief(const void * ptr, FILE * file); + #endif -- cgit v1.2.3