Brian Paul [Tue, 29 Nov 2011 01:13:44 +0000 (18:13 -0700)]
glapi: s/INLINE/inline/ for dispatch.h file
Brian Paul [Tue, 29 Nov 2011 01:13:44 +0000 (18:13 -0700)]
swrast: use STATIC_ASSERT to make sure texfetch table isn't missing entries
When new MESA_FORMAT_x enums are added we need to add a new entry in
the table of texture fetch functions. In the past this has been
missed if swrast isn't actually tested. Using a static assertion
should help with that.
Brian Paul [Tue, 29 Nov 2011 01:13:43 +0000 (18:13 -0700)]
mesa: add STATIC_ASSERT() macro for compile-time assertions
This can be used to check that tables have the right number of entries,
etc. at compile-time. This will hopefully catch things that are missed
if particular drivers aren't tested, for example.
v2: Simplify the macro to omit the extra line number info (the compiler
already indicates the line number). And wrap the macro for readability.
Brian Paul [Mon, 28 Nov 2011 18:08:01 +0000 (11:08 -0700)]
mesa: access pixels as GLushort in unpack_SL8()
Per the format comments and the texstore code, use a GLushort to access the
pixel. The code was OK as-is on little endian machines.
Eric Anholt [Tue, 22 Nov 2011 02:03:30 +0000 (18:03 -0800)]
mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().
There was only one consumer of this API, meta.c, which was intending
to ask "is this format just stencil index (and nothing else)?".
Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type
formats, it would just try to draw the stencil parts. Nothing good
came of this.
This function looks rather silly at this point, but I'm leaving it in
place to be the obvious parallel API to _mesa_is_depth_format(). Note
that if you want the old behavior, you should use it as
(_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is
commonly done for depth-related tests.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Fri, 18 Nov 2011 01:26:41 +0000 (17:26 -0800)]
mesa: Fix the datatype of GL_DEPTH32F_STENCIL8's depth channel.
Asking for the datatype of MESA_FORMAT_Z32_FLOAT_X24S8 is a bit funny
-- there's a float depth channel, and a stencil channel that doesn't
have a particular GLenum associated with its type, so what's the
correct response?
Because there is no query for stencil, just make this format's
datatype be that of the depth channel. It fixes the depth query (and
thus a failure in piglit gl-3.0-required-sized-formats), and none of
the other consumers of the _mesa_get_format_datatype() API care.
v2: Add a comment for why the DataType is this way for this format.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Fri, 18 Nov 2011 01:01:58 +0000 (17:01 -0800)]
i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.
We were already doing it through the shader (layered underneath
GL_EXT_texture_swizzle) in the shadow compare case. This avoids
having per-format logic for switching out the surface format dependent
on the depth mode.
v2: Also do the swizzling for DEPTH_STENCIL. oops.
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Tue, 22 Nov 2011 01:46:22 +0000 (17:46 -0800)]
i965: Fix EXT_texture_swizzle with a writemask in the FFFS/FP backend.
I tripped over this bug in the next commit, relying on our
EXT_texture_swizzle to do some shadow sampler-related swizzling. If a
writemask was masking out a channel of the destination that was a live
channel of the texture swizzle, it would read undefined values.
Fixes piglit ARB_fragment_program_shadow/masked.
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 17 Nov 2011 22:45:54 +0000 (14:45 -0800)]
i965: Base HW depth format setup based on MESA_FORMAT, not bpp.
This will make handling new formats (like actually exposing Z32F)
easier and more reliable.
v2: Remove the check for hiz buffer -- the MESA_FORMAT should really
be giving us the value we want even for hiz.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kai Wasserbäch [Tue, 29 Nov 2011 17:17:47 +0000 (18:17 +0100)]
gallium/cell: Remove the driver.
Complicates Gallium3D development and doesn't seem to have active users.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Eric Anholt [Wed, 23 Nov 2011 00:26:55 +0000 (16:26 -0800)]
i965: Don't depth test the fake depthbuffer when one isn't present.
For the non-separate-stencil-only case, we've been using a NULL
surface for depth, so we didn't have to care. However, to support
separate stencil with no depthbuffer, we have to make the depth
surface non-NULL or the stencil test always fails thanks to separate
stencil inheriting the surface type of depth.
Fixes hiz-depth-stencil-test-d0-s8.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Ian Romanick [Tue, 22 Nov 2011 04:47:57 +0000 (20:47 -0800)]
mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES
Page 77 (page 91 of the PDF) says about glGetActiveAttrib:
"The returned attribute name can be the name of a generic
attribute or a conventional attribute (which begin with the prefix
"gl_", see the OpenGL Shading Language specification for a
complete list)."
Page 261 (page 275 of the PDF) says about glGetProgramiv:
"If pname is ACTIVE_ATTRIBUTES, the number of active attributes in
program is returned."
It doesn't say anything about built-in vs. user-defined attributes.
From the language around glGetActiveAttrib and the lack of an
exclusion of built-in attributes, which exists other places (e.g.,
around glBindAttribLocation), we can infer that GL_ACTIVE_ATTRIBUTES
should include the active attribute count. It should also be included
in the values returned by glGetActiveAttrib.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43138
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Yi Sun <yi.sun@intel.com>
Chad Versace [Mon, 28 Nov 2011 19:45:03 +0000 (11:45 -0800)]
swrast: Fix some static analysis warnings
To each switch statement in s_texfilter.c, add a break statement to the
default case.
Eliminates the Eclipse static analysis warning: No break at the end of
this case.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
José Fonseca [Wed, 9 Nov 2011 07:05:52 +0000 (07:05 +0000)]
Remove windows kernel support code.
Not actively used.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Wed, 9 Nov 2011 07:02:27 +0000 (07:02 +0000)]
gallium/auxiliary: Remove os_stream.
XP kernel mode was the only subsystem lacking stdio FILES.
Reviewed-by: Brian Paul <brianp@vmware.com>
Kai Wasserbäch [Tue, 29 Nov 2011 16:07:06 +0000 (17:07 +0100)]
docs: Removed i965 entry in the source tree listing.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Kai Wasserbäch [Tue, 29 Nov 2011 16:07:05 +0000 (17:07 +0100)]
docs: Added item to release notes for 7.12.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
José Fonseca [Wed, 9 Nov 2011 07:03:46 +0000 (07:03 +0000)]
st/vega: Fix warnings about dllimport attributes on windows.
Kai Wasserbäch [Tue, 29 Nov 2011 14:04:58 +0000 (15:04 +0100)]
i965g: Delete this driver.
Never completed, and no plans to do so.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Chia-I Wu [Tue, 29 Nov 2011 07:19:28 +0000 (15:19 +0800)]
mesa: distinct gl_client_array arrays are gone
Fix build errors since
762c9766c93697af8d7fbaa729aed118789dbe8e.
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Mathias Fröhlich [Mon, 31 Oct 2011 21:23:51 +0000 (22:23 +0100)]
mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.
Replace the distinct struct gl_client_array members in gl_array_object by
an array of gl_client_arrays indexed by VERT_ATTRIB_*.
Renumber the vertex attributes slightly to keep the old semantics of the
distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
Update all occurances of the distinct struct members with the array
equivalents.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Mon, 31 Oct 2011 17:32:59 +0000 (18:32 +0100)]
mesa: Make gl_program::InputsRead 64 bits.
Make gl_program::InputsRead a 64 bits bitfield.
Adapt the intel and radeon driver to handle a 64 bits
InputsRead value.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Mon, 31 Oct 2011 17:26:00 +0000 (18:26 +0100)]
mesa: Make gl_array_object::_Enabled 64 bits.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Mon, 31 Oct 2011 15:23:40 +0000 (16:23 +0100)]
vbo: Use The VERT_{ATTRIB,BIT} defines.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Mon, 31 Oct 2011 14:11:43 +0000 (15:11 +0100)]
mesa: Replace _NEW_ARRAY_* bits with VERT_BIT_*
Consolidate the two distinct set of flags to use VERT_BIT_*.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Mon, 31 Oct 2011 08:31:58 +0000 (09:31 +0100)]
mesa: Introduce more symbolic VERT_{ATTRIB,BIT}* defines.
Introduce a set of defines for VERT_ATTRIB_* and VERT_BIT_*
that will be used in the followup patches.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Yuanhan Liu [Wed, 23 Nov 2011 07:59:06 +0000 (15:59 +0800)]
mesa: move ElementArrayBufferObj to gl_array_object
According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.
So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.
This would fix most of(3 left) intel oglc vao test fail
NOTE: this is a candidate for the 7.11 branch.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Brian Paul [Tue, 29 Nov 2011 01:09:14 +0000 (18:09 -0700)]
mesa: update comments for _mesa_format_matches_format_and_type(), 80-column wrapping
Brian Paul [Tue, 29 Nov 2011 01:09:14 +0000 (18:09 -0700)]
mesa: add component comments for sRGB formats
Brian Paul [Tue, 29 Nov 2011 01:09:14 +0000 (18:09 -0700)]
mesa: update texstore comments for R/G textures
Brian Paul [Tue, 29 Nov 2011 01:09:14 +0000 (18:09 -0700)]
mesa: fix comments for RG formats
The position of the red and green bits was misstated in the comments.
Arguably, the names of these formats should be changed to "GR" to reflect
the component ordering and to be consistent with other formats.
Brian Paul [Tue, 29 Nov 2011 01:00:35 +0000 (18:00 -0700)]
st/mesa: don't try to allocate zero-sized renderbuffers
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43047
and https://bugs.freedesktop.org/show_bug.cgi?id=43048
Note: This is a candidate for the 7.11 branch.
Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Daniel Vetter [Mon, 28 Nov 2011 21:24:26 +0000 (22:24 +0100)]
gallium/i965g: hide that utterly broken driver better
And warn loudly in case people want to use it. Too many tester report
gpu hangs on irc and we rootcause this ...
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Brian Paul [Mon, 28 Nov 2011 22:03:55 +0000 (15:03 -0700)]
swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINT
As with the other integer-valued formats, use NULL until we support
integer textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316
Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Brian Paul [Mon, 28 Nov 2011 17:07:19 +0000 (10:07 -0700)]
mesa: remove unused gl_texture_object::DriverData field
Brian Paul [Sat, 26 Nov 2011 16:10:54 +0000 (09:10 -0700)]
mesa: handle MapTextureImage() failures in mipmap generation code
And handle potential malloc failures too.
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Sat, 26 Nov 2011 16:10:51 +0000 (09:10 -0700)]
mesa: handle MapTextureImage() failures in glGetTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Sat, 26 Nov 2011 16:10:47 +0000 (09:10 -0700)]
mesa: handle MapTextureImage() failures in glTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Sat, 26 Nov 2011 15:54:57 +0000 (08:54 -0700)]
mesa: fix frag shader generation for alpha test with no color buffers
If alpha test is enabled and there's no color buffers we still need the
fragment shader to emit a color.
v2: add _NEW_COLOR flag in _mesa_update_state_locked()
Fixes piglit fbo-alphatest-nocolor-ff failures with Gallium drivers.
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net> (i965)
Brian Paul [Wed, 23 Nov 2011 22:33:46 +0000 (15:33 -0700)]
mesa: check for null ptr in _mesa_is_bufferobj()
This simplifies a few callers. And it adds a bit of robustness.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Brian Paul [Wed, 23 Nov 2011 22:33:46 +0000 (15:33 -0700)]
mesa: move _mesa_base_format_has_channel() into image.c
This is where other format-related functions live.
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Wed, 23 Nov 2011 22:33:46 +0000 (15:33 -0700)]
mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queries
Use the _mesa_base_format_has_channel() helper as we do for the
other texture format component queries.
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Wed, 23 Nov 2011 22:33:45 +0000 (15:33 -0700)]
mesa: use _mesa_base_format_has_channel() in fbobject.c queries
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Wed, 23 Nov 2011 17:36:16 +0000 (10:36 -0700)]
mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()
The source array elements are 8-bytes (float + uint) so we need
to multiply the src index by 2 to get the right array stride.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Dave Airlie [Sun, 27 Nov 2011 16:44:13 +0000 (16:44 +0000)]
mesa/docs: add ARB_texture_rgb10_a2ui to relnotes/gl3.txt
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 16:23:56 +0000 (16:23 +0000)]
st/mesa: add ARB_texture_rgb10_a2ui support
Add support to the state tracker format and extension enablement code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 16:21:02 +0000 (16:21 +0000)]
mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.
This format is used in the ARB_texture_rgb10_a2ui spec.
It adds core mesa support, texformat + texstore support, format_unpack
and fbobject.c (all patches from list merged + fixed up).
also fixes some whitespace issues.
Parts were:
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 17:16:27 +0000 (17:16 +0000)]
image/pack: fix missing GL_BGR(A)_INTEGER support.
These codepaths were missing the cases for BGR_INTEGER/BGRA_INTEGER.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Sun, 27 Nov 2011 22:17:22 +0000 (14:17 -0800)]
docs: Add 7.11.2 release notes and news
Dave Airlie [Sat, 26 Nov 2011 16:54:29 +0000 (16:54 +0000)]
image: fix legal types for packed integer formats.
After reading ARB_texture_rgb10_a2ui it appears the packed formats
for integer types are only specified via this extension, and not via
the original ones. So condition the checks on this.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Dave Airlie [Sun, 27 Nov 2011 20:33:37 +0000 (20:33 +0000)]
r600g: add framebuffer support for 2/10/10/10 integer
Dave Airlie [Sun, 27 Nov 2011 16:24:26 +0000 (16:24 +0000)]
r600g: add int support for 2/10/10/10 format.
integer wasn't set properly for the non-uniform types.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 16:44:03 +0000 (16:44 +0000)]
docs/gl3: these two interfaces are complete now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 17:15:50 +0000 (17:15 +0000)]
pack: fix indentation (trivial)
just saw this while looking for other problems.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 16:19:39 +0000 (16:19 +0000)]
glapi: add ARB_texture_rgb10_a2ui support.
This just adds one enum.
regenerate enums.c.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 27 Nov 2011 16:18:08 +0000 (16:18 +0000)]
gallium: add B10G10R10A2_UINT format
This format is used for ARB_texture_rgb10_a2ui extension.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chia-I Wu [Tue, 22 Nov 2011 07:05:25 +0000 (15:05 +0800)]
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.]
Beren Minor [Fri, 25 Nov 2011 10:58:38 +0000 (11:58 +0100)]
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]
Chia-I Wu [Fri, 25 Nov 2011 12:44:12 +0000 (20:44 +0800)]
android: bring in i915_dri and i965_dri automatically
Add i915_dri and i965_dri to libGLES_mesa's LOCAL_REQUIRED_MODULES when
enabled.
Chia-I Wu [Sat, 26 Nov 2011 03:20:05 +0000 (11:20 +0800)]
android: pass -std=c99 by default
Several modules expect a C99 compiler already. It is also the default for
Makefile build.
Chia-I Wu [Sat, 26 Nov 2011 03:06:02 +0000 (11:06 +0800)]
android: move libGLES_mesa build rules to src/egl/main/.
Keep the top-level Android.mk away from building modules.
Chia-I Wu [Sat, 26 Nov 2011 02:28:13 +0000 (10:28 +0800)]
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.
Thomas Hellstrom [Thu, 24 Nov 2011 21:23:37 +0000 (22:23 +0100)]
st/xa: Kill a couple of compilation warnings
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Thomas Hellstrom [Thu, 24 Nov 2011 20:54:54 +0000 (21:54 +0100)]
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>
Thomas Hellstrom [Thu, 24 Nov 2011 20:59:06 +0000 (21:59 +0100)]
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>
Thomas Hellstrom [Thu, 24 Nov 2011 21:01:54 +0000 (22:01 +0100)]
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>
Chia-I Wu [Fri, 25 Nov 2011 03:59:02 +0000 (11:59 +0800)]
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.
Chia-I Wu [Tue, 15 Nov 2011 17:07:26 +0000 (10:07 -0700)]
vbo: fix !FEATURE_beginend build
Fix a build error in GLES-only build.
Chia-I Wu [Thu, 24 Nov 2011 09:13:15 +0000 (17:13 +0800)]
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.
Brian Paul [Wed, 23 Nov 2011 22:03:47 +0000 (15:03 -0700)]
softpipe: s/int/unsigned/ to be consistent in alpha test code
Brian Paul [Wed, 23 Nov 2011 22:02:05 +0000 (15:02 -0700)]
softpipe: remove pointless break stmt
Chad Versace [Wed, 23 Nov 2011 18:06:46 +0000 (10:06 -0800)]
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>
Eric Anholt [Wed, 23 Nov 2011 03:29:56 +0000 (19:29 -0800)]
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.
Eric Anholt [Tue, 22 Nov 2011 19:00:35 +0000 (11:00 -0800)]
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)
Brian Paul [Wed, 23 Nov 2011 15:36:14 +0000 (08:36 -0700)]
mesa: fix incorrect error message in format_unpack.c
Vasily Khoruzhick [Wed, 23 Nov 2011 10:27:24 +0000 (13:27 +0300)]
i915g: don't set alpha to 1 for RGBX and BGRX
This patch fixes regression introduced in
1f3c5eae5c4be582e50c2d4d7950424d86059c45
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Brian Paul [Wed, 23 Nov 2011 00:07:18 +0000 (17:07 -0700)]
mesa: update comment for clear_teximage_fields()
Brian Paul [Wed, 23 Nov 2011 00:03:35 +0000 (17:03 -0700)]
gallium: remove trailing comma and unneeded comments in p_defines.h
Marek Olšák [Tue, 22 Nov 2011 20:02:08 +0000 (21:02 +0100)]
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>
Eric Anholt [Tue, 15 Nov 2011 23:57:39 +0000 (15:57 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 23:49:26 +0000 (15:49 -0800)]
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>
Eric Anholt [Wed, 16 Nov 2011 00:53:48 +0000 (16:53 -0800)]
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>
Eric Anholt [Wed, 16 Nov 2011 00:50:59 +0000 (16:50 -0800)]
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>
Eric Anholt [Wed, 16 Nov 2011 00:26:29 +0000 (16:26 -0800)]
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>
Eric Anholt [Wed, 16 Nov 2011 00:47:25 +0000 (16:47 -0800)]
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>
Eric Anholt [Tue, 22 Nov 2011 21:27:54 +0000 (13:27 -0800)]
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.
Eric Anholt [Mon, 7 Nov 2011 02:08:36 +0000 (18:08 -0800)]
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>
Eric Anholt [Wed, 16 Nov 2011 00:16:43 +0000 (16:16 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 21:15:09 +0000 (13:15 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 20:53:18 +0000 (12:53 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 20:49:25 +0000 (12:49 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 20:15:37 +0000 (12:15 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 19:44:52 +0000 (11:44 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 19:43:40 +0000 (11:43 -0800)]
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>
Eric Anholt [Tue, 15 Nov 2011 00:58:57 +0000 (16:58 -0800)]
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>
Eric Anholt [Thu, 17 Nov 2011 21:56:30 +0000 (13:56 -0800)]
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>
Eric Anholt [Fri, 4 Nov 2011 22:28:58 +0000 (15:28 -0700)]
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)
Marek Olšák [Tue, 22 Nov 2011 19:48:23 +0000 (20:48 +0100)]
r600g: handle all remaining CAPs
Marek Olšák [Tue, 22 Nov 2011 19:44:14 +0000 (20:44 +0100)]
r600g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
Marek Olšák [Tue, 22 Nov 2011 19:47:14 +0000 (20:47 +0100)]
r300g: re-order shaders CAPs