diff options
author | Marek Olšák <marek.olsak@amd.com> | 2016-10-16 22:08:03 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2016-10-19 19:26:30 +0200 |
commit | 4e42898d9d8fc45bb1cf870b04c0ccd949205079 (patch) | |
tree | 679c3b269eacae26a9ef0e32f1a0c07da2e4205e /src/mesa | |
parent | 4d3d620f26be242c9c0d92877bb69edf3ed872ed (diff) | |
download | external_mesa3d-4e42898d9d8fc45bb1cf870b04c0ccd949205079.zip external_mesa3d-4e42898d9d8fc45bb1cf870b04c0ccd949205079.tar.gz external_mesa3d-4e42898d9d8fc45bb1cf870b04c0ccd949205079.tar.bz2 |
glsl_to_tgsi: allocate glsl_to_tgsi_instruction::tex_offsets on demand
sizeof(glsl_to_tgsi_instruction): 384 -> 264
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 523b533..812a7a0 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -273,7 +273,7 @@ public: st_dst_reg dst[2]; st_src_reg src[4]; st_src_reg resource; /**< sampler or buffer register */ - st_src_reg tex_offsets[MAX_GLSL_TEXTURE_OFFSET]; + st_src_reg *tex_offsets; /** Pointer to the ir source this tree came from for debugging */ ir_instruction *ir; @@ -4309,6 +4309,9 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir) } if (ir->offset) { + if (!inst->tex_offsets) + inst->tex_offsets = rzalloc_array(inst, st_src_reg, MAX_GLSL_TEXTURE_OFFSET); + for (i = 0; i < MAX_GLSL_TEXTURE_OFFSET && offset[i].file != PROGRAM_UNDEFINED; i++) inst->tex_offsets[i] = offset[i]; inst->tex_offset_num_offset = i; |