summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_shader.c
Commit message (Collapse)AuthorAgeFilesLines
* r600g: fix tgsi_op2_s with trans-only instructionsVadim Girlin2013-10-131-5/+31
| | | | | | | | | | | | | | | | | | This fixes the issue when dst and src is the same reg and operation on one channel overwrites the source for other channels, e.g.: UMUL TEMP[2].xyz, TEMP[0].xyzz, TEMP[2].xxxx In this example the result of the operation on channel x is written in TEMP[2].x and then used as a second source operand for channels y and z instead of original value in TEMP[2].x. This patch stores the results in temp reg and moves them to dst after performing operation on all channels. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70327 Signed-off-by: Vadim Girlin <[email protected]>
* r600g: texture offsets for non-TXF instructionsGrigori Goronzy2013-10-041-10/+10
| | | | | | | All texture instructions can use offsets, not just TXF. Offsets into the literals array were wrong, too. Signed-off-by: Marek Olšák <[email protected]>
* r600/llvm: Adds support for MSAAVincent Lejeune2013-10-021-0/+2
|
* r600g/llvm: fix txq for texture bufferVincent Lejeune2013-10-021-0/+1
|
* r600g: move the low-level buffer functions for multiple rings to drivers/radeonMarek Olšák2013-09-291-1/+1
| | | | Also slightly optimize r600_buffer_map_sync_with_rings.
* radeonsi: move debug options to R600_DEBUGMarek Olšák2013-09-291-29/+2
|
* r600g: move some debug options to drivers/radeonMarek Olšák2013-09-291-7/+7
|
* r600g: move streamout state to drivers/radeonMarek Olšák2013-08-311-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | This streamout state code will be used by radeonsi. There are new structures r600_common_context and r600_common_screen. What is inherited by what is shown here: pipe_context -> r600_common_context -> r600_context pipe_screen -> r600_common_screen -> r600_screen The common structures reside in drivers/radeon. Currently they only contain enough functionality to be able to handle streamout. Eventually I'd like the whole pipe_screen implementation to be shared and some of the context stuff too. This is quite big, but most changes are because of the new structures and the fact r600_write_value is replaced by radeon_emit. Thanks to Tom Stellard for fixing the build for r600g/compute. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Christian König <[email protected]> Tested-by: Tom Stellard <[email protected]>
* r600g: enable SB backend by defaultVadim Girlin2013-08-301-1/+1
| | | | | | | Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: fix color exports when we have no CBsVadim Girlin2013-08-301-3/+4
| | | | | | | We need to export at least one color if the shader writes it, even when nr_cbufs==0. Signed-off-by: Vadim Girlin <[email protected]>
* r600g: Implement the new float comparison instructions for Cayman as well.Henri Verbeet2013-08-251-4/+4
| | | | | | | | I assume this should have been part of commit 7727fbb7c5d64348994bce6682e681d6181a91e9. This (obviously) fixes a lot tests. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r600/radeonsi: implement new float comparison instructionsRoland Scheidegger2013-08-151-10/+8
| | | | | | | Also use ordered comparisons for old cmp instructions. Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* r600g: honour semantic index in fragment color exportsChristoph Bumiller2013-08-021-5/+5
| | | | Signed-off-by: Marek Olšák <[email protected]>
* tgsi: rename the TGSI fragment kill opcodesBrian Paul2013-07-121-7/+7
| | | | | | | | | | | | | | | | | | | | | TGSI_OPCODE_KIL and KILP had confusing names. The former was conditional kill (if any src component < 0). The later was unconditional kill. At one time KILP was supposed to work with NV-style condition codes/predicates but we never had that in TGSI. This patch renames both opcodes: TGSI_OPCODE_KIL -> KILL_IF (kill if src.xyzw < 0) TGSI_OPCODE_KILP -> KILL (unconditional kill) Note: I didn't just transpose the opcode names to help ensure that I didn't miss updating any code anywhere. I believe I've updated all the relevant code and comments but I'm not 100% sure that some drivers had this right in the first place. For example, the radeon driver might have llvm.AMDGPU.kill and llvm.AMDGPU.kilp mixed up. Driver authors should review their code. Reviewed-by: Jose Fonseca <[email protected]>
* r600g/compute: Move compute_shader_create() function into evergreen_compute.cTom Stellard2013-06-281-32/+0
| | | | Tested-by: Aaron Watry <[email protected]>
* gallium: replace bswap_32 calls with util_bswap32Jonathan Gray2013-06-171-2/+2
| | | | | | | | | byteswap.h and bswap_32 aren't portable, replace them with calls to gallium's util_bswap32 as suggested by Mark Kettenis. Lets these files build on OpenBSD. Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* r600g/llvm: Fix cubearray textureSizeVincent Lejeune2013-05-201-0/+1
|
* r600g: fixup for MSAA texture support checkingNiels Ole Salscheider2013-05-161-1/+1
| | | | Signed-off-by: Niels Ole Salscheider <[email protected]>
* r600g: cleanup MSAA texture support checkingMarek Olšák2013-05-151-2/+3
| | | | Reviewed-by: Alex Deucher <[email protected]>
* r600g: increase array size for shader inputs and outputsMarek Olšák2013-05-101-0/+2
| | | | | | | and add assertions to prevent buffer overflow. This fixes corruption of the r600_shader struct. NOTE: This is a candidate for the stable branches.
* r600g/llvm: Don't feed LLVM output through r600_bytecode_build()Tom Stellard2013-05-061-388/+13
| | | | | The LLVM backend emits raw ISA now, so we can just its output unmodified.
* r600g/llvm: Don't emit CALL_FS for vertex shadersTom Stellard2013-05-061-7/+9
| | | | The LLVM backend takes care of this now.
* r600g/sb: use hex instead of binary constantsVadim Girlin2013-05-031-3/+3
| | | | | | This should fix build issues with GCC < 4.3 Signed-off-by: Vadim Girlin <[email protected]>
* r600g: use old shader disassembler by defaultVadim Girlin2013-05-031-13/+9
| | | | | | | | | | | | | | New disassembler is not completely isolated yet from further processing in r600g/sb that is not required for printing the dump, so it has higher probability to fail in case of any unexpected features in the bytecode. This patch adds "sbdisasm" flag for R600_DEBUG that allows to use new disassembler in r600g/sb for shader dumps when shader optimization is not enabled. If shader optimization is enabled, new disassembler is used by default. Signed-off-by: Vadim Girlin <[email protected]>
* r600g: plug in optimizing backendVadim Girlin2013-04-301-2/+77
| | | | | | Optimization is enabled with "R600_DEBUG=sb". Signed-off-by: Vadim Girlin <[email protected]>
* r600g: mask unused source components for SAMPLEVadim Girlin2013-04-301-0/+20
| | | | | | | | This results in more clean shader code and may improve the quality of optimized code produced by r600-sb due to eliminated false dependencies in some cases. Signed-off-by: Vadim Girlin <[email protected]>
* r600g/llvm: Fix opencl buildVincent Lejeune2013-04-301-1/+1
|
* r600g/llvm: get use_kill from compiler shaderVincent Lejeune2013-04-301-1/+5
|
* r600g/llvm: Pass struct r600_bytecode to r600_llvm_compileTom Stellard2013-04-241-2/+2
| | | | | | This way we don't need to update the function signature everytime we emit a new config value. This also fixes the build with --enable-opencl.
* r600/llvm: Read stacksize from config headerVincent Lejeune2013-04-231-2/+1
|
* /bin/bash: q : commande introuvableVincent Lejeune2013-04-231-1/+1
|
* r600g: Fix build with --enable-openclTom Stellard2013-04-181-1/+2
|
* r600g/llvm: Use gprcount from llvmVincent Lejeune2013-04-171-1/+1
|
* gallium: Disambiguate TGSI_OPCODE_IF.José Fonseca2013-04-171-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TGSI_OPCODE_IF condition had two possible interpretations: - src.x != 0.0f - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was false either for vertex and fragment shaders - gallivm/llvmpipe - postprocess - vl state tracker - vega state tracker - most old drivers - old internal state trackers - many graw examples - src.x != 0U - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was true for both vertex and fragment shaders - tgsi_exec/softpipe - r600 - radeonsi - nv50 And drivers that use draw module also were a mess (because Mesa would emit float IFs, but draw module supports native integers so it would interpret IF arg as integers...) This sort of works if the source argument is limited to float +0.0f or +1.0f, integer 0, but would fail if source is float -0.0f, or integer in the float NaN range. It could also fail if source is integer 1, and hardware flushes denormalized numbers to zero. But with this change there are now two opcodes, IF and UIF, with clear meaning. Drivers that do not support native integers do not need to worry about UIF. However, for backwards compatibility with old state trackers and examples, it is advisable that native integer capable drivers also support the float IF opcode. I tried to implement this for r600 and radeonsi based on the surrounding code. I couldn't do this for nouveau, so I just shunted IF/UIF together, which matches the current behavior. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]> v2: - Incorporate Roland's feedback. - Fix r600_shader.c merge conflict. - Fix typo in radeon, spotted by Michel Dänzer. - Incorporte Christoph Bumiller's patch to handle TGSI_OPCODE_IF(float) properly in nv50/ir.
* gallium: Eliminate TGSI_OPCODE_IFC.José Fonseca2013-04-171-3/+6
| | | | | | Never used or implemented. Reviewed-by: Roland Scheidegger <[email protected]>
* r600g: Workaround for a harware bug with nested loops on CaymanMartin Andersson2013-04-161-3/+15
| | | | | | | | | | | | | | | | There is a hardware bug on Cayman where a BREAK/CONTINUE followed by LOOP_STARTxxx for nested loops may put the branch stack into a state such that ALU_PUSH_BEFORE doesn't work as expected. Workaround this by replacing the ALU_PUSH_BEFORE with a PUSH + ALU Fixes piglit tests EXT_transform_feedback/order* v2: Use existing loop count and improve comment v3: [Vadim Girlin] Set jump address for PUSH instructions NOTE: This is a candidate for the 9.1 branch Signed-off-by: Vadim Girlin <[email protected]>
* r600g: fix two issues in compressed msaa reading codeDave Airlie2013-04-111-2/+2
| | | | | | | | | I've no idea when sample_chan would ever be 4 here, but 4 is most definitely wrong, array textures have it as 3 as well. Also the cayman code though unused is obviously wrong. Signed-off-by: Dave Airlie <[email protected]>
* r600g: Fix UMAD on CaymanMartin Andersson2013-04-091-13/+32
| | | | | | | | | | | | The multiplication part of tgsi_umad did not work on Cayman, because it did not populate the correct vector slots. This fixed hardlocks in the EXT_transform_feedback/order tests. NOTE: This is a candidate for the stable branches. (might not be easy to cherry-pick though) Signed-off-by: Marek Olšák <[email protected]>
* r600g/llvm: Workaround for wrong tex.offset_*Vincent Lejeune2013-04-041-0/+3
|
* r600g/llvm: Do not change cf_alu inst when adding alusVincent Lejeune2013-04-031-7/+2
|
* r600g: don't reserve more stack space than required v5Vadim Girlin2013-04-021-44/+87
| | | | | | | | | | | Reduced stack size allows to run more threads in some cases, improving performance for the shaders that use stack (that is, for the shaders with control flow instructions). E.g. with unigine-based apps. v4: implement exact computation taking into account wavefront size v5: add cases for RV620, RS880 Signed-off-by: Vadim Girlin <[email protected]>
* r600g: fix range handling for tgsi input declarations v2Vadim Girlin2013-04-021-3/+7
| | | | Signed-off-by: Vadim Girlin <[email protected]>
* r600g/llvm: Use stack_size provided from llvm.Vincent Lejeune2013-04-011-0/+1
|
* r600g/llvm: Add support for cf_alu native encodeVincent Lejeune2013-04-011-0/+14
|
* r600g/llvm: use native encode for texVincent Lejeune2013-03-311-23/+27
|
* r600g/llvm: Fix buildTom Stellard2013-03-111-1/+1
|
* r600g: atomize vertex shaderMarek Olšák2013-03-111-0/+1
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: inline r600_pipe_shader functionMarek Olšák2013-03-111-48/+41
| | | | | | also change names of other functions, so that they make sense Reviewed-by: Jerome Glisse <[email protected]>
* r600g: use a single env var R600_DEBUG, disable bytecode dumpingMarek Olšák2013-03-111-25/+37
| | | | | | | | | | | | | | | | | | | | | | | | | Only the disassembler is used to dump shaders. Here's a few examples how to use R600_DEBUG. Log compute info: R600_DEBUG=compute Dump all shaders: R600_DEBUG=fs,vs,gs,ps,cs Dump pixel shaders only: R600_DEBUG=ps Disable Hyper-Z: R600_DEBUG=nohyperz Disable the LLVM backend: R600_DEBUG=nollvm Or use any combination of the above, or print all options: R600_DEBUG=help Reviewed-by: Tom Stellard <[email protected]>
* r600g/llvm: Fix alpha_to_one piglit testsVincent Lejeune2013-02-181-0/+1
| | | | Reviewed-by: Tom Stellard <thomas.stellard at amd.com>