Commit Graph

84144 Commits

Author SHA1 Message Date
Jason Ekstrand
7bdccd104b anv/clear: Clear E5B9G9R9 images as R32_UINT
We can't actually clear these images normally because we can't render to
them.  Instead, we have to manually unpack the rgb9e5 color value on the
CPU and clear it as R32_UINT.  We still have a bit of work to do to clear
non-power-of-two images, but this should get all of the power-of-two clears
working on at least Haswell.  This fixes three of the new Vulkan CTS tests
in the dEQP-VK.api.image_clearing.clear_color_image.* group.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-08-23 11:45:25 -07:00
Jason Ekstrand
afa7ca0f77 anv/clear: Make cmd_clear_image take an actual VkClearValue
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
cf3cf2ecfc anv/blit2d: Add support for RGB destinations
This fixes 104 of the new image_clearing and copy_and_blit Vulkan CTS
tests.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
16ddda8452 anv/blit2d: Add a format parameter to bind_dst and create_iview
Signed-off-by: Jasosn Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
954c0bfb20 anv/image: Don't create invalid render target surfaces
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
ca2a8e5628 isl/formats: Update the table with more samplable formats
There were a lot of formats where support was added on Haswell or later but
we never updated the format table.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
aba9e25b70 isl/formats: Report ETC as being samplable on Bay Trail
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
f6967ddd32 i965/surface_formats: Don't advertise 8 or 16-bit RGB formats
We have implicitly been not advertising these formats since we had them
turned off in the format capabilities table.  We are about to update that
table and this prevents a change in behavior.  The only change in behavior
created by this patch is that we no longer advertise support for
R16G16B16_FLOAT which means that it's now renderable which seems like a
bonus.  Maybe someday we'll want to change things to start supporting
16-bit RGB formats natively but, at the moment, there's no need.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-08-23 11:45:24 -07:00
Jason Ekstrand
fb90291dd5 anv/formats: Don't use an RGBX format if it isn't renderable
The whole point of using RGBX is so that we can render to it so if it isn't
renderable, that kind-of defeats the purpose.  Some formats (one example is
R32G32B32X32_SFLOAT) exist in the format table but aren't actually
renderable.  Eventually, we'd like to get away from RGBX entirely, but this
fixes hangs on BDW today.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-23 11:45:24 -07:00
Nicolas Boichat
4f3f8bb59d egl/dri2: dri2_initialize: Do not reference-count TestOnly display
In the case where dri2_initialize is called with a TestOnly display,
the display is not actually initialized, so dri2_egl_display always
fails, and we cannot do any reference counting.

Fixes piglit spec@egl_khr_create_context@verify gl flavor (reproducible
with LIBGL_ALWAYS_SOFTWARE=1).

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reported-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-23 18:08:17 +01:00
Jan Ziak
6687037f1f vbo: fix format string compiler warning for 32-bit machines
Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-23 07:31:28 -06:00
Dongwon Kim
c6e97aaf75 egl/dri2: remove error checks on return values from mtx_lock and cnd_wait
This removes unnecessary error checks on return result of mtx_lock
and cnd_wait calls as in all other places in MESA source since there
is no chance that any of these functions return any of error codes
in current implementation.

This patch also removes a redundent _eglError call that follows
EGL_FALSE check in the bottom of dri2_client_wait_sync.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-23 12:00:45 +01:00
Dave Airlie
96ea753d9e i965: report bound buffer size not underlying buffer size for image size (v2)
This seems to make sense, the image is bound to a subset of the buffer
so the image size should be from the bound size not the underlying
object.

This fixes:
GL44-CTS.shader_image_size.advanced-nonMS-fs-int

v2: get mininum of the two values, same as we write to the hw.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-23 13:39:15 +10:00
Jason Ekstrand
34ff4fbba6 anv: Throw INCOMPATIBLE_DRIVER for non-fatal initialization errors
The only reason we should throw INITIALIZATION_FAILED is if we have found
useable intel hardware but have failed to bring it up for some reason.
Otherwise, we should just throw INCOMPATIBLE_DRIVER which will turn into
successfully advertising 0 physical devices

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2016-08-22 18:49:49 -07:00
Dave Airlie
26187f3890 st/glsl_to_tgsi: fix st_src_reg_for_double constant.
This needs to set the src swizzle so it doesn't access the .zw
members ever when we are just emitting a 0 constant here.

