Commit graph

48720 commits

Author SHA1 Message Date
Eric Anholt
e71fc6a820 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>
2011-12-19 13:20:11 -08:00
Eric Anholt
353f7ba4ab 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>
2011-12-19 13:20:11 -08:00
Eric Anholt
0c49846710 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>
2011-12-19 13:20:11 -08:00
Eric Anholt
fdf18b3231 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>
2011-12-19 13:20:11 -08:00
Eric Anholt
7978fb4d9f 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>
2011-12-19 13:20:11 -08:00
Eric Anholt
0b8b6c7e97 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>
2011-12-19 13:20:11 -08:00
Dave Airlie
35db326de5 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>
2011-12-19 20:45:13 +00:00
Dave Airlie
42696ba16f 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>
2011-12-19 20:45:08 +00:00
Dave Airlie
97b778efe7 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>
2011-12-19 20:44:47 +00:00
Dave Airlie
f4ab1783b3 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>
2011-12-19 19:07:35 +00:00
Alex Galakhov
d334a0fb8c osmesa: fix RGB565 rendering
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-19 07:41:06 -07:00
Maarten Lankhorst
d6942f781f 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>
2011-12-19 13:46:51 +01:00
Maarten Lankhorst
e8e0756bd3 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>
2011-12-19 13:36:17 +01:00
Maarten Lankhorst
89b9863252 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>
2011-12-19 13:33:47 +01:00
Dave Airlie
417aad5a99 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>
2011-12-19 11:53:07 +00:00
Dave Airlie
07eeb92abc 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>
2011-12-19 11:52:47 +00:00
Brian Paul
009ac0618c mesa: make _mesa_set_tex_image() static since it's not called anywhere else 2011-12-18 17:56:08 -07:00
Christoph Bumiller
f202610288 nvc0: add NVC0_RESOURCE_FLAG_VIDEO 2011-12-18 22:37:45 +01:00
Dave Airlie
3788b4b5c9 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>
2011-12-18 20:54:50 +00:00
Kenneth Graunke
bdd76ebef1 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>
2011-12-18 12:39:00 -08:00
Kenneth Graunke
7e7c40ff98 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>
2011-12-18 12:38:56 -08:00
Kenneth Graunke
febad1779a 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>
2011-12-18 12:38:42 -08:00
Kenneth Graunke
c592ebc581 i965/fs: Don't swizzle the results of textureSize().
Fixes a regression since d2235b0f46,
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>
2011-12-18 11:59:52 -08:00
nobled
bb6fb7afd3 program: fix previous commit
Accidentally an old patch.
2011-12-18 17:17:10 +00:00
nobled
f71984ee5b 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>
2011-12-18 17:12:25 +00:00
nobled
03bfdb2bad gen_matypes: eliminate printf warnings
The VERT_BIT_* defines are 64-bit values now, but the printf
was still expecting a simple int.
2011-12-18 17:08:31 +00:00
Marek Olšák
745d990b8d r600g: fix MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS limit 2011-12-17 19:42:13 +01:00
Marek Olšák
211520450b mesa/x86: fix printf warning 2011-12-17 15:14:03 +01:00
Marek Olšák
5016b09f89 drisw: remove unused variable 2011-12-17 15:13:37 +01:00
Marek Olšák
a3bfbccd0a r600g: handle new caps 2011-12-17 15:13:23 +01:00
Marek Olšák
f47da7f580 r300g: handle new caps 2011-12-17 15:12:59 +01:00
Marek Olšák
06dcb17725 docs: update GL3 status 2011-12-17 14:56:21 +01:00
Marek Olšák
543b2331d7 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.
2011-12-17 14:56:21 +01:00
Marek Olšák
047363a07b 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.
2011-12-17 14:56:21 +01:00
Vinson Lee
95aa0e5d84 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>
2011-12-16 21:22:39 -08:00
Vinson Lee
5d32b00db9 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>
2011-12-16 21:21:01 -08:00
Vinson Lee
7b6b5f5102 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>
2011-12-16 17:51:41 -08:00
Brian Paul
cf79e22509 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>
2011-12-16 12:14:32 -07:00
Brian Paul
d77b963245 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>
2011-12-16 12:14:27 -07:00
Brian Paul
d842a118b2 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>
2011-12-16 12:13:35 -07:00
Brian Paul
45bd5c43ca mesa: whitespace and comment fixes in fbobject.c 2011-12-16 08:44:43 -07:00
Brian Paul
2b3fdb1fae mesa: add MESA_FORMAT_RGB565[_REV] as candidates for GL_R3_G3_B2
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-16 08:44:43 -07:00
Brian Paul
3d3a21c5fa vbo: add comment for map_vp_non[] array 2011-12-16 08:44:43 -07:00
Brian Paul
89da5a1415 mesa: add a few comments for the z unpacking functions 2011-12-16 08:44:42 -07:00
Anuj Phogat
36a484bc98 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>
2011-12-15 15:28:38 -08:00
Fredrik Höglund
cf59483808 gallium: fix a crash in drivers that don't support stream output 2011-12-15 20:50:29 +01:00
Christoph Bumiller
97144eef03 llvmpipe: adapt to struct stream_output_info modifications
My fault, I broke it with v5 of 861a029ddb.
2011-12-15 20:10:16 +01:00
Christoph Bumiller
14bd9d7648 nvc0: implement new stream output interface 2011-12-15 18:51:48 +01:00
Christoph Bumiller
14193da589 d3d1x: implement new stream output interface 2011-12-15 18:51:48 +01:00
Marek Olšák
c05fafa4a0 st/mesa: implement EXT_transform_feedback and ARB_transform_feedback2 2011-12-15 18:51:48 +01:00