summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa: fix truncated value warningDylan Noblesmith2012-04-131-1/+1
| | | | | | | | | | | | Silences a clang warning: format_pack.c:2546:30: warning: implicit conversion from 'int' to 'GLubyte' (aka 'unsigned char') changes value from 65535 to 255 [-Wconstant-conversion] d[i] = d[i] ? 0xffff : 0x0; ~ ^~~~~~ Reviewed-by: Brian Paul <[email protected]>
* mesa: don't cast away constDylan Noblesmith2012-04-131-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* egl-static: fix printf warningDylan Noblesmith2012-04-131-1/+2
| | | | | | | | | | | | | Noticed by clang: egl_st.c:57:50: warning: field precision should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat] ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT, ~~^~ NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* st/vega: fix uninitialized valuesDylan Noblesmith2012-04-131-2/+2
| | | | | | | | | | | | | | | | | | C still treats array arguments exactly like pointer arguments. By sheer coincidence, this still worked fine on 64-bit machines where 2 * sizeof(float) == sizeof(void*), but not on 32-bit. Noticed by clang: text.c:76:51: warning: sizeof on array function parameter will return size of 'const VGfloat *' (aka 'const float *') instead of 'const VGfloat [2]' [-Wsizeof-array-argument] memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyphOrigin)); NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* egl: fix uninitialized valuesDylan Noblesmith2012-04-131-1/+1
| | | | | | | | | | | | | | Noticed by clang: eglimage.c:48:28: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess] memset(attrs, 0, sizeof(attrs)); ~~~~~ ^~~~~ NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* util: fix uninitialized tableDylan Noblesmith2012-04-132-5/+7
| | | | | | | | | | | | | | | | | | | Most of the 256 values in the 'generic_to_slot' table were supposed to be initialized with the default value 0xff, but were left at zero (from CALLOC_STRUCT()) instead. Noticed by clang: u_linkage.h:60:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess] memset(table, 0xff, sizeof(table)); ~~~~~ ^~~~~ Also fix a signed/unsigned comparison and a comment typo here. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* util: fix undefined behaviorDylan Noblesmith2012-04-131-5/+10
| | | | | | | | | container_of() can legally return anything, even invalid addresses that cause segfaults, when 'sample' is an uninitialized pointer. Bug exposed by clang. NOTE: This is a candidate for the 8.0 branch.
* ir_to_mesa: Fix uninitialized member in add_uniform_to_shader.Vinson Lee2012-04-121-1/+1
| | | | | | | | | Fix uninitialized scalar field defect reported by Coverity. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* wayland-drm: Implement wl_buffer.damage in old versions of WaylandNeil Roberts2012-04-121-0/+26
| | | | | | | | | | | | | | | | | | Commit 272bc48976 removed the damage implementation for the wl_buffer_interface because that has been removed from git master of Wayland. However this breaks building with the 0.85 branch of Wayland because it would end up initialising the struct incorrectly. For the time being it's quite convenient for some compositors to track the 0.85 branch of Wayland because the protocol is stable but they will also want to track the master branch of Mesa so that they can use the gbm surface changes. This patch adds a compile-time check for the version of Wayland so that it can work with either Wayland master or the 0.85 branch. krh: Edited to also account for API changes in 6802eaa68, which removes the timestamp argument from wl_resource_destroy().
* Revert "i915g: Implement stipple with draw."Stéphane Marchesin2012-04-122-2/+1
| | | | This reverts commit 3cff45fdb182a1327f6b89fdc4e0ddc5d680372a.
* Revert "i915g: Remove unused poly stipple state."Stéphane Marchesin2012-04-122-0/+54
| | | | This reverts commit be6a02266d1a934c6eff9aaf12fc618588b2d586.
* glx: Hook up the unit tests again using the internal gtest.Eric Anholt2012-04-122-3/+9
| | | | Reviewed-by: Ian Romanick <[email protected]>
* gtest: Fix up import of gtest 1.6.0Ian Romanick2012-04-1225-1/+21231
| | | | | | | | The include files were all missing. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Acked-by: Eric Anholt <[email protected]>
* gtest: Build as a convenience library.Eric Anholt2012-04-122-0/+43
| | | | Reviewed-by: Ian Romanick <[email protected]>
* gtest: Import sources from gtest 1.6.0.Eric Anholt2012-04-1210-0/+8959
| | | | | | | | | The upstream of gtest has decided that the intended usage model is for projects to import the source and use it, which is reflected in their recent removal of the gtest-config tool. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* cso: unreference saved vertex buffers when restoringMarek Olšák2012-04-121-0/+8
| | | | Reviewed-by: Brian Paul <[email protected]>
* i965: When the kernel lacks the LLC check, assume it's present on gen >= 6.Eric Anholt2012-04-111-3/+7
| | | | | The param wasn't added until drm-intel-next for 3.4, so we were missing our various LLC fast-paths.
* intel: Drop backwards compat code for not having libdrm with the LLC check.Eric Anholt2012-04-111-4/+0
|
* i965/fs: Avoid generating extra AND instructions on bool logic ops.Eric Anholt2012-04-111-22/+14
| | | | | | | | | | | | | | | | | | | | | | | By making a bool fs_reg only have a defined low bit (matching CMP output), instead of being a full 0 or 1 value, we reduce the ANDs generated in logic chains like: if (v_texcoord.x < 0.0 || v_texcoord.x > texwidth || v_texcoord.y < 0.0 || v_texcoord.y > 1.0) discard; My concern originally when writing this code was that we would end up generating unnecessary ANDs on bool uniforms, so I put the ANDs right at the point of doing the CMPs that otherwise set only the low bit. However, in order to use a bool, we're generating some instruction anyway (e.g. moving it so as to produce a condition code update), and those instructions can often be turned into an AND at that point. It turns out in the shaders I have on hand, none of them regress in instruction count: Total instructions: 262649 -> 262545 39/2148 programs affected (1.8%) 14253 -> 14149 instructions in affected programs (0.7% reduction)
* i965/fs: Try to avoid generating extra MOVs to do saturates.Eric Anholt2012-04-113-12/+54
| | | | | | | | | | | | This change (before the previous two) produced a .23% +/- .11% performance improvement in Unigine Tropics at 1024x768 on IVB. Total instructions: 269270 -> 262649 614/2148 programs affected (28.6%) 179386 -> 172765 instructions in affected programs (3.7% reduction) v2: Move some of the logic of finding the instruction that produced the result of an expression tree to a helper.
* glsl: Extend the array splitting optimization pass to matrices.Eric Anholt2012-04-111-11/+18
| | | | | | | | | | | | | | This should fit in well with our lower_mat_op_to_vec code: now, in addition to having expressions on each column of a matrix, we also split the columns to separate variables so they can be tracked individually by the copy propagation, dead code, and other passes. This optimizes out some more code generation in unigine and gstreamer shaders. Total instructions: 269342 -> 269270 14/2148 programs affected (0.7%) 2226 -> 2154 instructions in affected programs (3.2% reduction)
* glsl: Add an array splitting pass.Eric Anholt2012-04-114-0/+380
| | | | | | | | | | | | | | | | | I've had this code laying around almost done for a long time. The idea is like opt_structure_splitting, that we've got a bunch of transforms at the GLSL IR level that only understand scalars and vectors, which just skip complicated dereferences. While driver backends may manage some optimization after they split matrices up themselves, it would be better to bring all of our optimization to bear on the problem. While I wasn't expecting changes quite yet, a few programs end up winning: a gstreamer convolution shader, and the Humus dynamic branching demo: Total instructions: 269430 -> 269342 3/2148 programs affected (0.1%) 1498 -> 1410 instructions in affected programs (5.9% reduction)
* glsl: Don't apply optimization passes to builtins.Eric Anholt2012-04-111-1/+1
| | | | | | The builtins we have are generally optimized, having been hand-written. This avoids generating bad code when an optimization pass prints debug output.
* mesa: add _mesa_total_texture_memory() debug functionBrian Paul2012-04-112-0/+62
| | | | | This function can be called in gdb to find out how much memory is used by all texture objects.
* mesa: new _mesa_total_buffer_object_memory() debug functionBrian Paul2012-04-112-0/+32
| | | | | This function can be called in gdb to find out how much memory is used by buffer objects.
* mapi: Fix Android buildChad Versace2012-04-101-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Android build was broken by commit ca760181b4420696c7e86aa2951d7203522ad1e8 Author: Kristian Høgsberg <[email protected]> Date: Fri Mar 16 12:55:40 2012 -0400 shared-glapi: Convert to automake The offending change was that it redefined the filepaths in sources.mak like this: - FOO_FILES := bar.c + FOO_FILES := $(TOP)/src/mapi/mapi/bar.c This broke the build because source filepaths in Android makefiles must be relative to the makefile. Ideally, this could be fixed by reverting the change in sources.mak and making shared-glapi's Makefile.am use $(addprefix $(TOP)/src/mapi/mapi, $(FOO_FILES)). However, automake doesn't understand builtin GNU make functions, such as addprefix. So, it seems that automake and Android can no longer share sources.mak. Fix the build by duplicating the source lists from sources.mak into Android.mk. Signed-off-by: Chad Versace <[email protected]>
* egl_dri2: fix aux buffer leak in drm platformMandeep Singh Baines2012-04-101-5/+4
| | | | | | | | Keep a reference to any newly allocated aux buffers to avoid re-allocating for every st_framebuffer_validate() (i.e. leaking). Signed-off-by: Mandeep Singh Baines <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]>
* i965: Stop lying about cpp and height of a stencil buffer.Paul Berry2012-04-105-45/+66
| | | | | | | | | | | | | | | | | | | | | | | When using a separate stencil buffer, i965 requires that the pitch of the buffer (in the 3DSTATE_STENCIL_BUFFER command) be specified as 2x the actual pitch. Previously this was accomplished by doubling the "cpp" and "pitch" values stored in the intel_region data structure, and halving the height. However, this was confusing, and it led to a subtle (but benign) bug: since a stencil buffer is W-tiled, its true height must be aligned to a multiple of 64; we were accidentally aligning its faux height to a multiple of 64, causing memory to be wasted. Note that for window system stencil buffers, the DDX also doubles the cpp and pitch values. To facilitate fixing this DDX server bug in the future, we fix the cpp and pitch values we receive from the X server only if cpp has the "incorrect" value of 2. Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]> v2: Clarify comments about the DDX.
* wayland-drm: remove wl_buffer.damagePekka Paalanen2012-04-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | | This is a related fix for the Wayland change: commit 83685c506e76212ae4e5cb722205d98d3b0603b9 Author: Kristian Høgsberg <[email protected]> Date: Mon Mar 26 16:33:24 2012 -0400 Remove wl_buffer.damage and simplify shm implementation Apparently, this should also fix a memory leak. When wl_buffer.damage was removed from Wayland and Mesa was not fixed, wl_buffer.destroy ended up in the (empty) damage function instead of calling wl_resource_destroy(). Spotted during build as: CC wayland-drm-protocol.lo wayland-drm.c:80:2: warning: initialization from incompatible pointer type wayland-drm.c:82:1: warning: excess elements in struct initializer wayland-drm.c:82:1: warning: (near initialization for 'drm_buffer_interface') Signed-off-by: Pekka Paalanen <[email protected]>
* st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.Vinson Lee2012-04-091-0/+4
| | | | | | | | | Fixes uninitialized member defects reported by Coverity. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: Fix memory leak in _mesa_make_extension_string()Chad Versace2012-04-091-0/+2
| | | | | | | | | I forgot to free the string returned by strdup(). Note: This is a candidate for the stable branches. CC: Johannes Obermayr <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* r600g: check gpr count limitVadim Girlin2012-04-091-0/+8
| | | | | | | | | | This should help to prevent gpu lockups. See https://bugs.freedesktop.org/show_bug.cgi?id=48472 NOTE: This is a candidate for the stable branches. Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* glsl: fix variable ordering in the output_read_removerVadim Girlin2012-04-091-1/+17
| | | | | | | Use the hash of the variable name instead of the pointer value. Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Add support for sampling texture buffer objects on gen7+.Eric Anholt2012-04-094-1/+71
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add real support for texturing/rendering with MESA_FORMAT_RGBA8888_REV.Eric Anholt2012-04-091-5/+1
| | | | | | | | | | | This was hacked in in one place for EGL image stuff, but the right thing to do was just to provide the mapping from the mesa format to the native hardware format, which includes render target support. This turns out to be required for GL_ARB_texture_buffer_object, which sees data in this layout. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen7: Fix the /* ignored */ comment on constant surface setup.Eric Anholt2012-04-091-1/+1
| | | | | | | It turns out this field *is* used, and it's the stride between samples from the buffer. Discovered during TBO debugging. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for the GL 3.1 R/RG formats in texture buffer objects.Eric Anholt2012-04-091-0/+54
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Track a gl_format for the texture buffer format.Eric Anholt2012-04-093-168/+76
| | | | | | | | | | | There was a function full of unused mappings from the GLenum to datatype/comps, but that wasn't all the information a driver would want, which includes the other fields that a gl_format has. Given that all the texture buffer formats were represented in gl_format, just use that as our description. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Handle updating texture state for buffer textures.Eric Anholt2012-04-092-0/+12
| | | | | | | | | We have to skip some work that wants to look at texture images, since buffer textures don't have any of that complexity. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Create the default (name==0) buffer texture.Eric Anholt2012-04-091-0/+5
| | | | | | | | All that should be needed is that it exists. Fixes segfaults on first _mesa_update_context() with a samplerBuffer-using shader active but without a particular buffer texture enabled. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add texelFetch(*samplerBuffer) entrypoints to GLSL 1.40.Eric Anholt2012-04-093-4/+15
| | | | | | | | Fix texelFetch(sampler2DRect) and textureSize(samplerBuffer) generation to not reference a LOD at the same time because it's easier than not fixing it. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add support for parsing [iu]samplerBuffer types in GLSL 1.40.Eric Anholt2012-04-092-1/+5
| | | | | | | | | The samplerBuffer type will be undefined in !glsl 1.40, and the keyword is marked as reserved. The [iu]samplerBuffer types are not marked as reserved pre-1.40, so they don't have separate tokens and fall through to normal type handling. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Set the correct initial value of the texture buffer object format.Eric Anholt2012-04-091-0/+1
| | | | | | | Fixes piglit GL_ARB_texture_buffer_object/get Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Set up glTexBuffer{,ARB} for display list compile.Eric Anholt2012-04-091-0/+3
| | | | | | | | We're supposed to just immediately call it. Fixes piglit GL_ARB_texture_buffer_object/dlist Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glapi: regen for TBO change.Eric Anholt2012-04-0910-9571/+9516
|
* glapi: Mark TexBuffer as an alias of TexBufferARB.Eric Anholt2012-04-091-1/+1
| | | | | | | | This is set correctly in gl.spec, but was missed in Mesa. As a result, only one of the two was hooked up in Mesa. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Drop the round-trip through ast_type_specifier for many builtin types.Eric Anholt2012-04-094-186/+58
| | | | | | | | | | We have lexer recognition of a bunch of our types based on the handling. This code was mapping those recognized tokens to an enum and then to a string of their name. Just drop the enums and provide the string directly in the parser. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Use (const char *) in AST nodes rather than plain (char *).Kenneth Graunke2012-04-093-11/+11
| | | | | | | | | | | Nothing actually relied on them being mutable, and there was at least one cast which discarded const qualifiers. The next patch would have introduced many more. Casting away const qualifiers should be avoided if at all possible. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* ff_fragment_shader: Remove some dead fields.Eric Anholt2012-04-091-11/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* x86-64: Don't print "Initializing x86-64 optimizations" in debug builds.Kenneth Graunke2012-04-091-11/+1
| | | | | | | | | | In "release" builds, Mesa would print this message if the MESA_DEBUG variable was set. Make it so for debug builds as well. I build debug builds all the time, but I'm not debugging this. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>