52773 Commits

Author SHA1 Message Date
Brian Paul
b9e88c5592 llvmpipe: implement the new can_create_resource() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
ead8847d44 st/mesa: implement new proxy texture code
If the gallium driver implements the can_create_resource() function, call
it to do proxy texture size checks.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
bd8b43a9f4 gallium: add new pipe_screen::can_create_resource() function
Used to implement proxy textures.  If a gallium driver doesn't implement
this function we'll just continue to use the core Mesa fallback code.

Without this hook we really have no good way to implement OpenGL proxy
textures with gallium drivers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
a0fc7620f5 mesa: take cube faces into account in _mesa_test_proxy_teximage()
There will always be six cube faces so take that into consideration when
computing the texture size and comparing against the limit.
2012-09-17 19:49:27 -06:00
Brian Paul
90ca4c0c62 mesa: handle GL_PROXY_TEXTURE_CUBE_MAP in _mesa_num_tex_faces() 2012-09-17 19:49:27 -06:00
Brian Paul
df73be9105 llvmpipe: set max cube texture size to 4K x 4K
Before, the limit was 8K.  For 32-bit RGBA that would be require 1.5 GB
of memory (w/out mipmaps).  That's well beyond the LP_MAX_TEXTURE_SIZE
of 1GB.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
7dc76e9424 mesa: move/fix levels check for glTexStorage()
Fix copy&paste error and move min levels check closer to max levels check.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
ff24ed09fa mesa: rewrite glTexStorage() code
Simplify the code and make it more like the other glTexImage commands.
Call _mesa_legal_texture_dimensions() to validate width, height, depth.
Call ctx->Driver.TestProxyTexImage() to make sure texture is not too large.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
e6eaa85a43 mesa: rework texture size error checking
There are two aspects to texture image size checking:
1. Are the width, height, depth legal values (not negative, not larger
   than the max size for the mipmap level, etc)?
2. Is the texture just too large to handle?  For example, we might not be
   able to really allocate memory for a 3D texture of maxSize x maxSize x
   maxSize.

Previously, we did (1) via the ctx->Driver.TestProxyTextureImage() hook
but those tests are really device-independent.  Now we do (2) via that
hook since the max texture memory and texture shape are device-dependent.

Also, (1) is now done outside the general texture parameter error checking
functions because of the special interaction with proxy textures.  The
recently introduced PROXY_ERROR token is removed.

