Commit Graph

75 Commits

Author SHA1 Message Date
Kenneth Graunke
e628095b9a iris: fix comment location 2019-02-21 10:26:10 -08:00
Kenneth Graunke
1b1ea23766 iris: Fix VIEWPORT/LAYER in stream output info
Fixes glsl-1.50-transform-feedback-builtins and
ext_transform_feedback-builtin-varyings gl_PointSize
2019-02-21 10:26:10 -08:00
Kenneth Graunke
1b69b14c2a iris: Fix SLM
Now that Jason has set up the L3 we can do this.  Also, my assert was
useless because we hadn't set up the field in the first place.  Oops.
2019-02-21 10:26:10 -08:00
Kenneth Graunke
8545e39808 iris: Fix TCS/TES slot unification
TCS outputs, TES inputs...not TCS inputs

Fixes some barrier tests
2019-02-21 10:26:10 -08:00
Kenneth Graunke
e11c497fc6 iris: fix sysval only binding tables 2019-02-21 10:26:10 -08:00
Kenneth Graunke
1b5d35319e iris: don't trip on param asserts
I'd rather not rewrite i965's compute system value handling right now :(
2019-02-21 10:26:10 -08:00
Kenneth Graunke
911f9e8f3f iris: regather info so we get CLIP_DIST slots, not CLIP_VERTEX 2019-02-21 10:26:09 -08:00
Kenneth Graunke
1ef68d77c0 iris: drop iris_setup_push_uniform_range
it doesn't do anything, we have no params.  I guess I thought there
would be some, but they all get dead code eliminated even if we try
to make them exist in the first place.
2019-02-21 10:26:09 -08:00
Kenneth Graunke
7eeb124c02 iris: fix more uniform setup 2019-02-21 10:26:09 -08:00
Kenneth Graunke
c60ce3f4fd iris: bypass params and do it ourselves
the backend keeps dead code eliminating them all, so we can't do that,
plus we don't want to because params[] is lame
2019-02-21 10:26:09 -08:00
Kenneth Graunke
78fc760bab iris: dodge backend UCP lowering 2019-02-21 10:26:09 -08:00
Kenneth Graunke
deb6d588a6 iris: fix system value remapping 2019-02-21 10:26:09 -08:00
Kenneth Graunke
2b0a2915dc iris: hook up key stuff for clip plane lowering 2019-02-21 10:26:09 -08:00
Kenneth Graunke
2876dd1a37 iris: lower user clip planes 2019-02-21 10:26:09 -08:00
Kenneth Graunke
80c856cbee iris: only bother with params if there are any... 2019-02-21 10:26:09 -08:00
Kenneth Graunke
2186d83185 iris: fill out params array with built-ins, like clip planes 2019-02-21 10:26:09 -08:00
Kenneth Graunke
ecb28b2802 iris: drop unnecessary param[] setup from iris_setup_uniforms
the backend just considers these dead anyway
2019-02-21 10:26:09 -08:00
Kenneth Graunke
e98cf9c24b iris: Clone the NIR
The backend compiler used to do this for us, but after a rebase, it's
now the driver's responsibility.  This lets us alter it for say, clip
vertex lowering, at the global level rather than the per-variant level.
2019-02-21 10:26:09 -08:00
Kenneth Graunke
4d219b0eb3 iris: implement scratch space!
we borrow the approach from anv rather than i965, as it works better
with pre-baked state that needs to contain scratch BO addresses

fixes a bunch of varying packing tests
2019-02-21 10:26:09 -08:00
Kenneth Graunke
5bd49a47b6 iris: flag CC_VIEWPORT when changing num viewports
this also has a loop over num_viewports
2019-02-21 10:26:09 -08:00
Jordan Justen
b35c8f2182 iris/compute: Push subgroup-id
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2019-02-21 10:26:09 -08:00
Jordan Justen
ea416d0b5d iris/program: Don't try to push ubo ranges for compute
We only can push constants for compute shaders from one range.

Gallium glsl-to-nir (src/mesa/state_tracker/st_glsl_to_nir.cpp) lowers
all uniform accesses to a ubo.

Unfortunately we also load the subgroup-id as a uniform in the
compiler. Since we use the 1 push range for this subgroup-id, we then
lose the ability to actually push the ubo with all the normal user
uniform values.

In other words, there is lots of room for performance improvement, but
at least retrieving the uniforms as pull-constants is functional for
now.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
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
Jordan Justen
6441e906e8 iris: Set num_uniforms in bytes
Ref: brw_nir_lower_uniforms, type_size_scalar_bytes

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2019-02-21 10:26:09 -08:00
Kenneth Graunke
c29fd34259 iris: move images next to textures in binding table 2019-02-21 10:26:09 -08:00
Kenneth Graunke
0d9c5b4e7e iris: null for non-existent cbufs
prevents BTs from being shifted down incorrectly
2019-02-21 10:26:09 -08:00
Kenneth Graunke
5d1dadfc38 iris: bother with BTIs 2019-02-21 10:26:09 -08:00
Kenneth Graunke
26a54ae4b2 iris: lower storage image derefs 2019-02-21 10:26:09 -08:00
Kenneth Graunke
e97a24da89 iris: set the binding table size
we weren't doing mark_surface_used on images (i965 does it while
uploading the unnecessary image uniforms), so our binding tables were
too small...
2019-02-21 10:26:09 -08:00
Kenneth Graunke
30c370ed4b iris: use 0 for TCS passthrough program string ID
the passthrough shader doesn't need a real program string ID - that's
basically used for ARB programs indicating total program source code
changes, or other pre-baked uniform changes, etc...none of which a
passthrough shader has...so we don't need a unique identifier to
distinguish them.  We want to use a consistent value so we find
existing passthrough shaders in the cache.
2019-02-21 10:26:08 -08:00
Caio Marcelo de Oliveira Filho
54e23442e2 iris: Add support for TCS passthrough
If no TCS is provided, create a "passthrough" TCS that will take the
default values set in the API as constants and pass to the TES, along
with any other inputs it expects.  The code to create the NIR shader
is the same as in i965.

