Commit Graph

61525 Commits

Author SHA1 Message Date
Rob Clark 141ae71671 freedreno/a3xx: add shader variants
Start putting in place infrastructure to deal with multiple shader
variants.  Initially we'll use this for two sided color (frag) and
binning pass (vert) shaders.  Possibly need for others later (such
as YUV vs RGB eglImage?).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark 9bbfae6265 freedreno/a3xx/compiler: collapse nop's with repeat
Easier than making more extensive use of rpt, and the more compact
shaders seem to bring some bit of performance boost.  (Perhaps repeat
flag benefits are more than just instruction cache, possibly it saves
on instruction decode as well?)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark bb255fdf06 freedreno/a3xx: drop hand-coded blit/solid shaders
Instead in the common code, construct these shaders from TGSI.  For now
we let a2xx keep it's hand coded shaders, as it's compiler isn't quite
up to the job yet.  All the same it is a net drop in code size and gets
rid of special cases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark 1c953b7cda freedreno/lowering: cleanup api
Make things configurable, and tweak the API a bit to avoid an extra
tgsi_shader_scan().  Getting closer to something generic which can be
moved out of freedreno and shaderd by other drivers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark 67cea4b32a freedreno/a3xx: add float 16 and 32bit formats
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark e819885b99 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Emil Velikov f92fbba11b glx/drisw: use the implemented version of __DRIswrastLoaderExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov f6537d0608 glx/dri: use the implemented version of __DRIdamageExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov ef342aad80 glx/dri_common: use the implemented version of __DRIsystemTimeExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov fbbf5ec471 glx/dri: use the implemented version of __DRIgetDrawableInfoExtension
... over the one provided by the headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov 15db8c0801 dri_util: use the implemented version of __DRIimageDriverExtension
... over the one provided by the headers.

Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov e9eb3ec331 glx/dri3: set the implemented version of __DRIimageLoaderExtension
... over the one provided by the spec.
Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov 4e229a6e86 gbm: explicitly set __DRIimageLoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov 9e627ccc0d egl/wayland: explicitly set __DRIimageLoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov 73b35b913e drivers/dri: explicitly set __DRI2flushExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov 8b45bc0ad5 gbm: explicitly set __DRIdri2LoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov 92273962f5 glx/dri2: set the implemented version of __DRIdri2LoaderExtension
... over the version number provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov 6dffab2092 dri_interface: note introduction of __DRIdri2LoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov c9fff0740e dri_interface: note introduction of various __DRItexBufferExtension members
Note the member function releaseTexBuffer was added without
bumping spec version, and currently no drivers implement it.

v2: releaseTexBuffer was introduced by version 3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov acf2fae64e dri_interface: Note the version introducing __DRIswrastLoaderExtensionRec::putImage2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov 13e5daf2da dri_util: explicitly set __DRIcopySubBufferExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:15 +00:00
Emil Velikov 01814734e6 dri_util: explicitly set __DRIswrastExtension members.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:15 +00:00
Kenneth Graunke 5e639a5f59 glsl: Pass stdout to _mesa_print_ir from st_glsl_to_tgsi.
Fixes the Gallium build since commit 1e3bd9f9a5.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75389
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-22 22:10:11 -08:00
Eric Anholt 83daa88035 i965: Move the remaining driver debug over to stderr.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt a76e5dce4f i965: Move compiler debugging output to stderr.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt 1e3bd9f9a5 glsl: Add a file argument to the IR printer.
While we want to be able to print to stdout for glsl_compiler, for
debugging drivers we want to be able to dump to stderr because that's
where other driver debug (like LIBGL_DEBUG) tends to go, and because some
apps actually close stdout to shut up their own messages (such as the X
Server, or NWN).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt f28c920865 i965: Refactor debug dumping of GLSL IR.
This was only going to get worse when tesselation shows up, and was
causing too much extra duplication in my stderr changes coming up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt 9ac9d133ed intel: Remove some dead code I noticed in intel_screen.c.
It was present in the initial i915tex import.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt fdcf6c8fad i965: Use the object label when available for INTEL_DEBUG=vs,gs,fs output.
Note that this requires updated run.py in shader_db.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt f474ced0d1 i965: Use the object label when available for shader_time output.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt 0e2c7e2f6e meta: Set some object labels on our meta shaders.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Ilia Mirkin 6152ba0894 nv50: make sure to clear _all_ layers of all attachments
Unfortunately there's only one RT_ARRAY_MODE setting for all
attachments, so clears were previously truncated to the minimum number
of layers any attachment had. Instead set the RT_ARRAY_MODE to 512 (the
max number of layers) before doing the clear. This fixes
gl-3.2-layered-rendering-clear-color-mismatched-layer-count.

