Commit graph

81137 commits

Author SHA1 Message Date
Kenneth Graunke
3a886721ed i965: Silence unused variable warning
I added this when deleting some unnecessary code in a rebase.
2016-05-04 00:46:31 -07:00
Juan A. Suarez Romero
97989059b9 mesa/main: handle double uniform matrices properly
When computing the offset in the uniform storage table, take into account
the size multiplier so double precision matrices are handled correctly.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-04 08:08:12 +02:00
Samuel Iglesias Gonsálvez
2ab2d2e588 nir: Separate 32 and 64-bit fmod lowering
Split 32-bit and 64-bit fmod lowering as the drivers might need to
lower them separately inside NIR depending on the HW support.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-04 08:07:49 +02:00
Samuel Iglesias Gonsálvez
b902377a56 nir/lower_double_ops: lower mod()
There are rounding errors with the division in i965 that affect
the mod(x,y) result when x = N * y. Instead of returning '0' it
was returning 'y'.

This lowering pass fixes those cases.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-04 08:07:49 +02:00
Matt Turner
9f81434c5f i965: Define GEN_GE/GEN_LE macros in terms of GEN_LT.
GEN_LT has a straightforward implementation on which we can build the
GEN_GE and GEN_LE macros.

Suggested-by:  Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 22:34:01 -07:00
Matt Turner
affaae197f i965: Add disassembler support for remaining opcodes.
For opcodes that changed meaning on different generations, we store a
pointer to a secondary table and the table's size in a tagged union in
place of the mnemonic and number of sources.

Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 22:34:00 -07:00
Matt Turner
b89b0a03f2 i965: Make opcode_descs and gen_from_devinfo() static.
The previous commit replaced direct uses of opcode_descs with calls to
the wrapper function, which should be the only method of accessing
opcode_descs's data. As a result gen_from_devinfo() can also be made
static.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 22:34:00 -07:00
Matt Turner
0ff4912cf4 i965: Actually check whether the opcode is supported.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 22:33:59 -07:00
Matt Turner
667408b889 i965: Merge inst_info and opcode_desc tables.
I merged opcode_desc into inst_info (instead of the other way around)
because inst_info was sorted by opcode number.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 22:33:42 -07:00
Matt Turner
d01596613b i965: Move inst_info from brw_eu_validate.c to brw_eu.c.
Drop the uses of 'enum gen' to a plain int, so that we don't have to
expose the bitfield definitions and GEN_GE/GEN_LE macros to other users
of brw_eu.h. As a result, s/.gen/.gens/ to avoid confusion with
devinfo->gen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 22:33:42 -07:00
Francisco Jerez
1530e27534 i965/disasm: Wrap opcode_desc look-up in a function.
The function takes a device info struct as argument in addition to the
opcode number in order to disambiguate between multiple opcode_desc
entries for different instructions with the same opcode number.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> [v1]

[v2] mattst88: Put brw_opcode_desc() in brw_eu.c instead of moving it
               there in a later patch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v2]
[v3] mattst88: Return NULL if opcode >= ARRAY_SIZE(opcode_descs)
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-03 22:32:40 -07:00
Francisco Jerez
1cc7573162 i965: Pass devinfo pointer to is_3src() helpers.
This is not strictly required for the following changes because none
of the three-source opcodes we support at the moment in the compiler
back-end has been removed or redefined, but that's likely to change in
the future.  In any case having hardware instructions specified as a
pair of hardware device and opcode number explicitly in all cases will
simplify the opcode look-up interface introduced in a subsequent
commit, since the opcode number alone is in general ambiguous.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 18:06:21 -07:00
Francisco Jerez
c55dc77ab1 i965: Pass devinfo pointer to brw_instruction_name().
A future series will implement support for an instruction that happens
to have the same opcode number as another instruction we support
already on a disjoint set of hardware generations.  In order to
disambiguate which instruction it is brw_instruction_name() will need
some way to find out which device we are generating code for.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-05-03 18:06:21 -07:00
Kenneth Graunke
7d9143ad88 i965: Write a scalar TCS backend that runs in SINGLE_PATCH mode.
Unlike most shader stages, the Hull Shader hardware makes us explicitly
tell it how many threads to dispatch and manually configure the channel
mask.  One perk of this is that we have a lot of flexibility - we can
run it in either SIMD4x2 or SIMD8 mode.

Treating it as SIMD8 means that shaders with 8 or fewer output vertices
(which is overwhemingly the common case) can be handled by a single
thread.  This has several intriguing properties:

- Accessing input arrays with gl_InvocationID as the index is a simple
  SIMD8 URB read with g1 as the header.  No indirect addressing required.
