Commit Graph

47539 Commits

Author SHA1 Message Date
Eric Anholt e452fbe871 swrast: Calculate image address/stride once for depth/stencil readpixels.
The fast and slow paths were doing these separately before.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt b832ac974f swrast: Make the packed depth/stencil read fastpath use MapRenderbuffer.
This also makes it handle 24/8 vs 8/24, fixing piglit
depthstencil-default_fb-readpixels-24_8 on i965.  While here, avoid
incorrectly fast-pathing if packing->SwapBytes is set.

v2: Move the unpack code to format_unpack.c, fix BUFFER_DEPTH typo
v3: Fix signed/unsigned comparison.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt ff27e058bc swrast: Directly map the stencil buffer in read_stencil_pixels.
This avoids going through the wrapper that has to rewrite the data for
packed depth/stencil.  This isn't done in _swrast_read_stencil_span
because we don't want to map/unmap for each span.

v2: Move the unpack code to format_unpack.c.
v3: Fix signed/unsigned comparison.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Vinson Lee 492d223590 radeon: Fix variable initialization typo.
Fixes Coverity uninitialized scalar variable defect.
2011-11-03 20:34:02 -07:00
Paul Berry 8fad0f9998 i965: Fix constant propagation into 32-bit integer MUL.
i965's MUL instruction can't take an immediate value as its first
argument.  So normally, if constant propagation wants to propagate a
constant into the first argument of a MUL instruction, it swaps the
order of the two arguments.

This doesn't work for 32-bit integer (and unsigned integer)
multiplies, because the MUL operation is asymmetric in that case (it
multiplies 16 bits of one operand by 32 bits of the other).

Fixes piglit tests {vs,fs}-multiply-const-{ivec4,uvec4}.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-03 18:18:34 -07:00
Brian Paul df73a70fba svga: use the draw-module's sprite stage depending on FS inputs
If we're drawing sprites and the fragment shader needs both auto-
generated texcoords and user-defined varying vars we need to use
this fallback path.
The reason is when we enable auto texcoord generation, it gets
enabled for all texcoord sets.  And that clobbers the user-defined
varying vars.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-03 17:41:08 -06:00
Brian Paul 022e270b1b svga: pass fragment shader to draw module
If we use the draw-module for wide point/line/etc drawing we'll need
a fragment shader too (like we pass in the vertex shader).

This fixes sprite point rendering when forcing the swtnl path.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-03 17:41:08 -06:00
Brian Paul 58ea42b7db svga: implement generic variable index remapping
The state tracker may generate shaders that use generic vs outputs /
fs inputs like:

DCL IN[0], GENERIC[0]
DCL IN[1], GENERIC[10]
DCL IN[2], GENERIC[11]

This patch remaps 0, 10, 11 to small integers like 1, 2, 3 so that we
stay inside the SVGA3D limit (8).

The remapping is done to both the vertex shader outputs and the
fragment shader inputs.  The same mapping must be used for a vs/fs
pair.

Note that 'union svga_compile_key' is now 'struct svga_compile_key'
because we needed to add the register remapping table.  The change in
size isn't really significant though (it's not a search key).

Also, add assertions when building up SVGA3D src/dst registers to we
don't try to store too large of value for the bitfield size.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-03 17:41:08 -06:00
Brian Paul e814d57725 draw: assert that we have non-null fragment shader
Instead of just segfaulting.  Recently ran into this.
2011-11-03 16:56:11 -06:00
nobled ac0ec07e6c texgetimage: add missing return on error
Missed this back in the arb_robustness branch
<6b329b9274b18c50f4177eef7ee087d50ebc1525>.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-03 15:27:08 -07:00
Brian Paul bf5255fb30 mesa: fix texture target mix-up in NV_fragment_program parser
The returned value should be a texture target index, not a bit.
I spotted this from seeing a new compiler warning caused by the increase
in the number of texture targets.  This has been broken for a long time.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-03 15:32:19 -06:00
Ian Romanick f37b1ad937 linker: Check that initializers for global variables match
This requires tracking a couple extra fields in ir_variable:

 * A flag to indicate that a variable had an initializer.

 * For non-const variables, a field to track the constant value of the
   variable's initializer.

