Compare commits

...

22 Commits

Author SHA1 Message Date
Emil Velikov
2bf79cb2f1 Update version to 17.1.0-rc2
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-24 15:23:07 +01:00
Emil Velikov
fb6379697b st/clover: add space between < and ::
As pointed out by compiler

./llvm/codegen.hpp:52:22: error: ‘<::’ cannot begin a template-argument list [-fpermissive]
./llvm/codegen.hpp:52:22: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’

Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
(cherry picked from commit dd6ec78b4f)
2017-04-24 13:27:37 +01:00
Vinson Lee
0948e113d2 configure.ac: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b81d85f175)
2017-04-24 13:14:07 +01:00
Timothy Arceri
f61c453cfc mesa: validate sampler type across the whole program
Currently we were only making sure types were the same within a
single stage. This looks to have regressed with 953a0af8e3.

Fixes: 953a0af8e3 ("mesa: validate sampler uniforms during gluniform calls")

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
https://bugs.freedesktop.org/show_bug.cgi?id=97524
(cherry picked from commit d682f8aa8e)
2017-04-24 13:13:38 +01:00
Emil Velikov
612fc14aab mesa/glthread: correctly compare thread handles
As mentioned in the manual - comparing pthread_t handles via the C
comparison operator is incorrect and pthread_equal() should be used
instead.

Cc: Timothy Arceri <tarceri@itsqueeze.com>
Fixes: d8d81fbc31 ("mesa: Add infrastructure for a worker thread to process GL commands.")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 52df318d61)
2017-04-24 13:13:22 +01:00
Emil Velikov
8aa9aa6a5f st/mesa: automake: honour the vdpau header install location
If VDPAU is installed in the non-default location, we'll fail to find
the headers and error at build time.

../../src/gallium/include/state_tracker/vdpau_dmabuf.h:37:25: fatal error: vdpau/vdpau.h: No such file or directory
 #include <vdpau/vdpau.h>
                         ^

Fixes: faba96bc60 ("st/vdpau: add new interop interface")
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 51c0c213b7)
2017-04-24 13:13:07 +01:00
Emil Velikov
10ff4b49dc configure.ac: check require_basic_egl only if egl enabled
Fixes: 1ac40173c2 ("configure.ac: simplify EGL requirements for drivers dependent on EGL")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 4516bfbd30)
2017-04-24 13:12:59 +01:00
Emil Velikov
3d40db7892 configure.ac: manually expand PKG_CHECK_VAR
The macro is introduced with pkgconfig v0.28 which isn't universally
available. Thus it will error at configure stage.

