summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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 <axel.davy@ens.fr>
* st/nine: Calculate dummy sampler state only onceAxel Davy2015-08-213-35/+24
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Better check shader constant limitsAxel Davy2015-08-211-9/+27
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Implement special DOTPRODUCT3 behaviourAxel Davy2015-08-211-0/+4
| | | | | | Taken from wine tests Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Implement ff vertex data passthroughAxel Davy2015-08-211-7/+61
| | | | | | Fixes Wine tests Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Programmable ps D3DTTSS_PROJECTED supportAxel Davy2015-08-217-8/+74
| | | | | | The implementation used Wine tests for conformance Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Advertise Fog flagsAxel Davy2015-08-211-6/+6
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Finish Fog implementationAxel Davy2015-08-218-26/+147
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Remove some useless variablesAxel Davy2015-08-212-2/+0
| | | | | Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: David Heidelberg <david@ixit.cz>
* st/nine: Fix nine_ff_ps_key paddingAxel Davy2015-08-211-1/+3
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Begin programmable shader fog supportAxel Davy2015-08-211-7/+42
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Rework blend statesAxel Davy2015-08-214-10/+21
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Avoid useless updates in SetSamplerStateAxel Davy2015-08-211-5/+7
| | | | | | | Check for redundant settings Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: David Heidelberg <david@ixit.cz>
* st/nine: Rework rasterizer statesAxel Davy2015-08-214-12/+22
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Reorder DSA state settingsAxel Davy2015-08-214-11/+30
| | | | | | Separate state preparation and state commit Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr>
* st/nine: Implement TEXBEM,TEXBEML and BEMTiziano Bacocco2015-08-217-8/+165
| | | | Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* 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 <siro@das-labor.org>
* st/nine: Fix Lock Checks for Compressed texturesAxel Davy2015-08-212-8/+11
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* 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 <axel.davy@ens.fr> Reviewed-by: David Heidelberg <david@ixit.cz>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* 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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* st/nine: Fix GenerateMipSubLevels potential crashPatrick Rudolph2015-08-211-2/+3
| | | | | | | | | | For the case of D3DPOOL_MANAGED textures, This->base.resource can be NULL at the start of the function. In This case, UploadSelf will take care of the defining. Assign resource after the UploadSelf call to prevent NULL pointer exception. Reviewed-by: Axel Davy <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* st/nine: Fix FillColor Flag checkAxel Davy2015-08-211-5/+2
| | | | | | | IT is better check if the surface was created with RT flag, instead of checking capability (llvmpipe was complaining) Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Fix StretchRect checksAxel Davy2015-08-211-1/+5
| | | | | | Fixes Wine tests Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Implement EvictManagedResourcesAxel Davy2015-08-213-4/+26
| | | | | | | | EvictManagedResources is used by apps to free the gpu memory of MANAGED textures (which have a cpu memory backing) Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Track managed texturesAxel Davy2015-08-214-2/+10
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Only update dirty rect for UpdateTextureAxel Davy2015-08-212-8/+83
| | | | | | | | | UpdateTexture is supposed to optimise by uploading only for the dirty region of the source (d3d9 doc, wine tests). This patch adds the behaviour for surfaces, but not entirely for volumes. Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Textures start dirtyAxel Davy2015-08-213-1/+11
| | | | | | | According to the spec all textures start dirty. Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Track dirty region for SYSTEMMEM tooAxel Davy2015-08-214-11/+17
| | | | | | | | | | Dirty regions should be tracked for both MANAGED and SYSTEMMEM. Until now we didn't bother to track for SYSTEMMEM, because we hadn't implemented using the dirty region to avoid some copies Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Add missing BASETEX_REGISTER_UPDATE callsAxel Davy2015-08-212-2/+6
| | | | | | | | | | If the texture is bound and dirty_mip is true, BASETEX_REGISTER_UPDATE adds the texture to the list of things to update before the next draw call. Some calls to it were missing. Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: SetAutoGenFilterType should regenerate the sublevelsAxel Davy2015-08-211-0/+2
| | | | | | It should regenerate the sublevels according to the spec Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Simplify NineVolume9_CopyVolumeAxel Davy2015-08-213-81/+21
| | | | | | We had only one usage for this function. Signed-off-by: Axel Davy <axel.davy@ens.fr>
* st/nine: Split NineSurface9_CopySurfaceAxel Davy2015-08-215-125/+169
| | | | | | | | | | | | | NineSurface9_CopySurface was supporting more cases than what we needed, and doing checks that were innapropriate for some NineSurface9_CopySurface use cases. This patch splits it into two for the two use cases, and moves the checks to the caller. This patch also adds a few checks to NineDevice9_UpdateSurface Signed-off-by: Axel Davy <axel.davy@ens.fr>