Commit graph

40817 commits

Author SHA1 Message Date
Chia-I Wu
47ba5c482f i915: factor our source lists into Makefile.sources
In preparation for porting i915 to Android, factor its source lists into
a shared makefile. This prevents duplication of source lists, and hence
prevents the Android build from breaking as often.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Chia-I Wu
05fdb44dd7 i965: fix Android build
Use $(TARGET_CC) instead of $(CC).  Correctly name and set LOCAL_CFLAGS.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Bryan Cain
488fe51cf8 mesa: Replace the EmitNoIfs compiler flag with a MaxIfDepth flag.
This is a better, more fine-grained way of lowering if statements.  Fixes the
game And Yet It Moves on nv50.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 21:49:26 -05:00
Kristian Høgsberg
7b1d94e5d1 wayland: Track changes to drop wl_visual 2011-08-31 18:33:47 -04:00
Kristian Høgsberg
447bb454d8 egl_dri2: Only clear EGL_PIXMAP_BIT if DRI config is double buffered
We don't want to set the pixmap bit in the EGL config if the DRI
config we're adding is a double buffered config.  However, don't clear
any other bits the platform might pass in in the surface_type
argument.
2011-08-31 18:33:36 -04:00
Kristian Høgsberg
c661ecce10 wayland: Track server side wayland changes 2011-08-31 18:20:40 -04:00
Kristian Høgsberg
6602bda23b wayland: Use new wl_callback mechanism 2011-08-31 16:50:50 -04:00
Brian Paul
82fff5f3ed mesa: fix comment typo: s/GL_SIGNED_NORMALED/GL_SIGNED_NORMALIZED/ 2011-08-31 14:34:48 -06:00
Bryan Cain
478034f34a glsl: Use a separate div_to_mul_rcp lowering flag for integers.
Using multiply and reciprocal for integer division involves potentially
lossy floating point conversions.  This is okay for older GPUs that
represent integers as floating point, but undesirable for GPUs with
native integer division instructions.

TGSI, for example, has UDIV/IDIV instructions for integer division,
so it makes sense to handle this directly.  Likewise for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 12:02:18 -07:00
Brian Paul
87679e2ea1 mesa: bump max program local params, max uniforms limit
Some driver support more than 1024.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 12:57:38 -06:00
Brian Paul
e26e9f77e7 swrast: initialize program native limits
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 12:57:01 -06:00
Eric Anholt
0c9ae24dbd i965/vs: Avoid the emit(), remove(), insert_before() for array instructions.
v2: Add generator instructions for the scratch opcodes.
    Add emit_before() for handling ->ir and ->annotation inheritance.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:30:33 -07:00
Eric Anholt
e45d0270c9 i965/vs: Move logic for weird CMP type handling to CMP generators.
v2: Don't bother with the no-dst-reg version of CMP()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:16:10 -07:00
Eric Anholt
a8e29987f5 i965/vs: Convert emit() calls to the new instruction generators.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:54 -07:00
Eric Anholt
ead7ffc62a i965/vs: Convert gen6 userclip handling to new generators.
This DP4 had one of its operands missing, so we were generating
garbage clip distances.  Using the per-opcode instruction generators
made it obvious.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:54 -07:00
Eric Anholt
2f12be5c95 i965/vs: Create instruction generators outside of the emit() functions.
v2: Fixed gen6 IF().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:49 -07:00
Benjamin Franzke
f811c1e6d6 egl_dri2: Drop dri2_surface_type enum
Was only used in platform_wayland, and the remaining egl stack
uses _EGLSurface::Type with one of EGL_{WINDOW,PIXMAP,PBUFFER}_BIT.
2011-08-31 11:45:34 +02:00
Chia-I Wu
93d5963744 egl_dri2: add pbuffer support to platform_android
This is a simple change thanks to allocateBuffer.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 12:06:26 +08:00
Chia-I Wu
c8e18f85da egl_dri2: check the surface type in platform_android
Check the surface type is EGL_WINDOW_BIT before doing anything, in
preparation for pbuffer support.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:58:34 +08:00
Chia-I Wu
384f228a25 egl_dri2: refactor droid_get_buffers_with_format
Move the loop to parse attachments to its own function.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:51:54 +08:00
Chia-I Wu
357d3f30f3 egl_dri2: set ctx->WindowRenderBuffer
Set ctx->WindowRenderBuffer to EGL_BACK_BUFFER.  As EGL_WINDOW_BIT of a
config is set only when there is dri_double_buffer, that makes sure
window surfaces are always double-buffered and contexts will render to
the back buffer.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:51:42 +08:00
Christoph Bumiller
66e8d223b6 nv50,nvc0: fix multisample format hack
Advertising different format support based on sample count was a
bad idea, it made resolve to window work, but resolve to anything
else would fail.

