Commit graph

47917 commits

Author SHA1 Message Date
Dave Airlie
c33d2e6b08 docs/gl3: these two interfaces are complete now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 17:36:48 +00:00
Dave Airlie
b50e017ae1 pack: fix indentation (trivial)
just saw this while looking for other problems.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 17:36:22 +00:00
Dave Airlie
8c1037042f glapi: add ARB_texture_rgb10_a2ui support.
This just adds one enum.

regenerate enums.c.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 16:25:12 +00:00
Dave Airlie
ee7bc10391 gallium: add B10G10R10A2_UINT format
This format is used for ARB_texture_rgb10_a2ui extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 16:25:12 +00:00
Chia-I Wu
d4fcf67a3a mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REV
MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android.
Thanks to texture-from-pixmap, drivers may actually see texture images with
this format on Android.

MESA_FORMAT_RGBX8888 is added only for completeness.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format.  I
      accidentally moved them to the wrong place when preparing the patch.]
2011-11-27 12:43:24 +08:00
Beren Minor
6baa5f10c0 egl_glx: Try first a default lookup for glXGetProcAddress before loading dynamic lib.
GLX functions are sometimes directly available in the current binary. In such
cases, we do not need any alternate library loaded using dlopen. Otherwise,
dlopen may find the wrong libGL library and get functions that conflicts with
the current loaded ones.

For example, on Debian Sid with nvidia binary drivers, using mesa's libEGL with
GLX driver leads to wrong glXGetFBConfigs symbol loaded (or loaded twice?),
which leads to "GLX: failed to create any config" error message as the
glXGetFBConfigs symbol seems to return garbage. If the binary is linked with
nvidia's libGL, the GLX symbols are already available.
Without this patch, convert_fbconfig (src/egl/drivers/glx/egl_glx.c:233) fails
for every config found, after glXGetFBConfigAttrib(... GLX_RENDER_TYPE, ...)
call, as the value returned has GLX_COLOR_INDEX_BIT and not GLX_RGBA_BIT.

[olv: initialize handle, prepend egl_glx to the commit log]
2011-11-27 11:22:24 +08:00
Chia-I Wu
496f68bb9d android: bring in i915_dri and i965_dri automatically
Add i915_dri and i965_dri to libGLES_mesa's LOCAL_REQUIRED_MODULES when
enabled.
2011-11-26 11:42:08 +08:00
Chia-I Wu
d2cd621086 android: pass -std=c99 by default
Several modules expect a C99 compiler already.  It is also the default for
Makefile build.
2011-11-26 11:42:08 +08:00
Chia-I Wu
4d3d6f76ff android: move libGLES_mesa build rules to src/egl/main/.
Keep the top-level Android.mk away from building modules.
2011-11-26 11:42:08 +08:00
Chia-I Wu
169ef48c85 android: clean up libglapi bulid rules a bit
Make the output prettier.  Make the rules reusable if we ever want to add
other modules, such as libGLESv2_mesa.
2011-11-26 11:42:01 +08:00
Thomas Hellstrom
dbf00812b0 st/xa: Kill a couple of compilation warnings
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:38:44 +01:00
Thomas Hellstrom
32b1641a59 st/xa, xa/vmwgfx: Generate exported symbol list from the st/xa symbols.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:38:36 +01:00
Thomas Hellstrom
4d04367eca st/xa, xa/vmwgfx: Use XA_EXPORT attribute to indicate global visibility
Also fix up Makefiles to use the default mesa compilation flags.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrants <jakob@vmware.com>
2011-11-25 16:38:16 +01:00
Thomas Hellstrom
404d2f9c86 st/xa, xa/vmwgfx: Set the right version on library suffix
Also remove some unused variables in the st/xa makefile.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:36:29 +01:00
Chia-I Wu
75cc24c876 android: add support for ICS
With ICS (Android 4.0), several headers and structs are renamed.  Define
ANDROID_VERSION so that we can choose a different path depending on the
platform version.

