diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-04-12 00:37:06 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-04-12 07:43:25 +0200 |
commit | bd91caf86366b88330bc167945512d35cc029db0 (patch) | |
tree | 3e4222883d27d3d01ed740c3da0bd6bc7097f3d6 /src/amd/common | |
parent | b35b5951fc5a0e0e697fb291d8fa257d413c717f (diff) |
radv: Use an offset instead of pointers for immutable samplers.
Makes more sense when we hash the layout for the pipeline cache.
Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 6fd2a0c4f62..9bcd5f6db46 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3973,16 +3973,18 @@ static LLVMValueRef get_sampler_desc(struct nir_to_llvm_context *ctx, constant_index = child->base_offset; } - if (desc_type == DESC_SAMPLER && binding->immutable_samplers && + if (desc_type == DESC_SAMPLER && binding->immutable_samplers_offset && (!index || binding->immutable_samplers_equal)) { if (binding->immutable_samplers_equal) constant_index = 0; + const uint32_t *samplers = radv_immutable_samplers(layout, binding); + LLVMValueRef constants[] = { - LLVMConstInt(ctx->i32, binding->immutable_samplers[constant_index * 4 + 0], 0), - LLVMConstInt(ctx->i32, binding->immutable_samplers[constant_index * 4 + 1], 0), - LLVMConstInt(ctx->i32, binding->immutable_samplers[constant_index * 4 + 2], 0), - LLVMConstInt(ctx->i32, binding->immutable_samplers[constant_index * 4 + 3], 0), + LLVMConstInt(ctx->i32, samplers[constant_index * 4 + 0], 0), + LLVMConstInt(ctx->i32, samplers[constant_index * 4 + 1], 0), + LLVMConstInt(ctx->i32, samplers[constant_index * 4 + 2], 0), + LLVMConstInt(ctx->i32, samplers[constant_index * 4 + 3], 0), }; return ac_build_gather_values(&ctx->ac, constants, 4); } |