aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* nouveau/codegen: set dType to S32 for OP_NEG U32Ilia Mirkin2014-01-273-7/+27
| | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to do an OP_NEG from U32 to U32. This was manifested on nv50 in glsl-fs-atan-3 which was generating a UMAD TEMP[0].x, TEMP[0].xxxx, -TEMP[5].xxxx, TEMP[0].xxxx instruction. (For some reason, nvc0 causes a different shader to be generated.) This led to a cvt neg u32 $r1 u32 $r1 Which did not yield the desired result. This changes the final output to cvt neg s32 $r1 u32 $r1 which produces the desired output and the piglit tests passes. My assumption is that this is also what we want on nvc0, but could not test as there was no suitable shader that generated the problem instruction. Signed-off-by: Ilia Mirkin <[email protected]>
* util/u_vbuf: correct map offset calculation for crazy offsetsIlia Mirkin2014-01-271-1/+1
| | | | | | | | | When the min_index is very large (or very negative), the multipliation can overflow 32 bits and result in an incorrect map pointer modification. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* translate: deal with size overflows by casting to ptrdiff_tIlia Mirkin2014-01-272-3/+7
| | | | | | | | | | | This was discovered as a result of the draw-elements-base-vertex-neg piglit test, which passes very negative offsets in, followed up by large indices. The nouveau code correctly adjusts the pointer, but the translate code needs to do the proper inverse correction. Similarly fix up the SSE code to do a 64-bit multiply to compute the proper offset. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/rtasm: handle mmap failures appropriatelyEmil Velikov2014-01-271-3/+7
| | | | | | | | | | | | | | For a variety of reasons mmap (selinux and pax to name a few) and can fail and with current code. This will result in a crash in the driver, if not worse. This has been the case since the inception of the gallium copy of rtasm. Cc: 9.1 9.2 10.0 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73473 Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
* i965: Don't store qpitch / 4 as mt->qpitch for compressed surfaces.Kenneth Graunke2014-01-252-5/+8
| | | | | | | | | | | | | | | | | | | | Broadwell requires software to specify QPitch in a bunch of packets, so we decided to store it in the miptree. However, when I did that refactoring, I missed a subtlety: the hardware expects QPitch to be "in units of rows in the uncompressed surface". This is the value we originally compute. However, for compressed surfaces, we then divided it by 4 (the block height), to obtain the physical layout. This is no longer the QPitch Broadwell expects. So, store the original undivided value in mt->qpitch, but continue to use the divided value in brw_miptree_layout_texture_array(). For non-Broadwell platforms, this should have no impact at all. Helps fix Piglit's "getteximage-targets S3TC CUBE" test on Broadwell. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Simplify built-in generator functions for min3/max3/mid3.Kenneth Graunke2014-01-241-77/+60
| | | | | | | | | The type of all three parameters are identical, so we don't need to specify it three times. The predicate is always identical too, so we don't need to make it a parameter, either. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Fix chained assignments of vector channels.Kenneth Graunke2014-01-241-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple shaders such as: void splat(vec2 v, float f) { v[0] = v[1] = f; } failed to compile with the following error: error: value of type vec2 cannot be assigned to variable of type float First, we would process v[1] = f, and transform: LHS: (expression float vector_extract (var_ref v) (constant int (1))) RHS: (var_ref f) into: LHS: (var_ref v) RHS: (expression vec2 vector_insert (var_ref v) (constant int (1)) (var_ref f)) Note that the LHS type is now vec2, not a float. This is surprising, but not the real problem. After emitting assignments, this ultimately becomes: (declare (temporary) vec2 assignment_tmp) (assign (xy) (var_ref assignment_tmp) (expression vec2 vector_insert (var_ref v) (constant int (1)) (var_ref f))) (assign (xy) (var_ref v) (var_ref assignment_tmp)) We would then return (var_ref assignment_tmp) as the rvalue, which has the wrong type---it should be float, but is instead a vec2. To fix this, we simply return (vector_extract (var_ref assignment_temp) <the appropriate channel>) to pull out the desired float value. Fixes Piglit's chained-assignment-with-vector-constant-index.vert and chained-assignment-with-vector-dynamic-index.vert tests. Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74026 Reported-by: Dan Ginsburg <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.Kenneth Graunke2014-01-241-6/+6
| | | | | | | | | | | 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: [email protected] Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* Update .gitignore for Catalan translations build artifactsPaul Berry2014-01-241-0/+1
| | | | | | Causes git to ignore the new build artifacts introduced by commit d5e5367e8992c2e5322d35fba8d86c33a0db6825 (driconf: Add Catalan translations).
* mesa: Increment the list pointer while freeing instruction dataIan Romanick2014-01-241-0/+1
| | | | | | | | | | | | | 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 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72214 Reviewed-by: Brian Paul <[email protected]> Cc: Lu Ha <[email protected]>
* svga: rename "tex_usage" to "bindings", add commentsBrian Paul2014-01-241-7/+11
| | | | Trivial.
* st/mesa: add a simple sanity check assertion in st_validate_attachment()Brian Paul2014-01-241-0/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* i965/gen7: Use to the correct program when uploading transform feedback state.Paul Berry2014-01-232-10/+6
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Ensure that transform feedback refers to the correct program.Paul Berry2014-01-232-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> v2: make the for loop in get_xfb_source() clearer. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove *_generator::shader field; use prog field instead.Paul Berry2014-01-237-18/+8
| | | | | | | | | | | | | | | 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 <[email protected]>
* glcpp: Define GL_EXT_shader_integer_mix in both GL and ES.Matt Turner2014-01-231-3/+5
| | | | | Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]>
* glcpp: Remove unused gl_api bits.Matt Turner2014-01-232-2/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* glcpp: Set extension defines after resolving the GLSL version.Matt Turner2014-01-233-143/+172
| | | | | | | | | | | | | | | | | | | | | | 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: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71630 Reviewed-by: Ian Romanick <[email protected]>
* glsl: Disable ARB_texture_rectangle in shader version 100.Anuj Phogat2014-01-231-0/+4
| | | | | | | | | | | | | OpenGL with ARB_ES2_compatibility allows shaders that specify #version 100. This fixes the Khronos OpenGL test(Texture_Rectangle_Samplers_frag.test) failure. Cc: [email protected] Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Anuj Phogat <[email protected]>
* glsl: Mark GLSL 4.40 as a known version.Matt Turner2014-01-231-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: fix glReadBuffer(GL_NONE) segfaultBrian Paul2014-01-231-1/+2
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956 Cc: 10.0 <[email protected]> Tested-by: Ahmed Allam <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: fix PS output register setup regressionBrian Paul2014-01-232-3/+5
| | | | | | | | | | | | Fixes glean fragProg1 regression caused by commit b9f68d927ea (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 <[email protected]>
* glx: link loader util lib only when building with dri3Emil Velikov2014-01-231-1/+1
| | | | | | | | | | | | | | | | 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 eac776cf779b705cbfb8d41812f1d171fb09c76f Author: Emil Velikov <[email protected]> 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 <[email protected]>
* driconf: Add Catalan translationsAlex Henrie2014-01-232-1/+322
| | | | | | See the instructions in Makefile.am under "Adding new translations". Reviewed-by: Eric Anholt <[email protected]>
* driconf: Correct and update Spanish translationsAlex Henrie2014-01-231-31/+33
| | | | Reviewed-by: Eric Anholt <[email protected]>
* driconf: Synchronize po filesAlex Henrie2014-01-235-357/+702
| | | | | | | See the instructions in Makefile.am under "Updating existing translations". Reviewed-by: Eric Anholt <[email protected]>
* mesa: Set gl_constants::MinMapBufferAlignmentIan Romanick2014-01-231-0/+1
| | | | | | | | | | | | 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 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73907 Reviewed-by: Kenneth Graunke <[email protected]> Cc: Lu Hua <[email protected]>
* radeon / r200: Eliminate BEGIN_BATCH_NO_AUTOSTATEIan Romanick2014-01-2311-32/+27
| | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: Marek Olšák <[email protected]>
* radeon / r200: Remove unused 'dostate' parameterIan Romanick2014-01-232-4/+2
| | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: Marek Olšák <[email protected]>
* radeon / r200: Fix 'empty body' warningIan Romanick2014-01-231-2/+2
| | | | | | | | | 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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: Marek Olšák <[email protected]>
* radeon / r200: Fix incompatible pointer type warningIan Romanick2014-01-231-2/+1
| | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: Marek Olšák <[email protected]>
* draw: Save original driver functions earlier.José Fonseca2014-01-232-14/+14
| | | | | | | | Otherwise they will be NULL when stage destroy is invoked prematurely, (i.e, on out of memory). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: whitespace fixes in glformats.cBrian Paul2014-01-231-75/+51
| | | | | | | Reindent _mesa_get_nongeneric_internalformat() to match other functions. Remove extraneous empty lines in _mesa_get_linear_internalformat(). Trivial.
* svga: minor code movement in svga_tgsi_insn.cBrian Paul2014-01-231-47/+47
| | | | Reviewed-by: José Fonseca <[email protected]>
* svga: whitespace, formatting fixes in svga_state_framebuffer.cBrian Paul2014-01-231-31/+26
| | | | Reviewed-by: José Fonseca <[email protected]>
* svga: simplify common immediate value constructionBrian Paul2014-01-232-91/+115
| | | | | | | 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 <[email protected]>
* svga: add comments, etc to svga_tgsi_insn.c codeBrian Paul2014-01-231-31/+163
| | | | | | To make things a little easier to understand for newcomers. Reviewed-by: José Fonseca <[email protected]>
* svga: assorted cleanups in shader codeBrian Paul2014-01-231-1/+0
| | | | Reviewed-by: José Fonseca <[email protected]>
* svga: rename shader_result -> variantBrian Paul2014-01-238-142/+158
| | | | | | | To be more consisten with other parts of gallium. Plus, update/add various comments. Reviewed-by: José Fonseca <[email protected]>
* mesa: rename unbind_texobj_from_imgunits()Brian Paul2014-01-231-4/+4
| | | | | | | ... to unbind_texobj_from_image_units() and change a local var's type to silence an MSVC warning. Reviewed-by: Marek Olšák <[email protected]>
* glsl: silence a couple warnings in find_active_atomic_counters()Brian Paul2014-01-231-1/+2
| | | | | | | Silence unitialized variable 'id' warning. Silence unused 'found' warning. Only seen in release builds. Reviewed-by: Marek Olšák <[email protected]>
* mesa: initialize "is_layered" variable to silence warningBrian Paul2014-01-231-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix/add some cases in _mesa_get_linear_internalformat()Brian Paul2014-01-231-1/+7
| | | | | | | | 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 <[email protected]>
* mesa: add missing ETC2_SRGB cases in formats.cBrian Paul2014-01-231-0/+12
| | | | | | | In the _mesa_get_format_color_encoding() and _mesa_get_srgb_format_linear() functions. Reviewed-by: Marek Olšák <[email protected]>
* radeon: More missing stdio.h includes.José Fonseca2014-01-232-0/+3
|
* os/os_thread: Revert pipe_barrier pre-processing logic.José Fonseca2014-01-231-1/+1
| | | | | Whitelist platforms instead of blacklisting, as several pthread implementations are missing pthread_barrier_t, in particular MacOSX.
* radeon: Adding missing stdio.h include.José Fonseca2014-01-231-0/+1
| | | | | | 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.
* mapi: Prevent cast from pointer to integer of different size.José Fonseca2014-01-231-1/+1
| | | | On Windows64.
* egl: Use C11 thread abstractions.José Fonseca2014-01-231-19/+7
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mapi: Use C11 thread abstractions.José Fonseca2014-01-231-152/+13
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>