Commit graph

40817 commits

Author SHA1 Message Date
Ian Romanick
92f3fca0ea mesa: Remove target parameter from dd_function_table::BufferSubData
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
12d924c5ae mesa: Remove target parameter from dd_function_table::MapBuffer
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
56f0c00f12 mesa: Remove target parameter from dd_function_table::UnmapBuffer
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:08 -07:00
José Fonseca
0457655035 make: Add missing source file. 2011-08-23 19:50:54 +01:00
Eric Anholt
abbb8fc3a7 i965: Fix typo in 2b224d66a0
Unfortunately, since a previous efficiency improvement, we no longer
have any open-source testcases producing register spilling, so this
code was untested in the fragment shader path.  That should change
when we get proper temporary array support in the fragment shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40194
2011-08-23 11:23:04 -07:00
Eric Anholt
9d4b98eb9e i965/gen6+: Use non-normalized coordinates for GL_TEXTURE_RECTANGLE.
Improves performance of a GL_TEXTURE_RECTANGLE microbenchmark by 1.84%
+/- .15% (n=3)
2011-08-23 11:23:04 -07:00
Kenneth Graunke
4eeb4c1505 i965: Implement textureSize (TXS) on Gen4.
Also, remove the BRW_SAMPLER_MESSAGE_SIMD8_RESINFO #define because
there totally isn't a SIMD8 variant.

Unfortunately, resinfo returns FLOAT32 on Broadwater/Crestline, unlike
G45 which returns a proper UINT32.  This turns out to be simple,
however: when we emit MOVs to select the desired half of the SIMD16
result, we can simply override the register type to be float so it's
converted to an integer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:26 -07:00
Kenneth Graunke
ecf8963754 i965/fs: Implement textureSize (TXS) on Gen5+.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:25 -07:00
Kenneth Graunke
b6bdcf2a90 i965/fs: Rudimentary support for non-floating point texture results.
Not all texturing operations return floating point data.  For example,
the resinfo message (textureSize or TXS) returns integer data.  In the
future, we'll also add integer texture support.

ir_texture's type field contains this information; use its base type to
appropriately type the destination register.  We want to keep it as a
four component vector, however, since SIMD8 samplers always have a
response length of 4.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:08 -07:00
Kenneth Graunke
2054652796 glsl/builtins: Uncomment textureSize prototypes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-08-23 11:18:03 -07:00
Kenneth Graunke
583b295bbf texture_builtins.py: Add support for textureSize (txs).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:17:35 -07:00
Kenneth Graunke
1e3bcbdf31 glsl: Add a new ir_txs (textureSize) opcode to ir_texture.
One unique aspect of TXS is that it doesn't have a coordinate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-08-23 11:16:30 -07:00
Maarten Lankhorst
8f26b59f53 st/xorg: Advertise support for XvMC
Formats were based on a patch sent to xf86-video-nouveau by Bryan Cain

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>

[Michel Dänzer: Add xorg_xvmc.c to SConscript.]
2011-08-23 12:13:03 +02:00
Chia-I Wu
29d7a0bb16 mesa: call _mesa_set_vp_override in glDrawTex*
The driver may install its own vertex shader.  _mesa_set_vp_override
must be called so that core mesa can generate correct fragment program..

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-23 09:12:12 +08:00
Chia-I Wu
dd250e6045 auxiliary: share the source lists
Factor out source lists from Makefile to Makefile.sources, and let
Makefile, SConscript, and Android.mk share it.

Note that files in $(GENERATED_SOURCES) are removed from $(C_SOURCES).

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:12:08 +08:00
Kenneth Graunke
6c8ea1eed6 glsl: Make ir_validate actually visit ir_if nodes.
There is no ir_hierarchical_visitor::visit(ir_if *) method, since ir_if
is not a leaf node.  Instead, there are visit_enter and visit_leave
methods.  Use visit_enter arbitrarily (either would work fine, though
visit_enter will catch errors sooner).

Found thanks to a warning emitted by Clang.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-22 10:30:47 -07:00
Chad Versace
69595283b6 intel: Abort when DRI2 separate stencil handshake fails
When intel_context requires separate stencil but the DRI2 separate stencil
handshake fails, then abort and emit an error instructing the user to
upgrade the DDX to 2.16.0.

CC: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-22 07:27:05 -07:00
Kenneth Graunke
7a5d28908c glsl_to_tgsi: Fix a few more struct vs. class warnings.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-21 23:07:14 -07:00
Bryan Cain
5379a70d3f glsl_to_tgsi: emit a MAD(b, -a, b) for !a && b
This is a port of commit ff2cfb8989 to glsl_to_tgsi.
2011-08-20 14:43:25 -05:00
Bryan Cain
c721d7b7bc glsl_to_tgsi: fix typo 2011-08-20 14:17:52 -05:00
Bryan Cain
9098953ee6 glsl_to_tgsi: implement ir_binop_all_equal using DP4 w/SGE
This is a port of commit ba01df11c4 to glsl_to_tgsi with integer support
added.
2011-08-20 14:15:03 -05:00
Bryan Cain
f3dce133f0 glsl_to_tgsi: implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLT
Implement the any() part of the operation the same way regular ir_unop_any
is implemented.

