summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa/vbo: move some Draw checks out of validationTimothy Arceri2017-04-192-41/+108
| | | | | | | These checks do not generate any errors. Move them so we can add KHR_no_error support and still make sure we do these checks. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: add KHR_no_error support to *Pointer() functionsTimothy Arceri2017-04-191-116/+236
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: add KHR_no_error support to some callers of validate_array_format()Timothy Arceri2017-04-191-63/+73
| | | | | | | The only caller we don't update is update_arrays(), we leave that to the following commit. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: rename update_array_format() -> validate_array_format()Timothy Arceri2017-04-191-26/+45
| | | | | | | | | | We also move _mesa_update_array_format() into the caller. This gets these functions ready for KHR_no_error support. V2: Updated function comment as suggested by Brian. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: create get_array_format() helperTimothy Arceri2017-04-191-11/+20
| | | | | | | | This will help us split array validation from array update. V2: add const to ctx param Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: split update_array() into validate_array() and update_array()Timothy Arceri2017-04-191-14/+41
| | | | | | This will be used for adding KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support to glUniform*() functionsTimothy Arceri2017-04-191-23/+50
| | | | | | | V2: restore lost comment, add static to validate_uniform(), simplify array offset logic. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabledTimothy Arceri2017-04-191-0/+11
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add _mesa_is_no_error_enabled() helperTimothy Arceri2017-04-191-0/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add env var to force enable the KHR_no_error ctx flagTimothy Arceri2017-04-191-0/+6
| | | | | | | V2: typo know -> known V3: add security check (Suggested by Nicolai) Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: expose KHR_no_errorTimothy Arceri2017-04-191-0/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* r600g: update dirty_level_mask after the 1-st draw after FB changeConstantine Kharlamov2017-04-194-18/+26
| | | | | | | | | | | Ported from radeonsi. Testing with Kane&Lynch2 shows ≈1k skipped updates per frame on average. No piglit changes with tests/gpu.py, gbm mode. Signed-off-by: Constantine Kharlamov <[email protected]> Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* vbo: fix gl_DrawID handling in glMultiDrawArraysNicolai Hähnle2017-04-191-6/+15
| | | | | | | | Fixes a bug in KHR-GL45.shader_draw_parameters_tests.ShaderMultiDrawArraysParameters. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* mesa: move glMultiDrawArrays to vbo and fix error handlingNicolai Hähnle2017-04-196-19/+127
| | | | | | | | | | | | | | | | 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: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: extract need_xfb_remaining_prims_checkNicolai Hähnle2017-04-191-20/+28
| | | | | | | | The same logic needs to be applied to glMultiDrawArrays. Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix remaining xfb prims check for GLES with multiple instancesNicolai Hähnle2017-04-191-1/+1
| | | | | | | | Found by inspection. Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radv/meta: Fix nir_builder.h includeMike Lothian2017-04-191-1/+1
| | | | | | | | | | | | | This fixes the build after: commit 399ebd2a84a133bd2ca3da388a059fd3bafe33f5 Author: Dave Airlie <[email protected]> Date: Wed Apr 19 06:18:23 2017 +1000 radv/meta: add common shader vertex generation function Signed-off-by: Mike Lothian <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: Fix nir.h includeMike Lothian2017-04-191-1/+1
| | | | | | | | | | | | | This fixes the build after: commit 224cf2906a8f38ce47411afc93a223ac0e41795f Author: Dave Airlie <[email protected]> Date: Mon Apr 17 13:01:52 2017 +1000 radv/ac: add initial pre-pass for shader info gathering Signed-off-by: Mike Lothian <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: refactor out some common shaders.Dave Airlie2017-04-195-104/+43
| | | | | | | | The vs vertex generate and fs noop shaders are used in a few places, so refactor them out. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: generate position for blit shaders.Dave Airlie2017-04-191-51/+16
| | | | | | | This generates the position info using the vertex shader. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: reduce vertex buffer in blit2d.Dave Airlie2017-04-191-28/+7
| | | | | | | Generate the position vertices. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: reduce vertex buffer usage in clear shadersDave Airlie2017-04-193-53/+25
| | | | | | | | | For depth clears we have to pass the depth in the 2nd component, we can use push constants for some of this later to drop the vertex buffer completely Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: avoid using vertex buffer for resolve shader.Dave Airlie2017-04-191-67/+7
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: move depth decompress to using inline vertex dataDave Airlie2017-04-191-69/+6
| | | | | | | | This removes the vertex buffer, and just generates the values in the shader. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: move fast clear to generate vertices in shader.Dave Airlie2017-04-191-68/+6
| | | | | | | Avoids having to setup vertex buffers. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: add common shader vertex generation functionDave Airlie2017-04-192-0/+39
| | | | | | | | | | Instead of passing in the same 1.0, -1.0 combinations via vertex buffers, we can just use vertex id to have the vertex shader build them. This function introduces the generator code needed, later patches will use this. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: add support for save/restore meta without vertex data.Dave Airlie2017-04-192-8/+38
| | | | | | | | Some of the shaders could just generate the vertex data in the shader, so add helpers to allow us to move to doing that. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: drop debugging leftovers code in descriptor set patches.Dave Airlie2017-04-191-3/+0
| | | | Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for 32 descriptor sets.Dave Airlie2017-04-192-7/+7
| | | | | | | | | This bumps the limit to the number of sets to 32, now that we have proper support for it. It also uses 1u in a few places to make things a bit safer. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: add support for indirect access of descriptor sets.Dave Airlie2017-04-195-18/+105
| | | | | | | | | | | | | | | | | | | We want to expose more descriptor sets to the applications, but currently we have a 1:1 mapping between shader descriptor sets and 2 user sgprs, limiting us to 4 per stage. This commit check if we don't have enough user sgprs for the number of bound sets for this shader, we can ask for them to be indirected. Two sgprs are then used to point to a buffer or 64-bit pointers to the number of allocated descriptor sets. All shaders point to the same buffer. We can use some user sgprs to inline one or two descriptor sets in future, but until we have a workload that needs this I don't think we should spend too much time on it. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: start allocating user sgprsDave Airlie2017-04-191-13/+74
| | | | | | | | | | | | This adds an initial implementation to allocate the user sgprs and make sure we don't run out if we try to bind a bunch of descriptor sets. This can be enhanced further in the future if we add support for inlining push constants. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: mark used descriptor sets in shader info.Dave Airlie2017-04-192-0/+35
| | | | | | | This pre calculates the used descriptor sets. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: frag shader only needs ring offsets if sample positions enabledDave Airlie2017-04-191-1/+4
| | | | | | | | mostly documenting things, since with modern llvm we always have the spill enabled. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: move needs_push_constants to shader info.Dave Airlie2017-04-193-10/+11
| | | | | | | First step to optimising push constants. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: optimise compute shader grid size emission.Dave Airlie2017-04-194-13/+29
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: start conditionalising vertex inputs. (v2)Dave Airlie2017-04-194-14/+63
| | | | | | | | | | | In practice this will probably just drop draw id in a few places. v2: just do draw_id for now. (Bas) it might be possible to do something more if we need it in the future. (nha) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: add initial pre-pass for shader info gatheringDave Airlie2017-04-196-9/+116
| | | | | | | | | | | | There is some radv specific info we need to gather from shaders before we get into converting nir->llvm, so we can make better decisions especially around user sgpr allocation. This is just an initial placeholder to gather if sample positions are required in the frag shader. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* freedreno: refactor dirty state handlingRob Clark2017-04-1819-101/+119
| | | | | | | | In particular, move per-shader-stage info out to a seperate array of enum's indexed by shader stage. This will make it easier to add more shader stages as well as new per-stage state (like SSBOs). Signed-off-by: Rob Clark <[email protected]>
* freedreno: move clear path dirty state hack to a2xx backendRob Clark2017-04-182-9/+9
| | | | | | | | | a3xx/a4xx use the generic u_blitter path, which will make state dirty bits be set appropriately thanks to the automagic of generic code setting generic state in the driver. And a5xx has a blit/dma engine (actually, two) so it doesn't need these extra dirty bits set. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: split out per-stage emit_consts fxnsRob Clark2017-04-185-21/+41
| | | | | | | | | This makes it easier to deal with adding additional stages which have their own driver-params. The duplicated code this introduces can be refactored out after a later patch moves to per-shader-stage dirty flags. Signed-off-by: Rob Clark <[email protected]>
* freedreno: add helper to mark all state cleanRob Clark2017-04-189-52/+34
| | | | | | | | Note that this involves juggling around a bit when we emit and clear texture state. So split out from the patch that adds the helper to set all state dirty. Signed-off-by: Rob Clark <[email protected]>
* freedreno: add helper to mark all state dirtyRob Clark2017-04-184-6/+13
| | | | | | This will simplify things when we break out per-shader-stage dirty bits. Signed-off-by: Rob Clark <[email protected]>
* freedreno: move a2xx specific hack out of coreRob Clark2017-04-182-10/+20
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno: make texture state an arrayRob Clark2017-04-1810-39/+45
| | | | | | | | Make this an array indexed by shader stage, as is done elsewhere for other per-shader-stage state. This will simplify things as more shader stages are eventually added. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: refactor out helpers for comparing shader keysRob Clark2017-04-184-79/+63
| | | | | | | | | | | | Each of the ir3 users has *basically* the same logic for comparing the previous and current shader key, to see which, if any, shader state needs to be marked dirty due to shader variant change. The difference between gen's was just that some lowering flags never get set on certain generations. But it doesn't really hurt to include the extra checks (because both keys would have false). Signed-off-by: Rob Clark <[email protected]>
* util/queue: don't hang at exitRob Clark2017-04-181-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* vc4: Enable V3D 2.6.Eric Anholt2017-04-181-1/+1
| | | | | This version of the chip is present on the Cygnus-based 911360 enterprise phone platform. It appears to be completely backwards compatible.
* st/mesa: add st_convert_sampler()Samuel Pitoiset2017-04-182-12/+36
| | | | | | | | | Similar to st_convert_image(), will be useful for bindless. While we are at it, rename convert_sampler() to convert_sampler_from_unit() and make 'st' a const argument. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glthread: add async support to ARB_viewport_array functionsBartosz Tomczyk2017-04-181-5/+5
| | | | | | | v2: fix attribute name, it is count_scale not scale_count Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: rename _mesa_add_renderbuffer* functionsTimothy Arceri2017-04-1811-62/+60
| | | | | | | These names make it easier to understand what is going on in regards to references. Reviewed-by: Brian Paul <[email protected]>