Commit Graph

71434 Commits

Author SHA1 Message Date
Marek Olšák a6f39ec1c5 Revert "Match swrast modes more loosely."
This reverts commit f3728a16c9.

It broke glxgears on radeonsi. The window was just black.
2015-07-23 21:53:06 +02:00
Jose Fonseca d6b50ba980 gallivm: Fix profile build. 2015-07-23 16:54:02 +01:00
Jose Fonseca c6267ebd6c 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>
2015-07-23 15:57:53 +01:00
Tom Hughes f3728a16c9 Match swrast modes more loosely.
https://bugs.freedesktop.org/show_bug.cgi?id=90817

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-07-23 15:57:53 +01:00
Eduardo Lima Mitev b469cf10ef 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>
2015-07-23 16:31:14 +02:00
Tom Stellard a3b53beaa0 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>
2015-07-23 14:13:03 +00:00
Tom Stellard 9f7a68feaf 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>
2015-07-23 14:12:56 +00:00
Ilia Mirkin 6d8e466792 docs: mark off tess for nvc0 2015-07-23 03:39:46 -04:00
Ilia Mirkin 88818c4cd6 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>
2015-07-23 03:33:09 -04:00
Ilia Mirkin fd092328e1 nvc0/ir: cleanup private enums that have graduated to gallium
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-23 03:33:09 -04:00
Ilia Mirkin da89e75d9c 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>
2015-07-23 03:33:09 -04:00
Ilia Mirkin 77672cdb64 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>
2015-07-23 03:33:09 -04:00
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