Commit Graph

94468 Commits

Author SHA1 Message Date
Samuel Pitoiset 789cc87063 mesa: add KHR_no_error support to glPatchParameteri()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Samuel Pitoiset 905ad0d1dd mesa: add KHR_no_error support to glBlendEquationiARB()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Samuel Pitoiset 474f4b343b mesa: add blend_equationi() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Samuel Pitoiset 6c15260ecc mesa: add KHR_no_error support to glSampleMaski()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Samuel Pitoiset 5f51c970a9 mesa: add sample_maski() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Samuel Pitoiset e4b170e4f0 mesa: add KHR_no_error support to glDepthRangeArrayv
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Samuel Pitoiset 999f2de9a8 mesa: add depth_range_arrayv() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-31 13:53:39 +02:00
Marek Olšák 1bf703e4ea dri_interface,egl,gallium: only expose RGBA visuals on Android
X/GLX can't handle them. This removes almost 500 GLX visuals that were
incorrectly exposed.

Add an optional getCapability callback for querying what the loader can do.

I'm not splitting this patch, because it's already too small.

v2: also add the callback to __DRIimageLoaderExtension

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
2017-07-31 12:49:30 +02:00
Marek Olšák 5d8359ff4d radeonsi: expose MRT-draw-calls to HUD
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-31 12:46:43 +02:00
Samuel Pitoiset ddc32537d6 mesa: clamp viewport values only once when using glViewport()
It's useless to clamp the same values for all viewports.

+7% in the "viewport change" test (drawoverhead benchmark).

v2: - call clamp_viewport() in all callers of set_viewport_no_notify()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
2017-07-31 12:14:10 +02:00
Samuel Pitoiset 58473f8b87 mesa: make _mesa_check_init_viewport() static
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-31 12:14:07 +02:00
Kenneth Graunke 7ea4cda2ab gallium: Fix Thomas's email address
Commit 8771285054 misspelled Hellstrom.
2017-07-28 13:41:51 -07:00
Kenneth Graunke 19c90481d4 i965: s/Tungsten Graphics/VMware/ in brw_bufmgr.c.
In commit 8771285054, José replaced the
Tungsten Graphics copyright notices with VMware, as Tungsten is gone.

I later imported brw_bufmgr.c, reintroducing a Tungsten copyright.
This commit does the equivalent of José's change to the new file.
2017-07-28 13:39:22 -07:00
Kenneth Graunke 1386a8fd13 i965: Reformat the copyright header in brw_bufmgr.c
This reformats the copyright header to match what we use in most of the
newer parts of the driver.  There are a few minor alterations: we change
"COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS" to the standard
"AUTHORS OR COPYRIGHT HOLDERS", and move the permission notice to the
proper place (it should be in the middle, so "next paragraph" actually
refers to something).

Both of these changes match the OSI's MIT License text:
https://opensource.org/licenses/MIT

I copied this from genX_state_upload.c.
2017-07-28 13:35:30 -07:00
Marek Olšák f4d095cc65 radeonsi: update dirty_level_mask only when flushing or unbinding framebuffer
This fixes corruption with bindless textures in Dawn Of War 3.

The do_update_surf_dirtiness mechanism was complicated and dirty_level_mask
was only updated after the first draw call. The problem is bindless textures
are checked for decompression every draw call and we would only decompress
after the first draw call. The solution is to set dirtiness after the last
draw call to the framebuffer, so the (unconditional) decompression of
bindless textures happens at the right time.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-28 16:34:24 +02:00
Marek Olšák 221fdae38b Revert "drirc: whitelist glthread for Mount and Blade Warband"
This reverts commit a7617a49fb.

glthread disables itself automatically and therefore has no effect
on the game.
2017-07-28 16:34:24 +02:00
Samuel Pitoiset 3f38e64270 st/mesa: remove useless st_bufferobj_validate_usage()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-28 11:22:40 +02:00
Samuel Pitoiset 8971513e90 st/mesa: remove st_cache.h
It contains unused prototypes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-28 11:22:21 +02:00
Samuel Pitoiset f99e9335e2 st/glsl_to_tgsi: fix getting the image type for array of structs
Since array splitting for AoA is disabled, we have to retrieve
the type of the first non-array type when an array of images is
declared inside a structure. Otherwise, it will hit an assert
in glsl_type::sampler_index() because it expects either a sampler
or an image type.

This fixes a regression in the following piglit test:
arb_bindless_texture/compiler/images/arrays-of-struct.frag

Fixes: 57165f2ef8 ("glsl: disable array splitting for AoA")
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-28 11:20:43 +02:00
Samuel Pitoiset b38c9c57f2 mesa: fix mismatch when returning 64-bit bindless uniform handles
The slower convert-and-copy process performs a bad conversion
because it converts the value to signed 64-bit integer, but
bindless uniform handles are considered unsigned 64-bit.

