Commit Graph

60952 Commits

Author SHA1 Message Date
Kenneth Graunke 6c158e110c glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.
When processing assignments, we have both an LHS and RHS.  At a glance,
"lhs_expr" clearly refers to the LHS, while a generic name like "expr"
is ambiguous.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-24 14:18:15 -08:00
Paul Berry eab32bb8f1 Update .gitignore for Catalan translations build artifacts
Causes git to ignore the new build artifacts introduced by commit
d5e5367e89 (driconf: Add Catalan
translations).
2014-01-24 13:45:16 -08:00
Ian Romanick c11d76c51a mesa: Increment the list pointer while freeing instruction data
Since the list pointer was never incremented when a OPCODE_PIXEL_MAP
opcode was encountered, the data for the instruction would get freed
over and over and over... resulting in a crash.

Fixes gl-1.0-beginend-coverage.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72214
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: Lu Ha <huax.lu@intel.com>
2014-01-24 13:43:10 -08:00
Brian Paul a44554870e svga: rename "tex_usage" to "bindings", add comments
Trivial.
2014-01-24 13:33:29 -07:00
Brian Paul e2dd240e32 st/mesa: add a simple sanity check assertion in st_validate_attachment()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-24 13:33:13 -07:00
Paul Berry 43e77215b1 i965/gen7: Use to the correct program when uploading transform feedback state.
Transform feedback may come from either the geometry shader or the
vertex shader, so we can't use
ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the current
post-link transform feedback information.  Fortunately we can use
ctx->TransformFeedback.CurrentObject->shader_program.

Cc: 10.0 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-23 13:41:36 -08:00
Paul Berry e190709119 mesa: Ensure that transform feedback refers to the correct program.
Previous to this patch, the _mesa_{Begin,Resume}TransformFeedback
functions were using ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to
find the program that would be the source of transform feedback data.
This isn't correct--if there's a geometry shader present it should be
ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY].  (These might be
different if separate shader objects are in use).

This patch creates a function get_xfb_source(), which figures out the
correct program to use based on GL state, and updates
_mesa_{Begin,Resume}TransformFeedback to call it.  get_xfb_source() is
written in terms of the gl_shader_stage enum, so it should not need
modification when we add tessellation shaders in the future.  It also
creates a new driver flag, NewTransformFeedbackProg, which is flagged
whenever this program changes.

To reduce future confusion, this patch also rewords some comments and
error message text to avoid referring to vertex shaders.

Cc: 10.0 <mesa-stable@lists.freedesktop.org>

v2: make the for loop in get_xfb_source() clearer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-23 13:41:01 -08:00
Paul Berry 9cee3ff562 i965: Remove *_generator::shader field; use prog field instead.
The "shader" field in fs_generator, vec4_generator, and gen8_generator
was only used for one purpose; to figure out if we were compiling an
assembly program or a GLSL shader (shader is NULL for assembly
programs).  And it wasn't being used properly: in vec4 shaders we were
always initializing it based on
prog->_LinkedShaders[MESA_SHADER_FRAGMENT], regardless of whether we
were compiling a geometry shader or a vertex shader.

This patch simplifies things by using the "prog" field instead; this
is also NULL for assembly programs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-23 13:40:55 -08:00
Matt Turner 00c672086c gles3: Update gl3.h to revision 24614.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner d519ebb34c gles2: Update gl2ext.h to revision 24614.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner 117d8ce27b gles2: Update gl2.h to revision 24614.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner 66ef8feb4d glcpp: Define GL_EXT_shader_integer_mix in both GL and ES.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Matt Turner 73c3c7e37d glcpp: Remove unused gl_api bits.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Matt Turner b2d1c579bb glcpp: Set extension defines after resolving the GLSL version.
Instead of defining preprocessor macros in glcpp_parser_create based on
the GL API, wait until the shader version has been resolved. Doing this
allows us to correctly set (and not set) preprocessor macros for
extensions allowed by the API but not the shader, as in the case of
ARB_ES3_compatibility.

The shader version has been resolved when the preprocessor encounters
the first preprocessor token, since the GLSL spec says

   "The #version directive must occur in a shader before anything else,
    except for comments and white space."

