Christoph Bumiller [Fri, 7 Dec 2012 21:43:10 +0000 (22:43 +0100)]
nv50,nvc0: fix shader eviction
Christoph Bumiller [Fri, 7 Dec 2012 21:47:40 +0000 (22:47 +0100)]
nv50,nvc0: add support for cube map arrays
NOTE: nv50 support not enabled, someone with nva3/8 please fix.
Stefan Dösinger [Fri, 7 Dec 2012 16:38:35 +0000 (17:38 +0100)]
r300: Don't disable destination read if the src blend factor needs it
The read can remain disabled if the src alpha factor needs it because
the result would still be zero.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57984
NOTE: This is a candidate for stable release branches.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Michel Dänzer [Fri, 7 Dec 2012 11:20:57 +0000 (12:20 +0100)]
gallium/egl-static: Fix unresolved symbol 'clock_gettime'.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
José Fonseca [Tue, 4 Dec 2012 19:06:54 +0000 (19:06 +0000)]
gallivm: Rudimentary native integer support.
Just enough for draw module to work ok.
This improves "piglit attribs GL3", though something fishy is still
happening with certain unsigned integer values.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Tue, 4 Dec 2012 16:55:32 +0000 (16:55 +0000)]
draw: Dump LLVM shader key.
Just like we do in llvmpipe for the fragment shader compilation key.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Tue, 4 Dec 2012 16:54:41 +0000 (16:54 +0000)]
gallivm: Allow indirection from TEMP registers too.
The ADDR file is cumbersome for native integer capable drivers. We
should consider deprecating it eventually, but this just adds support
for indirection from TEMP registers.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Tue, 4 Dec 2012 14:52:44 +0000 (14:52 +0000)]
gallivm,llvmpipe,draw: Support multiple constant buffers.
Support 16 (defined in LP_MAX_TGSI_CONST_BUFFERS) as opposed to 32 (as
defined by PIPE_MAX_CONSTANT_BUFFERS) because that would make the jit
context become unnecessarily large.
v2: Bump limit from 4 to 16 to cover ARB_uniform_buffer_object needs,
per Dave Airlie.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 04:36:08 +0000 (05:36 +0100)]
st/dri: implement MSAA for GLX/DRI2 framebuffers
All MSAA buffers are allocated privately and resolved into the DRI-provided
back and front buffers.
If an MSAA visual is chosen, the buffers st/mesa receives are all
multi-sample. st/mesa doesn't have access to the single-sample buffers
in that case.
This makes MSAA work in games like Nexuiz.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 15:24:59 +0000 (16:24 +0100)]
gallium: pass the current context to the flush_front state tracker function
I will later use the context to resolve an MSAA front buffer.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 02:40:43 +0000 (03:40 +0100)]
st/dri: don't expose MSAA configs with accumulation buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 02:21:04 +0000 (03:21 +0100)]
st/dri: refactor dri_fill_in_modes
- We can use a single loop for adding new configs.
- The useless parameter depth_bits is removed.
- The maximum number of samples is bumped to 32.
- We can support Z16_UNORM and Z32_UNORM unconditionally since the zbuffers
are private.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 00:26:22 +0000 (01:26 +0100)]
st/dri: always allocate private depth-stencil buffers
This disables DRI2 sharing of zbuffers. The window zbuffer is allocated just
like any other texture - through resource_create.
The idea of allocating a zbuffer through DRI2 isn't very useful with MSAA,
where a single-sample zbuffer is useless.
IIRC, the Intel driver does the same thing.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 16:34:58 +0000 (17:34 +0100)]
st/mesa: implement CopyTexSubImage for MSAA framebuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
Just use pipe->blit, which can do resolve, flipping, and format conversions.
The util_blit_pixels codepath is still there for the cases where we have to
force alpha to 1.
This also turns on acceleration for copying GL_DEPTH_STENCIL.
Marek Olšák [Mon, 3 Dec 2012 20:31:04 +0000 (21:31 +0100)]
gallium/u_blitter: fix conflict with u_memory.h
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 21:21:39 +0000 (22:21 +0100)]
r600g: transfers of MSAA color textures should do the resolve
so that ReadPixels and various fallbacks work.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 04:35:30 +0000 (05:35 +0100)]
trace: dump pipe_resource::nr_samples
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 3 Dec 2012 04:15:11 +0000 (05:15 +0100)]
glx/dri2: set the __DRI2_FLUSH_DRAWABLE flag where it should be set
Sorry, I accidentally omitted this.
It only broke MLAA.
Reviewed-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Thu, 6 Dec 2012 17:36:25 +0000 (18:36 +0100)]
build: Fix GLES linkage without libglapi
fixes a regression introduced with
fc9ea7c74dc5cb996c3d9fe6663fd6da080e8360
NOTE: This is a candidate for the 9.0 branch.
Reported-by: Brian Paul <brianp@vmware.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Dave Airlie [Thu, 6 Dec 2012 22:31:57 +0000 (08:31 +1000)]
llvmpipe: fix regression in gears speed.
This fixes the gears regression since transform feedback.
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Kenneth Graunke [Tue, 20 Nov 2012 06:36:28 +0000 (22:36 -0800)]
glsl: Add missing semicolon in the grammar
This may not be strictly necessary, but every other rule in the grammar ends
with a semicolon. It also appears that this was supposed to be commited with
the original patch that changed this rule, but the wrong version of the patch
was accidentally pushed.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Fri, 9 Nov 2012 20:26:42 +0000 (12:26 -0800)]
glsl: Allow layout qualifiers in GLSL 3.00 ES
Note that while 'packed' is a reserved word in GLSL ES, row_major is not.
This means that we have to use the string-based matching for that.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Sat, 4 Aug 2012 22:42:33 +0000 (15:42 -0700)]
glsl: Create builtin function profiles for GLSL 3.00 ES.
Nearly all of the builtin functions in GLSL 3.00 ES are already
implemented in Mesa; this patch enables them.
A few functions are not implemented yet; those have been commented
out, with a FIXME comment to act as a reminder of what still needs to
be implemented. Here is the complete list: packSnorm2x16,
unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16,
unpackHalf2x16.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Mon, 6 Aug 2012 21:36:31 +0000 (14:36 -0700)]
glsl: add determinant() functions.
These functions are defined in GLSL 1.50 and GLES 3.00 ES.
The formulas have been extracted from the existing implementation of
inverse().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Sat, 4 Aug 2012 17:43:53 +0000 (10:43 -0700)]
glsl: Make builtin function profiles for GLSL ES use "es" in the filename.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Sat, 4 Aug 2012 17:29:49 +0000 (10:29 -0700)]
glsl: Add builtin variables for GLSL 3.00 ES.
This patch also adds assertions so that when we add new GLSL versions,
we'll notice that we need to update the builtin variables.
[v2, idr]: s/Frab/Frag/ Noticed by Eric.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 20:38:57 +0000 (13:38 -0700)]
glsl: Populate built-in types correctly for GLSL 3.00 ES.
This patch implements all of the built-in types for GLSL 3.00 ES.
This is almost exactly the same as the set of built-in types for GLSL
1.30, except ate 1D samplers are skipped, and samplerCubeShadow is
added.
This patch also addes an assertion so that when we add new GLSL
versions, we'll notice that we need to update the types.
In review, Eric noted:
"This change looks correct. The overall interaction of profiles is
getting ugly, though. I'm imagining a restructure of the symbol
table population so that there's a big list of types, and each
#version has a nice list of strings of type names copy and pasted
out of its spec."
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Sat, 4 Aug 2012 17:00:20 +0000 (10:00 -0700)]
glsl: Make {Min,Max}ProgramTexelOffset available to compiler.
These constants need to be made available to shaders in GLSL 3.00 ES.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Fri, 3 Aug 2012 00:51:02 +0000 (17:51 -0700)]
glsl: Fix linker checks for GLSL ES 3.00.
This patch updates the following linker checks to do the right thing
in GLSL 3.00 ES:
- Failing to write to gl_Position is allowed in GLSL 1.40+ as well as
GLSL 3.00 ES.
- It is an error to write to both gl_ClipVertex and gl_ClipDistance in
GLSL 1.30+. This does not apply to GLSL 3.00 ES.
- GLSL 3.00 ES uses the same varying counting rules as GLSL 1.00 ES.
- In GLSL 1.30 and GLSL 3.00 ES, "discard" terminates the shader.
- In GLSL 1.00 ES and GLSL 3.00 ES, both a fragment and a vertex
shader must be present.
[v2, idr]: Fix minro typo in a comment. Noticed by Ken.
[v3, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Fri, 3 Aug 2012 00:50:43 +0000 (17:50 -0700)]
glsl: Record in gl_shader_program whether the program uses GLSL ES.
Previously we recorded just the GLSL version (or the max version, if
GLSL 1.10 and GLSL 1.20 programs were linked together).
[v2, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Fri, 3 Aug 2012 00:49:44 +0000 (17:49 -0700)]
glsl: Clean up shading language mixing check for GLSL 3.00 ES.
Previously, we prohibited mixing of shading language versions if
min_version == 100 or max_version >= 130. This was technically
correct (since desktop GLSL 1.30 and beyond prohibit mixing of shading
language versions, as does GLSL 1.00 ES), but it was confusing. Also,
we asserted that all shading language versions were between 1.00 and
1.40, which was unnecessary (since the parser already checks shading
language versions) and doesn't work for GLSL 3.00 ES.
This patch changes the code to explicitly check that (a) ES shaders
aren't mixed with desktop shaders, (b) shaders aren't mixed between ES
versions, and (c) shaders aren't mixed between desktop GLSL versions
when at least one shader is GLSL 1.30 or greater. Also, it removes
the unnecessary assertion.
[v2, idr]: Slightly tweak the is_es_prog detection to occur outside the loop
instead of doing something special on the first loop iteration. Suggested by
Ken.
[v3, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Fri, 3 Aug 2012 00:47:49 +0000 (17:47 -0700)]
glsl: Record in gl_shader whether the shader uses GLSL ES.
Previously we recorded just the GLSL version, with the knowledge that
100 means GLSL 1.00 ES. With the advent of GLSL 3.00 ES, this is
going to get more complex, and eventually will probably become
ambiguous (GLSL 4.00 already exists, and GLSL 4.00 ES is likely to be
created some day).
To reduce confusion, this patch simply records whether the shader is
GLSL ES as an explicit boolean.
[v2, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 18:17:30 +0000 (11:17 -0700)]
glsl/parser: Handle "#version 300 es" directive.
Note that GLSL 1.00 is selected using "#version 100", so "#version 100
es" is prohibited.
v2: Check for GLES3 before allowing '#version 300 es'
v3: Make sure a correct language_version is set in
_mesa_glsl_parse_state::process_version_directive.
Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 18:02:55 +0000 (11:02 -0700)]
glsl/parser: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.
No functional change.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 20:21:54 +0000 (13:21 -0700)]
glsl/preprocessor: Handle "#version 300 es" directive.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 20:06:45 +0000 (13:06 -0700)]
glsl/preprocessor: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.
No functional change.
[mattst88] v2: Use intmax_t instead of int for version argument. Would
otherwise write garbage after #version since PRIiMAX was reading 64-bits
instead of 32.
[idr] v3: A later commit fixes the caller of
_glcpp_parser_handle_version_declaration to pass the correct number of
parameters. Fix it in the patch that changes the interface instead.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 15:18:12 +0000 (08:18 -0700)]
glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.
This patch turns on the following features for GLSL ES 3.00:
- Array constructors, whole array assignment, and array comparisons.
- Second and third operands of ?: may be arrays.
- Use of "in" and "out" qualifiers on globals.
- Bitwise and modulus operators.
- Integral vertex shader inputs.
- Range-checking of literal integers.
- array.length method.
- Function calls may be constant expressions.
- Integral varyings must be qualified with "flat".
- Interpolation and centroid qualifiers may not be applied to vertex
shader inputs.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 15:17:55 +0000 (08:17 -0700)]
glsl: parse GLSL ES 3.00 keywords correctly.
GLSL ES 3.00 adds the following keywords over GLSL 1.00: uint,
uvec[2-4], matNxM, centroid, flat, smooth, various samplers, layout,
switch, default, and case.
Additionally, it reserves a large number of keywords, some of which
were already reserved in versions of desktop GL that Mesa supports,
some of which are new to Mesa.
A few of the reserved keywords in GLSL ES 3.00 are keywords that are
supported in all other versions of GLSL: attribute, varying,
sampler1D, sampler1DShador, sampler2DRect, and sampler2DRectShadow.
This patch updates the lexer to handle all of the new keywords
correctly when the language being parsed is GLSL 3.00 ES.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 02:04:59 +0000 (19:04 -0700)]
glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.
This patch expands the lexer KEYWORD macro to take two additional
arguments: the GLSL ES versions in which the given keyword was first
reserved, and supported, respectively. This will allow us to
trivially add support for GLSL 3.00 ES keywords, even though the set
of GLSL 3.00 ES keywords is neither a subset or a superset of the
keywords corresponding to any desktop GLSL version.
The new KEYWORD macro makes use of the
_mesa_glsl_parse_state::is_version() function, so it accepts 0 as
meaning "unsupported" (rather than 999, which we used previously).
Note that a few keywords ("packed" and "row_major") are supported
*either* when GLSL 1.40 is in use or when ARB_uniform_buffer_obj
support is enabled. Previously, we handled these by cleverly taking
advantage of the fact that the KEYWORD macro didn't parenthesize its
arguments in the usual way. Now they are handled more
straightforwardly, with a new macro, KEYWORD_WITH_ALT.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Sun, 5 Aug 2012 16:57:01 +0000 (09:57 -0700)]
glsl: Make use of new _mesa_glsl_parse_state::check_version() function.
Previous to this patch, we were not very consistent about the errors
we generate when a shader tried to use a feature that is prohibited in
the current GLSL version. Some error messages failed to mention the
GLSL version currently in use (or did so inaccurately), and some error
messages failed to mention the first GLSL version in which the given
feature is allowed.
This patch reworks all of the error checks to use the check_version()
function, which produces error messages in a standard form
(approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION
($REQUIRED_GLSL_VERSION required).").
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Wed, 1 Aug 2012 21:50:05 +0000 (14:50 -0700)]
glsl: Make use of new _mesa_glsl_parse_state::is_version() function.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 02:09:24 +0000 (19:09 -0700)]
glsl: Add GLSL version query functions.
With the advent of GLSL 3.00 ES, the version checks we perform in the
GLSL compiler (to determine which language features are present) will
become more complicated. To reduce the complexity, this patch adds
functions check_version() and is_version() to _mesa_glsl_parse_state.
These functions take two version numbers: a desktop GLSL version and a
GLSL ES version, and return a boolean indicating whether the GLSL
version being compiled is at least the required version. So, for
example, is_version(130, 300) returns true if the GLSL version being
compiled is at least desktop GLSL 1.30 or GLSL 3.00.
The check_version() function additionally produces an error message if
the version check fails, informing the user of which GLSL version(s)
support the given feature.
[v2, idr]: Add PRINTFLIKE annotation to the new method. The numbering of th
parameters is correct because GCC is silly.
[v3, idr]: Fix copy-and-paste error in the comment before
_mesa_glsl_parse_state::is_version. Noticed by Ken.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 13:45:30 +0000 (06:45 -0700)]
glsl: Compute version_string on the fly.
Fixes a bug where version_string would be left uninitialized if no
GLSL "#version" directive was used.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 01:36:57 +0000 (18:36 -0700)]
glsl: Make a function to express a GLSL version ir human-readable form.
This will be useful in generating more helpful error messages,
especially with the addition of GLSL 3.00 ES support.
[v2, idr]: Rename ctx parameter to mem_ctx
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Thu, 2 Aug 2012 00:44:02 +0000 (17:44 -0700)]
glsl: Simplify symbol table version checking.
Previously, we stored the GLSL language version in the
glsl_symbol_table struct. But this was unnecessary--all
glsl_symbol_table needs to know is whether functions and variables
have separate namespaces (they do in GLSL 1.10 only).
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Paul Berry [Mon, 6 Aug 2012 17:22:44 +0000 (10:22 -0700)]
mesa: Add ARB_ES3_compatibility flag.
Adding this now makes it easier to develop and test GLES3 features, since we
can do initial development and testing using desktop GL. Later GLSL compiler
patches check for either ctx->Extensions.ARB_ES3_compatibility or
_mesa_is_gles3 to allow certain features (i.e., "#version 300 es").
[v2, idr]: Just edits to the commit message.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
Michel Dänzer [Mon, 3 Dec 2012 11:46:30 +0000 (12:46 +0100)]
radeonsi: Fix cube texture coordinates.
8 more piglits.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Michel Dänzer [Mon, 3 Dec 2012 11:45:41 +0000 (12:45 +0100)]
radeon/llvm: Export prepare_cube_coords helper to driver.
To be used by radeonsi.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Brian Paul [Thu, 6 Dec 2012 18:54:36 +0000 (11:54 -0700)]
mesa: use rand() instead of random()
As Vinson Lee did in commit
bb284669f85a32900bfec648d68ba4c4300772f4
in hash_table.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Jordan Justen [Tue, 4 Dec 2012 09:24:07 +0000 (01:24 -0800)]
mesa: validate that sync objects were created by mesa
Previously, the user could send in a pointer that was not created
by mesa. When we dereferenced that pointer, there would be an
exception.
Now we keep a set of pointers and verify that the pointer
exists in that set before dereferencing it.
Note: This fixes several crashing gles3conform tests.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Jordan Justen [Tue, 4 Dec 2012 09:17:23 +0000 (01:17 -0800)]
main/syncobj: return GL_INVALID_VALUE for invalid sync objects
Note: The GL/GLES3 web man pages don't seem to properly
document glWaitSync's error when the sync object is invalid.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Tue, 4 Dec 2012 09:03:57 +0000 (01:03 -0800)]
mesa: add set support (stores a set of pointers)
From: git://people.freedesktop.org/~anholt/hash_table
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: minor rework for mesa]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 6 Dec 2012 17:23:11 +0000 (17:23 +0000)]
llvmpipe: Fix statement before declaration.
José Fonseca [Wed, 5 Dec 2012 20:15:40 +0000 (20:15 +0000)]
util: Add util_copy_box helper.
Must users of util_copy_rect() need or should deal with volumes.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Wed, 5 Dec 2012 09:04:21 +0000 (09:04 +0000)]
gallium/util: Move the util_copy/fill_rect into u_surface.
u_rect.h said these should move to a different file, and u_surface seems
a better home.
Leave #include "util/u_surface.h" to avoid having to touch thousand of
files.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Wed, 5 Dec 2012 08:59:21 +0000 (08:59 +0000)]
gallium/os: Cleanup up os_time_get/os_time_get_nano.
- Re-implement os_time_get in terms of os_time_get_nano() for consistency
- Use CLOCK_MONOTONIC as recommended
- Only use clock_gettime on Linux for now.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Tue, 4 Dec 2012 19:44:08 +0000 (19:44 +0000)]
gallium/os: Fix os_time_sleep() on Windows for small durations.
Prevents undetermined sleeps.
Reviewed-by: Brian Paul <brianp@vmware.com>
Stefan Dösinger [Wed, 5 Dec 2012 22:08:21 +0000 (23:08 +0100)]
meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER
Fixes clears in Wine on r200.
NOTE: This is a candidate for stable release branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stefan Dösinger [Wed, 5 Dec 2012 22:08:20 +0000 (23:08 +0100)]
radeon: Initialize swrast before setting limits
NOTE: This is a candidate for stable release branches.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stefan Dösinger [Wed, 5 Dec 2012 22:08:19 +0000 (23:08 +0100)]
r200: Initialize swrast before setting limits
Otherwise the driver announces 4096 vertex shader constants and other
way too high limits.
NOTE: This is a candidate for stable release branches.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Matthew Waters [Sun, 2 Dec 2012 11:28:34 +0000 (22:28 +1100)]
mesa: fix compiler warnings when including GL/gl.h with other gl headers
GL/gl.h provides some definitions (GL_FALSE, GL_ONE, etc) that have
the same value as other gl headers but are represented differently
(0 vs 0x0 and 1 vs 0x1).
This causes compiler warnings about redefining such definitions when
including GL/gl.h with other gl headers.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57802
Signed-off-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 6 Dec 2012 09:30:53 +0000 (09:30 +0000)]
gallivm: Fix lerping of (un)signed normalized numbers.
Several issues actually:
- Fix a regression in unsigned normalized in the rescaling
[0, 255] to [0, 256]
- Ensure we use signed shifts where appropriate (instead of
unsigned shifts)
- Refactor the code slightly -- move all the logic inside
lp_build_lerp_simple().
This change, plus an adjustment in the tolerance of signed normalized
results in piglit fbo-blending-formats fixes bug 57903
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 6 Dec 2012 08:50:46 +0000 (08:50 +0000)]
gallivm: Fix lp_build_print_value of smaller integer types.
They need to be converted to the native integer type to prevent garbage
in higher order bits from being printed.
Reviewed-by: Brian Paul <brianp@vmware.com>
Brian Paul [Thu, 6 Dec 2012 15:34:08 +0000 (08:34 -0700)]
llvmpipe: remove unused variable
Brian Paul [Thu, 6 Dec 2012 00:18:30 +0000 (17:18 -0700)]
draw: remove some dead constant buffer code
Remove the draw_vs_set_constants() and draw_gs_set_constants()
functions and the draw->vs.aligned_constants,
draw->vs.aligned_constant_storage and draw->vs.const_storage_size
fields. None of it was used.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Chad Versace [Thu, 6 Dec 2012 05:34:26 +0000 (21:34 -0800)]
android: Fix build of libmesa_program
Commit 4097308 fixed the build in a questionable way. It worked at the
time, but, as Ian pointed out, the fix would likely fail at a future
commit due to the indeterminism of parallel builds. And that's exactly
what happened; the fix no longer works. `mm -j4` on Fedora 17 fails for
me.
The problem is that there is no rule for program_parse.tab.h. To fix that,
this patch adds a rule that makes program_parse.tab.c depend on
program_parse.tab.h. Technically, the c file does not depend on the
h file. However, because the two files are generated together by a single
invocation of Bison, any rule that forces execution of Bison is
sufficient.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Dave Airlie [Tue, 4 Dec 2012 20:50:07 +0000 (06:50 +1000)]
llvmpipe: EXT_transform_feedback support (v1.1)
I'd written most of this ages ago, but never finished it off.
This passes 115/130 piglit tests so far. I'll look into the
others as time permits.
v1.1: fix calloc return check as suggested by Jose.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Tue, 27 Nov 2012 22:10:52 +0000 (14:10 -0800)]
i965: Add a debug flag for counting cycles spent in each compiled shader.
This can be used for two purposes: Using hand-coded shaders to determine
per-instruction timings, or figuring out which shader to optimize in a
whole application.
Note that this doesn't cover the instructions that set up the message to
the URB/FB write -- we'd need to convert the MRF usage in these
instructions to GRFs so that our offsets/times don't overwrite our
shader outputs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
v2: Check the timestamp reset flag in the VS, which is apparently
getting set fairly regularly in the range we watch, resulting in
negative numbers getting added to our 32-bit counter, and thus large
values added to our uint64_t.
v3: Rebase on reladdr changes, removing a new safety check that proved
impossible to satisfy. Add a comment to the AOP defs from Ken's
review, and put them in a slightly more sensible spot.
v4: Check timestamp reset in the FS as well.
Eric Anholt [Wed, 28 Nov 2012 22:16:03 +0000 (14:16 -0800)]
i965: Add a flag for instructions with normal writemasking disabled.
For getting values from the new timestamp register, the channels we
load have nothing to do with the pixels dispatched.
Vincent Lejeune [Thu, 29 Nov 2012 22:46:15 +0000 (23:46 +0100)]
r600g: use default action for min/max opcode in tgsi to llvm
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Thu, 29 Nov 2012 22:43:31 +0000 (23:43 +0100)]
gallivm: Have a default emit function for min/max opcode
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Thu, 29 Nov 2012 22:45:30 +0000 (23:45 +0100)]
r600g: use default action for fdiv/rcp opcode
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Thu, 29 Nov 2012 22:43:05 +0000 (23:43 +0100)]
gallivm: have a default emit function for fdiv/rcp
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Tue, 27 Nov 2012 23:35:55 +0000 (00:35 +0100)]
r600g: Use default mul/mad function for tgsi-to-llvm
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Fri, 23 Nov 2012 16:53:06 +0000 (17:53 +0100)]
glsl: add new variable declaration in function body in lower_output_read
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Brian Paul [Tue, 4 Dec 2012 23:32:01 +0000 (16:32 -0700)]
draw: set precalc_flat flag for AA lines too
Fixes flat shading for AA lines. demos/src/trivial/line-smooth is a
test case which hits this.
Note: This is a candidate for the stable branches.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Chris Forbes [Wed, 5 Dec 2012 05:03:04 +0000 (18:03 +1300)]
mesa: expose ARB_texture_cube_map_array in core contexts as well
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@gmail.com>
Vinson Lee [Tue, 4 Dec 2012 07:24:12 +0000 (23:24 -0800)]
scons: Require drm to build gallium/state_trackers/egl/x11/x11_screen.c.
x11_screen.c includes xf86drm.h, which comes from libdrm-dev.
This patch fixes this build error.
Compiling src/gallium/state_trackers/egl/x11/x11_screen.c ...
src/gallium/state_trackers/egl/x11/x11_screen.c:30:21: fatal error: xf86drm.h: No such file or directory
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Eric Anholt [Fri, 9 Nov 2012 00:06:24 +0000 (16:06 -0800)]
i965/fs: Add support for uniform array access with a variable index.
Serious Sam 3 had a shader hitting this path, but it's used rarely so it
didn't show a significant performance difference (n=7). It does reduce
compile time massively, though -- one shader goes from 14s compile time
and 11723 instructions generated to .44s and 499 instructions.
Note that some shaders lose 16-wide mode because we don't support
16-wide and pull constants at the moment (generally, things looping over
a few-element array where the loop isn't getting unrolled). Given that
those shaders are being generated with 15-20% fewer instructions, it
probably outweighs the loss of 16-wide.
Eric Anholt [Thu, 8 Nov 2012 23:55:36 +0000 (15:55 -0800)]
i965/fs: Conditionalize constant-index UBO load code and add comments.
I wanted to separate this step for easier reviewing when I add the
variable-index case next.
Eric Anholt [Fri, 9 Nov 2012 19:48:20 +0000 (11:48 -0800)]
i965/fs: Restrict optimization that would fail for gen7's SENDs from GRFs
v2: Fix SNB math bug in register_coalesce() where I was looking at the
instruction to be removed, not the instruction to be copy propagated
into.
Eric Anholt [Mon, 26 Nov 2012 18:23:07 +0000 (10:23 -0800)]
i965/fs: Allow source mods on gen7+ math.
This gen6 restriction was removed in gen7 as the mathbox merge to act
more like a normal instruction was finished in the hardware.
Eric Anholt [Wed, 7 Nov 2012 19:18:34 +0000 (11:18 -0800)]
i965/fs: Add instruction emit for varying-index reads of uniforms.
The gen7 send-from-GRF path is sufficiently different from the perspective of
IR generation and optimization that I just made it a separate opcode.
v2: fix whitespace, rebase on Ken's recent refactor.
Eric Anholt [Wed, 7 Nov 2012 18:42:34 +0000 (10:42 -0800)]
i965/fs: Rename the existing pull constant load opcode.
We're going to use another send message for handling loads with a varying
per-fragment array index.
Eric Anholt [Fri, 9 Nov 2012 19:17:48 +0000 (11:17 -0800)]
i965: Add a header_present flag for setting up dp read messages.
As of gen7, we can skip the header on some messages, and this can make
optimization on those messages much nicer when you've got GRFs instead of MRFs
as the source.
Eric Anholt [Fri, 9 Nov 2012 19:38:14 +0000 (11:38 -0800)]
i965/gen7: Add some safety checks for send messages from GRFs.
José Fonseca [Tue, 4 Dec 2012 21:16:13 +0000 (21:16 +0000)]
gallivm: Re-add the kludge for lp_build_lerp of fixed point types.
I removed it in commit
7d44d354bdba853e453ce3991396e2b0933468f4 but
texture sample code still relies on it.
Not sure how to this cleanly, so put it pack for now.
José Fonseca [Tue, 4 Dec 2012 19:36:52 +0000 (19:36 +0000)]
scons: Link against librt
Fixes missing clock_gettime symbol.
José Fonseca [Sun, 2 Dec 2012 18:57:53 +0000 (18:57 +0000)]
util/u_debug: Cleanup/fix debug_dump_image.
- Handle other formats.
- Prevent CRLF on Windows.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Wed, 21 Nov 2012 16:17:22 +0000 (16:17 +0000)]
translate: Fix the fetch function assertions.
fetch_rgba_float is NULL for integer formats, and vice-versa.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Fri, 16 Nov 2012 17:57:38 +0000 (17:57 +0000)]
util/u_draw: Skip rendering instead of aborting when excessive number of instances is found.
This is a temporary hack. I believe the only way of properly fixing this
is to check buffer overflow just before fetching based on addresses,
instead of number of vertices/instances. This change simply allows tests
that stress buffer overflows to complete without asserting, and should
not affect valid rendering.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Fri, 16 Nov 2012 17:09:05 +0000 (17:09 +0000)]
draw: Properly limit vertex buffer fetches on draw arrays.
We need to clamp vertex buffer fetch based on its size, not based on the
user specified max index hint.
This matches draw_pt_fetch_run() above.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 15 Nov 2012 20:36:55 +0000 (20:36 +0000)]
draw: Use symbolic primitive names in debug output.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 15 Nov 2012 20:35:20 +0000 (20:35 +0000)]
draw: Consider the geometry shader when choosing the vertex size.
A single vertex size is chosen for the whole pipeline. So the number of
geometry shader outputs must also be taken in consideration.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 15 Nov 2012 14:20:35 +0000 (14:20 +0000)]
tgsi: Allow TXF from buffers.
There is more work necessary to properly support buffers in shaders, but
this gets things a bit further along.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 15 Nov 2012 14:19:55 +0000 (14:19 +0000)]
util/surface: Always use the surface format when clearing.
Not the texture format, as they might differ.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 15 Nov 2012 09:16:59 +0000 (09:16 +0000)]
tgsi: Increase maximum number of temps to 4096.
To match Shader Model 4 limits, as specified in
http://msdn.microsoft.com/en-us/library/windows/desktop/
ff471378.aspx
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Tue, 4 Dec 2012 19:09:28 +0000 (19:09 +0000)]
llvmpipe: Fix alignment.
My understanding and actual implementation of how the pixels are being
fetch differed.
This fixes bug 57863.
Trivial.
José Fonseca [Tue, 4 Dec 2012 13:38:52 +0000 (13:38 +0000)]
gallivm: Generalize lp_build_mul and lp_build_lerp for signed normalized types.
This fixes fdo bug 57755 and most of the failures of piglit fbo-blending-formats
GL_EXT_texture_snorm.
GL_INTENSITY_SNORM is still failing, but problem is probably elsewhere,
as GL_R8_SNORM works fine.
Dave Airlie [Mon, 3 Dec 2012 23:25:13 +0000 (09:25 +1000)]
automake/gallium: attempt to fix -lrt
fix non-automake bits in pipe-load to.
Should fix:
http://bugs.freedesktop.org/57852
Signed-off-by: Dave Airlie <airlied@redhat.com>