summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeonsi/si_state_draw.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-15radeonsi: Fix off-by-one for maximum vertex element index in some casesMichel Dänzer1-2/+8
In cases where the vertex element size is smaller than the vertex buffer stride, the previous calculation could end up 1 too low. This would result in the GPU using index 0 instead of the maximum index for those elements, which would be visible as intermittent distorted triangles. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 4dca602521c51a4cb03855bda9c22b5ccc4829c7)
2013-03-04radeonsi: Fix up and enable flat shading.Michel Dänzer1-9/+1
Requires corresponding LLVM R600 backend fix to work correctly, but even without that it doesn't hang anymore. 13 more little piglits. Depends on LLVM: r175193, r175733 NOTE: This is a candidate for the 9.1 branch. (cherry picked from commit 18272c9b1b530ad6d2091b647c062793f94b5351)
2013-02-04radeonsi: Fix draws using user index buffer.Michel Dänzer1-4/+3
Was broken since commit bf469f4edc60bd1c5fd770cb231b8d5ab801427f ('gallium: add void *user_buffer in pipe_index_buffer'). Fixes 11 piglit tests and lots of missing geometry e.g. in TORCS. NOTE: This is a candidate for the 9.1 branch. (cherry picked from commit a8a5055f2dea1960898763d17f28043577c3e64e)
2013-01-21radeonsi: More assorted depth/stencil changes ported from r600g.Marek Olšák1-6/+13
[ Squashed port of the following r600g commits: - Michel Dänzer ] commit 428e37c2da420f7dc14a2ea265f2387270f9bee1 Author: Marek Olšák <maraeo@gmail.com> Date: Tue Oct 2 22:02:54 2012 +0200 r600g: add in-place DB decompression and texturing with DB tiling The decompression is done in-place and only the compressed tiles are decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F. The texture unit is programmed to use non-displayable tiling and depth ordering of samples, so that it can fetch the texture in the native DB format. The latest version of the libdrm surface allocator is required for stencil texturing to work. The old one didn't create the mipmap tree correctly. We need a separate mipmap tree for stencil, because the stencil mipmap offsets are not really depth offsets/4. There are still some known bugs, but this should save some memory and it also improves performance a little bit in Lightsmark (especially with low resolutions; tested with Radeon HD 5000). The DB->CB copy is still used for transfers. commit e2f623f1d6da9bc987582ff68d0471061ae44030 Author: Marek Olšák <maraeo@gmail.com> Date: Sat Jul 28 13:55:59 2012 +0200 r600g: don't decompress depth or stencil if there isn't any commit 43e226b6efb77db2247741cc2057d9625a2cfa05 Author: Marek Olšák <maraeo@gmail.com> Date: Wed Jul 18 00:32:50 2012 +0200 r600g: optimize uploading depth textures Make it only copy the portion of a depth texture being uploaded and not the whole 2D layer. There is also a little code cleanup. commit b242adbe5cfa165b252064a1ea36f802d8251ef1 Author: Marek Olšák <maraeo@gmail.com> Date: Wed Jul 18 00:17:46 2012 +0200 r600g: remove needless wrapper r600_texture_depth_flush commit 611dd529425281d73f1f0ad2000362d4a5525a25 Author: Marek Olšák <maraeo@gmail.com> Date: Wed Jul 18 00:05:14 2012 +0200 r600g: init_flushed_depth_texture should be able to report errors commit 80755ff56317446a8c89e611edc1fdf320d6779b Author: Marek Olšák <maraeo@gmail.com> Date: Sat Jul 14 17:06:27 2012 +0200 r600g: properly track which textures are depth This fixes the issue with have_depth_texture never being set to false. commit fe1fd675565231b49d3ac53d0b4bec39d8bc6781 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Jul 8 03:10:37 2012 +0200 r600g: don't flush depth textures set as colorbuffers The only case a depth buffer can be set as a color buffer is when flushing. That wasn't always the case, but now this code isn't required anymore. commit 5a17d8318ec2c20bf86275044dc8f715105a88e7 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Jul 8 02:14:18 2012 +0200 r600g: flush depth textures bound to vertex shaders This was missing/broken. There are also minor code cleanups. commit dee58f94af833906863b0ff2955b20f3ab407e63 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Jul 8 01:54:24 2012 +0200 r600g: do fine-grained depth texture flushing - maintain a mask of which mipmap levels are dirty (instead of one big flag) - only flush what was requested at a given point and not the whole resource (most often only one level and one layer has to be flushed) Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17radeonsi: Set SPI_SHADER_COL_FORMAT to what the pixel shader actually exports.Michel Dänzer1-0/+2
Instead of deriving it from the colour buffer formats only. Fixes a number of piglit tests which export depth from the pixel shader. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28radeonsi: Flesh out support for depth/stencil exports from the pixel shader.Michel Dänzer1-4/+9
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-12radeonsi: Implement alpha testing in pixel shader.Michel Dänzer1-22/+1
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-10-26radeonsi: Handle TGSI_SEMANTIC_FACE.Michel Dänzer1-1/+4
Fixes two piglit tests using gl_FrontFacing. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26radeonsi: Handle TGSI_SEMANTIC_BCOLOR.Michel Dänzer1-4/+15
Put the back face colour right after the front face colour in the LDS parameter space. Fixes 18 piglit tests related to two sided lighting. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-02radeonsi: Fix double compilation of shader variants.Michel Dänzer1-6/+0
Fixes crash in piglit glsl-max-varyings. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02radeonsi: Better indexing of parameters in the pixel shader.Michel Dänzer1-4/+5
We were previously using the TGSI input index, which can exceed the number of parameters passed from the vertex shader via the parameter cache. Now we use a separate index which only counts those parameters. Prevents piglit regressions with the following fix. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-01radeonsi: define SGPR register numbersChristian König1-3/+3
Instead of hardcoding them. Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-09-26radeonsi: move draw cmds to si_commands.cChristian Koenig1-14/+8
Signed-off-by: Christian Koenig <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26radeonsi: start reworking inferred state handlingChristian König1-3/+1
Instead of tracking the inferred state changes separately just check if queued and emitted states are the same. This patch just reworks the update of the SPI map between vs and ps, but there are probably more cases like this. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-12radeonsi: Fix calculation of number of records in buffer resource.Michel Dänzer1-1/+1
The value was too small by 1 in some cases (non-first of several vertex elements interleaved in a single buffer). Fixes intermittent incorrect geometry in many apps, e.g. piglit spec/EXT_texture_snorm/fbo-generatemipmap-formats. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-11radeonsi: Handle position input parameter for pixel shaders v2Tom Stellard1-0/+16
v2: - Don't increment ninterp or set any of the have_* flags for TGSI_SEMANTIC_POSITION Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11radeonsi: Move interpolation mode check into the compilerTom Stellard1-11/+9
The compiler needs to know which interpolation modes are enabled, so it knows which values will be preloaded into the VGPRs. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11radeonsi: Add missing interpolation mode to check for enabled modesTom Stellard1-0/+1
At least one interpolation mode must be enable, but the code that checks this was not checking for perspective center. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-30radeonsi: fix stupid bug added in commit ↵Christian König1-7/+8
07838603b9a69c05911edbcd351bfce5ad9b5a2c Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27radeonsi: Use FP16 shader export format when necessary / possible.Michel Dänzer1-4/+0
Fixes piglit fbo-blending-formats. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27radeonsi: Maintain cache of pixel shader variants according to contxt state.Michel Dänzer1-17/+20
Mostly inspired by r600g commit 4acf71f01ea1edb253cd38cc059d4af1a2a40bf4 ('r600g: cache shader variants instead of rebuilding v3'). Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-22radeonsi: fix SPI_PS_INPUT_ENA handlingChristian König1-3/+14
We need to enable at least one interpolation mode, otherwise the GPU will hang. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-16radeonsi: Fix symbol conflicts with r600g.Michel Dänzer1-2/+2
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50389 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15radeonsi: move vertex state descriptors into PM4 streamChristian König1-27/+9
Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-11radeonsi: move drawing into new state handlingChristian König1-37/+71
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11radeonsi: move sync handling into new state handlerChristian König1-4/+8
So we can remove all the old atom handling. Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11radeonsi: separate and disable streamout for nowChristian König1-0/+2
I have my doubts that this code still works on SI. Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11radeonsi: remove ps_partial_flushChristian König1-1/+1
Not needed any more. Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11radeonsi: cleanup shader headersChristian König1-0/+1
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-08radeonsi: If pixel shader compilation fails, use a dummy shader.Michel Dänzer1-0/+7
Otherwise we're likely to hang the GPU. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-30radeonsi: fix vertex buffer and elementsChristian König1-50/+30
Let's just use the T# descriptors until we get a fetch shader. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30radeonsi: rename r600_resource to si_resourceChristian König1-6/+5
Also split it into seperate header and add some helper functions. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-24radeonsi: remove old state handlingChristian König1-4/+0
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24radeonsi: move draw state into new handlingChristian König1-0/+572
Split it out into si_state_draw.c Signed-off-by: Christian König <deathsimple@vodafone.de>