Commit Graph

48 Commits

Author SHA1 Message Date
Dave Airlie 7c79c9bfb1 mesa: rebalance the CALLOC_STRUCT/FREE force.
There were some CALLOC_STRUCT that were using free, rebalance this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14325>
2022-01-18 22:20:18 +00:00
Pierre-Eric Pelloux-Prayer 2671b9c90f vbo/dlist: remove vbo_save_copied_vtx
The copy_vertices() function is rarely called and removing
this decreases vbo_save_context's size by 20kb.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>
2021-09-09 16:42:16 +02:00
Pierre-Eric Pelloux-Prayer 2c6e8bab1b vbo/dlist: don't store prim_store
This is not used anywhere, so we can drop it from vbo_save_context.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>
2021-09-09 16:42:16 +02:00
Pierre-Eric Pelloux-Prayer f5aa98579a vbo/dlist: remove vbo_save_vertex_store::bufferobj
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>
2021-09-09 16:42:16 +02:00
Pierre-Eric Pelloux-Prayer f9d12bf50e vbo/dlist: use a single buffer object
Instead of using 2 bo, 1 for the indices, one for the vertices store
everything in the same buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>
2021-09-09 16:42:16 +02:00
Pierre-Eric Pelloux-Prayer e012b34e61 dlist: upload vertices in compile_vertex_list
Previously vertices were uploaded on-the-fly: each time
the position attribute was set, the newly added vertex
was copied to the mapped bo.

Replace this with a plain RAM buffer, and do the upload
at the end of compile_vertex_list.

This allows to remove the we-need-to-unmap-the-buffer-
before-drawing special case, but more importantly it
will allow to implement vertices deduplication in the
next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11927>
2021-08-02 11:13:16 +02:00
Tapani Pälli 06ea5f49fa vbo/dlist: free prim_store->prims when vbo_save is destroyed
Fixes: 83149e1c2d ("vbo/dlist: refactor prim_store/vertex_store allocations")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4067
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8410>
2021-01-12 06:22:20 +00:00
Pierre-Eric Pelloux-Prayer 4c751ad67a vbo/dlist: use a shared index buffer
Draws can be merged by u_threaded if they share the same IB.

This improves performance in SPECviewperf13 snx-03: tests fps
are improved by a 1.2x - 2.0x factor.

v2: reworked error handling

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8111>
2021-01-05 09:51:56 +01:00
Marek Olšák d0bc10affb vbo: remove gl_context dereferences when we can just subtract the pointer
vbo_exec_context and vbo_save_context are inside gl_context.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>
2020-12-03 21:41:19 +00:00
Mathias Fröhlich b899f5e59c vbo: Move no_current_update out of _mesa_prim.
The _mesa_prim::no_current_update flag should tell the compiled
display list if the current attributes that are placed in the dlists
vbo shall take a defined state past replay of a display list.
Immediate mode draws compiled into display lists should set the
current values. Array draws may leave the current values in
undefined state.
So finally this flag is not a property of every primitive
but it is a property of the compiled display list and there it
is a property of the last primitive compiled into the list.
So move the flag out of _mesa_prim into vbo_save.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2018-11-01 06:08:49 +01:00
Mathias Fröhlich 5b41504f66 vbo: Remove unused vbo_save_fallback function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2018-11-01 06:08:49 +01:00
Marek Olšák 43d66c8c2d mesa: include mtypes.h less
- remove mtypes.h from most header files
- add main/menums.h for often used definitions
- remove main/core.h

v2: fix radv build

Reviewed-by: Brian Paul <brianp@vmware.com>
2018-04-12 19:31:30 -04:00
Mathias Fröhlich 19a0f27a49 vbo: Remove reference to the vertex_store from the dlist node.
Since we now store a set of VAOs in the display list, use these object
to get the reference to the VBO in several places.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2018-03-01 04:06:23 +01:00
Mathias Fröhlich 4562a7b0e8 vbo: Make use of _DrawVAO from the dlist code.
Finally use an internal VAO to execute display list draws. Avoid
duplicate state validation for display list draws. Remove client arrays
previously used exclusively for display lists.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-02-23 05:34:14 +01:00
Brian Paul 718f4251c5 vbo: remove unneeded #includes
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2018-01-24 10:12:49 -07:00
Brian Paul f4376a0c2b vbo: remove vbo_context.h and change includes to use vbo.h instead
Now vbo.h is the public interface to the VBO module.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2018-01-24 10:12:49 -07:00
Brian Paul a7cfec3be0 vbo: move VBO-private types, prototypes, etc. into new vbo_private.h header
Things which should not be used outside the VBO module.
More public/private clean-ups coming.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2018-01-24 10:12:49 -07:00
Brian Paul c538846e31 mesa: rename gl_client_array -> gl_vertex_array
The term "client array" is a legacy thing dating back to the pre-VBO
era when _all_ vertex arrays lived in client memory.

