mesa.git
12 years agoglx: Don't create a shared context if the other context isn't the same kind
Ian Romanick [Tue, 6 Dec 2011 20:19:39 +0000 (12:19 -0800)]
glx: Don't create a shared context if the other context isn't the same kind

Each of the DRI, DRI2, and DRISW backends contain code like the
following in their create-context routine:

   if (shareList) {
      pcp_shared = (struct dri2_context *) shareList;
      shared = pcp_shared->driContext;
   }

This assumes that the glx_context *shareList is actually the correct
derived type.  However, if shareList was created as an
indirect-rendering context, it will not be the expected type.  As a
result, shared will contain garbage.  This garbage will be passed to
the driver, and the driver will probably segfault.  This can be
observed with the following GLX code:

    ctx0 = glXCreateContext(dpy, visinfo, NULL, False);
    ctx1 = glXCreateContext(dpy, visinfo, ctx0, True);

Create-context is the only case where this occurs.  All other cases
where a context is passed to the backend, it is the 'this' pointer
(i.e., we got to the backend by call something from ctx->vtable).

To work around this, check that the shareList->vtable->destroy method
is the same as the destroy method of the expected type.  We could also
check that shareList->vtable matches the vtable or by adding a "tag"
to glx_context to identify the derived type.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Add support for GL_ARB_depth_buffer_float under 3.0 override.
Eric Anholt [Fri, 18 Nov 2011 01:19:12 +0000 (17:19 -0800)]
i965: Add support for GL_ARB_depth_buffer_float under 3.0 override.

This is not exposed generally yet because some of the swrast paths hit
in piglit (drawpixels, copypixels, blit) aren't yet converted to
MapRenderbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Add separate stencil/HiZ setup for MESA_FORMAT_Z32_FLOAT_X24S8.
Eric Anholt [Wed, 7 Dec 2011 22:49:45 +0000 (14:49 -0800)]
i965: Add separate stencil/HiZ setup for MESA_FORMAT_Z32_FLOAT_X24S8.

This is a little more unusual than the separate MESA_FORMAT_S8_Z24
support, because in addition to storing the real stencil data in a
MESA_FORMAT_S8 miptree, we also make the Z miptree be
MESA_FORMAT_Z32_FLOAT instead of the requested format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Use the miptree format for texture surface format choice.
Eric Anholt [Tue, 13 Dec 2011 20:40:09 +0000 (12:40 -0800)]
i965: Use the miptree format for texture surface format choice.

With separate stencil GL_DEPTH32F_STENCIL8, the miptree will have a
really different format (MESA_FORMAT_Z32_FLOAT) from the teximage
(MESA_FORMAT_Z32_FLOAT_X24S8).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Add support for mapping Z32_FLOAT_X24S8 fake packed depth/stencil.
Eric Anholt [Sat, 3 Dec 2011 00:00:10 +0000 (16:00 -0800)]
i965: Add support for mapping Z32_FLOAT_X24S8 fake packed depth/stencil.

The format handling here is tricky, because we're not actually
generating a Z32_FLOAT_X24S8 miptree, so we're guessing the format
that GL wants based on seeing Z32_FLOAT with a separate stencil.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Stop creating the wrapped depth irb.
Eric Anholt [Thu, 8 Dec 2011 16:33:28 +0000 (08:33 -0800)]
intel: Stop creating the wrapped depth irb.

All the operations were just trying to get at irb->wrapped_depth->mt,
which is the same as irb->mt now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Properly demote the depth mt format for fake packed depth/stencil.
Eric Anholt [Thu, 15 Dec 2011 01:16:07 +0000 (17:16 -0800)]
i965: Properly demote the depth mt format for fake packed depth/stencil.

gen7 only supports the non-packed formats, even if you associate a
real separate stencil buffer -- otherwise it's as if the depth test
always fails.

This requires a little bit of care in the match_texture_image case,
since the miptree format no longer matches the texture image format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Reuse intel_miptree_match_image().
Eric Anholt [Thu, 15 Dec 2011 04:43:06 +0000 (20:43 -0800)]
intel: Reuse intel_miptree_match_image().

This little bit of logic was duplicated, which isn't much, but I was
going to need to duplicate a bit of additional logic in the next
commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Stop creating the wrapped stencil irb.
Eric Anholt [Wed, 7 Dec 2011 23:02:02 +0000 (15:02 -0800)]
intel: Stop creating the wrapped stencil irb.

There were only two places it was really used at this point, which was
in the batchbuffer emit of the separate stencil packets for gen6/7.
Just write in the ->stencil_mt reference in those two places and ditch
all this flailing around with allocation and refcounts.

