mesa.git
12 years agogallium: utility helper functions for stream output
Marek Olšák [Fri, 9 Dec 2011 17:12:55 +0000 (18:12 +0100)]
gallium: utility helper functions for stream output

12 years agogallium: interface changes necessary to implement transform feedback (v5)
Marek Olšák [Thu, 15 Dec 2011 17:42:21 +0000 (18:42 +0100)]
gallium: interface changes necessary to implement transform feedback (v5)

Namely:
- EXT_transform_feedback
- ARB_transform_feedback2
- ARB_transform_feedback_instanced

The old interface was not useful for OpenGL and had to be reworked.

This interface was originally designed for OpenGL, but additional
changes have been made in order to make st/d3d1x support easier.

The most notable change is the stream-out info must be linked
with a vertex or geometry shader and cannot be set independently.
This is due to limitations of existing hardware (special shader
instructions must be used to write into stream-out buffers),
and it's also how OpenGL works (stream outputs must be specified
prior to linking shaders).

Other than that, each stream output buffer has a "view" into it that
internally maintains the number of bytes which have been written
into it. (one buffer can be bound in several different transform
feedback objects in OpenGL, so we must be able to have several views
around) The set_stream_output_targets function contains a parameter
saying whether new data should be appended or not.

Also, the view can optionally be used to provide the vertex
count for draw_vbo. Note that the count is supposed to be stored
in device memory and the CPU never gets to know its value.

OpenGL way | Gallium way
------------------------------------
BeginTF    = set_so_targets(append_bitmask = 0)
PauseTF    = set_so_targets(num_targets = 0)
ResumeTF   = set_so_targets(append_bitmask = ~0)
EndTF      = set_so_targets(num_targets = 0)
DrawTF     = use pipe_draw_info::count_from_stream_output

v2: * removed the reset_stream_output_targets function
    * added a parameter append_bitmask to set_stream_output_targets,
      each bit specifies whether new data should be appended to each
      buffer or not.
v3: * added PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME for ARB_tfb2,
      note that the draw-auto subset is always required (for d3d10),
      only the pause/resume functionality is limited if the CAP is not
      advertised
v4: * update gallium/docs
v5: * compactified struct pipe_stream_output_info, updated dump/trace

12 years agogallium: disable stream output in drivers that support it
Marek Olšák [Sat, 19 Nov 2011 20:44:24 +0000 (21:44 +0100)]
gallium: disable stream output in drivers that support it

I am going to make interface changes and I don't want to break compilation.

12 years agomesa: implement DrawTransformFeedback from ARB_transform_feedback2
Marek Olšák [Fri, 9 Dec 2011 16:00:23 +0000 (17:00 +0100)]
mesa: implement DrawTransformFeedback from ARB_transform_feedback2

It's like DrawArrays, but the count is taken from a transform feedback
object.

This removes DrawTransformFeedback from dd_function_table and adds the same
function to GLvertexformat (with the function parameters matching GL).

The vbo_draw_func callback has a new parameter
"struct gl_transform_feedback_object *tfb_vertcount".

The rest of the code just validates states and forwards the transform
feedback object into vbo_draw_func.

12 years agost/xa: Disable composite solid fill with mask
Thomas Hellstrom [Wed, 14 Dec 2011 15:18:06 +0000 (16:18 +0100)]
st/xa: Disable composite solid fill with mask

Xa doesn't support it yet. Trying to do that would cause a segfault.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agost/xa: Fix format conversion copy alpha channel
Thomas Hellstrom [Wed, 14 Dec 2011 15:02:54 +0000 (16:02 +0100)]
st/xa: Fix format conversion copy alpha channel

When doing format conversion copies between a format without an
alpha channel and a format with an alpha channel, make sure the
destination alpha is set to 1.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agost/xa: Fix component alpha check
Thomas Hellstrom [Wed, 14 Dec 2011 08:37:09 +0000 (09:37 +0100)]
st/xa: Fix component alpha check

Component alpha only affects mask pictures.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agost/egl: fix compiler warnings
Chia-I Wu [Thu, 15 Dec 2011 07:06:25 +0000 (15:06 +0800)]
st/egl: fix compiler warnings

