summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
Commit message (Collapse)AuthorAgeFilesLines
* st/xa: Use PIPE_FORMAT_R8_UNORM when availableThomas Hellstrom2015-09-172-34/+34
| | | | | | | | | | | | XA has been using L8_UNORM for a8 and yuv component surfaces. This commit instead makes XA prefer R8_UNORM since it's assumed to have a higher availability. Also neither of these formats are suitable as destination formats using destination alpha blending, so reject those operations. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* clover: Avoid using typename to allow compilation of clover by clangAlbert Freeman2015-09-101-1/+1
| | | | | | | | | | | | | | | | When parsing an variable declaration qualified with the typename keyword, clang attempted to declare a variable with the type of non type member "enum type type" of module::argument (within the header file clover/core/module.hpp) instead of the typed member of module::argument "enum type". Replaced "typename" with "enum" to force clang to declare the variable marg_type with type "enum type" of module::argument. CC: "11.0" <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Albert Freeman <[email protected]>
* xa: add xa_surface_from_handle2 v2Rob Clark2015-09-072-11/+44
| | | | | | | | | | | | | | | | | Like xa_surface_from_handle(), but takes a handle type, rather than hard-coding 'shared' handle. This is needed to fix bugs seen with xf86-video-freedreno with xrandr rotation, for example. The root issue is that doing a GEM_OPEN ioctl on a bo that already has a GEM handle associated with the drm_file will result in two unique handles for the same bo. Which causes all sorts of follow-on fail. v2: - Add support for for fd handles. - Avoid duplicating code. - Bump xa version minor. Signed-off-by: Rob Clark <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
* gallium: add flags parameter to pipe_screen::context_createMarek Olšák2015-08-269-10/+11
| | | | | | | | This allows creating compute-only and debug contexts. Reviewed-by: Brian Paul <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
* st/nine: Always use user constant buffersKrzysztof Sobiecki2015-08-211-1/+3
| | | | | | | | | | | | | | We had several reports of users hitting bugs with the other path to upload constants, and switching to the user constant buffer path solves the bugs. User constant buffers are expected to be slower for Nvidia cards, so ideally this patch should be reverted when the path is fixed. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Krzysztof Sobiecki <[email protected]>
* st/nine: Silent warning in nine_ffAxel Davy2015-08-211-0/+2
| | | | | | release build was complaining Signed-off-by: Axel Davy <[email protected]>
* st/nine: Silent warning in sm1_declusage_to_tgsiAxel Davy2015-08-211-1/+1
| | | | | | release build was complaining Signed-off-by: Axel Davy <[email protected]>
* st/nine: Silent warning in NineCubeTexture9_ctorAxel Davy2015-08-211-1/+1
| | | | | | The compiler was complaining the value may be uninitialised when it is used (which is wrong). Initialize to NULL to silent the warning.
* st/nine: Silent warning in update_vertex_bufferAxel Davy2015-08-211-1/+0
| | | | There was an unused variable
* st/nine: Catch setting the same shaderAxel Davy2015-08-211-0/+6
| | | | | | | | This is quite rare that an app does set again the same shaders, but it isn't an expensive check either. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid Constant upload when there is no changeAxel Davy2015-08-211-0/+42
| | | | | | | | | | | It is very common for d3d9 apps to set again the constants they need before every draw call, even if nothing changed. Since we are mostly gpu bound, it is better to check for change, and upload constants again (and thus use gpu bandwith) only if the constants changed. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix the number of texture stagesAxel Davy2015-08-212-4/+6
| | | | | | | | | | | 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-214-23/+5
| | | | | | | | 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: Calculate dummy sampler state only onceAxel Davy2015-08-213-35/+24
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Better check shader constant limitsAxel Davy2015-08-211-9/+27
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove NINED3DRS_ZBIASSCALEAxel Davy2015-08-213-23/+12
| | | | | | | | | 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: Implement special DOTPRODUCT3 behaviourAxel Davy2015-08-211-0/+4
| | | | | | Taken from wine tests Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement ff vertex data passthroughAxel Davy2015-08-211-7/+61
| | | | | | Fixes Wine tests Signed-off-by: Axel Davy <[email protected]>
* st/nine: Change nine_state_update orderAxel Davy2015-08-211-63/+76
| | | | | | | | | nine_update_state called every draw call. This patch attemps to change the order of the checks to have better control flow Signed-off-by: Axel Davy <[email protected]>
* st/nine: Programmable ps D3DTTSS_PROJECTED supportAxel Davy2015-08-217-8/+74
| | | | | | The implementation used Wine tests for conformance Signed-off-by: Axel Davy <[email protected]>
* st/nine: Complete ff texture transform implementationAxel Davy2015-08-213-70/+174
| | | | | | Wine tests were used to get it right. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Change a few advertised capsAxel Davy2015-08-211-15/+11
| | | | | | | | | There were flags all sm3 cards do advertise, and we weren't. Some games can trigger buggy rendering path if the caps are not what they expect. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Advertise Fog flagsAxel Davy2015-08-211-6/+6
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Revert to userbuf path when neededAxel Davy2015-08-211-0/+11
| | | | | | | | Automatically switch to userbuf path when we would need to upload fog or bumpmat constants Signed-off-by: Axel Davy <[email protected]>
* st/nine: Finish Fog implementationAxel Davy2015-08-218-26/+147
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework shader statesAxel Davy2015-08-216-115/+207
| | | | | | | Separate state setting and commit Changes how the shader key is computed Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove some useless variablesAxel Davy2015-08-212-2/+0
| | | | | Signed-off-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]>
* st/nine: Fix nine_ff_ps_key paddingAxel Davy2015-08-211-1/+3
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Begin programmable shader fog supportAxel Davy2015-08-211-7/+42
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix fixed function fog supportAxel Davy2015-08-211-34/+19
| | | | | | Previous code had only a subcase of fog working right. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework ff constant buffersAxel Davy2015-08-214-87/+57
| | | | | | | | | 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-215-342/+337
| | | | | | | | | | | | | | | | 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-214-10/+21
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <[email protected]>
* st/nine: Improve fallback when driver doesn't support user buffers.Axel Davy2015-08-214-18/+103
| | | | | | | | | | | For now the path updated is only used by Amd drivers, but a later patch will make it used by all drivers. Some drivers like llvmpipe doesn't support the uploading of constants from user buffers, so improve the path to work for all drivers Inspired from the gl state tracker. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid useless updates in SetSamplerStateAxel Davy2015-08-211-5/+7
| | | | | | | Check for redundant settings Signed-off-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]>
* st/nine: Rework rasterizer statesAxel Davy2015-08-214-12/+22
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <[email protected]>
* st/nine: Reorder DSA state settingsAxel Davy2015-08-214-11/+30
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <[email protected]>
* st/nine: Reorder nine_state.Axel Davy2015-08-211-31/+43
| | | | | | | | | | | | Instead of mixing state preparation (filling pipe_****) and state commit (pipe->set_*****), begin doing so in two separate functions. This will allow to implement efficient Stateblocks, and eventually lead to optimisation where the complete pipe_*** structure is only partially updated. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove group_mask argument from nine_update_stateAxel Davy2015-08-214-14/+28
| | | | | | | 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-217-8/+165
| | | | Signed-off-by: Tiziano Bacocco <[email protected]>
* st/nine: Fix use of uninitialized valuesPatrick Rudolph2015-08-211-1/+3
| | | | | | | Set all values to 0 after allocation. Found using valgrind. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Prevent possible crashPatrick Rudolph2015-08-211-1/+2
| | | | | | | | In case NineBaseTexture9_ctor returns an error This->surfaces[l] might be NULL. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Return correct error codes in NineDevice9_ResetPatrick Rudolph2015-08-212-3/+5
| | | | | | | | Allow more than two errors, and return D3DERR_INVALIDCALL for failed display resolution changes. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Fail on D3DUSAGE_DYNAMIC for D3DPOOL_SCRATCH texturesPatrick Rudolph2015-08-211-1/+2
| | | | | | | Texture with pool D3DPOOL_SCRATCH and D3DPOOL_MANAGED cannot be used with flag D3DUSAGE_DYNAMIC. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Fix Lock Checks for Compressed texturesAxel Davy2015-08-212-8/+11
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Impose restrictions on DXTN texture sizesAxel Davy2015-08-214-0/+28
| | | | | | | | | This is the expected behaviour. Fixes wine tests. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]>
* st/nine: Return NULL pointer in lock error casesPatrick Rudolph2015-08-212-7/+14
| | | | | | | | Tests showed, that in case of errors, the pBits pointer is set to NULL. The pBits field isn't set to NULL in case of an already locked object. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Fix resource SetPriority/GetPriorityPatrick Rudolph2015-08-211-2/+8
| | | | | | | | Return 0 for non MANAGED textures and surfaces. Fixes failing wine d3d9 tests device.c test_resource_priority. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Clean GetPrivateDataPatrick Rudolph2015-08-211-4/+6
| | | | | | | | | Move the assert to return error codes in the correct order. Always set the pSizeOfData to the required buffer size. Fixes failing wine test device.c test_private_data() Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Allow lock coordinates outside rangePatrick Rudolph2015-08-211-6/+2
| | | | | | | | | | This fixes wine test device.c test_lockrect_invalid() Mimic WindowsXp behaviour and allow negative values in the rectangle passed. Add comment to point out behaviour used. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>