aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r--src/gallium/drivers/iris/iris_program.c10
-rw-r--r--src/gallium/drivers/iris/iris_state.c6
2 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index d2ada71146d..4eb2b676a7d 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -543,10 +543,12 @@ assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
{
const struct shader_info *info = &nir->info;
- if (info->num_textures) {
+ unsigned num_textures = util_last_bit(info->textures_used);
+
+ if (num_textures) {
prog_data->binding_table.texture_start = next_binding_table_offset;
prog_data->binding_table.gather_texture_start = next_binding_table_offset;
- next_binding_table_offset += info->num_textures;
+ next_binding_table_offset += num_textures;
} else {
prog_data->binding_table.texture_start = 0xd0d0d0d0;
prog_data->binding_table.gather_texture_start = 0xd0d0d0d0;
@@ -581,10 +583,10 @@ assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
prog_data->binding_table.plane_start[0] = prog_data->binding_table.texture_start;
prog_data->binding_table.plane_start[1] = next_binding_table_offset;
- next_binding_table_offset += info->num_textures;
+ next_binding_table_offset += num_textures;
prog_data->binding_table.plane_start[2] = next_binding_table_offset;
- next_binding_table_offset += info->num_textures;
+ next_binding_table_offset += num_textures;
/* Set the binding table size */
prog_data->binding_table.size_bytes = next_binding_table_offset * 4;
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index e7801a698dc..2cf9c62587e 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -3719,9 +3719,11 @@ iris_populate_binding_table(struct iris_context *ice,
}
}
- bt_assert(texture_start, info->num_textures > 0);
+ unsigned num_textures = util_last_bit(info->textures_used);
- for (int i = 0; i < info->num_textures; i++) {
+ bt_assert(texture_start, num_textures > 0);
+
+ for (int i = 0; i < num_textures; i++) {
struct iris_sampler_view *view = shs->textures[i];
uint32_t addr = view ? use_sampler_view(batch, view)
: use_null_surface(batch, ice);