One is about casting a pointer to integer and the other is about an unused
function when HAVE_WAYLAND_BACKEND is not defined.

12 years agost/egl: Implement EGL_NOK_swap_region for x11
Fredrik Höglund [Wed, 14 Dec 2011 20:06:29 +0000 (21:06 +0100)]
st/egl: Implement EGL_NOK_swap_region for x11

v2: inline x11_drawable_copy_buffers().

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
[olv: s/inline/INLINE/]

12 years agost/egl: Add support for EGL_NOK_swap_region
Fredrik Höglund [Wed, 14 Dec 2011 20:06:28 +0000 (21:06 +0100)]
st/egl: Add support for EGL_NOK_swap_region

Backends indicate that they support this extension by returning
EGL_TRUE when native_display::get_param() is called with
NATIVE_PARAM_PRESENT_REGION and NATIVE_PARAM_PRESERVE_BUFFER.

native_present_control is extended to include the region that should
be presented. When native_present_control::num_rects is zero,
the whole surface is to be presented.

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
12 years agoi965: Drop separate stencil assertions in update_draw_buffer().
Eric Anholt [Thu, 8 Dec 2011 02:12:04 +0000 (18:12 -0800)]
i965: Drop separate stencil assertions in update_draw_buffer().

The comment said they deserved to be in emit_depthbuffer, and at this
point they were all there already.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Simplify and touch up the FBO completeness test.
Eric Anholt [Thu, 8 Dec 2011 01:51:14 +0000 (17:51 -0800)]
intel: Simplify and touch up the FBO completeness test.

Now that we have miptrees for everything, we can more easily test for
!has_separate_stencil completeness.  Also, test for whether the
stencil rb is the wrong kind of format for separate stencil, or if we
are trying to do packed to different images of a single miptree.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Remove another renderbuffer allocation path.
Eric Anholt [Wed, 7 Dec 2011 23:44:02 +0000 (15:44 -0800)]
intel: Remove another renderbuffer allocation path.

Now there's the thing that CALLOCs and sets up window system vtable,
and the thing that CALLOCs and sets up user renderbuffer vtable.  The
user renderbuffer vtable gets replaced later by
intel_renderbuffer_update_wrapper for wrapped renderbuffers (things
with name == ~0).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Make the separate stencil RB storage path match texture more.
Eric Anholt [Wed, 7 Dec 2011 23:38:08 +0000 (15:38 -0800)]
intel: Make the separate stencil RB storage path match texture more.

There were too many things making intel_renderbuffer *s and tweaking
their bits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Move S8 width/height alignment to miptree creation.
Eric Anholt [Thu, 8 Dec 2011 00:37:26 +0000 (16:37 -0800)]
intel: Move S8 width/height alignment to miptree creation.

We were doing it in the caller in the renderbuffer code, but it was
missed in the separate stencil creation for textures.  Apparently our
testing was using renderbuffers or pre-aligned sizes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Drop check for wrapped_depth in RB mapping.
Eric Anholt [Wed, 7 Dec 2011 22:50:02 +0000 (14:50 -0800)]
intel: Drop check for wrapped_depth in RB mapping.

This used to be needed because irb->mt would be unset for fake packed
depth/stencil, but no longer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Fix uninitialized values in debug output for renderbuffer mapping.
Eric Anholt [Tue, 13 Dec 2011 20:03:37 +0000 (12:03 -0800)]
intel: Fix uninitialized values in debug output for renderbuffer mapping.

12 years agoswrast: Add a note about overlapping support for framebuffer blit.
Eric Anholt [Thu, 8 Dec 2011 17:28:32 +0000 (09:28 -0800)]
swrast: Add a note about overlapping support for framebuffer blit.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoswrast: Don't do Z24S8 drawpixels fast-paths with Z32_X24S8 input data.
Eric Anholt [Sat, 3 Dec 2011 01:32:53 +0000 (17:32 -0800)]
swrast: Don't do Z24S8 drawpixels fast-paths with Z32_X24S8 input data.

The cool part was that in the "fbo-depthstencil -drawpixels
GL_DEPTH24_STENCIL8 32F_24_8_REV" testcase, the shifting happened to
end up with a value awfully close to the expected value, except for
every other pixel being 0 (the stencil value, shifted away to
nothing).

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/vdpau: fix unwanted output scaling
Christian König [Mon, 12 Dec 2011 15:51:12 +0000 (16:51 +0100)]
st/vdpau: fix unwanted output scaling

