Commit Graph

96795 Commits

Author SHA1 Message Date
Jason Ekstrand 52f39d6910 i965/tex: Check if there is data to upload up-front
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-12 19:58:40 -07:00
Jason Ekstrand d9ed4f6c32 i965/barrier: Do the correct flushes for framebuffer access
Framebuffer access includes framebuffer reads so we need to invalidate
the texture cache.  We do not, however, need to flush the depth cache
because you cannot do bind a depth texture as an image.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-12 19:58:40 -07:00
Jason Ekstrand 45991479a3 i965/barrier: Do the correct flushes for texture updates
Texture uploads and downloads may go through the render pipe which may
result in texturing from or rendering to the texture or the PBO.  We
need to flush accordingly.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-12 19:58:40 -07:00
Eric Anholt 2f1cdd7137 include: Revert out the update of the Khronos GLX extension header.
They made a mistake in the MESA_swap_control XML, which I'm pursuing in
their github.  Until then, we can just back this piece out.

Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
2017-10-12 19:49:14 -07:00
Kenneth Graunke cb9a4ae6c0 i965: Ignore GL_SKIP_DECODE_EXT for textures accessed via texelFetch().
The GL_EXT_texture_sRGB_decode spec says:

"The conversion of sRGB color space components to linear color space is
 always performed if the texel lookup function is one of the texelFetch
 builtin functions.

 Otherwise, if the texel lookup function is one of the texture builtin
 functions or one of the texture gather functions, the conversion of sRGB
 color space components to linear color space is controlled by the
 TEXTURE_SRGB_DECODE_EXT parameter.

 If the TEXTURE_SRGB_DECODE_EXT parameter is DECODE_EXT, the conversion
 of sRGB color space components to linear color space is performed.

 If the TEXTURE_SRGB_DECODE_EXT parameter is SKIP_DECODE_EXT, the value
 is returned without decoding. However, if the texture is also accessed
 with a texelFetch function, then the result of texture builtin functions
 and/or texture gather functions may be returned with decoding or without
 decoding."

This patch makes i965 force sRGB decoding for any textures accessed via
texelFetch().  If textures are accessed via texelFetch() and a regular
texture access function, this will affect the other ones too - which is
fine - it's undefined according to the last paragraph quoted.

We could make both work, but we'd have to emit multiple SURFACE_STATEs,
and have two binding table sections, like we do for texture gather hacks
on older platforms.

Fixes the following Android O CTS test:
dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.texel_fetch

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-12 17:22:42 -07:00
Kenneth Graunke 32fcced7b4 meta: Unset the textures_used_by_txf bitfield.
Drivers that use Meta are happily using blitting data using texelFetch
and GL_SKIP_DECODE_EXT, but the GL_EXT_texture_sRGB spec unfortunately
makes GL_SKIP_DECODE_EXT not necessarily work with texelFetch.

