mesa.git
12 years agost/glx: Fix compilation error
Thomas Hellstrom [Wed, 29 Jun 2011 12:49:57 +0000 (14:49 +0200)]
st/glx: Fix compilation error

Fix compilation error due to commit
"Rework how drawables are invalidated v3"

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
12 years agost/mesa: fix overwriting gl_format with pipe_format since 9d380f48
Andre Maasikas [Mon, 27 Jun 2011 15:03:27 +0000 (18:03 +0300)]
st/mesa: fix overwriting gl_format with pipe_format since 9d380f48

fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/dri: Get rid of the evil struct dri_drawable::context member
Thomas Hellstrom [Tue, 28 Jun 2011 12:07:51 +0000 (14:07 +0200)]
st/dri: Get rid of the evil struct dri_drawable::context member

It's incorrect to assume a single context bound to a drawable.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
12 years agost-api: Rework how drawables are invalidated v3.
Thomas Hellstrom [Wed, 29 Jun 2011 07:00:23 +0000 (09:00 +0200)]
st-api: Rework how drawables are invalidated v3.

The api and the state tracker manager code as well as the state tracker code
assumed that only a single context could be bound to a drawable. That is not
a valid assumption, since multiple contexts can bind to the same drawable.

Fix this by making it the state tracker's responsibility to update all
contexts binding to a drawable

Note that the state trackers themselves don't use atomic stamps on
frame-buffers. Multiple context rendering to the same drawable should
be protected by the application.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
12 years agoi915g: Fix unimplemented Abs comment.
Stéphane Marchesin [Wed, 29 Jun 2011 08:23:44 +0000 (01:23 -0700)]
i915g: Fix unimplemented Abs comment.

12 years agoi915g: If we have a program, that means the other fields are ours and we can free...
Stéphane Marchesin [Wed, 29 Jun 2011 03:38:07 +0000 (20:38 -0700)]
i915g: If we have a program, that means the other fields are ours and we can free them.

Otherwise they probably belong to draw.

12 years agoi915g: Don't overflow the program buffer.
Stéphane Marchesin [Wed, 29 Jun 2011 03:36:35 +0000 (20:36 -0700)]
i915g: Don't overflow the program buffer.

Otherwise it corrupts other fields of the struct and hilarity ensues.

12 years agoi915g: Update the TODO with another idea.
Stéphane Marchesin [Wed, 29 Jun 2011 03:18:57 +0000 (20:18 -0700)]
i915g: Update the TODO with another idea.

12 years agoglsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Paul Berry [Fri, 24 Jun 2011 22:34:04 +0000 (15:34 -0700)]
glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.

Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Changed extension enable bits to bools.
Paul Berry [Fri, 24 Jun 2011 19:33:30 +0000 (12:33 -0700)]
glsl: Changed extension enable bits to bools.

These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: permit explicit locations on fragment shader outputs, not inputs
Paul Berry [Tue, 28 Jun 2011 16:42:24 +0000 (09:42 -0700)]
glsl: permit explicit locations on fragment shader outputs, not inputs

From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624

12 years agoi915g: Fix comment about sin/cos constants.
Stéphane Marchesin [Tue, 28 Jun 2011 19:07:11 +0000 (12:07 -0700)]
i915g: Fix comment about sin/cos constants.

12 years agoi915g: Fix staging texture uploads a bit.
Stéphane Marchesin [Tue, 28 Jun 2011 19:04:45 +0000 (12:04 -0700)]
i915g: Fix staging texture uploads a bit.

They still look corrupted, but at least now they don't look tiled any more.

12 years agoi965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
Eric Anholt [Sun, 19 Jun 2011 19:04:46 +0000 (12:04 -0700)]
i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.

This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.

12 years agoi965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
Eric Anholt [Sun, 19 Jun 2011 18:33:40 +0000 (11:33 -0700)]
i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.

The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.

12 years agoglx: Check HAVE_XF86VIDMODE before adding it as an implicit link
Alan Hourihane [Tue, 28 Jun 2011 16:40:24 +0000 (17:40 +0100)]
glx: Check HAVE_XF86VIDMODE before adding it as an implicit link
library.

