platform/upstream/mesa.git
9 years agomesa: adjust error message when there's a missing teximage
Ilia Mirkin [Wed, 22 Jul 2015 16:39:47 +0000 (12:39 -0400)]
mesa: adjust error message when there's a missing teximage

The current message makes it seem like the zoffset is invalid.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoRevert "Match swrast modes more loosely."
Marek Olšák [Thu, 23 Jul 2015 19:51:48 +0000 (21:51 +0200)]
Revert "Match swrast modes more loosely."

This reverts commit f3728a16c9c6a02fc1f44b8069b0060e2358f22e.

It broke glxgears on radeonsi. The window was just black.

9 years agogallivm: Fix profile build.
Jose Fonseca [Thu, 23 Jul 2015 15:54:02 +0000 (16:54 +0100)]
gallivm: Fix profile build.

9 years agogallium/util: Stop bundling our snprintf implementation.
Jose Fonseca [Wed, 22 Jul 2015 12:21:24 +0000 (13:21 +0100)]
gallium/util: Stop bundling our snprintf implementation.

Use MSVCRT functions instead.  Their semantics are slightly
different but they can be made to work as expected.

Also, use the same code paths for both MSVCRT and MinGW.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoMatch swrast modes more loosely.
Tom Hughes [Tue, 2 Jun 2015 12:40:37 +0000 (13:40 +0100)]
Match swrast modes more loosely.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agomesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls
Eduardo Lima Mitev [Thu, 23 Jul 2015 14:25:21 +0000 (16:25 +0200)]
mesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls

Basically, two different target error checks are chained consecutively, and the
second one is executed regardless the result of the first one. This produces an
incorrect error if the first check fails but is overrided by the second.

This patch conditions the execution of the second check to a successful pass of
the first one.

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

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
9 years agogallivm: Add ifdefs so raw_debug_stream is only defined when used
Tom Stellard [Mon, 20 Jul 2015 15:24:13 +0000 (11:24 -0400)]
gallivm: Add ifdefs so raw_debug_stream is only defined when used

Its only use is to implement a custom version of LLVMDumpValue
on some Windows and embedded platforms.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: Don't use raw_debug_ostream for dissasembling
Tom Stellard [Mon, 20 Jul 2015 13:49:05 +0000 (06:49 -0700)]
gallivm: Don't use raw_debug_ostream for dissasembling

All LLVM API calls that require an ostream object have been removed from
the disassemble() function, so we don't need to use this class to wrap
_debug_printf() we can just call this function directly.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodocs: mark off tess for nvc0
Ilia Mirkin [Thu, 23 Jul 2015 07:39:13 +0000 (03:39 -0400)]
docs: mark off tess for nvc0

9 years agogk110/ir: fake BAR support
Ilia Mirkin [Thu, 23 Jul 2015 00:34:30 +0000 (20:34 -0400)]
gk110/ir: fake BAR support

Makes things sorta work until we figure out the real way to do this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: cleanup private enums that have graduated to gallium
Ilia Mirkin [Sun, 17 May 2015 04:45:12 +0000 (00:45 -0400)]
nvc0/ir: cleanup private enums that have graduated to gallium

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: allow tess eval output loads to be CSE'd
Ilia Mirkin [Thu, 30 Apr 2015 06:00:20 +0000 (02:00 -0400)]
nvc0/ir: allow tess eval output loads to be CSE'd

These only happen for gl_TessCoord which are constant.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: add hazard for 2nd dim of vfetch/load indirect argument
Ilia Mirkin [Thu, 23 Jul 2015 06:27:04 +0000 (02:27 -0400)]
nvc0/ir: add hazard for 2nd dim of vfetch/load indirect argument

Apparently a multi-word load can potentially overwrite the indirect
sources, so make sure that RA picks different registers for those.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: patch vertex count is stored in the upper bits
Ilia Mirkin [Sat, 21 Feb 2015 08:12:54 +0000 (03:12 -0500)]
nvc0/ir: patch vertex count is stored in the upper bits