As a hack, just unset the texture_used_by_txf bitfield so we can
continue with the old desired behavior.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-12 17:22:42 -07:00
Kenneth Graunke a576c148cd nir: Make nir_shader_gather_info() track texelFetch texture accesses.
For TGSI-based drivers, st_glsl_to_tgsi records this information.
For NIR-based drivers, nir_shader_gather_info() will do so.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-12 17:22:42 -07:00
Kenneth Graunke fbf4c2916c compiler: Move gl_program::TexelFetchSamplers to shader_info.
I'd like to put this sort of metadata in the shader_info structure,
rather than adding more things to gl_program.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 17:22:39 -07:00
Dave Airlie fb972ed4e5 radv: take unsafe_math and sisched into account when hashing shaders.
We want to generate different variants for sisched and unsafe_math
shader variants, so add them to the hash key.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-12 23:46:55 +01:00
Dave Airlie 26f1ba94a3 mesa/bufferobj: fix atomic offset/size get
When I realigned the bufferobj code, I didn't see the getters
were different, realign the getters to work the same as ssbo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103214
Fixes: 65d3ef7cd (mesa: align atomic buffer handling code with ubo/ssbo (v1.1))
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-13 07:53:34 +10:00
Marek Olšák 69730dc589 relnotes: document EGL_ANDROID_native_fence_sync on radeonsi 2017-10-12 22:27:55 +02:00
Eric Anholt 89e02db81f include: Update GL headers from khronos opengl registry.
Taken from their c6a99aff31874697741a08cbc8a3488606ce59c7, keeping the
BUILDING_MESA hunk in place.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-12 12:45:07 -07:00
Eric Anholt 6de8f1f970 mapi: Update extension number of MESA_tile_raster_order.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-12 12:44:51 -07:00
Eric Anholt dbf9e4fbf8 broadcom/vc5: Remove the u_resource_vtbl usage.
Like for vc4, this was just a wasted indirection.
2017-10-12 12:44:27 -07:00
Eric Anholt 376a0a9b08 mesa: Disallow GL_RED/GL_RG with half-floats on GLES2.
Sure, you'd think that the combination of GL_OES_texture_half_float and
GL_EXT_texture_rg would mean that GL_RG16F exists, but it doesn't.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103227
Fixes: c16a7443e9 ("mesa: Expose GL_OES_required_internalformat on GLES contexts.")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 12:42:13 -07:00
Marek Olšák f536f45250 radeonsi: implement sync_file import/export
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 21:07:48 +02:00
Marek Olšák 162502370c winsys/amdgpu: implement sync_file import/export
syncobj is used internally for interactions with command submission.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 21:07:41 +02:00
Marek Olšák 11adea4b24 ac: add radeon_info::has_sync_file
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 21:04:56 +02:00
Eric Anholt 20b91cd568 broadcom/vc5: Don't pair VPMSETUP with other peripheral access.
The specs don't say you can't, but pairing it with an SFU write on the
7268 breaks all our simple shader tests using gl_MVP * gl_Vertex.
2017-10-12 10:41:09 -07:00
Eric Anholt dc9fa4bfb3 broadcom/vc5: Fix inclusion of FS flag bits in dumping the FS address. 2017-10-12 10:41:09 -07:00
Marek Olšák 255573996c st/dri: implement __DRIimageExtension::validateUsage properly
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 19:03:33 +02:00
Marek Olšák 07fdc0a09c gallium: add pipe_screen::check_resource_capability
This is optional (and no CAP).

Implemented by radeonsi, ddebug, rbug, trace.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 19:03:33 +02:00
Marek Olšák 5f2073be32 ac/surface: add ac_surface::is_displayable
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 19:03:33 +02:00
Marek Olšák c3f3685fd6 amd/addrlib: add Addr2IsValidDisplaySwizzleMode
Some "standard" (_S) swizzle modes are displayable on Raven,
even though the micro tile mode says it's not displayable.
Expose the addrlib function to the driver.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 19:03:33 +02:00
tournier.elie 1233d32d2a meson: fix typo in isl
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Antia Puentes <apuentes@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-10-12 09:39:07 -07:00
Rob Herring 137b32b815 Android: disable i9x5 drivers on non-x86 builds
The i965 driver has become dependent on x86 specific compiler builtin
functions, so ensure it's disabled for non-x86 builds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-10-12 09:06:09 -05:00
Wladimir J. van der Laan 78ade65956 etnaviv: Do GC3000 resolve-in-place when possible
If an RS blit is done with source exactly the same as destination, and
the hardware supports this, do an in-place resolve. This only fills in
tiles that have not been rendered to using information from the TS.

This is the same as the blob does and potentially saves significant
bandwidth when doing i.MX6qp scanout using PRE, and when rendering to
textures (though here using sampler TS would be even better).

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2017-10-12 16:03:26 +02:00
Eric Engestrom 3ba5a467a5 egl_haiku: drop haiku_egl_driver struct
The struct only contained the one field we're interested in.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-12 14:55:10 +01:00
Eric Engestrom 3188b6e45f egl: remove left over _EGLMain_t
Fixes: b174a1ae72 "egl: Simplify the "driver" interface"
Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-12 14:43:48 +01:00
Eric Engestrom 4a6c7e8ad8 egl: drop memset(0) of calloc'ed memory
`_EGLDriver *drv` is a freshly calloc()'ed object, memset(0)'ing some of
it is a no-op.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-12 14:40:12 +01:00
Eric Engestrom 9690759d0c egl: replace _egl_driver->Unload() callback with a simple free()
Bonus: fixes a memleak on haiku when unloading the driver

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-12 14:38:55 +01:00
Dave Airlie 6049fa454e radv: don't crash if cache is disabled.
If you set MESA_GLSL_CACHE_DISABLE, radv crashed.

Fixes: fd24be134f (radv: make use of on-disk cache)
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-10-12 14:14:43 +02:00
Samuel Pitoiset 4f42ea4dcf radv: use CLEAR_STATE for initializing some registers
Based on RadeonSI.