I've tested only softpipe and llvmpipe.  r600g is also reported to work.
2011-11-25 12:34:33 +08:00
Chia-I Wu
42c2c371d6 vbo: fix !FEATURE_beginend build
Fix a build error in GLES-only build.
2011-11-25 11:18:50 +08:00
Chia-I Wu
d3d3c12a95 st/egl: fix a crash in Android backend
There is no buffer and android_surface_present should be a no-op when
eglSwapBuffers is called twice in a row.
2011-11-25 11:18:02 +08:00
Brian Paul
24d25b55bf softpipe: s/int/unsigned/ to be consistent in alpha test code 2011-11-23 15:04:01 -07:00
Brian Paul
173427841a softpipe: remove pointless break stmt 2011-11-23 15:02:05 -07:00
Chad Versace
f99d5af03b i965/gen6: Fix GPU hang when using stencil buffer without depth
Enable the bit 3DSTATE_DEPTH_BUFFER.Tiled_Surface.  From the Sandybridge
PRM, Volume 2, Part 1, Section 7.5.5.1.1 3DSTATE_DEPTH_BUFFER, Bit 1.27
Tiled Surface:
   [DevGT+]: This field must be set to TRUE.

Fixes GPU hangs on the following Piglit tests:
   hiz-stencil-test-fbo-d0-s8
   hiz-stencil-read-fbo-d0-s8

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-23 11:03:31 -08:00
Eric Anholt
8d15268a61 i915: Fix complete texturing regression since 27505a105a
I had notes to myself to test gen3 and gen4, and then I tested gen4
and called it good.  Turns out I forgot to actually call the new
function on gen3.
2011-11-23 09:45:17 -08:00
Eric Anholt
87f12bb2d9 i915: Fix build since hiz merge.
v2: Guard against rb->mt being NULL, since we may enter the draw
regions path before intel_prepare_render() has been called to set
them.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
2011-11-23 09:44:58 -08:00
Brian Paul
ca4e664f21 mesa: fix incorrect error message in format_unpack.c 2011-11-23 08:40:46 -07:00
Vasily Khoruzhick
8265bb7fb8 i915g: don't set alpha to 1 for RGBX and BGRX
This patch fixes regression introduced in
1f3c5eae5c

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-11-23 11:32:13 +01:00
Brian Paul
fc144728c7 mesa: update comment for clear_teximage_fields() 2011-11-22 17:16:50 -07:00
Brian Paul
12dd5dedf5 gallium: remove trailing comma and unneeded comments in p_defines.h 2011-11-22 17:08:36 -07:00
Marek Olšák
a7c107f3bc mesa: re-implement unpacking of DEPTH_COMPONENT32F
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43122

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-23 00:00:40 +01:00
Eric Anholt
27505a105a i915: Move the texture format setup for this driver out of shared code.
The i965 driver is now enabling all of these formats on its own from
the surface format table.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
899e6ea8d3 i965: Drop intel_context.c's texture format set up for this driver.
This is a no-op change on gen6, but should result in some
actually-unsupported formats on gen4 no longer being chosen (like
RGBA_FLOAT32 now being RGBA_FLOAT16).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
f8b13ba137 i965: Add support for ARGB2101010 rendering.
GL 3.0 specifies GL_RGB10_A2 as a required sized format for rendering
and texturing.

This introduces two piglit regressions: one due to fbo-mipmap-copypix
hitting swrast GetRow (we want to convert swrast to MapRenderbuffer),
and one due to fbo-blending-formats being too picky while leaving
dithering on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
b0a0f4bf14 i965: Add support for RGBA_16 unorm rendering.
GL 3.0 specifies GL_RGBA16 as a required sized format for rendering
and texturing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
1e42568bf3 i965: Add support for half-float formats.
Now that all the rest of the driver is driven off of the surface
formats table, all we really need to do is add the mapping from
MESA_FORMAT to BRW_SURFACEFORMAT.  However, we also add format
override for I16/L16 render targets at the same time, so that existing
users of I16 that were getting promoted to I32 and then getting the
I32->R32 override still get FBO support.

Fixes failures in piglit gl-3.0-required-sized-texture-formats, and
will prevent regressions in ARB_texture_float on gen4 when moving to
fully table-driven texture format setup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
f258c0dfa8 mesa: Fix unpack for MESA_FORMAT_INTENSITY_FLOAT16.
Fixes failures in i965 on fbo-blending-formats when the format is enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
6216a5b495 mesa: Fall back to float16 if float32 isn't supported in ChooseTexFormat.
Until GL 3.0, there isn't any requirement on the actual sizes of
channels chosen.  By falling back to 16 here, we can correctly support
ARB_texture_float on original i965 hardware, which can't correctly
filter 32-bit floats.
2011-11-22 13:58:38 -08:00
Eric Anholt
babe26b3ef mesa: Add fallback from RGB_FLOAT16 to RGBA_FLOAT16 before RGBA_FLOAT32.
Not all i965 hardware can do RGB float16, and this will at least save
half the memory and have expected behavior in terms of precision.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
2d159e6b36 i965: Reorganize MESA_FORMAT -> BRW_SURFACEFORMAT table.
This should be a no-op change.  The initializers are reordered to
match the ordering of the enum, since there isn't a clearly sensible
ordering, but "the order they were added to the driver, sort of" is
definitely not one.