Nowadays, it only contains vertex array state which is derived from
gl_array_attributes and gl_vertex_buffer_binding.  It's used by the
VBO module and some drivers.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-28 09:25:30 -07:00
Marek Olšák 00f6beed02 mesa: remove Driver.EndCallList
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03 22:06:09 +02:00
Marek Olšák ef6c0714af mesa: remove Driver.BeginCallList
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03 22:06:09 +02:00
Marek Olšák f457964885 mesa: remove Driver.EndList
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03 22:06:09 +02:00
Marek Olšák 55735cad00 mesa: remove Driver.NewList
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03 22:06:09 +02:00
Marek Olšák 7a54939728 mesa: remove Driver.NotifySaveBegin
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03 22:06:09 +02:00
Marek Olšák 4b8bb2f559 mesa: remove Driver.SaveFlushVertices
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03 22:06:08 +02:00
José Fonseca 8771285054 s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008.  Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

    $ cat tg2vmw.sed
    # Run as:
    #
    #   git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
    #

    # Rename copyrights
    s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
    /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
    s/TUNGSTEN GRAPHICS/VMWARE/g

    # Rename emails
    s/alanh@tungstengraphics.com/alanh@vmware.com/
    s/jens@tungstengraphics.com/jowen@vmware.com/g
    s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
    s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
    s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
    s/michel@tungstengraphics.com/daenzer@vmware.com/g
    s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
    s/zack@tungstengraphics.com/zackr@vmware.com/

    # Remove dead links
    s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

    # C string src/gallium/state_trackers/vega/api_misc.c
    s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 20:00:32 +00:00
Rico Schüller 3998cfa933 mesa: remove outdated version lines in comments
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-06-05 08:54:27 -06:00
Brian Paul 5472ae1fa9 vbo: fix initial value of ctx->Driver.CurrentSavePrimitive
This is set during context creation/initialization.  We know we're
not inside glBegin/glEnd at this point so use PRIM_OUTSIDE_BEGIN_END.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-05-02 09:03:15 -06:00
Kenneth Graunke 3d8d5b298a mesa: Restore 78-column wrapping of license text in C-style comments.
The previous commit introduced extra words, breaking the formatting.

This text transformation was done automatically via the following shell
command:
$ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript

where 'vimscript' is a file containing:
/THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * '
:wq

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-23 22:07:09 -07:00
Kenneth Graunke 96ff2edc73 mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.
This brings the license text in line with the MIT License as published
on the Open Source Initiative website:

http://opensource.org/licenses/mit-license.php

Generated automatically be the following shell command:
$ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
  sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {}

This introduces some wrapping issues, to be fixed in the next commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-23 22:07:06 -07:00
Kenneth Graunke dd404bc94f mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.
Generated automatically be the following shell command:
$ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
  sed -i 's/BRIAN PAUL/THE AUTHORS/' {}

The intention here is to protect all authors, not just Brian Paul.  I
believe that was already the sensible interpretation, but spelling it
out is probably better.

More practically, it also prevents people from accidentally copy &
pasting the license into a new file which says Brian is not liable when
he isn't even one of the authors.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-23 22:06:38 -07:00
Brian Paul b76f6d9557 mesa: remove #include "mfeatures.h" from numerous source files
None of the remaining FEATURE_x symbols in mfeatures.h are used anymore.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-17 17:33:40 -06:00
Oliver McFadden 09df07373b mesa: remove FEATURE_dlist define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:42 +03:00
Brian Paul fe72a069d1 mesa: s/FREE/free/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul c55ebc3e3e vbo: add some comments 2012-05-08 12:12:03 -06:00
Marek Olšák 8c990de0d6 vbo: remove vbo_context::generic_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák fa48137f29 vbo: remove vbo_context::legacy_currval
It's not nice when you have several variables pointing to the same array
and you wanna ask your editor "where is this used" and you only get an answer
for one of the four currval, legacy_currval, generic_currval, mat_currval,
which is quite useless, because you never see the whole picture.

Let's get rid of the additional pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Mathias Fröhlich ed42c25807 vbo: Use The VERT_{ATTRIB,BIT} defines.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Vinson Lee 14b36cd568 vbo: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:18:23 -08:00
Kristian Høgsberg f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Chia-I Wu 8d5c83c467 mesa/es: Remove omit list.
vbo/vbo_save* are the last members on the omit list.  Test FEATURE_dlist
in the sources and remove the omit list.
2010-05-12 13:50:29 +08:00
José Fonseca 05ac187f30 mesa: Fix null buffer object reference counting.
Always use _mesa_reference_buffer_object, and never call
ctx->Driver.DeleteBuffer() directly to prevent dangling pointers to the
null buffer object.

This fixes crash/assertions in sharedtex_mt and Autodesk Mudbox.
2010-02-09 11:52:05 +00:00
Vinson Lee aee9a6f4e1 vbo: Remove unnecessary headers from vbo_save.c. 2010-01-12 00:50:05 -08:00
Brian Paul 37c74af01c mesa: improved gl_buffer_object reference counting
Use new _mesa_reference_buffer_object() function wherever possible.
Fixes buffer object/display list crash reported in ParaView.
2008-09-04 14:59:40 -06:00
Brian f0676cc422 fix vbo display list memleak upon context destruction 2008-01-01 10:20:56 -07:00
Brian c223c6b663 Be more consistant with paths in #includes. Eventually, eliminate a bunch of -I flags. 2007-07-04 13:15:20 -06:00
Keith Whitwell fd2756006a Move edgeflag into the VERT_ATTRIB_SEVEN slot. This means that our
NV_vertex_program implementation has slightly incorrect aliasing
behaviour.  I think this is reasonable given the simplification and
the fact that the mainstream ARB_vp continues to have the correct
behaviour.
2006-10-30 20:16:35 +00:00
Keith Whitwell e8abd098b3 Remove wakeup functions. This code is intended to be active all the
time.
2006-10-30 17:12:05 +00:00
Keith Whitwell fd12b37dba Checkpoint of new vbo-building code. Currently builds regular arrays
rather than VBO's - VBOs are easy but need to look closer at the
driver interface.  The trivial/tri demo works.
2006-10-29 09:46:11 +00:00