See 9f4998639c.
2011-08-31 00:06:22 +02:00
Eric Anholt
0b96b3ffa9 intel: Restructure TexSubImage as just the 2D implementation and blit func.
Fixes a segfault in piglit copyteximage where I accidentally removed
the dst_bo setup in the previous cleanup.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40474
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Sean McNamara <gm.potato.ul@gmail.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 14:58:52 -07:00
Eric Anholt
b26a08402f intel: Remove the passthrough TexSubImage[13]D functions.
All we need for these is _mesa_store_texsubimage[13]d(), since we
don't do the blit path.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 14:58:47 -07:00
Eric Anholt
81a0b21669 i965/vs: Fix GL_FIXED setup when a writemask is present.
By emitting code before generate_code(), we ended up in align1 mode
where writemasks don't exist, so we rescaled gl_Vertex.w and things
went badly.  By moving GL_FIXED support to the visitor, we end up with
normal codegen, and as a bonus the GL_FIXED setup ends up getting
printed appropriately in debug output.

Fixes gtf/GL2Tests/fixed_data_type

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
72cfc6f377 i965/vs: Pack live uniform vectors together in the push constant upload.
At some point we need to also move uniform accesses out to pull
constants when there are just too many in use, but we lack tests for
that at the moment.

Fixes glsl-vs-large-uniform-array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
7c84b9d303 i965/vs: Track uniforms as separate vectors once we've done array access.
This will make it easier to figure out which elements are totally
unused and not upload them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
ddca4592a7 i965/vs: Don't lower uniform array indexing.
This avoids the massive conditional move array access, and brings code
generation quality for the new VS backend into the realm of efficiency
of the old backend (roughly 20% more instructions generated than
before across shader-db, instead of assertion failing for generating
over 10,000 instructions on many shaders!).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
483f5b348b i965/vs: Add support for pull constant loads for uniform arrays.
v2: reworked the instruction emit and made use of gen6_resolve_implied_move,
    from Ken's review
2011-08-30 12:09:40 -07:00
Eric Anholt
88e08de801 i965/vs: Restructure emit() functions around a vec4_instruction constructor.
We sometimes want to put an instruction somewhere besides the end of
the instruction stream, and we also want per-opcode instruction
generation to enable compile-time checking of operands.
2011-08-30 12:09:40 -07:00
Eric Anholt
8654931d11 i965: Make the old VS backend record pull constant references in pull_params[].
We'll be using that to track things for the new VS backend, and this will
avoid cluttering brw_vs_surface_state.c for it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
9fa41f0742 mesa: Fix glGetUniform() type conversions.
We were primarily failing to convert in the NativeIntegers case, which
this fixes.  However, we were also just truncating float uniforms when
converting to integer, which does not appear to be the correct
behavior.  Note, however, that the NVIDIA drivers also truncate
instead of rounding.

GL_DOUBLE return type is dropped because it was never used and
completely broken.  It can be added when there's test code.

Fixes piglit ARB_shader_objects/getuniform

