radv/ac: implement txs for buffer textures.
authorDave Airlie <airlied@redhat.com>
Mon, 30 Jan 2017 19:19:56 +0000 (05:19 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 30 Jan 2017 20:26:53 +0000 (06:26 +1000)
This fixes a bunch of buffer related:
dEQP-VK.memory.pipeline_barrier.*
tests, that were crashing in LLVM due to this being missing.

Reviewed-by: Andres Rodriguez<andresx7@gmail.com>
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index bfe6a2e725d91cefa3dc39386388a4ae5ad70210..f0ac3d364acd7c3d164f8bc16d202cf16a02dc0a 100644 (file)
@@ -3224,6 +3224,11 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
                }
        }
 
+       if (instr->op == nir_texop_txs && instr->sampler_dim == GLSL_SAMPLER_DIM_BUF) {
+               result = get_buffer_size(ctx, res_ptr, false);
+               goto write_result;
+       }
+
        if (instr->op == nir_texop_texture_samples) {
                LLVMValueRef res, samples, is_msaa;
                res = LLVMBuildBitCast(ctx->builder, res_ptr, ctx->v8i32, "");