Commit Graph

186 Commits

Author SHA1 Message Date
Kenneth Graunke 5ad0c88dbe iris: Replace buffer backing storage and rebind to update addresses.
This implements PIPE_CAP_INVALIDATE_BUFFER and invalidate_resource(),
as well as the PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE flag.  When either
of these happen, we swap out the backing storage of the buffer for a
new idle BO, allowing us to write to it immediately without stalling
or queueing a blit.

On my Skylake GT4e at 1920x1080, this improves performance in games:

   -----------------------------------------------
   | DiRT Rally        | +25% (avg) | +17% (max) |
   | Bioshock Infinite | +22% (avg) | +11% (max) |
   | Shadow of Mordor  | +27% (avg) | +83% (max) |
   -----------------------------------------------
2019-04-23 00:24:08 -07:00
Kenneth Graunke 36478b9f77 iris: Enable the dual_color_blend_by_location driconf option.
This fixes rendering in Unigine Valley 1.0 and Heaven 4.0.
2019-04-22 09:36:36 -07:00
Kenneth Graunke faa52e328e iris: Add mechanism for iris-specific driconf options
Based on Nicolai's 0f8c5de869.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-22 09:35:36 -07:00
Kenneth Graunke 33314cf410 iris: Change vendor and renderer strings
This patch changes the GL_VENDOR string from "Mesa Project" to "Intel".
This makes GLX_MESA_query_renderer report "Vendor: Intel (0x8086)"
instead of "Vendor: Mesa Project (0x8086)" which is arguably wrong.
We now also use a consistent vendor string across Windows and Linux.

It also prepends "Mesa" to the GL_RENDERER string, both to credit the
community and have a distinguishing mark between the two drivers.  We
drop "DRI" compared to i965, as it's not really that important.

Improves performance in Portal by 1.8x.  Iris is now 3.86% faster
than i965 at the portal-d1.dem timedemo on my Kabylake laptop.  One
change is that Portal selects the MapBufferRange path based on the
vendor string, and iris's BufferSubData path is still missing the
storage invalidation optimization.
2019-04-16 10:27:20 -07:00
Kenneth Graunke 024a57d23c iris: Make shader_perf_log print to stderr if INTEL_DEBUG=perf is set
This matches i965's behavior, and makes sure that shader compiler
messages are visible when setting INTEL_DEBUG=perf.
2019-04-15 23:33:03 -07:00
Mike Blumenkrantz 03d6d01fe2 iris: support INTEL_NO_HW environment variable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-10 12:59:17 -07:00
Caio Marcelo de Oliveira Filho 956226c8ba iris: Enable NV_compute_shader_derivatives
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2019-04-08 19:29:33 -07:00
Caio Marcelo de Oliveira Filho 3b20ca34ae iris: Clean up compiler warnings about unused
Removed a few unused variables and iris_getparam_boolean().
Kept 'name' around since there's a commented debug that make use of it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-03-29 12:07:26 -07:00
Timur Kristóf fd5075e059 iris: Face should be a system value.
This patch adds PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL which
despite its name is not a TGSI-specific capability, just lets
the state tracker know that it should generate a system value
for FACE.

This is needed if we want to run tgsi_to_nir on iris.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-03-11 14:02:40 -07:00
Kenneth Graunke 9d1334d2a0 iris: Use copy_region and staging resources to avoid transfer stalls
This is similar to intel_miptree_map_blit and intel_buffer_object.c's
temporary blits in i965.

Improves performance of DiRT Rally by 20-25% by eliminating stalls.

Breaks piglit's spec/arb_shader_image_load_store/host-mem-barrier,
by using the GPU to do uploads, exposing a st/mesa issue where it
doesn't give us memory_barrier() calls.  This is a pre-existing issue
and will be fixed by a later patch (currently out for review).
2019-03-08 13:29:39 -08:00
Chris Wilson 04ddff1aa4 iris: Wire up EGL_IMG_context_priority
Add the missing PIPE_CAP_CONTEXT_PRIORITY_MASK and parsing of the context
construction flags.

Testcase: piglit/egl-context-priority

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-03-07 20:27:10 -08:00
Kenneth Graunke d53b1b6215 iris: Drop PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY
This cap is mainly for working around a r600 texture swizzle issue,
but it also controls whether ARB_texture_buffer_object (with legacy
formats) is enabled.  I suspect the missing I/L/A/LA faking is why
I had it set in the first place.

