Commit Graph

93966 Commits

Author SHA1 Message Date
Ilia Mirkin cf173b5dcd a5xx: add border color clamping, add packed border color formats
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-08 21:14:58 -04:00
Ilia Mirkin a9b58a00bb a5xx: fix border colors for swizzled texture formats
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-08 21:14:58 -04:00
Ilia Mirkin a4eeb0c403 a5xx: fix integer texture border colors
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-08 21:14:58 -04:00
Ilia Mirkin 1acc101b3f a5xx: fix primitive restart
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-08 21:14:58 -04:00
Andres Gomez e6b189351f nir/spirv: Remove unnecessary comment.
It should have been removed after 00c47e111c.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-07-08 21:14:19 +03:00
Bas Nieuwenhuizen 1aba0e7f58 radv: Add compute htile clear for combined depth+stencil surfaces.
Figured out the clear value when we have a combined depth stencil
surface.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-07-08 16:11:29 +02:00
Roland Scheidegger 4db72852a1 draw: handle more TGSI_SEMANTIC_COLOR indices
It could only handle indices 0/1, otherwise what happened was bad (accessing
array out of bounds, no crash but kind of random). This is enough for the gl
state tracker (primary/secondary color) but not enough for some other state
trackers (d3d9 has no limits on the number of color interpolants).
The complexity with color semantics are all due to the front/back mapping (2
outputs in the vs map to one input in the fs) so this isn't extended to
indices > 1 - d3d9 has no use for back colors, therefore this isn't needed and
still only 2 back colors can be handled correctly.

Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-08 06:02:18 +02:00
Matias N. Goldberg f728435e1f st/mesa: Fix grabbing the wrong variant if glDrawPixels is called
By design pixel shaders can have up to 3 variants:
* The standard one.
* glDrawPixels variant.
* glBitmap variant.
However "shader_has_one_variant" ignores this fact, and therefore
st_update_fp would select the wrong variant if glDrawPixels or glBitmap
was ever called.

This patch fixes the problem. If the standard variant has been created,
calling glDrawPixels or glBitmap will append the variant to the second
entry of the linked list, so that st_update_fp still selects the right
one if shader_has_one_variant is set.

If the standard variant hasn't been created yet and glDrawPixel/Bitmap
has been called, st_update_fp will will see this and take the slow path
instead. The standard variant will then be added at the front of the
linked list, so that the next time the fast path is taken.

Blender in particular is hit by this bug.

v2: Marek - cosmetic changes

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=101596

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2017-07-08 01:44:51 +02:00
Nanley Chery 753a7bbc84 Revert "intel/isl: Only create a CCS buffer if the image supports rendering"
This reverts commit 8aaa13467d, which was
based on an incorrect assumption. Unlike the restriction placed on image
views in the Vulkan API, OpenGL allows you to render to texture views
whose formats differ from the originals.

Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=101677
2017-07-07 14:24:58 -07:00
Brian Paul 9ac55e8219 mesa: finish implementing glPrimitiveRestartNV() for display lists
If we try to build a display list with just a glPrimitiveRestartNV()
call, we'd crash because of a null GLvertexformat::PrimitiveRestartNV
pointer.  This change fixes that case.

The previous patch fixed the case of calling glPrimitiveRestartNV()
inside a glBegin/End pair.

v2: minor clean-up in save_PrimitiveRestartNV(), per Charmaine.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07 12:22:46 -06:00
Olivier Lauffenburger f5c8bb1e00 vbo: fix glPrimitiveRestartNV crash inside a display list
glPrimitiveRestartNV crashes when it is called during the compilation
of a display list.

There are two reasons:
- ctx->Driver.CurrentSavePrimitive is not set to the current primitive
- save_PrimitiveRestartNV() calls _save_Begin() which only sets an
  OpenGL error, instead of calling vbo_save_NotifyBegin().

This patch correctly calls vbo_save_NotifyBegin() but it detects
the current primitive mode by looking at the latest saved primitive.

Additional work by Brian Paul

Signed-off-by: Olivier Lauffenburger <o.lauffenburger@topsolid.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101464
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07 12:22:34 -06:00
Brian Paul 1d0bdfb56d st/mesa: remove unused st_framebuffer::Private field
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07 12:04:58 -06:00
Brian Paul 1b3cbcc7be mesa: add some braces in _mesa_make_current()
Slightly better readability.
2017-07-07 12:04:34 -06:00
Brian Paul 960aa95df6 vbo: rename target->index in loopback code
Because it's a vertex attribute index.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07 12:04:34 -06:00
Brian Paul 650b3c8756 vbo: whitespace/formatting fixes in vbo_save_loopback.c
Trivial.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07 12:04:34 -06:00
Brian Paul 7022e298b0 vbo: simplify vbo_save_NotifyBegin()
This function always returned GL_TRUE.  Just make it a void function.
Remove unreachable code following the call to vbo_save_NotifyBegin()
in save_Begin() in dlist.c

