aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_resource_texture.c
Commit message (Collapse)AuthorAgeFilesLines
* 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: add guest statistic gathering interfaceCharmaine Lee2016-08-261-10/+27
| | | | | | | | | | | | With this patch, guest statistic gathering interface is added to svga winsys interface that can be used to gather svga driver statistic. The winsys module can then share the statistic info with the VMX host via the mksstats interface. The statistic enums used in the svga driver are defined in svga_stats_count and svga_stats_time in svga_winsys.h Reviewed-by: Brian Paul <[email protected]>
* svga: don't call os_get_time() when not needed by Gallium HUDBrian Paul2016-08-161-3/+2
| | | | | | | The calls to os_get_time() were showing up higher than expected in profiles. Reviewed-by: Charmaine Lee <[email protected]>
* gallium: split transfer_inline_write into buffer and texture callbacksMarek Olšák2016-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | to reduce the call indirections with u_resource_vtbl. The worst call tree you could get was: - u_transfer_inline_write_vtbl - u_default_transfer_inline_write - u_transfer_map_vtbl - driver_transfer_map - u_transfer_unmap_vtbl - driver_transfer_unmap That's 6 indirect calls. Some drivers only had 5. The goal is to have 1 indirect call for drivers that care. The resource type can be determined statically at most call sites. The new interface is: pipe_context::buffer_subdata(ctx, resource, usage, offset, size, data) pipe_context::texture_subdata(ctx, resource, level, usage, box, data, stride, layer_stride) v2: fix whitespace, correct ilo's behavior Reviewed-by: Nicolai Hähnle <[email protected]> Acked-by: Roland Scheidegger <[email protected]>
* svga: set render target flag for snorm surfacesBrian Paul2016-06-301-0/+10
| | | | | | | | | We don't normally support rendering to SNORM surfaces, but with GL_ARB_copy_image we can copy to them if we treat them as typeless and use a UNORM surface view. Acked-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: use untyped surface formats in most casesBrian Paul2016-06-301-4/+7
| | | | | | | | | This allows us to do copies between different, but compatible, surface formats such as RGBA8_UNORM, RGBA8_SINT, RGBA8_UINT, etc. for GL_ARB_copy_image. Acked-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: force direct map for transfering multiple slicesCharmaine Lee2016-06-281-15/+24
| | | | | | | | | | | | | With commit fb9fe35, we start using transfer_inline_write for memcpy of TexSubImage. But SurfaceDMA command does not work well with texture array. This patch forces direct map when transfering multiple slices of a texture array. Fixes piglit regression "texelFetch fs sampler1DArray" Tested with MTT piglit, glretrace, conform. Reviewed-by: Sinclair Yeh <[email protected]>
* svga: fix texture array update regressionCharmaine Lee2016-06-231-6/+27
| | | | | | | | | | | | | | | With commit fb9fe35, we start using transfer_inline_write for memcpy TexSubImage path, but that triggers a regression with texture array in the svga driver. With this patch, the direct map code will update the texture array correctly. Fixes VMware bug 1679293. Tested with MTT piglit, glretrace, conform. Reviewed-by: Brian Paul <[email protected]>
* svga: allow copy box in svga_transfer_dma_band()Charmaine Lee2016-06-021-13/+20
| | | | | | | | | | | | | Instead of just allow copy of a rectangle in svga_transfer_dma_band(), this patch allows it to copy a box, hence allows copy a 3d texture in one transfer. Fixes black screen in running Heaven after commit fb9fe35. (Bug 1663282) Tested with Heaven, glretrace, piglit. Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: try to flag surfaces for sampling, in addition to renderingBrian Paul2016-05-031-0/+11
| | | | | | | | | This silences some warnings when we try to sample from surfaces that were created for drawing, such as when blitting from one of the framebuffer surfaces. We were already doing the opposite situation (adding a bind flag for rendering to surfaces declared as texture sources). Reviewed-by: Charmaine Lee <[email protected]>
* svga: mark the texture dirty for write transfer map onlyCharmaine Lee2016-04-251-2/+4
| | | | | | | | | Instead of unconditionally mark the texture subresource dirty at transfer map, we'll set the dirty bit for write transfer only. Tested with lightsmark2008 and glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: minimize surface flushCharmaine Lee2016-04-251-15/+56
| | | | | | | | | | | | Currently, we always do a surface flush when we try to establish a synchronized write transfer map. But if the subresource has not been modified, we can skip the surface flush. In other words, we only need to do a surface flush if the to-be-mapped subresource has been modified in this command buffer. With this patch, lightsmark2008 shows about 15% performance improvement. Reviewed-by: Brian Paul <[email protected]>
* svga: add a few more resource updates HUD queryCharmaine Lee2016-03-211-0/+2
| | | | | | | | | | | | This patch adds the following HUD queries: .num-resource-updates -- number of resource update. Commands include UPDATE_SUBRESOURCE, UPDATE_GB_IMAGE. .num-buffer-uploads -- number of buffer uploads. .num-const-buf-updates -- number of set constant buffer. .num-const-updates -- number of set shader constant. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
* svga: add new num-readbacks HUD queryCharmaine Lee2016-03-211-0/+2
| | | | | | | To find out how many image readback command is issued. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
* svga: add new surface-write-flushes HUD queryBrian Paul2016-03-071-1/+3
| | | | | | | To know when we're flushing the command buffer because we need to write to surface in the command buffer. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix an error in svga_texture_generate_mipmapCharmaine Lee2016-03-041-1/+6
| | | | | | | With this patch, make sure the shader resource view is properly created before referencing it in the generate mipmap command. Reviewed-by: Brian Paul <[email protected]>
* svga: add DXGenMips command supportCharmaine Lee2016-01-141-0/+58
| | | | | | | | | | | | | For those formats that support hw mipmap generation, use the DXGenMips command. Otherwise fallback to the mipmap generation utility. Tested with piglit, OpenGL apps (Heaven, Turbine, Cinebench) v2: make sure the texture surface was created with the render target bind flag set relocation flag to SVGA_RELOC_WRITE for the texture surface Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium/drivers: Sanitize NULL checks into canonical formEdward O'Callaghan2015-12-061-1/+1
| | | | | | | | | | Use NULL tests of the form `if (ptr)' or `if (!ptr)'. They do not depend on the definition of the symbol NULL. Further, they provide the opportunity for the accidental assignment, are clear and succinct. Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* svga: add num-bytes-uploaded HUD queryBrian Paul2015-11-201-0/+6
| | | | | | | | To graph the number of bytes uploaded to GPU per frame (vertex buffer data, constant buffer data, texture data, etc). Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: add new GALLIUM_HUD queriesNeha Bhende2015-10-161-6/+21
| | | | | | | | | | | | | | | | | | Add new GALLIUM_HUD queries for: num-shaders num-resources num-state-objects num-validations map-buffer-time num-surface-views num-resources-mapped num-flushes Most of this patch was originally written by Neha. Additional clean-ups and num-flushes counter added by Brian Paul. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: update driver for version 10 GPU interfaceBrian Paul2015-09-021-172/+335
| | | | | | | | | | | | | | | | | This is a squash commit of roughly two years of development work. Authors include: Brian Paul Charmaine Lee Thomas Hellstrom Jakob Bornecrantz Sinclair Yeh Mingcheng Chen Kai Ninomiya MengLin Wu The driver supports OpenGL 3.3. Signed-off-by: Brian Paul <[email protected]>
* svga: fix comment typoBrian Paul2014-12-011-1/+1
|
* svga: remove some unneeded INLINE qualifiersBrian Paul2014-08-141-2/+2
| | | | Trivial.
* svga: Add a limit to the maximum surface sizeCharmaine Lee2014-08-121-2/+4
| | | | | | | | | This patch adds a limit to the maximum surface size which is based on the maximum size of a single mob. If this value is not available, the maximum surface size is by default set to 128 MB. Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: update texture code for GBSBrian Paul2014-02-141-64/+324
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: add helpers for tracking rendering to texturesBrian Paul2014-02-141-0/+9
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: split / update svga3d header filesBrian Paul2014-02-141-1/+1
| | | | | | | | | | The old svga3d_reg.h file is split into separate header files and we add new items for guest-backed surfaces. Plus some minor code fixes because of renamed symbols. Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: allow 3D transfers in svga_texture_transfer_map()Brian Paul2013-06-251-4/+3
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: use new svga_define_texture_level() helperBrian Paul2013-06-251-2/+2
| | | | | | To get array bounds checking. Reviewed-by: Jose Fonseca <[email protected]>
* svga: use new svga_age_texture_view() helperBrian Paul2013-06-251-1/+1
| | | | | | | | | The function does array bounds checking. Note, this exposes a bug in the svga_mark_surface_dirty() function: we're calling svga_age_texture_view() with a texture slice instead of mipmap level. This can lead to a failed assertion. That'll be fixed next. Reviewed-by: Jose Fonseca <[email protected]>
* svga: use svga_texture() helper instead of castingBrian Paul2013-06-251-1/+1
|
* svga: add new memory-used HUD queryBrian Paul2013-04-031-0/+6
| | | | | | | To track the amount of memory used by all pipe_resources (textures and buffers). Reviewed-by: Jose Fonseca <[email protected]>
* svga: add, use SVGA3D_SURFACE_HINT_VOLUME flagBrian Paul2013-02-011-0/+4
| | | | Reviewed-by: Reviewed-by: José Fonseca <[email protected]>
* svga: silence some MSVC signed/unsigned comparison warningsBrian Paul2012-10-161-1/+1
|
* gallium: unify transfer functionsMarek Olšák2012-10-111-41/+23
| | | | | | | | | | | | | | "get_transfer + transfer_map" becomes "transfer_map". "transfer_unmap + transfer_destroy" becomes "transfer_unmap". transfer_map must create and return the transfer object and transfer_unmap must destroy it. transfer_map is successful if the returned buffer pointer is not NULL. If transfer_map fails, the pointer to the transfer object remains unchanged (i.e. doesn't have to be NULL). Acked-by: Brian Paul <[email protected]>
* svga: Remove wierd code which forces non-sRGB formats.John Kåre Alsaker2012-10-101-8/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"Marek Olšák2012-03-051-1/+1
| | | | | | | This reverts commit 0950086376b1c8b7fb89eda81ed7f2f06dee58bc. It was decided to refactor the transfer API instead of adding workarounds to address the performance issues.
* svga: re-enable deleted surface cachingBrian Paul2012-02-231-2/+1
| | | | | | | | Basically, instead of immediately freeing deleted surfaces, hang onto them in a cache to do quick re-allocation. This helps when surfaces are frequently destroyed and then reallocated a bit later. Reviewed-by: José Fonseca <[email protected]>
* gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the deviceThomas Hellstrom2012-01-121-3/+6
| | | | | | | | Some hardware versions rely on it to render correctly. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
* svga: fix assorted whitespace issues, add copyright commentBrian Paul2012-01-071-16/+0
|
* gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLYMarek Olšák2012-01-051-1/+1
| | | | | | | | | | | Please see the diff for further info. This paves the way for moving user buffer uploads out of drivers and should allow to clean up the mess in u_upload_mgr in the meantime. For now only allowed for buffers on r300 and r600. Acked-by: Christian König <[email protected]>
* svga: Tag cursors with the scanout hintJakob Bornecrantz2011-11-021-2/+3
| | | | | Signed-off-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
* svga: Cleanup format capability checking.José Fonseca2011-09-231-83/+1
| | | | | | Accurately describe what operations are supported when a format caps entry is not advertised by the host, and which formats are never supported, instead of making ad-hoc and often incorrect assumptions.
* svga: Don't use the new depth formats for surfaces that will never be ↵José Fonseca2011-09-231-9/+11
| | | | | | | sampled from. Mitigates issues with hosts where support for these new depth formats is flaky.
* svga: Consider the new depth formats in svga_texture_from_handle().José Fonseca2011-09-231-1/+2
|
* svga: Expose the new depth formatsJakob Bornecrantz2011-09-231-9/+11
|