Thanks to Ilia for pointing out that I shouldn't be setting this.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-03-07 11:39:27 -08:00
Jose Maria Casanova Crespo 4122665dd9 iris: Enable ARB_shader_draw_parameters support
Additional VERTEX_ELEMENT_STATE are used to store basevertex and
baseinstance and drawid updating the DWordLength of the
3DSTATE_VERTEX_ELEMENTS command.

This passes all piglit tests for spec.*draw_parameters.* tests
and VK-GL-CTS KHR-GL45.shader_draw_parameters_tests.* tests.

Now we only mark a dirty_update when parameters are changed or
when we have an indirect draw.

We enable PIPE_CAP_DRAW_PARAMETERS on Iris.

There is no edge flag support in the Vertex Elements setup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-02-26 13:28:38 -08:00
Kenneth Graunke 07ec1f0b25 iris: Make an IRIS_MAX_MIPLEVELS define 2019-02-21 10:26:12 -08:00
Kenneth Graunke 8ab82bd1fd iris: Drop XXX about checking for swizzling
Caio noted that this is not necessary on Gen8+:

   "Before Gen8, there was a historical configuration control field to
    swizzle address bit[6] for in X/Y tiling modes.  This was set in
    three different places: TILECTL[1:0], ARB_MODE[5:4], and
    DISP_ARB_CTL[14:13].  For Gen8 and subsequent generations, the
    swizzle fields are all reserved, and the CPU's memory controller
    performs all address swizzling modifications."

Since we don't support earlier hardware, we can skip it entirely.
2019-02-21 10:26:12 -08:00
Andre Heider bffb65d28e iris: improve PIPE_CAP_VIDEO_MEMORY bogus value
-1 is a little too bogus for most games ;)

Signed-off-by: Andre Heider <a.heider@gmail.com>
2019-02-21 10:26:12 -08:00
Kenneth Graunke be49fb051d iris: Stop chopping off the first nine characters of the renderer string 2019-02-21 10:26:12 -08:00
Kenneth Graunke 974229df46 iris: Add PIPE_CAP_MAX_VARYINGS 2019-02-21 10:26:11 -08:00
Kenneth Graunke 4bfd12bbf7 iris: minor tidying 2019-02-21 10:26:11 -08:00
Kenneth Graunke edd3ce5a63 iris: Enable PIPE_CAP_COMPACT_ARRAYS 2019-02-21 10:26:11 -08:00
Kenneth Graunke e17333ea1e iris: fail to create screen for older unsupported HW
loader shouldn't try, but let's be paranoid
2019-02-21 10:26:11 -08:00
Kenneth Graunke 1f91f688e8 iris: Switch to the new PIPELINE_STATISTICS_QUERY_SINGLE capability
I had a hack in place earlier to pass the query type as q->index
for the regular statistics query, but we ended up adjusting the
interface and adding a new query type.  Use that instead, fixing
pipeline statistics queries since the rebase.
2019-02-21 10:26:11 -08:00
Dave Airlie 8806b29e16 iris: setup gen8 caps 2019-02-21 10:26:11 -08:00
Kenneth Graunke 68d531d7d7 iris: Destroy the bufmgr
Plugs a 12360 byte leak
2019-02-21 10:26:10 -08:00
Kenneth Graunke 3d55e9a2aa iris: Destroy transfer helper on screen teardown
Plugs a 16 byte leak
2019-02-21 10:26:10 -08:00
Kenneth Graunke 855ff47d36 iris: Enable precompiles 2019-02-21 10:26:10 -08:00
Kenneth Graunke beb2d5e065 iris: Lie about indirects
fixes interpolateAt tests
2019-02-21 10:26:10 -08:00
Kenneth Graunke b9ccb00e2c iris: Enable ctx->Const.UseSTD430AsDefaultPacking
hooray for obscurely named pipe caps with bizarre descriptions!
2019-02-21 10:26:10 -08:00
Chris Wilson f459c56be6 iris: Add fence support using drm_syncobj 2019-02-21 10:26:10 -08:00
Chris Wilson fae74234d9 iris: Tag each submitted batch with a syncobj
(adjusted by Ken to make the signalling sync object immediately on
batch reset, rather than batch finish time.  this will work better
with deferred flushes...)
2019-02-21 10:26:10 -08:00
Kenneth Graunke f4829a2fe1 iris: don't support pull constants.
I don't think it matters, we won't have any params anyway, but let's
be sure it doesn't try
2019-02-21 10:26:10 -08:00
Kenneth Graunke 80497af192 iris: Enable ARB_shader_stencil_export 2019-02-21 10:26:09 -08:00
Kenneth Graunke a9b32f2bbf iris: Fix texture buffer / image buffer sizes.
Also fix image buffers with offsets.
2019-02-21 10:26:09 -08:00
Kenneth Graunke 9fc672428d iris: little bits of compute basics 2019-02-21 10:26:09 -08:00
Kenneth Graunke 752abeb690 iris: initial compute caps
RET macro borrowed from freedreno
2019-02-21 10:26:09 -08:00
Kenneth Graunke 4da28c2c22 iris: Enable fb fetch
needed for ES 3.2
2019-02-21 10:26:09 -08:00
Kenneth Graunke be905bd461 iris: advertise GL_ARB_shader_texture_image_samples 2019-02-21 10:26:09 -08:00
Kenneth Graunke 87351b8dfe iris: force persample interp cap 2019-02-21 10:26:09 -08:00
Kenneth Graunke 90b9efc1f9 iris: stencil texturing 2019-02-21 10:26:09 -08:00
Kenneth Graunke 3c0ef22edb iris: Enable ARB_shader_vote
The easiest get out the vote campaign ever
2019-02-21 10:26:08 -08:00
Kenneth Graunke 0395eba20f iris: magic number 36 -> #define 2019-02-21 10:26:08 -08:00
Kenneth Graunke dff174c103 iris: Need to | 1 when asking for timestamps 2019-02-21 10:26:08 -08:00
Kenneth Graunke 1d91eba7dc iris: glGet timestamps, more correct timestamps 2019-02-21 10:26:08 -08:00
Kenneth Graunke dca5632de1 iris: initial query code 2019-02-21 10:26:08 -08:00
Caio Marcelo de Oliveira Filho fb4a3e2736 iris: Fix uses of gl_TessLevel*
The backend compiler expects the gl_TessLevel* variables to be mapped
as inputs instead of system values.  Use the new PIPE_CAP to get this
behavior from GLSL compiler.

