summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* svga: add num-bytes-uploaded HUD queryBrian Paul2015-11-205-6/+30
| | | | | | | | 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 some sanity check assertions in svga_buffer_transfer_map()Brian Paul2015-11-201-0/+5
| | | | | | | Make sure y and z values of buffers are as expected. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: use more VGPU10 formatsBrian Paul2015-11-181-30/+67
| | | | | | | | | | We always want to prefer the VGPU10 formats over the VGPU9 ones when we have VGPU10 support. Original patch by Jose and updated by Brian. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: add/use new svga_sampler_format() functionBrian Paul2015-11-183-0/+30
| | | | | | | | | This is important for the case of sampling from a depth texture. In that case, we need to sample the texture as if it were a single-channel color texture. For other/color formats, we can use the format as-is. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* gallium: add PIPE_CAP_CLEAR_TEXTURE and clear_texture prototypeIlia Mirkin2015-11-111-0/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: implement 'white_fragments' option for VGPU10 fragment shadersBrian Paul2015-11-041-5/+30
| | | | | | | | | | When we emulate XOR logicop mode with blend-subtract, we need to ensure that the fragment shader always emits white. We had this implemented for VGPU9, but not VGPU10. VMware bug 1545492. Reviewed-by: Charmaine Lee <[email protected]>
* svga: use new enum indices_mode typeBrian Paul2015-11-042-2/+4
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* gallium: add PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATSMarek Olšák2015-10-281-0/+1
| | | | | | For ARB_copy_image. Reviewed-by: Brian Paul <[email protected]>
* svga: Condition preemptive flush on draw emissionSinclair Yeh2015-10-223-0/+15
| | | | | | | | | | | | | | On ultra high resolution modes, the preemptive flush flag can be set midway through command submission, a condition that cannot be recovered from a flush-retry, causing rendering artifacts. This patch prevents a preemtive_flush until a draw has been emitted. Signed-off-by: Sinclair Yeh <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: try to avoid index generation for some primitive typesBrian Paul2015-10-221-0/+14
| | | | | | | | | | The svga device doesn't directly support quads, quad strips or polygons so we have to convert those types to indexed triangle lists. But we can sometimes avoid that if we're drawing flat/constant-colored prims and we don't have to worry about provoking vertex. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: avoid provoking vertex conversion when possibleBrian Paul2015-10-221-1/+14
| | | | | | | | | | | | Provoking vertex comes into play when doing flat shading. But if we know that all fragments in a primitive are the same color, the provoking vertex doesn't matter. Check for that case and use whichever provoking vertex convention is supported by the device. This avoids generating an index buffer to do the PV conversion. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: detect constant color writes in fragment shadersBrian Paul2015-10-225-2/+77
| | | | | | | | | | | | | | | | | | Examine the fragment shader to try to detect TGSI shaders which use "MOV OUT[0], CONST[i]" to write a constant value for the fragment color. In this case, all fragments will have the same color (unless blending is enabled). This is a common case for OpenGL code such as: glColor(), glBegin(), glVertex(), ..., glEnd() when lighting/fog/etc are disabled. In this case, the Mesa/gallium state tracker actually generates a simple "MOV OUT[0], CONST[i]" fragment shader. This will be used by the next commit to avoid provoking vertex conversion (creating/rewriting an index buffer) when drawing flat-shaded primitives. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: fix clip plane regression after recent tgsi_scan changeBrian Paul2015-10-211-2/+2
| | | | | | | | | Before the change "tgsi/scan: use properties for clip/cull distance writemasks", the tgsi_shader_info::num_written_clipdistance field was a multiple of four, now it's an accurate count. In the svga driver, we need a minor change to the loop test. Reviewed-by: Charmaine Lee <[email protected]>
* svga: add switch case for PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINTBrian Paul2015-10-201-0/+2
| | | | | | | | A third instance of this was needed but missed in the previous commit. Return 32 as for the two other cases. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* gallium: add PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINTMarek Olšák2015-10-201-0/+4
| | | | | | | | | | | | | | This avoids a serious r600g bug leading to a GPU hang. The chances this bug will get fixed are pretty low now. I deeply regret listening to others and not pushing this patch, leaving other users with a GPU-crashing driver. Yes, it should be fixed in the compiler and it's ugly, but users couldn't care less about that. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86720 Cc: 11.0 10.6 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: add PIPE_CAP_SHAREABLE_SHADERSMarek Olšák2015-10-201-0/+1
| | | | | | I'll let drivers figure out how to do it. Reviewed-by: Ilia Mirkin <[email protected]>
* svga: fix incorrect round-down arithmeticBrian Paul2015-10-191-1/+1
| | | | | | | | | Spotted by Roland. Luckily, this code should never really be hit since the const buffer size and offset should already be multiples of 16. I could probably add more assertions to that effect, but let's just fix the arithmetic for now. Reviewed-by: Roland Scheidegger <[email protected]>
* svga: only count hardware buffer mappings for HUDBrian Paul2015-10-162-1/+3
| | | | | | Don't count client memory buffer mappings since they're basically free. Reviewed-by: Charmaine Lee <[email protected]>
* svga: add new GALLIUM_HUD queriesNeha Bhende2015-10-1616-38/+196
| | | | | | | | | | | | | | | | | | 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: use new svga_new_shader_variant() functionBrian Paul2015-10-164-2/+12
| | | | | | To simplify upcoming new HUD shader count implementation. Reviewed-by: Charmaine Lee <[email protected]>
* svga: pass context to svga_tgsi_vgpu9_translate()Brian Paul2015-10-164-4/+8
| | | | | | Will be used for upcoming change. Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove svga_tgsi_vgpu9_translate() call in GS pathBrian Paul2015-10-161-7/+3
| | | | | | We can never have geometry shaders with vgpu9. Reviewed-by: Charmaine Lee <[email protected]>
* svga: whitespace fixes in svga_sampler_view.cBrian Paul2015-10-071-8/+16
|
* svga: whitespace fixes in svga_resource_buffer.cBrian Paul2015-10-071-26/+27
|
* svga: round UBO constant buffer size up/down to multiple of 16 bytesBrian Paul2015-10-071-0/+18
| | | | | | | | | | | | | | The svga3d device requires constant buffers to be a multiple of 16 bytes in size. OpenGL UBOs may not fit that restriction. As a work-around, round the size up if possible, else round down. Note that this patch only effects UBO constant buffers (index 1 or higher), not the 0th/default constant buffer. Fixes the game Grim Fandango Remastered. VMware bug 1510130. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* gallium: add per-sample interpolation control into rasterizer statOAeMarek Olšák2015-10-031-0/+1
| | | | | | | | Required by ARB_sample_shading for drivers that don't want a shader variant in st/mesa. Reviewed-by: Ilia Mirkin <[email protected]> Acked-by: Roland Scheidegger <[email protected]>
* gallium/svga: Enable PIPE_FORMAT_L8_UNORM for vgpu10Thomas Hellstrom2015-09-151-1/+1
| | | | | | | | It's extensively used by XA for a8- and planar yuv component surfaces. This fixes broken XA yuv blits using vgpu10 contexts. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: add PIPE_CAP_TGSI_TXQS to let st know if TXQS is supportedIlia Mirkin2015-09-131-0/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
* svga: clean up the compile_vs/gs/fs() functionsBrian Paul2015-09-103-49/+27
| | | | | | Sipmlify structure and remove gotos. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix shader variant memory leakBrian Paul2015-09-102-0/+6
| | | | | | | Fixes a small leak in a seldom-hit corner case for VS/FS compilation. Found with coverity. Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove useless MAX2() callBrian Paul2015-09-101-1/+1
| | | | | | The sum of two unsigned ints is always >= 0. Found with Coverity. Reviewed-by: Charmaine Lee <[email protected]>
* svga: pick all the files into the tarballEmil Velikov2015-09-091-5/+26
| | | | Signed-off-by: Emil Velikov <[email protected]>
* svga: Fix surface view error handlingThomas Hellstrom2015-09-071-22/+26
| | | | | | | | | Make sure errors are correcly propagated. Also don't flush during state emission if emission fails. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: update call to u_upload_alloc()Brian Paul2015-09-031-3/+3
| | | | | | u_upload_alloc() no longer returns a return value. Trivial.
* svga: fix referencing a NULL framebuffer cbufCharmaine Lee2015-09-021-2/+2
| | | | | | | | | Check for a valid framebuffer cbuf pointer before accessing its associated surface. Fix piglit test fbo-drawbuffers-none. Reviewed-by: Brian Paul <[email protected]>
* svga: increment texture age when surface is to be marked as dirtyCharmaine Lee2015-09-021-7/+6
| | | | | | | | | | | | | | | | Commit b9ba8492 removes an unneeded pipe_surface_release() from st_render_texture(). This implies a surface can now be reused for a render buffer. Currently, when we render to a texture, we mark the surface as dirty. But in svga_mark_surface_dirty(), if the surface is already marked as dirty, it does not increment the texture age. Any view to this texture might not be updated properly then. With this patch, the texture age is incremented regardless of whether the surface is already marked as dirty or not. Fix bug 1499181. Reviewed-by: Sinclair Yeh <[email protected]>
* svga: fix backed surface view regressionCharmaine Lee2015-09-024-17/+46
| | | | | | | | | | | | | | | | | | Commit b9ba8492 removes an unneeded pipe_surface_release() from st_render_texture() and exposes a bug in the backed surface view creation. Currently a backed surface view for a conflicted surface view is created at framebuffer emit time. But if shader sampler views are changed but framebuffer surface views remain unchanged, emit_framebuffer() will not be called and conflicted surface views will not be detected. To fix this, also check for conflicted surface views when setting sampler views. If there is any conflicted surface views, enable the framebuffer dirty bit so that the framebuffer emit code has a chance to create a backed surface view for the conflicted surface view. Fix cinebench-r11-test regression. Reviewed-by: Brian Paul <[email protected]>
* svga: update driver for version 10 GPU interfaceBrian Paul2015-09-0264-2369/+8655
| | | | | | | | | | | | | | | | | 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: add new version 10 device command prototypesBrian Paul2015-09-021-0/+333
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_streamout.h fileBrian Paul2015-09-021-0/+50
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_state_tgsi_transform.c fileBrian Paul2015-09-021-0/+293
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_state_sampler.c fileBrian Paul2015-09-021-0/+339
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_state_gs.c fileBrian Paul2015-09-021-0/+264
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_pipe_streamout.c fileBrian Paul2015-09-021-0/+320
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_pipe_gs.c fileBrian Paul2015-09-021-0/+142
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_link.[ch] filesBrian Paul2015-09-022-0/+140
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_cmd_vgpu10.c fileBrian Paul2015-09-021-0/+1289
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: add new svga_tgsi_vgpu10.c fileBrian Paul2015-09-021-0/+6778
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga: remove unused SVGA3D_* command functionsBrian Paul2015-09-022-156/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* svga/winsys: Add support for VGPU10Brian Paul2015-09-023-15/+111
| | | | | | | This involves a few driver modifications to keep things building. The driver may not actually run properly at this point. Signed-off-by: Brian Paul <[email protected]>