v2: Fix separate stencil on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agotgsi: update documents with some info on texture lookup
Dave Airlie [Mon, 19 Dec 2011 16:40:05 +0000 (16:40 +0000)]
tgsi: update documents with some info on texture lookup

this mentions which channels are used for slice and depth comparison values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agosoftpipe: fix shadow1d tests.
Dave Airlie [Mon, 19 Dec 2011 11:51:39 +0000 (11:51 +0000)]
softpipe: fix shadow1d tests.

This fixes the piglit glsl-1.10 shadow1D related tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agosoftpipe: fix shadow 2d texture array sampling
Dave Airlie [Mon, 19 Dec 2011 10:34:20 +0000 (10:34 +0000)]
softpipe: fix shadow 2d texture array sampling

The 4th texcoord is used in this case for the comparison.

This fixes piglit glsl-fs-shadow2DArray* on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium/draw: fix two side handling
Dave Airlie [Mon, 19 Dec 2011 15:57:50 +0000 (15:57 +0000)]
gallium/draw: fix two side handling

The code didn't handle the case where front wasn't specified in the vertex
shader outputs, but back was.

In that case we were doing a copy from back to non-existant front,
this code checks we have existant front/backs and only does the copy when
they both exist.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoosmesa: fix RGB565 rendering
Alex Galakhov [Mon, 19 Dec 2011 14:40:07 +0000 (07:40 -0700)]
osmesa: fix RGB565 rendering

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agovdpau: Add background surface support
Maarten Lankhorst [Mon, 19 Dec 2011 09:16:06 +0000 (10:16 +0100)]
vdpau: Add background surface support

Sets rgba layer as zeroth layer if a custom background_surface is specified.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovdpau: Add support for mixer attributes
Maarten Lankhorst [Mon, 19 Dec 2011 09:14:16 +0000 (10:14 +0100)]
vdpau: Add support for mixer attributes

It's harmless to add support for attributes we don't support,
since they require a feature enabled for them to affect
something. As long as they aren't enabled, nothing happens.

This enables support for custom colorspaces and background colors.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovdpau: Add support for parameters
Maarten Lankhorst [Mon, 19 Dec 2011 09:10:06 +0000 (10:10 +0100)]
vdpau: Add support for parameters

Currently only validating, since nothing else can be done with it yet

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
v2: removed check_video_surface

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agosoftpipe: fix depth sampling for linear vs nearest.
Dave Airlie [Sun, 18 Dec 2011 21:25:15 +0000 (21:25 +0000)]
softpipe: fix depth sampling for linear vs nearest.

This sample compare was always doing linear, and this makes the
glsl-fs-shadow1DArray test render like the Intel driver.

fix wrong 0->j from initial patch

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agosoftpipe: fix texture sampling from 1D texture array
Dave Airlie [Sun, 18 Dec 2011 21:18:19 +0000 (21:18 +0000)]
softpipe: fix texture sampling from 1D texture array

This is the first part of a fix to piglit glsl-fs-shadow1DArray

also fix the passing of unused r[2] in the normal 1D case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: make _mesa_set_tex_image() static since it's not called anywhere else
Brian Paul [Sun, 18 Dec 2011 17:02:42 +0000 (10:02 -0700)]
mesa: make _mesa_set_tex_image() static since it's not called anywhere else

12 years agonvc0: add NVC0_RESOURCE_FLAG_VIDEO
Christoph Bumiller [Sun, 18 Dec 2011 21:34:50 +0000 (22:34 +0100)]
nvc0: add NVC0_RESOURCE_FLAG_VIDEO

12 years agoglsl_to_tgsi: make sure copied instructions don't lose texture target. (v2)
Dave Airlie [Sat, 10 Dec 2011 18:33:49 +0000 (18:33 +0000)]
glsl_to_tgsi: make sure copied instructions don't lose texture target. (v2)

The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
due to 0 texture target, this makes sure the texture target is copied over
correctly when we copy instructions around.

v2: drive-by fix bitmap on the way past.

This avoids the assertion, have to contemplate fixing things as per the spec
later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoi965/vs: Add a new dst_reg constructor for file, number, type, and mask.
Kenneth Graunke [Fri, 28 Oct 2011 04:45:12 +0000 (21:45 -0700)]
i965/vs: Add a new dst_reg constructor for file, number, type, and mask.

This will be especially useful for loading texturing parameters, where I
need to (for example) reference m3.xz<D>.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965/vs: Add vec4_instruction::is_tex() query.
Kenneth Graunke [Wed, 26 Oct 2011 19:59:33 +0000 (12:59 -0700)]
i965/vs: Add vec4_instruction::is_tex() query.