9 years agonvc0/ir: add support for reading outputs in tess control shaders
Ilia Mirkin [Sun, 20 Jul 2014 20:23:16 +0000 (16:23 -0400)]
nvc0/ir: add support for reading outputs in tess control shaders

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: set perPatch flag on load/stores to per-patch varyings
Ilia Mirkin [Sun, 20 Jul 2014 17:36:37 +0000 (13:36 -0400)]
nvc0/ir: set perPatch flag on load/stores to per-patch varyings

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: populate info structure based on new tess properties
Ilia Mirkin [Sun, 20 Jul 2014 17:12:38 +0000 (13:12 -0400)]
nvc0/ir: populate info structure based on new tess properties

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: mark varyings as per-patch based on semantic name
Ilia Mirkin [Sun, 20 Jul 2014 16:17:46 +0000 (12:17 -0400)]
nvc0/ir: mark varyings as per-patch based on semantic name

Also add proper handling for PATCH semantics

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: TESSCOORD comes in as a sysval, not an input
Ilia Mirkin [Sun, 13 Jul 2014 02:08:44 +0000 (22:08 -0400)]
nvc0: TESSCOORD comes in as a sysval, not an input

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: add handling for set_tess_state callback
Ilia Mirkin [Sun, 20 Jul 2014 19:50:43 +0000 (15:50 -0400)]
nvc0: add handling for set_tess_state callback

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: add support for setting patch vertices at draw time
Ilia Mirkin [Sun, 17 May 2015 04:40:20 +0000 (00:40 -0400)]
nvc0: add support for setting patch vertices at draw time

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: support MAX_SHADER_PATCH_VARYINGS
Ilia Mirkin [Sun, 21 Jun 2015 17:35:53 +0000 (13:35 -0400)]
nvc0: support MAX_SHADER_PATCH_VARYINGS

9 years agonvc0: preliminary tess support
Ilia Mirkin [Sat, 12 Jul 2014 19:40:14 +0000 (15:40 -0400)]
nvc0: preliminary tess support

Uncomment the various functionality that was already there and add in
obvious missing bits that parallel vp/gp/fp functionality.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agodocs/GL3.txt: update ARB_shader_subroutine status.
Dave Airlie [Wed, 22 Jul 2015 01:04:52 +0000 (11:04 +1000)]
docs/GL3.txt: update ARB_shader_subroutine status.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agost/mesa: enable shader subroutine
Dave Airlie [Mon, 20 Apr 2015 00:30:53 +0000 (10:30 +1000)]
st/mesa: enable shader subroutine

since this touches drivers, only enable it on gallium
for now for drivers reporting GLSL 1.30 or above.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agost/mesa: add subroutine bits (v1.1)
Dave Airlie [Mon, 20 Apr 2015 00:29:42 +0000 (10:29 +1000)]
st/mesa: add subroutine bits (v1.1)

Just add support for the subroutine type to the
glsl->tgsi convertor.

v1.1: add subroutine to int support.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: fill out the ARB_shader_subroutine APIs
Dave Airlie [Mon, 20 Apr 2015 00:29:12 +0000 (10:29 +1000)]
mesa: fill out the ARB_shader_subroutine APIs

This fleshes out the APIs, using the program resource
APIs where they should match.

It also sets the default values to valid subroutines.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoprogram: add subroutine uniform support (v1.1)
Dave Airlie [Mon, 20 Apr 2015 00:28:40 +0000 (10:28 +1000)]
program: add subroutine uniform support (v1.1)

Add support for the subroutine uniform type ir->mesa.cpp

v1.1: add subroutine to int to switch

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoprogram_resource: add subroutine support (v3.1)
Dave Airlie [Mon, 20 Apr 2015 00:27:58 +0000 (10:27 +1000)]
program_resource: add subroutine support (v3.1)

This fleshes out the ARB_program_query support for the
APIs that ARB_shader_subroutine introduces, leaving
some TODOs for later addition.