Reported-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Fixes: ce562f9e3f ("EGL: Implement the libglvnd interface for EGL (v3)")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 179e21a720)
2017-04-24 13:12:51 +01:00
Rob Clark
99da9dfd95 util/queue: don't hang at exit
So atexit() is horrible and 4aea8fe7 is probably not a good idea.  But
add an extra layer of duct-tape to the problem.  Otherwise we hit a
situation where app using an atexit() handler that runs later than ours
doesn't hang when trying to tear down a context.

 (gdb) bt
 #0  util_queue_killall_and_wait (queue=queue@entry=0x52bc80) at ../../../src/util/u_queue.c:264
 #1  0x0000007fb6c380c0 in atexit_handler () at ../../../src/util/u_queue.c:51
 #2  0x0000007fb7730e2c in __run_exit_handlers () from /lib64/libc.so.6
 #3  0x0000007fb7730e5c in exit () from /lib64/libc.so.6
 #4  0x0000007fb7ce17dc in piglit_report_result (result=PIGLIT_PASS) at /home/robclark/src/piglit/tests/util/piglit-util.c:267
 #5  0x0000007fb7ef99f8 in process_next_event (x11_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:139
 #6  0x0000007fb7ef9a90 in enter_event_loop (winsys_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:153
 #7  0x0000007fb7ef8e50 in run_test (gl_fw=0x432c20, argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:88
 #8  0x0000007fb7edb890 in piglit_gl_test_run (argc=1, argv=0x7ffffff588, config=0x7ffffff400) at /home/robclark/src/piglit/tests/util/piglit-framework-gl.c:203
 #9  0x0000000000401224 in main (argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/bugs/drawbuffer-modes.c:46
 (gdb) c
 Continuing.
 [Thread 0x7fb67580c0 (LWP 3471) exited]
 ^C
 Thread 1 "drawbuffer-mode" received signal SIGINT, Interrupt.
 0x0000007fb72dda34 in pthread_cond_wait@@GLIBC_2.17 () from /lib64/libpthread.so.0
 (gdb) bt
 #0  0x0000007fb72dda34 in pthread_cond_wait@@GLIBC_2.17 () from /lib64/libpthread.so.0
 #1  0x0000007fb6c38304 in cnd_wait (mtx=0x5bdc90, cond=0x5bdcc0) at ../../../include/c11/threads_posix.h:159
 #2  util_queue_fence_wait (fence=0x5bdc90) at ../../../src/util/u_queue.c:106
 #3  0x0000007fb6daac70 in fd_batch_sync (batch=0x5bdc70) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:233
 #4  batch_reset (batch=batch@entry=0x5bdc70) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:183
 #5  0x0000007fb6daa5e0 in batch_flush (batch=0x5bdc70) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:290
 #6  fd_batch_flush (batch=0x5bdc70, sync=<optimized out>) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:308
 #7  0x0000007fb6daba2c in fd_bc_flush (cache=0x461220, ctx=0x52b920) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch_cache.c:141
 #8  0x0000007fb6dac954 in fd_context_flush (pctx=0x52b920, fence=0x0, flags=<optimized out>) at ../../../../../src/gallium/drivers/freedreno/freedreno_context.c:54
 #9  0x0000007fb6b43294 in st_glFlush (ctx=<optimized out>) at ../../../src/mesa/state_tracker/st_cb_flush.c:121
 #10 0x0000007fb69a84e8 in _mesa_make_current (newCtx=newCtx@entry=0x0, drawBuffer=drawBuffer@entry=0x0, readBuffer=readBuffer@entry=0x0) at ../../../src/mesa/main/context.c:1654
 #11 0x0000007fb6b7ca58 in st_api_make_current (stapi=<optimized out>, stctxi=0x0, stdrawi=0x0, streadi=0x0) at ../../../src/mesa/state_tracker/st_manager.c:827
 #12 0x0000007fb6cc87e8 in dri_unbind_context (cPriv=<optimized out>) at ../../../../../src/gallium/state_trackers/dri/dri_context.c:217
 #13 0x0000007fb6cc80b0 in driUnbindContext (pcp=0x5271e0) at ../../../../../../src/mesa/drivers/dri/common/dri_util.c:591
 #14 0x0000007fb7d1da08 in MakeContextCurrent (dpy=0x433380, draw=0, read=0, gc_user=0x0) at ../../../src/glx/glxcurrent.c:214
 #15 0x0000007fb7a8d5e0 in glx_platform_make_current () from /lib64/libwaffle-1.so.0
 #16 0x0000007fb7a894e4 in waffle_make_current () from /lib64/libwaffle-1.so.0
 #17 0x0000007fb7ef8c60 in piglit_wfl_framework_teardown (wfl_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_wfl_framework.c:628
 #18 0x0000007fb7ef939c in piglit_winsys_framework_teardown (winsys_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:238
 #19 0x0000007fb7ef9c30 in destroy (gl_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:212
 #20 0x0000007fb7edb7c4 in destroy () at /home/robclark/src/piglit/tests/util/piglit-framework-gl.c:184
 #21 0x0000007fb7730e2c in __run_exit_handlers () from /lib64/libc.so.6
 #22 0x0000007fb7730e5c in exit () from /lib64/libc.so.6
 #23 0x0000007fb7ce17dc in piglit_report_result (result=PIGLIT_PASS) at /home/robclark/src/piglit/tests/util/piglit-util.c:267
 #24 0x0000007fb7ef99f8 in process_next_event (x11_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:139
 #25 0x0000007fb7ef9a90 in enter_event_loop (winsys_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:153
 #26 0x0000007fb7ef8e50 in run_test (gl_fw=0x432c20, argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:88
 #27 0x0000007fb7edb890 in piglit_gl_test_run (argc=1, argv=0x7ffffff588, config=0x7ffffff400) at /home/robclark/src/piglit/tests/util/piglit-framework-gl.c:203
 #28 0x0000000000401224 in main (argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/bugs/drawbuffer-modes.c:46
 (gdb) r

Fixes: 4aea8fe7 ("gallium/u_queue: fix random crashes when the app calls exit()")
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 6fb7935ded)
2017-04-24 13:12:41 +01:00
Emil Velikov
fcbb263f8c configure.ac: print deprecation warning as needed
The warning should be printed only when one explicitly uses the
deprecated configure toggle.

Fixes: 7748c3f5eb ("configure.ac: deprecate --with-egl-platforms over
--with-platforms")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9915753e63)
2017-04-24 13:12:26 +01:00
Marek Olšák
29fa5b6e1c st/mesa: invalidate the readpix cache in st_indirect_draw_vbo
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7cd6e2df65)
2017-04-24 13:11:14 +01:00
Emil Velikov
4e7e903bb3 winsys/sw/dri: don't use GNU void pointer arithmetic
Resolves build issues like the following:

src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                               ^
src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:62: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                                                              ^

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 309f4067a7)
2017-04-24 13:11:14 +01:00
Nicolai Hähnle
26949e872b vbo: fix gl_DrawID handling in glMultiDrawArrays
Fixes a bug in
KHR-GL45.shader_draw_parameters_tests.ShaderMultiDrawArraysParameters.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 51deba0eb3)
2017-04-24 13:11:14 +01:00
Nicolai Hähnle
2cc119c35a mesa: move glMultiDrawArrays to vbo and fix error handling
When any count[i] is negative, we must skip all draws.

Moving to vbo makes the subsequent change easier.

v2:
- provide the function in all contexts, including GLES
- adjust validation accordingly to include the xfb check
v3:
- fix mix-up of pre- and post-xfb prim count (Nils Wallménius)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 42d5465b9b)
2017-04-24 13:11:13 +01:00
Nicolai Hähnle
6abdbd8b10 mesa: extract need_xfb_remaining_prims_check
The same logic needs to be applied to glMultiDrawArrays.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 756e9ebbdd)
2017-04-24 13:11:13 +01:00
Nicolai Hähnle
24c05c57e4 mesa: fix remaining xfb prims check for GLES with multiple instances
Found by inspection.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ea9a8940ca)
2017-04-24 13:11:13 +01:00
Nanley Chery
7ae90b4f65 anv/cmd_buffer: Disable CCS on BDW input attachments
The description under RENDER_SURFACE_STATE::RedClearColor says,

   For Sampling Engine Multisampled Surfaces and Render Targets:
    Specifies the clear value for the red channel.
   For Other Surfaces:
    This field is ignored.

This means that the sampler on BDW doesn't support CCS.

Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
(cherry picked from commit d9d793696b)
2017-04-24 13:11:13 +01:00
Lionel Landwerlin
0f2ac6ded8 anv: blorp: flush memory after copy
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d71efbe5f2)
2017-04-24 13:11:13 +01:00
Rob Clark
bea2c4b88f freedreno: fix crash if ctx torn down with no rendering
In this case, ctx->flush_queue would not have been initialized.

Fixes: 0b613c20 ("freedreno: enable draw/batch reordering by default")
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit d4601b0efc)
2017-04-24 13:11:13 +01:00
Emil Velikov
ed846b4c78 Update version to 17.1.0-rc1
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-17 14:51:04 +01:00
Emil Velikov
8c69adf9a9 Revert "docs: add 17.2.0-devel release notes template, bump version"
This reverts commit 47dd2544e1.

Should have landed in the master branch
2017-04-17 14:30:44 +01:00
Emil Velikov
47dd2544e1 docs: add 17.2.0-devel release notes template, bump version
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-17 14:28:27 +01:00
25 changed files with 255 additions and 109 deletions

View File

@@ -1 +1 @@
17.1.0-devel 17.1.0-rc2

View File

@@ -724,7 +724,7 @@ dnl Arch/platform-specific settings
dnl dnl
AC_ARG_ENABLE([asm], AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--disable-asm], [AS_HELP_STRING([--disable-asm],
[disable assembly usage @<:@default=enabled on supported plaforms@:>@])], [disable assembly usage @<:@default=enabled on supported platforms@:>@])],
[enable_asm="$enableval"], [enable_asm="$enableval"],
[enable_asm=yes] [enable_asm=yes]
) )
@@ -1367,7 +1367,7 @@ if test "x$enable_libglvnd" = xyes ; then
esac esac
PKG_CHECK_MODULES([GLVND], libglvnd >= 0.2.0) PKG_CHECK_MODULES([GLVND], libglvnd >= 0.2.0)
PKG_CHECK_VAR(LIBGLVND_DATADIR, libglvnd, datadir) LIBGLVND_DATADIR=`$PKG_CONFIG --variable=datadir libglvnd`
AC_SUBST([LIBGLVND_DATADIR]) AC_SUBST([LIBGLVND_DATADIR])
DEFINES="${DEFINES} -DUSE_LIBGLVND=1" DEFINES="${DEFINES} -DUSE_LIBGLVND=1"
@@ -2146,12 +2146,11 @@ dnl DEPRECATED: EGL Platforms configuration
dnl dnl
AC_ARG_WITH([egl-platforms], AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@], [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[DEPRECATED: use --with-plaforms instead@<:@default=auto@:>@])], [DEPRECATED: use --with-platforms instead@<:@default=auto@:>@])],
[with_egl_platforms="$withval"], [with_egl_platforms="$withval"],
[with_egl_platforms=auto]) [with_egl_platforms=auto])
if test "x$with_egl_platforms" = xauto; then if test "x$with_egl_platforms" = xauto; then
AC_MSG_WARN([--with-egl-platforms is deprecated. Use --with-plaforms instead.])
if test "x$enable_egl" = xyes; then if test "x$enable_egl" = xyes; then
if test "x$enable_gbm" = xyes; then if test "x$enable_gbm" = xyes; then
with_egl_platforms="x11,drm" with_egl_platforms="x11,drm"
@@ -2161,6 +2160,8 @@ if test "x$with_egl_platforms" = xauto; then
else else
with_egl_platforms="" with_egl_platforms=""
fi fi
else
AC_MSG_WARN([--with-egl-platforms is deprecated. Use --with-platforms instead.])
fi fi
dnl dnl
@@ -2465,7 +2466,9 @@ if test -n "$with_gallium_drivers"; then
xvirgl) xvirgl)
HAVE_GALLIUM_VIRGL=yes HAVE_GALLIUM_VIRGL=yes
require_libdrm "virgl" require_libdrm "virgl"
if test "x$enable_egl" = xyes; then
require_basic_egl "virgl" require_basic_egl "virgl"
fi
;; ;;
*) *)
AC_MSG_ERROR([Unknown Gallium driver: $driver]) AC_MSG_ERROR([Unknown Gallium driver: $driver])