Copy and pasted from fs_inst::is_tex(), but without TXB.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Rename texturing ops from FS_OPCODE to SHADER_OPCODE, except TXB.
Kenneth Graunke [Wed, 26 Oct 2011 19:58:37 +0000 (12:58 -0700)]
i965: Rename texturing ops from FS_OPCODE to SHADER_OPCODE, except TXB.

We'll be reusing most of these for the VS shortly.  The one exception is
TXB (texturing with LOD bias), which is explicitly forbidden in the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965/fs: Don't swizzle the results of textureSize().
Kenneth Graunke [Tue, 6 Dec 2011 20:39:54 +0000 (12:39 -0800)]
i965/fs: Don't swizzle the results of textureSize().

Fixes a regression since d2235b0f4681f75d562131d655a6d7b7033d2d8b,
in my new textureSize sampler(1DArrayShadow|2DShadow|2DArrayShadow)
piglit tests, though I'm not honestly sure how this ever worked.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoprogram: fix previous commit
nobled [Sun, 18 Dec 2011 17:17:10 +0000 (17:17 +0000)]
program: fix previous commit

Accidentally an old patch.

12 years agoprogram: fix out of bounds array accesses and other bad things
nobled [Thu, 8 Dec 2011 21:07:18 +0000 (21:07 +0000)]
program: fix out of bounds array accesses and other bad things

Noticed a "warning: array subscript is above array bounds" given at one of
the existing sanity-check asserts. Turns out all the arrays of strings
haven't matched the corresponding enum values in a while, if ever.

I didn't know the proper names for any of these and couldn't find
them in the base specs aside from "result.pointsize" in
ARB_vertex_program, so I just filled in the enum's value
as was done with other slots.

Also add four STATIC_ASSERT()s to be sure and catch future additions
or bumps to MAX_VARYING/etc again, and some more non-static asserts
where there weren't any before.

(Note, the fragment enum that corresponded to result.color(half) was removed in
8d475822e6e19fa79719c856a2db5b6a205db1b9.)

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogen_matypes: eliminate printf warnings
nobled [Thu, 8 Dec 2011 20:53:25 +0000 (20:53 +0000)]
gen_matypes: eliminate printf warnings

The VERT_BIT_* defines are 64-bit values now, but the printf
was still expecting a simple int.

12 years agor600g: fix MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS limit
Marek Olšák [Sat, 17 Dec 2011 18:42:13 +0000 (19:42 +0100)]
r600g: fix MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS limit

12 years agomesa/x86: fix printf warning
Marek Olšák [Sat, 17 Dec 2011 14:14:03 +0000 (15:14 +0100)]
mesa/x86: fix printf warning

12 years agodrisw: remove unused variable
Marek Olšák [Sat, 17 Dec 2011 14:13:37 +0000 (15:13 +0100)]
drisw: remove unused variable

12 years agor600g: handle new caps
Marek Olšák [Sat, 17 Dec 2011 14:13:23 +0000 (15:13 +0100)]
r600g: handle new caps

12 years agor300g: handle new caps
Marek Olšák [Sat, 17 Dec 2011 14:12:59 +0000 (15:12 +0100)]
r300g: handle new caps

12 years agodocs: update GL3 status
Marek Olšák [Sat, 17 Dec 2011 13:47:15 +0000 (14:47 +0100)]
docs: update GL3 status

12 years agor600g: implement transform feedback
Marek Olšák [Tue, 8 Nov 2011 20:58:27 +0000 (21:58 +0100)]
r600g: implement transform feedback