v2: reworked for lots of the ARB_program_interface_query
entry points and tests
v3: use common function to test for subroutine support
v3.1: add tess, fix missing breaks

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: add uniform and program resource support (v2)
Dave Airlie [Mon, 20 Apr 2015 00:27:36 +0000 (10:27 +1000)]
glsl: add uniform and program resource support (v2)

This adds linker support for subroutine uniforms, they
have some subtle differences from real uniforms, we also hide
them and they are given internal uniform names.

This also adds the subroutine locations and subroutine uniforms
to the program resource tracking for later use.

v1.1: drop is_subroutine_def

v2: handle explicit location properly, ARB_explicit_location
has a lot of language for subroutine shaders.
Calculate a link time the number of compatible subroutines
for a uniform, to make program resource easier later.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)
Dave Airlie [Tue, 21 Jul 2015 04:59:01 +0000 (14:59 +1000)]
mesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)

This adds the necessary storage for subroutine info to gl_shader.

v2: add comments, rename one member
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/ir: add subroutine lowering pass (v2.3)
Dave Airlie [Thu, 23 Apr 2015 03:34:14 +0000 (13:34 +1000)]
glsl/ir: add subroutine lowering pass (v2.3)

This lowers the enhanced ir_call using the lookaside table
of subroutines into an if ladder. This initially was done
at the AST level but it caused some ordering issues so a separate
pass was required.

v2: clone return value derefs.
v2.1: update for subroutine->int convert.
v2.2: add a clone for the array index

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: add ast/parser support for subroutine parsing storage (v3.2)
Dave Airlie [Mon, 1 Jun 2015 00:55:47 +0000 (10:55 +1000)]
glsl: add ast/parser support for subroutine parsing storage (v3.2)

This is the guts of the GLSL parser and AST support for
shader subroutines.

The code creates a subroutine type in the parser, and
uses that there to validate the identifiers. The parser
also distinguishes between subroutine types/function prototypes
/uniforms and subroutine defintions for functions.

Then in the AST conversion it recreates the types, and
stores the subroutine definition info or subroutine info
into the ir_function along with a side lookup table in
the parser state. It also converts subroutine calls into
the enhanced ir_call.

v2: move to handling method calls in
function handling not in field selection.
v3: merge Chris's previous parser patches in here, to
make it clearer what's changed in one place.
v3.1: add more documentation, drop unused include
v3.2: drop is_subroutine_def

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/ir: allow ir_call to handle subroutine calling
Dave Airlie [Fri, 24 Apr 2015 00:47:03 +0000 (10:47 +1000)]
glsl/ir: allow ir_call to handle subroutine calling

This adds a ir_variable which contains the subroutine uniform
and an array rvalue for the deref of that uniform, these
are stored in the ir_call and lowered later.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/ir: add subroutine information storage to ir_function (v1.1)
Dave Airlie [Mon, 20 Apr 2015 00:22:57 +0000 (10:22 +1000)]
glsl/ir: add subroutine information storage to ir_function (v1.1)

We need to store two sets of info into the ir_function,
if this is a function definition with a subroutine list
(subroutine_def) or if it a subroutine prototype.

v1.1: add some more documentation.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: add function to check if shader subroutines are enabled.
Dave Airlie [Thu, 23 Jul 2015 00:23:36 +0000 (10:23 +1000)]
mesa: add function to check if shader subroutines are enabled.

This checks if core profile and shader subroutine extension
is enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: add inline conversion functions for ARB_shader_subroutine (v2)
Dave Airlie [Mon, 20 Apr 2015 00:20:06 +0000 (10:20 +1000)]
mesa: add inline conversion functions for ARB_shader_subroutine (v2)

This handles converting the shader stages to the internal
prefix along with the program resource interfaces.

v2: add tess support

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: don't eliminate subroutine types.
Dave Airlie [Tue, 21 Jul 2015 04:52:40 +0000 (14:52 +1000)]
glsl: don't eliminate subroutine types.

