Bug 65420 - Remove gallium draw_arrays() and draw_arrays_instanced() functions
Summary: Remove gallium draw_arrays() and draw_arrays_instanced() functions
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium minor
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-05 15:15 UTC by Brian Paul
Modified: 2014-09-22 19:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Brian Paul 2013-06-05 15:15:03 UTC
This is a simple gallium clean-up task.

draw_arrays() in gallium/auxiliary/draw/draw_pt.c is only used by the state_tracker's st_draw_feedback.c file.  We could move draw_arrays() into st_draw_feedback.c and make it static like this (untested):

static void
draw_arrays(struct draw_context *draw, unsigned prim,
            unsigned start, unsigned count)
{
   struct pipe_draw_info info;

   util_draw_init_info(&info);

   info.mode = mode;
   info.start = start;
   info.count = count;
   info.min_index = start;
   info.max_index = start + count - 1;

   draw_vbo(draw, &info);
}


Then, the draw module will be down to one drawing entrypoint: draw_vbo().
Comment 1 Arnas Milaševičius 2013-06-05 16:01:11 UTC
I'll take this task.
Comment 2 Arnas Milaševičius 2013-06-05 19:33:13 UTC
And what should we do with void draw_vbo(struct draw_context *draw, const struct pipe_draw_info *info); function in that file? Because I couldn't find it declared in any *.h file. If we'd move this function to st_draw_feedback.c too, we'd need to move a bunch of other static functions from draw_pt.c that are needed by draw_vbo(). Maybe we should declare this function in some *.h file?
Comment 3 Brian Paul 2013-06-05 19:45:14 UTC
draw_vbo() should not be touched.  It's called by a number of gallium drivers.

See also src/gallium/auxiliary/draw/draw_context.h:241:void draw_vbo(struct draw_context *draw, ...
Comment 4 Arnas Milaševičius 2013-06-05 20:44:00 UTC
Wow, I was so confused that it's not there and only now I realized that I accidently deleted it together with draw_arrays() and draw_arrays_instanced() from that .h file...
Comment 5 Emil Velikov 2014-09-22 19:07:06 UTC
commit 3069357ef0cfa112c3c77a25c010df7f9af4467d
Author: Arnas Milasevicius <giant1gf@gmail.com>
Date:   Fri Jun 7 01:21:19 2013 +0300

    gallium: Remove draw_arrays() and draw_arrays_instanced() functions

    Moved draw_arrays() to st_draw_feedback.c and removed draw_arrays_instanced().
    draw_arrays() was used by nobody else.  Now there's just one "draw" entrypoint
    into the draw module.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.