vlVdpPresentationQueueDisplay shouldn't scale, so
use size of destination surface as source rectangle.

Based on work of Maarten Lankhorst <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: some mixer fixes
Christian König [Mon, 12 Dec 2011 15:28:24 +0000 (16:28 +0100)]
st/vdpau: some mixer fixes

Correctly use destination_rect and destination_video_rect
in the mixer, and also use a dirty area tracking for output surfaces.

Based on work of Maarten Lankhorst <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agog3dvl/compositor: improve dirty area handling
Christian König [Mon, 12 Dec 2011 14:27:34 +0000 (15:27 +0100)]
g3dvl/compositor: improve dirty area handling

Take viewport and scissors into account and make
the dirty area a parameter instead of a member.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoAdd mismatch check for glGetTexImage or it will return -1 and may lead to segment...
Jian Zhao [Tue, 13 Dec 2011 05:31:41 +0000 (13:31 +0800)]
Add mismatch check for glGetTexImage or it will return -1 and may lead to segment fault.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: Fix crashes caused by Bison error messages involving "'%'".
Kenneth Graunke [Thu, 8 Dec 2011 09:35:48 +0000 (01:35 -0800)]
glsl: Fix crashes caused by Bison error messages involving "'%'".

Invalid shaders containing the character % at an unexpected location
would cause Bison to call yyerror with a message of:

    syntax error, unexpected '%'

Bison expects yyerror() to take a string, while _mesa_glsl_error() is a
printf-style function.  This hit the classic printf string escape issue:

    _mesa_glsl_error(loc, state, "unexpected '%'");       // invalid!
    _mesa_glsl_error(loc, state, "%s", "unexpected '%'"); // correct.

This caused assertion failures after ralloc_asprintf_append called
vsnprintf to determine the length of the text that would be printed:
vsnprintf would see the invalid format and return -1, an invalid length.

The solution is to define a proper yyerror() wrapper function that calls
_mesa_glsl_error with the "%s".  Since we compile with -p "_mesa_glsl",
yyerror is defined as:

    #define yyerror         _mesa_glsl_error

So we have to #undef yyerror in order to be able to declare it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43564
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoRegenerate files from previous commits
Ian Romanick [Thu, 8 Dec 2011 20:27:38 +0000 (12:27 -0800)]
Regenerate files from previous commits

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi/glx: For GLX code, use the existing _X_HIDDEN and _X_INTERNAL defines
Ian Romanick [Thu, 8 Dec 2011 18:58:06 +0000 (10:58 -0800)]
glapi/glx: For GLX code, use the existing _X_HIDDEN and _X_INTERNAL defines

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi/glx: Generate glapi_gentable.c so that the xserver can use it
Ian Romanick [Mon, 5 Dec 2011 23:24:49 +0000 (15:24 -0800)]
glapi/glx: Generate glapi_gentable.c so that the xserver can use it

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi/glx: Generate dispatch.h so that the xserver can use it
Ian Romanick [Mon, 5 Dec 2011 23:24:05 +0000 (15:24 -0800)]
glapi/glx: Generate dispatch.h so that the xserver can use it

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi/glx: Xserver wants dispatch.h, not glapidispatch.h
Ian Romanick [Mon, 5 Dec 2011 23:20:06 +0000 (15:20 -0800)]
glapi/glx: Xserver wants dispatch.h, not glapidispatch.h

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi/glx: Don't send GL API files to the xserver
Ian Romanick [Mon, 5 Dec 2011 23:18:54 +0000 (15:18 -0800)]
glapi/glx: Don't send GL API files to the xserver

The versions in the xserver and in libGL have diverged enough that the
xserver doesn't want these.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi: Remove mention of nonexistent enums
Ian Romanick [Mon, 5 Dec 2011 23:12:07 +0000 (15:12 -0800)]
glapi: Remove mention of nonexistent enums

