summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* svga: Fix incorrect advertizing of EGL_KHR_gl_colorspaceThomas Hellstrom2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | | When advertizing this extension, egl_dri2 uses the DRI2_RENDERER_QUERY extension to query whether an sRGB format is supported. That extension will query our driver with the BIND flag PIPE_BIND_RENDER_TARGET rather than PIPE_BIND_DISPLAY_TARGET which is used when building the configs. We only return the correct value for PIPE_BIND_DISPLAY_TARGET. The inconsistency causes EGL to crash at surface initialization if sRGB is not supported. Fix this by supporting both bind flags. Testing done: piglit egl_gl_colorspace srgb Cc: <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: simplify uses_flat_interp expression in emit_input_declarations()Brian Paul2018-03-231-1/+1
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: replace unsigned with proper enum namesBrian Paul2018-03-232-15/+16
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: use enum tgsi_opcodeBrian Paul2018-03-232-5/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* gallium: add packed uniform CAPTimothy Arceri2018-03-201-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* svga: add SVGA_NEW_PRESCALE to the tracked dirty mask for gsCharmaine Lee2018-03-021-1/+2
| | | | | | | | Since geometry shader also consumes prescale constants, the geometry shader constant buffer will need to be updated when prescale factor is changed. Reviewed-by: Brian Paul <[email protected]>
* svga: fix blending regressionBrian Paul2018-03-021-11/+24
| | | | | | | | | | | | | | | | | | | The earlier Mesa commit 3d06c8afb5 ("st/mesa: don't translate blend state when it's disabled for a colorbuffer") subtly changed the details of gallium's per-RT blend state. In particular, when pipe_rt_blend_state[i].blend_enabled is true, we have to get the src/dst blend terms from pipe_rt_blend_state[i], not [0] as before. We now have to scan the blend targets to find the first one that's enabled (if any). We have to use the index of that target for getting the src/dst blend terms. And note that we have to set identical blend terms for all targets. This fixes the Piglit fbo-drawbuffers2-blend test. VMware bug 2063493. Reviewed-by: Charmaine Lee <[email protected]>
* svga: check svga_have_vgpu10() in svga_delete_blend_state()Brian Paul2018-03-021-1/+1
| | | | | | | We were calling SVGA3D_vgpu10_DestroyBlendState() when vgpu10 was not enabled (bs->id==0 by default), resulting in lots of device errors. Reviewed-by: Neha Bhende<[email protected]>
* svga: if svga_update_state() fails, skip the draw callBrian Paul2018-03-021-5/+5
| | | | | | | | | | | | | | | | | | | | | If svga_update_state() fails, we flush the command buffer and retry. If it fails again, it likely means we were unable to translate a shader for some reason (uses too many resources, for example). In that case, let's just skip the draw call. The alternative, just disabling the shader stage in question, would certainly lead to bad rendering anyway, and probably device errors. Fixes failed assertion running Piglit glsl-1.50/execution/ variable-indexing/gs-output-array-vec4-index-wr.shader_test since it uses too many GS output registers (though the test still fails). VMware bug 2063492. v2: also call pipe_debug_message() so apps or apitrace can be notified when this issue occurs. v3: use svga_update_state_retry(). Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: let svga_update_state_retry() return a boolBrian Paul2018-03-022-6/+9
| | | | | | | This will allow minor simplifications elsewhere. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/boolean/ for a few local varsBrian Paul2018-03-021-6/+6
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: replaced 'unsigned' with proper enum types in shader codeBrian Paul2018-02-201-12/+21
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: Fix a leftover debug hackThomas Hellstrom2018-02-201-2/+2
| | | | | | | | | | | | | | | Fix what appears to be a leftover debug hack. The hack would force the driver to take a different blit path; possibly, although unverified, reverting to software blits. Tested using piglit tests/quick. No related regressions. Cc: "17.2 17.3 18.0" <[email protected]> Fixes: 9d81ab7376 (svga: Relax the format checks for copy_region_vgpu10 somewhat) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104625 Reported-by: Grazvydas Ignotas <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: allow drivers to impose BO flags restrictions on constant buffer 0Marek Olšák2018-02-171-0/+1
| | | | Required by radeonsi for optimal behavior.
* svga: replace gotos with else clausesBrian Paul2018-02-153-23/+20
| | | | | | Simple clean-up. Reviewed-by: Charmaine Lee <[email protected]>
* svga: s/unsigned/enum pipe_shader_type/Brian Paul2018-02-153-4/+6
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: move duplicated code for setting fillmode/flatshade stateBrian Paul2018-02-151-20/+10
| | | | | | | Move the calls to svga_hwtnl_set_fillmode() and svga_hwtnl_set_flatshade() out of the two retry_draw_*() functions to the svga_draw_vbo() function. Reviewed-by: Charmaine Lee <[email protected]>
* svga: move svga_update_state() call in draw codeBrian Paul2018-02-151-18/+19
| | | | | | | | | | | | | | | | This fixes a few Piglit transform feedback regressions caused by commit 7a1401938b351. In that change I moved the moved svga_update_state() into the loops, after the calls to svga_hwtnl_set_flatshade(). But svga_hwtnl_set_flatshade() actually depends on some derived shader state. This patch moves the svga_update_state() call into svga_draw_vbo() so it's not duplicated in two places. Fixes: 7a1401938b351 ("svga: clean up retry_draw_range_elements(), retry_draw_arrays()") Reviewed-by: Charmaine Lee <[email protected]>
* svga: call tgsi_scan_shader() for dummy shadersBrian Paul2018-02-152-0/+7
| | | | | | | | | | | | | | If we fail to compile the normal VS or FS we fall back to a simple/ dummy shader. We need to rescan the the shader to update the shader info. Otherwise, this can lead to further translations failures because the shader info doesn't match the actual shader. Found by adding some extra debug assertions in the state-update code while debugging something else. v2: also update shader generic_inputs/outputs, etc. per Charmaine Reviewed-by: Charmaine Lee <[email protected]>
* gallium: drop all the guard band float caps.Dave Airlie2018-02-141-5/+0
| | | | | | | | | | Nobody queries these and nobody sets them to anything useful, the docs say TODO. Drop them until a use appears. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: Add a new A4B4G4R4 pipe format for Broadcom.Eric Anholt2018-02-021-0/+1
| | | | | | | | The VC5 HW puts A in the low bits and R in the high bits. We can't just swizzle in the shaders because the blending HW can't pick what channel A is in, so make a new format to match it. Reviewed-by: Marek Olšák <[email protected]>
* svga: remove unneeded #includes in svga_pipe_draw.cBrian Paul2018-02-011-7/+0
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: whitespace/formatting fixes in svga_pipe_draw.cBrian Paul2018-02-011-33/+34
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: clean up retry_draw_range_elements(), retry_draw_arrays()Brian Paul2018-02-011-54/+27
| | | | | | | Get rid of a bunch of goto spaghetti. Remove unneeded do_retry parameter. No Piglit changes. Also tested w/ Google Earth and other apps. Reviewed-by: Neha Bhende <[email protected]>
* svga: remove unused min/max_index params to draw_vgpu10()Brian Paul2018-02-011-4/+3
| | | | Reviewed-by: Neha Bhende <[email protected]>
* svga: use opcode local var to simplify some codeBrian Paul2018-01-311-4/+2
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: s/unsigned/VGPU10_OPCODE_TYPE/Brian Paul2018-01-311-10/+11
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* gallium: introduce PIPE_CAP_FENCE_SIGNAL v2Andres Rodriguez2018-01-301-0/+1
| | | | | | | | | Protects semaphore signaling functionality required by GL_EXT_semaphore. v2: s/semaphore/fence Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add type parameter to create_fence_fdAndres Rodriguez2018-01-301-1/+3
| | | | | | | | | | | An fd can potentially have different types of objects backing it. Specifying the type helps us make sure we treat the FD correctly. This is in preparation to allow importing syncobj fence FDs in addition to native sync FDs. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: Check rasterization state object before checking poly_stipple_enableNeha Bhende2018-01-291-1/+1
| | | | | | | | | | | | | | Sometimes rasterization state object could be empty. This is causing segfault on hw8,9,10 for some traces. This patch fixes enemy_territory_quake_wars_high, enemy_territory_quake_wars_low, etqw-demo, lightsmark2008, quake1 glretrace crashes on hw 8,9,10. Tested with mtt-glretrace and mtt-piglit. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Adjust alpha for S3TC_DXT1_EXT RGB formatsNeha Bhende2018-01-291-0/+4
| | | | | | | | | | | | According to spec, S3TC_DXT1_EXT RGB formats are supposed to be opaque. Correspoding svga formats are not handling it so explicitly setting it to 1.0. This fixes piglit test spec@ext_texture_compression_s3tc@s3tc-targeted Note: This test is testcase for freedesktop bug 100925 Tested with mtt-piglit and mtt-glretrace on 8,9,10,11 and 15 Reviewed-by: Brian Paul <[email protected]>
* svga: s/Bool/SVGA3dBool/ in SVGA3dDevCapResultBrian Paul2018-01-251-3/+3
| | | | | | And fix whitespace. To sync up with in-house code. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix context alloc error handlingGrazvydas Ignotas2018-01-231-1/+1
| | | | | | | | | 'cleanup' path is dereferencing 'svga' a lot, 'done' is a better choice. Found by Coccinelle. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Prevent use after free.Jose Fonseca2018-01-221-0/+1
| | | | | | | | | | Courtesy of clang static analyzer. I was hunting for potential sources of memory corruption using Mesa with a GL trace, and happened to find this (unrelated) issue. Cc: [email protected] Reviewed-by: Emil Velikov <[email protected]>
* autotools: include meson build files in tarballDylan Baker2018-01-191-1/+2
| | | | | | | | | | | | This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <[email protected]> Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium: remove PIPE_CAP_USER_CONSTANT_BUFFERSMarek Olšák2018-01-171-2/+0
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* gallium: remove PIPE_CAP_TEXTURE_SHADOW_MAPMarek Olšák2018-01-171-2/+0
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* gallium: remove PIPE_CAP_TWO_SIDED_STENCILMarek Olšák2018-01-171-2/+0
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* svga: add num-commands-per-draw HUD queryBrian Paul2018-01-176-0/+24
| | | | | | | | | This query shows the ratio of total commands vs. drawing commands sent to the vgpu device. This gives some idea of how many state changes are sent per draw call. The closer the ratio is to 1.0, the better. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: simplify failure code in emit_rss_vgpu9()Brian Paul2018-01-111-17/+12
| | | | | | | No need for a goto. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove unused fail parameter to EMIT_RS(), EMIT_RS_FLOAT()Brian Paul2018-01-111-57/+57
| | | | | Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: add assertion in svga_queue_rs()Brian Paul2018-01-111-0/+1
| | | | | Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: whitespace/formatting fixes in svga_state_rss.cBrian Paul2018-01-111-79/+75
| | | | | Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: update SVGA_NEW_ flags for updating sampler stateBrian Paul2017-12-281-3/+4
| | | | | | | | | | | The SVGA_NEW_FS flag is needed since we now examine the fragment shader's fs_shadow_compare_units flags. The SVGA_NEW_TEXTURE_FLAGS flag is not needed since it's only for pre-VGPU10. No piglit changes. This doesn't fix any known issues but it could pop up somewhere. Suggested by Charmaine. Reviewed-by: Charmaine Lee <[email protected]>
* svga: whitespace, formatting fixes in svga_state_tss.cBrian Paul2017-12-281-34/+21
|
* svga: check for null fs pointer in update_samplers()Brian Paul2017-12-281-1/+1
| | | | | | | | This can happen when there's no active fragment shader, such as when using transform feedback. This wasn't hit by any Piglit test but is hit by Daniel Rákos' Nature demo. VMware bug 2026189. Reviewed-by: Charmaine Lee <[email protected]>
* svga: move variant->fs_shadow_compare_units assignmentBrian Paul2017-12-271-2/+2
| | | | | | | Fixes a crash since the variant object isn't allocated until later in the function. Not sure how this got through. Reviewed-by: Charmaine Lee <[email protected]>
* svga: use tgsi_util_get_shadow_ref_src_index() in a couple placeBrian Paul2017-12-261-22/+7
| | | | | | | No piglit changes. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix TGSI_TEXTURE_SHADOW1D coordinate selectionBrian Paul2017-12-261-3/+1
| | | | | | | Fixes about 24 Piglit tex-miplevel-selection tests. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix shadow comparison failuresBrian Paul2017-12-265-36/+78
| | | | | | | | | | | | | | In some cases, We do shadow comparison cases in the fragment shader instead of with texture sampler state. But when we do so, we must disable the shadow comparison test in the sampler state. As it was, we were doing the comparison twice, which resulted in nonsense. Also, we had the texcoord and texel value swapped in the comparison instruction. Fixes about 38 Piglit tex-miplevel-selection tests. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>