Also, the unsupported formats are explicitly initialized to 0, so it's
more obvious what we aren't claiming to support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
1b4910b305 i965: Mark texture formats as supported using the surface formats table.
This is currently duplicated with intel_context.c's setup of the
formats table, and sets true for exactly the same set of formats on
gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
3d798abc81 intel: Improve debug output for begin/finish render texture.
I've never seen a use for the thread ID value, but knowing the format
being rendered is kind of a big deal.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
05ab8fc134 intel: Remove duplicate test for texture attachment completeness.
We are already testing this if appropriate in
intel_validate_framebuffer (FBO completeness), so no need to avoid
attaching the texture to the renderbuffer here.

This causes MESA_FORMAT_R11_G11_B10_FLOAT to now be renderable as a texture
attachment on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
925356c8c0 i965: Don't require spans (swrast) support to consider a format FBO complete.
We don't want to go writing GetRow/PutRow for every format required by
GL 3.0, when it's very hard to get those functions called, and in
every case we want to make swrast do direct mapping through
MapRenderbuffer anyway.

This causes MESA_FORMAT_R11_G11_B10_FLOAT to be considered complete on gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
ca10b2d449 i965: Use the surface format table to determine render target supportedness.
This moves any chipset-dependent logic we want for render target
format choices to init time as well.  There is still logic left at
state update for SRGB handling, where format choices change based on
GL state.

The brw_render_target_supported() function should now return correct
results, instead of relying on the limited results from
intel_span_supports_format() to avoid lying about FBO completeness.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
6661b7596f intel: Add the context to the render_target_supported() vtbl method.
We're going to want to provide different answers per chipset
generation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
e589ebdf23 i965: Add a table of the surface format information from the PRM.
This will be used to drive chosing formats and determining framebuffer
completeness, instead of the bunch of ad-hoc checks we have had until
now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 13:58:38 -08:00
Eric Anholt
755f0a0a02 mesa: Make formats.c "datatype" values match glGetTexLevelParameter return.
The formats.c code's "datatype" value is "what does this value mean",
i.e. unorm or snorm or float, and is the return value from the
GL_TEXTURE_RED_TYPE class of queries.  The depth formats were marked
as GL_UNSIGNED_INT, which is what we use for integer, and not what we
should be returning from the glGetTexLevelParameter.

In texstore, we were inappropriately using it as an argument to
_mesa_unpack_depth_span() that was expecting a value like
GL_UNSIGNED_INT or GL_UNSIGNED_SHORT.  Just hardcode
_mesa_unpack_depth_span()'s arguments for now, though it looks like
the consumers of that interface would be happier with using
MESA_FORMAT.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-22 13:58:37 -08:00
Eric Anholt
250a9c8e7e mesa: Don't report types for 0-sized components of textures.
The GL_TEXTURE_WHATEVER_SIZE entrypoints were checking if the
specified base type of the texture allowed that channel to be present
before reporting the size of the channel, so that GL_RGB didn't end up
with an alpha size if the hardware driver had to store it that way.

The GL_TEXTURE_WHATEVER_TYPE entrypoints weren't checking it, so you
would end up with strange responses from the GL involving 0-bit
floating-point alpha components in GL_RGB32F, even though it says
GL_NONE as expected for other 0-sized channels.

Make _TYPE check _BaseFormat the same as _SIZE, which results in
fixing most of the GL_RGB* testcases of gl-3.0-required-sized-formats
pass on i965.

v2: Add a default case with a warning (suggestion by Brian Paul)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2011-11-22 13:58:37 -08:00
Marek Olšák
034e63b9f8 r600g: handle all remaining CAPs 2011-11-22 20:56:51 +01:00
Marek Olšák
4ac250c9d5 r600g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
2011-11-22 20:56:51 +01:00
Marek Olšák
650f6a6815 r300g: re-order shaders CAPs 2011-11-22 20:56:51 +01:00
Marek Olšák
410c12352a r300g: handle SHADER_CAP_OUTPUT_READ 2011-11-22 20:56:51 +01:00
Marek Olšák
684d74e000 r300g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
2011-11-22 20:56:51 +01:00