[Mesa-dev] [PATCH] nir/lower_samplers: Use the right memory context for realloc'ing tex sources

Kenneth Graunke kenneth at whitecape.org
Fri Apr 3 17:01:06 PDT 2015


On Friday, April 03, 2015 03:50:05 PM Jason Ekstrand wrote:
> As of da5ec2a, we allocate instruction sources out of the instruction
> itself.  When we realloc the texture sources we need to use the right
> memory context or ralloc will get angry and assert-fail
> 
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/glsl/nir/nir_lower_samplers.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp
> index 3015dbd..1e509a9 100644
> --- a/src/glsl/nir/nir_lower_samplers.cpp
> +++ b/src/glsl/nir/nir_lower_samplers.cpp
> @@ -90,7 +90,7 @@ lower_sampler(nir_tex_instr *instr, struct gl_shader_program *shader_program,
>                 ralloc_asprintf_append(&name, "[%u]", deref_array->base_offset);
>              break;
>           case nir_deref_array_type_indirect: {
> -            instr->src = reralloc(mem_ctx, instr->src, nir_tex_src,
> +            instr->src = reralloc(instr, instr->src, nir_tex_src,
>                                    instr->num_srcs + 1);
>              memset(&instr->src[instr->num_srcs], 0, sizeof *instr->src);
>              instr->src[instr->num_srcs].src_type = nir_tex_src_sampler_offset;
> 

Oops, thanks!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150403/3ef1d107/attachment.sig>


More information about the mesa-dev mailing list