View File

@@ -112,7 +112,7 @@ fd_context_destroy(struct pipe_context *pctx)
DBG(""); DBG("");
if (ctx->screen->reorder) if (ctx->screen->reorder && util_queue_is_initialized(&ctx->flush_queue))
util_queue_destroy(&ctx->flush_queue); util_queue_destroy(&ctx->flush_queue);
fd_batch_reference(&ctx->batch, NULL); /* unref current batch */ fd_batch_reference(&ctx->batch, NULL); /* unref current batch */

View File

@@ -200,7 +200,7 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
if (box) { if (box) {
void *data; void *data;
data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize; data = (char *)dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
dri_sw_ws->lf->put_image2(dri_drawable, data, dri_sw_ws->lf->put_image2(dri_drawable, data,
box->x, box->y, box->width, box->height, dri_sw_dt->stride); box->x, box->y, box->width, box->height, dri_sw_dt->stride);
} else { } else {

View File

@@ -701,10 +701,10 @@ void anv_CmdUpdateBuffer(
struct anv_state tmp_data = struct anv_state tmp_data =
anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, copy_size, 64); anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, copy_size, 64);
anv_state_flush(cmd_buffer->device, tmp_data);
memcpy(tmp_data.map, pData, copy_size); memcpy(tmp_data.map, pData, copy_size);
anv_state_flush(cmd_buffer->device, tmp_data);
int bs = 16; int bs = 16;
bs = gcd_pow2_u64(bs, dstOffset); bs = gcd_pow2_u64(bs, dstOffset);
bs = gcd_pow2_u64(bs, copy_size); bs = gcd_pow2_u64(bs, copy_size);
@@ -1398,7 +1398,6 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
* still hot in the cache. * still hot in the cache.
*/ */
bool found_draw = false; bool found_draw = false;
bool self_dep = false;
enum anv_subpass_usage usage = 0; enum anv_subpass_usage usage = 0;
for (uint32_t s = subpass_idx + 1; s < pass->subpass_count; s++) { for (uint32_t s = subpass_idx + 1; s < pass->subpass_count; s++) {
usage |= pass->attachments[att].subpass_usage[s]; usage |= pass->attachments[att].subpass_usage[s];
@@ -1408,8 +1407,6 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
* wait to resolve until then. * wait to resolve until then.
*/ */
found_draw = true; found_draw = true;
if (pass->attachments[att].subpass_usage[s] & ANV_SUBPASS_USAGE_INPUT)
self_dep = true;
break; break;
} }
} }
@@ -1468,14 +1465,6 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
* binding this surface to Sampler." * binding this surface to Sampler."
*/ */
resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL; resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL;
} else if (cmd_buffer->device->info.gen == 8 && self_dep &&
att_state->input_aux_usage == ISL_AUX_USAGE_CCS_D) {
/* On Broadwell we still need to do resolves when there is a
* self-dependency because HW could not see fast-clears and works
* on the render cache as if there was regular non-fast-clear surface.
* To avoid any inconsistency, we force the resolve.
*/
resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_FULL;
} }
} }

View File

