Commit graph

46695 commits

Author SHA1 Message Date
Christoph Bumiller
16f8308c3d gallium: add polygon offset clamp state
This is required for D3D1x and supported by hardware.
2011-09-28 16:28:17 +02:00
Brian Paul
f83af361a4 scons: generate git_sha1.h file as with Makefile build
So that GL_VERSION includes the git head hash id when building with scons.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-28 08:15:22 -06:00
Kenneth Graunke
83df7fbe62 i965: Allow SIMD16 color writes on Ivybridge.
Again, the check was needlessly specific: this works fine on Gen7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 00:52:43 -07:00
Kenneth Graunke
79cba4c2b1 i965/fs: Allow SIMD16 with control flow on Ivybridge.
The check was designed to forbid it on old generations (Gen5/Ironlake),
not on new ones.  It just works on Gen7/Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 00:52:36 -07:00
Eric Anholt
b095b683f8 intel: Fix compiler warnings from the depth stall flush commit. 2011-09-27 15:17:50 -07:00
Eric Anholt
d1fda903ec radeon: Drop mapping we were doing around glGetTexImage().
It's handled by MapTextureImage() now.
2011-09-27 12:12:07 -07:00
Eric Anholt
6731c6cfb1 nouveau: Drop mapping we were doing around glGetTexImage().
It's handled by MapTextureImage() now.
2011-09-27 12:12:07 -07:00
Eric Anholt
019c9ee220 intel: Drop our custom glGetTexImage() code.
The mesa core code uses MapTextureImage() like we need now.

v2: Drop mapping around _mesa_generate_mipmap for compressed, since
    the whole path ends up going through MapTextureImage(), and the
    meta decompression code ended up causing us to lose track of the
    region that was originally mapped and assertion fail.
2011-09-27 12:12:07 -07:00
Brian Paul
ce62473408 mesa: Finally, convert RGBA glGetTexImage() to using MapTextureImage().
v2: Changes by Brian to MapTexImage in the decompression path.
v3: Changes by anholt to fix srcRowStride for decompression of NPOT.

Tested-by: Brian Paul <brianp@vmware.com> (v2)
2011-09-27 12:12:07 -07:00
Brian Paul
429b45e7c0 mesa: Convert depth glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
59348722b7 mesa: Convert depth/stencil glGetTexImage() to using MapTextureImage().
Note that the implementation before and after appears to be broken in
its handling of Z24_S8 vs S8_Z24.

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
0c513a9c1b mesa: Switch ycbcr glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
440dfb4583 mesa: Switch memcpy fast-path of glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
177110ae32 mesa: Update comments/assertions about buffer mapping for glGetTexImage().
This code is about to stop needing ->Data and using MapTextureImage().

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
8df7ca7112 mesa: Convert GetCompressedTexImage to using MapTextureImage().
This changes drivers to not map the texture on their own before
calling _mesa_get_compressed_teximage().

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Dave Airlie
9f61e43b49 gallium: move border color to be a color union
EXT_texture_integer also specifies border color should be a color
union, the values are used according to the texture sampler format.

(update docs)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-27 20:02:02 +01:00
Chad Versace
0527c11d7a mesa: Allow override of GL version with environment variable
It is necessary to manually set the GL version to 3.0 in order to run
Piglit tests that use glGetUniform*().

This patch allows one to override the version of the OpenGL context by
setting the environment variable MESA_GL_VERSION_OVERRIDE.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-27 11:23:17 -07:00
Paul Berry
b565e62a44 mesa: Make enable.c and get.c properly range check clip flags.
This is a follow-up to commit
2d686fe911, which added decoding of
GL_CLIP_DISTANCE[67] to the _mesa_set_enable() function.  This patch
makes the following additional fixes:

- Uses GL_CLIP_DISTANCEi enums consistently within enable.c rather
  than the deprecated GL_CLIP_PLANEi enums.

- Generates an error if the user tries to access a clip flag that is
  unsupported by the hardware.

- Applies the same change to _mesa_IsEnabled(), so that querying clip
  flags using glIsEnabled() works properly.