12 years agoDon't use -fvisibilty=hidden on cygwin
Jon TURNEY [Tue, 26 Apr 2011 10:56:02 +0000 (11:56 +0100)]
Don't use -fvisibilty=hidden on cygwin

All it's going to do is generate lots and lots and lots of
'warning: visibility attribute not supported in this configuration; ignored'
warnings

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
12 years agoFix config check that claims to test if CXX supports -fvisibility=hidden option to...
Jon TURNEY [Tue, 26 Apr 2011 10:49:01 +0000 (11:49 +0100)]
Fix config check that claims to test if CXX supports -fvisibility=hidden option to actually test the C++ compiler.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
12 years agoi915g: Add a debug_printf when we get the Abs flag.
Stéphane Marchesin [Tue, 28 Jun 2011 09:14:43 +0000 (02:14 -0700)]
i915g: Add a debug_printf when we get the Abs flag.

12 years agoi915g: Support PIPE_FORMAT_B10G10R10A2_UNORM.
Stéphane Marchesin [Tue, 28 Jun 2011 08:41:57 +0000 (01:41 -0700)]
i915g: Support PIPE_FORMAT_B10G10R10A2_UNORM.

12 years agoi915g: Improve SIN/COS a bit.
Stéphane Marchesin [Tue, 28 Jun 2011 07:53:01 +0000 (00:53 -0700)]
i915g: Improve SIN/COS a bit.

12 years agoi915g: When emulating LUMINANCE8 and INTENSITY8 texutres, route alpha properly.
Stéphane Marchesin [Tue, 28 Jun 2011 06:00:16 +0000 (23:00 -0700)]
i915g: When emulating LUMINANCE8 and INTENSITY8 texutres, route alpha properly.

That fixes some formats in fbo-alphatest-formats.

12 years agoi915g: fix shadow compare.
Stéphane Marchesin [Tue, 28 Jun 2011 05:40:03 +0000 (22:40 -0700)]
i915g: fix shadow compare.

"Works" as well as i915c now.

12 years agotargets/egl-static: fix library search order
Chia-I Wu [Tue, 28 Jun 2011 06:23:20 +0000 (15:23 +0900)]
targets/egl-static: fix library search order

Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.

12 years agost/egl: update fbdev backend
Chia-I Wu [Tue, 28 Jun 2011 01:22:01 +0000 (10:22 +0900)]
st/egl: update fbdev backend

Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.

12 years agoi915g: Enable GL_ARB_instanced_arrays.
Stéphane Marchesin [Tue, 28 Jun 2011 02:24:42 +0000 (19:24 -0700)]
i915g: Enable GL_ARB_instanced_arrays.

12 years agoi915g: Fix a bug in facing.
Stéphane Marchesin [Tue, 28 Jun 2011 01:27:50 +0000 (18:27 -0700)]
i915g: Fix a bug in facing.

However doesn't work because of limitations in the draw module.

12 years agoi965: step message register allocation
Ben Widawsky [Thu, 16 Jun 2011 23:53:04 +0000 (16:53 -0700)]
i965: step message register allocation

The system routine requires m0 be reserved for saving off architectural
state. Moved the allocation to start at 2 instead of 0.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Fix depth unbalancing problem in if-statement flattening
Ian Romanick [Thu, 2 Jun 2011 19:42:48 +0000 (12:42 -0700)]
glsl: Fix depth unbalancing problem in if-statement flattening

Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi915g: Remove unused cbuf_dirty.
Stéphane Marchesin [Mon, 27 Jun 2011 09:08:44 +0000 (02:08 -0700)]
i915g: Remove unused cbuf_dirty.

12 years agoi915g: Add a comment about a bug.
Stéphane Marchesin [Mon, 27 Jun 2011 09:05:10 +0000 (02:05 -0700)]
i915g: Add a comment about a bug.