This stops dead code from removing subroutines types,
we need these for the queries to work properly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/types: add new subroutine type (v3.2)
Dave Airlie [Mon, 20 Apr 2015 00:16:55 +0000 (10:16 +1000)]
glsl/types: add new subroutine type (v3.2)

This type will be used to store the name of subroutine types

as in subroutine void myfunc(void);
will store myfunc into a subroutine type.

This is required to the parser can identify a subroutine
type in a uniform decleration as a valid type, and also for
looking up the type later.

Also add contains_subroutine method.

v2: handle subroutine to int comparisons, needed
for lowering pass.
v3: do subroutine to int with it's own IR
operation to avoid hacking on asserts (Kayden)
v3.1: fix warnings in this patch, fix nir,
fix tgsi
v3.2: fixup tests

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
tests: fix warnings

9 years agoglsl: Make `subroutine` a reserved keyword
Chris Forbes [Sun, 10 Aug 2014 09:38:23 +0000 (21:38 +1200)]
glsl: Make `subroutine` a reserved keyword

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodispatch_sanity: add shader subroutine to fix make check
Dave Airlie [Thu, 23 Jul 2015 00:49:12 +0000 (10:49 +1000)]
dispatch_sanity: add shader subroutine to fix make check

Add the shader subroutine to the core only API list,
and fixup dispatch_sanity to suit.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: Add extension plumbing and define for ARB_shader_subroutine
Chris Forbes [Sun, 10 Aug 2014 09:31:06 +0000 (21:31 +1200)]
glsl: Add extension plumbing and define for ARB_shader_subroutine

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Add glGet support for ARB_shader_subroutine implementation limits
Chris Forbes [Sun, 10 Aug 2014 09:07:33 +0000 (21:07 +1200)]
mesa: Add glGet support for ARB_shader_subroutine implementation limits

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Add extension tracking for arb_shader_subroutine (v2)
Chris Forbes [Sun, 10 Aug 2014 08:43:45 +0000 (20:43 +1200)]
mesa: Add extension tracking for arb_shader_subroutine (v2)

v2: [airlied]: merge version check update.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglapi: Add ARB_shader_subroutine functions and enums (v2)
Chris Forbes [Sun, 10 Aug 2014 08:38:53 +0000 (20:38 +1200)]
glapi: Add ARB_shader_subroutine functions and enums (v2)

v2: fix output="true" and LENGTH typo

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Add stubs for ARB_shader_subroutine entrypoints
Chris Forbes [Sun, 10 Aug 2014 09:00:34 +0000 (21:00 +1200)]
mesa: Add stubs for ARB_shader_subroutine entrypoints

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodispatch_sanity.cpp: remove commented out tess entries
Dave Airlie [Thu, 23 Jul 2015 00:39:47 +0000 (10:39 +1000)]
dispatch_sanity.cpp: remove commented out tess entries

These entries were put in the GL4.0 section, so removed the commented
out ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/tests: fix varying_test since tess changes.
Dave Airlie [Thu, 23 Jul 2015 01:13:36 +0000 (11:13 +1000)]
glsl/tests: fix varying_test since tess changes.