@@ -291,8 +291,6 @@ color_attachment_compute_aux_usage(struct anv_device *device,
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_E; att_state->input_aux_usage = ISL_AUX_USAGE_CCS_E;
} else if (att_state->fast_clear) { } else if (att_state->fast_clear) {
att_state->aux_usage = ISL_AUX_USAGE_CCS_D; att_state->aux_usage = ISL_AUX_USAGE_CCS_D;
if (GEN_GEN >= 9 &&
!isl_format_supports_ccs_e(&device->info, iview->isl.format)) {
/* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode: /* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode:
* *
* "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D * "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D
@@ -301,17 +299,13 @@ color_attachment_compute_aux_usage(struct anv_device *device,
* engine, Surface Format must be supported for Render Target * engine, Surface Format must be supported for Render Target
* Compression for surfaces bound to the sampling engine." * Compression for surfaces bound to the sampling engine."
* *
* In other words, we can't sample from a fast-cleared image if it * In other words, we can only sample from a fast-cleared image if it
* doesn't also support color compression. * also supports color compression.
*/ */
att_state->input_aux_usage = ISL_AUX_USAGE_NONE; if (isl_format_supports_ccs_e(&device->info, iview->isl.format))
} else if (GEN_GEN >= 8) {
/* Broadwell/Skylake can sample from fast-cleared images */
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D; att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D;
} else { else
/* Ivy Bridge and Haswell cannot */
att_state->input_aux_usage = ISL_AUX_USAGE_NONE; att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
}
} else { } else {
att_state->aux_usage = ISL_AUX_USAGE_NONE; att_state->aux_usage = ISL_AUX_USAGE_NONE;
att_state->input_aux_usage = ISL_AUX_USAGE_NONE; att_state->input_aux_usage = ISL_AUX_USAGE_NONE;

View File

@@ -10219,7 +10219,7 @@
</category> </category>
<category name="GL_EXT_multi_draw_arrays" number="148"> <category name="GL_EXT_multi_draw_arrays" number="148">
<function name="MultiDrawArraysEXT" es1="1.0" es2="2.0" alias="MultiDrawArrays"> <function name="MultiDrawArraysEXT" es1="1.0" es2="2.0" exec="dynamic" alias="MultiDrawArrays">
<param name="mode" type="GLenum"/> <param name="mode" type="GLenum"/>
<param name="first" type="const GLint *"/> <param name="first" type="const GLint *"/>
<param name="count" type="const GLsizei *"/> <param name="count" type="const GLsizei *"/>

View File

@@ -96,6 +96,7 @@ endif
AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS) AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
AM_CFLAGS = \ AM_CFLAGS = \
$(VDPAU_CFLAGS) \
$(LLVM_CFLAGS) \ $(LLVM_CFLAGS) \
$(VISIBILITY_CFLAGS) \ $(VISIBILITY_CFLAGS) \
$(MSVC2013_COMPAT_CFLAGS) $(MSVC2013_COMPAT_CFLAGS)

View File

@@ -816,25 +816,10 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
"glDrawRangeElements"); "glDrawRangeElements");
} }
static bool static bool
validate_draw_arrays(struct gl_context *ctx, const char *func, need_xfb_remaining_prims_check(const struct gl_context *ctx)
GLenum mode, GLsizei count, GLsizei numInstances)
{ {
struct gl_transform_feedback_object *xfb_obj
= ctx->TransformFeedback.CurrentObject;
FLUSH_CURRENT(ctx, 0);
if (count < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(count)", func);
return false;
}
if (!_mesa_valid_prim_mode(ctx, mode, func))
return false;
if (!check_valid_to_render(ctx, func))
return false;
/* From the GLES3 specification, section 2.14.2 (Transform Feedback /* From the GLES3 specification, section 2.14.2 (Transform Feedback
* Primitive Capture): * Primitive Capture):
* *
@@ -862,10 +847,33 @@ validate_draw_arrays(struct gl_context *ctx, const char *func,
* is removed and replaced with the GL behavior (primitives are not * is removed and replaced with the GL behavior (primitives are not
* written and the corresponding counter is not updated)..." * written and the corresponding counter is not updated)..."
*/ */
if (_mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) && return _mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
!_mesa_has_OES_geometry_shader(ctx) && !_mesa_has_OES_geometry_shader(ctx) &&
!_mesa_has_OES_tessellation_shader(ctx)) { !_mesa_has_OES_tessellation_shader(ctx);
size_t prim_count = vbo_count_tessellated_primitives(mode, count, 1); }
static bool
validate_draw_arrays(struct gl_context *ctx, const char *func,
GLenum mode, GLsizei count, GLsizei numInstances)
{
FLUSH_CURRENT(ctx, 0);
if (count < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(count)", func);
return false;
}
if (!_mesa_valid_prim_mode(ctx, mode, func))
return false;
if (!check_valid_to_render(ctx, func))
return false;
if (need_xfb_remaining_prims_check(ctx)) {
struct gl_transform_feedback_object *xfb_obj
= ctx->TransformFeedback.CurrentObject;
size_t prim_count = vbo_count_tessellated_primitives(mode, count, numInstances);
if (xfb_obj->GlesRemainingPrims < prim_count) { if (xfb_obj->GlesRemainingPrims < prim_count) {
_mesa_error(ctx, GL_INVALID_OPERATION, _mesa_error(ctx, GL_INVALID_OPERATION,
"%s(exceeds transform feedback size)", func); "%s(exceeds transform feedback size)", func);
@@ -913,6 +921,60 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
} }
/**
* Called to error check the function parameters.
*
* Note that glMultiDrawArrays is not part of GLES, so there's limited scope
* for sharing code with the validation of glDrawArrays.
*/
bool
_mesa_validate_MultiDrawArrays(struct gl_context *ctx, GLenum mode,
const GLsizei *count, GLsizei primcount)
{
int i;
FLUSH_CURRENT(ctx, 0);
if (!_mesa_valid_prim_mode(ctx, mode, "glMultiDrawArrays"))
return false;
if (!check_valid_to_render(ctx, "glMultiDrawArrays"))
return false;
if (primcount < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glMultiDrawArrays(primcount=%d)",
primcount);
return false;
}
for (i = 0; i < primcount; ++i) {
if (count[i] < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glMultiDrawArrays(count[%d]=%d)",
i, count[i]);
return false;
}
}
if (need_xfb_remaining_prims_check(ctx)) {
struct gl_transform_feedback_object *xfb_obj
= ctx->TransformFeedback.CurrentObject;
size_t xfb_prim_count = 0;
for (i = 0; i < primcount; ++i)
xfb_prim_count += vbo_count_tessellated_primitives(mode, count[i], 1);
if (xfb_obj->GlesRemainingPrims < xfb_prim_count) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glMultiDrawArrays(exceeds transform feedback size)");
return false;
}
xfb_obj->GlesRemainingPrims -= xfb_prim_count;
}
return true;
}
GLboolean GLboolean
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx, _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
GLenum mode, GLsizei count, GLenum type, GLenum mode, GLsizei count, GLenum type,