12 years agoi915g: initial support for SEMANTIC_FACE.
Stéphane Marchesin [Mon, 27 Jun 2011 09:04:38 +0000 (02:04 -0700)]
i915g: initial support for SEMANTIC_FACE.

Doesn't work yet, see TODO.

12 years agoi915g: update TODO.
Stéphane Marchesin [Mon, 27 Jun 2011 09:03:45 +0000 (02:03 -0700)]
i915g: update TODO.

12 years agoi915g: Return the max result for the fake occlusion queries.
Stéphane Marchesin [Mon, 27 Jun 2011 02:38:12 +0000 (19:38 -0700)]
i915g: Return the max result for the fake occlusion queries.

12 years agoi915g: Fix depth texture formats.
Stéphane Marchesin [Mon, 27 Jun 2011 02:17:04 +0000 (19:17 -0700)]
i915g: Fix depth texture formats.

Depth compare still looks broken though.

12 years agoi915g: Fix u_blitter comment.
Stéphane Marchesin [Mon, 27 Jun 2011 02:09:02 +0000 (19:09 -0700)]
i915g: Fix u_blitter comment.

12 years agoi915g: Implement fake DDX/DDY.
Stéphane Marchesin [Sun, 26 Jun 2011 20:40:54 +0000 (13:40 -0700)]
i915g: Implement fake DDX/DDY.

12 years agoi915g: Fix gl_FragCoord.
Stéphane Marchesin [Sun, 26 Jun 2011 12:01:24 +0000 (05:01 -0700)]
i915g: Fix gl_FragCoord.

12 years agoegl: Fix Terminate with shared gbm screens
Benjamin Franzke [Mon, 27 Jun 2011 08:23:34 +0000 (10:23 +0200)]
egl: Fix Terminate with shared gbm screens

NOTE: This is a candidate for the 7.11 branch.

12 years agost/d3d1x: fix for st/egl native.h interface change
Chia-I Wu [Mon, 27 Jun 2011 02:47:27 +0000 (11:47 +0900)]
st/d3d1x: fix for st/egl native.h interface change

The interface was changed in 73df31eedd0f33c8a9907855cb247c8f87964c48.

12 years agoconfigure.ac: sort Gallium directories alphabetically
Marek Olšák [Mon, 27 Jun 2011 01:12:57 +0000 (03:12 +0200)]
configure.ac: sort Gallium directories alphabetically

12 years agotargets/egl-static: fix building without libudev
Chia-I Wu [Sun, 26 Jun 2011 09:03:15 +0000 (18:03 +0900)]
targets/egl-static: fix building without libudev

Thanks to José for pointing out.

12 years agotargets/egl-static: refactor drm_fd_get_screen_name
Chia-I Wu [Sat, 25 Jun 2011 22:58:16 +0000 (07:58 +0900)]
targets/egl-static: refactor drm_fd_get_screen_name

Add drm_fd_get_pci_id to get the PCI ID.  Fix a leak with udev on error.

12 years agost/egl: fix a compile error
Chia-I Wu [Sat, 25 Jun 2011 23:02:13 +0000 (08:02 +0900)]
st/egl: fix a compile error

It is triggered when --with-driver=xlib is specified.

12 years agotargets/gbm: attemp to fix unresolved symbols
Chia-I Wu [Sat, 25 Jun 2011 22:36:26 +0000 (07:36 +0900)]
targets/gbm: attemp to fix unresolved symbols

Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.

12 years agor300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Marek Olšák [Sat, 25 Jun 2011 05:20:20 +0000 (07:20 +0200)]
r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets

Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

12 years agoRevert "Fix 24bpp software rendering"
Brian Paul [Sat, 25 Jun 2011 12:17:01 +0000 (06:17 -0600)]
Revert "Fix 24bpp software rendering"

This reverts commit c0c0bb6cb140825f5bab3c40c0c9c0ec575fbc76.

12 years agoegl: fix EGL_MATCH_NATIVE_PIXMAP
Chia-I Wu [Sat, 25 Jun 2011 09:28:20 +0000 (18:28 +0900)]
egl: fix EGL_MATCH_NATIVE_PIXMAP

EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.

12 years agost/egl: add get_pixmap_format callback to native_display
Chia-I Wu [Sat, 25 Jun 2011 07:44:11 +0000 (16:44 +0900)]
st/egl: add get_pixmap_format callback to native_display

And use it for EGL_MATCH_NATIVE_PIXMAP.  Remove is_pixmap_supported
meanwhile.

12 years agoegl: make implementing eglChooseConfig easier
Chia-I Wu [Sat, 25 Jun 2011 08:32:15 +0000 (17:32 +0900)]
egl: make implementing eglChooseConfig easier

Add a new helper function, _eglFilterConfigArray, for drivers and hide
_eglSortConfigs.

12 years agotargets/egl-static: do not use DRI_LIB_DEPS
Chia-I Wu [Sat, 25 Jun 2011 09:09:18 +0000 (18:09 +0900)]
targets/egl-static: do not use DRI_LIB_DEPS

It brings in libraries that are not necessarily needed.

12 years agost/egl: add a fast path for ximage eglCopyBuffers
Chia-I Wu [Sat, 25 Jun 2011 07:18:11 +0000 (16:18 +0900)]
st/egl: add a fast path for ximage eglCopyBuffers

12 years agost/egl: clean up eglCopyBuffers
Chia-I Wu [Sat, 25 Jun 2011 06:48:24 +0000 (15:48 +0900)]
st/egl: clean up eglCopyBuffers

Add copy_to_pixmap method to native_display and use it for
eglCopyBuffers.

12 years agost/egl: reorganize backend initialization
Chia-I Wu [Sat, 25 Jun 2011 05:52:57 +0000 (14:52 +0900)]
st/egl: reorganize backend initialization

Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().

12 years agoi915g: always upload the vs constants.
Stéphane Marchesin [Sat, 25 Jun 2011 02:51:25 +0000 (19:51 -0700)]
i915g: always upload the vs constants.

This fixes a crash in llvm draw.

12 years agoi965/gen5: Fix grf_used calculation for 16-wide.
Eric Anholt [Fri, 24 Jun 2011 22:40:51 +0000 (15:40 -0700)]
i965/gen5: Fix grf_used calculation for 16-wide.

If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
12 years agoi915g: add fake occlusion queries.
Stéphane Marchesin [Sat, 25 Jun 2011 00:18:12 +0000 (17:18 -0700)]
i915g: add fake occlusion queries.

Those always return 0, but at least we don't crash when exposing GL 2.0.

12 years agoi915g: Don't do shader fixup if no surface is bound.
Stéphane Marchesin [Fri, 24 Jun 2011 23:41:09 +0000 (16:41 -0700)]
i915g: Don't do shader fixup if no surface is bound.

12 years agoi915g: Fix point sprites.
Stéphane Marchesin [Fri, 24 Jun 2011 23:18:58 +0000 (16:18 -0700)]
i915g: Fix point sprites.

12 years agoindices: fix conversion of PIPE_PRIM_POLYGON to lines
Brian Paul [Fri, 24 Jun 2011 00:44:42 +0000 (18:44 -0600)]
indices: fix conversion of PIPE_PRIM_POLYGON to lines

When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.

12 years agoi965: fix mask used to write to clip distance registers when gen>6
Paul Berry [Sun, 12 Jun 2011 17:47:46 +0000 (10:47 -0700)]
i965: fix mask used to write to clip distance registers when gen>6

In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test

12 years agor600g: limit fs_write_all shader rebuild to eg+
Alex Deucher [Fri, 24 Jun 2011 22:27:39 +0000 (18:27 -0400)]
r600g: limit fs_write_all shader rebuild to eg+

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
12 years agor600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Alex Deucher [Fri, 24 Jun 2011 22:05:53 +0000 (18:05 -0400)]
r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS

Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
12 years agointel: Fix workaround for _mesa_update_framebuffer
Chad Versace [Thu, 23 Jun 2011 08:20:19 +0000 (01:20 -0700)]
intel: Fix workaround for _mesa_update_framebuffer