This fixes:
vert-conversion-explicit-dvec3-bvec3.shader_test
and a bunch of other fp64 tests on softpipe and radeonsi.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-23 11:14:03 +10:00
Dave Airlie
0bce055d9e mesa/subroutines: drop the old subroutine index uploads.
We used to upload the indices when they changed, now we rely
on the drivers calling the correct hook to have the values
updated from the context storage.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-08-23 11:03:46 +10:00
Dave Airlie
6a332a389a st/mesa: use the new subroutine index upload API.
This plugs the new API into the gallium state tracker.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Andres Gomez <agomez@igalia.com>
2016-08-23 11:03:45 +10:00
Dave Airlie
4adad99cfb i965: use new subroutine index uploader.
This plugs the subroutine index updates into the i965 backend,
where it loads constants.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Andres Gomez <agomez@igalia.com>
2016-08-23 11:03:45 +10:00
Dave Airlie
ea783667e4 mesa: add api to write subroutine indicies to the program storage.
This writes the subroutine indicies to the program storage for
a stage. This API is intended to be used by drivers to update
the uniform storage before uploading to the hw.

This isn't the most thread safe effort, but it will be significantly
more multi-context safe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-08-23 11:03:45 +10:00
Dave Airlie
4566aaaa5b mesa/subroutines: start adding per-context subroutine index support (v1.1)
One piece of ARB_shader_subroutine I ignored was the fact that it
needs to store the subroutine index data per context and not per
shader program.

There is one CTS test that tests this:
GL45-CTS.shader_subroutine.multiple_contexts

However the test only does a write to context and readback,
it never renders using the values, so this is enough to fix the
test however not enough to do what the spec says.

So with this patch the info is now stored per context, but
it gets updated into the program at UseProgram and when the
values are inserted into the context, which won't help if
multiple contexts are in use in multiple threads.

v1.1: cleanups and nit-picks (Andres)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-08-23 11:03:45 +10:00
Matt Turner
27d20ee264 vbo: Make #if 0'd debugging code compile. 2016-08-22 16:31:50 -07:00
Timothy Arceri
8ee909ee42 nir: avoid segfault when ssa src not found
Without this the following line will segfault and we don't get to
see the results of the validate_assert() above.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-08-23 09:06:29 +10:00
Eric Anholt
47e3cc7557 vc4: Tell state_tracker that we would prefer NIR.
Before this series, the code generation path was:

GLSL IR -> TGSI -> NIR -> NIR clone -> QIR -> QPU

Now it's (generally)

GLSL IR -> NIR -> NIR clone -> QIR -> QPU
2016-08-22 12:11:08 -07:00
Eric Anholt
d08f09c24e st/nir: Trim out unused VS input variables.
If we're going to skip setting up vertex input data in them, we should
probably not leave them as vertex inputs with a driver_location that
happens to alias to something else.

Fixes a regression in glsl-mat-attribute on vc4 when enabling GTN.

v2: Change commit message shortlog, lower the new globals away before
    handing off to the driver.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-22 12:11:05 -07:00
Eric Anholt
3ef1853f7d nir: Fix crash in nir_lower_drawpixels.
Generally you'd see the gl_Color reference first and get some cursor set.
However, in piglit draw-pixel-with-texture we're now seeing the TexCoord
dereferenced first.

Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-08-22 11:52:27 -07:00
Eric Anholt
0a8ff1681b nir: Fix a comment typo in nir_lower_drawpixels.
Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-08-22 11:52:26 -07:00
Eric Anholt
f4d143f0d9 vc4: Use proper type sizes for uniforms. 2016-08-22 11:52:26 -07:00
Eric Anholt
bdb54cdc16 vc4: Add VARYING_SLOT_PNTC support.
We end up with this when doing GLSL-to-NIR.
2016-08-22 11:52:26 -07:00
Eric Anholt
3c1ea6e651 vc4: Fix vc4_nir_lower_io for non-vec4 I/O.
To support GLSL-to-NIR, we need to be able to support actual
float/vec2/vec3 varyings.
2016-08-22 11:52:26 -07:00
Eric Anholt
e8378fee0c nir: Define system values for vc4's blending-lowering arguments.
In the GLSL-to-NIR conversion of VC4, I had a bit of trouble with what I
was calling the "state uniforms" that I was putting into the NIR fighting
with its other lowering passes.  Instead of using magic uniform base
numbers in the backend, follow the lead of load_user_clip_plane and just
define system values for them.

v2: Fix unintended change to channel_num, drop unspecified const_index
    value on blend_const_color_r_float.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-22 11:52:26 -07:00
Lionel Landwerlin
475ce61d1a anv: GetDeviceImageFormatProperties: fix TRANSFER formats
We let the user believe we support some transfer formats which we don't.
This can lead to crashes when actually trying to use those formats for
example on dEQP-VK.api.copy_and_blit.image_to_image.* tests.