View File

@@ -48,6 +48,10 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name);
extern GLboolean extern GLboolean
_mesa_validate_DrawArrays(struct gl_context *ctx, GLenum mode, GLsizei count); _mesa_validate_DrawArrays(struct gl_context *ctx, GLenum mode, GLsizei count);
extern bool
_mesa_validate_MultiDrawArrays(struct gl_context *ctx, GLenum mode,
const GLsizei *count, GLsizei primcount);
extern GLboolean extern GLboolean
_mesa_validate_DrawElements(struct gl_context *ctx, _mesa_validate_DrawElements(struct gl_context *ctx,
GLenum mode, GLsizei count, GLenum type, GLenum mode, GLsizei count, GLenum type,

View File

@@ -265,7 +265,7 @@ _mesa_glthread_finish(struct gl_context *ctx)
* dri interface entrypoints), in which case we don't need to actually * dri interface entrypoints), in which case we don't need to actually
* synchronize against ourself. * synchronize against ourself.
*/ */
if (pthread_self() == glthread->thread) if (pthread_equal(pthread_self(), glthread->thread))
return; return;
pthread_mutex_lock(&glthread->mutex); pthread_mutex_lock(&glthread->mutex);

View File

@@ -945,6 +945,8 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
*/ */
if (uni->type->is_sampler()) { if (uni->type->is_sampler()) {
bool flushed = false; bool flushed = false;
shProg->SamplersValidated = GL_TRUE;
for (int i = 0; i < MESA_SHADER_STAGES; i++) { for (int i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_linked_shader *const sh = shProg->_LinkedShaders[i]; struct gl_linked_shader *const sh = shProg->_LinkedShaders[i];

View File

@@ -67,11 +67,15 @@ void
_mesa_update_shader_textures_used(struct gl_shader_program *shProg, _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
struct gl_program *prog) struct gl_program *prog)
{ {
GLbitfield mask = prog->SamplersUsed;
gl_shader_stage prog_stage =
_mesa_program_enum_to_shader_stage(prog->Target);
struct gl_linked_shader *shader = shProg->_LinkedShaders[prog_stage];
assert(shader);
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed)); memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
shProg->SamplersValidated = GL_TRUE;
GLbitfield mask = prog->SamplersUsed;
while (mask) { while (mask) {
const int s = u_bit_scan(&mask); const int s = u_bit_scan(&mask);
GLuint unit = prog->SamplerUnits[s]; GLuint unit = prog->SamplerUnits[s];
@@ -87,8 +91,20 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
* types pointing to the same texture image unit within a program * types pointing to the same texture image unit within a program
* object." * object."
*/ */
if (prog->TexturesUsed[unit] & ~(1 << tgt)) unsigned stages_mask = shProg->data->linked_stages;
while (stages_mask) {
const int stage = u_bit_scan(&stages_mask);
/* Skip validation if we are yet to update textures used in this
* stage.
*/
if (prog_stage < stage)
break;
struct gl_program *glprog = shProg->_LinkedShaders[stage]->Program;
if (glprog->TexturesUsed[unit] & ~(1 << tgt))
shProg->SamplersValidated = GL_FALSE; shProg->SamplersValidated = GL_FALSE;
}
prog->TexturesUsed[unit] |= (1 << tgt); prog->TexturesUsed[unit] |= (1 << tgt);
} }

View File

@@ -1539,24 +1539,6 @@ _mesa_UnlockArraysEXT( void )
} }
/* GL_EXT_multi_draw_arrays */
void GLAPIENTRY
_mesa_MultiDrawArrays( GLenum mode, const GLint *first,
const GLsizei *count, GLsizei primcount )
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
FLUSH_VERTICES(ctx, 0);
for (i = 0; i < primcount; i++) {
if (count[i] > 0) {
CALL_DrawArrays(ctx->CurrentClientDispatch, (mode, first[i], count[i]));
}
}
}
/* GL_IBM_multimode_draw_arrays */ /* GL_IBM_multimode_draw_arrays */
void GLAPIENTRY void GLAPIENTRY
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,

View File

@@ -3117,6 +3117,11 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
} }
if (prog->data->LinkStatus) { if (prog->data->LinkStatus) {
/* Reset sampler validated to true, validation happens via the
* LinkShader call below.
*/
prog->SamplersValidated = GL_TRUE;
if (!ctx->Driver.LinkShader(ctx, prog)) { if (!ctx->Driver.LinkShader(ctx, prog)) {
prog->data->LinkStatus = linking_failure; prog->data->LinkStatus = linking_failure;
} }

View File

@@ -282,6 +282,8 @@ st_indirect_draw_vbo(struct gl_context *ctx,
assert(ctx->NewState == 0x0); assert(ctx->NewState == 0x0);
assert(stride); assert(stride);
st_invalidate_readpix_cache(st);
/* Validate state. */ /* Validate state. */
if ((st->dirty | ctx->NewDriverState) & ST_PIPELINE_RENDER_STATE_MASK || if ((st->dirty | ctx->NewDriverState) & ST_PIPELINE_RENDER_STATE_MASK ||
st->gfx_shaders_may_be_dirty) { st->gfx_shaders_may_be_dirty) {

View File

@@ -404,7 +404,8 @@ vbo_bind_arrays(struct gl_context *ctx)
*/ */
static void static void
vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
GLsizei count, GLuint numInstances, GLuint baseInstance) GLsizei count, GLuint numInstances, GLuint baseInstance,
GLuint drawID)
{ {
struct vbo_context *vbo = vbo_context(ctx); struct vbo_context *vbo = vbo_context(ctx);
struct _mesa_prim prim[2]; struct _mesa_prim prim[2];
@@ -420,6 +421,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
prim[0].mode = mode; prim[0].mode = mode;
prim[0].num_instances = numInstances; prim[0].num_instances = numInstances;
prim[0].base_instance = baseInstance; prim[0].base_instance = baseInstance;
prim[0].draw_id = drawID;
prim[0].is_indirect = 0; prim[0].is_indirect = 0;
prim[0].start = start; prim[0].start = start;
prim[0].count = count; prim[0].count = count;
@@ -572,7 +574,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
if (0) if (0)
check_draw_arrays_data(ctx, start, count); check_draw_arrays_data(ctx, start, count);
vbo_draw_arrays(ctx, mode, start, count, 1, 0); vbo_draw_arrays(ctx, mode, start, count, 1, 0, 0);
if (0) if (0)
print_draw_arrays(ctx, mode, start, count); print_draw_arrays(ctx, mode, start, count);
@@ -600,7 +602,7 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
if (0) if (0)
check_draw_arrays_data(ctx, start, count); check_draw_arrays_data(ctx, start, count);
vbo_draw_arrays(ctx, mode, start, count, numInstances, 0); vbo_draw_arrays(ctx, mode, start, count, numInstances, 0, 0);
if (0) if (0)
print_draw_arrays(ctx, mode, start, count); print_draw_arrays(ctx, mode, start, count);
@@ -630,13 +632,52 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
if (0) if (0)
check_draw_arrays_data(ctx, first, count); check_draw_arrays_data(ctx, first, count);
vbo_draw_arrays(ctx, mode, first, count, numInstances, baseInstance); vbo_draw_arrays(ctx, mode, first, count, numInstances, baseInstance, 0);
if (0) if (0)
print_draw_arrays(ctx, mode, first, count); print_draw_arrays(ctx, mode, first, count);
} }
/**
* Called from glMultiDrawArrays when in immediate mode.
*/
static void GLAPIENTRY
vbo_exec_MultiDrawArrays(GLenum mode, const GLint *first,
const GLsizei *count, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx,
"glMultiDrawArrays(%s, %p, %p, %d)\n",
_mesa_enum_to_string(mode), first, count, primcount);
if (!_mesa_validate_MultiDrawArrays(ctx, mode, count, primcount))
return;
for (i = 0; i < primcount; i++) {
if (count[i] > 0) {
if (0)
check_draw_arrays_data(ctx, first[i], count[i]);
/* The GL_ARB_shader_draw_parameters spec adds the following after the
* pseudo-code describing glMultiDrawArrays:
*
* "The index of the draw (<i> in the above pseudo-code) may be
* read by a vertex shader as <gl_DrawIDARB>, as described in
* Section 11.1.3.9."
*/
vbo_draw_arrays(ctx, mode, first[i], count[i], 1, 0, i);
if (0)
print_draw_arrays(ctx, mode, first[i], count[i]);
}
}
}
/** /**
* Map GL_ELEMENT_ARRAY_BUFFER and print contents. * Map GL_ELEMENT_ARRAY_BUFFER and print contents.
@@ -1230,7 +1271,7 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
!_mesa_all_varyings_in_vbos(ctx->Array.VAO))) { !_mesa_all_varyings_in_vbos(ctx->Array.VAO))) {
GLsizei n = GLsizei n =
ctx->Driver.GetTransformFeedbackVertexCount(ctx, obj, stream); ctx->Driver.GetTransformFeedbackVertexCount(ctx, obj, stream);
vbo_draw_arrays(ctx, mode, 0, n, numInstances, 0); vbo_draw_arrays(ctx, mode, 0, n, numInstances, 0, 0);
return; return;
} }
@@ -1641,6 +1682,7 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
SET_DrawRangeElements(exec, vbo_exec_DrawRangeElements); SET_DrawRangeElements(exec, vbo_exec_DrawRangeElements);
} }
SET_MultiDrawArrays(exec, vbo_exec_MultiDrawArrays);
SET_MultiDrawElementsEXT(exec, vbo_exec_MultiDrawElements); SET_MultiDrawElementsEXT(exec, vbo_exec_MultiDrawElements);
if (ctx->API == API_OPENGL_COMPAT) { if (ctx->API == API_OPENGL_COMPAT) {

View File

@@ -1176,6 +1176,40 @@ _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
} }
static void GLAPIENTRY
_save_OBE_MultiDrawArrays(GLenum mode, const GLint *first,
const GLsizei *count, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
if (!_mesa_is_valid_prim_mode(ctx, mode)) {
_mesa_compile_error(ctx, GL_INVALID_ENUM, "glMultiDrawArrays(mode)");
return;
}
if (primcount < 0) {
_mesa_compile_error(ctx, GL_INVALID_VALUE,
"glMultiDrawArrays(primcount<0)");
return;
}
for (i = 0; i < primcount; i++) {
if (count[i] < 0) {
_mesa_compile_error(ctx, GL_INVALID_VALUE,
"glMultiDrawArrays(count[i]<0)");
return;
}
}
for (i = 0; i < primcount; i++) {
if (count[i] > 0) {
_save_OBE_DrawArrays(mode, first[i], count[i]);
}
}
}
/* Could do better by copying the arrays and element list intact and /* Could do better by copying the arrays and element list intact and
* then emitting an indexed prim at runtime. * then emitting an indexed prim at runtime.
*/ */
@@ -1484,6 +1518,7 @@ vbo_initialize_save_dispatch(const struct gl_context *ctx,
struct _glapi_table *exec) struct _glapi_table *exec)
{ {
SET_DrawArrays(exec, _save_OBE_DrawArrays); SET_DrawArrays(exec, _save_OBE_DrawArrays);
SET_MultiDrawArrays(exec, _save_OBE_MultiDrawArrays);
SET_DrawElements(exec, _save_OBE_DrawElements); SET_DrawElements(exec, _save_OBE_DrawElements);
SET_DrawElementsBaseVertex(exec, _save_OBE_DrawElementsBaseVertex); SET_DrawElementsBaseVertex(exec, _save_OBE_DrawElementsBaseVertex);
SET_DrawRangeElements(exec, _save_OBE_DrawRangeElements); SET_DrawRangeElements(exec, _save_OBE_DrawRangeElements);

View File

@@ -298,9 +298,18 @@ util_queue_add_job(struct util_queue *queue,
struct util_queue_job *ptr; struct util_queue_job *ptr;
assert(fence->signalled); assert(fence->signalled);
fence->signalled = false;
mtx_lock(&queue->lock); mtx_lock(&queue->lock);
if (queue->kill_threads) {
mtx_unlock(&queue->lock);
/* well no good option here, but any leaks will be
* short-lived as things are shutting down..
*/
return;
}
fence->signalled = false;
assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs); assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs);
/* if the queue is full, wait until there is space */ /* if the queue is full, wait until there is space */