This fixes "Check glUniform*() with mixed texture units/handles"
from arb_bindless_texture-uniform piglit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-28 11:20:39 +02:00
Samuel Pitoiset e0e79f0b08 mesa: remove gl_sync_object::Type field
This is useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-28 11:20:37 +02:00
Samuel Pitoiset ca4d1def39 mesa: drop fence type parameter from NewSyncObject()
This is useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-28 11:20:34 +02:00
Marek Olšák 28c7fbbe0f radeonsi: rely on CLEAR_STATE for clearing UCP and blend color registers
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-28 08:03:24 +02:00
Marek Olšák 7c721b28f6 radeonsi: rely on CLEAR_STATE for resetting the framebuffer and sample mask
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-28 08:03:24 +02:00
Marek Olšák 064550238e radeonsi: use CLEAR_STATE to initialize some registers
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-28 08:03:24 +02:00
Marek Olšák 5c1241268b st/mesa: release sampler views when redefining a texture in st_context_teximage
Noticed randomly.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-28 08:03:24 +02:00
Dave Airlie 800d162209 radv: for stencil only set Z tile mode index to same value
On SI this was causing a hang in
dEQP-VK.pipeline.render_to_image.core.2d_array.mipmap.r16g16_sint_s8_uint

This was due to not handling the tile mode index for depth like
I fixed previously for new GPUs.

Fixes: 01d0c5a9 (radv: fix stencil regression since new addrlib import)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-28 04:12:32 +01:00
Dave Airlie 554aa09440 virgl: drop precise modifier.
The host doesn't understand this yet, so drop it for now.

Fixes: virgl regressions.

Fixes: af22adee4f (tgsi: add precise flag to tgsi_instruction)
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-28 11:04:35 +10:00
Marek Olšák 7257c171e9 st/mesa: always unconditionally revalidate main framebuffer after SwapBuffers
This fixes the black Feral launcher window.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101867

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
2017-07-28 00:24:39 +02:00
Nicolai Hähnle 06e20c4b8c radeonsi: bail out instead of crashing if the main shader part failed to compile
Reviewed: Marek Olšák <marek.olsak@amd.com>
2017-07-27 21:16:45 +02:00
Nicolai Hähnle 4dd86631f4 radeonsi: update a comment for merged shaders
Reviewed: Marek Olšák <marek.olsak@amd.com>
2017-07-27 21:16:45 +02:00
Nicolai Hähnle 4738dd9546 radeonsi/gfx9: dump previous stage LLVM IR for merged shaders
Reviewed: Marek Olšák <marek.olsak@amd.com>
2017-07-27 21:16:45 +02:00
Nicolai Hähnle 760876a7b1 radeonsi: make sure TCS main output VGPRs don't alias inputs
Avoids an unnecessary move introduce by "radeonsi/gfx9: always wrap GS
and TCS in an if-block (v2)"

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-27 21:16:42 +02:00
Nicolai Hähnle 081ac6e5c6 radeonsi/gfx9: always wrap GS and TCS in an if-block (v2)
With merged ESGS shaders, the GS part of a wave may be empty, and the
hardware gets confused if any GS messages are sent from that wave. Since
S_SENDMSG is executed even when EXEC = 0, we have to wrap even
non-monolithic GS shaders in an if-block, so that the entire shader and
hence the S_SENDMSG instructions are skipped in empty waves.

This change is not required for TCS/HS, but applying it there as well
simplifies the logic a bit.

Fixes GL45-CTS.geometry_shader.rendering.rendering.*

v2: ensure that the TCS epilog doesn't run for non-existing patches

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-27 21:16:32 +02:00
Nicolai Hähnle 873789002f radeonsi/gfx9: fix vertex idx in ES with multiple waves per threadgroup
Cc: mesa-stable@lists.freedesktop.org
Reviewed: Marek Olšák <marek.olsak@amd.com>
2017-07-27 21:16:32 +02:00
George Kyriazis 194ff5eed1 swr: fix transform feedback logic
The shader that is used to copy vertex data out of the vs/gs shaders to
the user-specified buffer (streamout or SO shader) was not using the
correct offsets.

Adjust the offsets that are used just for the SO shader:
- Make sure that position is handled in the same special way
  as in the vs/gs shaders
