summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_state_framebuffer.c
AgeCommit message (Collapse)AuthorFilesLines
2017-10-03svga: tweak pre-VGPU10 rasterization offsetsBrian Paul1-17/+7
It seems there's no perfect x/y biases for line drawing to satisfy all applications. Depending on the biases, either real apps produce results similar to VGPU10 while Piglit's gl-1.0-ortho-pos fails, or vice versa. Let's lean toward real applications (Solidworks, SolidEdge, Google Earth) over Piglit. Using (-0.5, -0.5) for points, lines and triangles, seems to generally work well. We don't seem to have these issues with VGPU10. Tested with Piglit and CAD-oriented apitraces. See VMware bugs 1775498 and 1905053. Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07svga: adjust line subpixel position for HWv8Brian Paul1-1/+1
This fixes two regressions on HWv8: Piglit gl-1.0-ortho-pos Piglit/glean fbo This was caused by commit c2b92dada076a "svga: clamp device line width to at least 1 to fix HWv8 line stippling" This also fixes two conform tests: Vertex Order and Polygon Face No Piglit/conform changes with HWv9 or later. VMware bug 1905053 Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-04-26svga: Move rendertarget view related fields to hw_clear stateCharmaine Lee1-7/+7
This patch moves the rendertarget view related fields from svga_hw_draw_state to svga_hw_clear_state where all the hw framebuffer related state resides. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-04-26svga: Move setting the rendered_to flags to framebuffer emit timeCharmaine Lee1-2/+28
Instead of setting the rendered_to flags at set time, this patch moves the setting of the flags to framebuffer emit time. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-04-07svga: remove redundant surface propagationCharmaine Lee1-0/+8
Currently, surface propagation for colliding render target resource is done at framebuffer emit time for vgpu10. This patch adds the surface propagation for non-vgpu10 path to emit_fb_vgpu9() and removes the redundant surface copy at set time. Tested with MTT glretrace, piglit, NobelClinicianViewer, Turbine, Cinebench. Reviewed-by: Neha Bhende <bhenden@vmware.com>
2017-04-07svga: add a reset flag to svga_propagate_surface()Charmaine Lee1-2/+4
The reset flag specifies if the dirty bit needs to be reset after the surface is propagated to the texture. This is used to make sure that the dirty bit is not reset and stay unset before the surface is unbound. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-04-07svga: add the has_backed_views flagCharmaine Lee1-0/+6
The new has_backed_views flag specifies if any of the render target views or depth stencil view is a backing surface view. The flag is used in svga_propagate_rendertargets() so it can return early if there is no surface to propagate. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-03-02svga: fix crash regression since e027935a795Brian Paul1-2/+2
During the first update of the hw_clear_state atoms, we may not yet have a current rasterizer state object. So, svga->curr.rast may be NULL and we crash. Add a few null pointer checks to work around this. Note that these are only needed in the state update functions which are called for 'clear' validation. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-03-02svga: s/unsigned/pipe_prim_type/Brian Paul1-0/+3
And add some default switch cases to silence compiler warnings. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-07-15svga: avoid ubinding render targets that have already been unboundCharmaine Lee1-1/+6
Fixed the remaining redundant SetRenderTargets command emission. Tested with lightsMark2008, Heaven, mtt piglit, glretrace, conform. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-07-08svga: remove unused variableBrian Paul1-1/+0
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-07-08svga: rebind using render target surfaces in hw draw stateCharmaine Lee1-6/+6
Currently when we rebind framebuffer resources at the beginning of the command buffer, we use the color buffer surfaces saved in the context hw clear state. But the surfaces could be different from the actual emitted render target surfaces if any of the color buffer surfaces is also used for shader resource, in that case, we create a backed surface for the collided render target surface. So to rebind the framebuffer resources correctly, use the render target surfaces saved in the context hw draw state. Tested with Heaven, Lightsmark2008, MTT piglit, glretrace, conform. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-07-05svga: avoid emitting redundant DXSetRenderTargets commandCharmaine Lee1-18/+28
Tested with Lightsmark2008, MTT piglit, glretrace, conform. Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-12-06gallium/drivers: Sanitize NULL checks into canonical formEdward O'Callaghan1-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 <eocallaghan@alterapraxis.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2015-09-02svga: update driver for version 10 GPU interfaceBrian Paul1-52/+288
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 <brianp@vmware.com>
2014-02-14svga: adjust adjustment for point coordinatesBrian Paul1-1/+4
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-01-23svga: whitespace, formatting fixes in svga_state_framebuffer.cBrian Paul1-31/+26
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-11svga: improve loops over color buffersBrian Paul1-2/+5
Only loop over the actual number of color buffers supported, not PIPE_MAX_COLOR_BUFS. Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-11svga: document magic number of 8 render targets per batchBrian Paul1-1/+13
Grab the comments from commit message b84b7f19dfdc0 to explain what the code is doing.
2013-04-23gallium: Replace gl_rasterization_rules with lower_left_origin and ↵José Fonseca1-1/+1
half_pixel_center. Squashed commit of the following: commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852 Author: José Fonseca <jfonseca@vmware.com> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <jfonseca@vmware.com> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <jbenton@vmware.com> Date: Fri May 11 17:50:55 2012 +0100 gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center. This change is necessary to achieve correct results when using OpenGL FBOs. Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-16svga: silence MSVC double/float assignment warningsBrian Paul1-23/+23
2012-05-19svga: return PIPE_OK instead of 0Brian Paul1-3/+3
And fix the emit_rss() function's return type.
2012-05-15svga: fix FBO / viewport bugsBrian Paul1-7/+24
When drawing to a FBO, the viewport wasn't always set correctly. It was fine in the usual case of the viewport dims matching the surface dims but broken otherwise. In particular, this was happening because the viewport scale is negative for FBO rendering. The piglit fbo-viewport test exercises this. Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12svga: Fix user clip planes.José Fonseca1-1/+1
Dirty flags also need to be updated in face of recent interface change. Fixes regression in compiz. Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-10Squash-merge branch 'gallium-clip-state'Marek Olšák1-1/+1
Conflicts: src/gallium/auxiliary/tgsi/tgsi_strings.c src/mesa/state_tracker/st_atom_clip.c commit d919791f2742e913173d6b335128e7d4c63c0840 Author: Christoph Bumiller <e0425955@student.tuwien.ac.at> Date: Fri Jan 6 17:59:22 2012 +0100 d3d1x: adapt to new clip state commit cfec82bca3fefcdefafca3f4555285ec1d1ae421 Author: Christoph Bumiller <e0425955@student.tuwien.ac.at> Date: Fri Jan 6 14:16:51 2012 +0100 gallium/docs: update for clip state changes commit c02bfeb81ad9f62041a2285ea6373bbbd602912a Author: Christoph Bumiller <e0425955@student.tuwien.ac.at> Date: Fri Jan 6 14:21:43 2012 +0100 tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS commit d4e0a785a6a23ad2f6819fd72e236acb9750028d Author: Brian Paul <brianp@vmware.com> Date: Thu Jan 5 08:30:00 2012 -0700 tgsi: consolidate TGSI string arrays in new tgsi_strings.h There was some duplication between the tgsi_dump.c and tgsi_text.c files. Also use some static assertions to help catch errors when adding new TGSI values. v2: put strings in tgsi_strings.c file instead of the .h file. Reviewed-by: Dave Airlie <airlied@redhat.com> commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd Author: Christoph Bumiller <e0425955@student.tuwien.ac.at> Date: Fri Jan 6 12:48:09 2012 +0100 gallium: extend user_clip_plane_enable to apply to clip distances commit f1d5016c07f786229ed057effbe55fbfd160b019 Author: Marek Olšák <maraeo@gmail.com> Date: Fri Jan 6 02:39:09 2012 +0100 nvfx: adapt to new clip state commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24 Author: Marek Olšák <maraeo@gmail.com> Date: Fri Jan 6 01:41:39 2012 +0100 st/mesa: fix DrawPixels with GL_DEPTH_CLAMP commit c86ad730aa1c017788ae88a55f54071bf222be12 Author: Christoph Bumiller <e0425955@student.tuwien.ac.at> Date: Tue Jan 3 23:51:30 2012 +0100 nv50: adapt to new clip state commit 3a8ae6ac243bae5970729dc4057fe02d992543dc Author: Christoph Bumiller <e0425955@student.tuwien.ac.at> Date: Tue Jan 3 23:32:36 2012 +0100 nvc0: adapt to new clip state commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11 Author: Marek Olšák <maraeo@gmail.com> Date: Thu Dec 29 01:32:51 2011 +0100 draw: initalize pt.user.planes in draw_init This fixes a crash in glean/fpexceptions. commit e3056524b19b56d473f4faff84ffa0eb41497408 Author: Marek Olšák <maraeo@gmail.com> Date: Mon Dec 26 06:26:55 2011 +0100 svga: adapt to new clip state commit c5bfa8b37d6d489271df457229081d6bbb51b4b7 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 14:11:51 2011 +0100 r600g: adapt to new clip state commit f11890905362f62627c4a28a8255b76eb7de7df2 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 14:10:26 2011 +0100 r300g: adapt to new clip state commit e37465327c79a01112f15f6278d9accc5bf3103f Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 12:39:16 2011 +0100 draw: adapt to new clip state This adds a regression in the LLVM clipping path. Can anybody see anything wrong with the code? It works for every other case, just glean/fpexceptions crashes when doing the "Infinite clip plane test". commit b474d2b18c72d965eefae4e427c269cba5ce6ba2 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 13:14:59 2011 +0100 u_blitter: don't save/set/restore clip state commit 9dd240ea91f523a677af45e8d0adb9e661e28602 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 13:11:56 2011 +0100 gallium: don't cso_save/set/restore clip state The enable bits are in the rasterizer state. commit a4f7031179f5f4ad524b34b394214b984ac950f6 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 12:58:55 2011 +0100 gallium: default depth_clip to 1 depth_clip = !depth_clamp commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3 Author: Marek Olšák <maraeo@gmail.com> Date: Mon Dec 26 06:14:19 2011 +0100 trace,util: update state logging to new clip state Also dump the other missing flags. commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23 Author: Marek Olšák <maraeo@gmail.com> Date: Sun Dec 25 10:43:43 2011 +0100 st/mesa: adapt to new clip state commit b7b656a42fca19d7c85267f42649a206a85a2c72 Author: Marek Olšák <maraeo@gmail.com> Date: Sat Dec 17 15:45:19 2011 +0100 gallium: move state enable bits from clip_state to rasterizer_state
2011-11-02svga: Update state prototypes to return pipe_error.José Fonseca1-8/+12
Fixes a bunch of prototype mismatch warnings..
2011-10-11gallium: rename ZS stencil type to UINT (v2)Dave Airlie1-2/+2
these are never USCALED, always UINT in reality. taken from some work by Christoph Bumiller v2: fixup formatting of table + tabs Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-27svga: emit user-defined clip plane stateBrian Paul1-3/+20
User-defined clip planes were a swtnl fallback before.
2011-04-12svga: Rebind framebuffer and tss bindings strictly when necessary.José Fonseca1-3/+7
The earlier change to ensure rendertargets and textures are always rebound at every command buffer start had the downside of making successive flushes no longer no-ops, as a command buffer with merely the rebinding commands were being unnecessarily sent to the vGPU. This change only re-emits the bindings when necessary, by keeping track of the need to rebind outside of the dirty state update mechanism.
2011-04-07svga: another tweak to adjust_x term (use -0.5)Brian Paul1-1/+1
2011-03-24svga: adjust triangle rasterization offsetBrian Paul1-1/+1
Fixes minor sub-pixel positioning error in some apps.
2011-02-24svga: Ensure rendertargets and textures are always rebound at every command ↵José Fonseca1-0/+49
buffer start. The svga_update_state() mechanism is inadequate as it will always end up flushing the primitives before processing the SVGA_NEW_COMMAND_BUFFER dirty state flag.
2010-08-30svga: Re-emit bound rendertargets and texture samplers at the beginning of ↵José Fonseca1-5/+10
every command buffer. Only non null resources. To ensure that relocations are emitted for every resource currently referred.
2010-03-30gallium: adapt all code to the renamed depth/stencil formatsRoland Scheidegger1-1/+1
2010-03-02Merge branch 'gallium-format-cleanup'José Fonseca1-1/+1
2010-03-02svga: Rename pipe formats.José Fonseca1-1/+1
2010-02-22gallium: Remove bypass_vs_clip_and_viewport from rasteriser state.Michal Krol1-153/+132
Needs testing.
2010-02-02gallium: pipe/p_inlines.h -> util/u_inlines.hJosé Fonseca1-1/+1
2010-01-21svga: Remove unnecessary headers.Vinson Lee1-2/+0
2009-11-27svga: flush our command buffer after the 8th distinct render targetKeith Whitwell1-0/+3
This helps improve the surface cache behaviour in the face of the large number of single-use render targets generated by EXA and the xorg state tracker. Without this we can reference hundreds of individual render targets from a command buffer, which leaves little scope for sharing or reuse of those targets. Flushing early means we can start reusing textures much sooner. This shouldn't have much effect on normal 3d rendering as it's pretty rare to have a command buffer with >8 different render targets in that world.
2009-11-17svga: Add svga driverJakob Bornecrantz1-0/+455