For variables non-constant initalizers, ir_variable::has_initializer
will be true, but ir_variable::constant_initializer will be NULL.  The
linker can use the values of these fields to check adherence to the
GLSL 4.20 rules for shared global variables:

    "If a shared global has multiple initializers, the initializers
    must all be constant expressions, and they must all have the same
    value. Otherwise, a link error will result. (A shared global
    having only one initializer does not require that initializer to
    be a constant expression.)"

Previous to 4.20 the GLSL spec simply said that initializers must have
the same value.  In this case of non-constant initializers, this was
impossible to determine.  As a result, no vendor actually implemented
that behavior.  The 4.20 behavior matches the behavior of NVIDIA's
shipping implementations.

NOTE: This is candidate for the 7.11 branch.  This patch also needs
the preceding patch "glsl: Refactor generate_ARB_draw_buffers_variables
to use add_builtin_constant"

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Ian Romanick d3b39194dc glsl: Refactor generate_ARB_draw_buffers_variables to use add_builtin_constant
v2: Remove int cast based on feedback from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Ian Romanick 22af08b410 glsl: Put all bitfields in ir_variable together for better packing
The diff looks weird because ir_variable::depth_layout was between the
last two bitfields in the structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Ian Romanick 46173f9079 linker: Fix the indentation of a block in cross_validate_globals
I suspect the indentation got messed up during a code merge.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Eric Anholt 9954a93ab7 radeon: Check an error return instead of assigning it to a dead variable.
Fixes gcc set-but-unused-variable warning.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-11-03 09:13:46 -07:00
Marek Olšák ca0f515f85 r300g: force buffer placements to GTT on big endian machines 2011-11-03 16:39:40 +01:00
Maarten Lankhorst eadbcb221d state_trackers/vdpau: Add support for VC-1 decoding
Add a struct with all the fields.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst 91d33b5c58 state_trackers/vdpau: Add mpeg4 part2 to PipeToProfile and ProfileToPipe
So it can actually be used when someone implements it. :)

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst 12bf452945 state_trackers/vdpau: Add support for MPEG4 Part 2
Just the support patch, no decoder implements it currently.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst 1eb48c5500 state_trackers/vdpau: Test if profile is supported first before trying to create decoder
So a nicer error message is returned.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst c4d47f065a state_trackers/vdpau: Add num_slices to mpeg12 picture structure
Bitstream parsers might need that field.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst c9c6eec1c6 state_trackers/vdpau: Implement VdpGenerateCSCMatrix
With the smpte240 profile, which was missing.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:00 +01:00
Christian König 8a7e645c9b g3dvl: remove some stale variable increment
Incrementing "td" before initializing it is
pointless and just leads to an uninitialized
variable warning with MSVC.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-11-03 13:52:00 +01:00
Dave Airlie c6a3026472 r600g: more integer support
just some more trivial integer changes for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-03 10:11:32 +00:00
Dave Airlie d546dcbb1b radeon: fix some regressions in texturing code.
On a piglit run vs 7.11 this fixes 23 tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-03 10:10:07 +00:00
José Fonseca 97213fd741 scons: Use -static-libstdc++ on 32bits builds w/ Mingw-w64 too. 2011-11-03 09:59:34 +00:00
José Fonseca 3276c3d42b libgl-gdi: Mingw-w64 in 32bit mode matches the Mingw32's .DEF semantics. 2011-11-03 09:59:34 +00:00
Chia-I Wu a56951139a docs: list GL_OES_EGL_image_external in 7.12 release notes 2011-11-03 15:09:45 +08:00
Chia-I Wu 8cd0873d31 st/mesa: add support for GL_OES_EGL_image_external
To pipe drivers, external textures are just 2D textures.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Chia-I Wu 0c87f16817 mesa: add support for GL_OES_EGL_image_external
This is an OpenGL ES specific extension.  External textures are textures that
may be sampled from, but not be updated (no glTexSubImage* and etc.).  The
image data are taken from an EGLImage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Chia-I Wu 79463f18ac mesa: clean up validate_texture_wrap_mode
GL_TEXTURE_RECTANGLE_NV (and soon GL_TEXTURE_EXTERNAL_OES) is special.  Handle
it in its own if-block.  There should be no functional change.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Chia-I Wu d8ba30af11 mesa: fix a logic error in glFramebufferTexture2D
Unrecognized texture target should give an error.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu 2903816aad glsl: add support for GL_OES_EGL_image_external
This extension introduces a new sampler type: samplerExternalOES.
texture2D (and texture2DProj) can be used to do a texture look up in an
external texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu db73264e14 mesa: add GL_OES_EGL_image_external to the extension list
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu 1b1af84149 mesa: add missing defines for GL_OES_EGL_image_external
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu 1ab1b15e9d mesa, i965: prepare for more than 8 texture targets
3-bit fields are used store texture target in several places.  That will fail
when TEXTURE_EXTERNAL_INDEX, which happends to be the 9th texture target, is
added.  Make them 4-bit fields.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu 833d707db1 glapi: regenerate files 2011-11-03 15:09:43 +08:00
Chia-I Wu 6e093935bb glapi: add entry points for OES_EGL_image_external
Only enums actually.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:43 +08:00
Chia-I Wu 61e81851be GLES: upgrade glext.h to revision 13240
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:43 +08:00
Yuanhan Liu 9f7b6a39f6 swrast: simplify the condition test for _swrast_choose_texture_sample_func
remove another long if condition test. I don't feel a strong need of
this patch. But for it make the code a little simpler(I do think so),
I send it out.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:24:28 +08:00
Yuanhan Liu 49f8447acc mesa: fix the low limit of width and height for glRenderbufferStorage
glRenderbufferStorage man page says:

  GL_INVALID_VALUE is generated if either of width or height is negative,
  or greater than the value of GL_MAX_RENDERBUFFER_SIZE.

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:22:56 +08:00
Yuanhan Liu 1f5bd65efa mesa: fix inital value for new renderbuffer
EXT_framebuffer_object bspec says:

    Get Value                          Type    Get Command 		Initial Value
    -------------------------------    ------  -----------      	-----------
    RENDERBUFFER_INTERNAL_FORMAT_EXT   Z+     GetRenderbufferParameterivEXT  RGBA

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:22:15 +08:00
Yuanhan Liu 77cd3bf18d mesa: complete the GL_TEXTURE_SWIZZLE* setup
The ARB_texture_swizzle spec says:
    The error INVALID_OPERATION is generated if TexParameteri,
    TexParameterf, TexParameteriv, or TexParameterfv, parameter <pname>
    is TEXTURE_SWIZZLE_R, TEXTURE_SWIZZLE_G,  TEXTURE_SWIZZLE_B,
    or TEXTURE_SWIZZLE_A, and <param> is not RED, GREEN, BLUE, ALPHA,
    ZERO, or ONE.

    The error INVALID_OPERATION is generated if TexParameteriv, or
    TexParameterfv, parameter <pname> TEXTURE_SWIZZLE_RGBA, and the four
    consecutive values pointed to by <param> are not all RED, GREEN, BLUE,
    ALPHA, ZERO, or ONE.

So, the GL_TEXTURE_SWIZZLE* pname is legal for glTexParameterf(v)

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:19:49 +08:00
Yuanhan Liu d9f05ac828 mesa: remove the redundant check
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:18:58 +08:00
Carl-Philip Haensch 34a5598d86 driconf: updated german translation 2011-11-02 14:28:19 -07:00
Carl-Philip Haensch 997a477d0c driconf: updated de.po 2011-11-02 14:28:19 -07:00
Morgan Armand c7fc4067eb wglSetPixelFormat should ignore the ppfd parameter.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-02 19:51:09 +00:00
Michel Dänzer 0be1f79770 r300g: Fix queries on big endian hosts.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-11-02 18:59:30 +01:00
Michel Dänzer 4a3be16fd2 gallium/util: Add macros for converting from little endian to CPU byte order.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-11-02 18:24:09 +01:00