- Use the correct offset to be passed in the core
- consolidate register slot mapping logic into one function, since it's
  been calculated in 2 different places (one for calcuating the slot mask,
  and one for the register offsets themselves

Also make room for all attibutes in the backend vertex area.

Fixes:
- all vtk GL2PS tests
- 18 piglit tests (16 ext_transform_feedback tests,
  arb-quads-follow-provoking-vertex and primitive-type gl_points

v2:

- take care of more SGV slots in slot mapping logic
- trim feState.vsVertexSize
- fix GS interface and incorporate GS while calculating vsVertexSize

Note that vsVertexSize is used in the core as the one parameter that
controls vertex size between all stages, so it has to be adjusted appropriately
for the whole vs/gs/fs pipeline.

Also note that GS and SO is not fully implemented.  This will be addressed
later.

fixes:
- fixes total of 20 piglit tests

CC: 17.2 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2017-07-27 13:54:19 -05:00
Tim Rowley e21fc2c625 swr/rast: non-regex knob fallback code for gcc < 4.9
gcc prior to 4.9 didn't implement <regex>, causing a startup crash
in the swr knob parameter reading code.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2017-07-27 08:31:21 -05:00
Timothy Arceri 2c34b49d9e mesa: check that buffer object is not NULL before initializing it
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-27 22:19:52 +10:00
Timothy Arceri 6ee3323d7d glsl: small builtin inline tidy up
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-27 22:14:37 +10:00
Dave Airlie c4652a0a5b virgl: encode index buffer offset.
Fixes arb_vertex_buffer_object-combined-vertex-index

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-27 16:10:07 +10:00
Michel Dänzer 57132d126f st/mesa: Fix inversed test in st_api_destroy_drawable
Fixes a drawable leak.

Fixes: bbc29393d3 ("st/mesa: create framebuffer iface hash table per
                      st manager")
Bugzilla: https://bugs.freedesktop.org/101930
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-27 11:12:24 +09:00
Dave Airlie e77ff11ffe radv/ac: port SI TC L1 write corruption fix.
This ports 72e46c988 to radv.
    radeonsi: apply a TC L1 write corruption workaround for SI

Fixes: f4e499ec7 (radv: add initial non-conformant radv vulkan driver)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26 23:39:24 +01:00
Dave Airlie d4b079e708 radv/winsys: fix padding command stream for SI
We were adding pad to size after creating the object, so we could
submit a CS bigger than the bo created for it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26 23:38:23 +01:00
Dave Airlie a81e99f50a radv/ac: realign SI workaround with radeonsi.
This ports: da7453666a
radeonsi: don't apply the Z export bug workaround to Hainan
to radv.

Just noticed in passing.

Fixes: f4e499ec7 (radv: add initial non-conformant radv vulkan driver)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26 23:38:17 +01:00
Jason Ekstrand f6e478c213 i965/clear: Don't perform redundant depth clears
We already have this little optimization for color clears.  Now that
we're actually tracking whether or not a slice has any fast-clear
blocks, it's easy enough to add for depth clears too.

Improves performance of GFXBench 4 TRex at 1920x1080 by:
- Skylake GT4: 0.905932% +/- 0.0620197% (n = 30)
- Apollolake:  0.382434% +/- 0.1134730% (n = 25)

v2: (by Ken) Rebase and drop intel_mipmap_tree.c changes, as they're
    no longer necessary (other patches already landed to do that part)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-26 14:43:01 -07:00
Jason Ekstrand 6db193701e i965: Only do depth resolves prior to clearing when needed
When changing the clear value, we need to resolve any fast cleared data.

Previously, we were performing resolves on every slice with HiZ enabled.
We only need to resolve slices that a) have fast clear data, and b)
aren't about to be cleared to the new color.  In the latter case, we
were actually doing a resolve, and then a fast clear - when we could
skip both, causing the existing fast cleared area to be updated to the
new clear value for no additional work.

This patch stops using intel_miptree_prepare_access in favor of a more
optimal open coded loop that knows about our clear operation.

v2: (by Ken) Rebase on islification, write a real commit message.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-26 14:43:01 -07:00
Kenneth Graunke e1d4030b0b i965: Expose get_num_logical_layers outside of intel_mipmap_tree.c.
I want to use it in brw_clear.c.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-26 14:43:00 -07:00
Marek Olšák 5e81df0f10 ac/surface: fix hybrid graphics where APU=GFX9, dGPU=older
v2: don't do it for compressed textures (bpp = 0)

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
2017-07-26 19:53:26 +02:00
Marek Olšák ed2b3f5c81 radeonsi: decrease the number of compiler threads
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-26 19:53:26 +02:00
Marek Olšák 433f6f7ac9 gallium/radeon: make S_FIXED function signed and move it to shared code
This fixes a bug uncovered by:
    2412c4c81e
    util: Make CLAMP turn NaN into MIN.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-26 19:53:26 +02:00