aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/nine_state.h
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Fix usage of rasterizer multisample bit.Axel Davy2016-05-181-3/+5
| | | | | | | | | | | pipe_rasterizer multisample bit should be enabled only when really wanting to do multisampling, thus we should disable when not having msaa render target. This fixes some depth calculation precision issues on radeon. Also disable it when depth and stencil tests are disabled, since in that case multisampling is same as not multisampled. Signed-off-by: Axel Davy <[email protected]>
* st/nine: ATOC has effect only with ALPHATESTENABLEAxel Davy2016-05-181-0/+4
| | | | | | | ATOC extension does something only when alpha test is enabled. Use a second bit to encode the difference with ATIATOC. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix Pointsize in programmable shaderAxel Davy2016-05-181-2/+3
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use fast clears more often for MRTsAxel Davy2016-02-041-1/+1
| | | | | | | | | | | | | | | | | | This enables to use fast clears in the following case: pixel shader renders to 1 RT 4 RT bound clear new pixel shader bound that renders to 4 RTs Previously the fast clear path wouldn't be hit, because when trying the fast clear path, the framebuffer state would be configured for 1 RT, instead of 4. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Add Render state validation layerAxel Davy2016-02-041-0/+1
| | | | | | | | | | | | | | | | | | Testing Win behaviour seems to show wrong states are accepted, but then depending on the states some specific 'good' behaviours happen. This adds some validation to catch invalid states and have these 'good' behaviours when it happens. Also reorders SetRenderState to match the expected optimisation: (Value == previous Value) => return immediately, which affects D3D9 hacks too. Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Introduce STREAMFREQ stateAxel Davy2016-02-041-17/+18
| | | | | | | | | | | | | | | | | | | | Previous vertex elements code update was protected by 'if ((group & (NINE_STATE_VDECL | NINE_STATE_VS)) || state->changed.stream_freq & ~1)' itself protected by 'if (group & (NINE_STATE_COMMON | NINE_STATE_VS))' If no state is changed except the stream frequency, no update would happen. This patch solves the problem by adding a new NINE_STATE_STREAMFREQ state. Another way would be to add state->changed.stream_freq & ~1 check to the main test. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Use ff vertex shader when position_t is usedAxel Davy2016-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | When an application sets a vertex shader, we are supposed to use it, and when no vertex shader are set, we are supposed to revert to fixed function vertex shader. It seems there is an exception: when the vertex declaration has a position_t index, we should revert to fixed function vertex shader. Up to know we were checking if device->state.vs is set to know whether to use programmable shader or not. With this commit we determine whether we use programmable shader or not when vertex shader/declaration are set, but stateblocks do complicate things a bit. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix the number of texture stagesAxel Davy2015-08-211-3/+5
| | | | | | | | | | | The number of texture stages is 8. 'tex_stage' array was too big, and thus the checks with 'Elements(state->ff.tex_stage)' were passing, causing some invalid API calls to pass, and crash because of out of bounds write since bumpmap_vars was just the correct size. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use CSO cache for sampler viewsAxel Davy2015-08-211-1/+0
| | | | | | | | The CSO cache unbinds views that are not needed anymore, which we don't do. It checks for change before committing the views. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove NINED3DRS_ZBIASSCALEAxel Davy2015-08-211-2/+1
| | | | | | | | | It wasn't giving the expected result. This fixes some object being transparents in games like FEAR. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Programmable ps D3DTTSS_PROJECTED supportAxel Davy2015-08-211-2/+3
| | | | | | The implementation used Wine tests for conformance Signed-off-by: Axel Davy <[email protected]>
* st/nine: Finish Fog implementationAxel Davy2015-08-211-2/+3
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework shader statesAxel Davy2015-08-211-2/+2
| | | | | | | Separate state setting and commit Changes how the shader key is computed Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework ff constant buffersAxel Davy2015-08-211-4/+2
| | | | | | | | | Always use a user constant buffer for ff. It means we have to: . commit the user constant buffer for ff when we use it . commit back the non-ff constant buffer when we stop using it Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework constant buffer state handlingAxel Davy2015-08-211-0/+5
| | | | | | | | | | | | | | | | We have two paths: . One that uses a fixed constant buffer, and updates it when needed . One that uses a user constant buffer, and uploads it when needed. This patch separates the preparation of the constant buffer and the commit. It also removes NineDevice9_RestoreNonCSOState, which was used to restore all states. Instead the commit of the constant buffer is moved to nine_state, and the other field settings moved to other functions where more appropriate. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework blend statesAxel Davy2015-08-211-0/+2
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework rasterizer statesAxel Davy2015-08-211-0/+2
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <[email protected]>
* st/nine: Reorder DSA state settingsAxel Davy2015-08-211-0/+7
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove group_mask argument from nine_update_stateAxel Davy2015-08-211-1/+2
| | | | | | | It was only used to discriminate update framebuffer vs update everything. Instead use two functions. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement TEXBEM,TEXBEML and BEMTiziano Bacocco2015-08-211-0/+2
| | | | Signed-off-by: Tiziano Bacocco <[email protected]>
* st/nine: Account POINTSIZE_MIN and POINTSIZE_MAX for point sizePatrick Rudolph2015-08-211-11/+10
| | | | | | | | | | When using D3DRS_POINTSIZE make sure the value is at least D3DRS_POINTSIZE_MIN but not greater than D3DRS_POINTSIZE_MAX. Fixes some Wine tests. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* util: Move gallium's linked list to utilJason Ekstrand2015-05-081-1/+1
| | | | | | | | | The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* st/nine: Implement dummy vbo behaviour when vs is missing inputsTiziano Bacocco2015-02-061-0/+3
| | | | | | | | | | | Use a dummy vertex buffer object when vs inputs have no corresponding entries in the vertex declaration. This dummy buffer will give to the shader float4(0,0,0,0). This fixes several artifacts on some games. Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Tiziano Bacocco <[email protected]>
* st/nine: Dummy sampler should have a=1Axel Davy2015-02-061-0/+2
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement AMD alpha to coverageAxel Davy2015-02-061-1/+2
| | | | | | | | | This D3D hack is supposed to be supported by all AMD SM2+ cards. Apps use it without checking if they are on AMD. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Commit sampler views again if srgb state changed.Axel Davy2015-02-061-0/+1
| | | | | | | | | | | | This fixes a wine test and some minor visual issues on some games. The patch is not optimal, there is probably a more efficient way to fix this issue, but the code there already has some innefficiencies. There is plans to rewrite that part of the code to make it more efficient. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Check for the correct number of constants.Axel Davy2015-02-061-0/+1
| | | | | | | | | | | | | | | | | This removes unneeded hack for Anno 1404. This app is not checking the number of supporting constants, and rely on the shader compilation to fail if it puts too many constants. This patch also checks for the correct number of constants for ps. Note that we don't check the official limitations for old vs and ps versions. The restrictions were fixed, unlike for the number of vertex shader constants for later versions. Likely apps use the correct number, and it's not a problem for us if it wants use more. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Refactor how user constbufs sizes are calculatedAxel Davy2015-02-061-5/+0
| | | | | | | | 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: Allocate vs constbuf buffer for indirect addressing once.Axel Davy2015-01-221-0/+1
| | | | | | | | | | | | | | | When the shader does indirect addressing on the constants, we allocate a temporary constant buffer to which we copy the constants from the app given user constants and the constants filled in the shader. This patch makes this buffer be allocated once. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Tiziano Bacocco <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Allocate the correct size for the user constant bufferAxel Davy2015-01-221-1/+1
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* nine: Add state tracker nine for Direct3D9 (v3)Joakim Sindholt2014-11-181-0/+234
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]>