summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-09 15:16:14 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-05 12:33:53 +0200
commit8a21582a11789d7989f21d88c851eef677ad0b01 (patch)
tree8b195b038b2cc441b1a67d074c2de9fc212a9eea
parent81005653b3836aafde77e6dd639b73aadba973c1 (diff)
radeonsi/nir: set si_shader_context::num_{sampler,images}
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 91796a8319..a278ef218b 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -375,6 +375,8 @@ si_nir_load_sampler_desc(struct ac_shader_abi *abi,
bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
{
+ struct tgsi_shader_info *info = &ctx->shader->selector->info;
+
unsigned fs_attr_idx = 0;
nir_foreach_variable(variable, &nir->inputs) {
unsigned attrib_count = glsl_count_attribute_slots(variable->type,
@@ -399,6 +401,9 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
ctx->abi.inputs = &ctx->inputs[0];
ctx->abi.load_sampler_desc = si_nir_load_sampler_desc;
+ ctx->num_samplers = util_last_bit(info->samplers_declared);
+ ctx->num_images = util_last_bit(info->images_declared);
+
ac_nir_translate(&ctx->ac, &ctx->abi, nir, NULL);
return true;