diff options
author | Samuel Iglesias Gonsalvez <[email protected]> | 2015-06-01 09:44:55 +0200 |
---|---|---|
committer | Samuel Iglesias Gonsalvez <[email protected]> | 2015-09-25 08:39:21 +0200 |
commit | 003ce30e36b1a0757053a1f1407cdd314a32db10 (patch) | |
tree | 4423be2e82a4d1f1258b4f620ccd227d488cb133 /src/glsl/nir/glsl_to_nir.cpp | |
parent | 750c694474776fd545262aaf3190ccd92d6bb0ec (diff) |
nir: Implement ir_unop_get_buffer_size
This is how backends provide the buffer size required to compute
the size of unsized arrays in the previous patch
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl/nir/glsl_to_nir.cpp')
-rw-r--r-- | src/glsl/nir/glsl_to_nir.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index c13f953d914..d114da49272 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -1322,6 +1322,16 @@ nir_visitor::visit(ir_expression *ir) unreachable("not reached"); } break; + case ir_unop_get_buffer_size: { + nir_intrinsic_instr *load = nir_intrinsic_instr_create( + this->shader, + nir_intrinsic_get_buffer_size); + load->num_components = ir->type->vector_elements; + load->src[0] = evaluate_rvalue(ir->operands[0]); + add_instr(&load->instr, ir->type->vector_elements); + return; + } + case ir_binop_add: case ir_binop_sub: case ir_binop_mul: |