Commit Graph

71422 Commits

Author SHA1 Message Date
Ilia Mirkin 7cf2bffe82 nvc0/ir: patch vertex count is stored in the upper bits 2015-07-23 03:33:09 -04:00
Ilia Mirkin e3e2df01bf nvc0/ir: add support for reading outputs in tess control shaders
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:09 -04:00
Ilia Mirkin 71744c0692 nvc0/ir: set perPatch flag on load/stores to per-patch varyings
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:09 -04:00
Ilia Mirkin c2350fb3db nvc0/ir: populate info structure based on new tess properties
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:09 -04:00
Ilia Mirkin 59438a4d0e 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>
2015-07-23 03:33:08 -04:00
Ilia Mirkin 4b2a58a523 nvc0: TESSCOORD comes in as a sysval, not an input
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:08 -04:00
Ilia Mirkin c8e5337a9a nvc0: add handling for set_tess_state callback
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:08 -04:00
Ilia Mirkin d1ffdebce6 nvc0: add support for setting patch vertices at draw time
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:08 -04:00
Ilia Mirkin b9ea557fd0 nvc0: support MAX_SHADER_PATCH_VARYINGS 2015-07-23 03:33:08 -04:00
Ilia Mirkin f97c14f9e4 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>
2015-07-23 03:33:08 -04:00
Dave Airlie 65d84daf29 docs/GL3.txt: update ARB_shader_subroutine status.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-07-23 17:26:13 +10:00
Dave Airlie c3fad009c5 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>
2015-07-23 17:26:09 +10:00
Dave Airlie a922c27993 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>
2015-07-23 17:26:04 +10:00
Dave Airlie 6f57fda494 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>
2015-07-23 17:25:59 +10:00
Dave Airlie 3f4f3e2d48 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>
2015-07-23 17:25:55 +10:00
Dave Airlie 0a18f16015 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>
2015-07-23 17:25:49 +10:00
Dave Airlie 60266863d8 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>
2015-07-23 17:25:43 +10:00
Dave Airlie 44ea8b9b8e 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>
2015-07-23 17:25:39 +10:00
Dave Airlie 7dd429e8f7 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>
2015-07-23 17:25:37 +10:00
Dave Airlie 65ac360823 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>
2015-07-23 17:25:35 +10:00
Dave Airlie 884df9ef83 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>
2015-07-23 17:25:34 +10:00
Dave Airlie 30681c3bb8 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>
2015-07-23 17:25:32 +10:00
Dave Airlie d8a250ce5e 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>
2015-07-23 17:25:31 +10:00
Dave Airlie 670b9e56da 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>
2015-07-23 17:25:29 +10:00
Dave Airlie f73ef82486 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>
2015-07-23 17:25:27 +10:00
Dave Airlie 57f24299b7 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
2015-07-23 17:25:25 +10:00
Chris Forbes d16ff8ac78 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>
2015-07-23 17:25:23 +10:00
Dave Airlie 24b0e50683 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>
2015-07-23 17:25:16 +10:00
Chris Forbes cc172fddf3 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>
2015-07-23 17:25:15 +10:00
Chris Forbes 25d6f56c08 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>
2015-07-23 17:25:14 +10:00
Chris Forbes 4c7b007104 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>
2015-07-23 17:25:13 +10:00
Chris Forbes b8f3e316bc 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>
2015-07-23 17:25:13 +10:00
Chris Forbes 2ffe9b5421 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>
2015-07-23 17:25:11 +10:00
Dave Airlie 2ca1f76781 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>
2015-07-23 12:46:46 +10:00
Dave Airlie 18955e8a80 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>
2015-07-23 12:46:42 +10:00
Dave Airlie b406c34a65 i965: fix warning since tess merge.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-07-23 10:39:26 +10:00
Marek Olšák bac12c8948 radeonsi: enable tessellation, update GL3.txt & release notes
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák a193c4978b radeonsi: add scratch buffer support for tessellation shaders
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák 12df9a7876 radeonsi: update invariant registers for tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák 99bf47f603 radeonsi: add assertions into draw_vbo and check tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák 5aa5f90823 radeonsi: set the rasterization primitive type for tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák 3344699243 radeonsi: set VGT_LS_HS_CONFIG for tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák 09d02fa463 radeonsi: update IA_MULTI_VGT_PARAM for tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák 74c1001d13 radeonsi: add derived tessellation state
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:33 +02:00
Marek Olšák db267a04ce radeonsi: implement a fixed-function tessellation control shader and its state
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:32 +02:00
Marek Olšák b6f4fdf6a9 radeonsi: set up a ring buffer for tessellation factors
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:32 +02:00
Marek Olšák ebfd9e0071 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>
2015-07-23 00:59:32 +02:00
Marek Olšák aa2fa6723a radeonsi: update si_get_vs_info and si_get_vs_state for tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:32 +02:00
Marek Olšák fff16e4ad2 radeonsi: add shader code generation for tessellation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:32 +02:00
Marek Olšák 4805685b6f radeonsi: implement TGSI_OPCODE_BARRIER
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-23 00:59:32 +02:00