Compare commits

..

41 Commits

Author SHA1 Message Date
Andres Gomez
61b134a862 docs: add release notes for 17.0.5
Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-28 20:41:38 +03:00
Andres Gomez
314bc3f048 Update version to 17.0.5
Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-28 20:33:00 +03:00
Timothy Arceri
b7916134a0 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)
[Andres Gomez: there was an intermediate cleanup but this commit
basically brings everything that was missing back]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/mesa/main/uniforms.c
2017-04-26 12:34:27 +03:00
Emil Velikov
e98c9af559 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-26 12:34:27 +03:00
Emil Velikov
8d7a8711d4 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-26 12:34:27 +03:00
Grazvydas Ignotas
795287c66e radv: report timestampPeriod correctly
The kernel returns frequency in kHz, so to convert to nanosecond
interval that Vulkan uses the dividend should be 1000000.0 and not
100000.0.

This fixes the GPU graph in DOOM and matches the amdgpu-pro blob.

Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 1b2fe7ce45)
2017-04-26 12:34:26 +03:00
Andres Gomez
375cc332bb cherry-ignore: provide required gem stubs for the tests
Only reported because it referes to fixes in 2 commits, but they are
not in stable.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
ce03b2c40e cherry-ignore: automake: ensure that the destination directory is created
Only reported because it referes to fixes in 2 commits, but they are
not in stable.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
ccdae185e8 cherry-ignore: remove i965_symbols_test reference from .gitignore
It just cleans .gitignore.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
7020d316c0 cherry-ignore: remove dead brw_new_shader() declaration
Removes unused symbols but it doesn't really add nor fix anything
relevant.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
b2a9b5c5d5 cherry-ignore: r600: fix libmesa_amd_common dependency
Only reported because it referes to fixes in 2 commits, but they are
not in stable.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
82082aea42 cherry-ignore: vulkan: add support for libmesa_vulkan_util
Only reported because it referes to fixes in 2 commits, but they are
not in stable.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
5f3a44a736 cherry-ignore: make radv_resolve_entrypoint static
It just makes a local function static.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:26 +03:00
Andres Gomez
2b4d42bb26 cherry-ignore: remove unused radv_dispatch_table dtable
Removes unused symbols but it doesn't really add nor fix anything
relevant.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:25 +03:00
Andres Gomez
270898aba9 cherry-ignore: remove unused anv_dispatch_table dtable
Removes unused symbols but it doesn't really add nor fix anything
relevant.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:25 +03:00
Andres Gomez
7c373a5990 cherry-ignore: fix typo in a2b10g10r10 fast clear calculation
The fixes script finds 2 commit references but it is really only one,
and only in master.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:25 +03:00
Andres Gomez
a93c1e0703 cherry-ignore: Revert "i965/fs: Don't emit SEL instructions for type-converting MOVs."
The commit depends on earlier commits which did not land in branch.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:25 +03:00
Rob Clark
df53e5844b 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)
[Andres Gomez: rename mtx_* back to pipe_mutex_*]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/gallium/auxiliary/util/u_queue.c
2017-04-26 12:34:25 +03:00
Andres Gomez
0e3fd35eb2 cherry-ignore: Revert "etnaviv: Cannot render to rb-swapped formats"
Reverts a commit in stable only because a new feature in master
replaces it.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:25 +03:00
Emil Velikov
c8f4160c40 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-26 12:34:25 +03:00
Nanley Chery
313f48f030 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)
[Andres Gomez: _ccs_e renamed back to _lossless_compression]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/genX_cmd_buffer.c
2017-04-26 12:34:25 +03:00
Kenneth Graunke
de9483a6cb i965/vec4: Avoid reswizzling MACH instructions in opt_register_coalesce().
opt_register_coalesce() was optimizing sequences such as:

   mul(8) acc0:D, attr18.xyyy:D, attr19.xyyy:D
   mach(8) vgrf5.xy:D, attr18.xyyy:D, attr19.xyyy:D
   mov(8) m4.zw:F, vgrf5.xxxy:F

into:

   mul(8) acc0:D, attr18.xyyy:D, attr19.xyyy:D
   mach(8) m4.zw:D, attr18.xxxy:D, attr19.xxxy:D

This doesn't work - if we're going to reswizzle MACH, we'd need to
reswizzle the MUL as well.  Here, the MUL fills the accumulator's .zw
components with attr18.yy * attr19.yy.  But the MACH instruction expects
.z to contain attr18.x * attr19.x.  Bogus results ensue.

No change in shader-db on Haswell.  Prevents regressions in Timothy's
patches to use enhanced layouts for varying packing (which rearrange
code just enough to trigger this pre-existing bug, but were fine
themselves).

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 2faf227ec2)

Squashed with commit:

i965/vec4: Use reads_accumulator_implicitly(), not MACH checks.

Curro pointed out that I should not just check for MACH, but use
the reads_accumulator_implicitly() helper, which would also prevent
the same bug with MAC and SADA2 (if we ever decide to use them).

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 6b10c37b9c)
2017-04-26 12:34:24 +03:00
Francisco Jerez
4c2356f13c intel/fs: Take into account amount of data read in spilling cost heuristic.
Until now the spilling cost calculation was neglecting the amount of
data read from the register during the spilling cost calculation.
This caused it to make suboptimal decisions in some cases leading to
higher memory bandwidth usage than necessary.

