intel/fs: Alloc pull constants off mem_ctx
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Nov 2017 14:57:21 +0000 (07:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 2 Nov 2017 16:55:21 +0000 (09:55 -0700)
It doesn't actually matter since the only user of push constants, i965,
ralloc_steals it back to NULL but it's more consistent and probably
fixes memory leaks in some error cases.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
src/intel/compiler/brw_fs.cpp

index 814da8ad94da64b9d71c21951afe2e10262ac965..e2176827a64fa3e73c709342b0de934adebe2196 100644 (file)
@@ -2095,7 +2095,7 @@ fs_visitor::assign_constant_locations()
    stage_prog_data->param = ralloc_array(mem_ctx, uint32_t, num_push_constants);
    if (num_pull_constants > 0) {
       stage_prog_data->nr_pull_params = num_pull_constants;
-      stage_prog_data->pull_param = ralloc_array(NULL, uint32_t,
+      stage_prog_data->pull_param = ralloc_array(mem_ctx, uint32_t,
                                                  num_pull_constants);
    }