On 05/01/2017 08:32 AM, Brian Paul wrote:
On 04/28/2017 05:12 PM, Marek Olšák wrote:
Hi,
This series shrinks various gallium structures and removes
set_index_buffer in order to decrease CPU overhead.
PART 1: Performance results
All testing below was done with radeonsi, and I used the drawoverhead
microbenchmark from mesa/demos ported to piglit and using GL 3.0
Compat and GL 3.2 Core (same GL states in both contexts).
1) Performance difference for the removal of set_index_buffer only:
Compat: DrawElements: 5.1 -> 5.3 million draws/second
Core: DrawElements: 5.1 -> 5.5 million draws/second
The result is better for the core profile where u_vbuf is disabled.
2) Performance difference with all 4 patches (Core profile only)
DrawArrays: 8.3 -> 8.5 million draws/second
DrawElements: 5.2 -> 5.8 million draws/second
3) Performance difference with threaded Gallium (Core profile only):
DrawElements: 5.9 -> 7.1 million draws/second
Threaded Gallium is still work in progress and might require
a non-trivial amount of driver work.
PART 2: Call for testing
These drivers have been tested:
- ddebug
- llvmpipe
- r300 (also with SWTCL)
- r600
- radeonsi
- softpipe
- trace
These drivers need testing:
- etnaviv
- freedreno
- nv30
- nv50
- nvc0
- svga
- swr
- vc4
- virgl
The following state trackers might need testing:
- nine
You can get the patches by fetching:
git://people.freedesktop.org/~mareko/mesa gallium-cleanup
I'd like to ask to you for testing drivers that I couldn't test.
Please let me know when you're done testing and if things are good.
After that, I'll push everything assuming the code review goes well.
You can also ignore this if you don't mind fixing your driver in
the master branch later.
With our VMware driver there's a whole bunch of clipflat failures. I'll
try to see if it's something simple, otherwise, it may take a day or two
to look closer.
I think the attached patch fixes things (it should be merged with 3/4).
I need to do another full piglit run, at least...
-Brian
diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c
index 0eb54a5..fea9da1 100644
--- a/src/gallium/drivers/svga/svga_pipe_draw.c
+++ b/src/gallium/drivers/svga/svga_pipe_draw.c
@@ -259,7 +259,7 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
/* Avoid leaking the previous hwtnl bias to swtnl */
svga_hwtnl_set_index_bias( svga->hwtnl, 0 );
- ret = svga_swtnl_draw_vbo( svga, info, indexbuf );
+ ret = svga_swtnl_draw_vbo(svga, info, indexbuf, index_offset);
}
else {
if (info->index_size && indexbuf) {
diff --git a/src/gallium/drivers/svga/svga_swtnl.h b/src/gallium/drivers/svga/svga_swtnl.h
index 1c66ab6..0661b71 100644
--- a/src/gallium/drivers/svga/svga_swtnl.h
+++ b/src/gallium/drivers/svga/svga_swtnl.h
@@ -40,7 +40,8 @@ void svga_destroy_swtnl( struct svga_context *svga );
enum pipe_error
svga_swtnl_draw_vbo(struct svga_context *svga,
const struct pipe_draw_info *info,
- struct pipe_resource *indexbuf);
+ struct pipe_resource *indexbuf,
+ unsigned index_offset);
#endif
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c
index 1898fa2..8dcfac8 100644
--- a/src/gallium/drivers/svga/svga_swtnl_draw.c
+++ b/src/gallium/drivers/svga/svga_swtnl_draw.c
@@ -39,7 +39,8 @@
enum pipe_error
svga_swtnl_draw_vbo(struct svga_context *svga,
const struct pipe_draw_info *info,
- struct pipe_resource *indexbuf)
+ struct pipe_resource *indexbuf,
+ unsigned index_offset)
{
struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS] = { 0 };
struct pipe_transfer *ib_transfer = NULL;
@@ -88,6 +89,7 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
map = pipe_buffer_map(&svga->pipe, indexbuf,
PIPE_TRANSFER_READ,
&ib_transfer);
+ map = (ubyte *) map + index_offset;
draw_set_indexes(draw,
(const ubyte *) map,
info->index_size, ~0);
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev