aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_tgsi.c
Commit message (Collapse)AuthorAgeFilesLines
* svga: abort shader translation upon indirect indexing of temporariesCharmaine Lee2017-09-081-0/+6
| | | | | | | | | | This patch aborts shader translation upon indirect indexing of temporary register on non-vgpu10 device. This prevents non-supported feature sending to the device. Tested wth MTT-piglit, glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: add guest statistic gathering interfaceCharmaine Lee2016-08-261-3/+9
| | | | | | | | | | | | With this patch, guest statistic gathering interface is added to svga winsys interface that can be used to gather svga driver statistic. The winsys module can then share the statistic info with the VMX host via the mksstats interface. The statistic enums used in the svga driver are defined in svga_stats_count and svga_stats_time in svga_winsys.h Reviewed-by: Brian Paul <[email protected]>
* svga: avoid freeing non-malloced memoryBrian Paul2016-03-291-10/+2
| | | | | | | | | | | svga_shader_expand() will fall back to using non-malloced memory for emit.buf if malloc fails. We should check if the memory is malloced before freeing it in the error path of svga_tgsi_vgpu9_translate. Original patch by Thomas Hindoe Paaboel Andersen <[email protected]>. Remove trivial svga_destroy_shader_emitter() function, by BrianP. Signed-off-by: Brian Paul <[email protected]>
* gallium/drivers: Sanitize NULL checks into canonical formEdward O'Callaghan2015-12-061-2/+2
| | | | | | | | | | Use NULL tests of the form `if (ptr)' or `if (!ptr)'. They do not depend on the definition of the symbol NULL. Further, they provide the opportunity for the accidental assignment, are clear and succinct. Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* svga: detect constant color writes in fragment shadersBrian Paul2015-10-221-0/+7
| | | | | | | | | | | | | | | | | | Examine the fragment shader to try to detect TGSI shaders which use "MOV OUT[0], CONST[i]" to write a constant value for the fragment color. In this case, all fragments will have the same color (unless blending is enabled). This is a common case for OpenGL code such as: glColor(), glBegin(), glVertex(), ..., glEnd() when lighting/fog/etc are disabled. In this case, the Mesa/gallium state tracker actually generates a simple "MOV OUT[0], CONST[i]" fragment shader. This will be used by the next commit to avoid provoking vertex conversion (creating/rewriting an index buffer) when drawing flat-shaded primitives. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: use new svga_new_shader_variant() functionBrian Paul2015-10-161-1/+1
| | | | | | To simplify upcoming new HUD shader count implementation. Reviewed-by: Charmaine Lee <[email protected]>
* svga: pass context to svga_tgsi_vgpu9_translate()Brian Paul2015-10-161-1/+2
| | | | | | Will be used for upcoming change. Reviewed-by: Charmaine Lee <[email protected]>
* svga: update driver for version 10 GPU interfaceBrian Paul2015-09-021-133/+12
| | | | | | | | | | | | | | | | | This is a squash commit of roughly two years of development work. Authors include: Brian Paul Charmaine Lee Thomas Hellstrom Jakob Bornecrantz Sinclair Yeh Mingcheng Chen Kai Ninomiya MengLin Wu The driver supports OpenGL 3.3. Signed-off-by: Brian Paul <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-1/+1
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* svga: refactor some shader codeBrian Paul2014-02-031-8/+0
| | | | | | | Put common code in new svga_shader.c file. Considate separate vertex/ fragment shader ID generation. Reviewed-by: Jose Fonseca <[email protected]>
* svga: rename shader_result -> variantBrian Paul2014-01-231-17/+17
| | | | | | | To be more consisten with other parts of gallium. Plus, update/add various comments. Reviewed-by: José Fonseca <[email protected]>
* svga: pass svga_compile_key by reference instead of valueBrian Paul2013-06-281-7/+7
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: reindent svga_tgsi.cBrian Paul2013-06-191-63/+65
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: initialize svga_compile_key to zeros to be safeBrian Paul2012-07-261-0/+4
|
* svga: emit some debug messages when shader compilation failsBrian Paul2012-07-051-4/+10
|
* svga: remove the special zero-stride vertex array codeBrian Paul2012-05-251-1/+0
| | | | | This code actually hasn't been needed for some time now. We can just treat a zero-stride vertex array like any other non-zero-stride array.
* svga: check that we don't exceed temp register limitBrian Paul2012-02-231-0/+4
| | | | | | | And assert on the register index in dst_register(). The dest can only be an output or temp reg and there's more of the later. Reviewed-by: Jose Fonseca <[email protected]>
* svga: fix varying var remapping for unused FS outputsBrian Paul2011-11-041-7/+20
| | | | | | | | If the VS has outputs that aren't consumed by the FS we were mapping them all to one unused VS output index, but that's illegal. Instead, map unused VS outputs to unique indexes. Reviewed-by: José Fonseca <[email protected]>
* svga: implement generic variable index remappingBrian Paul2011-11-031-3/+89
| | | | | | | | | | | | | | | | | | | | | | | | | The state tracker may generate shaders that use generic vs outputs / fs inputs like: DCL IN[0], GENERIC[0] DCL IN[1], GENERIC[10] DCL IN[2], GENERIC[11] This patch remaps 0, 10, 11 to small integers like 1, 2, 3 so that we stay inside the SVGA3D limit (8). The remapping is done to both the vertex shader outputs and the fragment shader inputs. The same mapping must be used for a vs/fs pair. Note that 'union svga_compile_key' is now 'struct svga_compile_key' because we needed to add the register remapping table. The change in size isn't really significant though (it's not a search key). Also, add assertions when building up SVGA3D src/dst registers to we don't try to store too large of value for the bitfield size. Reviewed-by: José Fonseca <[email protected]>
* svga: remove support for shader model 2.0Brian Paul2011-10-111-5/+2
| | | | | | We've been requiring SM 3.0 all along so this just removes unused code. Reviewed-by: Jose Fonseca <[email protected]>
* svga: clean up return values and error codesBrian Paul2011-09-231-2/+0
| | | | | | Previously we were using a hodge podge of int vs. pipe_enum and 0 vs. PIPE_OK. Some functions that always returned PIPE_OK were made void.
* svga: Integer constant register file has a separate namespace.Michal Krol2010-09-201-1/+1
| | | | | | Count int and float constants independently. Since there are only few i# constants available and hundreds of c# constants, it would be too easy to end up with an i# declaration out of its range.
* svga: Use a shader id as low as possible.José Fonseca2010-01-031-0/+2
|
* svga: Re-add shader dumping.José Fonseca2009-11-271-0/+14
|
* svga: Use consistent file names for dumping facilities.José Fonseca2009-11-271-1/+1
|
* svga: Add svga driverJakob Bornecrantz2009-11-171-0/+266