r600: DONE.
r700: MOSTLY (done but locks up).
Evergreen: MOSTLY (done but doesn't work for an unknown reason).

The kernel support will come soon.

12 years agost/mesa: expose conservative_depth if GLSL 1.3 is supported
Marek Olšák [Tue, 13 Dec 2011 17:11:00 +0000 (18:11 +0100)]
st/mesa: expose conservative_depth if GLSL 1.3 is supported

It's not yet, but it can be enabled by the override environment variable.

12 years agogallivm: Fix build with llvm-3.1svn.
Vinson Lee [Tue, 13 Dec 2011 01:54:54 +0000 (17:54 -0800)]
gallivm: Fix build with llvm-3.1svn.

llvm-3.1svn r145714 moved global variables into a new TargetOptions
class. TargetMachine constructor now needs a TargetOptions object as
well.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Fix memory leak on error path.
Vinson Lee [Sat, 10 Dec 2011 22:46:13 +0000 (14:46 -0800)]
mesa: Fix memory leak on error path.

Fixes Coverity resource leak defect.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: Fix memory leak in out-of-memory path.
Vinson Lee [Tue, 6 Dec 2011 08:15:28 +0000 (00:15 -0800)]
st/mesa: Fix memory leak in out-of-memory path.

Fixes Coverity resource leak defect.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agometa: use _mesa_prepare_mipmap_level() in the mipmap generation code
Brian Paul [Thu, 15 Dec 2011 14:36:49 +0000 (07:36 -0700)]
meta: use _mesa_prepare_mipmap_level() in the mipmap generation code

See previous commit for more information.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: new _mesa_prepare_mipmap_level() function for mipmap generation
Brian Paul [Thu, 15 Dec 2011 23:30:33 +0000 (16:30 -0700)]
mesa: new _mesa_prepare_mipmap_level() function for mipmap generation

This helper function is used during mipmap generation to prepare space
for the destination mipmap levels.

This improves/fixes two things:
1. If the texture object was created with glTexStorage2D, calling
   _mesa_TexImage2D() to allocate the new image would generate
   INVALID_OPERATION since the texture is marked as immutable.
2. _mesa_TexImage2D() always frees any existing texture image memory
   before allocating new memory.  That's inefficient if the existing
   image is the right size already.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: make update_fbo_texture() non-static
Brian Paul [Fri, 16 Dec 2011 00:33:33 +0000 (17:33 -0700)]
mesa: make update_fbo_texture() non-static

We'll call this from the mipmap generation code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: whitespace and comment fixes in fbobject.c
Brian Paul [Fri, 16 Dec 2011 15:44:43 +0000 (08:44 -0700)]
mesa: whitespace and comment fixes in fbobject.c

12 years agomesa: add MESA_FORMAT_RGB565[_REV] as candidates for GL_R3_G3_B2
Brian Paul [Fri, 16 Dec 2011 15:44:43 +0000 (08:44 -0700)]
mesa: add MESA_FORMAT_RGB565[_REV] as candidates for GL_R3_G3_B2

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agovbo: add comment for map_vp_non[] array
Brian Paul [Fri, 16 Dec 2011 15:44:43 +0000 (08:44 -0700)]
vbo: add comment for map_vp_non[] array

12 years agomesa: add a few comments for the z unpacking functions
Brian Paul [Fri, 16 Dec 2011 15:44:42 +0000 (08:44 -0700)]
mesa: add a few comments for the z unpacking functions

12 years agoEnabling display list support for glClearBuffer functions with minor fixes
Anuj Phogat [Tue, 13 Dec 2011 19:52:59 +0000 (11:52 -0800)]
Enabling display list support for glClearBuffer functions with minor fixes

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
12 years agogallium: fix a crash in drivers that don't support stream output
Fredrik Höglund [Thu, 15 Dec 2011 19:41:42 +0000 (20:41 +0100)]
gallium: fix a crash in drivers that don't support stream output

12 years agollvmpipe: adapt to struct stream_output_info modifications
Christoph Bumiller [Thu, 15 Dec 2011 19:10:16 +0000 (20:10 +0100)]
llvmpipe: adapt to struct stream_output_info modifications

My fault, I broke it with v5 of 861a029ddb31e91bb4d8e18ab708d0d172f63aad.

12 years agonvc0: implement new stream output interface
Christoph Bumiller [Fri, 9 Dec 2011 17:46:09 +0000 (18:46 +0100)]
nvc0: implement new stream output interface

12 years agod3d1x: implement new stream output interface
Christoph Bumiller [Thu, 15 Dec 2011 17:46:10 +0000 (18:46 +0100)]
d3d1x: implement new stream output interface

12 years agost/mesa: implement EXT_transform_feedback and ARB_transform_feedback2
Marek Olšák [Fri, 9 Dec 2011 17:33:58 +0000 (18:33 +0100)]
st/mesa: implement EXT_transform_feedback and ARB_transform_feedback2

12 years agou_blitter: implement copy_buffer using stream output
Marek Olšák [Fri, 9 Dec 2011 17:32:41 +0000 (18:32 +0100)]
u_blitter: implement copy_buffer using stream output

12 years agou_blitter: restore stream output targets
Marek Olšák [Sat, 19 Nov 2011 20:44:28 +0000 (21:44 +0100)]
u_blitter: restore stream output targets

12 years agotrace: implement stream output interface
Christoph Bumiller [Fri, 9 Dec 2011 18:12:38 +0000 (19:12 +0100)]
trace: implement stream output interface

12 years agonoop: implement stream output
Marek Olšák [Sat, 19 Nov 2011 20:44:27 +0000 (21:44 +0100)]
noop: implement stream output

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>