Let all formats we can render to or sample from as meta implements transfers
using attachments.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-22 10:41:30 -07:00
Marek Olšák
0328b20050 gallium/hud: round max_value to print nicely rounded numbers next to graphs
This improves readability a lot.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
0f1befe926 gallium/hud: generalize code for drawing numbers next to graphs
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
a33eb48d61 gallium/hud: draw numbers with 3 decimal places if those aren't 0
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
b9c9551c09 gallium/hud: use sRGB for nicer AA lines
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
6ffde82083 gallium/hud: use AA lines for graphs
this looks a lot better (with the next patch)

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Marek Olšák
6902f9e82a gallium/hud: don't enable blending for all objects
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-22 16:01:35 +02:00
Tapani Pälli
0abebec012 util: add assert that key cannot be NULL on insertion
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-22 07:37:55 +03:00
Tapani Pälli
68233801ae glsl: fix key used for hashing switch statement cases
Implementation previously used value itself as the key, however after
hash implementation change by ee02a5e we cannot use 0 as key.

v2: use constant pointer as the key and implement comparison
    for contents (Eric Anholt)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97309
2016-08-22 07:36:33 +03:00
Mauro Rossi
a5f445640e android: i965: add per-gen libmesa_i965_gen{8,9} static
Needed to fix android build after commit 16a9fcb
which enabled genxml for gen{8,9} state setup

This is the last patch needed, android build tested successfully.
2016-08-20 16:18:31 -07:00
Mauro Rossi
9dc70a71f8 android: i965: add per-gen libmesa_i965_gen{7,75} static libraries
Needed to fix android build after commit e198983
which enabled genxml for gen{7,75} state setup

Android build fix for gen{8,9} will follow as incremental patch,
build tested successfully with all per-gen patches applied.
2016-08-20 16:18:28 -07:00
Mauro Rossi
7478ddad29 android: i965: add per-gen libmesa_i965_gen6 static library
Needed to fix android build after commit c8bc1ae
where new per-gen genX_blorp.c source replaced gen6_blorp.c for gen6

Android build fixes for gen{7,75} and gen{8,9} will follow as incremental patches,
build tested successfully with all per-gen patches applied.
2016-08-20 16:18:26 -07:00
Kenneth Graunke
7db81d9a87 glsl: Rename link_fs_input_layout_qualifiers to "inout".
We're going to handle output qualifiers here too, and calling it "inout"
seems to be the going convention.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-08-20 13:52:25 -07:00
Matt Turner
7e3e1bed03 i965/cfg: Factor common code out of switch statement.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-08-20 11:40:42 -07:00
Jason Ekstrand
a2ae67aa47 anv: Give the installed intel_icd.json file an absolute path
Not providing a path allows the ICD to work on multi-arch systems but
breaks it if you install anywhere other than /usr/lib.  Given that users
may be installing locally in .local or similar, we probably do want to
provide a filename.  Distros can carry a revert of this commit if they want
an intel_icd.json file without the path.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chad@kiwitree.net>
2016-08-20 00:50:03 -07:00
Daniel Scharrer
16ef7ab5c1 mesa: Fix fixed function spot lighting on newer hardware (again)
This was first fixed in commit b3f9c5c and then broken again in commit
fe2d2c7, which removed the abs modifier from input registers.

v2: Don't change the size of struct ureg.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91342
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Daniel Scharrer <daniel@constexpr.org>
2016-08-19 20:46:53 -07:00
Matt Turner
a9033d1dc1 i965: Remove comment within a comment. 2016-08-19 20:44:37 -07:00
Roland Scheidegger
0849621891 llvmpipe: fix issues with depth clamp
We only did depth clamp when the value was written from the fs.
This is very wrong both for d3d10 and GL, and only passed the
corresponding piglit test due to pure luck (it no longer does
with the enhanced test).
Also, interpolation clamped values to 1.0 always, which can legitimately
happen if depth clip is disabled, so fix that as well (untested).
There is one unresolved issue left, d3d10 always does depth clamping,
whereas GL does not (but does [0,1] clamp instead for fs depth outputs)
- this information isn't in any gallium state object, leave it as-is
for now (though it looks like llvmpipe misses the [0,1] clamp as well).
This (with the previous patch) fixes piglit depth-clamp-range test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-08-20 04:05:33 +02:00
Roland Scheidegger
b0a647f284 llvmpipe: fix depth clamping wrt reversed near/far values
This wasn't handled before (the result was that no matter what value got
clamped, it always ended up as the near value in this case) (if clamping
actually happened).
Fix this by using the util helper for that (the math is otherwise "mostly"
the same, mostly because there could actually be differences due to float
rounding, but I don't even know which one would be more correct).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-08-20 04:05:33 +02:00
Matt Turner
a73116ecc6 i965/sched: Simplify work done by add_barrier_deps().
Scheduling barriers are implemented by placing a dependence on every
node before and after the barrier. This is unnecessary as we can limit
the number of nodes we place dependencies on to those between us and the
next barrier in each direction.

Runtime of dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23
is reduced from ~25 minutes to a little more than three.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94681
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-19 16:52:25 -07:00