This fixes make check since the tess changes.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoi965: fix warning since tess merge.
Dave Airlie [Thu, 23 Jul 2015 00:39:26 +0000 (10:39 +1000)]
i965: fix warning since tess merge.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: enable tessellation, update GL3.txt & release notes
Marek Olšák [Sun, 22 Feb 2015 17:46:53 +0000 (18:46 +0100)]
radeonsi: enable tessellation, update GL3.txt & release notes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add scratch buffer support for tessellation shaders
Marek Olšák [Mon, 18 May 2015 12:41:35 +0000 (14:41 +0200)]
radeonsi: add scratch buffer support for tessellation shaders

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: update invariant registers for tessellation
Marek Olšák [Sun, 22 Feb 2015 17:16:02 +0000 (18:16 +0100)]
radeonsi: update invariant registers for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add assertions into draw_vbo and check tessellation
Marek Olšák [Sun, 22 Feb 2015 17:10:38 +0000 (18:10 +0100)]
radeonsi: add assertions into draw_vbo and check tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: set the rasterization primitive type for tessellation
Marek Olšák [Sun, 22 Feb 2015 17:09:18 +0000 (18:09 +0100)]
radeonsi: set the rasterization primitive type for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: set VGT_LS_HS_CONFIG for tessellation
Marek Olšák [Sun, 22 Feb 2015 17:07:51 +0000 (18:07 +0100)]
radeonsi: set VGT_LS_HS_CONFIG for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: update IA_MULTI_VGT_PARAM for tessellation
Marek Olšák [Sun, 22 Feb 2015 17:06:34 +0000 (18:06 +0100)]
radeonsi: update IA_MULTI_VGT_PARAM for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add derived tessellation state
Marek Olšák [Sun, 22 Feb 2015 17:01:18 +0000 (18:01 +0100)]
radeonsi: add derived tessellation state

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: implement a fixed-function tessellation control shader and its state
Marek Olšák [Sun, 17 May 2015 23:59:37 +0000 (01:59 +0200)]
radeonsi: implement a fixed-function tessellation control shader and its state

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: set up a ring buffer for tessellation factors
Marek Olšák [Sun, 22 Feb 2015 16:25:37 +0000 (17:25 +0100)]
radeonsi: set up a ring buffer for tessellation factors

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add tessellation shader states
Marek Olšák [Sun, 22 Feb 2015 16:07:34 +0000 (17:07 +0100)]
radeonsi: add tessellation shader states

ls_rsrc# will be emitted as part of the derived tessellation state

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: update si_get_vs_info and si_get_vs_state for tessellation
Marek Olšák [Sun, 22 Feb 2015 15:07:04 +0000 (16:07 +0100)]
radeonsi: update si_get_vs_info and si_get_vs_state for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add shader code generation for tessellation
Marek Olšák [Sun, 22 Feb 2015 14:09:35 +0000 (15:09 +0100)]
radeonsi: add shader code generation for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: implement TGSI_OPCODE_BARRIER
Marek Olšák [Mon, 6 Oct 2014 11:19:53 +0000 (13:19 +0200)]
radeonsi: implement TGSI_OPCODE_BARRIER

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: program VGT_SHADER_STAGES_EN for tessellation
Marek Olšák [Thu, 18 Sep 2014 22:16:12 +0000 (00:16 +0200)]
radeonsi: program VGT_SHADER_STAGES_EN for tessellation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add translation of PATCH primitives
Marek Olšák [Thu, 18 Sep 2014 21:39:44 +0000 (23:39 +0200)]
radeonsi: add translation of PATCH primitives

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add support for tessellation shader resources and samplers
Marek Olšák [Thu, 18 Sep 2014 20:54:40 +0000 (22:54 +0200)]
radeonsi: add support for tessellation shader resources and samplers

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add code for creating, binding and destroying tessellation shaders
Marek Olšák [Thu, 18 Sep 2014 20:50:52 +0000 (22:50 +0200)]
radeonsi: add code for creating, binding and destroying tessellation shaders

This doesn't do anything yet.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add debug flags for dumping tessellation shaders
Marek Olšák [Thu, 18 Sep 2014 20:26:02 +0000 (22:26 +0200)]
radeonsi: add debug flags for dumping tessellation shaders

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: rework how shader pointers to descriptors are set
Marek Olšák [Mon, 15 Sep 2014 21:34:28 +0000 (23:34 +0200)]
radeonsi: rework how shader pointers to descriptors are set

This is mainly needed for tessellation where a VS can be bound as VS, ES,
or LS, and TES (tess. evaluationshader) can be bound as VS or ES or neither.
Therefore we need the ability to move pointers to descriptors between
shaders arbitrarily.

The idea is that the context has a mapping from PIPE_SHADER_x to
SPI_SHADER_USER_DATA_x. After a shader is enabled or disabled,
si_shader_change_notify should be called to update this mapping accordingly.

