mesa.git
9 years agoegl/x11: auth with xserver before attempting to open the dri module
Emil Velikov [Wed, 29 Jul 2015 16:19:07 +0000 (17:19 +0100)]
egl/x11: auth with xserver before attempting to open the dri module

No real change, apart from keeping the calls to the underlying winsys
(x11) next to each other. Just like platform_wayland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl/x11: trust our loader over the xserver for the drivername
Emil Velikov [Wed, 29 Jul 2015 16:19:06 +0000 (17:19 +0100)]
egl/x11: trust our loader over the xserver for the drivername

This is a port of commit 7bd95ec437a(dri2: Trust our own driver name
lookup over the server's.) from glx/dri2.

v2: Add newline between code and multiline comment. (Matt)

Cc: Julien Isorce <julien.isorce@gmail.com>
Reported-by: Julien Isorce <julien.isorce@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl/x11: open the device from within dri2_x11_connect()
Emil Velikov [Wed, 29 Jul 2015 16:19:05 +0000 (17:19 +0100)]
egl/x11: open the device from within dri2_x11_connect()

Allows us, with the next commit, to use alternative driver_name rather
than the one from xserver.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl/x11: fetch the device_name prior to driver_name
Emil Velikov [Wed, 29 Jul 2015 16:19:04 +0000 (17:19 +0100)]
egl/x11: fetch the device_name prior to driver_name

With the follow up commits we're about to further reshuffle things. Thus
we'll honour our our driver_name lookup (src/loader), and use the one
provided by xserver as a fall-back.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl/x11: remove dri2_dpy->conn checks
Emil Velikov [Wed, 29 Jul 2015 16:19:03 +0000 (17:19 +0100)]
egl/x11: remove dri2_dpy->conn checks

If the connection is NULL we won't be able to get here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl/x11: bail out if we cannot fetch the xcb connection
Emil Velikov [Wed, 29 Jul 2015 16:19:02 +0000 (17:19 +0100)]
egl/x11: bail out if we cannot fetch the xcb connection

The documentation of xcb_connection_has_error() does not mention
what will happen, if NULL is fed to the function.

Upon closer look (props to Matt), it seems that we'll crash as the
implementation dereferences conn.

This will also allow us to remove the dri2_dpy->conn checking with the
next commit.

v2: Reword commit message as per Matt's findings.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agovc4: add missing nir include, to fix the build
Emil Velikov [Fri, 17 Jul 2015 11:52:27 +0000 (12:52 +0100)]
vc4: add missing nir include, to fix the build

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agovc4: automake: remove unused include
Emil Velikov [Fri, 17 Jul 2015 11:41:24 +0000 (12:41 +0100)]
vc4: automake: remove unused include

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoclover: Stub missing CL 1.2 functions.
Serge Martin (EdB) [Fri, 7 Aug 2015 08:40:31 +0000 (10:40 +0200)]
clover: Stub missing CL 1.2 functions.

As sugested by Tom a long time ago
and in order to be able to create Piglit tests

v2:
replace NOT_SUPPORTED_BY_CL_1_1 macro with an inline function
remove extra space in clLinkProgram arg

v3:
use __func__

v4:
back to a macro, it make more sense to use it with __func__

[ Francisco Jerez: Rename to CLOVER_NOT_SUPPORTED_UNTIL and pass the
  minimum API version required by the entry point so the error
  messages don't become stale when support for additional CL versions
  is introduced. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agomesa: NULL check InfoLog
Marta Lofstedt [Tue, 23 Jun 2015 11:03:13 +0000 (13:03 +0200)]
mesa: NULL check InfoLog

When a program is compiled, but linking failed the sh->InfoLog
could be NULL. This is expoloited by OpenGL ES 3.1 conformance tests.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/vec4: Fix indentation in vec4_visitor::evaluate_spill_costs
Iago Toral Quiroga [Tue, 4 Aug 2015 08:06:41 +0000 (10:06 +0200)]
i965/vec4: Fix indentation in vec4_visitor::evaluate_spill_costs

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoi965/vec4: do not predicate scratch writes for BRW_OPCODE_SEL instructions
Iago Toral Quiroga [Fri, 31 Jul 2015 12:36:30 +0000 (14:36 +0200)]
i965/vec4: do not predicate scratch writes for BRW_OPCODE_SEL instructions

The dst is always written, in this case the predicate is only used to select
the value to write, so if we are spilling the dst we always want to write
whatever value we selected to scratch.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: remove stage ref generation for transform feedback
Timothy Arceri [Wed, 5 Aug 2015 11:05:52 +0000 (21:05 +1000)]
glsl: remove stage ref generation for transform feedback

Stage ref cannot be queried for transform feedback.

Also simplify the build_stageref function by passing the
correct mode for uniforms.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agowinsys/radeon: add a specific error message for cs_submit -> -ENOMEM
Marek Olšák [Wed, 15 Jul 2015 19:14:24 +0000 (21:14 +0200)]
winsys/radeon: add a specific error message for cs_submit -> -ENOMEM

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agowinsys/radeon: add an interface for contexts
Marek Olšák [Thu, 30 Apr 2015 14:07:12 +0000 (16:07 +0200)]
winsys/radeon: add an interface for contexts

Same idea as in libdrm_amdgpu.

A command stream can only be created for a specific context and it's always
submitted to that context.

This will mainly be used by amdgpu and it's required by the GPU reset status
query too.
(radeon only has a basic version of the query and thus doesn't need this)

Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agogallium/radeon: unify buffer_wait and buffer_is_busy in the winsys interface
Marek Olšák [Thu, 6 Aug 2015 21:41:38 +0000 (23:41 +0200)]
gallium/radeon: unify buffer_wait and buffer_is_busy in the winsys interface

The timeout parameter covers both cases.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoradeonsi: rename enable_s3tc -> enable_compressed_formats
Marek Olšák [Mon, 3 Aug 2015 19:43:36 +0000 (21:43 +0200)]
radeonsi: rename enable_s3tc -> enable_compressed_formats

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agogallium/radeon: add DRM and LLVM version to the renderer string
Marek Olšák [Sun, 19 Jul 2015 22:15:59 +0000 (00:15 +0200)]
gallium/radeon: add DRM and LLVM version to the renderer string

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: always flush framebuffer caches at the beginning of IBs
Marek Olšák [Thu, 16 Jul 2015 12:40:00 +0000 (14:40 +0200)]
radeonsi: always flush framebuffer caches at the beginning of IBs

better safe than sorry

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agoradeonsi: don't count the exact needed CS space if the CS is large enough
Marek Olšák [Sat, 27 Jun 2015 12:49:34 +0000 (14:49 +0200)]
radeonsi: don't count the exact needed CS space if the CS is large enough

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoradeonsi: don't crash when cleaning up after an incomplete context
Marek Olšák [Wed, 6 May 2015 17:34:09 +0000 (19:34 +0200)]
radeonsi: don't crash when cleaning up after an incomplete context

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoi965: Rename MIPTREE_LAYOUT_ALLOC_* -> MIPTREE_LAYOUT_TILING_*.
Matt Turner [Thu, 6 Aug 2015 17:59:15 +0000 (10:59 -0700)]
i965: Rename MIPTREE_LAYOUT_ALLOC_* -> MIPTREE_LAYOUT_TILING_*.

Ben suggested that I rename MIPTREE_LAYOUT_ALLOC_ANY_TILED since it
needed to include no tiling at all, but the name
MIPTREE_LAYOUT_ALLOC_ANY is pretty nondescriptive. We can avoid
confusion by replacing "ALLOC" with "TILING" in the identifiers.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
9 years agoi965: Correct a mistake that always forced texture tiling.
Matt Turner [Wed, 5 Aug 2015 05:58:08 +0000 (22:58 -0700)]
i965: Correct a mistake that always forced texture tiling.

Regression since commit 3a31876600, when tiling modes were moved into
layout_flags.

The relevant enum values are

   MIPTREE_LAYOUT_ALLOC_YTILED = 1 << 5
   MIPTREE_LAYOUT_ALLOC_XTILED = 1 << 6
   MIPTREE_LAYOUT_ALLOC_ANY_TILED = MIPTREE_LAYOUT_ALLOC_YTILED |
                                    MIPTREE_LAYOUT_ALLOC_XTILED
   MIPTREE_LAYOUT_ALLOC_LINEAR = 1 << 7

so the expression (layout_flags & MIPTREE_LAYOUT_ALLOC_ANY_TILED) can
never produce a value of MIPTREE_LAYOUT_ALLOC_LINEAR.

The enum this replaced was

   enum intel_miptree_tiling_mode {
      INTEL_MIPTREE_TILING_ANY,
      INTEL_MIPTREE_TILING_Y,
      INTEL_MIPTREE_TILING_NONE,
   };

where "ANY" means "Y" or "NONE" (i.e., linear). As such, remove the
unused (and worse, unhandled) MIPTREE_LAYOUT_ALLOC_XTILED and redefine
MIPTREE_LAYOUT_ALLOC_ANY_TILED to mean what it did before.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91513
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
9 years agoi965: Request a miptree with no tiling intel_miptree_map_blit().
Matt Turner [Thu, 6 Aug 2015 01:51:24 +0000 (18:51 -0700)]
i965: Request a miptree with no tiling intel_miptree_map_blit().

Regression since commit 3a31876600, when tiling modes were moved into
layout_flags.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
9 years agoradeonsi: add a HUD query showing the number of shaders created
Marek Olšák [Sun, 2 Aug 2015 19:12:18 +0000 (21:12 +0200)]
radeonsi: add a HUD query showing the number of shaders created

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add a HUD query showing the number of compiler invocations
Marek Olšák [Sun, 2 Aug 2015 14:57:39 +0000 (16:57 +0200)]
radeonsi: add a HUD query showing the number of compiler invocations

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: display cumulative results for some driver queries
Marek Olšák [Sun, 2 Aug 2015 15:28:20 +0000 (17:28 +0200)]
gallium/radeon: display cumulative results for some driver queries

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: switch the buffer-wait-time query to microseconds
Marek Olšák [Sun, 2 Aug 2015 15:47:38 +0000 (17:47 +0200)]
gallium/radeon: switch the buffer-wait-time query to microseconds

This display the units in the HUD.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: change some driver query types to Hz
Marek Olšák [Sun, 2 Aug 2015 15:09:01 +0000 (17:09 +0200)]
gallium/radeon: change some driver query types to Hz

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/hud: automatically print % if max_value == 100
Marek Olšák [Sun, 2 Aug 2015 16:11:55 +0000 (18:11 +0200)]
gallium/hud: automatically print % if max_value == 100

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/hud: fix printing % next to panes
Marek Olšák [Sun, 2 Aug 2015 16:11:09 +0000 (18:11 +0200)]
gallium/hud: fix printing % next to panes

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/hud: replace assertions with clamping the unit index
Marek Olšák [Sun, 2 Aug 2015 16:00:57 +0000 (18:00 +0200)]
gallium/hud: replace assertions with clamping the unit index

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium,hud: allow displaying cumulative values instead of average
Marek Olšák [Sun, 2 Aug 2015 15:24:30 +0000 (17:24 +0200)]
gallium,hud: allow displaying cumulative values instead of average

The cumulative value is useful for queries like the number of shader
compilations.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/hud: fix printing byte units
Marek Olšák [Sun, 2 Aug 2015 15:08:29 +0000 (17:08 +0200)]
gallium/hud: fix printing byte units

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium,hud: add support for Hz units in driver queries
Marek Olšák [Sun, 2 Aug 2015 15:06:17 +0000 (17:06 +0200)]
gallium,hud: add support for Hz units in driver queries

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: before storing tess levels, load them from LDS instead of temporary
Marek Olšák [Sun, 2 Aug 2015 23:34:32 +0000 (01:34 +0200)]
radeonsi: before storing tess levels, load them from LDS instead of temporary

Also use only one store if stride <= 4.
All the fetches from and stores to temporaries can be removed now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91461

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agowinsys/radeon: loosen up the requirements for how much memory IBs can use
Marek Olšák [Sun, 2 Aug 2015 20:01:25 +0000 (22:01 +0200)]
winsys/radeon: loosen up the requirements for how much memory IBs can use

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: always use the llvm. prefix in intrinsic names
Marek Olšák [Fri, 31 Jul 2015 15:26:08 +0000 (17:26 +0200)]
gallium/radeon: always use the llvm. prefix in intrinsic names

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agoradeon/winsys: increase the IB size for VM
Marek Olšák [Fri, 31 Jul 2015 09:45:13 +0000 (11:45 +0200)]
radeon/winsys: increase the IB size for VM

Luckily, there is a kernel query, so use the size from that.
It currently returns 256KB. It can be increased in the kernel.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: allow the winsys to choose the IB size
Marek Olšák [Sat, 27 Jun 2015 12:19:41 +0000 (14:19 +0200)]
gallium/radeon: allow the winsys to choose the IB size

Picked from the amdgpu branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: suspend timer queries between IBs
Marek Olšák [Fri, 31 Jul 2015 00:39:02 +0000 (02:39 +0200)]
gallium/radeon: suspend timer queries between IBs

When we are measuring the time spent in a draw call, an unexpected flush
can distort the result.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agost/mesa: implement DrawTransformFeedbackStream
Marek Olšák [Thu, 30 Jul 2015 14:14:03 +0000 (16:14 +0200)]
st/mesa: implement DrawTransformFeedbackStream

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: save which transform feedback buffer is associated with which stream
Marek Olšák [Thu, 30 Jul 2015 14:11:50 +0000 (16:11 +0200)]
mesa: save which transform feedback buffer is associated with which stream

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agovbo: pass the stream from DrawTransformFeedbackStream to drivers
Marek Olšák [Thu, 30 Jul 2015 13:43:09 +0000 (15:43 +0200)]
vbo: pass the stream from DrawTransformFeedbackStream to drivers

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: handle no-op cases sooner in _mesa_[Client]ActiveTexture()
Brian Paul [Mon, 3 Aug 2015 21:06:42 +0000 (15:06 -0600)]
mesa: handle no-op cases sooner in _mesa_[Client]ActiveTexture()

If the new texture unit is the current texture unit, we can return
before error checking.

Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoi965/fs: Lower arithmetic instructions with register regions of unsupported width.
Francisco Jerez [Tue, 4 Aug 2015 16:07:19 +0000 (19:07 +0300)]
i965/fs: Lower arithmetic instructions with register regions of unsupported width.

This extends the SIMD lowering pass to enforce the hardware limitation
that no directly-addressed source may read more than 2 physical GRFs.
One can easily go over this limit when doing 64-bit arithmetic
(e.g. FP64 or extended-precision integer MULs) or SIMD32, so it's nice
to be able to just emit an instruction of the intended execution size
from the visitor and let the lowering pass deal with this restriction
transparently.

Some hardware arithmetic instructions are not handled here, including
all instructions that use the accumulator implicitly (which the SIMD
lowering pass deliberately doesn't handle), instructions with
non-per-channel sources (e.g. LINE or PLANE) and SEND-like
instructions, which need special handling most likely as virtual
opcodes.

Reviewed-by: Connor Abbott <connor.w.abbott@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agoi965/fs: Fix fs_inst::regs_read() for sources in the ATTR file.
Francisco Jerez [Wed, 5 Aug 2015 13:29:30 +0000 (16:29 +0300)]
i965/fs: Fix fs_inst::regs_read() for sources in the ATTR file.

Otherwise it would crash on Gen8 with scalar VS.  The issue can easily
be reproduced with the following patch, but I don't see any reason why
it wouldn't be possible to end up with an ATTR argument here even
without it.

CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Connor Abbott <connor.w.abbott@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agoi965/fs: Implement nir_op_imul/umul_high in terms of MULH.
Francisco Jerez [Tue, 4 Aug 2015 16:08:45 +0000 (19:08 +0300)]
i965/fs: Implement nir_op_imul/umul_high in terms of MULH.

And get rid of another no16() call.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Lower the MULH virtual instruction.
Francisco Jerez [Thu, 6 Aug 2015 11:04:00 +0000 (14:04 +0300)]
i965/fs: Lower the MULH virtual instruction.

Translate MULH into the MUL/MACH sequence.  This does roughly the same
thing that nir_emit_alu() used to do but we can now handle 16-wide by
taking advantage of the SIMD lowering pass.  The force_sechalf
workaround near the bottom is required because the SIMD lowering pass
will emit instructions with non-zero quarter control and we need to
make sure we avoid that on integer arithmetic instructions with
implicit accumulator access due to a known hardware bug on IVB.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Indent the implementation of 32x32-bit MUL lowering by one level.
Francisco Jerez [Wed, 5 Aug 2015 13:47:18 +0000 (16:47 +0300)]
i965/fs: Indent the implementation of 32x32-bit MUL lowering by one level.

In order to make room for the code that will lower the MULH virtual
instruction.  Also move the hardware generation and execution type
checks into the same branch, they are going to have to be different
for MULH.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Lower 32x32 bit multiplication on BXT.
Francisco Jerez [Wed, 5 Aug 2015 13:43:37 +0000 (16:43 +0300)]
i965/fs: Lower 32x32 bit multiplication on BXT.

AFAIK BXT has the same annoying alignment limitation as CHV on the
source register regions of 32x32 bit MULs, give it the same treatment.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Define virtual instruction to calculate the high 32 bits of a multiply.
Francisco Jerez [Tue, 4 Aug 2015 16:04:55 +0000 (19:04 +0300)]
i965: Define virtual instruction to calculate the high 32 bits of a multiply.

This instruction will translate to the MUL/MACH sequence that computes
the high 32-bits of the result of a 64-bit multiply.  Before Gen8
integer operations that used the accumulator were limited to 8-wide,
but the SIMD lowering pass can easily be hooked up to sidestep this
limitation, we just need a virtual opcode to represent the MUL/MACH
sequence in the IR.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoglsl: Initialize patch member of glsl_struct_field
Michel Dänzer [Wed, 5 Aug 2015 09:17:14 +0000 (18:17 +0900)]
glsl: Initialize patch member of glsl_struct_field

There is apparently a subtle difference in C++ between

    F f;

and

    F f();

The former will use the default constructor.  If there is no default
constructor specified, the compiler provides one that simply invokes the
default constructor for each field.  For built-in basic types, the
default constructor does nothing.  The later will, according to
http://stackoverflow.com/questions/2417065/does-the-default-constructor-initialize-built-in-types)
perform value-initialization of the type.  For built-in types this means
initializing to zero.

The per_vertex_accumulator constructor is:

    per_vertex_accumulator::per_vertex_accumulator()
       : fields(),
         num_fields(0)
    {
    }

This is the second form of constructor, so the glsl_struct_field
objects were previously zero initialized.  With the addition of an empty
default constructor in commit 7ac946e5, per_vertex_accumulator::fields
receive no initialization.

Fixes a bunch of random (mostly tessellation related) piglit failures
since commit 7ac946e5 ("glsl: Add constuctors for the common cases of
glsl_struct_field").

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91544
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agonir: add missing type to type_size_vec4()
Timothy Arceri [Wed, 5 Aug 2015 10:27:24 +0000 (20:27 +1000)]
nir: add missing type to type_size_vec4()

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Add missing check of format and type in glTexSubImageXD on GLES 3.0
Eduardo Lima Mitev [Wed, 29 Jul 2015 14:01:27 +0000 (16:01 +0200)]
mesa: Add missing check of format and type in glTexSubImageXD on GLES 3.0

Argument validation for glTexSubImageXD is missing a check of format and type
against texture object's internal format when profile is OpenGL-ES 3.0+.

This patch also groups together all format and type checks on GLES into a
new function texture_format_error_check_gles(), to factorize similar
code in texture_format_error_check().

Fixes 2 dEQP tests:
* dEQP-GLES3.functional.negative_api.texture.texsubimage2d
* dEQP-GLES3.functional.negative_api.texture.texsubimage3d

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Fix error returned by glCopyTexImage2D() upon an invalid internal format
Eduardo Lima Mitev [Wed, 29 Jul 2015 14:01:28 +0000 (16:01 +0200)]
mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal format

Page 161 of the OpenGL-ES 3.1 (PDF) spec, and page 207 of the OpenGL 4.5 (PDF),
both on section '8.6. ALTERNATE TEXTURE IMAGE SPECIFICATION COMMANDS', states:

    "An INVALID_ENUM error is generated if an invalid value is specified for
     internalformat".

It is currently returning INVALID_OPERATION error because
_mesa_get_read_renderbuffer_for_format() is called before the internalformat
argument has been validated. To fix this, we move this call down the validation
process, after _mesa_base_tex_format() has been called. _mesa_base_tex_format()
effectively serves as a validator for the internal format.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.texture.copyteximage2d_invalid_format

Fixes 1 piglit test:
* spec@oes_compressed_etc1_rgb8_texture@basic

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 10.6 <mesa-stable@lists.freedesktop.org>
9 years agomesa: Validate target before resolving tex obj in glTex(ture)SubImageXD
Eduardo Lima Mitev [Wed, 29 Jul 2015 14:01:26 +0000 (16:01 +0200)]
mesa: Validate target before resolving tex obj in glTex(ture)SubImageXD

Currently, glTexSubImageXD attempt to resolve the texture object
(by calling _mesa_get_current_tex_object()) before validating the given
target. However, that method explicitly states that target must have been
validated before calling it, so it never returns a user error.

The target validation occurs later when texsubimage_error_check() is called.

This patch reorganizes target validation, taking it out from the error check
function and into a point before the texture object is resolved.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 10.6 <mesa-stable@lists.freedesktop.org>
9 years agomesa: Fix errors values returned by glShaderBinary()
Eduardo Lima Mitev [Wed, 29 Jul 2015 14:01:23 +0000 (16:01 +0200)]
mesa: Fix errors values returned by glShaderBinary()

Page 68, section 7.2 'Shader Binaries" of the of the OpenGL ES 3.1,
and page 88 of the OpenGL 4.5 specs state:

    "An INVALID_VALUE error is generated if count or length is negative.
     An INVALID_ENUM error is generated if binaryformat is not a supported
     format returned in SHADER_BINARY_FORMATS."

Currently, an INVALID_OPERATION error is returned for all cases.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.shader.shader_binary

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 10.6 <mesa-stable@lists.freedesktop.org>
9 years agomesa: do not modify args when errors with GetProgramResourceName
Tapani Pälli [Tue, 4 Aug 2015 08:09:35 +0000 (11:09 +0300)]
mesa: do not modify args when errors with GetProgramResourceName

Original purpose of these lines was to be more friendly against
GUI tools using the extension. However conformance suite explicitly
checks that buffers are not modified in error conditions.

Fixes:
   ES31-CTS.program_interface_query.buff-length

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
9 years agoglsl: add variable mode check to build_stageref
Tapani Pälli [Mon, 3 Aug 2015 05:48:32 +0000 (08:48 +0300)]
glsl: add variable mode check to build_stageref

Currently stage reference mask is built using the variable name
only. However it can happen that input of one stage has same name
as output from another stage. Adding check of variable mode makes
sure we do not pick wrong variable.

Fixes some subcases from
   ES31-CTS.program_interface_query.no-locations

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
9 years agodri: set the __DRI_API_OPENGL bit based on max gl compat version
Frank Binns [Fri, 31 Jul 2015 08:11:47 +0000 (09:11 +0100)]
dri: set the __DRI_API_OPENGL bit based on max gl compat version

This matches similar behaviour for the __DRI_API_OPENGL_CORE bit.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl: Add eglQuerySurface surface type check for EGL_LARGEST_PBUFFER attrib
Frank Binns [Fri, 31 Jul 2015 08:11:45 +0000 (09:11 +0100)]
egl: Add eglQuerySurface surface type check for EGL_LARGEST_PBUFFER attrib

Calling eglQuerySurface on a window or pixmap with the EGL_LARGEST_PBUFFER
attribute resulted in the contents of the 'value' parameter being modified.
This is the wrong behaviour according to the EGL spec, which states:

    "Querying EGL_LARGEST_PBUFFER for a pbuffer surface returns the
     same attribute value specified when the surface was created with
     eglCreatePbufferSurface. For a window or pixmap surface, the
     contents of value are not modified."

Avoid this from happening by checking that the surface type is EGL_PBUFFER_BIT
before modifying the contents of the parameter.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoegl/dri: Add error info needed for EGL_EXT_image_dma_buf_import extension
Frank Binns [Fri, 31 Jul 2015 08:11:46 +0000 (09:11 +0100)]
egl/dri: Add error info needed for EGL_EXT_image_dma_buf_import extension

Update the DRI image interface error codes to reflect the needs of the
EGL_EXT_image_dma_buf_import extension. This means updating the existing error
code documentation and adding a new __DRI_IMAGE_ERROR_BAD_ACCESS error code
so that drivers can correctly reject unsupported pitches and offsets. Hook
the new error code up in EGL to return EGL_BAD_ACCESS.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agovc4: Use nir_lower_load_const_to_scalar().
Eric Anholt [Tue, 4 Aug 2015 00:36:47 +0000 (17:36 -0700)]
vc4: Use nir_lower_load_const_to_scalar().

9 years agonir: Add a nir_lower_load_const_to_scalar() pass.
Eric Anholt [Tue, 4 Aug 2015 00:20:33 +0000 (17:20 -0700)]
nir: Add a nir_lower_load_const_to_scalar() pass.

This is useful to increase the CSE opportunities for a scalar backend.  It
avoids regressions when dropping vc4's custom CSE implementation.

v2: Cleanups by Matt (decl in the for loop, and unreachable()).
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agovc4: Don't bother de-SSAing values that aren't part of phi webs.
Eric Anholt [Tue, 4 Aug 2015 02:08:37 +0000 (19:08 -0700)]
vc4: Don't bother de-SSAing values that aren't part of phi webs.

We can just support them the same way we do load_const's SSA values.

9 years agonir: Add algebraic opt for no-op iand.
Eric Anholt [Fri, 31 Jul 2015 16:12:48 +0000 (09:12 -0700)]
nir: Add algebraic opt for no-op iand.

I lazily generated some of these in VC4 NIR lowering.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agovc4: Don't bother saturating the dst color for blending.
Eric Anholt [Sat, 1 Aug 2015 00:08:46 +0000 (17:08 -0700)]
vc4: Don't bother saturating the dst color for blending.

Since we just pulled it out of the destination as 8-bit unorm, we know
it's in [0, 1] already.

shader-db:
total instructions in shared programs: 100040 -> 98208 (-1.83%)
instructions in affected programs:     14084 -> 12252 (-13.01%)

9 years agovc4: Make r4-writes implicitly move to a temp, and allocate temps to r4.
Eric Anholt [Fri, 31 Jul 2015 18:46:56 +0000 (11:46 -0700)]
vc4: Make r4-writes implicitly move to a temp, and allocate temps to r4.

Previously, SFU values always moved to a temporary, and TLB color reads
and texture reads always lived in r4.  Instead, we can have these results
just be normal temporaries, and the register allocator can leave the
values in r4 when they don't interfere with anything else using r4.

shader-db results:
total instructions in shared programs: 100809 -> 100040 (-0.76%)
instructions in affected programs:     42383 -> 41614 (-1.81%)

9 years agovc4: Drop a dead prototype.
Eric Anholt [Fri, 31 Jul 2015 17:02:45 +0000 (10:02 -0700)]
vc4: Drop a dead prototype.

9 years agoRevert "nir: Use a single bit for the dual-source blend index"
Eric Anholt [Wed, 5 Aug 2015 00:18:43 +0000 (17:18 -0700)]
Revert "nir: Use a single bit for the dual-source blend index"

This reverts commit ab5b7a0fe659ff6f9c1885d5cb047b6531959506.  We use more
than one bit of value in tgsi_to_nir.

9 years agofreedreno/a4xx: add independent blend function support
Rob Clark [Sat, 1 Aug 2015 20:17:49 +0000 (16:17 -0400)]
freedreno/a4xx: add independent blend function support

needed for MRT

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: MRT support
Rob Clark [Fri, 31 Jul 2015 19:32:58 +0000 (15:32 -0400)]
freedreno/a4xx: MRT support

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: move the half-precision logic into core
Rob Clark [Fri, 31 Jul 2015 18:34:19 +0000 (14:34 -0400)]
freedreno: move the half-precision logic into core

Both a3xx and a4xx need the same logic to decide if half-precision can
be used for blit shaders.  So move it to core and simplify things a bit
with a helper that considers all render targets.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: simplify/cleanup resource status tracking
Rob Clark [Fri, 31 Jul 2015 16:07:24 +0000 (12:07 -0400)]
freedreno: simplify/cleanup resource status tracking

Collapse dirty/reading bools into status bitmask (and drop writing which
should really be the same as dirty).  And use 'used_resources' list for
all tracking, including zsbuf/cbufs, rather than special casing the
color and depth/stencil buffers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: fix stream-out caps vec4->components
Rob Clark [Fri, 31 Jul 2015 14:54:23 +0000 (10:54 -0400)]
freedreno: fix stream-out caps vec4->components

Should be in units of components, not vec4's

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: small bit of cleanup about max rendertargets
Rob Clark [Fri, 31 Jul 2015 13:36:31 +0000 (09:36 -0400)]
freedreno: small bit of cleanup about max rendertargets

We hard-coded 4 or 8 as the max in various places.  Switch it all to a
define since the limit will go up with a4xx (and maybe even again in the
future?)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agoglx: Use _mesa_lroundevenf() in glPixelStoref().
Matt Turner [Mon, 13 Jul 2015 01:05:58 +0000 (18:05 -0700)]
glx: Use _mesa_lroundevenf() in glPixelStoref().

Functional change in which way half-way cases are rounded from towards
positive-infinity to even. The spec says "the passed value is rounded to
the nearest integer". Removes another case of bad half-up rounding.

9 years agoutil: Use SSE intrinsics in _mesa_lroundeven{f,}.
Matt Turner [Mon, 29 Jun 2015 16:38:34 +0000 (09:38 -0700)]
util: Use SSE intrinsics in _mesa_lroundeven{f,}.

gcc actually generates this for us now that we use -fno-math-errno
(which is weird, since lrintf()/lrint() don't set errno) but clang still
does not. Presumably helps MSVC as well.

Reduced .text size by 8.5k with gcc before -fno-math-errno.

   text     data      bss      dec      hex  filename
4935850   195136    26192  5157178   4eb13a  i965_dri.so before
4927225   195128    26192  5148545   4e8f81  i965_dri.so after

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agomesa: Use _mesa_lroundevenf() in some more places.
Matt Turner [Fri, 26 Jun 2015 04:43:30 +0000 (21:43 -0700)]
mesa: Use _mesa_lroundevenf() in some more places.

9 years agovl/mpeg12: Silence GCC unused-variable warning.
Vinson Lee [Thu, 30 Jul 2015 03:32:41 +0000 (20:32 -0700)]
vl/mpeg12: Silence GCC unused-variable warning.

vl/vl_mpeg12_bitstream.c: In function 'decode_slice':
vl/vl_mpeg12_bitstream.c:928:19: warning: unused variable 'extra' [-Wunused-variable]
          unsigned extra = vl_vlc_get_uimsbf(&bs->vlc, 1);
                   ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agoglsl: replace old hash table with new and faster one
Alejandro Seguí [Mon, 3 Aug 2015 00:15:20 +0000 (02:15 +0200)]
glsl: replace old hash table with new and faster one

The util/hash_table was intended to be a fast hash table
replacement for the program/hash_table see 35fd61bd99c1 and
72e55bb6888ff.

Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
9 years agoglsl: Add constuctors for the common cases of glsl_struct_field
Ian Romanick [Thu, 30 Jul 2015 13:00:56 +0000 (06:00 -0700)]
glsl: Add constuctors for the common cases of glsl_struct_field

Fixes a giant pile of GCC warnings:

builtin_types.cpp:60:1: warning: missing initializer for member 'glsl_struct_field::stream' [-Wmissing-field-initializers]

I had to add a default constructor because a non-default constructor
was added.  Otherwise the only constructor would be the one with
parameters, and all the plases like

    glsl_struct_field foo;

would fail to compile.

I wanted to do this in two patches.  All of the initializers of
glsl_struct_field structures had to be converted to use the
constructor because C++ apparently forces you to do one or the other:

builtin_types.cpp:61:1: error: could not convert '{glsl_type::float_type, "near", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0, -1}' from '<brace-enclosed initializer list>' to 'glsl_struct_field'

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Make gen7_upload_ps_state static
Ian Romanick [Thu, 25 Jun 2015 17:45:34 +0000 (10:45 -0700)]
i965: Make gen7_upload_ps_state static

It is only ever called from within the same file.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Remove extern declaration for nonexistent state atom
Ian Romanick [Thu, 25 Jun 2015 15:43:13 +0000 (08:43 -0700)]
i965: Remove extern declaration for nonexistent state atom

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Trivial formatting changes in gen7_vs_state.c
Ian Romanick [Thu, 25 Jun 2015 15:20:01 +0000 (08:20 -0700)]
i965: Trivial formatting changes in gen7_vs_state.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Trivial formatting changes in gen6_multisample_state.c
Ian Romanick [Thu, 25 Jun 2015 15:20:01 +0000 (08:20 -0700)]
i965: Trivial formatting changes in gen6_multisample_state.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Trivial formatting changes in brw_misc_state.c
Ian Romanick [Thu, 25 Jun 2015 15:20:01 +0000 (08:20 -0700)]
i965: Trivial formatting changes in brw_misc_state.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Trivial formatting changes in brw_draw_upload.c
Ian Romanick [Thu, 25 Jun 2015 15:20:01 +0000 (08:20 -0700)]
i965: Trivial formatting changes in brw_draw_upload.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Trivial formatting changes in brw_draw.c
Ian Romanick [Fri, 19 Jun 2015 01:45:44 +0000 (18:45 -0700)]
i965: Trivial formatting changes in brw_draw.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965: Trivial formatting changes in brw_wm.c
Ian Romanick [Thu, 11 Jun 2015 00:09:16 +0000 (17:09 -0700)]
i965: Trivial formatting changes in brw_wm.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
9 years agoi965/nir: Do not scalarize phis in non-scalar setups
Iago Toral Quiroga [Wed, 15 Jul 2015 07:32:17 +0000 (09:32 +0200)]
i965/nir: Do not scalarize phis in non-scalar setups

Significantly reduces register pressure in some piglit tests.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/vec4: Handle uniform and GRF array access on vertex programs (NIR)
Antia Puentes [Wed, 8 Jul 2015 14:08:17 +0000 (16:08 +0200)]
i965/vec4: Handle uniform and GRF array access on vertex programs (NIR)

When the NIR-vec4 pass is enabled, handles uniform and GRF array access
on ARB_vertex_program like it is done on vertex shaders.

When the old IR-vec4 pass is used, emit_program_code() emits pull constant
loads directly instead of using relative addressing, hence to call to
move_uniform_array_access_to_pull_constants() is not needed and it is enough
to call to split_uniform_registers().

The patch also calls to move_grf_array_access_to_scratch() like it is
done for shaders, however I suspect this is a no-op for vertex programs and
we could remove it.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir/vec4: Handle uniforms on vertex programs
Antia Puentes [Mon, 29 Jun 2015 12:21:38 +0000 (14:21 +0200)]
i965/nir/vec4: Handle uniforms on vertex programs

The implementation takes into account that on ARB_vertex_program
only a single nir variable is generated to support all the uniform data.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/vec4: Enable NIR-vec4 pass on ARB_vertex_programs
Antia Puentes [Wed, 8 Jul 2015 10:44:15 +0000 (12:44 +0200)]
i965/vec4: Enable NIR-vec4 pass on ARB_vertex_programs

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir/gs: Implement support for gl_InvocationID system value
Iago Toral Quiroga [Wed, 1 Jul 2015 08:12:10 +0000 (10:12 +0200)]
i965/nir/gs: Implement support for gl_InvocationID system value

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/gs/gen6: Refactor ir_emit_vertex and ir_end_primitive for gen6
Samuel Iglesias Gonsalvez [Mon, 13 Jul 2015 13:51:17 +0000 (15:51 +0200)]
i965/gs/gen6: Refactor ir_emit_vertex and ir_end_primitive for gen6

So the implementation is independent of GLSL IR and the visit methods of the
gen6 GS visitor. This way we will be able to reuse that implementation directly
from the NIR vec4 backend.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir/gs: Implement EmitVertex and EndPrimitive
Iago Toral Quiroga [Mon, 29 Jun 2015 12:08:11 +0000 (14:08 +0200)]
i965/nir/gs: Implement EmitVertex and EndPrimitive

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir/gs: Handle geometry shaders inputs
Iago Toral Quiroga [Mon, 29 Jun 2015 11:52:30 +0000 (13:52 +0200)]
i965/nir/gs: Handle geometry shaders inputs

Outputs from the vertex shader become array inputs in the geomtry shader,
but the arrays are interleaved, so we need to map our inputs accordingly.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/gs: Refactor ir_emit_vertex and ir_end_primitive
Iago Toral Quiroga [Mon, 29 Jun 2015 11:37:31 +0000 (13:37 +0200)]
i965/gs: Refactor ir_emit_vertex and ir_end_primitive

So the implementation is independent of GLSL IR and the visit methods of the
vec4 visitor. This way we will be able to reuse that implementation directly
from the NIR vec4 backend.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>