glext.h doesn't have GL_MIN_PROGRAM_TEXEL_OFFSET_EXT or
GL_MAX_PROGRAM_TEXEL_OFFSET_EXT.  Using them in the XML causes code to
be generated for the xserver that won't compile.  Use the names that
exist instead.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoglapi/glx: Remove g_disptab.h from xserver generated files
Ian Romanick [Mon, 5 Dec 2011 23:10:55 +0000 (15:10 -0800)]
glapi/glx: Remove g_disptab.h from xserver generated files

That file was removed from the xserver with commit:

    commit a80780a7638f847c3be20e5e0c7fe85e83d9bdd1
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Wed Nov 17 09:03:06 2010 -0500

        glx: Remove swap barrier and hyperpipe support

        Never implemented in any open source driver.  The implementation
        assumed explicit DDX driver knowledge of how the client-side driver
        worked, since at the time the server's GL renderer was not a DRI driver.
        But now, it is, so any implementation of these should be done with
        additional DRI driver API, like the swap control extension.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agor300g: take advantage of KEEP_TILING_FLAGS flush flag
Marek Olšák [Tue, 13 Dec 2011 19:27:48 +0000 (20:27 +0100)]
r300g: take advantage of KEEP_TILING_FLAGS flush flag

This fixes at least two multi-context-related races.

12 years agonouveau: get rid of winsys object
Marcin Slusarz [Fri, 2 Dec 2011 21:02:51 +0000 (22:02 +0100)]
nouveau: get rid of winsys object

Its only purpose was to destroy itself.

12 years agoi915g: Roll back to the previous shader limits.
Stéphane Marchesin [Fri, 9 Dec 2011 03:22:13 +0000 (19:22 -0800)]
i915g: Roll back to the previous shader limits.

Those shader limits seem to be responsible for a piglit hang.

12 years agoi915g: Update TODO.
Stéphane Marchesin [Fri, 4 Nov 2011 23:13:50 +0000 (16:13 -0700)]
i915g: Update TODO.

12 years agowinsys/radeon: add flush option not to rewrite tiling flags in registers
Marek Olšák [Mon, 24 Oct 2011 23:44:45 +0000 (01:44 +0200)]
winsys/radeon: add flush option not to rewrite tiling flags in registers

Not used yet.

12 years agomesa: add const flags to skip MaxVarying and MaxUniform linker checks (v2)
Marek Olšák [Sat, 10 Dec 2011 03:14:46 +0000 (04:14 +0100)]
mesa: add const flags to skip MaxVarying and MaxUniform linker checks (v2)

This is only temporary until a better solution is available.

v2: print warnings and add gallium CAPs

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: fix an out-of-bounds access in prog_print.c
Marek Olšák [Mon, 12 Dec 2011 05:29:31 +0000 (06:29 +0100)]
mesa: fix an out-of-bounds access in prog_print.c

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl_to_tgsi: fix typo in comment
Bryan Cain [Tue, 13 Dec 2011 16:33:44 +0000 (10:33 -0600)]
glsl_to_tgsi: fix typo in comment

12 years agoglsl_to_tgsi: emit both operands of shift and bitwise operations
Bryan Cain [Tue, 13 Dec 2011 16:30:59 +0000 (10:30 -0600)]
glsl_to_tgsi: emit both operands of shift and bitwise operations

Fixes these operations when native integers are enabled.

12 years agoegl_dri2: Fix some valgrind reported leaks
Benjamin Franzke [Tue, 13 Dec 2011 13:43:48 +0000 (14:43 +0100)]
egl_dri2: Fix some valgrind reported leaks

Free the device_name, reported by Pekka Paalanen.

Destroy wayland display and drm resources,
if created by dri2_initialize_wayland.

12 years agomesa: update comments for _DepthBuffer, _StencilBuffer fields
Brian Paul [Sat, 10 Dec 2011 18:44:44 +0000 (11:44 -0700)]
mesa: update comments for _DepthBuffer, _StencilBuffer fields

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: remove _DepthBuffer, _StencilBuffer resize code
Brian Paul [Sat, 10 Dec 2011 18:44:44 +0000 (11:44 -0700)]
mesa: remove _DepthBuffer, _StencilBuffer resize code