Improves Unigine Heaven performance by ~4% on BDW, reversing an
unintended FPS regression from my previous commit
147e71242c with n=12 and statistical
significance 5%.  In addition SynMark2 OglCSDof performance is
improved by an additional ~5% on SKL, and a Kerbal Space Program
apitrace around the Moho planet I can provide on request improves by
~20%.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 58324389be)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
2017-04-26 12:34:24 +03:00
Francisco Jerez
a7c86ab750 intel/fs: Use regs_written() in spilling cost heuristic for improved accuracy.
This is what we use later on to compute the number of registers that
will actually get spilled to memory, so it's more likely to match
reality than the current open-coded approximation.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit ecc19e12dc)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
2017-04-26 12:34:24 +03:00
Andres Gomez
5403c02983 cherry-ignore: Fix typos.
Nomination in stable.

17.1 nomination only.

The commit depends on earlier commit 7748c3f5eb which did not land in
branch and the part that could be merged is not really providing
anything relevant to stable.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:24 +03:00
Marek Olšák
7ab11a9822 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-26 12:34:24 +03:00
Emil Velikov
0022df96be 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-26 12:34:24 +03:00
Nicolai Hähnle
8a46da3731 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-26 12:34:24 +03:00
Nicolai Hähnle
d066714fbb 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)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/mesa/main/varray.c
2017-04-26 12:34:23 +03:00
Nicolai Hähnle
ddf884a9e3 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-26 12:34:23 +03:00
Nicolai Hähnle
1b4afdeb17 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-26 12:34:23 +03:00
Andres Gomez
88e5afd146 cherry-ignore: fix crash if ctx torn down with no rendering
Nomination in stable.

17.1 nomination only.

Fixes earlier commit 0b613c20 which did not land in branch.

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:23 +03:00
Andres Gomez
efe50f2dde cherry-ignore: Add the pci_id into the shader cache UUID
Nomination in stable.

The commit depends on earlier commit 656e30b686 which did not land in
branch, and some other dependencies

Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-04-26 12:34:23 +03:00
Boyan Ding
4b3efe993e nir: Destination component count of shader_clock intrinsic is 2
This fixes the following error when using ARB_shader_clock on i965:
	vec1 32 ssa_0 = intrinsic shader_clock () () ()
	intrinsic store_var (ssa_0) (clock_retval) (3) /* wrmask=xy */
error: src->ssa->num_components == num_components (nir/nir_validate.c:204)

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit ff29f488d4)
2017-04-26 12:34:23 +03:00
Jason Ekstrand
255d689dcd anv/blorp: Properly handle VK_ATTACHMENT_UNUSED
The Vulkan driver was originally written under the assumption that
VK_ATTACHMENT_UNUSED was basically just for depth-stencil attachments.
However, the way things fell together, VK_ATTACHMENT_UNUSED can be used
anywhere in the subpass description.  The blorp-based clear and resolve
code has a bunch of places where we walk lists of attachments and we
weren't handling VK_ATTACHMENT_UNUSED everywhere.  This commit should
fix all of them.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 220974b38d)
[Andres Gomez: the anv_subpass structure was not storing yet
VkAttachmentReference and recovered a hunk that was not needed in
master]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/anv_blorp.c
2017-04-26 12:33:34 +03:00
Jason Ekstrand
af58e0dbe6 anv/cmd_buffer: Use the null surface state for ATTACHMENT_UNUSED
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 21d2ca72d8)
[Andres Gomez: the anv_subpass structure was not storing yet VkAttachmentReference]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/genX_cmd_buffer.c
2017-04-26 00:10:04 +03:00
Jason Ekstrand
9717c0aad5 anv/cmd_buffer: Always set up a null surface state
We're about to start requiring it in yet another case and calculating
exactly when one is needed is starting to get prohibitively expensive.
A single surface state doesn't take up that much space so we may as well
create one all the time.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 02eca8b6f8)
2017-04-26 00:10:04 +03:00
Jason Ekstrand
f26047871f anv/cmd_buffer: Flush the VF cache at the top of all primaries
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e1f6fb8021)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/genX_cmd_buffer.c
2017-04-26 00:10:04 +03:00
Jason Ekstrand
c09f729d93 anv/blorp: Flush the texture cache in UpdateBuffer
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 939337e49f)
[Andres Gomez: replace anv_state_flush with anv_state_clflush]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/anv_blorp.c

Squashed with commit:

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)
[Andres Gomez: replace anv_state_flush with anv_state_clflush]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/anv_blorp.c
2017-04-26 00:10:04 +03:00
Boyan Ding
a6a42a84cf nvc0/ir: Properly handle a "split form" of predicate destination
GF100's ISA encoding has a weird form of predicate destination where its
3 bits are split across whole the instruction. Use a dedicated setPDSTL
function instead of original defId which is incorrect in this case.

v2: (Ilia Mirkin)
Change API of setPDSTL() to handle cases of no output
Fix setting of the highest bit in setPDSTL()

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit d941ef3829)
2017-04-26 00:10:04 +03:00
Emil Velikov
12434966eb docs: add sha256 checksums for 17.0.4
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-17 14:42:37 +01:00
33 changed files with 535 additions and 137 deletions

View File

@@ -1 +1 @@
17.0.4
17.0.5

View File