There were some stale comments that no longer applied since an earlier
code refactoring.

No Piglit regressions.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-07 12:04:34 -06:00
Brian Paul 5b8d33acef svga: adjust line subpixel position for HWv8
This fixes two regressions on HWv8:
  Piglit gl-1.0-ortho-pos
  Piglit/glean fbo
This was caused by commit c2b92dada0 "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-07-07 12:04:17 -06:00
Aleksander Morgado 5d8514de14 etnaviv: fix refcnt initialization in etna_screen
Despite being a member of the etna_screen struct, 'refcnt' is used by
the winsys-specific logic to track the reference count of the object
managed in a hash table. When the count reaches zero, the pipe screen
is removed from the table and destroyed.

Fix the logic by initializing the refcnt to 1 when screen created.
This initialization is done in etna_screen_create(), to follow the
same logic as in freedreno and virgl.

Fixes: c9e8b49b88 ("etnaviv: gallium driver for Vivante GPUs")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2017-07-07 15:39:29 +02:00
Ilia Mirkin c036122646 a5xx: add support for rendering to RGB10A2_UNORM formats
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-07 09:09:48 -04:00
Ilia Mirkin a00727ab25 a5xx: set uint/sint bits for mrt output register
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-07 09:09:48 -04:00
Ilia Mirkin e803023614 a5xx: add backface stencil emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-07-07 09:09:48 -04:00
Samuel Pitoiset a584a12308 radeonsi: fix invalidating bindless buffer descriptors
The VA is stored at [4:5], not [0:1]. This invalidated all
texture buffer descriptors when they were made resident in
the current context.

This removes few partial flushes and cache invalidations which
are needed when updating a bindless descriptor on the fly with
a WRITE_DATA packet.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-07 09:09:39 +02:00
Olivier Lauffenburger 43dea65ad2 st/wgl: Implement wglUseFontBitmaps.
wglUseFontBitmaps is currently a noop.
This patch implements this function for Windows.
Misc code clean-ups by Brian.

Signed-off-by: Olivier Lauffenburger <o.lauffenburger@topsolid.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-06 17:26:05 -06:00
Olivier Lauffenburger 80c6598cdb st/wgl: improve selection of pixel format
Current selection of pixel format does not enforce the request of
stencil or depth buffer if the color depth is not the same as
requested.

For instance, GLUT requests a 32-bit color buffer with an 8-bit
stencil buffer, but because color buffers are only 24-bit, no
priority is given to creating a stencil buffer.

This patch gives more priority to the creation of requested buffers
and less priority to the difference in bit depth.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101703
Signed-off-by: Olivier Lauffenburger <o.lauffenburger@topsolid.com>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-06 17:25:58 -06:00
Alex Smith c2a5cb6427 ac/nir: Fix ordering of parameters for image atomic cmpswap intrinsics
The NIR parameters are ordered "compare, data", matching GLSL, but both
the image and buffer LLVM intrinsics take them the other way around.
This is already handled correctly for SSBO atomics.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver"
2017-07-07 00:57:25 +02:00
Brian Paul 7cc6ee56c6 mesa: simplify get_tex_images_for_clear()
Get rid of redundant code.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-06 16:33:57 -06:00
Brian Paul f3a608d9f9 mesa: new comments, assertion related to glClearTexSubImage
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-06 16:33:57 -06:00
Brian Paul ccdcce3638 st/mesa: find proper mipmap level in st_ClearTexSubImage()
The Piglit arb_clear_texture-error test creates a texture with only
a 1x1 image at level=1, then tries to clear level 0 (nonexistent)
and level 1 (exists).  The test only checks that the former generates
an error but the later doesn't.  The test passes, but when we try
to clear the level=1 image we're passing an invalid level to
pipe_context::clear_texture().  level=1, but since there's only one
mipmap level in the texture, it should be zero.

This fixes the code to search the gallium texture resource for the
correct mipmap level.  Also, add an assertion to make sure we're not
passing an invalid level to pipe_context::clear_texture().

Fixes device errors with VMware driver.  No Piglit regressions.

v2: don't do the level search when using immutable textures.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-06 16:33:57 -06:00
Brian Paul 7e2669d02f st/mesa: whitespace fixes in st_cb_fbo.c
Trivial.
2017-07-06 16:33:57 -06:00
Brian Paul dd50663e7b st/mesa: whitespace fixes in st_texture.c
Trivial.
2017-07-06 16:33:57 -06:00
Dave Airlie 8950fac6ab radv: don't overallocate depth/stencil formats
For depth/stencil formats the surface layer allocates the
stencil separately, so we don't need to include it in the
bpe.

