aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: rename some vars related to indirect draw countBrian Paul2018-02-081-6/+7
| | | | | | | | 'indirect_params' was a bit vague. Use the names that we use in gallium's pipe_draw_indirect_info. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: skip draw calls with pipe_draw_info::count == 0Marek Olšák2017-09-071-1/+6
| | | | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102502 Cc: 17.2 <[email protected]> Tested-by: Alexandre Demers <[email protected]> Tested-by: Dieter Nützel <[email protected]> Acked-by: Timothy Arceri <[email protected]>
* st/mesa: silence a valgrind warning in u_threaded_context due to st_draw_vboMarek Olšák2017-05-181-0/+1
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move the logic of all_varyings_in_vbos into st_update_arrayMarek Olšák2017-05-101-24/+4
| | | | | | | | | | The function was pretty slow. This brings a substantial decrease in draw call overhead when min/max index bounds are not needed: Before: DrawElements (1 VBO) w/ no state change: 5.75 million After: DrawElements (1 VBO) w/ no state change: 7.03 million Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: unify common code in st_draw_vbo functionsMarek Olšák2017-05-101-27/+21
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: make st_draw_vbo staticMarek Olšák2017-05-101-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't call util_draw_init_info in st_draw_vboMarek Olšák2017-05-101-2/+8
|
* gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák2017-05-101-45/+32
| | | | | | | | | | | | | | pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
* gallium: separate indirect stuff from pipe_draw_info - 80 -> 56 bytesMarek Olšák2017-05-101-8/+11
| | | | For faster initialization of non-indirect draws.
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-101-3/+3
|
* st/mesa: use min_index and max_index directly from vboMarek Olšák2017-04-281-7/+2
| | | | | | also remove the incorrect comment about primitive restart. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: replace _mesa_index_buffer::type with index_sizeMarek Olšák2017-04-221-10/+8
| | | | | | | This avoids repeated translations of the enum. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: check in advance in st_draw_vbo whether the bitmap cache is emptyMarek Olšák2017-04-201-1/+3
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: invalidate the readpix cache in st_indirect_draw_vboMarek Olšák2017-04-201-0/+2
| | | | | | Cc: <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: fold u_trim_pipe_prim call from st/mesa to driversMarek Olšák2017-04-201-10/+2
| | | | | | | Most drivers don't need it and shouldn't need it because it can't be used in some cases (indirect draws, primitive restart, count from streamout). Reviewed-by: Brian Paul <[email protected]>
* st/mesa: assume all drivers support user index buffersMarek Olšák2017-02-251-37/+13
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> (VMware driver only)
* st/mesa: use the common uploader (v2)Marek Olšák2017-02-141-6/+7
| | | | | | | | v2: use const_uploader Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> (v1) Tested-by: Charmaine Lee <[email protected]>
* mesa: rename gl_client_array -> gl_vertex_arrayBrian Paul2016-10-281-2/+2
| | | | | | | | | | | 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 <[email protected]>
* st/mesa: cleanup and fix primitive restart for indirect drawsNicolai Hähnle2016-10-241-17/+28
| | | | | | | | | | | | | | | | There are three intended functional changes here: 1. OpenGL 4.5 clarifies that primitive restart should only apply with index buffers, so make that change explicit in the indirect draw path. 2. Make PrimitiveRestartFixedIndex work with indirect draws. 3. The change where primitive_restart is only set when the restart index can actually have an effect (based on the size of indices) is also applied for indirect draws. Cc: 13.0 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: only set primitive_restart when the restart index is in rangeNicolai Hähnle2016-10-201-2/+13
| | | | | | | | | | | | | Even when enabled, primitive restart has no effect when the restart index is larger than the representable values in the index buffer. Fixes GL45-CTS.gtf31.GL3Tests.primitive_restart.primitive_restart_upconvert for radeonsi VI. v2: add an explanatory comment Cc: "12.0 13.0" <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v1)
* state_tracker: Initialize the draw context only when needed.Eric Anholt2016-08-041-8/+23
| | | | | | | | | | | It's only used for rarely-used deprecated GL features (feedback/rasterpos), so we can skip the memory allocation and initialization for it most of the time. Saves about 659k (out of 1605k) of maximum memory size according to massif on simulated vc4 glsl-algebraic-add-add-1 Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove excessive shader state dirtyingMarek Olšák2016-07-301-2/+4
| | | | | | | | | This just needs to be done by st_validate_state. v2: add "shaders_may_be_dirty" flags for not skipping st_validate_state on _NEW_PROGRAM to detect real shader changes Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: completely rewrite state atomsMarek Olšák2016-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | The goal is to do this in st_validate_state: while (dirty) atoms[u_bit_scan(&dirty)]->update(st); That implies that atoms can't specify which flags they consume. There is exactly one ST_NEW_* flag for each atom. (58 flags in total) There are macros that combine multiple flags into one for easier use. All _NEW_* flags are translated into ST_NEW_* flags in st_invalidate_state. st/mesa doesn't keep the _NEW_* flags after that. torcs is 2% faster between the previous patch and the end of this series. v2: - add st_atom_list.h to Makefile.sources Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: invalidate readpixels cacheNicolai Hähnle2016-06-211-0/+1
| | | | | | | Whenever a draw happens or some other function call might change the result of future glReadPixels calls, we must invalidate the cache. Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove initialized field from uniform storageTimothy Arceri2016-03-291-37/+0
| | | | | | | | The only place this was used was in a gallium debug function that had to be manually enabled. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove ST_NEW_MESA flag (v2)Marek Olšák2016-03-111-2/+2
| | | | | | | | Only used indirectly when checking dirty.st != 0 v2: also update st_cb_compute.c Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: consolidate quad drawing codeBrian Paul2016-02-161-0/+90
| | | | | | | The glClear, glBitmap and glDrawPixels code now use a new st_draw_quad() helper function. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: include u_draw.h, not u_draw_quad.h in st_draw.cBrian Paul2016-02-161-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: add a second pipeline for computeSamuel Pitoiset2016-02-131-2/+2
| | | | | | | | | | | | | Compute needs a new and different validation path. Changes from v2: - make use of unreachable() instead of assert() when the pipeline is invalid - move the st_pipeline enumeration to st_context.h instead of st_api.h Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl: move to compiler/Emil Velikov2016-01-261-1/+1
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>
* st/mesa: add support for new mesa indirect draw interfaceIlia Mirkin2016-01-071-9/+81
| | | | | | | | | | This shifts all indirect draws to go through the new function. If the driver doesn't have support for multi draws, we break those up and perform N draws. Otherwise, we pass everything through for just a single draw call. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move bitmap cache flushing out of state validationBrian Paul2016-01-061-0/+3
| | | | | | Just do it where needed (before drawing, clearing, etc). Reviewed-by: José Fonseca <[email protected]>
* u_upload_mgr: pass alignment to u_upload_data manuallyMarek Olšák2016-01-021-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add GL_ARB_shader_draw_parameters supportIlia Mirkin2015-12-301-0/+1
| | | | | | | Hooks up the new system values, passes the drawid in. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: clean up #includes in st_draw.cBrian Paul2015-10-011-2/+2
| | | | Reviewed-by: Tapani Pälli <[email protected]>
* u_upload_mgr: remove the return value from u_upload_dataMarek Olšák2015-09-031-3/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: implement DrawTransformFeedbackStreamMarek Olšák2015-08-061-1/+1
| | | | Reviewed-by: Dave Airlie <[email protected]>
* vbo: pass the stream from DrawTransformFeedbackStream to driversMarek Olšák2015-08-061-0/+1
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: don't draw instead of asserting in transform feedbackDave Airlie2015-07-311-1/+2
| | | | | | | | | | | | if we get a request to take the count from feedback, but there is no buffer to take it from, just draw as if we got 0 vertices so nothing. This fixes this assert killing the ogl conform, and a piglit test I've sent. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: set vertices_per_patch when drawingIlia Mirkin2015-07-231-0/+2
|
* mesa: reference built-in uniforms into gl_uniform_storageMartin Peres2015-06-041-1/+1
| | | | | | | | | | | | | | | This change introduces a new field in gl_uniform_storage to explicitely say that a uniform is built-in. In the case where it is, no storage is defined to make it clear that it is read-only from the mesa side. I fixed all the places in the code that made use of the structure that I changed. Any place making a wrong assumption and using the storage straight away will just crash. This patch seems to implement the path of least resistance towards listing built-in uniforms in GL_ACTIVE_UNIFORM (and other APIs). Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-1/+1
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEXMarek Olšák2015-01-071-1/+2
| | | | | Cc: 10.2 10.3 10.4 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: add support for indirect drawingChristoph Bumiller2014-07-021-1/+10
|
* mesa/sso: rename Shader to the pointer _ShaderGregory Hainaut2014-03-251-1/+1
| | | | | | | | | | | | | | | | Basically a sed but shaderapi.c and get.c. get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior shaderapi.c => the old api stil update the Shader object directly V2: formatting improvement V3 (idr): * Rebase fixes after a block of code was moved from ir_to_mesa.cpp to shaderapi.c. * Trivial reformatting. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: drop the lowering of quad strips to triangle stripsMarek Olšák2014-03-211-10/+0
| | | | | | | | | | | | | | | This fallback to triangle strips is silly and should be done in drivers if they need it. This should fix the case when quad strips are used with flatshading that is enabled by the "flat" GLSL varying modifier. It also fixes primitive restart for quad strips. This fixes piglit: NV_primitive_restart/primitive-restart-draw-mode-quad_strip Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove ad-hoc arrays of gl_shader_program.Paul Berry2014-01-211-5/+1
| | | | | | | | Now that we have a ctx->Shader.CurrentProgram array, we can just use it directly. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an ↵Paul Berry2014-01-211-3/+3
| | | | | | | | | | | | | | | | | | | | | array. These are replaced with ctx->Shader.CurrentProgram[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' ')' \ -print0 | xargs -0 sed -i \ -e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \ -e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \ -e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g' Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # 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 <[email protected]>
* mesa: add indirect drawing buffer parameter to draw functionsChristoph Bumiller2013-11-251-1/+2
| | | | | | | | | | | | Split from patch implementing ARB_draw_indirect. v2: Const-qualify the struct gl_buffer_object *indirect argument. v3: Fix up some more draw calls for new argument. v4: Fix up rebase conflicts in i965. v5: Undo const-qualification Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>