In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Change framebuffer validation criteria
Chad Versace [Thu, 23 Jun 2011 00:52:22 +0000 (17:52 -0700)]
intel: Change framebuffer validation criteria

Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Chad Versace [Thu, 23 Jun 2011 02:44:53 +0000 (19:44 -0700)]
intel: In intel_update_wrapper, support s8z24 textures when using separate stencil

Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Factor region updates out of intel_update_wrapper
Chad Versace [Wed, 22 Jun 2011 23:08:49 +0000 (16:08 -0700)]
intel: Factor region updates out of intel_update_wrapper

... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: During glTexImage, allocate renderbuffers for faking s8z24 textures
Chad Versace [Tue, 21 Jun 2011 22:54:27 +0000 (15:54 -0700)]
intel: During glTexImage, allocate renderbuffers for faking s8z24 textures

... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Declare some functions in intel_fbo.c as non-static
Chad Versace [Wed, 22 Jun 2011 17:26:26 +0000 (10:26 -0700)]
intel: Declare some functions in intel_fbo.c as non-static

... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Change signature of intel_create_wrapped_renderbuffer
Chad Versace [Tue, 21 Jun 2011 21:06:13 +0000 (14:06 -0700)]
intel: Change signature of intel_create_wrapped_renderbuffer

Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Perform gather on s8z24 texture images during glGetTexImage
Chad Versace [Wed, 22 Jun 2011 04:42:48 +0000 (21:42 -0700)]
intel: Perform gather on s8z24 texture images during glGetTexImage

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Define functions intel_texture_s8z24_scatter/gather
Chad Versace [Wed, 22 Jun 2011 05:58:39 +0000 (22:58 -0700)]
intel: Define functions intel_texture_s8z24_scatter/gather

... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agointel: Add fields to intel_texture for faking s8z24 with separate stencil
Chad Versace [Tue, 21 Jun 2011 20:44:57 +0000 (13:44 -0700)]
intel: Add fields to intel_texture for faking s8z24 with separate stencil

Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
12 years agost/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Stéphane Marchesin [Fri, 24 Jun 2011 21:07:31 +0000 (14:07 -0700)]
st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.

Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.

12 years agomesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Marek Olšák [Tue, 21 Jun 2011 03:08:28 +0000 (05:08 +0200)]
mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: fix a memory leak in _mesa_unpack_depth_span
Marek Olšák [Tue, 21 Jun 2011 03:07:53 +0000 (05:07 +0200)]
mesa: fix a memory leak in _mesa_unpack_depth_span

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
Marek Olšák [Tue, 21 Jun 2011 03:10:26 +0000 (05:10 +0200)]
mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX

NOTE: This is a candidate for the 7.10 branch.

12 years agomesa: remove unused function _mesa_new_depthstencil_renderbuffer
Marek Olšák [Wed, 1 Jun 2011 13:10:27 +0000 (15:10 +0200)]
mesa: remove unused function _mesa_new_depthstencil_renderbuffer

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Brian Paul [Fri, 24 Jun 2011 19:59:33 +0000 (13:59 -0600)]
st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()

Commit 1a339b6c71ebab6e1a64f05b2e133022d3bbcd15 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38649

NOTE: This is a candidate for the 7.10 branch.

12 years agoegl_dri2: Build drm platform only if enabled
Benjamin Franzke [Fri, 24 Jun 2011 19:45:05 +0000 (21:45 +0200)]
egl_dri2: Build drm platform only if enabled