@@ -3,3 +3,48 @@ d49d275c415d60ae08dc3e52d8db11f19a44010f anv/blorp: Don't sanitize the swizzle f
# The commit addressed an earlier commit 0567ab0407e which did not land in branch.
# A stable specific backported patch will follow later ...
bc5d587a80b64fb3e0a5ea8067e6317fbca2bbc5 radv: Invalidate L2 for TRANSFER_WRITE barriers
# stable: the commit depends on earlier commit 656e30b6860 which did
# not land in branch, and some other dependencies.
d2d6cf6c8387ac06c8559027f57683a61b48671b anv: Add the pci_id into the shader cache UUID
# stable: 17.1 nomination only. Fixes earlier commit 0b613c20 which
# did not land in branch.
d4601b0efc7f5e24e3f39fefa8e29e79560245ce freedreno: fix crash if ctx torn down with no rendering
# stable: 17.1 nomination only. the commit depends on earlier commit
# 7748c3f5eb1 which did not land in branch and the part that
# could be merged is not really providing anything relevant to
# stable.
b81d85f1754928139f9f01474495e024946aa1b4 configure.ac: Fix typos.
# extra: this reverts a commit in stable only because a new feature in
# master replaces it.
e75001811e3b66986b4ede165a0fdde703d4f05b Revert "etnaviv: Cannot render to rb-swapped formats"
# extra: the commit depends on earlier commits which did not land in
# branch.
dee31311eb024a636466e359b43d3a67b0135f32 Revert "i965/fs: Don't emit SEL instructions for type-converting MOVs."
# fixes: finds 2 commit references but it is really only one, and only
# in master.
2b3c490e23a6cd7f4f6bb489267c2b9b4fde5b20 radv: fix typo in a2b10g10r10 fast clear calculation
# fixes: removes unused symbols but it doesn't really add nor fix
# anything relevant.
9807e9dea67a60ab8ee04741c75b748eade582ee anv: remove unused anv_dispatch_table dtable
# fixes: removes unused symbols but it doesn't really add nor fix
# anything relevant.
320561bd831b81843e732d38d2b254aa3b25f2f6 radv: remove unused radv_dispatch_table dtable
# fixes: it just makes a local function static.
8b79f0ed0812a3a80dd91e47112fd722bd2d6978 radv: make radv_resolve_entrypoint static
# fixes: reported only because referes to fixes in 2 commits, but they
# are not in stable.
3f2cb699cfe0481f214c709b5a1375caf0a9c7fe android: vulkan: add support for libmesa_vulkan_util
# fixes: reported only because referes to fixes in 2 commits, but they
# are not in stable.
61c38d14b7b1d0ccacc440340ee0b1bc4454eca2 android: r600: fix libmesa_amd_common dependency
# fixes: removes unused symbols but it doesn't really add nor fix
# anything relevant.
b69a03e12aa38ed5d8b60a056630ed445f6097dc i965: remove dead brw_new_shader() declaration
# fixes: it just cleans .gitignore.
f282ace67862c0633d0a8135e4808867740d0d39 i965: remove i965_symbols_test reference from .gitignore
# fixes: reported only because referes to fixes in 2 commits, but they
# are not in stable.
15603055fb36a630cf3023219e9dd5c4a49c0596 anv: automake: ensure that the destination directory is created
# fixes: reported only because referes to fixes in 2 commits, but they
# are not in stable.
a6840efc096bd26e92bcee1a50515d845988a2f9 anv: provide required gem stubs for the tests

View File

@@ -2394,7 +2394,9 @@ if test -n "$with_gallium_drivers"; then
xvirgl)
HAVE_GALLIUM_VIRGL=yes
require_libdrm "virgl"
require_basic_egl "virgl"
if test "x$enable_egl" = xyes; then
require_basic_egl "virgl"
fi
;;
*)
AC_MSG_ERROR([Unknown Gallium driver: $driver])

View File

@@ -31,7 +31,8 @@ because compatibility contexts are not supported.
<h2>SHA256 checksums</h2>
<pre>
TBD
c4c34ba05d48f76b45bc05bc4b6e9242077f403d63c4f0c355c7b07786de233e mesa-17.0.4.tar.gz
1269dc8545a193932a0779b2db5bce9be4a5f6813b98c38b93b372be8362a346 mesa-17.0.4.tar.xz
</pre>

143
docs/relnotes/17.0.5.html Normal file
View File