There is a dirty flag for each shader pointer, but only one emit function
for all pointers in the whole context, whose code and logic is separated
from descriptors.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: rename build_streamout_store -> build_tbuffer_store_dwords
Marek Olšák [Sun, 22 Feb 2015 13:54:54 +0000 (14:54 +0100)]
radeonsi: rename build_streamout_store -> build_tbuffer_store_dwords

It will be reused later.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: separate primitive ID computation
Marek Olšák [Sun, 22 Feb 2015 13:46:20 +0000 (14:46 +0100)]
radeonsi: separate primitive ID computation

Support for new shader stages will be added here.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: move declaring streamout parameters to its own function
Marek Olšák [Sun, 22 Feb 2015 13:33:49 +0000 (14:33 +0100)]
radeonsi: move declaring streamout parameters to its own function

It will be reused later.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: make ES2GS offset sgpr location dynamic
Marek Olšák [Sun, 5 Oct 2014 22:17:42 +0000 (00:17 +0200)]
radeonsi: make ES2GS offset sgpr location dynamic

It will have a different location in the tessellation evaluation shader.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: expose emit_fetch
Marek Olšák [Tue, 3 Mar 2015 14:11:27 +0000 (15:11 +0100)]
gallium/radeon: expose emit_fetch

Radeonsi will use this.

9 years agogallium/radeon: expose LLVM functions implementing emit_store
Marek Olšák [Sun, 5 Oct 2014 18:20:18 +0000 (20:20 +0200)]
gallium/radeon: expose LLVM functions implementing emit_store

emit_store will be reimplemented for tessellation control shader outputs
where only radeon_llvm_saturate will be used, but radeonsi will want to
fall back to radeon_llvm_emit_store for other register types.

This exposes both functions.

9 years agost/mesa: enable tessellation if the driver supports it
Marek Olšák [Sun, 22 Feb 2015 18:50:42 +0000 (19:50 +0100)]
st/mesa: enable tessellation if the driver supports it

9 years agost/mesa: set default tessellation levels
Marek Olšák [Mon, 18 May 2015 10:49:10 +0000 (12:49 +0200)]
st/mesa: set default tessellation levels

9 years agost/mesa: add barrier support
Ilia Mirkin [Sun, 7 Sep 2014 22:36:06 +0000 (18:36 -0400)]
st/mesa: add barrier support

9 years agost/mesa: disable copy propagation for tessellation shaders
Ilia Mirkin [Tue, 22 Jul 2014 00:45:29 +0000 (20:45 -0400)]
st/mesa: disable copy propagation for tessellation shaders

This can't work due to shared inputs and outputs and barriers.

9 years agost/mesa: set vertices_per_patch when drawing
Ilia Mirkin [Mon, 21 Jul 2014 22:49:40 +0000 (18:49 -0400)]
st/mesa: set vertices_per_patch when drawing

9 years agost/mesa: add 2d indexing support to outputs
Ilia Mirkin [Sun, 13 Jul 2014 19:02:53 +0000 (15:02 -0400)]
st/mesa: add 2d indexing support to outputs

9 years agost/mesa: handle tessellation 2D varyings correctly
Marek Olšák [Sun, 22 Feb 2015 19:47:31 +0000 (20:47 +0100)]
st/mesa: handle tessellation 2D varyings correctly

9 years agost/mesa: lower gl_TessLevel from float[] to vecn
Ilia Mirkin [Sun, 13 Jul 2014 00:09:06 +0000 (20:09 -0400)]
st/mesa: lower gl_TessLevel from float[] to vecn

9 years agost/mesa: query shader CAPs for tessellation
Ilia Mirkin [Sat, 12 Jul 2014 21:28:24 +0000 (17:28 -0400)]
st/mesa: query shader CAPs for tessellation

The MaxTessPatchComponents query added by Marek.

9 years agost/mesa: add texture updates for tessellation programs
Ilia Mirkin [Sat, 12 Jul 2014 21:15:51 +0000 (17:15 -0400)]
st/mesa: add texture updates for tessellation programs