This is handled in swrast now when we validate the framebuffer state.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: add debug code to test combined depth/stencil buffers
Brian Paul [Sat, 10 Dec 2011 18:44:44 +0000 (11:44 -0700)]
swrast: add debug code to test combined depth/stencil buffers

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: remove unused depthstencil.[ch] files
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
mesa: remove unused depthstencil.[ch] files

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: move depth/stencil buffer validation to swrast
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
mesa: move depth/stencil buffer validation to swrast

Since gl_framebuffer::_DepthBuffer and _StencilBuffer are only used
by swrast, do the validation of those fields in swrast too.
The main/depthstencil.[ch] code is no longer used and will be removed
next.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: update depth/stencil wrapper sizes
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
swrast: update depth/stencil wrapper sizes

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: build swrast/s_depthstencil.c
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
mesa: build swrast/s_depthstencil.c

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: add new s_depthstencil.[ch] files
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
swrast: add new s_depthstencil.[ch] files

These files are copies of main/depthstencil.[ch] with s/mesa/swrast/.
The main/depthstencil.[ch] will go away soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: move update_depth/stencil_buffer() functions
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
mesa: move update_depth/stencil_buffer() functions

These functions update the gl_framebuffer::_DepthBuffer and _StencilBuffer
fields, possibly creating renderbuffer wrappers that make a shared
depth+stencil accessible as depth-only or stencil only.
This stuff is only used by swrast now and will be moved there next.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoradeon: stop using _DepthBuffer, _StencilBuffer fields
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
radeon: stop using _DepthBuffer, _StencilBuffer fields

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agonouveau: stop using _DepthBuffer, _StencilBuffer fields
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
nouveau: stop using _DepthBuffer, _StencilBuffer fields

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: stop using _Depth, _StencilBuffer fields in _mesa_BlitFramebufferEXT()
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
mesa: stop using _Depth, _StencilBuffer fields in _mesa_BlitFramebufferEXT()

We're just looking at the depth/stencil renderbuffers to do error
checking.  We don't need to look at the depth/stencil wrappers to do
that.  Also, remove pointless readRb = depthRb = NULL assignments.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agost/mesa: stop using _DepthBuffer, _StencilBuffer fields
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
st/mesa: stop using _DepthBuffer, _StencilBuffer fields

We never want to use the depth/stencil buffer wrappers so always just
use the attachment renderbuffers.  This is a step toward removing the
_DepthBuffer, _StencilBuffer fields.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: add missing state validation calls for Blit, Clear
Brian Paul [Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)]
swrast: add missing state validation calls for Blit, Clear

12 years agor600g: add some new pci ids
Alex Deucher [Mon, 12 Dec 2011 14:48:15 +0000 (09:48 -0500)]
r600g: add some new pci ids

fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=43739

Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agomesa: fix possible precision issues in pack/unpack/fetch functions
Marek Olšák [Sun, 11 Dec 2011 15:18:36 +0000 (16:18 +0100)]
mesa: fix possible precision issues in pack/unpack/fetch functions

GLfloat doesn't have enough precision to exactly represent 0xffffff
and 0xffffffff. (and a reciprocal of those, if I am not mistaken)

If -ffast-math is enabled, using GLfloat causes assertion failures in:
- fbo-blit-d24s8
- fbo-depth-sample-compare
- fbo-readpixels-depth-formats
- glean/depthStencil

