summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Fix multisampling support detectionAxel Davy2015-02-062-28/+9
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix enabled lights in stateblocksTiziano Bacocco2015-02-062-3/+7
| | | | | Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Tiziano Bacocco <[email protected]>
* st/nine: Fix depth stencil formats bindings flags.Axel Davy2015-02-064-27/+74
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix gpu memory leak in swapchainAxel Davy2015-02-061-2/+1
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: SetResourceResize should track nr_samples tooAxel Davy2015-02-061-0/+1
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: D3DRS_FILLMODE set to 0 is D3DFILL_SOLIDTiziano Bacocco2015-02-061-0/+1
| | | | | | Reviewed-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Tiziano Bacocco <[email protected]>
* st/nine: Setting D3DRS_ALPHAFUNC to 0 means D3DCMP_NEVERTiziano Bacocco2015-02-061-0/+1
| | | | | Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Tiziano Bacocco <[email protected]>
* st/nine: Implement fallback behaviour when rts and ds don't matchAxel Davy2015-02-061-18/+28
| | | | | | | | This seems to be the behaviour on Win. Previous behaviour led to different issues depending on the driver. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix present_buffers allocationAxel Davy2015-02-061-6/+9
| | | | | | | | | | | | If has_present_buffers was false at first, but after a device reset, it turns true (for example if we begin to render to a multisampled back buffer), there was a crash due to present_buffers being uninitialised. This patch fixes it. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Check for aligned offset in each vertex elementPatrick Rudolph2015-02-061-1/+3
| | | | | | | Fixes wine test test_vertex_declaration_alignment() Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Fix bufferoverflow in {Get|Set}PixelShaderConstantFPatrick Rudolph2015-02-061-5/+5
| | | | | | | | | | Previous code wasn't checking against the correct limit: 224 for sm3 hardware, but 256. Fixes wine test test_pixel_shader_constant() Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Set [out] argument to NULL for some functionsPatrick Rudolph2015-02-061-0/+6
| | | | | | | | | Wine tests, and probably some apps, check for errors by checking for NULL instead of error codes. Fixes wine test test_surface_blocks() Reviewed-by: Axel davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Remove duplicated debug messagePatrick Rudolph2015-02-061-3/+0
| | | | | | | Likely a rebase error Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Return E_FAIL for unused vertexdeclaration typePatrick Rudolph2015-02-061-3/+4
| | | | | | | | Add returncode E_FAIL. Return E_FAIL for any vertexdeclaration element with type unused. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Missing sanity check for CALLOC return E_OUTOFMEMORY if allocation ↵Patrick Rudolph2015-02-061-1/+1
| | | | | | | of usage_map fails Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Implement ATOC hackAxel Davy2015-02-062-0/+12
| | | | | | | | | | | ATOC is an hack for Alpha to coverage that is supported by NV and Intel. You need to check the support for it with CheckDeviceFormat. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement AMD alpha to coverageAxel Davy2015-02-064-5/+20
| | | | | | | | | 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: Add D3DFMT_DF16 supportAxel Davy2015-02-062-4/+14
| | | | | | | | | | | | | | | This depth buffer format, like D3DFMT_INTZ, can be used to read the depth buffer values when bound to a shader. Some apps may use this format to get better performance when they don't need the precision of INTZ (24 bits for depth, 8 for stencil, whereas DF16 is just 16 bits for depth) We don't add support for DF24 yet, because it implies support for FETCH4, which we don't support for now. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Change the value of some advertised capsAxel Davy2015-02-061-3/+3
| | | | | | | These values are taken from wine. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: NineDevice9_SetClipPlane: pPlane must be non-NULLAxel Davy2015-02-061-3/+5
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement fallback for D3DFMT_D24S8, D3DFMT_D24X8 and D3DFMT_INTZAxel Davy2015-02-061-1/+20
| | | | | | | | | | | Some drivers support PIPE_FORMAT_S8_UINT_Z24_UNORM, some others PIPE_FORMAT_Z24_UNORM_S8_UINT, some both. It doesn't matter which one we use, since the d3d formats they map to aren't lockable (app can read it directly). Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Refactor format d3d9 to pipe conversionAxel Davy2015-02-0611-77/+136
| | | | | | | | | | | Move the checks of whether the format is supported into a common place. The advantage is that allows to handle when a d3d9 format can be mapped to several formats, and that cards don't support all of them. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Refactor nine_d3d9_to_pipe_format_mapAxel Davy2015-02-061-79/+44
| | | | | | | | | | The order of the format is changed to have an increasing ordering of the d3d9 format values. Some missing formats are added and matched to PIPE_FORMAT_NONE Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Improve CheckDeviceFormat debug outputAxel Davy2015-02-061-9/+3
| | | | | | | | | | | | | Because the debug output of this function was cut in two parts, sometimes the second part wasn't print when we would return earlier, whereas we would like to get it. The reason of the separation was that it's only at the end of the function we can print what we map to the d3d9 arguments, but we can always retrieve that info by hand. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement RESZ hackAxel Davy2015-02-063-0/+64
| | | | | | | | | | | | | | | | | This D3D hack allows to resolve a multisampled depth buffer into a single sampled one. Note that the implementation is slightly incorrect. When querying the content of D3DRS_POINTSIZE, it should return the resz code if it has been set. This behaviour will be implemented when state changes will be reworked. For now the current behaviour is ok, since apps use the D3DCREATE_PUREDEVICE flag when creating the device, which means they won't read states and in exchange get better performance. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: fix early basetexture destructionAxel Davy2015-02-061-1/+2
| | | | | Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not leak private data in volume9.Patrick Rudolph2015-02-061-0/+3
| | | | | | | This->data was allocated by nine, but not freed. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Check block alignment for compressed textures in ↵Patrick Rudolph2015-02-061-0/+24
| | | | | | | NineSurface9_CopySurface Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Commit sampler views again if srgb state changed.Axel Davy2015-02-063-2/+7
| | | | | | | | | | | | 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: Fix use of D3DSP_NOSWIZZLEAxel Davy2015-02-061-1/+1
| | | | | | | | | D3DSP_NOSWIZZLE already contains the shift. Detected with Clang. Reviewed-by: Tiziano Bacocco <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Check for the correct number of constants.Axel Davy2015-02-062-4/+5
| | | | | | | | | | | | | | | | | 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: Introduce failure handling for shader parsing.Axel Davy2015-02-061-8/+30
| | | | | | | | | Instead of crashing on buggy shaders, we should return an error. This patch introduces this behaviour in the case of invalid constant access Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Print warnings for r500 when shader is likely to go wrongAxel Davy2015-02-061-0/+6
| | | | | | | | | | r500 hasn't enough float constants for vs to fill all needs. Overlapping issues can happen with complex shaders. The fix would be to recompile shaders to include the integer and boolean constants, instead of reserving slots for them. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Declare constants only up to the maximum needed.Axel Davy2015-02-061-27/+11
| | | | | | | | | | | | | | | Previously 276 constants were declared everytime. This patch makes shaders declare constants up to the maximum constant needed and moves the moment we print the TGSI shader after the moment we declare the constants. This is needed for r500, since when indirect addressing is used, it cannot reduce the amount of constants needed, and that it is restricted to 256 constant slots. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Refactor how user constbufs sizes are calculatedAxel Davy2015-02-065-23/+24
| | | | | | | | 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: Explicit nine requirementsAxel Davy2015-02-062-49/+66
| | | | | | | | | | | | | | | | | | | | This patch raises nine requirements and disables nine for old hw that don't match them. Currently for these cards only games that don't have tight requirements would work well with nine. However nine is missing several checks regarding these limitations. To make code and future patches less heavy, dropping support for these old card seems a good solution. That makes r500 the only dx9 generation cards supported by nine. It seems the one with the less limitations for nine. Still not everything is ok, and we'll have for example to implement shader recompilation for these cards to include integer and boolean constants in the shader. Eventually when this is done, we can reintroduce support for older cards. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* gallium: Add MULTISAMPLE_Z_RESOLVE capAxel Davy2015-02-0615-0/+20
| | | | | | | | | | | | | | | | Resolving a multisampled depth texture into a single sampled texture is supported on >= SM4.1 hw. It is possible some previous hw support it. The ability was tested on radeonsi and nvc0. Apparently is is also supported for radeon >= r700. This patch adds the MULTISAMPLE_Z_RESOLVE cap and add it to the drivers. It is advertised for drivers for which it is sure the ability is supported. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* llvmpipe: Trivially advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT.Jose Fonseca2015-02-051-1/+2
| | | | | | | | | | | Nothing special needs to be done. Even though llvmpipe copies constant (ie uniform) buffers internally, the application is supposed to flush and sync, so all should work. All bufferstorage piglit tests pass. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: Don't implement u_bit_scan64 on MSVC.Jose Fonseca2015-02-041-0/+2
| | | | | | | | | | As ffsll doesn't exist in MSVC yet, and u_bit_scan64 is only used by radeonsi which is never built with MSVC. This is just a stop-gap fix to unbreak MSVC build until we refactor these mathematical portability wrappers into src/util. Trivial.
* gallium/util: Define ffsll on MinGW.Jose Fonseca2015-02-041-0/+1
| | | | | | Trivial. (Fixing MSVC will be far less so, as _BitScanForward64 is only supported on x64.)
* radeonsi: implement polygon stipplingMarek Olšák2015-02-047-5/+79
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: add polygon stipple texture slotMarek Olšák2015-02-041-5/+8
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: deduce rasterizer primitive type at the beginning of draw_vboMarek Olšák2015-02-042-13/+17
| | | | | | I will need this for polygon stippling. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: allow 64 descriptors per arrayMarek Olšák2015-02-042-34/+34
| | | | | | | We need a slot for the stipple texture and the pixel shader already uses 32 textures (16 API slots + 16 FMASK slots). Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: add support for sampler views where resource = NULLMarek Olšák2015-02-042-6/+22
| | | | | | | The hardware obeys swizzles even if the resource is NULL. This will be used by set_polygon_stipple. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: add support for NULL texture sampler views that return (0,0,0,1)Marek Olšák2015-02-041-2/+28
| | | | | | This used to hang. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: fix a crash when binding a NULL sampler view listMarek Olšák2015-02-041-1/+1
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: move the buffer descriptor to the end of the image descriptorMarek Olšák2015-02-044-7/+9
| | | | | | This will allow supporting NULL textures. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: don't use tgsi_parse_context to get processor typeMarek Olšák2015-02-041-7/+1
| | | | | | Also remove unused "tokens". Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: fix instanced arrays with non-zero start instanceMarek Olšák2015-02-041-3/+3
| | | | | | | Fixes piglit ARB_base_instance/arb_base_instance-drawarrays. Cc: 10.3 10.4 <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>