summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-11-30egl/wayland: Dispatch the event queue before get_buffersAnder Conselvan de Oliveira1-0/+3
When a client frame callback is executed and the client starts rendering again, the egl event queue might not have been dispatched so that the buffer release event for the previous frame hasn't been processed. In that case a third buffer is allocated, even though it would be possible to reuse the buffer that was just released. The wl_display_dispatch_queue_pending() entry point is available from wayland-client 1.0.2, so require that in configure.ac. Also, just let the pkg-config macro throw its own error, which will show what version we were looking for and failed to find. Note: This is a candidate for stable branches. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-11-30egl/wayland: Add invalidate back in eglSwapBuffers()Kristian Høgsberg1-0/+1
Commit ca3ed3e024864e91ca3cccc59fb96950e1d079b5 fixed the problem where eglMakeCurrent would trigger a getbuffer callback that then breaks the following wl_egl_window_resize() call. However, we still need to invalidate buffers in eglSwapBuffers, since in wayland we always swap buffers, so the dri driver needs to come out and ask us for the next buffer after each swapbuffer. Note: this is a candidate for stable branches. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-11-30i965/fs: Add fs_reg::is_zero() and is_one(); use for opt_algebraic().Kenneth Graunke2-7/+24
These helper macros save you from writing nasty expressions like: if ((inst->src[1].type == BRW_REGISTER_TYPE_F && inst->src[1].imm.f == 1.0) || ((inst->src[1].type == BRW_REGISTER_TYPE_D || inst->src[1].type == BRW_REGISTER_TYPE_UD) && inst->src[1].imm.u == 1)) { Instead, you simply get to write inst->src[1].is_one(). Simple. Also, this makes the FS backend match the VS backend (which has these). This patch also converts opt_algebraic to use the new helper functions. As a consequence, it will now also optimize integer-typed expressions. Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-30st/mesa: fix context use-after-free problem in st_renderbuffer_delete()Brian Paul1-3/+5
The use-after-free happened when the renderbuffer was shared by multiple contexts and we tried to delete the renderbuffer using a context which was previously deleted. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30util: added pipe_surface_release() functionBrian Paul1-0/+16
To fix a pipe_context::surface_destroy() use-after-free problem. We previously added pipe_sampler_view_release() for similar reasons. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30mesa: pass context parameter to gl_renderbuffer::Delete()Brian Paul15-24/+29
We sometimes need a rendering context when deleting renderbuffers. Pass it explicitly instead of trying to grab a current context (which might be NULL). The next patch will make use of this. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30egl/wayland: Don't invalidate drawable on swap buffersAnder Conselvan de Oliveira3-1/+27
We used to invalidate the drawable after a call to eglSwapBuffers(), so that a wl_egl_window_resize() would take effect for the next frame. However, that leads to calling dri2_get_buffers() when eglMakeCurrent() is called with the current context and surface, and a later call to wl_egl_window_resize() would not take effect until the next buffer swap. Instead, add a callback from wl_egl_window_resize() back to the wayland egl platform, and invalidate the drawable only when it is resized. This solves a bug on wayland clients when going back to windowed mode from fullscreen when clicking a pop up menu, where the window size after this would be the fullscreen size. Note: this is a candidate for stable branches. CC: wayland-devel@lists.freedesktop.org
2012-11-30llvmpipe: Remove remnants of lp_tile_soa from Makefile.José Fonseca2-4/+0
Completely forgot about updating Makefile when removing it. Stephane already fixed the make build, but there were a few mentions of lp_tile_soa left in the tree.
2012-11-29i965/fp: Fix segfault on gen4 TXB instructions.Eric Anholt1-0/+2
The gen4 simd16 workaround looks at ir->type to determine how much storage to allocate for the simd16 value. In fragment programs, texturing only ever returns float vec4s (unlike GLSL, which can also have scalar floats or vector integers), so this is the right type. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-29llvmpipe: Fix incorrect sizeof.Vinson Lee1-2/+2
Fixes sizeof not portable defects reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29llvmpipe: Fix build break from 75da95c50Stéphane Marchesin1-2/+1
The Makefile looks for a file which is gone (lp_tile_soa.c) http://bugs.freedesktop.org/show_bug.cgi?id=57713
2012-11-29mesa: Fix GL_LUMINANCE handling for textures in glGetTexImageAnuj Phogat2-14/+41
We need to rebase colors (ex: set G=B=0) when getting GL_LUMINANCE textures in following cases: 1. If the luminance texture is actually stored as rgba 2. If getting a luminance texture, but returning rgba 3. If getting an rgba texture, but returning luminance A similar fix was pushed by Brian Paul for uncompressed textures in commit: f5d0ced. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47220 Observed no regressions in piglit and ogles2conform due to this fix. This patch will cause failures in intel oglconform pxconv-gettex, pxstore-gettex and pxtrans-gettex test cases. The cause of failures is a bug in test cases. Expected luminance value is calculted incorrectly in test cases: L = R+G+B. V2: Set G = 0 when getting a RG texture but returning luminance. Note: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <idr@freedesktop.org>
2012-11-29Revert "meta: Don't try to glOrtho when the draw buffer isn't initialized."Kenneth Graunke1-5/+3
This reverts commit 9947470655bbf8f4a9c98fe6d93ff5c3486f1124. Apparently it caused a lot of Piglit regressions.
2012-11-29r600g: mirror simplification of if/break opcodesVincent Lejeune1-32/+12
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-29r600g: separate resource_id and sampler_id tex info in tgsi-to-llvmVincent Lejeune1-0/+3
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-29glcpp: Update README for new support of __LINE__ and __FILE__.Carl Worth1-3/+1
Drop these from the known limitations list since support was recently added for these. Also, fix a typo while in the area, (and the oddly missing final newline). Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: Add test involving token pasting of INTEGER tokens.Carl Worth2-0/+15
This test file is very similar to test 113-line-and-file-macros but uses token pasting for cleaner quiz answers (without spaces between the digits). This test passes thanks to the recent addition of support for pasting INTEGER tokens, (but would have failed without that). (Note that this test is distinct from test 059-token-pasting-integer which pastes integers parsed from the source. Those are parsed to INTEGER_STRING tokens and are already pasted correctly as verified by that test. The only way to generate the INTEGER tokens which currently fail to paste is with an internal define such as __LINE__ that results in an integer.) Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: Add support for pasting of INTEGER tokens.Carl Worth1-14/+47
By generalizing the current code designed to paste string tokens of various types. Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: Flag invalid pastes for integer followed by non-digitsCarl Worth1-5/+13
As recently tested in the additions to the invalid paste test, it is illegal to paste a non-digit sequence onto the end of an integer. The 082-invalid-paste test should now pass again. Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: Extend the invalid-paste testCarl Worth2-0/+20
The current code lets a few invalid pastes through, such as an string pasted onto the end of an integer. Extend the invalid-paste test to catch some of these. Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: More factoring-out of common code to simplify things.Carl Worth1-26/+20
This time creating a new _token_list_create_with_one_integer function modeled after the existing _token_list_create_with_one_space function (both implemented with new _token_list_create_with_one_ival). Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: Factor out a tiny bit of repeated code.Carl Worth1-4/+1
This function is getting a little long too read. Simplify it by pulling up one assignment from every condition. Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29glcpp: Add support for __LINE__ and __FILE__ macrosCarl Worth3-1/+45
These tokens are easy to expand by just looking at the current, tracked location values, (and no need to look anything up in the hash table). Add a test which verifies __LINE__ with several values, (and verifies __FILE__ for the single value of 0). Our testing framework isn't sophisticated enough here to have a test with multiple file inputs. This commit fixes part of es3conform's preprocess16_frag test. Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29mesa: Rename API_OPENGL to API_OPENGL_COMPAT.Paul Berry50-261/+261
This should help avoid confusion now that we're using the gl_api enum to distinguishing between core and compatibility API's. The corresponding enum value for core API's is API_OPENGL_CORE. Acked-by: Eric Anholt <eric@anholt.net> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-29gallium/postprocess: share pipe_context and cso_context with the state trackerMarek Olšák7-26/+71
Using one context instead of two is more efficient and we can skip another context flush. Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29mesa: move some helper functions from fboobject.c to glformats.cMarek Olšák3-119/+127
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29android: include api_exec.c in generated files listTapani Pälli1-0/+1
Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-29gallivm: Fix lp_build_float_to_half.José Fonseca1-30/+75
The current implementation was close by not fully correct: several operations that should be done in floating point were being done in integer. Fixes piglit fbo-clear-formats GL_ARB_texture_float Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29gallivm: fix a trivial txq issue for 2d shadow and cube shadow samplersRoland Scheidegger1-2/+2
untested (couldn't get the piglit test to run even with version overrides) but seemed blatantly wrong. In any case it would only affect an error case which when it would happen probably all hope is lost anyway. Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29llvmpipe: support array texturesRoland Scheidegger6-7/+32
This adds array (1d,2d) texture support to llvmpipe. Though probably should do something about 1d array textures requiring gobs of memory (this issue is not strictly limited to arrays but it is probably worse there). Initial code by Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: support array texturesRoland Scheidegger6-65/+103
Support 1d and 2d array textures (including shadow samplers), and (as a side effect mostly) also shadow cube samplers. Seems to pass the relevant piglit tests both for sampling and rendering to (though some require version overrides). Since we don't support render target indices rendering to array textures is still restricted to a single layer at a time. Also, the min/max layer in the sampler view (which is unnecessary for GL) is ignored (always use all layers). Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29llvmpipe: Remove lp_build_blend_soa()José Fonseca5-538/+37
No longer used/necessary, as we always blend in AoS now. Trivial.
2012-11-29llvmpipe: Eliminate color buffer swizzling.José Fonseca17-1334/+30
Now dead code. Also had to remove the show_tiles/show_subtiles because now the color buffers are always stored in their native format, so there is no longer an easy way to paint the tile sizes. Depth-stencil buffers are still swizzled. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29llvmpipe: Only advertise unswizzled formats.José Fonseca3-25/+17
Update llvmpipe_is_format_supported and llvmpipe_is_format_unswizzled so that only the formats that we can render without swizzling are advertised. We can still render all D3D10 required formats except PIPE_FORMAT_R11G11B10_FLOAT, which needs to be implemented in a future opportunity. Removal of rendertarget swizzling will be done in a subsequent change. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29util/u_format: Kill util_format_is_array().José Fonseca4-53/+4
It is buggy (it was giving wrong results for some of the formats with padding), and util_format_description::is_array already does precisely what's intended. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29util/u_format: Tighten the meaning of is_array bit to exclude mixed type ↵José Fonseca2-2/+11
formats. This is what we want in practice. The only change is in PIPE_FORMAT_R8SG8SB8UX8U_NORM, which no longer is considered an array format. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29util/u_format: Fix format manipulation for big-endianAdhemerval Zanella1-5/+5
This patch fixes various format manipulation for big-endian architectures. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Fix format manipulation for big-endianAdhemerval Zanella5-12/+145
This patch fixes various format manipulation for big-endian architectures. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Add byte-swap construct callsAdhemerval Zanella2-0/+89
This patch adds two more functions in type conversions header: * lp_build_bswap: construct a call to llvm.bswap intrinsic for an element * lp_build_bswap_vec: byte swap every element in a vector base on the input and output types. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Fix vector constant for shuffleAdhemerval Zanella1-1/+6
This patch fixes the vector constant generation used for vector shuffle for big-endian machines. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: clear Altivec NJ bitAdhemerval Zanella1-0/+19
This patch enforces the clear of NJ bit in VSCR Altivec register so denormal numbers are handles as expected by IEEE standards. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Altivec floating-point roundingAdhemerval Zanella1-23/+70
This patch adds Altivec intrinsics for float vector types. It changes the SSE specific definitions to a platform neutral and adds the calls to Altivec intrinsic builder. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Altivec vector add/sub intrisicsAdhemerval Zanella2-15/+27
This patch add correct vector addition and substraction intrisics when using Altivec with PPC. Current code uses default path and LLVM backend ends up issuing carry-out arithmetic instruction while it is expected saturated ones. It also includes a fix for PowerPC where char are unsigned by default, resulting in bogus values for vector shifting. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Altivec vector max/min intrisicsAdhemerval Zanella1-2/+54
This patch adds the PPC Altivec instrics max/min instruction for supported Altivec vector types (16xi8, 8xi16, 4xi32, 4xf32). Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29gallivm: Altivec pack/unpack intrisicsAdhemerval Zanella1-14/+30
This patch adds PPC Altivec support for pack/unpack operations using Altivec supported vector type (8xi8, 16xi16, 4xi32, 4xf32). Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29radeonsi: Bitcast result of packf16 intrinsic to float for export intrinsic.Michel Dänzer1-1/+5
Fixes 7 piglit tests, and prevents many more from crashing. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-and-Tested-by: Christian König <christian.koenig@amd.com>
2012-11-28i965/vs: Move struct brw_compile (p) entirely inside vec4_generator.Kenneth Graunke3-4/+3
The brw_compile structure contains the brw_instruction store and the brw_eu_emit.c state tracking fields. These are only useful for the final assembly generation pass; the earlier compilation stages doesn't need them. This also means that the code generator for future hardware won't have access to the brw_compile structure, which is extremely desirable because it prevents accidental generation of Gen4-7 code. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28i965/vs: Split final assembly code generation out of vec4_visitor.Kenneth Graunke4-53/+106
Compiling shaders requires several main steps: 1. Generating VS IR from either GLSL IR or Mesa IR 2. Optimizing the IR 3. Register allocation 4. Generating assembly code This patch splits out step 4 into a separate class named "vec4_generator." There are several reasons for doing so: 1. Future hardware has a different instruction encoding. Splitting this out will allow us to replace vec4_generator (which relies heavily on the brw_eu_emit.c code and struct brw_instruction) with a new code generator that writes the new format. 2. It reduces the size of the vec4_visitor monolith. (Arguably, a lot more should be split out, but that's left for "future work.") 3. Separate namespaces allow us to make helper functions for generating instructions in both classes: ADD() can exist in vec4_visitor and create IR, while ADD() in vec4_generator() can create brw_instructions. (Patches for this upcoming.) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28i965/vs: Abort on unsupported opcodes rather than failing.Kenneth Graunke1-3/+4
Final code generation should never fail. This is a bug, and there should be no user-triggerable cases where this could occur. Also, we're not going to have a fail() method after the split. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28i965/vs: Move uses of brw_compile from do_vs_prog to brw_vs_emit.Kenneth Graunke3-14/+19
The brw_compile structure is closely tied to the Gen4-7 hardware encoding. However, do_vs_prog is very generic: it just calls out to get a compiled program and then uploads it. This isn't ultimately where we want it, but it's a step in the right direction: it's now closer to the code generator. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>