Lines Matching defs:slot
137 /* split new variable into second slot */
739 /* this should get fixed up by slot remapping */
744 clamp_slot_type(const struct glsl_type *type, unsigned slot)
750 /* normalize slot idx to current type's size */
751 slot %= slot_count;
755 /* create a vec4 mask of the selected slot's components out of all the components */
756 uint32_t mask = BITFIELD_MASK(slot_components) & BITFIELD_RANGE(slot * 4, 4);
768 /* iterate over all the members in the struct, stopping once the slot idx is reached */
770 /* use array type for slot counting but return array member type for unroll */
783 get_slot_components(nir_variable *var, unsigned slot, unsigned so_slot)
785 assert(var && slot < var->data.location + glsl_count_vec4_slots(var->type, false, false));
788 unsigned slot_idx = slot - so_slot;
791 /* need to find the vec4 that's being exported by this slot */
795 /* arrays here are already fully unrolled from their structs, so slot handling is implicit */
810 find_packed_output(const struct pipe_stream_output_info *so_info, uint8_t *reverse_map, unsigned slot)
814 if (reverse_map[packed_output->register_index] == slot)
825 unsigned slot = 0;
832 reverse_map[slot++] = bit;
850 unsigned slot = reverse_map[output->register_index];
857 var = find_var_with_location_frac(zs->nir, slot--, output->start_component, have_psiz);
860 so_slot = slot + 1;
861 slot = reverse_map[output->register_index];
865 inlined[slot][output->start_component + j] = true;
867 if (is_inlined(inlined[slot], output))
870 unsigned num_components = get_slot_components(var, slot, so_slot);
881 inlined[slot][output->start_component + j] = true;
884 packed |= BITFIELD64_BIT(slot);
885 packed_components[slot] += output->num_components;
886 packed_streams[slot] |= BITFIELD_BIT(output->stream);
887 packed_buffers[slot] |= BITFIELD_BIT(output->output_buffer);
900 unsigned slot = reverse_map[output->register_index];
901 if (is_inlined(inlined[slot], output))
906 var = find_var_with_location_frac(zs->nir, slot--, output->start_component, have_psiz);
914 slot = var->data.location + j;
915 const struct pipe_stream_output *packed_output = find_packed_output(so_info, reverse_map, slot);
919 /* if this slot wasn't packed or isn't in the same stream/buffer, skip consolidation */
920 if (!(packed & BITFIELD64_BIT(slot)) ||
921 util_bitcount(packed_streams[slot]) != 1 ||
922 util_bitcount(packed_buffers[slot]) != 1)
925 /* if all the components the variable exports to this slot aren't captured, skip consolidation */
926 unsigned num_components = get_slot_components(var, slot, var->data.location);
929 if (num_components != packed_components[slot])
950 /* mark all slot components inlined to skip subsequent loop iterations */
952 slot = var->data.location + j;
953 for (unsigned k = 0; k < packed_components[slot]; k++)
954 inlined[slot][k] = true;
955 packed &= ~BITFIELD64_BIT(slot);
1373 unsigned slot = var->data.location;
1374 switch (slot) {
1393 assert(slot >= VARYING_SLOT_PATCH0);
1394 slot -= VARYING_SLOT_PATCH0;
1396 if (slot_map[slot] == 0xff) {
1405 slot_map[slot + i] = (*reserved)++;
1407 slot = slot_map[slot];
1408 assert(slot < MAX_VARYING);
1409 var->data.driver_location = slot;
1425 unsigned slot = var->data.location;
1426 switch (slot) {
1443 assert(slot >= VARYING_SLOT_PATCH0);
1444 slot -= VARYING_SLOT_PATCH0;
1446 if (slot_map[slot] == (unsigned char)-1) {
1453 slot_map[slot] = (*reserved)++;
1455 var->data.driver_location = slot_map[slot];