Commit graph

48156 commits

Author SHA1 Message Date
George Sapountzis
0c425ac18c st/dri/sw: add get_image inline helper similar to put_image
TODO: check if GetImage works with passing the pitch as width, similar to PutImage,
which avoids the extra copy, ala dri_sw_displaytarget_display() in src/gallium/winsys/sw/dri/dri_sw_winsys.c
2011-11-02 17:07:59 +02:00
Benjamin Franzke
31156c07b0 st/dri/sw: Fix incorrect cast
Missed one casting error due to rebase for commit
98aa2a8f72.
2011-11-02 15:56:23 +01:00
Benjamin Franzke
98aa2a8f72 st/dri/sw: Implement texture_from_pixmap
This is a cleanup of commit 02f1b50987.

Update tex buffer using a dri_drawable hook from implemented in sw/drisw.c.
This saves us the duplication of dri_drawable.c.

CC: Stuart Abercrombie <sabercrombie@chromium.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
2011-11-02 15:43:27 +01:00
Benjamin Franzke
0a2afcb754 Revert "Duplicate state_tracker/dri/sw/dri_drawable.c"
This reverts commit 569bde1fa7.

CC: Stuart Abercrombie <sabercrombie@chromium.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
2011-11-02 15:43:26 +01:00
Benjamin Franzke
5da7c5e364 Revert "state_trackers/dri/sw: Implement texture_from_pixmap."
This reverts commit 02f1b50987.

CC: Stuart Abercrombie <sabercrombie@chromium.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
2011-11-02 15:43:26 +01:00
Alex Deucher
0a2c4889cb r600g: add comment about special shader exports
Certain exports (position, point size, etc.) are treated
specially by the shader and not counted as generic exports.

Note the exports and any relevant related state bits.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-02 09:47:40 -04:00
Vadim Girlin
16c0a3a972 r600g: take into account PSIZE output for spi mapping
Skip PSIZE and POSITION when counting VS outputs.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42435

Tested without regressions on evergreen.

NOTE: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-02 09:47:10 -04:00
José Fonseca
e8f646fa7e svga: Update state prototypes to return pipe_error.
Fixes a bunch of prototype mismatch warnings..
2011-11-02 11:18:35 +00:00
Jeremy Huddleston
666c70ce8e Build fix for -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-01 21:04:51 -07:00
Yuanhan Liu
81d5195a61 intel: fix potential segfault error
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-02 11:14:53 +08:00
Eric Anholt
8524be3fb4 swrast: Use MapRenderbuffer for glReadPixels(GL_DEPTH_COMPONENT) fast-paths.
This fixes issues with the code playing fast and loose with types of
buffers, and as a bonus avoids the wrappers that were previously used
to pull bits out of packed depth/stencil buffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
789cb3435c mesa: Make unpack_uint_z_row return 32 bits of data.
Some of the return values were u32, some were 24 bits, and z16
returned 16 bits.  The caller would have to do all the work of
interpreting the format all over again.  However, there are no callers
of this function at this point.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
4b8f4e7ce1 nouveau: Add implementation of MapRenderbuffer.
Perhaps the easiest implementation, nouveau can directly map buffers
even if tiled, and uses separate surfaces for its texture
renderbuffers so we don't have to worry about that offset.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
425b8d54b8 radeon: Add implementation of MapRenderbuffer.
Unlike intel, we do a blit to/from GTT memory in order to
untile/retile the renderbuffer data, since we don't have fence
registers for accessing it.