@@ -0,0 +1,143 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 17.0.5 Release Notes / April 28, 2017</h1>
<p>
Mesa 17.0.5 is a bug fix release which fixes bugs found since the 17.0.4 release.
</p>
<p>
Mesa 17.0.5 implements the OpenGL 4.5 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
4.5 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
TBD
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97524">Bug 97524</a> - Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION</li>
</ul>
<h2>Changes</h2>
<p>Andres Gomez (16):</p>
<ul>
<li>cherry-ignore: Add the pci_id into the shader cache UUID</li>
<li>cherry-ignore: fix crash if ctx torn down with no rendering</li>
<li>cherry-ignore: Fix typos.</li>
<li>cherry-ignore: Revert "etnaviv: Cannot render to rb-swapped formats"</li>
<li>cherry-ignore: Revert "i965/fs: Don't emit SEL instructions for type-converting MOVs."</li>
<li>cherry-ignore: fix typo in a2b10g10r10 fast clear calculation</li>
<li>cherry-ignore: remove unused anv_dispatch_table dtable</li>
<li>cherry-ignore: remove unused radv_dispatch_table dtable</li>
<li>cherry-ignore: make radv_resolve_entrypoint static</li>
<li>cherry-ignore: vulkan: add support for libmesa_vulkan_util</li>
<li>cherry-ignore: r600: fix libmesa_amd_common dependency</li>
<li>cherry-ignore: remove dead brw_new_shader() declaration</li>
<li>cherry-ignore: remove i965_symbols_test reference from .gitignore</li>
<li>cherry-ignore: automake: ensure that the destination directory is created</li>
<li>cherry-ignore: provide required gem stubs for the tests</li>
<li>Update version to 17.0.5</li>
</ul>
<p>Boyan Ding (2):</p>
<ul>
<li>nvc0/ir: Properly handle a "split form" of predicate destination</li>
<li>nir: Destination component count of shader_clock intrinsic is 2</li>
</ul>
<p>Emil Velikov (5):</p>
<ul>
<li>docs: add sha256 checksums for 17.0.4</li>
<li>winsys/sw/dri: don't use GNU void pointer arithmetic</li>
<li>st/clover: add space between &lt; and ::</li>
<li>configure.ac: check require_basic_egl only if egl enabled</li>
<li>st/mesa: automake: honour the vdpau header install location</li>
</ul>
<p>Francisco Jerez (2):</p>
<ul>
<li>intel/fs: Use regs_written() in spilling cost heuristic for improved accuracy.</li>
<li>intel/fs: Take into account amount of data read in spilling cost heuristic.</li>
</ul>
<p>Grazvydas Ignotas (1):</p>
<ul>
<li>radv: report timestampPeriod correctly</li>
</ul>
<p>Jason Ekstrand (5):</p>
<ul>
<li>anv/blorp: Flush the texture cache in UpdateBuffer</li>
<li>anv/cmd_buffer: Flush the VF cache at the top of all primaries</li>
<li>anv/cmd_buffer: Always set up a null surface state</li>
<li>anv/cmd_buffer: Use the null surface state for ATTACHMENT_UNUSED</li>
<li>anv/blorp: Properly handle VK_ATTACHMENT_UNUSED</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>i965/vec4: Avoid reswizzling MACH instructions in opt_register_coalesce().</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>st/mesa: invalidate the readpix cache in st_indirect_draw_vbo</li>
</ul>
<p>Nanley Chery (1):</p>
<ul>
<li>anv/cmd_buffer: Disable CCS on BDW input attachments</li>
</ul>
<p>Nicolai Hähnle (4):</p>
<ul>
<li>mesa: fix remaining xfb prims check for GLES with multiple instances</li>
<li>mesa: extract need_xfb_remaining_prims_check</li>
<li>mesa: move glMultiDrawArrays to vbo and fix error handling</li>
<li>vbo: fix gl_DrawID handling in glMultiDrawArrays</li>
</ul>
<p>Rob Clark (1):</p>
<ul>
<li>util/queue: don't hang at exit</li>
</ul>
<p>Timothy Arceri (1):</p>
<ul>
<li>mesa: validate sampler type across the whole program</li>
</ul>
</div>
</body>
</html>

View File

