((struct type*)tc_add_sized_call(tc, execute, \
sizeof(struct type) + \
sizeof(((struct type*)NULL)->slot[0]) * \
- num_slots))
+ (num_slots)))
static union tc_payload *
tc_add_small_call(struct threaded_context *tc, enum tc_call_id id)
struct tc_shader_images {
ubyte shader, start, count;
+ bool unbind;
struct pipe_image_view slot[0]; /* more will be allocated if needed */
};
struct tc_shader_images *p = (struct tc_shader_images *)payload;
unsigned count = p->count;
+ if (p->unbind) {
+ pipe->set_shader_images(pipe, p->shader, p->start, p->count, NULL);
+ return;
+ }
+
pipe->set_shader_images(pipe, p->shader, p->start, p->count, p->slot);
for (unsigned i = 0; i < count; i++)
struct threaded_context *tc = threaded_context(_pipe);
struct tc_shader_images *p =
- tc_add_slot_based_call(tc, TC_CALL_set_shader_images, tc_shader_images, count);
+ tc_add_slot_based_call(tc, TC_CALL_set_shader_images, tc_shader_images,
+ images ? count : 0);
p->shader = shader;
p->start = start;
p->count = count;
+ p->unbind = images == NULL;
if (images) {
for (unsigned i = 0; i < count; i++) {
}
}
memcpy(p->slot, images, count * sizeof(images[0]));
- } else {
- memset(p->slot, 0, count * sizeof(images[0]));
}
}