(There is software tiling code in radeon_tile.c, but it's unused and
doesn't support macro tiling)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
bae10c0d2e intel: Use MapRenderbuffer in spans setup.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Eric Anholt
92054cd94e intel: Add an implementation of MapRenderbuffer.
v2: Add separate stencil S8 W-tile swizzling/deswizzling.  Tested for
    the swizzling case with env INTEL_SEPARATE_STENCIL=1 INTEL_HIZ=1
    ./bin/hiz-depth-stencil-test-fbo-d24-s8
v3: Apply Chad's fix for S8 window system buffers.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-11-01 15:42:17 -07:00
Eric Anholt
6b341662b3 intel: Improve the debug info for renderbuffer allocation. 2011-11-01 15:42:17 -07:00
Eric Anholt
76d1275474 Add MapRenderbuffer implementations for software drivers.
Mesa core's is generic for things like osmesa.

For swrast_dri.so, we have to do Y flipping.  The front-buffer path
isn't actually tested, though, because both before and after it fails
with a BadMatch in XGetImage.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Eric Anholt
a25a452fbe mesa: Add a driver hook for mapping renderbuffers.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Eric Anholt
15b58d8c22 Revert "intel: Drop the immediate validation of the texture object in TFP."
This reverts commit abaebcee78.

The assertion I made was that "the zero-copy code in validation" would
zero copy.  Of course, I deleted that check back in January because
the two sites that would trigger it (glTexImage() and this one) both
immediately bound their mt to the object, making the other check
pointless.

Removes two extra blits in glx-tfp.  Also fixed the Android home
screen, which wasn't rendering because the extra copy broke the
relationship between the texture and the eglimage.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42152
Tested-by: Chad Versace <chad@chad-versace.us>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-11-01 15:42:17 -07:00
Brian Paul
689df24503 mesa: make save_EndConditionalRender param list (void) to silence warning 2011-11-01 16:39:37 -06:00
Brian Paul
f6fa34f7ad postprocess: remove const qualifiers on unsigned int parameters
to match the prototype in postprocess.h
2011-11-01 16:39:37 -06:00
Chia-I Wu
45568faba2 scons: include src/glsl/Makefile.sources
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-02 06:36:58 +08:00
Chia-I Wu
fb0e4a23fa android: include src/glsl/Makefile.sources
This also fixes the build error due to missing link_uniforms.cpp in the source
lists.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>

[olv: the missing link_uniforms.cpp was added before this patch is committed]
2011-11-02 06:36:24 +08:00
Chia-I Wu
dfdb34b7c1 glsl: Refactor source lists to Makefile.sources
With the hope that Android.mk and SConscript can share the file to reduce
future breakage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-11-02 06:34:39 +08:00
Vinson Lee
3d6d443481 mesa: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.
2011-11-01 14:41:24 -07:00
Adam Jackson
6d3d0ca9e9 drisw: Enable SGI_make_current_read for direct contexts
Equivalent to glXMakeContextCurrent, which had better already work since
we advertise GLX 1.3.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-11-01 13:52:48 -04:00
Thomas Hellstrom
dc4ef91601 st/xa: Add a scanout flag for surfaces
Bump minor to signal availability.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-01 18:18:14 +01:00
Eugeni Dodonov
48a4b9b70c Build link_uniforms for android
Otherwise android-x86 build fails.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-11-01 15:05:24 -02:00
José Fonseca
a1b737d72f llvmpipe: Re-advertise support for stencil formats...
"no fetch_rgba_float for uint formats" => "llvmpipe does not support uint formats"

"stencil == uint" => "llvmpipe does not support stencil"
2011-11-01 12:28:47 +00:00
José Fonseca
0cbb49aff5 llvmpipe: Use -1 instead of ~0 for "no slot".
As the value of unsigned ~0 depends on the bit-width.

Fixes fdo 42411.
2011-11-01 11:29:31 +00:00
Marek Olšák
4a0afa2c3b docs: update relnotes-7.12 2011-11-01 11:37:11 +01:00
Nicholas Miell
66389bb99d dri/nouveau: Enable NV_fog_distance on NV10 and NV20 hardware
Add support for NV_fog_distance to the NV10 and NV20 drivers.

[ Francisco Jerez: Fix fog coord. signedness for
  GL_EYE_RADIAL_NV/GL_EYE_PLANE on nv20 ]
2011-11-01 11:37:11 +01:00
Nicholas Miell
64cebb6c83 st/mesa: Enable NV_fog_distance for Gallium drivers
The fixed-function generated vertex program is all that's needed for
Gallium drivers.
2011-11-01 11:37:11 +01:00
Nicholas Miell
fadd5e1b00 mesa: Add NV_fog_distance to the fixed-function vertex program generator
This is all that is needed to implement NV_fog_distance on programmable
hardware.
2011-11-01 11:37:10 +01:00
Nicholas Miell
740467dd62 mesa: Add the basics for the NV_fog_distance extension
No driver implements it yet.
2011-11-01 11:37:10 +01:00
José Fonseca
7f08248c2e ralloc: Use _vscprintf on MinGW.
MinGW uses MSVC's runtime DLLs for most of C runtime's functions, and
there has same semantics for vsnprintf.

Not sure how this worked until now -- maybe one of the internal
vsnprintf implementations was taking precedence.
2011-11-01 08:47:39 +00:00
José Fonseca
e33447aac6 svga: Fix potential buffer overflow in rs draw state.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-31 21:33:04 +00:00
José Fonseca
0f26c6ae3f llvmpipe: Remove unsed variables. 2011-10-31 19:40:54 +00:00
José Fonseca
7ff247712d util: Add missing initializer. 2011-10-31 19:40:54 +00:00
Paul Berry
9734bd0560 i965: Fix flat integral varyings.
Previously, the vertex and fragment shader back-ends assumed that all
varyings were floats.  In GLSL 1.30 this is no longer true--they can
also be of integral types provided that they have an interpolation
qualifier of "flat".

This required two changes in each back-end: assigning the correct type
to the register that holds the varying value during shader execution,
and assigning the correct type to the register that ties the varying
value to the rest of the graphics pipeline (the message register in
the case of VS, and the payload register in the case of FS).

Fixes piglit tests fs-int-interpolation and fs-uint-interpolation.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-31 11:29:44 -07:00
Paul Berry
fa0066ae2b mesa: Add glsl_type::get_scalar_type() function.
This function is similar to get_base_type(), but when called on
arrays, it returns the scalar type composing the array.  For example,
glsl_type(vec4[]) => float_type.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-31 11:29:14 -07:00
Paul Berry
f40c6b2a99 i965/gen6+: Switch GLSL from ALT to IEEE floating point mode
i965 graphics hardware has two floating point modes: ALT and IEEE.  In
ALT mode, floating-point operations never generate infinities or NaNs,
and MOV instructions translate infinities and NaNs to finite values.
In IEEE mode, infinities and NaNs behave as specified in the IEEE 754
spec.

Previously, we used ALT mode for all vertex and fragment programs,
whether they were GLSL programs or ARB programs.  The GLSL spec is
sufficiently vague about how infs and nans are to be handled that it
was unclear whether this mode was compliant with the GLSL 1.30 spec or
not, and it made it very difficult to test the isinf() and isnan()
functions.

This patch changes i965 GLSL programs to use IEEE floating-point mode,
which is clearly compliant with GLSL 1.30's inf/nan requirements.  In
addition to making the Piglit isinf and isnan tests pass, this paves
the way for future support of the ARB_shader_precision extension.

Unfortunately we still have to use ALT floating-point mode when
executing ARB programs, because those programs require 0^0 == 1, and
i965 hardware generates 0^0 == NaN in IEEE mode.

Fixes piglit tests "isinf-and-isnan fs_fbo", "isinf-and-isnan vs_fbo",
and {fs,vs}-{isinf,isnan}-{vec2,vec3,vec4}.
2011-10-31 11:24:03 -07:00
Paul Berry
ede60bc467 glsl: Add isinf() and isnan() builtins.
The implementations are as follows:

isinf(x) = (abs(x) == +infinity)
isnan(x) = (x != x)

Note: the latter formula is not necessarily obvious.  It works because
NaN is the only floating point number that does not equal itself.

Fixes piglit tests "isinf-and-isnan fs_basic" and "isinf-and-isnan
vs_basic".
2011-10-31 11:24:03 -07:00
Paul Berry
b6f32bbe12 glsl: Add '.ir' extension to builtin IR files
This patch adds the extension '.ir' to all the files in
src/glsl/builtins/ir/, and changes generate_builtins.py so that it no
longer globs on '*' to find the files to build.  This prevents
spurious files (such as EMACS' infamous *~ backup files) from breaking
the build.
2011-10-31 11:24:03 -07:00
Paul Berry
b726639e1b glsl: Fix copy-paste error in constant_expression_value(ir_binop_nequal)
The implementation of ir_binop_nequal in constant_expression_value()
appears to have been copy-and-pasted from the implementation of
ir_binop_equal, but with all instances of '==' changed to '!='.  This
is correct except for one minor flaw: one of those '==' operators was
in an assertion checking that the types of the two arguments were
equal.  That one needs to stay an '=='.

Fixes piglit tests {fs,vs}-inline-notequal.
2011-10-31 11:24:03 -07:00
Brian Paul
d09b1109d4 docs: list GL_ARB_texture_storage in 7.12 release notes 2011-10-31 10:52:57 -06:00
Brian Paul
414e183ed7 mesa: add note about immutable textures for _mesa_test_texobj_completeness() 2011-10-31 10:52:57 -06:00
Brian Paul
12d69fca09 swrast: implement GL_ARB_texture_storage 2011-10-31 10:52:57 -06:00
Brian Paul
e0a0496971 st/mesa: implement GL_ARB_texture_storage 2011-10-31 10:52:57 -06:00