Ilia Mirkin
82f7fad966
st/mesa: add barrier support
2015-07-23 00:59:30 +02:00
Ilia Mirkin
8f40428afb
st/mesa: disable copy propagation for tessellation shaders
...
This can't work due to shared inputs and outputs and barriers.
2015-07-23 00:59:30 +02:00
Ilia Mirkin
f4c13fad65
st/mesa: set vertices_per_patch when drawing
2015-07-23 00:59:30 +02:00
Ilia Mirkin
37d1809dd7
st/mesa: add 2d indexing support to outputs
2015-07-23 00:59:30 +02:00
Marek Olšák
c9998617a8
st/mesa: handle tessellation 2D varyings correctly
2015-07-23 00:59:30 +02:00
Ilia Mirkin
05c847433f
st/mesa: lower gl_TessLevel from float[] to vecn
2015-07-23 00:59:30 +02:00
Ilia Mirkin
d00e2763b1
st/mesa: query shader CAPs for tessellation
...
The MaxTessPatchComponents query added by Marek.
2015-07-23 00:59:30 +02:00
Ilia Mirkin
40bc1c32d2
st/mesa: add texture updates for tessellation programs
2015-07-23 00:59:29 +02:00
Ilia Mirkin
bda79139d4
st/mesa: handle constbufs/ubos for tessellation shaders
2015-07-23 00:59:29 +02:00
Marek Olšák
a58a66fe85
st/mesa: add conversion for tessellation shaders
...
Based on code from Ilia Mirkin <imirkin@alum.mit.edu>.
2015-07-23 00:59:29 +02:00
Ilia Mirkin
ba9fb96f86
st/mesa: add tessellation shader states
...
additional fixes by Marek
2015-07-23 00:59:29 +02:00
Marek Olšák
df4ee8ef36
mesa: implement GL_IS_PER_PATCH
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:29 +02:00
Marek Olšák
0af240e940
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>
2015-07-23 00:59:29 +02:00
Marek Olšák
d070238944
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>
2015-07-23 00:59:29 +02:00
Marek Olšák
41acdae2e9
glsl: don't demote tess control shader outputs
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:29 +02:00
Marek Olšák
3a4b87f26d
glsl: disable varying packing between tessellation shaders
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:29 +02:00
Marek Olšák
d5787e7eef
glsl: allow indexing of gl_out with a non-const if length isn't known
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:28 +02:00
Chris Forbes
19f46d0540
glsl: allow redeclaration of TCS gl_out[]
...
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:28 +02:00
Chris Forbes
8cf72972ce
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>
2015-07-23 00:59:28 +02:00
Marek Olšák
799afadf51
glsl: allow barrier() in tessellation control shaders
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:28 +02:00
Chris Forbes
df16e0dd63
glsl: analyze TES usage of gl_ClipDistance
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:28 +02:00
Chris Forbes
0e94f350ee
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>
2015-07-23 00:59:28 +02:00
Ilia Mirkin
567f1b2ee8
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>
2015-07-23 00:59:28 +02:00
Chris Forbes
61846f222f
glsl: properly size unsized arrays in tess stages
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:28 +02:00
Chris Forbes
d563946a40
glsl: restrict indexing for writes to TCS outputs to gl_InvocationID
...
Marek: handle ir_swizzle
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:28 +02:00
Chris Forbes
da7adb99e8
glsl: add builtin constants for ARB_tessellation_shader
...
Limits from other extensions added by Marek.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:27 +02:00
Chris Forbes
b7f98f9f09
glsl: allow nonconst indexing of arrays where we can work out an implicit size
...
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:27 +02:00
Chris Forbes
64a0ae88b9
glsl: relax unsized input/output block arrays for TCS/TES
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-07-23 00:59:27 +02:00
Marek Olšák
2abbe941e1
glsl: add the tessellation extension to the list for the "layout" qualifier
...
This is technically not needed, but it makes the compiler return a better
error message if tessellation is used with GLSL < 1.50.
Instead of:
error: syntax error, unexpected NEW_IDENTIFIER, expecting $end
It returns:
error: #version 150 layout qualifier `triangles' used
And the tessellation spec says:
OpenGL 3.2 and GLSL 1.50 are required.
So it makes perfect sense.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:27 +02:00
Marek Olšák
fb800b3dcd
glsl: don't lower variable indexing on non-patch tessellation inputs/outputs
...
There is no way to lower them, because the array sizes are unknown
at compile time.
Based on a patch from: Fabian Bieler <fabianbieler@fastmail.fm>
v2: add comments
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-07-23 00:59:27 +02:00
Fabian Bieler
0cfac91755
glsl: make stand-alone compiler work with tessellation shaders.
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:27 +02:00
Fabian Bieler
c53aa26379
glsl: add "in" or "out" prefix to name when flattening interface blocks
...
This is to prevent a name conflict in tessellation shaders built-in interface
blocks.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-07-23 00:59:27 +02:00
Fabian Bieler
73a9a1539a
glsl: lower gl_TessLevel* from float[n] to vecn.
...
Similar to gl_ClipDistance -> gl_ClipDistanceMESA
v2: - renamed is_mesa_var to lowered_builtin_array_variable
- moved LowerTessLevel into gl_constants
- cosmetic changes in lower_tess_level.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:27 +02:00
Fabian Bieler
54f2950297
glsl: make lower_clip_distance work with tessellation shaders.
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-07-23 00:59:27 +02:00
Chris Forbes
7c758c5a21
glsl: allow linking of tessellation shaders.
...
Marek: require a tess eval shader if a tess control shader is present
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-07-23 00:59:27 +02:00
Fabian Bieler
1009b3311f
glsl: add the patch in/out qualifier (v2)
...
v2: Dropped some unrelated reordering in glsl_parser.yy as Ken suggested.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Fabian Bieler
1036b024d4
glsl: add tessellation shader defines and built-in variables.
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Fabian Bieler
497eb29583
glsl: add tessellation shader parsing support (v2)
...
v2: Fixed things that Ken suggested.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Marek Olšák
206af9d049
mesa: don't allow drawing with tess ctrl shader and without tess eval shader
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Marek Olšák
3d528e7c47
mesa: handle tessellation shaders in use_shader_program
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Marek Olšák
882413f1c5
mesa: add program interface queries for tessellation shaders
...
Based on a patch by Chris Forbes <chrisf@ijw.co.nz>.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Fabian Bieler
550a570c53
mesa: add misc tessellation shader stuff
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Fabian Bieler
6823d713c6
mesa: add tessellation shader getters (v3)
...
Tessellation dependencies added by Marek.
v2: require tessellation in addition to atomics/images for some glGet queries
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:26 +02:00
Marek Olšák
cb0c12512c
mesa: allow setting of patch parameters.
...
Based on a patch from Fabian Bieler <fabianbieler@fastmail.fm>.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00
Chris Forbes
e32e546c17
mesa: require VS if TCS or TES is present in pipeline
...
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00
Chris Forbes
a30cc28829
mesa: allow tess stages in glUseProgramStages
...
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00
Fabian Bieler
6435b2909e
mesa: support tess stages in glGetProgramPipelineiv
...
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00
Marek Olšák
5852b5d2fa
mesa: take tessellation into account when validating GS input primitive mode
...
I've reported the bug in the Khronos bugzilla.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00
Chris Forbes
8e758c3a74
mesa: allow drawing of patch primitives
...
Cosmetic changes and fixes by Marek.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00
Marek Olšák
fa602c2088
mesa: add _mesa_has_tessellation
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-23 00:59:25 +02:00