struct tu_cs_entry ib;
};
-static struct tu_sampler*
+const static struct tu_sampler*
sampler_ptr(struct tu_descriptor_state *descriptors_state,
const struct tu_descriptor_map *map, unsigned i,
unsigned array_index)
const struct tu_descriptor_set_binding_layout *layout =
&set->layout->binding[map->binding[i]];
+ if (layout->immutable_samplers_offset) {
+ const struct tu_sampler *immutable_samplers =
+ tu_immutable_samplers(set->layout, layout);
+
+ return &immutable_samplers[array_index];
+ }
+
switch (layout->type) {
case VK_DESCRIPTOR_TYPE_SAMPLER:
return (struct tu_sampler*) &set->mapped_ptr[layout->offset / 4];
int sampler_index = 0;
for (unsigned i = 0; i < link->sampler_map.num; i++) {
for (int j = 0; j < link->sampler_map.array_size[i]; j++) {
- struct tu_sampler *sampler = sampler_ptr(descriptors_state,
- &link->sampler_map, i, j);
+ const struct tu_sampler *sampler = sampler_ptr(descriptors_state,
+ &link->sampler_map,
+ i, j);
memcpy(&tex_samp.map[A6XX_TEX_SAMP_DWORDS * sampler_index++],
sampler->state, sizeof(sampler->state));
*needs_border |= sampler->needs_border;
for (unsigned i = 0; i < vs_sampler->num; i++) {
for (unsigned j = 0; j < vs_sampler->array_size[i]; j++) {
- struct tu_sampler *sampler = sampler_ptr(descriptors_state, vs_sampler, i, j);
+ const struct tu_sampler *sampler = sampler_ptr(descriptors_state,
+ vs_sampler, i, j);
memcpy(ptr.map, &border_color[sampler->border], 128);
ptr.map += 128 / 4;
}
for (unsigned i = 0; i < fs_sampler->num; i++) {
for (unsigned j = 0; j < fs_sampler->array_size[i]; j++) {
- struct tu_sampler *sampler = sampler_ptr(descriptors_state, fs_sampler, i, j);
+ const struct tu_sampler *sampler = sampler_ptr(descriptors_state,
+ fs_sampler, i, j);
memcpy(ptr.map, &border_color[sampler->border], 128);
ptr.map += 128 / 4;
}
uint32_t *ptr = set->mapped_ptr;
struct tu_bo **buffer_list = set->descriptors;
- const struct tu_sampler *samplers = tu_immutable_samplers(set->layout, binding_layout);
-
ptr += binding_layout->offset / 4;
ptr += binding_layout->size * writeset->dstArrayElement / 4;
writeset->descriptorType,
writeset->pImageInfo + j,
!binding_layout->immutable_samplers_offset);
- if (binding_layout->immutable_samplers_offset) {
- const unsigned idx = writeset->dstArrayElement + j;
- memcpy((char*)ptr + A6XX_TEX_CONST_DWORDS*4, &samplers[idx],
- sizeof(struct tu_sampler));
- }
break;
case VK_DESCRIPTOR_TYPE_SAMPLER:
write_sampler_descriptor(device, ptr, writeset->pImageInfo + j);