aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/nine_shader.h
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Use tgsi_to_nir when preferred IR is NIR.Timur Kristóf2019-06-051-0/+6
| | | | | | | | | This patch allows nine to read the preferred IR from pipe caps and use NIR when that is preferred by the driver, by calling tgsi_to_nir. Also adds some debug options that allow overriding it. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Cache constant buffer sizeAxel Davy2019-04-301-2/+10
| | | | | | | | | | | | The shader constant buffer size with the constant compaction code can vary depending on the shader variant compiled (for example if fog constants are required, etc). Thus instead of using fixed size for the shader, add in the variant cache the size required, pass it to the context, and use this value. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Propagate const_range to contextAxel Davy2019-04-301-3/+7
| | | | | | | | | As with the constant compaction we map the constant slots to new slots, we need to pass that information to the context which is in charge of uploading the constants. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Prepare constant compaction in nine_shaderAxel Davy2019-04-301-0/+2
| | | | | | | | | | | | | | When indirect addressing is not used, we know exactly which constants are accessed, and thus can have them located in consecutive slots. We thus parse again the shader with a slot map for compaction. The path contains the work inside nine_shader.c for this path, but it needs some other commits to work, and thus is not enabled yet by this commit. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Refactor shader constants ureg_src computationAxel Davy2019-04-301-23/+0
| | | | | | | Put the shader constant code in one place to better change that code in future commits. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Compact nine_ff_get_projected_keyAxel Davy2019-04-301-1/+1
| | | | | | | | Only the first four sampler slots can be used by ff ps < 0x14, thus the size of the key can be reduced. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Recompile optimized shaders based on b/i constsAxel Davy2019-04-301-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | Boolean and Integer constants are used in d3d9 for flow control. Boolean are used for if/then/else and Integer constants for loops. The compilers can generate better code if these values are known at compilation. I haven't met so far a game that would change the values of these constants frequently (and when they do, they set to the values used for the previous draw call, and thus the changes get filtered out). Thus it makes sense to inline these constants and recompile the shaders. The commit sets a bound to the number of variants for a given shader to avoid too many shaders to be generated. One drawback is it means more shader compilations. It would probably make sense to compile these shaders asynchronously or let the user control the behaviour with an env var, but this is not done here. The games I tested hit very few shader variants, and the performance impact was negligible, but it could help for games with uber shaders. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Change the way nine_shader gets the pipeAxel Davy2016-12-201-1/+3
| | | | | | | The change is required with csmt, where depending on the thread you don't access the pipe the same way. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Initial ProcessVertices supportAxel Davy2016-10-101-0/+75
| | | | | | | | For now only VS 3 support is implemented. This enables The Sims 2 to work. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add support for swvp constants in shadersAxel Davy2016-10-101-0/+2
| | | | | | | swvp has relaxed limits (more nested loops, etc). In particular it enables more constants. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix Pointsize in programmable shaderAxel Davy2016-05-181-47/+5
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Enforce centroid for color input when multisampling is onAxel Davy2016-02-041-0/+1
| | | | | | | | The color inputs must automatically use centroid whether multisampling is used or not. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Programmable ps D3DTTSS_PROJECTED supportAxel Davy2015-08-211-0/+1
| | | | | | The implementation used Wine tests for conformance Signed-off-by: Axel Davy <[email protected]>
* st/nine: Finish Fog implementationAxel Davy2015-08-211-0/+47
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement TEXBEM,TEXBEML and BEMTiziano Bacocco2015-08-211-0/+1
| | | | Signed-off-by: Tiziano Bacocco <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-6/+6
| | | | | | | | | | | | | | | | 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]>
* st/nine: Refactor how user constbufs sizes are calculatedAxel Davy2015-02-061-12/+10
| | | | | | | | Count explicitly the slots for float, int and bool constants, and deduce the constbuf size in nine_shader. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix vertex declarations for non-standard (usage/index)Axel Davy2014-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | Nine code to match vertex declaration to vs inputs was limiting the number of possible combinations. Some sm3 games have issues with that, because arbitrary (usage/index) can be used. This patch does the following changes to fix the problem: . Change the numbers given to (usage/index) combinations to uint16 . Do not put limits on the indices when it doesn't make sense . change the conversion rule (usage/index) -> number to fit all combinations . Instead of having a table usage_map mapping a (usage/index) number to an input index, usage_map maps input indices to their (usage/index) Cc: "10.4" <[email protected]> Tested-by: Yaroslav Andrusyak <[email protected]> Acked-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* nine: Add state tracker nine for Direct3D9 (v3)Joakim Sindholt2014-11-181-0/+142
Work of Joakim Sindholt (zhasha) and Christoph Bumiller (chrisbmr). DRI3 port done by Axel Davy (mannerov). v2: - nine_debug.c: klass extended from 32 chars to 96 (for sure) by glennk - Nine improvements by Axel Davy (which also fixed some wine tests) - by Emil Velikov: - convert to static/shared drivers - Sort and cleanup the includes - Use AM_CPPFLAGS for the defines - Add the linker garbage collector - Restrict the exported symbols (think llvm) v3: - small nine fixes - build system improvements by Emil Velikov v4: [Emil Velikov] - Do no link against libudev. No longer needed. Acked-by: Jose Fonseca <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Axel Davy <[email protected]> Signed-off-by: David Heidelberg <[email protected]>