diff options
author | Jason Ekstrand <[email protected]> | 2017-03-02 21:42:06 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-03-14 07:36:40 -0700 |
commit | e9a45a3d5da17922b7a02515cff05681728cf99c (patch) | |
tree | d5d4898ffdae034d23190c44ac01195b25fd0beb /src/compiler/glsl | |
parent | b377be921324a1841027e68eac7d1b64c8e65bbd (diff) |
nir: Make image_size a variable-width intrinsic
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index fc2a2c4dbe0..3a71afd1866 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -865,10 +865,11 @@ nir_visitor::visit(ir_call *ir) /* Set the intrinsic destination. */ if (ir->return_deref) { - const nir_intrinsic_info *info = - &nir_intrinsic_infos[instr->intrinsic]; + unsigned num_components = ir->return_deref->type->vector_elements; + if (instr->intrinsic == nir_intrinsic_image_size) + instr->num_components = num_components; nir_ssa_dest_init(&instr->instr, &instr->dest, - info->dest_components, 32, NULL); + num_components, 32, NULL); } if (op == nir_intrinsic_image_size || |