This is a port of commit e7bf096e8b to glsl_to_tgsi, with added integer
support.
2011-08-20 14:00:41 -05:00
Bryan Cain
a43f68810a glsl_to_tgsi: implement ir_unop_any using DP4 w/saturate or DP4 w/SLT
This is a port of commit 92ca560d68 to glsl_to_tgsi, with integer support
added.
2011-08-20 14:00:41 -05:00
Bryan Cain
c15eb5569b glsl_to_tgsi: make glsl_to_tgsi_visitor::emit_dp return the instruction 2011-08-20 14:00:40 -05:00
Bryan Cain
691cc0e3a8 glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLT
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 41f8ffe5e0 to glsl_to_tgsi with integer support
added.
2011-08-20 14:00:40 -05:00
Bryan Cain
8c31bc7048 glsl_to_tgsi: implement ir_unop_logic_not using 1-x
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 6ad08989d7 to glsl_to_tgsi.
2011-08-20 14:00:40 -05:00
Chia-I Wu
112e68c503 st/egl: add a missing include
Reported by cwhuang.
2011-08-21 02:01:50 +08:00
Chia-I Wu
b71a7a2f37 st/egl: improve error logging
This helps diagnose problems in EGL initialization.
2011-08-21 02:01:50 +08:00
Chia-I Wu
5ce2dc692f st/egl: add buffer preserving support to Android
Use a staging color buffer when buffer preserving is enabled.
2011-08-21 02:01:50 +08:00
Chia-I Wu
4c222ff4fe st/egl: improve buffer cache for Android
There may be more than two back buffers.  Clean up and prepare the
buffer cache for that.
2011-08-21 02:01:50 +08:00
Chia-I Wu
62c7c2fca4 st/egl: swapping without a buffer is not an error
This fixes Kwaak3.
2011-08-21 02:01:49 +08:00
Chia-I Wu
8ccafbbbcc st/egl: use HAL formats for Android backend
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu
9650483acd winsys/sw/android: use HAL formats
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu
f496d8b86d winsys/sw/android: set bo usage correctly
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.
2011-08-21 02:01:49 +08:00
Chia-I Wu
ee41fc898d android: build shared glapi
This builds the shared library libglapi from shared glapi.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
b81b82df95 android: build glsl
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 <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
ee40f18054 android: build core mesa
This builds the static library libmesa_st_mesa from core mesa.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
2a77dc0c0d android: build core EGL
This builds the static library libmesa_egl from core EGL.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
faf9d580f5 android: build softpipe
This builds the static library libmesa_pipe_softpipe from softpipe.
2011-08-21 02:01:49 +08:00
Chia-I Wu
15576344f7 android: build android sw winsys
This builds the static library libmesa_winsys_sw_android from winsys/sw.
2011-08-21 02:01:49 +08:00
Chia-I Wu
b38da5f0a1 android: build targets/egl-static
This builds the static library libmesa_egl_gallium from
targets/egl-static.
2011-08-21 02:01:49 +08:00
Chia-I Wu
98345cf1b5 android: build st/egl with android backend
This builds the static library libmesa_st_egl from st/egl.
2011-08-21 02:01:48 +08:00
Chia-I Wu
688db6e8dc android: build gallium auxiliaries
This builds the static library libmesa_gallium from gallium auxiliaries.
2011-08-21 02:01:48 +08:00
Chia-I Wu
4b2b0b9fb8 targets/egl-static: do not rely on libudev on Android
There is no libudev on Android.  Use DRM to get the PCI ID directly.

Reviewed-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
2011-08-21 02:01:48 +08:00
Chia-I Wu
15418a8505 st/egl: add android backend
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.
2011-08-21 02:01:48 +08:00
Chia-I Wu
8e54c47a61 winsys/android: new SW winsys for Android
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.
2011-08-21 02:01:48 +08:00
Chia-I Wu
00b365bc78 egl: add Android-specific extensions
Add EGL_ANDROID_image_native_buffer and EGL_ANDROID_swap_rectangle.
There is no spec for them though.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
b0945c14df egl: add _EGL_PLATFORM_ANDROID
This is Android Gingerbread platform.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
504f92c739 mesa: android has no log2f nor ffs
Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
b34770d834 ralloc: include limits.h for SIZE_MAX on Android
Android does not define SIZE_MAX in stdint.h.  We have to include
limits.h for it.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00