9 years agost/mesa: handle constbufs/ubos for tessellation shaders
Ilia Mirkin [Sat, 12 Jul 2014 21:10:59 +0000 (17:10 -0400)]
st/mesa: handle constbufs/ubos for tessellation shaders

9 years agost/mesa: add conversion for tessellation shaders
Marek Olšák [Sun, 22 Feb 2015 19:44:39 +0000 (20:44 +0100)]
st/mesa: add conversion for tessellation shaders

Based on code from Ilia Mirkin <imirkin@alum.mit.edu>.

9 years agost/mesa: add tessellation shader states
Ilia Mirkin [Sat, 12 Jul 2014 02:11:21 +0000 (22:11 -0400)]
st/mesa: add tessellation shader states

additional fixes by Marek

9 years agomesa: implement GL_IS_PER_PATCH
Marek Olšák [Tue, 16 Jun 2015 11:07:04 +0000 (13:07 +0200)]
mesa: implement GL_IS_PER_PATCH

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: use separate varying slots for patch varyings
Marek Olšák [Sat, 13 Jun 2015 11:50:12 +0000 (13:50 +0200)]
glsl: use separate varying slots for patch varyings

The idea is to allow 32 normal varyings and 32 patch varyings,
a total of 64. Previously, only a total of 32 was allowed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: fix locations of 2-dimensional varyings without varying packing (v2)
Marek Olšák [Sat, 16 May 2015 19:12:54 +0000 (21:12 +0200)]
glsl: fix locations of 2-dimensional varyings without varying packing (v2)

v2: renamed producer/consumer_type -> producer/consumer_stage

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: don't demote tess control shader outputs
Marek Olšák [Fri, 3 Oct 2014 22:13:42 +0000 (00:13 +0200)]
glsl: don't demote tess control shader outputs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: disable varying packing between tessellation shaders
Marek Olšák [Fri, 3 Oct 2014 22:15:33 +0000 (00:15 +0200)]
glsl: disable varying packing between tessellation shaders

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow indexing of gl_out with a non-const if length isn't known
Marek Olšák [Tue, 16 Jun 2015 00:43:55 +0000 (02:43 +0200)]
glsl: allow indexing of gl_out with a non-const if length isn't known

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow redeclaration of TCS gl_out[]
Chris Forbes [Fri, 12 Sep 2014 09:27:26 +0000 (21:27 +1200)]
glsl: allow redeclaration of TCS gl_out[]

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: validate restrictions on use of barrier()
Chris Forbes [Sun, 7 Sep 2014 09:42:50 +0000 (21:42 +1200)]
glsl: validate restrictions on use of barrier()

With the exception of always-taken switch cases (which are
indistinguishable from straight line code in our IR), this
disallows use of the builtin barrier() function in all the
places it may not appear.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow barrier() in tessellation control shaders
Marek Olšák [Sun, 14 Jun 2015 18:14:22 +0000 (20:14 +0200)]
glsl: allow barrier() in tessellation control shaders

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: analyze TES usage of gl_ClipDistance
Chris Forbes [Tue, 9 Sep 2014 07:25:02 +0000 (19:25 +1200)]
glsl: analyze TES usage of gl_ClipDistance

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: push vertex count determination down one level
Chris Forbes [Sun, 7 Sep 2014 06:19:15 +0000 (18:19 +1200)]
glsl: push vertex count determination down one level

We have the prog here, so we don't need the caller to work this out for
us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: pass shader stage to lower_output_reads and handle tess control
Ilia Mirkin [Tue, 22 Jul 2014 01:59:37 +0000 (21:59 -0400)]
glsl: pass shader stage to lower_output_reads and handle tess control

Tessellation control outputs can be read in directly without first
having been written. Accessing these will require some special logic
anyways, so just let them through.

V2: Never lower tess control output reads, whether patch or not -- both
can be read back by other threads.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>