Tested with:
tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
2019-02-21 10:26:08 -08:00
Kenneth Graunke 2b956a093a iris: totally untested icelake support 2019-02-21 10:26:08 -08:00
Kenneth Graunke 2d1db44e8e iris: enable ARB_enhanced_layouts 2019-02-21 10:26:08 -08:00
Kenneth Graunke 2ebce6f8c8 iris: use Eric's new caps helper
this does change a couple caps...PRIMITIVE_RESTART_FOR_PATCHES...
2019-02-21 10:26:08 -08:00
Kenneth Graunke 3e7a41f228 iris: new caps 2019-02-21 10:26:08 -08:00
Chris Wilson d209cc5170 iris: AMD_pinned_memory
(rebased by Ken, mainly set res->internal_format)
2019-02-21 10:26:08 -08:00
Kenneth Graunke 42dccb1233 iris: use consistent copyright formatting
some of them had typos, didn't say 'authors or copyright holders',
or other mistakes.  This is now https://opensource.org/licenses/MIT
text, formatted consistently.
2019-02-21 10:26:08 -08:00
Kenneth Graunke ee8cb7e0ee iris: implement ARB_clear_texture 2019-02-21 10:26:08 -08:00
Kenneth Graunke 906becec70 iris: we can do multisample Z resolves 2019-02-21 10:26:08 -08:00
Kenneth Graunke 1f156f004b iris: deal with Marek's new MSAA caps
storage sample count is equal to sample count for us, for now,
so 0 the pipe cap and ignore the new parameter
2019-02-21 10:26:08 -08:00
Kenneth Graunke 763f9095ea iris: fill out more caps 2019-02-21 10:26:08 -08:00
Kenneth Graunke dfe1ee4f6f iris: comment everything
1. Write the code
2. Add comments
3. PROFIT (or just avoid cost of explaining or relearning things...)
2019-02-21 10:26:08 -08:00
Kenneth Graunke 682aeff8d0 iris: we don't support textureGatherOffsets, need it lowered 2019-02-21 10:26:08 -08:00
Kenneth Graunke 834b97c34b iris: fix GS output component limit
this is total, so should be 1024, not 128
2019-02-21 10:26:08 -08:00
Kenneth Graunke 8da91ebb68 iris: enable texture gather 2019-02-21 10:26:08 -08:00
Kenneth Graunke b7b061c4e2 iris: fix SSBO indexing
st/nir offsets SSBO indexes by MaxABOs.  This is not what we want,
as it bloats the binding tables.  We'll need to adjust it to use
info->num_abos as the offset and buffer base instead.  For now,
just use the inefficient format to get us rolling.  We can add a
PIPE_CAP later.
2019-02-21 10:26:07 -08:00
Kenneth Graunke 376c7253f8 iris: enable SSBOs 2019-02-21 10:26:07 -08:00
Kenneth Graunke 75709d982b iris: fix TBO alignment to match 965 2019-02-21 10:26:07 -08:00
Kenneth Graunke 2c73d7e3f1 iris: expose more things that we already support 2019-02-21 10:26:07 -08:00
Kenneth Graunke a12a370d7b iris: fix EmitNoIndirect
we were using pipe stages, which are ordered dumbly for historical
reasons.  we want gl_shader_stage here.  this got us the wrong options
2019-02-21 10:26:07 -08:00
Kenneth Graunke 5e19885d5a iris: fill out MAX_PATCH_VERTICES 2019-02-21 10:26:07 -08:00
Kenneth Graunke aeb6fc8782 iris: bits of multisample program key 2019-02-21 10:26:07 -08:00
Kenneth Graunke a3f77eceb4 iris: slab allocate transfers
apparently we need this for u_threaded_context
2019-02-21 10:26:07 -08:00
Kenneth Graunke 5165308169 iris: don't crash on shader perf logs 2019-02-21 10:26:07 -08:00
Kenneth Graunke 40fd2fd603 iris: fall back to u_generate_mipmap
It just does blits between layers, which is all we'd do anyway,
and it already should use BLORP because of iris_blit().  Plus it
handles 3D, which our code in i965 doesn't.
2019-02-21 10:26:07 -08:00
Kenneth Graunke 419fac2fc6 iris: fix fragcoord ytransform
the TGSI in the name is a misnomer, it actually controls wpos_ytransform
lowering in NIR these days.
2019-02-21 10:26:07 -08:00
Kenneth Graunke e67951227d iris: Disable unsupported mirror clamp modes 2019-02-21 10:26:07 -08:00
Kenneth Graunke a7770501a7 iris: fix caps so tests run again 2019-02-21 10:26:07 -08:00
Kenneth Graunke 49f9c88801 iris: support signed vertex buffer offsets 2019-02-21 10:26:07 -08:00
Kenneth Graunke d46c5b7c6c iris: allow mapped buffers during execution (faster) 2019-02-21 10:26:06 -08:00
Kenneth Graunke 26cc609927 iris: better ubo handling 2019-02-21 10:26:06 -08:00
Kenneth Graunke 5b914a6d58 iris: caps 2019-02-21 10:26:06 -08:00
Kenneth Graunke d4a64e0a64 iris: bump GL version to 4.2 2019-02-21 10:26:06 -08:00
Kenneth Graunke 21acc00490 iris: crazy pipe control code
imported from ~kwg/mesa pcx-2, gen < 8 code dropped
2019-02-21 10:26:06 -08:00
Kenneth Graunke e4aa8338c3 iris: Soft-pin the universe
Breaks everything, woo!
2019-02-21 10:26:05 -08:00
Kenneth Graunke 902a122404 iris: stop adding 9 to our varyings 2019-02-21 10:26:05 -08:00
Kenneth Graunke 6f1c07d7dd iris: actually softpin at an address 2019-02-21 10:26:05 -08:00
Kenneth Graunke 4525dda75f iris: reworks, FS compile pieces 2019-02-21 10:26:05 -08:00
Kenneth Graunke 628a71c2e3 iris: parse INTEL_DEBUG 2019-02-21 10:26:05 -08:00
Kenneth Graunke 8097dc9dd9 iris: shader debug log 2019-02-21 10:26:05 -08:00
Kenneth Graunke 7b80f4587d iris: sampler states 2019-02-21 10:26:04 -08:00
Kenneth Graunke 2dce0e94a3 iris: Initial commit of a new 'iris' driver for Intel Gen8+ GPUs.
This commit introduces a new Gallium driver for Intel Gen8+ GPUs,
named 'iris_dri.so' after the hardware.

Developed by:
- Kenneth Graunke (overall driver)
- Dave Airlie (shaders, conditional render, overflow query, Gen8 port)
- Chris Wilson (fencing, pinned memory, ...)
- Jordan Justen (compute shaders)
- Jason Ekstrand (image load store)
- Caio Marcelo de Oliveira Filho (tessellation control passthrough)
- Rafael Antognolli (auxiliary buffer fixes)
- The rest of the i965 contributors and the Mesa community
2019-02-21 10:26:04 -08:00