The teximage() and copyteximage() functions are bit simpler now (less
if-then nesting, etc.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
ce2ae3c3a2 mesa: refactor _mesa_test_proxy_teximage() code
Basically, move the body into a new _mesa_legal_texture_dimensions() function.
More refactoring to come.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
b1874ec931 mesa: move glTexImage 'level' error checking
Move level checking out of _mesa_test_proxy_teximage() and into
the other error-checking functions.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
35f16600b3 mesa: change create_version_string() return type to void
Fixes "warning: no return statement in function returning non-void"
2012-09-17 19:46:20 -06:00
Dave Airlie
1ce9f25fde glsl: make _mesa_builtin_uniform_desc static
I can't see any reason this is global (unless for debugging)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-18 07:57:42 +10:00
Tom Stellard
bfd55711c1 radeon/llvm: Inital flow control support for SI
This adds basic flow control support for If-Then-Else blocks using
predicates (stored in the EXEC register) and a predicate stack for
nested flow control.
2012-09-17 21:09:43 +00:00
Xinya Zhang
ef0d7e13d7 r600g: Close a memory leak of llvm byte streams
No regressions found in the tests of opencl-example/run_tests.sh.

Signed-off-by: Xinya Zhang <zxy_thf@hotmail.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 21:09:43 +00:00
Tom Stellard
0b1a182905 radeon/llvm: Fix unused variable warning 2012-09-17 21:09:43 +00:00
Tom Stellard
059a56bddb radeon/llvm: Move kernel arg lowering into R600TargetLowering class 2012-09-17 21:09:43 +00:00
Jordan Justen
9fac1d1c3a main/version: consolodate version string creation for ES/Desktop GL
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-17 13:42:09 -07:00
Eric Anholt
81dff4f752 i965: Stop putting 8 NOPs after each prorgam.
As far as I can see, the intention of the requirement that we do so is to
prevent instruction prefetch from wandering out into either unmapped memory or
memory with a different caching type, and hanging the chip.  The kernel makes
sure that the page after your BO has a valid page of the same caching type,
which meets this requirement, so there's no need to waste space between our
programs (and in instruction cache) on this.

Saves another 9kb instructions in l4d2 shaders.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-17 12:32:52 -07:00
Eric Anholt
3e165ba62c i965: Test instruction compaction on gen7 2012-09-17 12:32:52 -07:00
Kenneth Graunke
bce72170ea i965: Add support for instruction compaction on Gen7.
Reduces l4d2 program size from 1195kb to 919kb.  Improves performance by 0.22%
+/- 0.11% (n=70).

v2: Rebase on compaction v2, fix up flag reg handling (by anholt).
v3: Fix uncompaction of the flag register number.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-17 12:32:52 -07:00
Eric Anholt
f25aefcebe i965: Support instruction compaction between control flow.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
077d01b673 i965: Add support for instruction compaction.
This reduces program size by using some smaller encodings for common bit
patterns in the Gen ISA, with the hope of making programs fit in the
instruction cache better.

v2: Use larger bitshifts for the uncompressed field setups, in line with the
    way it's described in the spec.  Consistently name a brw_compile "p" like
    all other code.  Add a couple more tests.  Consistently call things
    "compacted" not "compressed" (which is a different feature).  Drop the
    explicit check for not compacting SENDs, which is unjustified and already
    implied by our lack of support for immediate values.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
f5e2706395 i965: Prepare the break/cont uip/jip setting for compacted instructions.
The first cut at instruction compaction won't compact things that
would change control flow jump distances, but we do need to still be
able to walk the instruction stream, which involves jumping by 8 or 16
bytes between instructions.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
f2bd3e70b5 i965: Move program dump to a helper function in brw_eu.c.
It's going to get more complicated when we do instruction compaction.  This
also introduces putting the program offset in the output.

v2: Use next_insn_offset in brw_get_program(), too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
826ecbbe6e i965: Make a linkable library for the contents of i965_dri.so.
To do unit testing of i965, we want to be able to link against the
driver's symbols and prod them.  If we don't have a separate lib from
our loadable module, libtool gets super whiny.

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
5dafee1853 dri: Reuse dri_test.c for stub glapi symbols for unit testing.
This file is used to provide stubs for the link test in gallium dri drivers.
But the same stubs without the main can be used for making unit tests for code
in a dri driver.

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
3f98ba9c43 i965: Clear brw_compile on setup.
I noticed in valgrind that p->single_program_flow was used while
uninitialized.  Everything else zeroed out brw_compile, but this is better
API.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Andreas Boll
99f14bc789 docs: remove obsolete mesa subset documentation
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-17 10:34:12 -06:00
Michel Dänzer
14c12ca331 radeon/llvm: Match integer add/sub for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:05:49 +02:00
Michel Dänzer
8d7dd68d2a radeon/llvm: Complete integer comparison patterns for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:03:41 +02:00
Michel Dänzer
97d3d25e1c radeon/llvm: Match AMDGPUfract on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:02:01 +02:00
Michel Dänzer
39fb7faf95 radeon/llvm: Match int_AMDGPU_floor for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 17:30:09 +02:00
Michel Dänzer
6d3a1a5361 radeon/llvm: Match vector logical operations on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 17:12:08 +02:00
Brian Paul
7b6b447fa3 softpipe: update SP_MAX_TEXTURE_3D_LEVELS comment
9 levels = max size of 256 texels.
2012-09-16 19:00:20 -06:00
Tomeu Vizoso
68d1a3afd4 mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs
instead of just for GL and ES1.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-16 12:03:29 -07:00
Chris Forbes
d30a7d2eb4 mesa: fix dropped && in glGetStringi()
This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously,
all extension names returned would be NULL.

NOTE: This is a candidate for release branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-16 01:47:00 -07:00
Kenneth Graunke
679c93ff89 meta: Don't _mesa_set_enable() invalid targets in ES 1.
GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and
GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops
that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL
errors.  One such operation is _mesa_meta_Clear().

On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead.

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f216232d3974f5997b266a8dd720928.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comment.
v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-15 20:13:09 -07:00
José Fonseca
b6c2234c22 Temporarily revert "mesa: remove remaining FEATURE_* defines where protected by API check."
This reverts commit 9f37b405a3de8668a5f74c9681829688475ac3b7.

Fixes windows builds.
2012-09-15 18:18:39 +01:00
Brian Paul
e78ebbc5f9 scons: add new -p (prefix) options for yacc
These were recently added to the Makefiles.
2012-09-15 09:01:15 -06:00
Brian Paul
2f5f7bd687 swrast: remove unused ati_fs_opcodes array 2012-09-15 08:29:47 -06:00
Brian Paul
e656c4a074 mesa: remove FEATURE_ES test in texcompress_cpal.c
Fixes a regression after removing the #if FEATURE_x tests.
2012-09-15 08:28:21 -06:00
Oliver McFadden
2bc8f03f49 mesa: remove never-defined FEATURE_histogram conditional.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:59 +03:00
Oliver McFadden
9f37b405a3 mesa: remove remaining FEATURE_* defines where protected by API check.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:57 +03:00
Oliver McFadden
ab1a9430c3 mesa: remove obsolete comments from mfeatures.h
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:55 +03:00
Oliver McFadden
961fcc45ad mesa: remove FEATURE_ATI_fragment_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:52 +03:00
Oliver McFadden
dd44f80f81 mesa: remove FEATURE_APPLE_object_purgeable define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:51 +03:00
Oliver McFadden
dda982f1a7 mesa: remove FEATURE_EXT_transform_feedback define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:49 +03:00
Oliver McFadden
88233b0bc3 mesa: remove FEATURE_EXT_texture_sRGB define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:48 +03:00
Oliver McFadden
e9ccb5fe52 mesa: remove FEATURE_EXT_framebuffer_blit define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:46 +03:00