Specifically, if a #version token is found the version is known
explicitly, and if any other preprocessor token is found then the GLSL
version is implicitly 1.10.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71630
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Anuj Phogat c907595ba7 glsl: Disable ARB_texture_rectangle in shader version 100.
OpenGL with ARB_ES2_compatibility allows shaders that specify #version
100.

This fixes the Khronos OpenGL test(Texture_Rectangle_Samplers_frag.test)
failure.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-01-23 11:33:22 -08:00
Matt Turner e0648015e9 glsl: Mark GLSL 4.40 as a known version.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-23 11:33:22 -08:00
Brian Paul f7c118ffbf st/mesa: fix glReadBuffer(GL_NONE) segfault
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Tested-by: Ahmed Allam <ahmabdabd@hotmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 11:08:40 -07:00
Brian Paul 349efdbba1 svga: fix PS output register setup regression
Fixes glean fragProg1 regression caused by commit b9f68d927e
(implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS).  This bug
only appears when the fragment shader emits fragment.Z before
color outputs.  The bug was caused by confusion between register
indexes and semantic indexes.

Also added some comments to better explain register indexing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-01-23 11:08:40 -07:00
Emil Velikov c6b6916b9a glx: link loader util lib only when building with dri3
Otherwise we pull libudev as a dependency and crash
games/programs that ship their own version of libudev.

Either way we should link the loader lib only when needed.
This fixes a regression caused by
commit eac776cf77
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Jan 11 02:24:43 2014 +0000

    glx: use the loader util lib

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73854
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-23 18:04:22 +00:00
Alex Henrie d5e5367e89 driconf: Add Catalan translations
See the instructions in Makefile.am under "Adding new translations".

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-23 09:10:19 -08:00
Alex Henrie 84529a5ddb driconf: Correct and update Spanish translations
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-23 09:10:18 -08:00
Alex Henrie 822b4315b7 driconf: Synchronize po files
See the instructions in Makefile.am under "Updating existing
translations".

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-23 09:10:18 -08:00
Ian Romanick e4fcae0755 mesa: Set gl_constants::MinMapBufferAlignment
Leaving it set to zero isn't really correct since every allocation has
at least an alignment of 1 byte.  It also caused a problem in the i965
driver after I removed the MAX(64, ...) from the alignment calculation.
That's what I get for changing a patch without retesting it. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73907
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Lu Hua <huax.lu@intel.com>
2014-01-23 08:50:58 -08:00
Ian Romanick 7a0f26dec9 radeon / r200: Eliminate BEGIN_BATCH_NO_AUTOSTATE
Sed job:

    grep -lr BEGIN_BATCH_NO_AUTOSTATE src/mesa/drivers/dri/ | while read f
    do
        cat $f | sed 's/BEGIN_BATCH_NO_AUTOSTATE/BEGIN_BATCH/g' > x
        mv x $f
    done

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
Ian Romanick 2d5fd20690 radeon / r200: Remove unused 'dostate' parameter
This parameter hasn't been used since January 2010 (commit 29e02c7).
Fixes the following warning in both radeon and r200:

radeon_common.c: In function 'r200_rcommonBeginBatch':
radeon_common.c:762:14: warning: unused parameter 'dostate' [-Wunused-parameter]

Note that now BEGIN_BATCH and BEGIN_PATCH_NO_AUTOSTATE are identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
Ian Romanick 5b4c12972c radeon / r200: Fix 'empty body' warning
radeon_common.c: In function 'radeon_draw_buffer':
radeon_common.c:237:3: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
Ian Romanick b790bed21e radeon / r200: Fix incompatible pointer type warning
When parameters were removed from dd_function_table::Viewport (commit
065bd6ff), radeon_viewport (in both radeon and r200) started generating
a warning.

radeon_common.c: In function 'r200_radeon_viewport':
radeon_common.c:415:15: warning: assignment from incompatible pointer type [enabled by default]
radeon_common.c:419:23: warning: assignment from incompatible pointer type [enabled by default]