- Barriers are no-ops.
- We could potentially do output shadowing to combine writes, as the
  concurrency concerns are gone.  (We don't do this yet, though.)

v2: Drop first_non_payload_grf change, as it was always adding 0
    (caught by Jordan Justen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-03 16:28:00 -07:00
Kenneth Graunke
75881bed9e i965: Rework the TCS passthrough shader to use NIR.
I'm about to implement a scalar TCS backend, and I'd rather not
duplicate all of this code there.

One change is that we now write the tessellation levels from all
TCS threads, rather than just the first.  This is pretty harmless,
and was easier.  The IF/ENDIF needed for that are gone; otherwise
the generated code is basically identical.

I chose to emit load/store intrinsics directly because it was easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-03 16:27:52 -07:00
Brian Paul
ef5a31fc06 gallium/util: change assertion to conditional in util_bitmask_destroy()
If we fail to create a context in the VMware driver we call this function
unconditionally to free a bunch of bit vectors.  Instead of asserting on
a null pointer, just no-op.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-05-03 15:40:49 -06:00
Brian Paul
68116dcd5a cso: null-out previously bound sampler states
If, for example, we previously had 2 sampler states bound and now we
are binding one, we'd leave the second sampler state unchanged.
This change nulls-out the second sampler state in this situation.
We're already doing the same thing for sampler views.

This silences an occasional warning issued by the VMware driver when
the number of sampler views and sampler states disagreed.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-03 15:40:49 -06:00
Brian Paul
05abaa65c7 svga: try to flag surfaces for sampling, in addition to rendering
This silences some warnings when we try to sample from surfaces that were
created for drawing, such as when blitting from one of the framebuffer
surfaces.  We were already doing the opposite situation (adding a bind
flag for rendering to surfaces declared as texture sources).

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-05-03 15:40:48 -06:00
Brian Paul
abc6432d54 svga: fix copying non-zero layers of 1D array textures
Like cube maps, we need to convert the z information to a layer index.
Also rename the *_face vars to *_face_layer to make things a little more
understandable.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-05-03 15:40:48 -06:00
Brian Paul
b94f73c150 svga: clean up svga_pipe_blit.c
Remove dead code.  Fix formatting.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-05-03 15:40:48 -06:00
Brian Paul
8842be1132 rbug: s/Elements/ARRAY_SIZE/
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-05-03 15:40:48 -06:00
Brian Paul
7f641916bf freedreno: s/Elements/ARRAY_SIZE/
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-05-03 15:40:48 -06:00
Brian Paul
b91975714d trace: s/Elements/ARRAY_SIZE/
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-05-03 15:40:48 -06:00
Brian Paul
e193c5dd59 ilo: s/Elements/ARRAY_SIZE/
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-05-03 15:40:48 -06:00
Brian Paul
951bf8b4a6 i915g: s/Elements/ARRAY_SIZE/
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-05-03 15:40:48 -06:00
Samuel Pitoiset
5658ddc7fe nvc0: compute a percentage for metric-achieved_occupancy
metric-issue_slot_utilization and metric-branch_efficiency are already
computed as percentages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2016-05-03 23:18:50 +02:00
Samuel Pitoiset
10ec27760a nvc0: display some performance metrics with a percentage
This makes more sense for them.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2016-05-03 23:18:50 +02:00
Samuel Pitoiset
64937615a0 nvc0: store the driver query type for performance metrics
This will allow to use percentages for some metrics because the Gallium
HUD doesn't allow to display floating point numbers and 0 is printed
instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2016-05-03 23:18:50 +02:00
Samuel Pitoiset
a9bc3211f5 nvc0: fix exposing of metric-issue_slots for SM21/SM30
This is most likely a copy-paste error when I reworked this area few
weeks ago. For SM20, metric-issue_slots is equal to inst_issued because
there is only one pipeline, so the metric is not exposed there.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reported-by: Karol Herbst <nouveau@karolherbst.de>
2016-05-03 23:18:50 +02:00
Mark Janes
0af8a7d50c mesa/objectlabel: handle NULL src string
This prevents a crash when a NULL src is passed with a non-NULL length.

fixes: dEQP-GLES31.functional.debug.object_labels.query_length_only
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95252

Signed-off-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-03 14:07:31 -07:00
Dave Airlie
265fe9dce8 glsl: subroutine types cannot be used in constructors.
This fixes two of the cases in
GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04 06:44:45 +10:00
Dave Airlie
3110a0aa23 glsl: resource is a reserved keyword in GLSL 4.20 as well
resource just appears in GLSL 4.20 without any fanfare.

Fixes GL43-CTX.CommonBugs.CommonBug_ReservedNames

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04 06:44:45 +10:00
Jan Vesely
ebbe31d57c gallium,utils: Fix trivial sign compare warnings
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Jakob Sinclair <sinclair.jakob@openmailbox.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-05-03 12:00:09 -04:00
Knut Andre Tidemann
c68a9cdaac anv: fix hang during generation of dev_icd.json.
Fixes: b370ec7c76 ("anv: tweak the %.json rule")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-03 11:42:47 +01:00
Anuj Phogat
883f3662db swrast: Add texfetch_funcs entries for astc 3d formats
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
63432eb370 mesa: Enable translation between astc 3d gl formats and mesa formats
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
54cac7ad96 mesa: Handle astc 3d formats in _mesa_get_compressed_formats()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
dcfea1d7eb mesa: Handle astc 3d formats in _mesa_base_tex_format()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
cf85ef1618 mesa: Account for astc 3d formats in _mesa_is_astc_format()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
38cd8145a8 mesa: Add a helper function is_astc_3d_format()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
72dfe0242d mesa: Add the missing defines for GL_OES_texture_compression_astc
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
57451e0fc1 mesa: Align the values of #define's in glheader.h
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
0306110fa9 mesa: Add OES_texture_compression_astc to extension table and gl_extensions
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
059f36c671 mesa: Add entries for astc 3d formats initializing struct gl_format_info
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
705216dbed mesa: Add mesa formats for astc 3d formats
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
24bb6ee8b6 glapi: Update dispatch XML files for OES_texture_compression_astc.xml
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
63a7a9d115 mesa: Account for block depth in _mesa_format_image_size()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
87bf66daa9 mesa: Handle 3d block sizes in _mesa_compute_compressed_pixelstore
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
84a44844f2 mesa: Handle 3d block sizes in teximage error checks
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00
Anuj Phogat
ec60b3da69 mesa: Handle 3d block sizes in getteximage error checks
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-03 03:43:18 -07:00