- Applies corresponding changes to get.c, so that querying clip flags
  using glGet*() works properly.

Fixes piglit test clip-flag-behavior.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-27 10:36:38 -07:00
Brian Paul
4c84fbea9d mesa: fix indentation in mipmap.c (3 spaces) 2011-09-26 20:44:09 -06:00
Eric Anholt
39790b6450 i965/vs: Fix access beyond array bounds for non-GRF operands.
Caught by valgrind.  I never saw a segfault from it (probably because
it's hard to have much more of any other file than GRF).
2011-09-26 15:33:42 -07:00
Eric Anholt
8004a1cb95 intel: Rename region->buffer to region->bo, and remove accessor function.
We call all the other drm_intel_bo pointers in intel/*.h "bo", so this
one was rather out of place.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
b4721bf711 intel: Drop stale comment about CopyTexSubImage.
We get called for TexImage higher up, and in a relatively normal way
(pixels == NULL is common for FBO setup).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
2ef77d1c74 intel: Rely on AllocTextureImageBuffer for our teximage fallbacks.
It will do a more reliable job at getting the image size for
_mesa_texstore right than us.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
d6b5e32f5f intel: Rely on mesa core for compressed texture image uploading.
There's nothing in our normal texture path we need for this.  We don't
PBO upload blit it.  We don't need to worry about flushing because
MapTextureImage handles it.  hiz scattergather doesn't apply, but MTI
handles it too.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
32fe506ae1 intel: Allow src == NULL and *dst != NULL in intel_miptree_reference().
This makes this API consistent with intel_region_reference, and the
consumers wanted it this way.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
db3ada6055 intel: Drop the "intel" argument to intel_miptree_release().
We don't have it in the other refcounting functions, and it was
totally unused.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
abaebcee78 intel: Drop the immediate validation of the texture object in TFP.
It's totally gratuitous -- the image's miptree will be checked for
binding to the object later, anyway, with zero-copy or blitting as
appropriate.

Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
d430e81c32 intel: Fix improper freeing of texture data in TFP.
If there happened to be ->Data present, we assertion failed instead of
handling it correctly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35234
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
fdd4961443 intel: Refactor texture_from_pixmap and EGL_image region binding.
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
19cfe1e035 intel: Drop some extra equality checks on reference/release functions.
_mesa_reference_renderbuffer already short-circuits equality, and
intel_miptree_release does nothing on NULL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
14ae70f793 i965: Set the pre/post-blend color clamp flags.
No change in piglit results on gen6, but the spec demands it so let's
do it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Kenneth Graunke
74e927bcaf i965/fs: Split generate_math into gen4/gen6 and 1/2 operand variants.
This mirrors the structure Eric used in the new VS backend, and seems
simpler.  In particular, the math1/math2 split will avoid having to
figure out how many operands there are, as this is already known by the
caller.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 16:30:07 -07:00
Brian Paul
c5943d6c1c swrast: always call _swrast_choose_texture_sample_func()
_swrast_choose_texture_sample_func() handles null texture object pointers
and will return the "null" sampler function which returns (0,0,0,1).  This
fixes a minor regression from ce82914f5a
2011-09-26 14:43:56 -06:00
Ian Romanick
e0553f6d4b mesa: Remove EXT_abgr extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is required in desktop OpenGL.  The existing support is already partially
broken in Mesa (e.g., using format=GL_ABGR for glTexImage2D in OpenGL ES 2.x).
This patch does not change the situation in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:14 -07:00
Ian Romanick
29386d1f2d mesa: Remove EXT_bgra and EXT_texture_format_BGRA8888 extension enable flags
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

EXT_texture_format_BGRA8888 is mostly a subset of EXT_bgra.  The only
difference seems to be that EXT_texture_format_BGRA8888 allows GL_BGRA
as an internal format to glTexImage2D and friends.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:14 -07:00
Ian Romanick
425284e882 mesa: Remove OES_read_format extension enable flag
This extension is always enabled, and drivers do not have
to option to disable it.

I kept this one separate from the others because I was a little
uncertain about the changes to get.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-09-26 12:14:13 -07:00
Ian Romanick
e5301b82ff mesa: Remove all mention of EXT_vertex_array_set
Mesa has never any portion of this extension, and neither has any
other vendor.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
740a9a4952 mesa: Fix extension year for EXT_texture_env_combine
The year 2006 apparently came from the "Last Modified Date" in the
spec header.  however, the revision history at the bottom say "2/22/00
mjk - added NVIDIA Implementation Details."  From that we can safely
infer that the spec is from at least 2000, and it may even be older.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
34eae1c72a mesa: Remove many extension enable flags
The following extensions are always enabled, and drivers do not have
to option to disable them:

    GL_ARB_multisample
    GL_ARB_texture_compression
    GL_ARB_vertex_buffer_object / GL_OES_mapbuffer
    GL_EXT_copy_texture
    GL_EXT_multi_draw_arrays / GL_SUN_multi_draw_arrays
    GL_EXT_polygon_offset
    GL_EXT_subtexture
    GL_EXT_texture_edge_clamp / GL_SGIS_texture_edge_clamp
    GL_EXT_vertex_array
    GL_SGIS_generate_mipmap

This set was picked because the are all either required or optional
features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x.  The
existing support for some is already partially broken in Mesa (e.g.,
proxy texture targets in OpenGL ES).  This patch does not change the
situation in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
2bf30b1ccc intel: Remove redundant GL_ARB_window_pos enable
This extension is enabled by default in _mesa_init_extensions, so
drivers don't need to enable it again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
5e4f42b017 dri: Remove redundant GL_SGIS_texture_edge_clamp enables
This extension is enabled by default in _mesa_init_extensions, so
drivers don't need to enable it again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:12 -07:00
Kenneth Graunke
8bd27a5b08 i965: Emit depth stalls and flushes before changing depth state on Gen6+.
Fixes OpenArena on Gen7.  Technically, adding only the first depth stall
fixes it, but the documentation says to do all three, and the Windows
driver seems to do it.

Not observed to fix anything on Gen6 yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:54:03 -07:00
Kenneth Graunke
490e6470a0 intel: Introduce a new intel_context::gt field to go along with gen.
It seems that GT1/GT2 sorts of variations are here to stay, and more
special cases will likely be required in the future.  Checking by PCI ID
via the IS_xxx_GTx macros is cumbersome; introducing a new 'gt' field
analogous to intel->gen will make this easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:50:31 -07:00
Kenneth Graunke
3f9f1b3659 intel: Remove intel_context::has_xrgb_textures/has_luminance_srgb.
Seeing as they were only used once (in the same function they were
defined), having them as context members seemed rather pointless.

Remove them entirely (rather than using local variables) since the
chipset generation checks are actually just as straightforward.

While we're at it, clean up the remainder of the if-tree that set them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:50:31 -07:00
Kenneth Graunke
01dda0758e i965: Fix incorrect maximum PS thread count shift on Ivybridge.
At one point, the documentation said that max thread count in 3DSTATE_PS
was at bit offset 23, but it's actually 24 on Ivybridge.  Not only did
this halve our thread count, it caused us to write 1 into a bit 23, which
is marked as MBZ (must be zero).  Furthermore, it made us write an even
number into this field, which is apparently not allowed.  Apparently we
were just lucky it worked.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:48:27 -07:00
Marek Olšák
44afac04ea r600g: add index_bias to index buffer bounds
This fixes ARB_draw_elements_base_vertex with max_index != ~0.

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
60a77cf316 u_vbuf_mgr: fix uploading with a non-zero index bias
Also don't rely on pipe_draw_info being set correctly.

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
21f71b6c05 u_vbuf_mgr: dereference some pointers only once etc. 2011-09-26 15:25:05 +02:00
Marek Olšák
cd9bbb3935 u_vbuf_mgr: rework user buffer uploads
- first determine the buffer range to upload for each buffer by walking over
  vertex elements
- take buffer_offset into account
- take src_offset into account
- take src_format into account in more places
- don't just blindly upload (stride*count) bytes

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
315300e444 u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED 2011-09-26 15:25:04 +02:00