I didn't notice this initially, and it's harmless because the function is
never called through the incorrectly typed pointer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:50:58 -08:00
José Fonseca 840154dc50 draw: Save original driver functions earlier.
Otherwise they will be NULL when stage destroy is invoked prematurely,
(i.e, on out of memory).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-23 15:49:32 +00:00
Brian Paul 1a44180578 mesa: whitespace fixes in glformats.c
Reindent _mesa_get_nongeneric_internalformat() to match other functions.
Remove extraneous empty lines in _mesa_get_linear_internalformat().

Trivial.
2014-01-23 08:31:21 -07:00
Brian Paul a15eb19676 svga: minor code movement in svga_tgsi_insn.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul f12954e1cb svga: whitespace, formatting fixes in svga_state_framebuffer.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul 56b876ecd0 svga: simplify common immediate value construction
Use some new helper functions to make the code much more readable.
And fix wrong value for XPD's w result.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul 023020d740 svga: add comments, etc to svga_tgsi_insn.c code
To make things a little easier to understand for newcomers.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:01 -07:00
Brian Paul fe043ae554 svga: assorted cleanups in shader code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:23:00 -07:00
Brian Paul 2a30379dcd svga: rename shader_result -> variant
To be more consisten with other parts of gallium.  Plus, update/add
various comments.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-01-23 08:22:58 -07:00
Brian Paul 35ddd2cc5d mesa: rename unbind_texobj_from_imgunits()
... to unbind_texobj_from_image_units() and change a local var's type
to silence an MSVC warning.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:14 -07:00
Brian Paul 1f2007429e glsl: silence a couple warnings in find_active_atomic_counters()
Silence unitialized variable 'id' warning.  Silence unused 'found' warning.
Only seen in release builds.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:14 -07:00
Brian Paul 5306ee736e mesa: initialize "is_layered" variable to silence warning
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:14 -07:00
Brian Paul b98fa6fe6f mesa: fix/add some cases in _mesa_get_linear_internalformat()
In some cases we were converting generic formats to sized formats
and vice versa.  The point is to simply convert sRGB formats to
corresponding linear formats.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:13 -07:00
Brian Paul 91567b83bf mesa: add missing ETC2_SRGB cases in formats.c
In the _mesa_get_format_color_encoding() and _mesa_get_srgb_format_linear()
functions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-23 08:13:13 -07:00
José Fonseca ab6f9fccd4 radeon: More missing stdio.h includes. 2014-01-23 14:20:20 +00:00
José Fonseca fa75cc4b89 os/os_thread: Revert pipe_barrier pre-processing logic.
Whitelist platforms instead of blacklisting, as several pthread
implementations are missing pthread_barrier_t, in particular MacOSX.
2014-01-23 13:44:10 +00:00
José Fonseca cd978ce26a c11: Fix missing pthread_mutex_timedlock declaration warnings on MacOSX. 2014-01-23 13:42:38 +00:00
José Fonseca 6b6fdb6aa9 radeon: Adding missing stdio.h include.
Became apparent with the C11 thread changes.  Unfortunately I didn't
have all dependencies to build the driver, and only noticed
this issue on build server.
2014-01-23 13:23:43 +00:00
José Fonseca ab5dc45b2f mapi: Prevent cast from pointer to integer of different size.
On Windows64.
2014-01-23 13:21:52 +00:00
José Fonseca 799f30f385 c11: Update docs/license.html and include verbatim copy of Boost license. 2014-01-23 12:55:55 +00:00
José Fonseca f298720cbc egl: Use C11 thread abstractions.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca 54876afcf0 mapi: Use C11 thread abstractions.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca fd33a6bcd7 gallium: Use C11 thread abstractions.
Note that PIPE_ROUTINE now returns an int.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00
José Fonseca ecaa81bd96 c11: Import threads.h emulation library.
Implementation is based of https://gist.github.com/2223710 with the
following modifications:
- inline implementatation
- retain XP compatability
- add temporary hack for static mutex initializers (as they are not part
  of the stack but still widely used internally)
- make TIME_UTC a conditional macro (some system headers already define
  it, so this prevents conflict)
- respect HAVE_PTHREAD macro

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-23 12:55:55 +00:00