summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-02-05nvc0: avoid negatives in PUSH_SPACE argumentHEADmasterIlia Mirkin1-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 <imirkin@alum.mit.edu> Cc: mesa-stable@lists.freedesktop.org
2016-02-05nvc0: add some missing PUSH_SPACE'sIlia Mirkin1-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 <imirkin@alum.mit.edu> Cc: mesa-stable@lists.freedesktop.org
2016-02-05nvc0/ir: fix converting between predicate and gprIlia Mirkin3-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 <imirkin@alum.mit.edu> Cc: mesa-stable@lists.freedesktop.org
2016-02-04nvc0: add support for ARB_query_buffer_objectIlia Mirkin13-21/+241
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-02-04st/mesa: add query buffer supportIlia Mirkin4-1/+103
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04gallium: add PIPE_CAP_QUERY_BUFFER_OBJECTIlia Mirkin15-0/+16
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04gallium: add a way to store query result into bufferIlia Mirkin3-0/+37
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04mesa: add core implementation of ARB_query_buffer_objectIlia Mirkin1-147/+138
Forwards query result writes to drivers. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04mesa: add driver interface for writing query results to buffersIlia Mirkin1-0/+9
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04mesa: Handle QUERY_BUFFER_BINDING in GetIntegervRafal Mielniczuk2-0/+8
Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2@gmail.com> [imirkin: move to GL/GL_CORE section] Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04mesa: Add QueryBuffer to contextRafal Mielniczuk2-0/+16
Add QueryBuffer and initialise it to NullBufferObj on start Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2@gmail.com> [imirkin: also release QueryBuffer on free] Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04mesa: Add ARB_query_buffer_object extension flagRafal Mielniczuk2-0/+2
Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2@gmail.com> [imirkin: add string to extensions.c] Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-04glapi: Add xml infrastructure for ARB_query_buffer_objectRafal Mielniczuk1-1/+8
Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2@gmail.com> [imirkin: move definition to gl_API.xml as it is very short] Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-02-05glsl: simplify setting of image access qualifiersTimothy Arceri1-63/+21
Cc: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-02-05mesa: remove dead program parameter functionsTimothy Arceri2-77/+0
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-02-04st/nine: Use align_free when neededAxel Davy4-4/+4
Use align_free to free memory allocated with align_malloc. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Disallow non-argb8888 cursorsAxel Davy1-0/+1
Only argb8888 cursors are allowed. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Enforce centroid for color input when multisampling is onAxel Davy4-4/+15
The color inputs must automatically use centroid whether multisampling is used or not. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Fix centroid flagAxel Davy1-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 <axel.davy@ens.fr>
2016-02-04st/nine: Use fast clears more often for MRTsAxel Davy4-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 <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Use linear filtering for shadow mappingAxel Davy1-2/+3
Some docs say linear filtering is always used when app does shadow mapping. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Respect block alignment on surface lockPatrick Rudolph1-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Add Render state validation layerAxel Davy5-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 <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04DRI_CONFIG: Add option to override vendor idPatrick Rudolph2-13/+53
Add config option override_vendorid to report a fake card in d3dadapter9 drm. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Implement NineDevice9_GetAvailableTextureMemPatrick Rudolph4-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Handle Window OcclusionPatrick Rudolph8-6/+108
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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Store minor version numPatrick Rudolph5-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Call flush_resource before flushAxel Davy1-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 <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Fix remaining swapchain testsPatrick Rudolph2-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix crash NineDevice9_CreateAdditionalSwapChainAxel Davy1-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 <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Fix possible crash on errorPatrick Rudolph1-1/+2
In case swapchain creation fails This->swapchains[i] might be NULL and causes a crash. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Test more presentation paramsPatrick Rudolph1-5/+8
Return errors in case of invalid presentation parameters. Fixes failing WINE tests device.c test_swapchain_parameters(). Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix resource9 private dataPatrick Rudolph2-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Print GUID instead of pointerPatrick Rudolph3-6/+30
To ease debugging print the GUID instead of the pointer to it. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix use of uninitialized memoryPatrick Rudolph2-1/+13
The values of box.z and box.depth weren't set and lead to a crash. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix clear for multisample mismatch depth-stencilPatrick Rudolph1-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix Volumetexture9_LockBoxPatrick Rudolph1-0/+7
Check for valid locked box dimensions. Fixes failing wine tests device.c test_lockbox_invalid. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix ATI2 pitch for non-squareAxel Davy1-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 <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Support D3DFMT_R8G8B8Patrick Rudolph1-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Use cso for viewportPatrick Rudolph1-2/+1
Use CSO to catch redundant viewport changes. Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Fix shade mode flatPatrick Rudolph2-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Clear rendertarget on creationPatrick Rudolph1-0/+9
Clear every rendertarget on creation. Fixes https://github.com/iXit/Mesa-3D/issues/139 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Allow ColorFill on D3DFMT_NULL surfacesPatrick Rudolph1-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Introduce STREAMFREQ stateAxel Davy3-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 <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Catch redundant SetStreamSourceFreq callsAxel Davy1-0/+3
Some apps do redundant SetStreamSourceFreq calls. Catch them to improve performance. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Squash indexbuffer9 and vertexbuffer9Patrick Rudolph8-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-02-04st/nine: Unset vtxbuf on resetAxel Davy1-1/+3
We forgot to reset vtxbuf. This fixes some crashes. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Use pipe_resource_reference for vtxbufAxel Davy2-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 <axel.davy@ens.fr>
2016-02-04st/nine: Use ff vertex shader when position_t is usedAxel Davy7-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 <axel.davy@ens.fr> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-02-04st/nine: Don't increment refcount on VertexDeclaration creation failurePatrick Rudolph1-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 <siro@das-labor.org> Reviewed-by: Axel Davy <axel.davy@ens.fr>