v2: This is a rewrite of my previous glGetUniform patch, which Ken
    pointed out missed storage_type-based conversions to integer,
    which was totally broken still thanks to a typo in the testcase.
v3: Quote the spec justifying the rounding behavior.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 12:09:40 -07:00
Eric Anholt
7708b25e2b mesa: Make the gl_constant_value's bool occupy the same space as float/int.
At least for Intel, all our uniform components are of uint32_t size, either
float or signed or unsigned int.  For uploading uniform data in the driver,
it's much easier to upload a full dword per uniform element instead of trying
to pick out the bool byte and then fill in the top 3 bytes of pad with 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
55b7fbb70f i965: Use native integer uniforms when the new VS backend is in use.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
2f82c33dee i965/vs: Move the flag for whether to use the new backend to the context.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Chad Versace
1995d1e207 i965: Build i965_dri.so for Android
Compile tested only.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
2f0edc60f4 i965: Fix Android build by removing relative includes
Replace each occurence of
    #include "../glsl/*.h"
with
    #include "glsl/*.h"

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
34349d4431 dri: Build libmesa_dri_common for Android
libmesa_dri_common is a static library that contains the sources in
src/mesa/drivers/dri/common. Each DRI driver should link to it.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
05049e709e make: Document imported variables
In src/mesa/Android.mk, it is non-trivial to determine which variables are
imported by `include sources.mak`. So document them.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
3758173149 mesa: Build libmesa_dricore.a for Android
libmesa_dricore.a is analogous to the libmesa.a built by the Autoconf
build.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Brian Paul
5d9e242c3e tnl: fix regression in bind_indices()
Commit 2ea1ff3816 caused the regression.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40413
2011-08-30 10:17:53 -06:00
Brian Paul
788d9bf121 tnl: add const qualifier to silence warning 2011-08-30 10:17:53 -06:00
Brian Paul
642bbc6f59 tnl: use buffer helper functions to improve readbility 2011-08-30 10:17:52 -06:00
Chad Versace
16f442e9d5 make: Factor out source lists from drivers/dri/common into Makefile.sources
In order that the Autoconf and Android build can share the same source
lists, move the lists from
    src/mesa/drivers/dri/Makefile.defines
into
    src/mesa/drivers/dri/common/Makefile.sources

I would like for Android to just reuse Makefile.defines, but the file is
unsuitable for reuse.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Chad Versace
e4a6ebdd87 make: Remove duplicate occurence of driverfuncs.c
driverfuncs.o is already contained in libmesa.a, so remove it from the
following source lists:
    src/mesa/drivers/dri/Makefiles.defines:COMMON_SOURCES.
    src/mesa/drivers/dri/swrast/Makefile:SWRAST_COMMON_SOURCES

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Chad Versace
08701b6c95 make: Remove duplicate defintion of COMMON_SOURCES in Radeon makefiles
Remove defintion of COMMON_SOURCES from {r300,r660}/Makefile. The
defintion is a duplicate of that found in
src/mesa/drivers/dri/Makefile.defines.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Christian König
8f4ec55f77 r600g: Make unaligned 3D textures work on +evergreen
The layersize calculation is slightly different on +evergreen.
This makes mpeg2 video decoding and piglits texture-packed-formats
test work correctly on this hardware.
2011-08-30 15:33:51 +02:00
Christoph Bumiller
d49525d0c5 nouveau: use PRIu64 for printing uint64_t 2011-08-30 14:52:17 +02:00
Christoph Bumiller
8476232b08 nouveau/mm: move slabs to correct list on memory release
Should get rid of "destroying GPU memory cache with some buffers
still in use" message.
2011-08-30 14:52:17 +02:00
Maarten Lankhorst
210ddf0819 winsys/radeon: Create async thread only once
I noticed that a thread was created for every time async flush was called, so I moved it and used some semaphores to synch.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-08-30 14:01:57 +02:00