This improves some Vulkan demos by +1% to +3%.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-10-12 09:17:43 +02:00
Samuel Pitoiset 65dcff7a26 radv: add has_clear_state and enable it on CIK+ only
This will allow us to emit the CLEAR_STATE packet instead
of a bunch of useless packets when doing CS initialization.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-10-12 09:17:40 +02:00
Samuel Pitoiset c74ed3966e radv: do not set registers for merged ES-GS on GFX9
Based on RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-10-12 09:17:38 +02:00
Samuel Pitoiset 1789cac6dd radv: move the raster config emission in si_set_raster_config()
Similar to RadeonSI, also only call this function for <= VI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-10-12 09:17:35 +02:00
Nicolai Hähnle bc2d874101 radeonsi: add support for PIPE_FORMAT_{X1,A1}R5G5B5_UNORM
Fixes dEQP-EGL.functional.image.modify.tex_rgb5_a1_tex_subimage_rgba8

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-12 08:42:55 +02:00
Nicolai Hähnle 9f55da130e gallium: add tests for PIPE_FORMAT_{X1,A1}B5G5R5_UNORM formats
This is a left-over from my version of adding the new format
after rebasing on Eric's version.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-12 08:42:55 +02:00
Dave Airlie a3ba14d0ce include/drm-uapi: clarify when headers can be updated.
Clarify when headers can be updated here.

Reviewed-by: Gurchetan Singh<gurchetansingh@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-12 09:44:27 +10:00
Timothy Arceri 0061a90550 radv: remove duplicate line of code
The same line of code is a few lines above.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-10-12 08:52:39 +11:00
Timothy Arceri fd24be134f radv: make use of on-disk cache
If the app provided in-memory pipeline cache doesn't yet contain
what we are looking for, or it doesn't provide one at all then we
fallback to the on-disk cache.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-10-12 08:52:38 +11:00
Timothy Arceri 1421625292 radv: create on-disk shader cache
This is the drivers on-disk cache intended to be used as a
fallback as opposed to the pipeline cache provided by apps.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-10-12 08:52:38 +11:00
Timothy Arceri 7664aaf331 radv: remove duplicate debug_flags field
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-10-12 08:52:38 +11:00
Lionel Landwerlin e568d2bd1f anv: intel: use anv_image's computed size for importing a BO
Rather than relying on size = stride * height, we can rely on
anv_image's total size.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-11 22:29:55 +01:00
Lionel Landwerlin c0a4f56fb9 anv: bo_cache: allow importing a BO larger than needed
It's not a problem if a BO has been allocated larger than we need it
to be.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102940
Fixes: 818b857914 ("anv: Use the BO cache for DeviceMemory allocations")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
2017-10-11 22:29:55 +01:00
Nicolai Hähnle cf3dd91969 st/glsl_to_tgsi: the second destination doesn't support relative addressing
It's not used -- DFRACEXP gets array indexes of its exponent out-parameter
lowered earlier -- and it wouldn't have worked correctly anyway when both
dst and dst1 use relative addressing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-11 23:17:08 +02:00
Nicolai Hähnle 3b666aa747 st/glsl_to_tgsi: fix DFRACEXP with only one destination
Replace the undefined destination by a new temporary register.

Cleanup merge_two_dsts while we're at it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-11 23:17:06 +02:00
Nicolai Hähnle 541208cf13 st/glsl_to_tgsi: fix indirect access to 64-bit integer
Make sure we actually allocate two adjacent TGSI temporaries. The
current code fails e.g. when an arithmetic operation has two
operands with indirect accesses.

I will send out a new piglit test
(arb_gpu_shader_int64/execution/indirect-array-two-accesses.shader_test)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-11 23:16:56 +02:00
Nicolai Hähnle 2991c0d7df st/mesa: don't assign prog->ShadowSamplers
It's not used, and the assignment for the TGSI case was incorrect
for sampler arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-11 23:16:21 +02:00
Nicolai Hähnle 0e26e767d2 st/glsl_to_tgsi: ignore GL_TEXTURE_SRGB_DECODE_EXT for samplers used with texelFetch*()
See the comment for the relevant spec quote.

Fixes dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.texel_fetch

v2: note the interaction between ARB_bindless_texture and EXT_texture_sRGB_decode
    as a TODO

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-11 23:16:20 +02:00