summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glsl_to_tgsi: emit a MAD(b, -a, b) for !a && bBryan Cain2011-08-201-0/+52
| | | | This is a port of commit ff2cfb8989cd to glsl_to_tgsi.
* glsl_to_tgsi: fix typoBryan Cain2011-08-201-1/+1
|
* glsl_to_tgsi: implement ir_binop_all_equal using DP4 w/SGEBryan Cain2011-08-201-1/+19
| | | | | This is a port of commit ba01df11c4d0 to glsl_to_tgsi with integer support added.
* glsl_to_tgsi: implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLTBryan Cain2011-08-201-2/+23
| | | | | | | | Implement the any() part of the operation the same way regular ir_unop_any is implemented. This is a port of commit e7bf096e8b04 to glsl_to_tgsi, with added integer support.
* glsl_to_tgsi: implement ir_unop_any using DP4 w/saturate or DP4 w/SLTBryan Cain2011-08-201-4/+28
| | | | | This is a port of commit 92ca560d68e8 to glsl_to_tgsi, with integer support added.
* glsl_to_tgsi: make glsl_to_tgsi_visitor::emit_dp return the instructionBryan Cain2011-08-201-7/+7
|
* glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLTBryan Cain2011-08-201-4/+27
| | | | | | | | | | | | | | | | | | | | | Logical-or is implemented using addition (followed by clamping to [0,1]) on values of 0.0 and 1.0. Replacing the logical-or operators with addition gives a + b which has a result on the range [0, 2]. Previously a SNE instruction was used to clamp the resulting logic value to [0,1]. In a fragment shader, using a saturate on the add has the same effect. Adding the saturate to the add is free, so (at least) one instruction is saved. In a vertex shader, using an SLT on the negation of the add result has the same effect. Many older shader architectures do not support the SNE instruction. It must be emulated using two SLT instructions and an ADD. On these architectures, the single SLT saves two instructions. Note that SNE is still used when integers are used for boolean values, since there is no such thing as an integer saturate, and older shader architectures without SNE don't support integers. This is a port of commit 41f8ffe5e07c to glsl_to_tgsi with integer support added.
* glsl_to_tgsi: implement ir_unop_logic_not using 1-xBryan Cain2011-08-201-1/+11
| | | | | | | Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x accurately implements logical not. This is a port of commit 6ad08989d7c1 to glsl_to_tgsi.
* st/egl: add a missing includeChia-I Wu2011-08-211-0/+1
| | | | Reported by cwhuang.
* st/egl: improve error loggingChia-I Wu2011-08-212-3/+12
| | | | This helps diagnose problems in EGL initialization.
* st/egl: add buffer preserving support to AndroidChia-I Wu2011-08-211-4/+67
| | | | Use a staging color buffer when buffer preserving is enabled.
* st/egl: improve buffer cache for AndroidChia-I Wu2011-08-211-31/+73
| | | | | There may be more than two back buffers. Clean up and prepare the buffer cache for that.
* st/egl: swapping without a buffer is not an errorChia-I Wu2011-08-211-1/+1
| | | | This fixes Kwaak3.
* st/egl: use HAL formats for Android backendChia-I Wu2011-08-211-26/+15
| | | | Native buffers use HAL formats, not UI formats.
* winsys/sw/android: use HAL formatsChia-I Wu2011-08-211-18/+9
| | | | Native buffers use HAL formats, not UI formats.
* winsys/sw/android: set bo usage correctlyChia-I Wu2011-08-211-10/+3
| | | | | | Since this is the software path, set GRALLOC_USAGE_SW_WRITE_OFTEN when PIPE_BIND_RENDER_TARGET, and set GRALLOC_USAGE_SW_READ_OFTEN when PIPE_BIND_SAMPLER_VIEW.
* android: make libGLES_mesa realChia-I Wu2011-08-211-0/+37
| | | | | | | | | | | | | | | | libGLES_mesa with swrast should link in these libraries libmesa_egl libmesa_egl_gallium libmesa_st_egl libmesa_st_mesa libmesa_glsl libmesa_glsl_utils libmesa_pipe_softpipe libmesa_winsys_sw_android libmesa_gallium Reviewed-by: Chad Versace <[email protected]>
* android: build shared glapiChia-I Wu2011-08-212-0/+61
| | | | | | This builds the shared library libglapi from shared glapi. Reviewed-by: Chad Versace <[email protected]>
* android: build glslChia-I Wu2011-08-214-0/+302
| | | | | | | This builds the static library libmesa_glsl and executable glsl_compiler from glsl. glsl_compiler is only installed for engineering build. Reviewed-by: Chad Versace <[email protected]>
* android: build core mesaChia-I Wu2011-08-213-0/+215
| | | | | | This builds the static library libmesa_st_mesa from core mesa. Acked-by: Chad Versace <[email protected]>
* android: build core EGLChia-I Wu2011-08-212-2/+67
| | | | | | This builds the static library libmesa_egl from core EGL. Reviewed-by: Chad Versace <[email protected]>
* android: build softpipeChia-I Wu2011-08-212-1/+68
| | | | This builds the static library libmesa_pipe_softpipe from softpipe.
* android: build android sw winsysChia-I Wu2011-08-212-0/+37
| | | | This builds the static library libmesa_winsys_sw_android from winsys/sw.
* android: build targets/egl-staticChia-I Wu2011-08-212-0/+53
| | | | | This builds the static library libmesa_egl_gallium from targets/egl-static.
* android: build st/egl with android backendChia-I Wu2011-08-212-0/+55
| | | | This builds the static library libmesa_st_egl from st/egl.
* android: build gallium auxiliariesChia-I Wu2011-08-214-0/+326
| | | | This builds the static library libmesa_gallium from gallium auxiliaries.
* android: build libGLES_mesaChia-I Wu2011-08-212-0/+139
| | | | | | | | | | | | This is the first step to integrate Mesa into Android(-x86) build system. You can git clone mesa under the external/ directory of Android source tree and build Android with $ make BOARD_GPU_DRIVERS=swrast It will build libGLES_mesa that will be loaded by Android runtime. libGLES_mesa is still a stub in this commit.
* targets/egl-static: do not rely on libudev on AndroidChia-I Wu2011-08-211-0/+64
| | | | | | There is no libudev on Android. Use DRM to get the PCI ID directly. Reviewed-by: Benjamin Franzke <[email protected]>
* st/egl: add android backendChia-I Wu2011-08-215-0/+781
| | | | | | | | | | Both HW and SW rendering are supported for Android. For SW rendering, we use the generic gralloc lock/unlock for mapping and unmapping color buffers (in winsys/android). For HW rendering, we need to know the real type of color buffers. This backend works with drm_gralloc, where a color buffer is backed by a GEM object.
* winsys/android: new SW winsys for AndroidChia-I Wu2011-08-212-0/+320
| | | | | | On Android, color buffers are passed between server and clients as opaque buffer_handle_t. This winsys makes use of gralloc, which provides a generic way to map and unmap buffer_handle_t for CPU access.
* egl: add Android-specific extensionsChia-I Wu2011-08-215-0/+53
| | | | | | | | Add EGL_ANDROID_image_native_buffer and EGL_ANDROID_swap_rectangle. There is no spec for them though. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: add _EGL_PLATFORM_ANDROIDChia-I Wu2011-08-213-1/+12
| | | | | | | This is Android Gingerbread platform. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: android has no log2f nor ffsChia-I Wu2011-08-211-1/+7
| | | | | | Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs. Reviewed-by: Chad Versace <[email protected]>
* ralloc: include limits.h for SIZE_MAX on AndroidChia-I Wu2011-08-211-0/+5
| | | | | | | Android does not define SIZE_MAX in stdint.h. We have to include limits.h for it. Reviewed-by: Chad Versace <[email protected]>
* gallium: add PIPE_OS_ANDROID supportChia-I Wu2011-08-214-2/+22
| | | | | | | Android uses Linux kernel and its own C runtime. It resembles PIPE_OS_LINUX a lot with some minor exceptions. Reviewed-by: Brian Paul <[email protected]>
* glsl: remove an unnecessary header includeChia-I Wu2011-08-211-1/+0
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: fix !FEATURE_GL buildChia-I Wu2011-08-211-18/+18
| | | | | | | Move vbo_exec_FlushVertices_internal out of FEATURE_beginend. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/gen7: Use align1 mode to set URB_WRITE_HWORD channel enables.Kenneth Graunke2011-08-201-0/+3
| | | | | | | Makes the new vertex shader backend work on Ivybridge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Don't double-convert integer/boolean uniforms.Kenneth Graunke2011-08-191-16/+20
| | | | | | | | | | | | | When ctx->Const.NativeIntegers is set, Core Mesa loads integer/boolean uniforms directly, rather than loading the floating point equivalent. So, when that's set, we don't need to perform any conversions. Unfortunately, we can't properly support native integers with the old vertex shader backend, so this patch leaves them disabled for now. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.Kenneth Graunke2011-08-193-27/+37
| | | | | | | | | | | | | | | | | | | Previously, native integer support was based on whether the driver advertised GLSL 1.30 or not. However, drivers that natively support integers may wish to do so for older GLSL versions as well. Adding this new opt-in flag allows them to do so. Currently disabled by default on all drivers, which was the existing behavior (no drivers currently implement GLSL 1.30). Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set: - spec/glsl-1.10/fs-uniform-int-110.shader_test - spec/glsl-1.30/fs-uniform-int-130.shader_test (it was doubly converting the data) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Remove incorrect usage of the 'struct' keyword on classes.Kenneth Graunke2011-08-191-2/+2
| | | | Signed-off-by: Kenneth Graunke <[email protected]>
* i965/fs: Change incorrect use of 'struct fs_reg' to simply 'fs_reg'.Kenneth Graunke2011-08-191-1/+1
| | | | | | It's actually a class. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Remove unused variable.Kenneth Graunke2011-08-191-1/+0
|
* i965/vs: Implement proper register allocation instead of 1:1 mapping.Eric Anholt2011-08-192-1/+155
| | | | | | Fixes vs-atan-* and several others. This is not the real solution we eventually want, which will pack floats, vec2s, and vec3s into vec4 registers, but this code should provide the framework for that.
* i965/vs: Add simple dead code elimination.Eric Anholt2011-08-193-0/+38
| | | | | This is copied right from the fragment shader. It is needed for real register allocation to work correctly.
* i965/vs: Copy the live intervals calculation over from the FS.Eric Anholt2011-08-194-0/+139
| | | | | | This is a rather pessimistic calculation, since it doesn't distinguish individual channels of a vec4, or elements of an array, but should be a minimum start for register allocation.
* i965/vs: Remove stale comment about compressed instructions.Eric Anholt2011-08-191-1/+0
| | | | | This was copy'n'paste from the fragment shader, and didn't make sense here.
* r600g: don't allocate separate depth and stencil for transfer textures on EGMarek Olšák2011-08-191-1/+2
| | | | | | | | The state tracker expects depth and stencil pixels interleaved. Evergreen can bind an interleaved depth-stencil resource as a colorbuffer, but not as a zbuffer. The hardware can do the interleaving for us when decompressing.
* r600g: finally enable float depth buffers on evergreenMarek Olšák2011-08-191-0/+11
|
* r600g: rename resource -> view in create_sampler_viewMarek Olšák2011-08-192-32/+26
| | | | | The sampler view is not a resource. Also remove the unused desc variable.