@@ -570,7 +570,7 @@ void radv_GetPhysicalDeviceProperties(
.storageImageSampleCounts = VK_SAMPLE_COUNT_1_BIT,
.maxSampleMaskWords = 1,
.timestampComputeAndGraphics = false,
.timestampPeriod = 100000.0 / pdevice->rad_info.clock_crystal_freq,
.timestampPeriod = 1000000.0 / pdevice->rad_info.clock_crystal_freq,
.maxClipDistances = 8,
.maxCullDistances = 8,
.maxCombinedClipAndCullDistances = 8,

View File

@@ -94,7 +94,7 @@ struct radeon_info {
uint32_t compute_rings;
uint32_t vce_fw_version;
uint32_t vce_harvest_config;
uint32_t clock_crystal_freq;
uint32_t clock_crystal_freq; /* in kHz */
/* Kernel info. */
uint32_t drm_major; /* version */

View File

@@ -927,7 +927,8 @@ nir_visitor::visit(ir_call *ir)
nir_builder_instr_insert(&b, &instr->instr);
break;
case nir_intrinsic_shader_clock:
nir_ssa_dest_init(&instr->instr, &instr->dest, 1, 32, NULL);
nir_ssa_dest_init(&instr->instr, &instr->dest, 2, 32, NULL);
instr->num_components = 2;
nir_builder_instr_insert(&b, &instr->instr);
break;
case nir_intrinsic_store_ssbo: {

View File

@@ -91,7 +91,7 @@ BARRIER(memory_barrier)
* The latter can be used as code motion barrier, which is currently not
* feasible with NIR.
*/
INTRINSIC(shader_clock, 0, ARR(0), true, 1, 0, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
INTRINSIC(shader_clock, 0, ARR(0), true, 2, 0, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
/*
* Memory barrier with semantics analogous to the compute shader

View File

@@ -294,9 +294,18 @@ util_queue_add_job(struct util_queue *queue,
struct util_queue_job *ptr;
assert(fence->signalled);
fence->signalled = false;
pipe_mutex_lock(queue->lock);
if (queue->kill_threads) {
pipe_mutex_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);
/* if the queue is full, wait until there is space */

View File

@@ -58,6 +58,7 @@ private:
void setImmediateS8(const ValueRef&);
void setSUConst16(const Instruction *, const int s);
void setSUPred(const Instruction *, const int s);
void setPDSTL(const Instruction *, const int d);
void emitCondCode(CondCode cc, int pos);
void emitInterpMode(const Instruction *);
@@ -373,6 +374,16 @@ void CodeEmitterNVC0::setImmediateS8(const ValueRef &ref)
code[0] |= (s8 >> 6) << 8;
}
void CodeEmitterNVC0::setPDSTL(const Instruction *i, const int d)
{
assert(d < 0 || (i->defExists(d) && i->def(d).getFile() == FILE_PREDICATE));
uint32_t pred = d >= 0 ? DDATA(i->def(d)).id : 7;
code[0] |= (pred & 3) << 8;
code[1] |= (pred & 4) << (26 - 2);
}
void
CodeEmitterNVC0::emitForm_A(const Instruction *i, uint64_t opc)
{
@@ -1864,7 +1875,7 @@ CodeEmitterNVC0::emitSTORE(const Instruction *i)
if (i->src(0).getFile() == FILE_MEMORY_SHARED &&
i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) {
assert(i->defExists(0));
defId(i->def(0), 8);
setPDSTL(i, 0);
}
}
@@ -1936,7 +1947,7 @@ CodeEmitterNVC0::emitLOAD(const Instruction *i)
if (p >= 0) {
if (targ->getChipset() >= NVISA_GK104_CHIPSET)
defId(i->def(p), 8);
setPDSTL(i, p);
else
defId(i->def(p), 32 + 18);
}

View File

@@ -49,7 +49,7 @@ namespace clover {
build_module_library(const ::llvm::Module &mod,
enum module::section::type section_type);
std::unique_ptr<::llvm::Module>
std::unique_ptr< ::llvm::Module>
parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
std::string &r_log);

View File

@@ -94,7 +94,7 @@ clover::llvm::build_module_library(const ::llvm::Module &mod,
return m;
}
std::unique_ptr<::llvm::Module>
std::unique_ptr< ::llvm::Module>
clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
std::string &r_log) {
auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
@@ -104,5 +104,5 @@ clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
fail(r_log, error(CL_INVALID_PROGRAM), s);
});
return std::unique_ptr<::llvm::Module>(std::move(*mod));
return std::unique_ptr< ::llvm::Module>(std::move(*mod));
}

View File

@@ -121,12 +121,12 @@ namespace {
} else {
// Other types.
const auto actual_type =
isa<::llvm::PointerType>(arg_type) && arg.hasByValAttr() ?
cast<::llvm::PointerType>(arg_type)->getElementType() : arg_type;
isa< ::llvm::PointerType>(arg_type) && arg.hasByValAttr() ?
cast< ::llvm::PointerType>(arg_type)->getElementType() : arg_type;
if (actual_type->isPointerTy()) {
const unsigned address_space =
cast<::llvm::PointerType>(actual_type)->getAddressSpace();
cast< ::llvm::PointerType>(actual_type)->getAddressSpace();
if (address_space == address_spaces[clang::LangAS::opencl_local
- clang::LangAS::Offset]) {

View File

@@ -156,7 +156,7 @@ clover::llvm::print_module_native(const ::llvm::Module &mod,
const target &target) {
std::string log;
try {
std::unique_ptr<::llvm::Module> cmod { CloneModule(&mod) };
std::unique_ptr< ::llvm::Module> cmod { CloneModule(&mod) };
return as_string(emit_code(*cmod, target,
TargetMachine::CGFT_AssemblyFile, log));
} catch (...) {

View File

@@ -118,18 +118,18 @@ namespace clover {
#endif
}
inline std::unique_ptr<::llvm::Linker>
inline std::unique_ptr< ::llvm::Linker>
create_linker(::llvm::Module &mod) {
#if HAVE_LLVM >= 0x0308
return std::unique_ptr<::llvm::Linker>(new ::llvm::Linker(mod));
return std::unique_ptr< ::llvm::Linker>(new ::llvm::Linker(mod));
#else
return std::unique_ptr<::llvm::Linker>(new ::llvm::Linker(&mod));
return std::unique_ptr< ::llvm::Linker>(new ::llvm::Linker(&mod));
#endif
}
inline bool
link_in_module(::llvm::Linker &linker,
std::unique_ptr<::llvm::Module> mod) {
std::unique_ptr< ::llvm::Module> mod) {
#if HAVE_LLVM >= 0x0308
return linker.linkInModule(std::move(mod));
#else

View File

@@ -51,7 +51,7 @@ namespace clover {
is_kernel_node_for(const ::llvm::Function &f) {
return [&](const ::llvm::MDNode *n) {
using ::llvm::mdconst::dyn_extract;
return &f == dyn_extract<::llvm::Function>(n->getOperand(0));
return &f == dyn_extract< ::llvm::Function>(n->getOperand(0));
};
}
@@ -65,7 +65,7 @@ namespace clover {
#endif
}
inline iterator_range<::llvm::MDNode::op_iterator>
inline iterator_range< ::llvm::MDNode::op_iterator>
get_kernel_metadata_operands(const ::llvm::Function &f,
const std::string &name) {
#if HAVE_LLVM >= 0x0309
@@ -79,11 +79,11 @@ namespace clover {
const auto kernel_node = find(is_kernel_node_for(f),
get_kernel_nodes(*f.getParent()));
const auto data_node = cast<::llvm::MDNode>(
const auto data_node = cast< ::llvm::MDNode>(
find([&](const ::llvm::MDOperand &op) {
if (auto m = dyn_cast<::llvm::MDNode>(op))
if (auto m = dyn_cast< ::llvm::MDNode>(op))
if (m->getNumOperands())
if (auto m_name = dyn_cast<::llvm::MDString>(
if (auto m_name = dyn_cast< ::llvm::MDString>(
m->getOperand(0).get()))
return m_name->getString() == name;
@@ -106,7 +106,7 @@ namespace clover {
get_argument_metadata(const ::llvm::Function &f,
const ::llvm::Argument &arg,
const std::string &name) {
return ::llvm::cast<::llvm::MDString>(
return ::llvm::cast< ::llvm::MDString>(
detail::get_kernel_metadata_operands(f, name)[arg.getArgNo()])
->getString();
}

View File

@@ -200,7 +200,7 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
if (box) {
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,
box->x, box->y, box->width, box->height, dri_sw_dt->stride);
} else {

View File

@@ -683,6 +683,11 @@ void anv_CmdUpdateBuffer(
assert(max_update_size < MAX_SURFACE_DIM * 4);
/* We're about to read data that was written from the CPU. Flush the
* texture cache so we don't get anything stale.
*/
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT;
while (dataSize) {
const uint32_t copy_size = MIN2(dataSize, max_update_size);
@@ -691,6 +696,9 @@ void anv_CmdUpdateBuffer(
memcpy(tmp_data.map, pData, copy_size);
if (!cmd_buffer->device->info.has_llc)
anv_state_clflush(tmp_data);
int bs = 16;
bs = gcd_pow2_u64(bs, dstOffset);
bs = gcd_pow2_u64(bs, copy_size);
@@ -1122,6 +1130,9 @@ anv_cmd_buffer_flush_attachments(struct anv_cmd_buffer *cmd_buffer,
for (uint32_t i = 0; i < subpass->color_count; ++i) {
uint32_t att = subpass->color_attachments[i];
if (att == VK_ATTACHMENT_UNUSED)
continue;
assert(att < pass->attachment_count);
if (attachment_needs_flush(cmd_buffer, &pass->attachments[att], stage)) {
cmd_buffer->state.pending_pipe_bits |=
@@ -1149,14 +1160,19 @@ subpass_needs_clear(const struct anv_cmd_buffer *cmd_buffer)
for (uint32_t i = 0; i < cmd_state->subpass->color_count; ++i) {
uint32_t a = cmd_state->subpass->color_attachments[i];
if (a == VK_ATTACHMENT_UNUSED)
continue;
assert(a < cmd_state->pass->attachment_count);
if (cmd_state->attachments[a].pending_clear_aspects) {
return true;
}
}
if (ds != VK_ATTACHMENT_UNUSED &&
cmd_state->attachments[ds].pending_clear_aspects) {
return true;
if (ds != VK_ATTACHMENT_UNUSED) {
assert(ds < cmd_state->pass->attachment_count);
if (cmd_state->attachments[ds].pending_clear_aspects)
return true;
}
return false;
@@ -1188,6 +1204,10 @@ anv_cmd_buffer_clear_subpass(struct anv_cmd_buffer *cmd_buffer)
struct anv_framebuffer *fb = cmd_buffer->state.framebuffer;
for (uint32_t i = 0; i < cmd_state->subpass->color_count; ++i) {
const uint32_t a = cmd_state->subpass->color_attachments[i];
if (a == VK_ATTACHMENT_UNUSED)
continue;
assert(a < cmd_state->pass->attachment_count);
struct anv_attachment_state *att_state = &cmd_state->attachments[a];
if (!att_state->pending_clear_aspects)
@@ -1246,6 +1266,7 @@ anv_cmd_buffer_clear_subpass(struct anv_cmd_buffer *cmd_buffer)
}
const uint32_t ds = cmd_state->subpass->depth_stencil_attachment;
assert(ds == VK_ATTACHMENT_UNUSED || ds < cmd_state->pass->attachment_count);
if (ds != VK_ATTACHMENT_UNUSED &&
cmd_state->attachments[ds].pending_clear_aspects) {
@@ -1551,8 +1572,12 @@ anv_cmd_buffer_resolve_subpass(struct anv_cmd_buffer *cmd_buffer)
blorp_batch_init(&cmd_buffer->device->blorp, &batch, cmd_buffer, 0);
for (uint32_t i = 0; i < subpass->color_count; ++i) {
ccs_resolve_attachment(cmd_buffer, &batch,
subpass->color_attachments[i]);
const uint32_t att = subpass->color_attachments[i];
if (att == VK_ATTACHMENT_UNUSED)
continue;
assert(att < cmd_buffer->state.pass->attachment_count);
ccs_resolve_attachment(cmd_buffer, &batch, att);
}
anv_cmd_buffer_flush_attachments(cmd_buffer, SUBPASS_STAGE_DRAW);
@@ -1565,6 +1590,9 @@ anv_cmd_buffer_resolve_subpass(struct anv_cmd_buffer *cmd_buffer)
if (dst_att == VK_ATTACHMENT_UNUSED)
continue;
assert(src_att < cmd_buffer->state.pass->attachment_count);
assert(dst_att < cmd_buffer->state.pass->attachment_count);
if (cmd_buffer->state.attachments[dst_att].pending_clear_aspects) {
/* From the Vulkan 1.0 spec:
*

View File

@@ -272,26 +272,21 @@ color_attachment_compute_aux_usage(struct anv_device *device,
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_E;
} else if (att_state->fast_clear) {
att_state->aux_usage = ISL_AUX_USAGE_CCS_D;
if (GEN_GEN >= 9) {
/* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode:
*
* "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D
* setting is only allowed if Surface Format supported for Fast
* Clear. In addition, if the surface is bound to the sampling
* engine, Surface Format must be supported for Render Target
* Compression for surfaces bound to the sampling engine."
*
* In other words, we can't sample from a fast-cleared image if it
* doesn't also support color compression.
*/
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
} else if (GEN_GEN == 8) {
/* Broadwell can sample from fast-cleared images */
/* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode:
*
* "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D
* setting is only allowed if Surface Format supported for Fast
* Clear. In addition, if the surface is bound to the sampling
* engine, Surface Format must be supported for Render Target
* Compression for surfaces bound to the sampling engine."
*
* In other words, we can only sample from a fast-cleared image if it
* also supports color compression.
*/
if (isl_format_supports_lossless_compression(&device->info, iview->isl.format))
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D;
} else {
/* Ivy Bridge and Haswell cannot */
else
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
}
} else {
att_state->aux_usage = ISL_AUX_USAGE_NONE;
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
@@ -418,23 +413,15 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
abort();
}
bool need_null_state = false;
unsigned num_states = 0;
/* Reserve one for the NULL state. */
unsigned num_states = 1;
for (uint32_t i = 0; i < pass->attachment_count; ++i) {
if (vk_format_is_color(pass->attachments[i].format)) {
if (vk_format_is_color(pass->attachments[i].format))
num_states++;
} else {
/* We need a null state for any depth-stencil-only subpasses.
* Importantly, this includes depth/stencil clears so we create one
* whenever we have depth or stencil
*/
need_null_state = true;
}
if (need_input_attachment_state(&pass->attachments[i]))
num_states++;
}
num_states += need_null_state;
const uint32_t ss_stride = align_u32(isl_dev->ss.size, isl_dev->ss.align);
state->render_pass_states =
@@ -444,11 +431,9 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
struct anv_state next_state = state->render_pass_states;
next_state.alloc_size = isl_dev->ss.size;
if (need_null_state) {
state->null_surface_state = next_state;
next_state.offset += ss_stride;
next_state.map += ss_stride;
}
state->null_surface_state = next_state;
next_state.offset += ss_stride;
next_state.map += ss_stride;
for (uint32_t i = 0; i < pass->attachment_count; ++i) {
if (vk_format_is_color(pass->attachments[i].format)) {
@@ -470,24 +455,22 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
ANV_FROM_HANDLE(anv_framebuffer, framebuffer, begin->framebuffer);
assert(pass->attachment_count == framebuffer->attachment_count);
if (need_null_state) {
struct GENX(RENDER_SURFACE_STATE) null_ss = {
.SurfaceType = SURFTYPE_NULL,
.SurfaceArray = framebuffer->layers > 0,
.SurfaceFormat = ISL_FORMAT_R8G8B8A8_UNORM,
struct GENX(RENDER_SURFACE_STATE) null_ss = {
.SurfaceType = SURFTYPE_NULL,
.SurfaceArray = framebuffer->layers > 0,
.SurfaceFormat = ISL_FORMAT_R8G8B8A8_UNORM,
#if GEN_GEN >= 8
.TileMode = YMAJOR,
.TileMode = YMAJOR,
#else
.TiledSurface = true,
.TiledSurface = true,
#endif
.Width = framebuffer->width - 1,
.Height = framebuffer->height - 1,
.Depth = framebuffer->layers - 1,
.RenderTargetViewExtent = framebuffer->layers - 1,
};
GENX(RENDER_SURFACE_STATE_pack)(NULL, state->null_surface_state.map,
&null_ss);
}
.Width = framebuffer->width - 1,
.Height = framebuffer->height - 1,
.Depth = framebuffer->layers - 1,
.RenderTargetViewExtent = framebuffer->layers - 1,
};
GENX(RENDER_SURFACE_STATE_pack)(NULL, state->null_surface_state.map,
&null_ss);
for (uint32_t i = 0; i < pass->attachment_count; ++i) {
struct anv_render_pass_attachment *att = &pass->attachments[i];
@@ -603,6 +586,18 @@ genX(BeginCommandBuffer)(
genX(cmd_buffer_emit_state_base_address)(cmd_buffer);
/* We sometimes store vertex data in the dynamic state buffer for blorp
* operations and our dynamic state stream may re-use data from previous
* command buffers. In order to prevent stale cache data, we flush the VF
* cache. We could do this on every blorp call but that's not really
* needed as all of the data will get written by the CPU prior to the GPU
* executing anything. The chances are fairly high that they will use
* blorp at least once per primary command buffer so it shouldn't be
* wasted.
*/
if (cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY)
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_VF_CACHE_INVALIDATE_BIT;
if (cmd_buffer->usage_flags &
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) {
cmd_buffer->state.pass =
@@ -1153,7 +1148,18 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
assert(binding->binding == 0);
if (binding->index < subpass->color_count) {
const unsigned att = subpass->color_attachments[binding->index];
surface_state = cmd_buffer->state.attachments[att].color_rt_state;
/* From the Vulkan 1.0.46 spec:
*
* "If any color or depth/stencil attachments are
* VK_ATTACHMENT_UNUSED, then no writes occur for those
* attachments."
*/
if (att == VK_ATTACHMENT_UNUSED) {
surface_state = cmd_buffer->state.null_surface_state;
} else {
surface_state = cmd_buffer->state.attachments[att].color_rt_state;
}
} else {
surface_state = cmd_buffer->state.null_surface_state;
}

View File

@@ -10190,7 +10190,7 @@
</category>
<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="first" type="const GLint *"/>
<param name="count" type="const GLsizei *"/>

View File

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

View File

@@ -822,12 +822,11 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
foreach_block_and_inst(block, fs_inst, inst, cfg) {
for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == VGRF)
spill_costs[inst->src[i].nr] += loop_scale;
spill_costs[inst->src[i].nr] += regs_read(inst, i) * loop_scale;
}
if (inst->dst.file == VGRF)
spill_costs[inst->dst.nr] += DIV_ROUND_UP(inst->size_written, REG_SIZE)
* loop_scale;
spill_costs[inst->dst.nr] += regs_written(inst) * loop_scale;
switch (inst->opcode) {

View File

@@ -1066,6 +1066,13 @@ vec4_instruction::can_reswizzle(const struct gen_device_info *devinfo,
if (devinfo->gen == 6 && is_math() && swizzle != BRW_SWIZZLE_XYZW)
return false;
/* We can't swizzle implicit accumulator access. We'd have to
* reswizzle the producer of the accumulator value in addition
* to the consumer (i.e. both MUL and MACH). Just skip this.
*/
if (reads_accumulator_implicitly())
return false;
if (!can_do_writemask(devinfo) && dst_writemask != WRITEMASK_XYZW)
return false;

View File

@@ -795,25 +795,10 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
"glDrawRangeElements");
}
static bool
validate_draw_arrays(struct gl_context *ctx, const char *func,
GLenum mode, GLsizei count, GLsizei numInstances)
need_xfb_remaining_prims_check(const struct gl_context *ctx)
{
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
* Primitive Capture):
*
@@ -841,10 +826,33 @@ validate_draw_arrays(struct gl_context *ctx, const char *func,
* is removed and replaced with the GL behavior (primitives are not
* written and the corresponding counter is not updated)..."
*/
if (_mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
!_mesa_has_OES_geometry_shader(ctx) &&
!_mesa_has_OES_tessellation_shader(ctx)) {
size_t prim_count = vbo_count_tessellated_primitives(mode, count, 1);
return _mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
!_mesa_has_OES_geometry_shader(ctx) &&
!_mesa_has_OES_tessellation_shader(ctx);
}
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) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(exceeds transform feedback size)", func);
@@ -892,6 +900,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
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
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
_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
_mesa_validate_DrawElements(struct gl_context *ctx,
GLenum mode, GLsizei count, GLenum type,

View File

@@ -856,6 +856,8 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
*/
if (uni->type->is_sampler()) {
bool flushed = false;
shProg->SamplersValidated = GL_TRUE;
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_linked_shader *const sh = shProg->_LinkedShaders[i];

View File

@@ -68,15 +68,14 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
struct gl_program *prog)
{
GLbitfield mask = prog->SamplersUsed;
struct gl_linked_shader *shader =
shProg->_LinkedShaders[_mesa_program_enum_to_shader_stage(prog->Target)];
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));
shProg->SamplersValidated = GL_TRUE;
while (mask) {
const int s = u_bit_scan(&mask);
GLuint unit = prog->SamplerUnits[s];
@@ -92,8 +91,20 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
* types pointing to the same texture image unit within a program
* object."
*/
if (prog->TexturesUsed[unit] & ~(1 << tgt))
shProg->SamplersValidated = GL_FALSE;
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;
}
prog->TexturesUsed[unit] |= (1 << tgt);
}

View File

@@ -1546,24 +1546,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->CurrentDispatch, (mode, first[i], count[i]));
}
}
}
/* GL_IBM_multimode_draw_arrays */
void GLAPIENTRY
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,

View File

@@ -3060,6 +3060,11 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
}
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)) {
prog->data->LinkStatus = GL_FALSE;
}

View File

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

View File

@@ -404,7 +404,8 @@ vbo_bind_arrays(struct gl_context *ctx)
*/
static void
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 _mesa_prim prim[2];
@@ -418,6 +419,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
prim[0].mode = mode;
prim[0].num_instances = numInstances;
prim[0].base_instance = baseInstance;
prim[0].draw_id = drawID;
prim[0].is_indirect = 0;
/* Implement the primitive restart index */
@@ -614,7 +616,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
if (0)
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)
print_draw_arrays(ctx, mode, start, count);
@@ -642,7 +644,7 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
if (0)
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)
print_draw_arrays(ctx, mode, start, count);
@@ -672,13 +674,52 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
if (0)
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)
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.
@@ -1272,7 +1313,7 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
!_mesa_all_varyings_in_vbos(ctx->Array.VAO))) {
GLsizei n =
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;
}
@@ -1683,6 +1724,7 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
SET_DrawRangeElements(exec, vbo_exec_DrawRangeElements);
}
SET_MultiDrawArrays(exec, vbo_exec_MultiDrawArrays);
SET_MultiDrawElementsEXT(exec, vbo_exec_MultiDrawElements);
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
* then emitting an indexed prim at runtime.
*/
@@ -1484,6 +1518,7 @@ vbo_initialize_save_dispatch(const struct gl_context *ctx,
struct _glapi_table *exec)
{
SET_DrawArrays(exec, _save_OBE_DrawArrays);
SET_MultiDrawArrays(exec, _save_OBE_MultiDrawArrays);
SET_DrawElements(exec, _save_OBE_DrawElements);
SET_DrawElementsBaseVertex(exec, _save_OBE_DrawElementsBaseVertex);
SET_DrawRangeElements(exec, _save_OBE_DrawRangeElements);