For example:
fbo-depth-sample-compare: main/format_unpack.c:1769:
unpack_float_z_Z24_X8: Assertion `dst[i] <= 1.0F' failed.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agor300g: integer and fixed-point 16.16 textures are not supported
Marek Olšák [Sun, 11 Dec 2011 12:25:56 +0000 (13:25 +0100)]
r300g: integer and fixed-point 16.16 textures are not supported

12 years agost/mesa: add color varyings to MaxVarying
Marek Olšák [Tue, 22 Nov 2011 14:05:29 +0000 (15:05 +0100)]
st/mesa: add color varyings to MaxVarying

The linker now adds color varyings to the number of used varyings and checks
against that limit.

NOTE: This is a candidate for the 7.11 branch.

12 years agoi915g: fix debug dump on 64 bit systems
Michael Karcher [Sun, 11 Dec 2011 21:24:10 +0000 (13:24 -0800)]
i915g: fix debug dump on 64 bit systems

12 years agoi915g: Fix wrong indices for LINE_LOOP case
Fatih Aşıcı [Sun, 11 Dec 2011 21:21:53 +0000 (13:21 -0800)]
i915g: Fix wrong indices for LINE_LOOP case

12 years agovl: Add missing mpeg fields to pipe_mpeg12_picture_desc
Maarten Lankhorst [Fri, 2 Dec 2011 00:00:54 +0000 (01:00 +0100)]
vl: Add missing mpeg fields to pipe_mpeg12_picture_desc

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
12 years agog3dvl/xlib: fix build by changing include order
Tobias Droste [Sun, 11 Dec 2011 04:13:47 +0000 (05:13 +0100)]
g3dvl/xlib: fix build by changing include order

fixes the following build error since
c83fb4d45f2a47042f395271efe6e5489b2c4aee:

/usr/include/strings.h:46:13: error: expected declaration specifiers or
‘...’ before numeric constant
/usr/include/strings.h:46:13: error: conflicting types for ‘memset’
In file included from
../../../../src/gallium/winsys/g3dvl/xlib/xsp_winsys.c:34:0:
../../../../src/gallium/auxiliary/util/u_inlines.h: In function
‘pipe_buffer_create’:
../../../../src/gallium/auxiliary/util/u_inlines.h:189:4: error: too
many arguments to function ‘memset’
/usr/include/strings.h:46:13: note: declared here

bzero is defined in X11 as: #define bzero(b,len) memset(b,0,len)
including strings.h after the X11 header results in preprocessor
replacing 'bzero' in strings.h and generating unbuildable code.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
12 years agost/mesa: move frag depth up a level.
Dave Airlie [Sat, 10 Dec 2011 17:30:37 +0000 (17:30 +0000)]
st/mesa: move frag depth up a level.

This fixes the segfault, and seems to put this closer to where other
properties are being set. Hopefully it still conforms.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoRevert "st/mesa: only resolve is number of samples is > 1"
Dave Airlie [Sat, 10 Dec 2011 09:04:46 +0000 (09:04 +0000)]
Revert "st/mesa: only resolve is number of samples is > 1"

This reverts commit 8c713626db33c40c18e24c880fe47d7948f4dcd7.

Didn't mean to push this at all

12 years agost/mesa: only resolve is number of samples is > 1
Dave Airlie [Wed, 30 Nov 2011 20:10:33 +0000 (20:10 +0000)]
st/mesa: only resolve is number of samples is > 1

This fixes the firefox crash but I've no idea if its correct.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.
Dave Airlie [Sun, 4 Dec 2011 20:14:09 +0000 (20:14 +0000)]
mesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.

This just adds the correct checks and asserts in the right places. This doesn't
fix all the tests that I've sent to piglit, need to add int paths to go alongside the uint paths that don't go via float to fix it up properly.

I'm not sure how much of that could be templated/shared will have a look
once I write it the long way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallium: implement ARB_conservative_depth
Marek Olšák [Fri, 18 Nov 2011 14:45:03 +0000 (15:45 +0100)]
gallium: implement ARB_conservative_depth

This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.

12 years agoutil: Add strings.h include on unices
José Fonseca [Fri, 9 Dec 2011 20:05:27 +0000 (20:05 +0000)]
util: Add strings.h include on unices

Fixes -Wimplicit-function-declaration for ffs with GCC.  Spotted/tested
by Kai Wasserbäch.

12 years agomesa/st: Don't modify the context draw/read buffers.
José Fonseca [Thu, 8 Dec 2011 13:25:10 +0000 (13:25 +0000)]
mesa/st: Don't modify the context draw/read buffers.

It sets the wrong values (GL_XXX_LEFT instead of GL_XXX), and no other
Mesa driver does this, given that Mesa sets the right draw/read buffers
provided the Mesa visual has the doublebuffer flag filled correctly
which is the case.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa,intel: use _mesa_image_offset() for PBOs
nobled [Wed, 19 Oct 2011 06:35:53 +0000 (06:35 +0000)]
mesa,intel: use _mesa_image_offset() for PBOs

This avoids forming invalid pointers needlessly, which even if
never dereferenced is undefined behavior. It also makes
_mesa_validate_pbo_access() more comprehensible.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: add _mesa_image_offset()
nobled [Tue, 18 Oct 2011 20:50:16 +0000 (20:50 +0000)]
mesa: add _mesa_image_offset()

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa/image: assert on bad format
nobled [Mon, 17 Oct 2011 21:34:44 +0000 (21:34 +0000)]
mesa/image: assert on bad format

NULL as an error indicator is meaningless, since it will return NULL
on success anyway if the caller passes in zero as the image's address
and asks to calculate the offset of the first pixel. For example,
_mesa_validate_pbo_access() does this.

This also matches the code in the non-GL_BITMAP codepath, which
already has an assert like this.

v2: Per Brian Paul's review, remove the function call entirely
and tighten the assert to only accept the two formats compatible with
GL_BITMAP. They always have one component per pixel.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa/image: delete dead store
nobled [Mon, 17 Oct 2011 21:27:55 +0000 (21:27 +0000)]
mesa/image: delete dead store

The return value here is a) always zero, b) never used.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl_to_tgsi: fix a bug in eliminate_dead_code_advanced()
Bryan Cain [Thu, 8 Dec 2011 19:48:27 +0000 (13:48 -0600)]
glsl_to_tgsi: fix a bug in eliminate_dead_code_advanced()

The bug, reported to me by Vadim Girlin on IRC, was causing overzealous
elimination of code in parallel if statements such as the following:

if (x) {
r = false;
}
if (y) {
r = true;
}

Before this commit, the assignment inside the first if block would be
misdetected as dead code and removed.

12 years agollvmpipe: Trim the fragment shader cached based on LLVM IR instruction count.
José Fonseca [Wed, 30 Nov 2011 17:12:00 +0000 (17:12 +0000)]
llvmpipe: Trim the fragment shader cached based on LLVM IR instruction count.

Number of fragment shader variants is not very representative of the
memory used by LLVM, neither is number of shader instructions, as often
texture sampling constitutes most of the generated code.

This change adds an additional trim criteria: least recently used
fragment shader variants will be freed until the total number of LLVM IR
instruction falls below a specified threshold.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agollvmpipe,draw,gallivm: Ensure we don't walk beyond the end of the shader variant...
José Fonseca [Mon, 28 Nov 2011 16:54:09 +0000 (16:54 +0000)]
llvmpipe,draw,gallivm: Ensure we don't walk beyond the end of the shader variant list.

u_simple_list.h uses a sentinel element, and not a NULL element. So
ensure list is not empty when reducing the list of shader variants.

Something I noticed while trying to free variants more aggressively.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoswrast: use malloc instead of MAX_WIDTH arrays in glCopyPixels, zoom code
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
swrast: use malloc instead of MAX_WIDTH arrays in glCopyPixels, zoom code

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use malloc instead of MAX_WIDTH array in glReadPixels()
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa: use malloc instead of MAX_WIDTH array in glReadPixels()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: add MAX_PIXEL_BYTES define
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa: add MAX_PIXEL_BYTES define

In a few places we need to allocate space for some number of generic
pixels.  Use this new define instead of a magic number like 16 or
4 * sizeof(GLuint).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify _mesa_remove_renderbuffer()
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa: simplify _mesa_remove_renderbuffer()

12 years agomesa: remove software-based renderbuffer code from core Mesa
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa: remove software-based renderbuffer code from core Mesa

We're now using the functions that live in swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa/drivers: use new swrast renderbuffer functions
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa/drivers: use new swrast renderbuffer functions

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: build new s_renderbuffer.c file
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
mesa: build new s_renderbuffer.c file

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: remove core renderbuffer functions from s_renderbuffer.[ch]
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
swrast: remove core renderbuffer functions from s_renderbuffer.[ch]

We'll use the functions that live in main/
Plus, rename the remaining functions with "swrast_" prefix.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: add s_renderbuffer.[ch], copied from main/renderbuffer.[ch]
Brian Paul [Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)]
swrast: add s_renderbuffer.[ch], copied from main/renderbuffer.[ch]

Copying these files is the first step in moving the software buffer
code from main/renderbuffer.c to swrast/s_renderbuffer.c

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: remove unused functions in depthstencil.c
Brian Paul [Sun, 4 Dec 2011 20:39:27 +0000 (13:39 -0700)]
mesa: remove unused functions in depthstencil.c

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: make some renderbuffer functions static
Brian Paul [Sun, 4 Dec 2011 20:34:04 +0000 (13:34 -0700)]
mesa: make some renderbuffer functions static

The functions to allocate software color, depth, accum, etc buffers aren't
called from anywhere else.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoswrast: remove dead accum buffer context fields
Brian Paul [Sat, 3 Dec 2011 17:04:19 +0000 (10:04 -0700)]
swrast: remove dead accum buffer context fields

12 years agomesa: remove dead swrast and state tracker accum buffer code
Brian Paul [Sat, 3 Dec 2011 17:04:19 +0000 (10:04 -0700)]
mesa: remove dead swrast and state tracker accum buffer code

12 years agomesa: rewrite accum buffer support
Brian Paul [Sat, 3 Dec 2011 17:04:18 +0000 (10:04 -0700)]
mesa: rewrite accum buffer support

Implemented in terms of renderbuffer mapping/unmapping and format
packing/unpacking functions.

The swrast and state tracker code for implementing accumulation are
unused and will be removed in the next commit.

v2: don't use memcpy() in _mesa_clear_accum_buffer()
v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: new format_pack.c code
Brian Paul [Sat, 3 Dec 2011 17:04:18 +0000 (10:04 -0700)]
mesa: new format_pack.c code

This code packs colors, Z, stencil, etc. in the various mesa pixel
formats.  Will be used for things like glDrawPixels, glTexImage,
glAccum, etc.

12 years agomesa: remove the ctx->Driver.IsTextureResident() hook
Brian Paul [Sat, 3 Dec 2011 17:04:18 +0000 (10:04 -0700)]
mesa: remove the ctx->Driver.IsTextureResident() hook

No driver implemented this and we always returned "True" for residence
queries.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: remove TextureMemCpy driver hook
Brian Paul [Sat, 3 Dec 2011 17:04:18 +0000 (10:04 -0700)]
mesa: remove TextureMemCpy driver hook

There's probably no reason to use a special version of memcpy() anymore.

12 years agost/mesa: Use util_blit_pixels_writemask() for depth blits as well in st_copy_texsubim...
Henri Verbeet [Sat, 3 Dec 2011 12:10:57 +0000 (13:10 +0100)]
st/mesa: Use util_blit_pixels_writemask() for depth blits as well in st_copy_texsubimage().

This has no piglit regressions on r600g and softpipe.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/xa: Update xa_yuv_planar_blit semantics
Thomas Hellstrom [Wed, 7 Dec 2011 19:11:23 +0000 (20:11 +0100)]
st/xa: Update xa_yuv_planar_blit semantics

Change and document the interpretation of the color conversion matrix
in order to make the function more versatile and to simplify the
generated shader.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agoi965 gen6: Implement pass-through GS for transform feedback.
Paul Berry [Tue, 29 Nov 2011 22:51:03 +0000 (14:51 -0800)]
i965 gen6: Implement pass-through GS for transform feedback.

In Gen6, transform feedback is accomplished by having the geometry
shader send vertex data to the data port using "Streamed Vertex Buffer
Write" messages, while simultaneously passing vertices through to the
rest of the graphics pipeline (if rendering is enabled).

This patch adds a geometry shader program that simply passes vertices
through to the rest of the graphics pipeline.  The rest of transform
feedback functionality will be added in future patches.

To make the new geometry shader easier to test, I've added an
environment variable "INTEL_FORCE_GS".  If this environment variable
is enabled, then the pass-through geometry shader will always be used,
regardless of whether transform feedback is in effect.

On my Sandy Bridge laptop, I'm able to enable INTEL_FORCE_GS with no
Piglit regressions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Clean up misleading defines for DWORD 2 of URB_WRITE header.
Paul Berry [Fri, 2 Dec 2011 22:38:52 +0000 (14:38 -0800)]
i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.

R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD
2 of R0 (as the name, and comments in the code, would seem to
indicate).  Actually they refer to bits in DWORD 2 of the header for
URB_WRITE messages.

This patch renames the defines to reflect what they actually mean.  It
also addes a define URB_WRITE_PRIM_TYPE_SHIFT, which previously was
just hardcoded in .c files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>