12 years agor600g: implement fragment and vertex color clamp
Vadim Girlin [Fri, 24 Jun 2011 16:29:13 +0000 (20:29 +0400)]
r600g: implement fragment and vertex color clamp

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agor600g: optimize spi update
Vadim Girlin [Fri, 24 Jun 2011 16:29:12 +0000 (20:29 +0400)]
r600g: optimize spi update

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agor600g: LIT: fix x&y slots order
Vadim Girlin [Fri, 24 Jun 2011 16:29:11 +0000 (20:29 +0400)]
r600g: LIT: fix x&y slots order

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoi965: Make the brw_format_for_mesa_format table static const.
Eric Anholt [Wed, 22 Jun 2011 00:38:20 +0000 (17:38 -0700)]
i965: Make the brw_format_for_mesa_format table static const.

Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd9396b0d3f9e84df41fd8bef1f26cc4.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965: Don't bother telling swrast_setup about state updates until fallback.
Eric Anholt [Wed, 22 Jun 2011 00:02:14 +0000 (17:02 -0700)]
i965: Don't bother telling swrast_setup about state updates until fallback.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965: Don't bother telling tnl about state updates unless we fall back.
Eric Anholt [Tue, 21 Jun 2011 23:52:51 +0000 (16:52 -0700)]
i965: Don't bother telling tnl about state updates unless we fall back.

This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965: Reuse existing program data when a new compiled program matches.
Eric Anholt [Sat, 26 Feb 2011 10:01:37 +0000 (02:01 -0800)]
i965: Reuse existing program data when a new compiled program matches.

It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agost/mesa: fix all_varyings_in_vbos() regression
Brian Paul [Fri, 24 Jun 2011 16:41:42 +0000 (10:41 -0600)]
st/mesa: fix all_varyings_in_vbos() regression

Fixes regression from d631c19db47181129811080bfa772b210d762d4d.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626

12 years agoFix 24bpp software rendering
Marc Pignat [Fri, 24 Jun 2011 13:19:32 +0000 (15:19 +0200)]
Fix 24bpp software rendering

This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agogallium/tests/trivial: update comment
Brian Paul [Fri, 24 Jun 2011 15:01:33 +0000 (09:01 -0600)]
gallium/tests/trivial: update comment

12 years agogallium/tests/trivial: use CXX to do final link
Brian Paul [Fri, 24 Jun 2011 15:00:57 +0000 (09:00 -0600)]
gallium/tests/trivial: use CXX to do final link

12 years agogallium/tests/trivial: make it build
Alon Levy [Wed, 22 Jun 2011 12:31:11 +0000 (14:31 +0200)]
gallium/tests/trivial: make it build

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/egl: make native_buffer interface typed
Chia-I Wu [Fri, 24 Jun 2011 04:30:35 +0000 (13:30 +0900)]
st/egl: make native_buffer interface typed

Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.

12 years agotargets/egl: removed
Chia-I Wu [Fri, 24 Jun 2011 02:15:55 +0000 (11:15 +0900)]
targets/egl: removed

Not used.

12 years agotargets/egl-static: replace targets/egl
Chia-I Wu [Mon, 20 Jun 2011 03:01:39 +0000 (12:01 +0900)]
targets/egl-static: replace targets/egl

Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.

12 years agotargets/egl-static: allow st/mesa to be dynamically loaded
Chia-I Wu [Thu, 23 Jun 2011 11:08:53 +0000 (20:08 +0900)]
targets/egl-static: allow st/mesa to be dynamically loaded

When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).

12 years agotargets/egl-static: add support for driver lookup
Chia-I Wu [Mon, 20 Jun 2011 03:36:02 +0000 (12:36 +0900)]
targets/egl-static: add support for driver lookup

Use pci id to driver map to look up the driver name.  This is based on
a433755ec5c48088a0d8a340851a1a8be9e58897.

12 years agotargets/gbm: build pipe drivers
Chia-I Wu [Fri, 24 Jun 2011 01:39:06 +0000 (10:39 +0900)]
targets/gbm: build pipe drivers

Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.

[with an update by Benjamin Franzke to use --{start|end}-group]

12 years agoconfigure: Disable drm egl platform by default
Benjamin Franzke [Fri, 24 Jun 2011 07:33:20 +0000 (09:33 +0200)]
configure: Disable drm egl platform by default

So that gbm(_dri) which pulls in shared-glapi is not needed.

12 years agodri/r200: properly spell current_atom.
Stéphane Marchesin [Fri, 24 Jun 2011 04:00:26 +0000 (21:00 -0700)]
dri/r200: properly spell current_atom.