Also fix clears of individual layered rt/zeta, in case it ever happens.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-22 18:42:31 -05:00
Chia-I Wu d5cbd73d21 ilo: fix and enable fast depth clear
Use tex->bo_format instead of zs->format in ilo_blitter_rectlist_clear_zs()
because the latter may be combined depth/stencil format.  hiz_can_clear_zs()
is no-op for GEN7+, but move the GEN check so that the assertions are tested.

Finally, call the fast depth clear function from ilo_clear().
2014-02-22 22:45:13 +08:00
Chia-I Wu f57bddc7e4 ilo: add slice clear value
It is needed for 3DSTATE_CLEAR_PARAMS, and can also be used to track what
value the slice has been cleared to.
2014-02-22 22:45:13 +08:00
Chia-I Wu 4afb8a7fb5 ilo: better readability and doc for texture flags
Improve comments for the flags, and explicitly separate their uses in slice
flags and resolve flags.
2014-02-22 22:45:13 +08:00
Chia-I Wu cb8a0d2be1 ilo: fix for stencil only rectlist ops
3DSTATE_STENCIL_BUFFER inherits some states from 3DSTATE_DEPTH_BUFFER.  We
need to emit both even the surface is stencil only.
2014-02-22 22:45:13 +08:00
Chia-I Wu 409add30b3 ilo: fix a false assertion failure on GEN6
Layer offsetting is possible when it is level 0, layer 0.
2014-02-22 22:45:12 +08:00
Chia-I Wu e7307fe708 ilo: pipe_texture::usage is not a bitfield
It happens to work because PIPE_USAGE_STAGING is 0x100.
2014-02-22 22:45:12 +08:00
Chia-I Wu f8d19a58dc ilo: set ILO_TEXTURE_CPU_WRITE for imported textures
Assume the bo has been written by another process, which will trigger a HiZ
resolve.
2014-02-22 22:45:12 +08:00
Christoph Bumiller 1f4bfb8797 nv50/ir/ra: fix SpillCodeInserter::offsetSlot usage
We were turning non-memory spill slots into NULL.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-22 13:17:23 +01:00
Matt Turner 7770b02693 Revert "i965/fs: Make fs_reg's type an enum for better debugging."
This reverts commit 5ceadd29b0.

I rebased and apparently failed to build test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75355
2014-02-21 23:53:36 -08:00
Kenneth Graunke 760c6777a0 i965/fs: Drop the emit(fs_inst) overload.
Using this emit function implicitly creates three copies, which
is pointlessly inefficient.

1. Code creates the original instruction.
2. Calling emit(fs_inst) copies it into the function.
3. It then allocates a new fs_inst and copies it into that.

The second could be eliminated by changing the signature to

   fs_inst(const fs_inst &)

but that wouldn't eliminate the third.  Making callers heap allocate the
instruction and call emit(fs_inst *) allows us to just use the original
one, with no extra copies, and isn't much more of a burden.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner 326fc60ee9 i965/fs: Pass fs_regs by constant reference where possible.
These functions (modulo emit_lrp, necessitating the small fix-up) pass
these arguments by value unmodified to other functions. No point in
making an additional copy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner 070f20272f i965/fs: Move setting opcode = NOP to its one useful location.
All other callers of init() immediately set opcode to something else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner 4fbebd6e65 i965/fs: Use a bitfield for fs_inst's bool fields.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner d91035a8f6 i965/fs: Reorder fs_inst's fields for better packing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner 109c211ffd i965/fs: Reduce the sizes of some fs_inst members.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner 0fc1a77e14 i965/fs: Reorder fs_reg for better packing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner 5ceadd29b0 i965/fs: Make fs_reg's type an enum for better debugging.
Since the enum is marked as packed, it'll still take only one byte.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner 3f6baf5755 i965/fs: Reduce the sizes of some fs_reg members.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00