Commit Graph

112963 Commits

Author SHA1 Message Date
Bas Nieuwenhuizen 45b73b3aa9 radv/gfx10: Do not allocate a gs_copy_shader on gfx10.
Will use ngg for any gs anyway.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-07-11 15:45:47 +02:00
Samuel Pitoiset ef5efb40f4 radv/gfx10: fix VGT_SHADER_STAGES_EN for GS as NGG
The driver shouldn't set the copy shader bit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-11 15:45:43 +02:00
Samuel Pitoiset 8bc3ab6f0c radv/gfx10: fix number of GS invocations for NGG
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-11 15:45:40 +02:00
Tomeu Vizoso 812ce2ce9e panfrost/midgard: Use _safe iterator
Fixes this assertion:

../mesa/src/panfrost/midgard/midgard_schedule.c:507:schedule_block: Assertion `ins == __next && "use _safe iterator"' failed.
Trace/breakpoint trap

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-11 15:06:51 +02:00
Tomeu Vizoso 82ee48e5ef panfrost: Place the height value in the height field
In the mali_single_framebuffer descriptor.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>

v2: Remove unwanted chunks
2019-07-11 15:06:47 +02:00
Samuel Pitoiset 022b1f4190 radv/gfx10: fix maximum number of mip levels for 3D images
The dimensions also have to be adjusted if the number of supported
mip levels is changed.

This fixes dEQP-VK.api.info.image_format_properties.3d.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-11 14:44:47 +02:00
Samuel Pitoiset f3dfdd4091 radv/gfx10: disable TC-compat HTILE for multisampled D32_SFLOAT format
For some reasons D32_SFLOAT is also affected on GFX10, it works
fine with previous generations.

This fixes some dEQP-VK.renderpass2.depth_stencil_resolve.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-11 13:43:21 +02:00
Kenneth Graunke a01770b9c8 iris: Fix key->input_vertices for 8_PATCH TCS mode.
We were failing to flag the program dirty when it changed.  Also, we
were unnecessarily setting key->input_vertices for SINGLE_PATCH mode,
which would reduce program cache hits.  Only set it if needed.
2019-07-11 01:18:24 -07:00
Kenneth Graunke c58f52f0ef iris: Only set key->flat_shade if COL0/COL1 are written.
This was just laziness on my part, we already added similar checks in
the VS key handling.  Just need to do it here too.  Should improve cache
hits.
2019-07-11 00:12:50 -07:00
Kenneth Graunke cb82d534a0 iris: Drop comment about var->data.binding not being set.
I refactored the sampler lowering passes a long time ago to ensure
that gl_nir_lower_samplers_as_deref is run and var->data.binding is set.
2019-07-11 00:12:00 -07:00
Kenneth Graunke 38f9954208 iris: Drop comments about missing NOS
These stages don't need NOS.  If they do, we can add it - the
infrastructure is there if we need it someday.
2019-07-11 00:12:00 -07:00
Kenneth Graunke 2bd1234a77 iris: Drop a TODO comment
This is literally implemented two lines above.
2019-07-11 00:12:00 -07:00
Neil Roberts eae06b34ea glsl/builtin types: Set the precision on the depth range params
The members of gl_DepthRangeParameters are declared to be highp in
GLSL ES specs.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-07-11 08:04:54 +02:00
Neil Roberts 74d71dac20 glsl: Add a constructor for glsl_struct_field to specify the precision
Adds a third constructor to glsl_struct_field which has an extra
parameter to specify the precision.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-07-11 08:04:54 +02:00
Neil Roberts 014be60398 glsl: Add a macro for the default values for glsl_struct_field
There are two constructors for glsl_struct_field with different
parameters. Instead of repeating them for both constructors, this
patch adds a convenience macro. This will make it easier to add a
third constructor in a later patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-07-11 08:04:54 +02:00
Neil Roberts ca6ee488e9 glsl/builtin_variables: Add a precision to the builtins
All of the builtin variables mentioned in the GLSL ES spec and the
extensions include a precision declaration which is different
depending on what the variable is used for. This patch makes it set
the corresponding precision when creating the variable. This will make
a difference once we start using the precision information for
optimisation. Previously all of the builtin variables ended up with a
precision of NONE.

v2: Made gl_PointSize and gl_FragCoord highp since GLSL ES 3.00. Fixed
    gl_MaxViewPorts to always be highp. (Eric Anholt)

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-07-11 08:04:54 +02:00
Kenneth Graunke ce93bf1876 compiler: Save a single copy of the softfp64 shader in the context.
We were recompiling the softfp64 library of functions from GLSL to NIR
every time we compiled a shader that used fp64.  Worse, we were ralloc
stealing it to the GL context.  This meant that we'd accumulate lots of
copies for the lifetime of the context, which was a big space leak.

Instead, we can simply stash a single copy in the GL context, and use
it for subsequent compiles.  Having a single copy should be fine from
a memory context point of view: nir_inline_function_impl already clones
the necessary nir_function_impl's as it inlines.

KHR-GL45.enhanced_layouts.ssb_member_align_non_power_of_2 was previously
OOM'ing a system with 16GB of RAM when using softfp64.  Now it finishes
much more quickly and uses only ~200MB of RAM.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2019-07-10 22:14:36 -07:00
Timothy Arceri ae4ccb67be radv: fix memory leak when restoring from cache
Fixes: 726a31df70 ("radv: Add the concept of radv shader binaries.")

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-07-11 10:44:29 +10:00
Kristian H. Kristensen e03259974e freedreno: Generate headers from xml files
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Rob Clark <robdclark@gmail.com>
2019-07-10 22:05:02 +00:00
Samuel Pitoiset 51e2124a4b radv: switch to the new VS exports path
It will help for GS as NGG on GFX10.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-10 23:37:02 +02:00
Samuel Pitoiset f616d80a7a radv: set the slot_index correctly for VARYING_SLOT_CLIP_DIST1
For selecting a different SQ_EXP_POS target.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-10 23:36:59 +02:00
Samuel Pitoiset c4ab33378a radv: add a new function for exporting VS outputs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-10 23:36:57 +02:00
Samuel Pitoiset ac0edc369c radv: implement new path for exporting generic varyings
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-10 23:36:55 +02:00
Samuel Pitoiset 0b368fc8c3 radv: use the generic export path for clip/cull distances
When they are exported to the next stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-10 23:36:52 +02:00
Samuel Pitoiset f653e5c1d6 radv: remove an extra memcpy when exporting clip/cull distances
Cleanup.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-07-10 23:36:50 +02:00
Jason Ekstrand 14781e2122 intel/compiler: Add a "base class" for program keys
Right now, all keys have two things in common: a program string ID and a
sampler_prog_key_data.  I'd like to add another thing or two and need a
place to put it.  This commit adds a new brw_base_prog_key struct which
contains those two common bits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-07-10 19:35:55 +00:00
Jason Ekstrand 3a4667e502 i965/program_cache: Cast the key to char * before adding key_size
We're about to change the type of key to be brw_base_prog_key and that
will mean blindly adding the key size without a cast will lead to the
wrong calculation.  It's safer to cast to char * first anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-07-10 19:35:55 +00:00
Jason Ekstrand bb14abed18 anv: Make the workaround BO a whole page
I'm not 100% sure how this ever worked because gem_create usually shoots
you if the BO size isn't page-aligned.

Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-07-10 19:35:23 +00:00
Jason Ekstrand 6a2ff217b8 anv: Set Stateless Data Port Access MOCS
This is the MOCS setting used for the A64 stateless messages which we
sometimes use for SSBO operations.

Fixes: 48ed2a7bb0 "anv: Implement VK_EXT_buffer_device_address"
Fixes: 79fb0d27f3 "anv: Implement SSBOs bindings with GPU addr..."
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-07-10 19:35:23 +00:00
Alyssa Rosenzweig bb483a9166 panfrost: Clamp point size
It's not clear the hardware really has a maximum which confuses dEQP;
clamp to whatever we report as our maximum.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 11:30:00 -07:00
Alyssa Rosenzweig 7318b525a2 pan/decode: Auto style
$ astyle *.c *.h --style=linux -s8

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Alyssa Rosenzweig ec2a59cd7a panfrost: Move non-Gallium files outside of Gallium
In preparation for a Panfrost-based non-Gallium driver (maybe
Vulkan...?), hoist everything except for the Gallium driver into a
shared src/panfrost. Practically, that means the compilers, the headers,
and pandecode.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Alyssa Rosenzweig a2d0ea92ba panfrost: Style main Gallium driver
$ astyle *.c *.h --style=linux -s8

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Alyssa Rosenzweig e4bd6fbe51 panfrost/midgard: Apply code styling
$ astyle *.c *.h --style=linux -s8

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Alyssa Rosenzweig b4733b2b61 panfrost/nir: Apply NIR style
$ astyle *.c *.h --style=linux -s3

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Alyssa Rosenzweig c2c8983cf4 panfrost: Move midgard/nir* to nir folder
The reason for doing this is two-fold:

   1. These passes are likely to be shared with the Bifrost compiler
      Therefore, we don't want to restrict them to Midgard

   2. The coding style is different (NIR-style vs Panfrost-style)
      The NIR passes are candidates for moving upstream into
      compiler/nir, so don't block that off for stylistic reasons

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 10:43:23 -07:00
Alyssa Rosenzweig ef2d577769 panfrost: Typofix
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 09:45:16 -07:00
Alyssa Rosenzweig 31fc52a4e7 panfrost: Identify shared tiler structure
This is identical across SFBD/MFBD so pull it out to allow for better
code sharing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 09:45:16 -07:00
Alyssa Rosenzweig 6eb99c78e2 panfrost/midgard: Drop unnecessary assert
Just use the #define instead.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-07-10 09:37:08 -07:00
Alyssa Rosenzweig c1b109caec panfrost: Don't expose OES_standard_derivatives
This has not been implemented quite yet.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 09:36:03 -07:00
Erik Faye-Lund 39e7fbf24a gallium: get rid of PIPE_CAP_SM3
PIPE_CAP_SM3 has always been an odd one out of all our caps. While most
other caps are fine-grained and single-purpose, this cap encode several
features in one. And since OpenGL cares more about single features, it'd
be nice to get rid of this one.

As it turns, this is now relatively simple. We only really care about
three features using this cap, and those already got their own caps. So
we can remove it, and make sure all current drivers just give the same
response to all of them.

The only place we *really* care about SM3 is in nine, and there we can
instead just re-construct the information based on the finer-grained
caps. This avoids DX9 semantics from needlessly leaking into all of the
drivers, most of who doesn't care a whole lot about DX9 specifically.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 15:50:51 +02:00
Erik Faye-Lund 21de1bf24b gallium: give vertex-shader saturate its own cap
Shader Model 3.0 is a big promise to make to the state-tracker, and
for instance mobile hardware might support vertex-shader saturate but
not some of the other features of SM3. So let's give this its own cap
for simplicity.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-10 15:49:57 +02:00
Erik Faye-Lund 681fa03e8d gallium: give fragment-shader derivatives its own cap
Shader Model 3.0 is a big promise to make to the state-tracker, and
for instance mobile hardware might support fragment-shader derivatives
but not some of the other features of SM3. So let's give this its own
cap for simplicity.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-10 15:49:57 +02:00
Erik Faye-Lund 66ee6661e9 gallium: give fragment-shader texture-lod its own cap
Shader Model 3.0 is a big promise to make to the state-tracker, and
for instance mobile hardware might support texture lod but not some
of the other features of SM3. So let's give this its own cap for
simplicity.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-10 15:49:57 +02:00
Erik Faye-Lund ffbd004686 mesa/st: drop needless has_shader_model3 boolean
This boolean is only consulted once during init, so there's nothing
much saved by storing this in the context. So let's just check directly
when we need it instead.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-10 15:49:57 +02:00
Alyssa Rosenzweig af2949e928 panfrost: Fix copyright identifier in a few places
Oops.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-07-10 06:47:15 -07:00
Alyssa Rosenzweig 629c516b76 panfrost: Bikeshed pan_screen.c comment
The asterisks were inherited from... softpipe, maybe?

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-07-10 06:47:13 -07:00
Alyssa Rosenzweig 2f7145a6de panfrost: Check GPU version before loading
Panfrost is known to only work on a select few CPU/GPU combinations at
the moment (tested system-on-chips: RK3288, RK3399, and S912). Whitelist
the combinations known to work and refuse to load on others where
nothing works yet to avoid user confusion.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-07-10 06:47:11 -07:00
Alyssa Rosenzweig b5de423ac1 panfrost: Be more honest about PIPE_CAPs
A lot of the pan_screen.c code was cargoculted from other drivers. The
upshot is that we return true for a lot of PIPE_CAPs that we don't
actually support, resulting in us exposing way too many extensions that
we don't actually support. Be more careful.

Some CAPs we do need to fake to access higher dEQP versions (i.e. in
order to debug the features we're hiding behind the CAP). For these, we
hide the CAP behind a special PAN_MESA_DEBUG=deqp option to avoid
apps randomly using these in-development features.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-07-10 06:47:01 -07:00
Alyssa Rosenzweig b69d5d6e19 panfrost/midgard: Hit missed scheduling opportunity
Don't try to schedule to vmul when that can't possible work (forcing a
bundle break). glmark:

total bundles in shared programs: 2700 -> 2683 (-0.63%)
bundles in affected programs: 695 -> 678 (-2.45%)
helped: 14
HURT: 0
helped stats (abs) min: 1 max: 4 x̄: 1.21 x̃: 1
helped stats (rel) min: 1.27% max: 7.69% x̄: 4.30% x̃: 4.77%
95% mean confidence interval for bundles value: -1.68 -0.75
95% mean confidence interval for bundles %-change: -5.63% -2.97%
Bundles are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-07-10 06:45:20 -07:00