Tested with

    ./piglit run -t 'tess' quick_shader r

and fixed a dozen crashes from that list.
2019-02-21 10:26:08 -08:00
Kenneth Graunke
58a6c99ebe iris: silence const warning
not sure why this is labeled const, I'm pretty sure we are taking the
reference and owning this, so there's no particular reason we can't
change it.  it certainly seems to be working for non-compute.  and,
freedreno's ir3_shader.c seems to do this as well.  still...gross :/
2019-02-21 10:26:08 -08:00
Kenneth Graunke
897f8d9232 iris: refactor program CSO stuff 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
2bd7d6fa71 iris: last VUE map NOS, handle > 16 FS inputs
not sure if the UNCOMPILED_FS flagging is still needed, should
reevaluate those hacks at some point
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
e990558152 iris: drop pipe_shader_state
looking at the freedreno code, this is totally unnecessary!  we can just
store the NIR and be happy, and not have any vestiges of TGSI.

plus we can reuse this structure for compute shaders, without needing a
pipe_compute_state base.
2019-02-21 10:26:08 -08:00
Kenneth Graunke
77b9219818 iris: unbind compiled shaders if none are present
avoids the case where you have a stale compiled shader bound, but no
uncompiled shader bound, which is not just boats, but an entire marina
2019-02-21 10:26:07 -08:00
Kenneth Graunke
541cb60e7e iris: export get_shader_info 2019-02-21 10:26:07 -08:00
Kenneth Graunke
5bd861de8b iris: assert about passthrough shaders to make this easier to detect
otherwise it just silently fails and looks like some obscure problem
2019-02-21 10:26:07 -08:00
Kenneth Graunke
ebb960c6d3 iris: compile a TCS...don't bother with passthrough yet 2019-02-21 10:26:07 -08:00
Kenneth Graunke
9aa8be3d8e iris: TES program key inputs 2019-02-21 10:26:07 -08:00
Kenneth Graunke
6e7e49cc4f iris: fix crash 2019-02-21 10:26:07 -08:00
Kenneth Graunke
841fc3e3ca iris: record FS NOS 2019-02-21 10:26:07 -08:00
Kenneth Graunke
d223b316ad iris: NOS mechanics 2019-02-21 10:26:07 -08:00
Kenneth Graunke
a6d480f892 iris: bind state helper function 2019-02-21 10:26:07 -08:00
Kenneth Graunke
48b826cdaf iris: s/hwcso/state/g 2019-02-21 10:26:07 -08:00
Kenneth Graunke
dc3b927e97 iris: bother setting program_string_id...
not sure how useful this really is...

./bin/ext_transform_feedback-tessellation triangles flat_first
is hitting a case where we rebind the same VS program, but with
different streamout info...which isn't in the key...but is in the
cache...so we don't rebuild it...
2019-02-21 10:26:07 -08:00
Kenneth Graunke
cef0b8b13b iris: streamout 2019-02-21 10:26:07 -08:00
Kenneth Graunke
5c00f5fdca iris: Implement 3DSTATE_SO_DECL_LIST 2019-02-21 10:26:07 -08:00