summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* i965: Remove now unnecessary Gen8 CMP destination type override.Matt Turner2015-02-041-8/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Set CMP's destination type to src0's type.Matt Turner2015-02-042-18/+18
| | | | | | Allows CMP instructions with float sources to be compacted and coissued. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Implement the WaCMPInstFlagDepClearedEarly work-around.Matt Turner2015-02-041-1/+36
| | | | | | Prevents piglit regressions from the next patch. Reviewed-by: Kenneth Graunke <[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]>
* r600g,radeonsi: don't append to streamout buffers that haven't been used yetMarek Olšák2015-02-042-1/+4
| | | | | | | | | | | | The FILLED_SIZE counter is uninitialized at the beginning, so we can't use it. Instead, use offset = 0, which is what we always do when not appending. This unexpectedly fixes spec/ARB_texture_multisample/sample-position/*. Yes, the test does use transform feedback. Cc: 10.3 10.4 <[email protected]> Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* gallium: set PIPE_MAX_SAMPLERS to 18Marek Olšák2015-02-041-1/+1
| | | | | | | For drivers that use higher slots not to crash in tgsi_shader_info. Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_pstipple: add ability to specify a fixed texture unitMarek Olšák2015-02-043-9/+21
| | | | | | | E.g. r600g can use slot 17, which is outside of the API range. Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/util: add u_bit_scan64Marek Olšák2015-02-041-0/+7
| | | | | | | Same as u_bit_scan, but for uint64_t. Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* tgsi: add tgsi_get_processor_type helper from radeonMarek Olšák2015-02-043-11/+14
| | | | | Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965/fs: Fix saturate on MAD and LRP with the NIR backend.Kenneth Graunke2015-02-041-2/+4
| | | | | | | | | Fixes misrendering in "Witcher 2" with INTEL_USE_NIR=1, and probably many other programs. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Fix _mesa_format_convert fallback path when src is not an array formatIago Toral Quiroga2015-02-041-2/+2
| | | | | | | | | | | When a rebase swizzle is provided and we call _mesa_swizzle_and_convert after unpacking the source format we were always passing normalized=false. We should pass true or false depending on the formats involved in the conversion for the byte and float paths (the integer path cannot ever be normalized). Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Mark Janes <[email protected]>
* st/osmesa: Fix osbuffer->textures indexingPark, Jeongmin2015-02-031-1/+1
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88930 Cc: 10.4 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965/nir: use redundant phi optimizationConnor Abbott2015-02-031-0/+2
| | | | | | Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Jason Ekstrand <[email protected]> Signed-off-by: Connor Abbott <[email protected]>
* nir: add an optimization to remove useless phi nodesConnor Abbott2015-02-033-0/+112
| | | | | | | | | | | | | | | | | | | | This removes phi nodes whose sources all point to the same thing. Shader-db results: total NIR instructions in shared programs: 2045293 -> 2041209 (-0.20%) NIR instructions in affected programs: 126564 -> 122480 (-3.23%) helped: 615 HURT: 0 total FS instructions in shared programs: 4321840 -> 4320392 (-0.03%) FS instructions in affected programs: 24622 -> 23174 (-5.88%) helped: 138 HURT: 0 Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Jason Ekstrand <[email protected]> Signed-off-by: Connor Abbott <[email protected]>
* nir/validate: Ensure that phi sources are SSA-onlyJason Ekstrand2015-02-031-10/+3
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/validate: Validate that only float ALU outputs are saturatedJason Ekstrand2015-02-031-0/+8
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/lower_source_mods: Don't lower saturate for non-float outputsJason Ekstrand2015-02-031-0/+4
| | | | Reviewed-by: Connor Abbott <[email protected]>
* i965/fs_nir: Get rid of get_alu_srcJason Ekstrand2015-02-032-59/+75
| | | | | | | | | | | | | | | | | Originally, get_alu_src was supposed to handle resolving swizzles and things like that. However, now that basically every instruction we have only takes scalar sources, we don't really need it anymore. The only case where it's still marginally useful is for the mov and vecN operations that are left over from SSA form. We can handle those cases as a special case easily enough. As a side-effect, we don't need the vec_to_movs pass anymore. v2 Jason Ekstrand <[email protected]>: - Rework the way we detect if we need an extra copy for swizzling. The old code involved a pile of confusing switch fall-throughs; we now use a loop. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Use NIR's scalarizing abilities and stop handling vectorsJason Ekstrand2015-02-032-349/+161
| | | | | | | | | | | | | | | | | | | | Now that we can scalarize with NIR, there's no need for all this code anymore. Let's get rid of it and just do scalar operations. v2: run copy prop before lowering phi nodes v3: Get rid of the "emit(...)->saturate = foo" pattern v4: Run alu_to_scalar as an optimization pass total instructions in shared programs: 5998321 -> 5974070 (-0.40%) instructions in affected programs: 732075 -> 707824 (-3.31%) helped: 3137 HURT: 191 GAINED: 18 LOST: 0 Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Add a pass to lower vector phi nodes to scalar phi nodesJason Ekstrand2015-02-033-0/+293
| | | | | | | | | | | | | | | | | | | | | | v2 Jason Ekstrand <[email protected]>: - Add better comments - Use nir_ssa_dest_init and nir_src_for_ssa more places - Fix some void * casts v3 Jason Ekstrand <[email protected]>: - Rework the way we determine whether or not to sccalarize a phi node to make the recursion non-bogus - Treat load_const instructions as scalarizable v4 Jason Ekstrand <[email protected]>: - Allow uniform and input loads to be scalarizable v5 Jason Ekstrand <[email protected]>: - Also consider loads of inputs (varying, uniform, or ubo) to be scalarizable. We were already doing this for load_var on uniforms and inputs. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Add support for constant propagating into sources with modifiers.Matt Turner2015-02-031-6/+12
| | | | | | | | | | | All but 16 of the programs helped were ARB fp programs. total instructions in shared programs: 5949286 -> 5945470 (-0.06%) instructions in affected programs: 275162 -> 271346 (-1.39%) helped: 1197 GAINED: 1 Reviewed-by: Jason Ekstrand <[email protected]>