summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* gallium: add PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERSIlia Mirkin2016-10-221-0/+1
| | | | | | | | | | | | | | This allows the driver to signal that it can't handle random interleaving of attributes across buffers. This is required for ARB_transform_feedback3, and it's initialized to whatever the previous value of PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME was except for nv50 where it is disabled. Note that the proprietary drivers never expose ARB_transform_feedback3 on any GT21x's (where nouveau previously did), and after some effort I was unable to get it to work. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: minor code improvements in svga_validate_pipe_sampler_view()Brian Paul2016-10-181-8/+8
| | | | | | | Use the 'texture' local var in more places. Rename 'pFormat' to 'viewFormat'. Reviewed-by: Charmaine Lee <[email protected]>
* gallium: add PIPE_CAP_TGSI_ARRAY_COMPONENTSNicolai Hähnle2016-10-121-0/+1
| | | | | | | | This is a screen cap because drivers are expected to support it either for all shader types or for none of them. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* svga: add svga_mksstats.h to the sources listEmil Velikov2016-10-061-0/+1
| | | | | | | Otherwise it won't be picked in the tarball and the build will fail. Fixes: 0035f7f1365 ("svga: add guest statistic gathering interface") Signed-off-by: Emil Velikov <[email protected]>
* svga: set PIPE_BIND_DEPTH_STENCIL flag for new resources when possibleBrian Paul2016-09-231-1/+11
| | | | | | | | When we create a depth/stencil texture, also check if we can render to it and set the PIPE_BIND_DEPTH_STENCIL flag. We were previously doing this for color textures (PIPE_BIND_RENDER_TARGET). Reviewed-by: Charmaine Lee <[email protected]>
* svga: don't special case caps for SVGA3D_R32_FLOATBrian Paul2016-09-231-6/+2
| | | | | | | This may have been needed years ago during development, but not now. Prevents some regressions after introducing the next patch. Reviewed-by: Charmaine Lee <[email protected]>
* svga: use new adjust_z_layer() helper in svga_pipe_blit.cBrian Paul2016-09-231-44/+28
| | | | | | | | | To handle z/layer fix-ups for blitting and copying. Note that we weren't doing this properly in svga_blit() before. Also, remove redundant stex, dtex assignments. Reviewed-by: Charmaine Lee <[email protected]>
* svga: simplify/improve the format compatibility check for region copiesBrian Paul2016-09-231-5/+25
| | | | | | | | The util_is_format_compatible() function didn't quite do what we wanted for vgpu10. This check is more flexible and allows copies between formats such as R32G32B32A32_FLOAT and R32G32B32A32_INT. Reviewed-by: Charmaine Lee <[email protected]>
* svga: add const qualifier on svga_translate_format()Brian Paul2016-09-232-2/+2
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: eliminate unneeded gotos in svga_validate_surface_view()Brian Paul2016-09-231-7/+4
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: disable srgb format related code from svga_blit()Neha Bhende2016-09-231-12/+0
| | | | | | | | | With latest mesa and latest piglit tests srgb<->linear conversion is not required as per GL4.4 rules See commit b662c70aeab6a92751514f30719c13a6de253b40. Reviewed-by: Charmaine Lee <[email protected]>
* svga: minor simplification in svga_validate_surface_view()Brian Paul2016-09-211-3/+2
| | | | | | Get rid of unneeded local var. Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove disable_shader debug variableBrian Paul2016-09-213-10/+0
| | | | | | Never used, AFAIK. Reviewed-by: Charmaine Lee <[email protected]>
* svga: relax restriction of compressed formats for texture uploadCharmaine Lee2016-09-171-3/+22
| | | | | | | | | | | | | | | This patch relaxes the restriction of compressed formats for texture upload buffer. For now, 3D texture with compressed format is still not supported in the texture upload buffer path. As Brian noted, ETQW does many texture updates with glCompressedTexSubImage. This patch greatly improves the performance of the ETQW trace. Tested with ETQW, MTT piglit, glretrace, conform, viewperf v2: Per Brian's suggestion, removed the subregion boundary check. Reviewed-by: Brian Paul <[email protected]>
* svga: skip query flush if we already have the query resultBrian Paul2016-09-171-5/+5
| | | | | | | | | This reduces the number of times we flush in some situations (the arbocclude demo is one trivial example). Tested with Piglit, ETQW, Sauerbraten, arbocclude. Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove unneeded svga_context_flush() in svga_end_query()Brian Paul2016-09-171-5/+0
| | | | | | | | | Since commit 99d8fe20abe1f we don't have to flush the command buffer when we end a query. Tested with Piglit, Sauerbraten, arbocclude, ETQW (noticably faster now). Reviewed-by: José Fonseca <[email protected]>
* svga: use upload buffer for upload texture.Charmaine Lee2016-09-176-26/+279
| | | | | | | | | | | | | With this patch, when running with vgpu10, instead of mapping directly to the guest backed memory for texture update, we'll use the texture upload buffer and use the transfer from buffer command to update the host side texture memory. This optimization yields about 20% performance improvement with Lightsmark2008 and about 40% with Tropics. Tested with Lightsmark2008, Tropics, Heaven, MTT piglit, glretrace, conform. Reviewed-by: Brian Paul <[email protected]>
* svga: refactor svga_texture_transfer_map/unmap functionsCharmaine Lee2016-09-171-217/+272
| | | | | | | | | Split the functions into separate functions for dma and direct map to make the code more readable. Tested with MTT piglit, glretrace, viewperf, conform, various OpenGL apps Reviewed-by: Brian Paul <[email protected]>
* svga: add SVGA3d_vgpu10_TransferFromBuffer()Charmaine Lee2016-09-173-0/+51
| | | | | | Also add the corresponding dump function to dump the TransferFromBuffer command. Reviewed-by: Brian Paul <[email protected]>
* svga: single sample surface can be created as non-multisamples surfaceCharmaine Lee2016-09-172-2/+6
| | | | | | | | | With this patch, single sample surface will be created as non-multisamples surface. Tested with piglit, glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: fix memory leak with sampler stateCharmaine Lee2016-09-171-3/+0
| | | | | | | | | | | This patch fixes a memory leak with sampler state when piglit is run with HW version 11. Sampler state clean up was incorrectly skipped in svga_cleanup_sampler_state() for vgpu9. Tested with piglit. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: fix prim type check/assignment in translate_indices()Brian Paul2016-09-171-2/+2
| | | | | | | | Left over test code spotted by Sinclair. Tested with piglit, Google Earth, Lightsmark, Heaven4, glretraces, etc. Reviewed-by: Sinclair Yeh <[email protected]>
* svga: use SVGA3D_QUERYTYPE_MAX for svga query type checkCharmaine Lee2016-09-171-3/+3
| | | | | | | | | Use SVGA3D_QUERYTYPE_MAX instead of SVGA_QUERY_MAX for svga query type check. Tested with various OpenGL apps with GALLIUM_HUD set. Reviewed-by: Brian Paul <[email protected]>
* svga: split the num-resources-mapped hud to textures & buffersCharmaine Lee2016-09-175-12/+26
| | | | | | | | Replace the num-resources-mapped hud with num-textures-mapped and num-buffers-mapped, so we can differentiate the map counts for these two different resources. Reviewed-by: Brian Paul <[email protected]>
* svga: change svga hud defines to enumsCharmaine Lee2016-09-171-22/+25
| | | | | | This will make it easier to add new hud types. Reviewed-by: Brian Paul <[email protected]>
* svga: implement an index buffer translation cacheBrian Paul2016-09-175-6/+84
| | | | | | | | | | | | | | | Some OpenGL apps, like Cinebench R15, have many glDrawElements(GL_QUADS) calls. Since we don't directly support quads we have to convert these calls into GL_TRIANGLES which involves generating a new index buffer. This patch saves the new/translated index buffer in the hope that it can be reused for a later draw call. Cinebench R15 increases by about 20% with this change. The NobelClinician Viewer app also hits this code. Tested with full piglit run. Reviewed-by: Charmaine Lee <[email protected]>
* svga: try to emit fewer buffer rebind commandsBrian Paul2016-09-175-5/+60
| | | | | | | | | | | | | | | | | If a consecutive sequence of drawing commands references the same vertex/index buffers, there should be no need to rebind the surfaces for the second and subsequent drawing commands. Apps that use multiple display lists benefit from this since the vertex data for several display lists is often stored in one buffer. In the case of the legacy E&S Glaze demo, this reduces the size of our command buffers from 91KB to 44KB. One WSI Fusion trace shows a 33% reduction in command buffer sizes. Tested with full piglit run. Reviewed-by: Charmaine Lee <[email protected]>
* svga: reduce unmapping/remapping of the default constant bufferBrian Paul2016-09-173-6/+40
| | | | | | | | | | | | | | | Previously, every time we put shader constants into the default constant buffer we called u_upload_alloc(), which mapped the buffer, and u_upload_unmap(). We had to unmap the buffer before calling svga_buffer_handle() to get the winsys handle for the buffer. But we really only need to do that the first time we reference the const buffer. Now we try to keep the upload manager's buffer mapped until we fill it or flush the command buffer. v2: add additional comment on the buffer unmapping code in svga_context_flush(), per Charmaine. Reviewed-by: Charmaine Lee <[email protected]>
* svga: optimize memcpy() in svga_buffer_update_hw()Brian Paul2016-09-171-1/+8
| | | | | | | When we migrate a buffer from sw/malloc storage to a hardware buffer, don't memcpy the whole buffer, just copy the part we've written to. Reviewed-by: Charmaine Lee <[email protected]>
* svga: Use comparison between svga texture types to use PredCopyRegion commandNeha Bhende2016-09-171-6/+9
| | | | | | | | | | | | | | PredCopyRegion support copy between same type of textures. Instead of comparing src and dst pipe texture type, compare svga texture type which can avoid some software fallback. for example, it avoids a software blit with the Redway3D Aston demo. Tested piglit tests on VGPU9 and VGPU10 on GL/DX11Renderer, Redway3D Aston demo v2: some nit pick suggested by Charmaine. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Add function svga_resource_type()Neha Bhende2016-09-172-19/+21
| | | | | | | This function returns svga texture type for corresponding pipe texture. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: fix a texture readback bugBrian Paul2016-08-292-6/+12
| | | | | | | | | | | | | | | | | | | | Backing views/surfaces are used to handle the case when a resource is bound both as a render target and as a sampler source (such as when doing auto mipmap generation). This patch fixes a bug where mapping a resource (to do a glReadPixels) was reading the stale data in the original surface rather than the backing surface which was rendered to. We need to propagate the backing resource (which we rendered to) back to the original resource before we read from it. The problem was the svga_propagate_rendertargets() function was examining the wrong surface views. This fixes the "poc9" test described in VMware bug 1686661. Also tested with Piglit, Cinebench, Lightsmark, etc. Reviewed-by: Charmaine Lee <[email protected]>
* svga: move surface propagation code into new functionBrian Paul2016-08-293-11/+27
| | | | | | | Put new svga_propagate_rendertargets() function where all the other surface propagation code lives. Reviewed-by: Charmaine Lee <[email protected]>
* svga: s/unsigned/enum pipe_shader_type/Brian Paul2016-08-2911-22/+24
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* gallium: Use enum pipe_shader_type in set_sampler_views()Kai Wasserbäch2016-08-291-1/+1
| | | | | Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: Use enum pipe_shader_type in bind_sampler_states() (v2)Kai Wasserbäch2016-08-291-1/+1
| | | | | | | | | | | v1 → v2: - Fixed indentation (noted by Brian Paul) - Removed second assert from nouveau's switch statements (suggested by Brian Paul) Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: minor whitespace, etc clean-ups in svga_pipe_misc.cBrian Paul2016-08-261-26/+23
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: move some code in svga_propagate_surface()Brian Paul2016-08-261-18/+19
| | | | | | | Move computation of zslice, layer inside the conditional where they're used. Reviewed-by: Neha Bhende <[email protected]>
* svga: simplify surface propagation code in svga_set_framebuffer_state()Brian Paul2016-08-261-12/+4
| | | | | | Rewrite the comment too. Reviewed-by: Neha Bhende <[email protected]>
* svga: add some comments in the svga_surface structBrian Paul2016-08-261-0/+16
| | | | | | Give more info about backing resources/surfaces. Reviewed-by: Neha Bhende <[email protected]>
* svga: use new svga_check_sampler_framebuffer_resource_collision()Brian Paul2016-08-261-18/+3
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: add new svga_check_sampler_framebuffer_resource_collision()Brian Paul2016-08-262-1/+36
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: remove assertions in svga_surface cast wrappersBrian Paul2016-08-261-2/+0
| | | | | | | We don't do this for other cast wrappers. And this will simplify some code at call sites. Reviewed-by: Neha Bhende <[email protected]>
* svga: minor code simplification in svga_texture_transfer_unmap()Brian Paul2016-08-261-2/+1
| | | | | | Use the tex variable instead of using svga_texture() again. Reviewed-by: Neha Bhende <[email protected]>
* svga: reformat some expressions in svga_texture_transfer_map()Brian Paul2016-08-261-3/+3
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: remove duplicated variable in svga_texture_transfer_map()Brian Paul2016-08-261-1/+0
| | | | | | tex was already declared at the function body scope. Reviewed-by: Neha Bhende <[email protected]>
* svga: move some assignments in svga_texture_transfer_map()Brian Paul2016-08-261-4/+4
| | | | | | Put near other assignments to the svga_transfer variable. Reviewed-by: Neha Bhende <[email protected]>
* svga: minor simplifications in svga_texture_transfer_map()Brian Paul2016-08-261-9/+9
| | | | | | Use local vars instead of jumping through a pointer. Reviewed-by: Neha Bhende <[email protected]>
* svga: minor reformatting of svga_texture() cast wrapperBrian Paul2016-08-261-1/+2
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: rewrite svga_buffer() cast wrapperBrian Paul2016-08-261-6/+4
| | | | | | To make it symmetric with the svga_texture() cast wrapper. Reviewed-by: Neha Bhende <[email protected]>