This reduces the side of d32s8 allocates to something closer to pro.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-06 23:23:22 +01:00
Dave Airlie 09d7c7be4f radv: enable sisched toggle in perftest flags.
RADV_PERFTEST=sisched

to enable it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-06 23:07:49 +01:00
Dave Airlie d97275e42c ac/llvm: set xnack like radeonsi does.
Use family, but only set xnack+ for gfx9.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-06 23:07:45 +01:00
Dave Airlie 01e958d631 ac/llvm: create features list using snprintf.
Just more moving code around before adding things to it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-06 23:06:04 +01:00
Dave Airlie 9d9f051390 ac/radv: change api to create target machine
This just modifies the API to make it easier to add other flags
to target machine creation.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-06 23:05:59 +01:00
Eric Engestrom 076faf8764 build systems: move git_sha1_gen.sh to bin/
There was no reason for this script to live outside the scripts
directory.

Suggested-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-06 22:59:39 +01:00
Tim Rowley bab03c06fc swr/rast: Correctly allocate SWR_STATS memory as cacheline aligned
Cacheline alignment of SWR_STATS to prevent sharing of cachelines
between threads (performance).

Gets rid of gcc-7.1 warning about using c++17's over-aligned new
feature.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2017-07-06 15:01:00 -05:00
Tim Rowley 1f0680b51e swr/rast: remove unused variables
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2017-07-06 15:00:54 -05:00
Tim Rowley d50ef7332c swr/rast: don't use _mm256_fmsub_ps in AVX code
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2017-07-06 15:00:48 -05:00
Tim Rowley f0a22956be swr/rast: _mm*_undefined_* implementations for gcc<4.9
Define these in terms of setzero for ancient gcc versions which don't
have the undefined intrinsics.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2017-07-06 15:00:28 -05:00
Aleksander Morgado a6893a50c8 etnaviv: don't dereference etna_resource pointer if allocation fails
The check for the pointer being non-NULL was being done too late.

Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-07-06 21:06:25 +02:00
Vinson Lee c5d0dc7fa5 scons: Check for xlocale.h before defining HAVE_XLOCALE_H.
Don't assume the header is present on some platforms - use the more
robust CheckHeader() instead.

glibc 2.26 removed xlocale.h.
https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27

Fix this build error with glibc 2.26.

  Compiling src/util/strtod.c ...
src/util/strtod.c:32:10: fatal error: xlocale.h: No such file or directory
 #include <xlocale.h>
          ^~~~~~~~~~~

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101657
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-07-06 09:51:28 -07:00
Dave Airlie a6c2001ace radv: add support for cmd predication.
This doesn't get used yet, it just adds support to various PKT3
emissions to enable it later.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-06 02:06:49 +01:00
Ilia Mirkin 880f21f55d glsl: check if any of the named builtins are available first
_mesa_glsl_has_builtin_function is used to determine whether any variant
of a builtin are available, for the purpose of enforcing the GLSL ES
3.00+ rule that overloads or overrides of builtins are disallowed.

However the builtin_builder contains information on all builtins,
irrespective of parse state, or versions, or extension enablement. As a
result we would say that a builtin existed even if it was not actually
available.

To resolve this, first check if at least one signature is available for
a builtin before returning true.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101666
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-05 20:05:53 -04:00
Jason Ekstrand ab1939aea8 nir/spirv: Rework function argument setup
Now that we have proper pointer types, we can be more sensible about the
way we set up function arguments and deal with the two cases of pointer
vs. SSA parameters distinctly.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2017-07-05 15:26:56 -07:00
Jason Ekstrand 0bdc622d43 nir/spirv: Stop trying to convert pointers to SSA in glsl450
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2017-07-05 15:26:55 -07:00
Jason Ekstrand 849bfc85c9 nir/spirv: Use real pointer types
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2017-07-05 15:26:55 -07:00
Jason Ekstrand ca62e849d3 nir/spirv: Stop using glsl_type for function types
We're going to want the full vtn_type available to us anyway at which
point glsl_type isn't really buying us anything.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2017-07-05 15:26:55 -07:00
Jason Ekstrand 96f2439858 nir/spirv: Beef up the type system a bit
This adds a vtn concept of base_type as well as a couple of other
fields.  This lets us be a tiny bit more efficient in some cases but,
more importantly, it will eventually let us express things the GLSL type
system can't.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2017-07-05 15:26:55 -07:00
Jason Ekstrand ad4519696d nir/spirv: Compact vtn_type
Use an anonymous union of structs to help keep the structure small and
better organized.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2017-07-05 15:26:54 -07:00