summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* nvc0: avoid negatives in PUSH_SPACE argumentIlia Mirkin2016-02-051-2/+1
| | | | | | | | | | Fixup to commit 03b3eb90d - the number of buffers could be larger than the number of elements, in which case we'd pass a negative argument to PUSH_SPACE, which would be bad. While we're at it, merge it with the other PUSH_SPACE at the top of the function. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* nvc0: add some missing PUSH_SPACE'sIlia Mirkin2016-02-051-1/+9
| | | | | | | | nvc0_vbo has explicit push space checking enabled, so we must run PUSH_SPACE by hand. A few spots missed that. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* nvc0/ir: fix converting between predicate and gprIlia Mirkin2016-02-053-11/+41
| | | | | | | | | | The spill logic will insert convert ops when moving between files. It seems like the emission logic wasn't quite ready for these converts. Tested on fermi, and visually looked at nvdisasm output for maxwell. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* nvc0: add support for ARB_query_buffer_objectIlia Mirkin2016-02-0411-20/+239
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* st/mesa: add query buffer supportIlia Mirkin2016-02-044-1/+103
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_CAP_QUERY_BUFFER_OBJECTIlia Mirkin2016-02-0415-0/+16
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add a way to store query result into bufferIlia Mirkin2016-02-043-0/+37
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add core implementation of ARB_query_buffer_objectIlia Mirkin2016-02-041-147/+138
| | | | | | | Forwards query result writes to drivers. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add driver interface for writing query results to buffersIlia Mirkin2016-02-041-0/+9
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Handle QUERY_BUFFER_BINDING in GetIntegervRafal Mielniczuk2016-02-042-0/+8
| | | | | | | Signed-off-by: Rafal Mielniczuk <[email protected]> [imirkin: move to GL/GL_CORE section] Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add QueryBuffer to contextRafal Mielniczuk2016-02-042-0/+16
| | | | | | | | | Add QueryBuffer and initialise it to NullBufferObj on start Signed-off-by: Rafal Mielniczuk <[email protected]> [imirkin: also release QueryBuffer on free] Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add ARB_query_buffer_object extension flagRafal Mielniczuk2016-02-042-0/+2
| | | | | | | Signed-off-by: Rafal Mielniczuk <[email protected]> [imirkin: add string to extensions.c] Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glapi: Add xml infrastructure for ARB_query_buffer_objectRafal Mielniczuk2016-02-041-1/+8
| | | | | | | Signed-off-by: Rafal Mielniczuk <[email protected]> [imirkin: move definition to gl_API.xml as it is very short] Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl: simplify setting of image access qualifiersTimothy Arceri2016-02-051-63/+21
| | | | | Cc: Francisco Jerez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: remove dead program parameter functionsTimothy Arceri2016-02-052-77/+0
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* st/nine: Use align_free when neededAxel Davy2016-02-044-4/+4
| | | | | | | | Use align_free to free memory allocated with align_malloc. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Disallow non-argb8888 cursorsAxel Davy2016-02-041-0/+1
| | | | | | | Only argb8888 cursors are allowed. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Enforce centroid for color input when multisampling is onAxel Davy2016-02-044-4/+15
| | | | | | | | The color inputs must automatically use centroid whether multisampling is used or not. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix centroid flagAxel Davy2016-02-041-1/+4
| | | | | | | | sem.reg.mod & NINED3DSPDM_CENTROID is worth 4 when centroid is requested, whereas TGSI_INTERPOLATE_LOC_CENTROID is worth 1. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use fast clears more often for MRTsAxel Davy2016-02-044-12/+11
| | | | | | | | | | | | | | | | | | 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: Use linear filtering for shadow mappingAxel Davy2016-02-041-2/+3
| | | | | | | | Some docs say linear filtering is always used when app does shadow mapping. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Respect block alignment on surface lockPatrick Rudolph2016-02-041-1/+1
| | | | | | | | | Respect block alignment for ATI1/ATI2 format when trying to lock a surface using LockRect(). Fixes failing WINE tests device.c test_surface_blocks() tests. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Add Render state validation layerAxel Davy2016-02-045-13/+236
| | | | | | | | | | | | | | | | | | 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]>
* DRI_CONFIG: Add option to override vendor idPatrick Rudolph2016-02-042-13/+53
| | | | | | | Add config option override_vendorid to report a fake card in d3dadapter9 drm. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Implement NineDevice9_GetAvailableTextureMemPatrick Rudolph2016-02-044-5/+50
| | | | | | | | | | | | | | | Implement a device private memory counter similar to Win 7. Only textures and surfaces increment vidmem and may return ERR_OUTOFVIDEOMEMORY. Vertexbuffers and indexbuffers creation always succeedes, even when out of video memory. Fixes "Vampire: The Masquerade - Bloodlines" allocating resources until crash. Fixes "Age of Conan" allocating resources until crash. Fixes failing WINE test device.c test_vidmem_accounting(). Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Handle Window OcclusionPatrick Rudolph2016-02-046-6/+104
| | | | | | | | | | | | | | Apps can know if the window is occluded by checking for specific error messages. The behaviour is different for Device9 and Device9Ex. This allow games to release the mouse and stop rendering until the focus is restored. In case of multiple swapchain we do care only of the device one. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Store minor version numPatrick Rudolph2016-02-045-12/+24
| | | | | | | | | To keep compatible with older ID3DPresent interfaces (used to talk with Wine), store the minor version num accessible to all statetracker functions (in the NineDevice9 structure). Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Call flush_resource before flushAxel Davy2016-02-041-6/+4
| | | | | | | | | | | flush_resource needs to be called before flush (for fast clear resolve, etc). Removes useless computation of resource (it is already set correctly). Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix remaining swapchain testsPatrick Rudolph2016-02-042-1/+5
| | | | | | | | | | | | | | | | Return D3DERR_INVALIDCALL instead of E_POINTER. On error set ppBackBuffer to NULL. Multiple swapchains can only be created in windowed mode as windowed swapchain. Set backbuffer to NULL in NineDevice9_GetBackBuffer, but not in NineSwapChain9_GetBackBuffer. This fixes all WINE's device.c test_swapchain() tests. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix crash NineDevice9_CreateAdditionalSwapChainAxel Davy2016-02-041-0/+4
| | | | | | | | | | | | When no window is specified, we should revert to the focus window. This deserves more tests however (what if the device swapchain is already using the focus window ?) Fixes crash for FFXIV Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix possible crash on errorPatrick Rudolph2016-02-041-1/+2
| | | | | | | | In case swapchain creation fails This->swapchains[i] might be NULL and causes a crash. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Test more presentation paramsPatrick Rudolph2016-02-041-5/+8
| | | | | | | | Return errors in case of invalid presentation parameters. Fixes failing WINE tests device.c test_swapchain_parameters(). Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix resource9 private dataPatrick Rudolph2016-02-042-1/+3
| | | | | | | | | | | Store a copy of GUID in the header that is under our control and use it as key for the hashtable instead of using the application provided pointer. The application might change the memory after leaving the function. Fixes a crash for issue https://github.com/iXit/Mesa-3D/issues/130 Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Print GUID instead of pointerPatrick Rudolph2016-02-043-6/+30
| | | | | | | To ease debugging print the GUID instead of the pointer to it. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix use of uninitialized memoryPatrick Rudolph2016-02-042-1/+13
| | | | | | | The values of box.z and box.depth weren't set and lead to a crash. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix clear for multisample mismatch depth-stencilPatrick Rudolph2016-02-041-5/+7
| | | | | | | | | | Tests show in case of multisample mismatch between the depth-stencil buffer and the render target, then it is not cleared. Fixes failing WINE test visual.c test_multisample_mismatch(). Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix Volumetexture9_LockBoxPatrick Rudolph2016-02-041-0/+7
| | | | | | | | | Check for valid locked box dimensions. Fixes failing wine tests device.c test_lockbox_invalid. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix ATI2 pitch for non-squareAxel Davy2016-02-041-2/+2
| | | | | | | | | Fixes crash for non-square textures. We were using the height instead of the width for some calculations. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Support D3DFMT_R8G8B8Patrick Rudolph2016-02-041-3/+3
| | | | | | | | | | | | | | | | Add support for D3DFMT_R8G8B8. It allows format conversion for surfaces of pool scratch. Usually gallium formats equivalents for d3d9 formats have their names reversed. The gallium format PIPE_FORMAT_R8G8B8_UNORM is the right equivalent here, and its name is likely wrong (reversed). Fixes a crash in TmNationsForever. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Use cso for viewportPatrick Rudolph2016-02-041-2/+1
| | | | | | | Use CSO to catch redundant viewport changes. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix shade mode flatPatrick Rudolph2016-02-042-7/+8
| | | | | | | | | | Shade mode flat is only working if pixelshaders have interpolate set to TGSI_INTERPOLATE_COLOR on color inputs. Fixes failing WINE tests visual.c test_shademode(). Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Clear rendertarget on creationPatrick Rudolph2016-02-041-0/+9
| | | | | | | | Clear every rendertarget on creation. Fixes https://github.com/iXit/Mesa-3D/issues/139 Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Allow ColorFill on D3DFMT_NULL surfacesPatrick Rudolph2016-02-041-0/+2
| | | | | | | | Report success instead of failing as there's no resource for those surfaces. Fixes a crash in Crysis: Warhead. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Introduce STREAMFREQ stateAxel Davy2016-02-043-21/+24
| | | | | | | | | | | | | | | | | | | | 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: Catch redundant SetStreamSourceFreq callsAxel Davy2016-02-041-0/+3
| | | | | | | | Some apps do redundant SetStreamSourceFreq calls. Catch them to improve performance. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Squash indexbuffer9 and vertexbuffer9Patrick Rudolph2016-02-048-215/+305
| | | | | | | | | The indexbuffer9 codebase was lagging behind the one of vertexbuffer9. Add buffer9 as common code base for indexbuffer9 and vertexbuffer9. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Unset vtxbuf on resetAxel Davy2016-02-041-1/+3
| | | | | | | | We forgot to reset vtxbuf. This fixes some crashes. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Use pipe_resource_reference for vtxbufAxel Davy2016-02-042-3/+4
| | | | | | | This seems cleaner to actually reference the resources for vtxbuf, rather than relying on the fact the bound d3d streams do. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use ff vertex shader when position_t is usedAxel Davy2016-02-047-14/+35
| | | | | | | | | | | | | | | | | | | | 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: Don't increment refcount on VertexDeclaration creation failurePatrick Rudolph2016-02-041-12/+12
| | | | | | | | | NineUnknown_ctor increments the refcount even in case of an error. Restructure the code to prevent refcount increments. Fixes a couple of wine tests. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>