~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/gallium/auxiliary/util/u_prim_restart.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
 * Helper function for util_draw_vbo_without_prim_restart()
105
105
 * \return true for success, false if out of memory
106
106
 */
107
 
static boolean
108
 
add_range(enum pipe_prim_type mode, struct range_info *info, unsigned start, unsigned count, unsigned index_bias)
 
107
static bool
 
108
add_range(enum mesa_prim mode, struct range_info *info, unsigned start, unsigned count, unsigned index_bias)
109
109
{
110
110
   /* degenerate primitive: ignore */
111
111
   if (!u_trim_pipe_prim(mode, (unsigned*)&count))
112
 
      return TRUE;
 
112
      return true;
113
113
 
114
114
   if (info->max == 0) {
115
115
      info->max = 10;
116
116
      info->draws = MALLOC(info->max * sizeof(struct pipe_draw_start_count_bias));
117
117
      if (!info->draws) {
118
 
         return FALSE;
 
118
         return false;
119
119
      }
120
120
   }
121
121
   else if (info->count == info->max) {
124
124
                             info->max * sizeof(struct pipe_draw_start_count_bias),
125
125
                             2 * info->max * sizeof(struct pipe_draw_start_count_bias));
126
126
      if (!info->draws) {
127
 
         return FALSE;
 
127
         return false;
128
128
      }
129
129
 
130
130
      info->max *= 2;
139
139
   info->count++;
140
140
   info->total_index_count += count;
141
141
 
142
 
   return TRUE;
 
142
   return true;
143
143
}
144
144
 
145
145
struct pipe_draw_start_count_bias *
270
270
   if (src_transfer)
271
271
      pipe_buffer_unmap(context, src_transfer);
272
272
 
273
 
   new_info.primitive_restart = FALSE;
 
273
   new_info.primitive_restart = false;
274
274
   new_info.index_bounds_valid = true;
275
275
   if (direct_draws)
276
276
      context->draw_vbo(context, &new_info, drawid_offset, NULL, direct_draws, num_draws);