Compare commits

...

7801 Commits

Author SHA1 Message Date
Jordan Justen
c988bf94bc i965: enable ARB_instanced_arrays extension
Set the step_rate value when drawing to implement
ARB_instanced_arrays for gen >= 4.

v2:
 * leave (total_size < 2048) check where it was to only make
   this check once rather than once for each array.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-26 11:22:16 -07:00
Brian Paul
345ee593e9 st/wgl: 80-column wrapping 2012-06-25 16:10:01 -06:00
Andreas Boll
19534579cf docs/lists: add piglit mailing list
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
24eebf4f88 docs/helpwanted: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
f29f5e8695 docs/sourcetree: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
b347bb5dbc docs/devinfo: update release info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
398d8be3ab docs/systems: add some useful driver links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
297309ce23 docs: update some broken/old links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
dae9b0f1d8 docs: whitespace cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
ddb0557868 docs: escape html special char
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
a5447aab96 docs: add missing target attribute
target is needed for the frame based layout

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
d52419e0c3 docs/shading: use proper markup
use dl instead of ul

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Brian Paul
75e62024c3 docs: document the GALLIUM_LOG_FILE env var 2012-06-25 16:10:01 -06:00
Brian Paul
9ccf5bffe3 mesa: new MESA_LOG_FILE env var to log errors, warnings, etc., to a file
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-25 16:10:01 -06:00
Marek Olšák
0f530d2dff docs: update GL3.3 status 2012-06-25 23:53:49 +02:00
Marek Olšák
4891c5dc64 r600g: inline r600_blit_push_depth and use resource_copy_region
We are going to have a separate resource for depth texturing and transfers
and this is just a transfer thing.
2012-06-25 23:53:49 +02:00
Marek Olšák
da98bb6fc1 r600g: split flushed depth texture creation and flushing 2012-06-25 23:53:49 +02:00
Paul Berry
d1056541e2 i965/msaa: Add backend support for centroid interpolation.
This patch causes the fragment shader to be configured correctly (and
the correct code to be generated) for centroid interpolation.  This
required two changes: brw_compute_barycentric_interp_modes() needs to
determine when centroid barycentric coordinates need to be included in
the pixel shader thread payload, and
fs_visitor::emit_general_interpolation() needs to interpolate using
the correct set of barycentric coordinates.

Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
centroid-edges" on i965.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
cf0e7aa9f8 i965/fs: Refactor interpolation code to prepare for adding centroid support.
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
6d7ebb21f8 i965/msaa: Adapt clip setup for centroid noperspective interpolation.
To save time, we only instruct the clip stage of the pipeline to
compute noperspective barycentric coordinates if those coordinates are
needed by the fragment shader.  Previously, we would determine whether
the coordinates were needed by seeing whether the fragment shader used
the BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC interpolation mode.

However, with MSAA, it's possible that the fragment shader might use
BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC instead.  In the future,
when we support ARB_sample_shading, it might use
BRW_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC.

This patch modifies the upload_clip_state() functions to check for all
three possible noperspective interpolation modes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
bebb043811 glsl: Add IsCentroid bitfield to gl_fragment_program.
This bitfield tells the back-ends which of a fragment shader's inputs
require centroid interpolation.  It is only set for GLSL fragment
shaders, since assembly fragment shaders don't support centroid
interpolation.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Brian Paul
2a4af651e6 st/mesa: added some simple fbo debugging/helper code 2012-06-25 11:28:03 -06:00
Brian Paul
45df3eb1db llvmpipe: fix the LP_NO_RAST debug option
It was only no-oping the clear() function, not actual triangle
rasterization.  Move the no_rast field from lp_context down into
lp_rasterizer so it's accessible where it's needed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-25 08:14:33 -06:00
Vinson Lee
37d699a296 scons: Add glsl/glcpp to the include path.
Fixes this build failure on Solaris.

  Compiling build/sunos-debug/glsl/glcpp/glcpp-lex.c ...
"src/glsl/glcpp/glcpp-lex.l", line 30: cannot find include file: "glcpp-parse.h"

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-23 13:40:09 -07:00
Laurent Carlier
78ac9af580 automake: add missing inclusion of GL headers
Building fail when GL headers are not installed in the system,
so add inclusion of these headers.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-22 17:24:37 -06:00
Brian Paul
cbffaf20e9 mesa: #define fprintf to be __mingw_fprintf() on Mingw32
So that formats such as "%llx" are understood.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-22 17:24:37 -06:00
Brian Paul
fe68af6e0d svga: init pointer to NULL to silence MSVC warning 2012-06-22 17:24:37 -06:00
Tom Stellard
ea76f03310 clover: Add --with-clang-libdir option and verify CLANG_RESOURCE_DIR
$CLANG_RESOURCE_DIR is the directory that contains all resources
needed by clang to compile programs.  When clover uses clang to
compile kernels it needs to specify a resource dir, so that clang
can find its internal headers (e.g. stddef.h).

clang defines $CLANG_RESOURCE_DIR as $CLANG_LIBDIR/clang/$CLANG_VERSION

This patch adds the --with-clang-libdir option in order to accommodate
clang intalls to non-standard locations, and it also adds a check
to the configure script to verify that $CLANG_RESOURCE_DIR/include
contains the necessary header files.
2012-06-22 16:59:24 -04:00
Paul Berry
82d25963a8 i965: Compute dFdy() correctly for FBOs.
On i965, dFdx() and dFdy() are computed by taking advantage of the
fact that each consecutive set of 4 pixels dispatched to the fragment
shader always constitutes a contiguous 2x2 block of pixels in a fixed
arrangement known as a "sub-span".  So we calculate dFdx() by taking
the difference between the values computed for the left and right
halves of the sub-span, and we calculate dFdy() by taking the
difference between the values computed for the top and bottom halves
of the sub-span.

However, there's a subtlety when FBOs are in use: since FBOs use a
coordinate system where the origin is at the upper left, and window
system framebuffers use a coordinate system where the origin is at the
lower left, the computation of dFdy() needs to be negated for FBOs.

This patch modifies the fragment shader back-ends to negate the value
of dFdy() when an FBO is in use.  It also modifies the code that
populates the program key (brw_wm_populate_key() and
brw_fs_precompile()) so that they always record in the program key
whether we are rendering to an FBO or to a window system framebuffer;
this ensures that the fragment shader will get recompiled when
switching between FBO and non-FBO use.

This will result in unnecessary recompiles of fragment shaders that
don't use dFdy().  To fix that, we will need to adapt the GLSL and
NV_fragment_program front-ends to record whether or not a given shader
uses dFdy().  I plan to implement this in a future patch series; I've
left FIXME comments in the code as a reminder.

Fixes Piglit test "fbo-deriv".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-22 07:59:34 -07:00
Brian Paul
d988ea5e81 mesa: minor transform feedback comments 2012-06-22 08:48:45 -06:00
Brian Paul
09af5783b3 mesa: fix comments on UBO buffer binding functions
The old comments were for transform feedback.
2012-06-22 08:44:00 -06:00
Olivier Galibert
b8068afafa draw: Handle the case when there isn't a fragment shader.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-22 09:58:39 +01:00
Zack Rusin
af98c6b05b mesa: update the emacs indent files
dirvars package has been replaced by built-in functionality of
dir-locals. preserve the settings in the new infrastructure
2012-06-21 17:29:11 -04:00
Tom Stellard
ff2b417245 r600g: Unify SURFACE_SYNC packet emission for 3D and compute
Drop the compute specific evergreen_set_buffer_sync() function and
instead use the r600_surface_sync_command atom for emitting SURFACE_SYNC
packets.
2012-06-21 20:42:07 +00:00
Tom Stellard
ff08f1ec6f r600g: Enable reusing of compute state 2012-06-21 20:42:07 +00:00
Tom Stellard
5cd6ce939d r600g: Fix reading vtx instruction offset from bytestream 2012-06-21 20:42:07 +00:00
Tom Stellard
563a764110 radeon/llvm: Turn on the BitExtract peephole optimization
Thie BitExtract optimization folds a mask and shift operation together
into a single instruction (BFE_UINT).
2012-06-21 20:42:06 +00:00
Tom Stellard
c53c8d0555 radeon/llvm: Lower ROTL to BIT_ALIGN 2012-06-21 20:42:06 +00:00
Tom Stellard
cd287301ec radeon/llvm: Use the VLIW Scheduler for R600->NI
It's not optimal, but it's better than the register pressure scheduler
that was previously being used.  The VLIW scheduler currently ignores
all the complicated instruction groups restrictions and just tries to
fill the instruction groups with as many instructions as possible.
Though, it does know enough not to put two trans only instructions in
the same group.

We are able to ignore the instruction group restrictions in the LLVM
backend, because the finalizer in r600_asm.c will fix any illegal
instruction groups the backend generates.

Enabling the VLIW scheduler improved the run time for a sha1 compute
shader by about 50%.  I'm not sure what the impact will be for graphics
shaders.  I tested Lightsmark with the VLIW scheduler enabled and the
framerate was about the same, but it might help apps that use really
big shaders.
2012-06-21 20:42:06 +00:00
Brian Paul
b73cf49c91 mesa: set GL_ARB_uniform_buffer_object extension year to 2009 2012-06-21 13:08:34 -06:00
Eric Anholt
cb9f35d16f mesa: Add a comment explaining my thoughts on glBindBufferBase().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:18 -07:00
Eric Anholt
d103fead19 mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object.
Fixes piglit ARB_uniform_buffer_object/getintegeri_v.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:10 -07:00
Eric Anholt
fb76ddc133 mesa: Add support for glBindBufferBase/Range on GL_UNIFORM_BUFFER.
Fixes piglits:
GL_ARB_uniform_buffer_object/bindbuffer-general-point.
GL_ARB_uniform_buffer_object/negative-bindbuffer-buffer
GL_ARB_uniform_buffer_object/negative-bindbuffer-index
GL_ARB_uniform_buffer_object/negative-bindbuffer-target
GL_ARB_uniform_buffer_object/negative-bindbufferrange-range

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:07 -07:00
Eric Anholt
b82c472156 mesa: Move glBindBufferBase and glBindBufferRange() to bufferobj.
The rest of the TFB implementation remains in transformfeedback.c, and
this will be shared with UBOs.

v2: Move the size/offset checks shared with UBOs to common code as
    well. (Kenneth's review)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:00 -07:00
Eric Anholt
9627660448 mesa: Move buffer object dispatch setup to bufferobj.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:58 -07:00
Eric Anholt
5527c2d220 mesa: Add indexed binding points for uniform buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:56 -07:00
Eric Anholt
c5c696e7fb mesa: Add support for the GL_UNIFORM_BUFFER general binding point.
Fixes piglit ARB_uniform_buffer_object/buffer-targets.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:54 -07:00
Eric Anholt
5426b1ade9 mesa: Add state and getters for the GL_ARB_uniform_buffer_object maximums.
Fixes piglit GL_ARB_uniform_buffer_object/minmax.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:51 -07:00
Vincent Lejeune
3e17d38457 glapi: Add uniform buffer object API
v2: Fix a typo spotted by Eric Anholt.
v3: Fix missing "GL" on types, fix style, fix Studly_Caps extension name,
    drop commented code duplicated with GL3x.xml [anholt]

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:45 -07:00
Eric Anholt
37c3cbe053 dricore: Turn it into a normal library.
Our intention is still that it's not abi stable, so make the package
version number get included in the library name.  Now you can parallel
install dricore-using drivers from multiple mesa versions.  We can put
it into lib now that we're following library versioning rules
(assuming that ABIs don't change within a single Mesa point release).

LD_LIBRARY_PATH still doesn't work with a non-/, non-/usr prefix
because libtool uses rpath instead of runpath for nonstandard
prefixes.
2012-06-21 10:10:46 -07:00
Eric Anholt
4113ac6a0f automake: Convert Mesa built sources generation to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
2d51ac84fd mesa: Move GL header installation to automake.
This cuts some cruft related to osmesa where we were being careful to
not install headers twice.
2012-06-21 10:10:46 -07:00
Eric Anholt
1bbd22ada0 automake: Move mesa subdirs processing to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
39785488e6 automake: Move .pc installation to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
417c1a6421 automake: Move the master Mesa makefile to Makefile.old.
This will let me incrementally move stuff to automake without
converting libmesa.a all at once.
2012-06-21 10:10:46 -07:00
Eric Anholt
bd18a236de automake: Convert osmesa.pc to be generated by configure. 2012-06-21 10:10:43 -07:00
Eric Anholt
fa4cf4dc0c mesa: Convert gl.pc to be generated by configure.
This saves a step of mashing variables around in our Makefile.
2012-06-21 10:10:08 -07:00
Eric Anholt
2d4b77c7c6 automake: Convert src/mesa/drivers/x11/Makefile to automake.
The weird versioning of the libGL where the package version was sort
of expressed as a big integer is dropped.  libtool didn't like the 0
prefix, and it didn't really make sense anyway -- if you interpret it
as an integer version number, old Mesa 071200 was bigger than current
Mesa 08100.  Instead, just bump the minor version and drop the
patchlevel.
2012-06-21 10:09:17 -07:00
Eric Anholt
2fb0f770a4 automake: Convert src/gallium/Makefile to automake. 2012-06-21 10:08:26 -07:00
Eric Anholt
27383cbb0b automake: Convert src/mapi/glapi/gen to silent build. 2012-06-21 10:08:26 -07:00
Eric Anholt
3a70f7526a automake: Convert src/mapi/glapi/gen/Makefile to automake. 2012-06-21 10:08:24 -07:00
Eric Anholt
d59149d3f4 automake: Convert src/mesa/drivers/Makefile to automake. 2012-06-21 10:07:38 -07:00
Eric Anholt
9ff2709ca5 automake: Directly generate configs/current instead of symlinking from it. 2012-06-21 10:07:38 -07:00
Eric Anholt
95836b46e7 automake: Convert gen_matypes building to automake. 2012-06-21 10:07:36 -07:00
Eric Anholt
acf27121a5 make: Drop HOST_CC and HOST_CFLAGS.
Except for the deleted linux-cell target, these were just the target
cc/cflags.  The only usage was for gen_matypes, which wants the
target's structure packing, not the host, anyway.
2012-06-21 09:58:12 -07:00
Eric Anholt
e426949cf1 make: Fold ASM_CFLAGS into DEFINES.
Every place that uses ASM_FLAGS already uses DEFINES.  Not including
it in DEFINES is just a way to screw up potential users, as I've done
several times while working on the build system.
2012-06-21 09:58:12 -07:00
Eric Anholt
07b28af5b5 automake: Convert src/egl/Makefile to automake. 2012-06-21 09:58:12 -07:00
Eric Anholt
a4ff3342d2 automake: Don't warn on gmake portability issues.
Even pre-automake, we rely on gmake features for pattern
substitutions, and replacing those with reams more make code is not
interesting.  This will let us turn the old Makefiles using pattern
substitutions into automake without spewing warnings.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-06-21 09:57:52 -07:00
Marcin Slusarz
19fd04f5ea nv50: fix buffer reuse issues
1) We need to insert a barrier between consecutive transform feedback calls.
2) VBO cache needs to be flushed when TFB output is used as VBO draw input.

Fixes Piglit test EXT_transform_feedback/immediate-reuse.

Thanks to Christoph Bumiller for pointing out bugs in previous versions
of this patch.
2012-06-20 21:24:53 +02:00
Marcin Slusarz
7e63b613a5 st/mesa: fix transform feedback of unsubscripted gl_ClipDistance array
gl_ClipDistance needs special treatment in form of lowering pass
which transforms gl_ClipDistance representation from float[] to
vec4[]. There are 2 implementations - at glsl linker level (enabled
by LowerClipDistance option) and at glsl_to_tgsi level (enabled
unconditionally for gallium drivers). Second implementation is
incomplete - it does not take into account transform feedback (see
commit 642e5b413e "mesa: Fix transform
feedback of unsubscripted gl_ClipDistance array" for details).

There are 2 possible fixes:
- adding transform feedback support into glsl_to_tgsi version
- ripping gl_ClipDistance support from glsl_to_tgsi and enabling
  gl_ClipDistance lowering on glsl linker side

This patch implements 2nd option. All it does is:
- reverts most of the commit 59be691638
  "st/mesa: add support for gl_ClipDistance"
- changes LowerClipDistance to true

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{2,3,4,5,6,7,8}]-no-subscript" at least on nv50
and evergreen cards.
2012-06-20 21:16:20 +02:00
Paul Berry
f2f05e50b1 glx/tests: Fix signed/unsigned comparison warnings. 2012-06-20 11:42:42 -07:00
Paul Berry
cde6544ad7 i965/msaa: Only do multisample rasterization if GL_MULTISAMPLE enabled.
From the GL 3.0 spec (p.116):

    "Multisample rasterization is enabled or disabled by calling
    Enable or Disable with the symbolic constant MULTISAMPLE."

Elsewhere in the spec, where multisample rasterization is described
(sections 3.4.3, 3.5.4, and 3.6.6), the following text is consistently
used:

    "If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is
    one, then..."

So, in other words, disabling GL_MULTISAMPLE should prevent
multisample rasterization from occurring, even if the draw framebuffer
is multisampled.  This patch implements that behaviour by setting the
WM and SF stage's "multisample rasterization mode" to
MSRAST_ON_PATTERN only when the draw framebuffer is multisampled *and*
GL_MULTISAMPLE is enabled.

Fixes piglit test spec/EXT_framebuffer_multisample/enable-flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-20 11:28:09 -07:00
Paul Berry
3b0279a693 i965/msaa: Disable unsupported formats.
Due to hardware limitations, MSAA is unsupported on Gen6 for formats
containing >64 bits of data per pixel.  From the Sandy Bridge PRM,
vol4 part1, p72 ("Surface Format"):

    If Number of Multisamples is set to a value other than
    MULTISAMPLECOUNT_1, this field cannot be set to the following
    formats:
    - any format with greater than 64 bits per element
    - any compressed texture format (BC*)
    - any YCRCB* format

Gen7 has a similar, but less stringent limitation: formats with >64
bits of data per pixel only support 4x MSAA.

This patch causes the unsupported formats to report
GL_FRAMEBUFFER_UNSUPPORTED.

Fixes piglit "multisample-formats" tests on Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-20 11:28:09 -07:00
Andreas Boll
3becf98424 mesa: remove obsolete confdiff.sh
this script is obsolete since
0cc216676c
2012-06-20 01:51:38 -07:00
Christian König
0f269c5e7b st/vdpau: use template size as default for source_rect.
Fixes alignment problems with flash player.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-20 10:13:38 +02:00
Christian König
d37c3c6ebe st/vdpau: clear Cb&Cr with 0.5f
That makes the output black in case of decoding errors.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-20 10:13:29 +02:00
Kenneth Graunke
2f8351a5ac i965: Don't set brw_wm_prog_key::iz_lookup on Gen6+.
Sandy Bridge and later don't use this field, so there's no point in
setting it.  It can only cause harmful state-based recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-19 17:36:48 -07:00
Olivier Galibert
c790c2c759 llvmpipe: Add vertex id support.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
46931ecf48 llvmpipe: Simplify and fix system variables fetch.
The system array values concept doesn't really because it expects the
system values to be fixed per call, which is wrong for gl_VertexID and
iffy for gl_SampleID.  So this patch does two things:

- kill the array, have emit_fetch_system_value directly pick the
  values it needs (only gl_InstanceID for now, as the previous code)

- correctly handle the expected type in emit_fetch_system_value

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
4625a9b1ad draw: fix flat shading and screen-space linear interpolation in clipper
This includes:
- picking up correctly which attributes are flatshaded and which are
  noperspective

- copying the flatshaded attributes when needed, including the
  non-built-in ones

- correctly interpolating the noperspective attributes in screen-space
  instead than in a 3d-correct fashion.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
cfc5b30941 softpipe: Offset is not to be applied to the layer parameter of array texture fetches.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Brian Paul
fc855ed5d9 st/mesa: clamp glDrawPixels size to max texture size 2012-06-19 14:40:44 -06:00
Brian Paul
7f4786ad29 st/mesa: move st_validate_state() call earlier in st_DrawPixels() 2012-06-19 14:40:44 -06:00
Jerome Glisse
b4f0ab0b22 r600g: fix z/stencil texture creation v2
z or stencil texture should not be created with the z/stencil
flags for surface creation as they are intended to be bound
as texture.

v2: remove broken code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-19 15:03:36 -04:00
Török Edwin
988ad7831c radeon/llvm: Fix CR/LF in Processors.td
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-19 16:38:23 -04:00
Török Edwin
7c005d5687 radeon/llvm: Fix sin/cos codegen on R700
Based on https://bugs.freedesktop.org/show_bug.cgi?id=50317#c4

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=50316
https://bugs.freedesktop.org/show_bug.cgi?id=50317

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-19 16:38:13 -04:00
Fredrik Höglund
4e943c375b docs: update GL3.txt for ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
c4c8c7a8f9 st/mesa: Add support for GL_ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
af372129e5 gallium: Add PIPE_CAP_START_INSTANCE
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
ae5d7d5e89 mesa: Add support for GL_ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Vinson Lee
ee99647e02 scons: Do not build svga if using Solaris Studio C compiler.
Solaris Studio C compiler does not support anonymous structs and
anonymous unions.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 16:37:46 -07:00
Kenneth Graunke
5b83bdc154 i965: Fix brw_swap_cmod() for LE/GE comparisons.
The idea here is to rewrite comparisons like 2 >= x with x <= 2; we want
to simply exchange arguments, not negate the condition.  If equality was
part of the original comparison, it should remain part of the swapped
version.

This is the true cause of bug #50298.  It didn't manifest itself on
Sandybridge because we embed the conditional modifier in the IF
instruction rather than emitting a CMP.  All other platforms use CMP.

It also didn't manifest itself on the master branch because commit
be5f27a84d ("glsl: Refine the loop instruction counting.") papered over
the problem.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50298
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-18 15:25:31 -07:00
Brian Paul
6f7834ad36 docs: start release notes file for 8.1 2012-06-18 12:39:34 -06:00
Tom Stellard
7fab4b648b radeon/llvm: Update comment in AMDGPU.td 2012-06-18 18:30:36 -04:00
Tom Stellard
984ad0788c radeon/llvm: Remove unused AMDIL TableGen definitons 2012-06-18 18:30:36 -04:00
Tom Stellard
34ff22b75f radeon/llvm: Eliminate getRegClassFromType() function
We can use TargetLowering::getRegClassFor() instead.
2012-06-18 18:30:36 -04:00
Tom Stellard
440ab9ea02 radeon/llvm: Remove deadcode from AMDILISelLowering.cpp 2012-06-18 18:30:35 -04:00
Vinson Lee
cd62960a2e gallium: Add support for Solaris Studio C++ compiler.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 10:01:26 -07:00
James Benton
f34e2f484b llvmpipe: Implement cylindrical wrapping.
Tested against mesa demos cylwrap and dx9 DCT address.exe which now passes 100%.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-18 17:55:05 +01:00
Vinson Lee
d1acae2bdc st/glx: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 09:42:08 -07:00
Brian Paul
8ae93c68ea svga: fix synchronization bug between sampler views and surfaces
This fixes a bug where a sampler view was using stale texture/resource
data when the texture was modified through a surface (render to texture).
Bumping the texture and layer ages triggers sampler view revalidation.

Fixes piglit fbo-blit failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-18 10:22:59 -06:00
Kristian Høgsberg
2d7b2d7a87 gles2: Add GL_NV_read_buffer extension
This lets us select the front buffer for reading under GLES2.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-18 11:53:18 -04:00
Kristian Høgsberg
e841a2426e get.c: Rename EXTRA_VERSION_ES2 to EXTRA_API_ES2
This extra condition checks the API not the version of the API, so rename
to reflect that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-18 11:50:53 -04:00
Andreas Boll
1692d3ad94 docs/relnotes: comment out bug template
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
fb918727ef docs/relnotes: replace tbd with release date
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
b9fad90350 docs/relnotes: fix validation errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
207d52eb46 docs/relnotes: consolidate html header
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
José Fonseca
e48d26bf40 draw: Ensure that the vertex_header type size matches expectation.
This is failing sometimes, probably because TargetData keeps a structure layout
cache, which can becomes bogus, ever since the InvalidateStructLayoutInfo API
was removed in LLVM r135245.

This change merely makes the problem easier to diagnose (an assertion
failure instead of a random crash).
2012-06-18 12:06:23 +01:00
Marek Olšák
6e7756db14 r600g: enable streamout by default on r7xx and DRM 2.17.0
Now that it's in Linus's tree.

Has anyone had a chance to test streamout on Cayman recently?
2012-06-17 18:28:32 +02:00
Marek Olšák
7c3786d780 st/mesa: properly allocate MSAA renderbuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:27 +02:00
Marek Olšák
c760283159 st/mesa: make unsupported renderbuffer formats always fail as FBO incomplete
instead of failing to allocate a renderbuffer.

This also fixes piglit/get-renderbuffer-internalformat with non-renderable
formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:27 +02:00
Marek Olšák
e4b2e6b527 st/mesa: separate sw renderbuffer allocation from hw one
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:26 +02:00
Marek Olšák
a82227ce4a mesa: if AllocStorage doesn't choose a format, report FRAMEBUFFER_UNSUPPORTED
This allows drivers not to do any allocation in AllocStorage if the storage
cannot be allocated because of an unsupported internalformat + samples combo.

The little ugliness is that AllocStorage is expected to return TRUE in this
case.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-16 14:20:26 +02:00
Stéphane Marchesin
841eee5d44 i915g: More ops commute.
This allows using the optimizations more broadly.
2012-06-15 20:22:26 -07:00
Marek Olšák
cb4d1d377d r600g: fix lockups with streamout on r7xx
This requires the latest streamout kernel patches.

Streamout is disabled by default on r7xx, so this patch is safe for regular
users.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:43:00 +02:00
Marek Olšák
f01594be0e r600g: compute CS space for streamout correctly, add comments
SET_CONTEXT_REG was not counted in.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:43:00 +02:00
Marek Olšák
bb07e25131 r600g: set SMX_ACTION_ENA to fix streamout cache flushes on some chipsets
It helps on R7xx.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:42:59 +02:00
Alexey Shvetsov
f56f03428d clover: Fix build with LLVM libs installed to non-standard directories
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-15 13:22:16 -04:00
Marek Olšák
5e7e7d96b3 st/mesa: don't do srgb->linear conversion in decompress_with_blit
This fixes piglit/getteximage-formats on r600g.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-15 18:54:14 +02:00
Paul Berry
4d9c3cbce9 glsl: Use ir_unop_f2u to convert floats to uints.
Fixes piglit tests
spec/glsl-1.30/execution/{vs,fs}-float-uint-conversion on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
9d57d483cb gallium: Add TGSI_OPCODE_F2U to gallivm backend.
Note: for the moment TGSI_OPCODE_F2U is implemented using
lp_build_itrunc() (the same function used to implement
TGSI_OPCODE_F2I).  In the long run, we should create an
lp_build_utrunc() function to do the proper conversion.  But this
should allow us to limp along with mostly correct behaviour for now.
2012-06-15 08:58:55 -07:00
Paul Berry
1be7661110 gallium: Add support for ir_unop_f2u to tgsi backend.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
fa584c50cf ir_to_mesa: Add support for ir_unop_f2u to ir_to_mesa backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
11a7b93592 i965: Add support for ir_unop_f2u to i965 backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
613a8170ae glsl: Add support for ir_unop_f2u to constant folding.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
8e31f961e6 glsl: Add unary operation ir_unop_f2u.
Previously, we performed conversions from float->uint by a two step
process: float->int->uint.  However, on platforms that use saturating
conversions (e.g. i965), this didn't work, because if the source value
was larger than the maximum representable int (0x7fffffff), then
converting it to an int would clamp it to 0x7fffffff.

This patch just adds the new opcode; further patches will adapt
optimization passes and back-ends to use it, and then finally the
ast_to_hir logic will be modified to emit the new opcode.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
75f409d75c i965/blorp: Implement source clipping.
This patch modifies blorp blits (which are used for MSAA) to properly
account for clipping of source coordinates.  Previously, if we
detected the possibility of source clipping, we would fall back to the
blit meta-op, which doesn't support MSAA and is very slow for depth
and stencil buffers.

Fixes piglit tests
"EXT_framebuffer_multisample/clip-and-scissor-blit" on i965/Gen6+.

Also substantially speeds up the Humble Bundle V game "Psychonauts" on
Gen6+ (without this patch, the game's depth buffer blits use the slow
blit meta-op).

Reviewed-by: Carl Worth <cworth@cworth.org>
2012-06-15 08:58:54 -07:00
Brian Paul
4d9f263d7c scons: add st_atom_array.c to the build 2012-06-15 09:31:33 -06:00
Christian König
92af184690 winsys/radeon: enable IB submission to compute rings v2
This allows to submit things to the compute only
rings on cayman+

v2: rebased on current master and actually make use
    of the new flag in evergreen_compute.c

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-15 09:52:38 +02:00
Marek Olšák
b4753dafcc st/mesa: atomize vertex array state
This moves the state validation to where all the other states are validated.
2012-06-15 03:15:50 +02:00
Maarten Lankhorst
6bb0151f1f winsys/radeon: Remove unnecessary pipe_thread_destroy in radeon_drm_cs_destroy
Fixes crash bug introduced with 210ddf0819 fd.o #49198
pthread_detach after a pthread_join is unneeded.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-06-15 03:01:23 +02:00
Marcin Slusarz
fc782bcbf0 nv50,nvc0: fix stream output target buffer leak
It manifests at exit as:
"WARNING: destroying GPU memory cache with some buffers still in use"
2012-06-14 23:38:28 +02:00
Christoph Bumiller
169a0ae40a nv50: disable stream output before reconfiguring it
If we don't, the GPU will just throw an ILLEGAL_OPERATION error.
2012-06-14 23:30:49 +02:00
Christoph Bumiller
ef51ce522b nv50/ir: handle NEG,ABS modifiers for short RCP encoding 2012-06-14 23:25:48 +02:00
Brian Paul
f677954e07 st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output
When drawing a depth image the fragment shader also needs to emit the
current raster color.

The new piglit drawpix-z test exercises this.

NOTE: This is a candiate for the 8.0 branch.
2012-06-14 14:37:31 -06:00
Brian Paul
8031aa134e docs: add info about shortlog_mesa.sh script 2012-06-14 14:37:31 -06:00
Paul Berry
4b7b4c46c5 glx/tests and mesa/tests: Update .gitignore files.
This patch updates .gitignore files to account for the new build
artifacts introduced by the following commits:

ae376f0 glx/tests: Rename test as glx-test
8fecdcc mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
a29ad2b mesa/tests: Add tests for the generated dispatch table
2012-06-14 10:08:57 -07:00
Christian König
eb024c7488 st/vdpau: fix YCbCr down/up-loads for buffers larger than requested
When the video buffer turns out to be larger than
requested by the application we shouldn't upload
or download more data into / from it original requested.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39309

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-14 17:54:04 +02:00
Alexander von Gluck IV
cb3054c849 scons: Fix Haiku binary optimizations
Haiku targets the Pentium or higher processor.
To ensure compatibility we can do march 586 and
mtune 686. Mesa will still use sse however if
the cpu supports it (and the stack is properly
aligned). These flags only effect the internal
compiler optimizations.
2012-06-14 08:08:17 -07:00
Andreas Boll
c1dcf9665c mesa: fix html in shortlog_mesa.sh script
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-14 08:25:42 -06:00
Brian Paul
51c9c67a2f mesa: added Ian's shortlog_mesa.sh script in bin/ 2012-06-14 08:22:54 -06:00
Brian Paul
5234b8902c svga: make svga_surface_needs_propagation() surface const 2012-06-14 08:20:40 -06:00
Brian Paul
92b65637ab svga: add svga_surface_const() cast wrapper 2012-06-14 08:20:40 -06:00
Brian Paul
bffb3997c3 svga: fix comment typo 2012-06-14 08:20:40 -06:00
Aaron Watry
fc3bac8a40 rbug: fix make process on Linux Mint 13 x64.
Previously, rbug_*.c would fail to compile with incomplete prototype
errors when make was run from the command line on my machine. My IDE
always built fine, and still does after this patch (Netbeans 7.1.2).

Most of the includes from files in gallium/auxiliary/rbug/* were
assuming an rbug/ subdirectory, while the headers are actually in the
same directory as the .c files.

The build error was also previously a problem for me on Ubuntu 11.10
and Mint 12.

Fixes build for the following configuration: ./autogen.sh
--enable-debug --enable-texture-float --with-gallium-drivers=r600
--with-dri-drivers=radeon --enable-r600-llvm-compiler

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-14 08:14:59 -06:00
José Fonseca
93a42d1314 windows/gdi: Remove GL_NV_register_combiners and GL_NV_vertex_array_range exports 2012-06-14 12:02:03 +01:00
Ian Romanick
4bfdc83135 glsl: Fix pi/2 constant in acos built-in function
In single precision, 1.5707963 becomes 1.5707962513 which is too
small.  However, 1.5707964 becomes 1.5707963705 which is just right.
The value 1.5707964 is already used in asin.ir.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-06-13 18:26:11 -07:00
Ian Romanick
f18d3fe0cb glapi: Remove GL_NV_vertex_array_range from the dispatch table
There is no GLX protocol for these functions.  Open-source Linux
driver have not supported this extension for many years, and it seems
unlikely at this point that this support will return.  There's no
reason to have slots for these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
69d1851757 glapi: Remove GL_NV_fence from the dispatch table
There is no GLX protocol for these functions.  No open-source Linux
driver has ever supported this extension, and it seems unlikely at
this point that one ever will.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
6db7cf29b5 glapi: Remove GL_NV_register_combiners from the dispatch table
There is no GLX protocol for these functions.  No open-source Linux
driver has ever supported this extension, and it seems unlikely at
this point that one ever will.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
a6002909a3 glapi: Remove GL_APPLE_texture_range from the dispatch table
There is no GLX protocol for these functions, and no Linux driver has
ever supported this extension.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
e62c4c765c glapi: Remove GL_SGIX_pixel_texture from the dispatch table
There is no GLX protocol for this function.  Open-source Linux driver
have not supported this extension for many years, and it seems
unlikely at this point that this support will return.  There's no
reason to have slots for this function in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
933714aabe glapi: Remove GL_SGIS_pixel_texture from the dispatch table
There is no GLX protocol for these functions, and no Linux driver has
ever supported this extension.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
a29ad2b421 mesa/tests: Add tests for the generated dispatch table
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:53 -07:00
Ian Romanick
8fecdcc587 mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:14:22 -07:00
Ian Romanick
e08f9080ff glapi: Add missing GL_EXT_texture_sRGB_decode enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
1c25984b23 glapi: Add missing GL_EXT_framebuffer_sRGB enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
75c516c959 glapi: Add missing GL_EXT_packed_float enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
ffbccb8cef glapi: Add missing framebuffer sRGB enum
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
2d8d85d7fb glapi: Add uniform buffer object enums
These are from OpenGL 3.1 and ARB_uniform_buffer_object.  I only added
them to 3.1 because that required the least work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
c5071825b0 glapi: Add missing enums for GL_NV_fragment_program
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
2485a1332e glapi: Add missing enums for GL_ARB_occlusion_query2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
22cdd7d817 glapi: Remove extraneous GL_ from TEXTURE_IMMUTABLE_FORMAT
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
21af1e9a0e glapi: Add missing enums for GL_ATI_fragment_shader
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
502449d71f glapi: Add texture swizzle enums
These are from OpenGL 3.3, ARB_texture_swizzle, and
EXT_texture_swizzle (with different names).  I only added them to 3.3
because that required the least work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
a4a0c1f09d glapi: Add a couple missing 3.0 enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
cc1e74bd19 glapi: Add missing _NV extension on COMBINE4
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
78b30938cc glapi: Add missing enums for GL_EXT_vertex_array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
8fcec14417 glapi: Add missing enums for GL_EXT_compiled_vertex_array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
3c22f79412 glx/tests: Add unit tests for generated code in indirect_init.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick
4c270f9c6b glx/tests: Add unit tests for generated code in indirect_size.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick
ae376f0567 glx/tests: Rename test as glx-test
This matches the existing test in src/glsl/tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick
2e8c866f10 glx: Move tests from tests/glx to src/glx/tests
This matches the organization of other unit tests in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Brian Paul
f68ab0398b util: add some comments, fix indentation 2012-06-13 08:52:40 -06:00
Matt Turner
ae419a0159 glsl: Transform dot product by a basis vector into a swizzle
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Matt Turner
9aa3fbcc2e glsl: Add is_basis function
Determines whether it's a basis vector, i.e., a vector with one element
equal to 1 and all other elements equal to 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Matt Turner
d7bef19c7f glsl: Check for zero vectors in ir_binop_dot
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Brian Paul
82ce93a8fd mesa: move variable declaration out of loop to fix MSVC build 2012-06-12 16:31:36 -06:00
Stéphane Marchesin
a74c4fb89d mesa: Fix bool-int mismatch
Also include stdbool for windows.
2012-06-12 15:22:48 -07:00
Antoine Labour
3c9fab8822 mesa: Fix hash table leak
When a value was replaced, the new key was strdup'd and leaked.
To fix this, we modify the hash table implementation to return
whether the value was replaced and free() the (now useless)
duplicate string.
2012-06-12 14:42:22 -07:00
Antoine Labour
e2e9b4b10f mesa: Free uniforms correclty.
This is an array of uniforms, not a single one.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Antoine Labour
53feb8ecdc meta: Cleanup the resources we allocate.
When we have multiple shared contexts, and one of them is
long-running, this will lead to never freeing those resources
since they are shared. Instead, free them right away on context
destruction since we know the other context isn't using them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Stéphane Marchesin
0256edd709 glx: Handle a null reply in QueryVersion.
Works around crashes when X connections break.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Michel Dänzer
1657dec72d radeonsi: Don't always re-compile shaders after they're bound. 2012-06-12 20:18:24 +02:00
Dave Airlie
6d289390ec st/xorg: Fix crash on startup.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-06-12 18:48:28 +02:00
Michel Dänzer
90c6eacdb4 radeonsi: Use linear instead of constant interpolation for now.
Constant interpolation still hangs the GPU for some reason.
2012-06-12 18:48:28 +02:00
Thomas Stellard
4c418cf1a3 radeonsi: Handle SUB_f32.
Signed-off-by: Thomas Stellard <tom.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-06-12 18:48:16 +02:00
Michel Dänzer
4c4ef9c29a radeonsi: Only dump shaders with environment variable RADEON_DUMP_SHADERS=1. 2012-06-12 18:33:54 +02:00
Eric Anholt
7b11051a28 mesa: Build git_sha1.h before computing dependencies.
Otherwise, version.c doesn't get a dependency on it in a clean build,
and then it doesn't necessarily get generated before version.c is
compiled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50976
Reviewed-by: Jakob Bornecrantz jakob@vmware.com
2012-06-12 08:10:41 -07:00
Andreas Boll
fd64b39727 docs: whitespaces cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
5dc59455f9 docs: remove some superfluous <p> tags
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
8155ed37a1 docs: remove unused table styles
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
908f788503 docs: remove unused anchor links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
210a27d8c3 docs: prefer lowercase html tags
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
cc4188895b docs: use id instead of <a name>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
f85d23cea4 docs/subset-A.html: fix markup
fixes tidy warnings:

line 11 column 1 - Warning: <center> isn't allowed in <h1> elements
line 10 column 1 - Info: <h1> previously mentioned
line 11 column 34 - Warning: discarding unexpected </center>
line 14 column 1 - Warning: <center> isn't allowed in <h2> elements
line 13 column 1 - Info: <h2> previously mentioned
line 13 column 1 - Warning: missing </h2> before <h3>
line 18 column 1 - Warning: discarding unexpected </center>
line 19 column 1 - Warning: discarding unexpected </h2>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
2d7f319a0a docs/news.html: use proper markup
fixes tidy warnings:

line 1227 column 9 - Warning: missing <li>
line 1228 column 17 - Warning: missing <li>
line 1235 column 25 - Warning: missing <li>
line 1259 column 17 - Warning: missing <li>
line 1267 column 9 - Warning: missing <li>
line 1359 column 9 - Warning: missing <li>
line 1361 column 55 - Warning: discarding unexpected </i>
line 1354 column 1 - Warning: trimming empty <p>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
df2be226d9 docs: fix html end/start tags
for more well-formed html

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
703a662c15 docs: escape special html chars
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:29 -06:00
Andreas Boll
ecd5c7ceb8 docs: consolidate html header and footer
add doctype
add character encoding
add missing <head> tag
unify html header and footer

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:29 -06:00
Kenneth Graunke
45c21f852e mesa: Unbind GL_TEXTURE_BUFFER on DeleteBuffers.
Fixes oglconform's tbo/basic.buffer.delete test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-11 13:30:32 -07:00
Kenneth Graunke
bbb67c3efc mesa: Make glPrimitiveRestartIndex execute immediately in display lists.
From the GL_NV_primitive_restart spec:
"PrimitiveRestartIndexNV is not compiled into display lists, but is
 executed immediately."

Prior to this patch, calls to glPrimitiveRestartIndex would hit the noop
dispatch stub.

+2 oglconforms.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-11 13:28:23 -07:00
Kenneth Graunke
a75e704326 mesa: Check for a negative "size" parameter in glCopyBufferSubData().
From the GL_ARB_copy_buffer spec:
"An INVALID_VALUE error is generated if any of readoffset, writeoffset,
 or size are negative [...]"

Fixes oglconform's copybuffer/negative.CNNegativeValues test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-06-11 13:27:36 -07:00
Kenneth Graunke
4a5d020ee3 automake: Add AM_PROG_AR before LT_INIT to silence a lot of warnings.
The warnings appear to occur with newer automake (probably 1.12).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-11 13:27:36 -07:00
José Fonseca
ea606ee7b4 scons: Fix scons build. 2012-06-11 19:38:07 +01:00
Brad King
f3cdcb839f configure.ac: Add --with-(gl|glu|osmesa)-lib-name options
These allow one to mangle the library names, without also mangling the
symbol names, to make them distinct from other GL libraries on the
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
337d9c955b glsl: Put a bunch of optimization visitors under anonymous namespaces.
Because these classes are used entirely from their own source files
and not from separate DSOs, the linker gets to produce massively less
code.  This cuts about 13k of text in the libdricore case.  In the
non-libdricore case, the additional linkage information allows the
compiler to inline some code, so libglsl.a size actually increases by
about 300 bytes.

For a dricore build, improves shader_runner runtime on
glsl-fs-copy-propagation-texcoords-1 by 0.21% +/- 0.03% (n=353574,
outliers removed).  No statistically significant difference with n=322
on glslparsertest on a yofrankie shader intended to test compiler
performance.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
279efce8bb automake: Merge the dricore libglsl build into libdricore.
Now we have just one library of "all of Mesa core" instead of both
libdricore and libglsl that drivers link against.

I did this change in a sort of nonrecursive make fashion: the
generated files are still produced in the non-automake build, like the
rest of dricore, but the GLSL files are stuffed into libdricore
without building a convenience library in src/glsl (even though we
could now).  This would make a bit more sense if glsl was just another
dir under src/mesa, because right now I had to contort the prefix
variable name to look another ../ level up.
2012-06-11 09:28:00 -07:00
Eric Anholt
446faee094 automake: Add a prefix variable for libglsl sources.
See e86c40a84d for reasoning.  In the
process I did s/:=/=/ to shut up automake about nonportable make syntax.
2012-06-11 09:28:00 -07:00
Eric Anholt
7edbf4b323 automake: Convert src/Makefile to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
07abd913b6 automake: Move top-level makefile to automake.
This is part of a series to fix our build issues in the automake case
by hooking up the automatic Makefile regeneration support.  The
extract_git_sha1 is moved into src/mesa/Makefile so that we get
correct dependency generation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
743e505315 automake: Globally add stub automake targets to the old Makefiles.
I tried to update all the old Makefiles that included the default
config to be sure they had a default target if they didn't previously
have one, since this new all target will always point at it.  Almost
everything had one.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
4038dda6cd mesa: Move the version information right into configure.ac.
Nothing else called version.mk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
0cc216676c automake: Remove the old static configs system.
With the incremental automake conversion, we'd broken those that
included glx or egl.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Tapani Pälli
d5c1801a01 android: fix the build
Some more of the files are now autogenerated, this caused build breakage,
patch adds generation of these missing files. Patch also changes existing
make so that the files are created to be part of the local source
(not intermediate directory, this causes several problems).

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-06-11 09:27:59 -07:00
Michael Karcher
e2c08e824b i915g: Fix depth/stencil glClear
This patch fixes a copy/paste error and masking of depth/stencil (stencil
is in the top 8 bits), and makes glean/readPixSanity happy.

Both the stencil and the depth buffer piglit test also pass if
glClear(DEPTH | STENCIL) is executed instead of
glClear(DEPTH)/glClear(STENCIL).

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-10 16:33:42 +02:00
Kenneth Graunke
306c9f0c57 mesa: Fix "glCopyBuffserSubData" typos in error messages and comments.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 22:04:34 -07:00
Eric Anholt
a018747ac8 glsl: Clean up warnings about deleting classes without virtual destructors.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 12:42:38 -07:00
Marcin Slusarz
ea055e19c2 glsl: fix deref_hash memory leak in constant_expression_value
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 21:00:40 +02:00
Andreas Boll
ca9977d5c6 glcpp: .gitignore cleanup
*.o, *.lo and *~ are already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 11:18:55 -07:00
Andreas Boll
6224e90247 glapi: .gitignore cleanup
remove archaic .cvsignore
*.pyo is already in toplevel .gitignore
*.pyc is already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 11:18:38 -07:00
Roland Scheidegger
dfbb18bdb5 gallivm: Fix calculating rho for 3d textures for the single-quad case
Discovered by accident, this looks like a very old typo bug.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-08 17:46:57 +01:00
Kenneth Graunke
529476b5e4 i965: Add forgotten bitcast operations in brw_fs_channel_expressions.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:22:11 -07:00
Paul Berry
9fd0e76a19 i965/blorp: allow all buffer formats provided src and dst match.
Previously, blits using the "blorp" mechanism only worked for 8-bit
RGBA color buffers, 24-bit depth buffers, and 8 bit stencil buffers.
This was not enough, because the blorp mechanism must be used for
blitting whenever MSAA is in use.  This patch allows all formats to be
used, provided the source and destination formats match.

So far I have confirmed that the following formats work properly with
MSAA:
- GL_RGB
- GL_RGBA
- GL_ALPHA
- GL_ALPHA4
- GL_ALPHA8
- GL_R3_G3_B2
- GL_RGB4
- GL_RGB5
- GL_RGB8
- GL_RGB10
- GL_RGB12
- GL_RGB16
- GL_RGBA2
- GL_RGBA4
- GL_RGB5_A1
- GL_RGBA8
- GL_RGB10_A2
- GL_RGBA12
- GL_RGBA16

Fixes piglit tests "EXT_framebuffer_multisample/formats {2,4}" on
Sandy Bridge and Ivy Bridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Paul Berry
530bda2aac i965/blorp: Implement logic for additional buffer formats.
Previously the blorp engine only supported RGBA8 color buffers and
24-bit depth buffers.  This patch adds support for any color buffer
format that is supported as a render target, and for 16-bit and 32-bit
depth buffers.

This required threading the brw_context struct through into
brw_blorp_surface_info::set() so that it can consult the
brw->render_target_format array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Paul Berry
9dbd0b6778 i965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.
Even though brw_blorp_surface_info is derived from brw_blorp_mip_info,
this function doesn't need to be virtual, because it is never accessed
through a base class pointer.  Making the function non-virtual will
allow it to take additional parameters in the brw_blorp_surface_info
case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Paul Berry
040d015734 i965/blorp: Refactor surface format determination.
This patch moves the responsibility for deciding on the format of the
source and destination surfaces from the
gen{6,7}_blorp_emit_surface_state() functions to
brw_blorp_surface_info::set(), which is shared between Gen6 and Gen7.
This will make it possible to add support for more surface formats
without code duplication.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Kenneth Graunke
05790746df i965: Enable the GL_ARB_shader_bit_encode extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:17:21 -07:00
Olivier Galibert
a83be8b6d7 st/mesa: Finally activate the ARB_shader_bit_encoding extension.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:17:14 -07:00
Olivier Galibert
e16b0a51be glsl: Bitwise conversion operator support in the software renderers.
TGSI doesn't need an opcode, since registers are untyped (but beware
once doubles come into the scene).  Mesa IR doesn't handle native
integers, so trying to handle them there is worthless, the case
entries are only added for warning reasons.

It was only tested with softpipe, since llvmpipe doesn't support glsl
1.3 yet.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
abe9767553 glsl: Bitwise conversion operator support in ir_constant_expression.
A "test_out = floatBitsToUint(-1.0);" fired through the GLSL compiler
gives a correct "(assign (x) (var_ref test_out)
(constant uint (3212836864)))"

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
1b8a3aad09 glsl: Bitwise conversion operator support in ir_validate.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
4fab150559 glsl: Bitwise conversion operator support in ir_expression.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:17 -07:00
Olivier Galibert
500dcbb1aa glsl: New unary opcodes for ARB_shader_bit_encoding support.
The opcodes are bitcast_f2u, bitcast_f2i, bitcast_i2f and bitcast_u2f.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:17 -07:00
Olivier Galibert
199771bc32 glsl: Scaffolding for ARB_shader_bit_encoding.
That adds support for activating the extension.  It doesn't actually
*do* anything yet, of course.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:00 -07:00
Kenneth Graunke
f8d40deea5 mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.
From the issues section of the GL_ARB_texture_compression_rgtc extension:

15) What should glGetTexLevelParameter return for
    GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1
    formats?  What should glGetTexLevelParameter return for
    GL_TEXTURE_BLUE_SIZE for the RGTC2 formats?

    RESOLVED:  Zero bits.

    These formats always return 0.0 for these respective components
    and have no bits devoted to these components.

    Returning 8 bits for red size of RGTC1 and the red and green
    sizes of RGTC2 makes sense because that's the maximum potential
    precision for the uncompressed texels.

Thus, we need to return 8 bits for GL_TEXTURE_RED_SIZE on all RGTC formats
and 8 bits for GL_TEXTURE_GREEN_SIZE on RGTC2 formats.  BLUE should be 0.

Fixes oglconform/rgtc/advanced.texture_fetch.tex_param.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-07 00:01:40 -07:00
Kenneth Graunke
3603fdcebf glsl: Hook up loop_variable_state destructor to plug a memory leak.
While ~loop_state() is already freeing the loop_variable_state objects
via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor
was never getting called, so the hash table inside loop_variable_state
was never getting destroyed.

Fixes a memory leak in any shader with loops.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:01:40 -07:00
Tom Stellard
5f3f63b76d radeon/llvm: Emulate RECIP_UINT instruction on Cayman 2012-06-06 20:51:00 -04:00
Tom Stellard
0c9f5f22d5 radeon/llvm: Remove some duplicate code in the R600 CodeEmitter 2012-06-06 20:51:00 -04:00
Tom Stellard
9c46cb2368 radeon/llvm: Fix MULLO* instructions on Cayman
On Cayman, the MULLO* instructions must fill all slots in an
instruction group.
2012-06-06 20:50:36 -04:00
Tom Stellard
0c4b19ac63 r600g: Compute support for Cayman 2012-06-06 10:49:36 -04:00
Dave Airlie
2bb2e6a6e3 xorg: port to new compat API.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-06 15:22:50 +01:00
Brian Paul
ec19bdd16c mesa: consolidate internal glCompressedTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
e8fdd0e0d5 mesa: consolidate internal glCompressedTexImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
cd9ab2584f mesa: consolidate internal glCopyTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
e42d00b3f4 mesa: consolidate internal glTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:55:59 -06:00
Brian Paul
8f5fffe75d mesa: consolidate internal glTexImage1/2/3D code
The functions for handling 1D, 2D and 3D texture images were nearly
identical.  This folds them all together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:55:59 -06:00
Brian Paul
3a62e8bcac translate_test: add support for half floats
Fixes assertion reported in
https://bugs.freedesktop.org/show_bug.cgi?id=44519
but there's still failing cases.
2012-06-06 07:55:59 -06:00
Brian Paul
adc58e96d0 docs: remove documentation of old Makefile system
It's going away in the near future.
2012-06-06 07:55:59 -06:00
Tom Stellard
d4942eb9fa radeon/llvm: Remove obselete hooks for the ConvertToISA pass
We can't remove this pass yet, because we need it to convert AMDIL
registers in BRANCH* instructions, but we don't need it for
instruction conversion any more.
2012-06-06 13:46:04 -04:00
Tom Stellard
edceed1b9a radeon/llvm: Remove AMDIL MOVE* instructions 2012-06-06 13:46:04 -04:00
Tom Stellard
f81e4663a7 radeon/llvm: Add isMov() to AMDILInstrInfo
This enables the CFGStructurizer to work without the AMDIL::MOV*
instructions.
2012-06-06 13:46:04 -04:00
Tom Stellard
1777c99bff radeon/llvm: Remove deadcode from the AMDILISelLowering class 2012-06-06 13:46:03 -04:00
Tom Stellard
8cc9b463de radeon/llvm: Don't lower RETURN to S_ENDPGM on SI
Instead create an S_ENDPGM instruction in the CodeEmitter and emit
it after all the other instructions.
2012-06-06 13:46:03 -04:00
Tom Stellard
de7366701d radeon/llvm: Remove AMDIL VCREATE* instructions
This obsoletes the AMDGPULowerInstruction pass.
2012-06-06 13:46:03 -04:00
Tom Stellard
8d53ddb375 radeon/llvm: Remove AMDIL LOADCONST* instructions
This obsoletes the R600LowerInstruction and SIPropagateImmReads passes.
2012-06-06 13:46:03 -04:00
Marcin Slusarz
17e047242e nouveau: fix scratch buffer leak
...and create common function for destroying nouveau_context
2012-06-05 23:58:43 +02:00
Marcin Slusarz
3232a86efe nv50: fix nv50_stream_output_state leak 2012-06-05 23:58:43 +02:00
Marcin Slusarz
cfa7cb991c nv50: fix symbol table memory leak 2012-06-05 23:58:43 +02:00
Kenneth Graunke
2f18698220 i965/fs: Fix user-defined FS outputs with less than four components.
OpenGL allows you to declare user-defined fragment shader outputs with
less than four components:

    out ivec2 color;

This makes sense if you're rendering to an RG format render target.

Previously, we assumed that all color outputs had four components (like
the built-in gl_FragColor/gl_FragData variables).  This caused us to
call emit_color_write for invalid indices, incrementing the output
virtual GRF's reg_offset beyond the size of the register.

This caused cascading failures: split_virtual_grfs would allocate new
size-1 registers based on the virtual GRF size, but then proceed to
rewrite the out-of-bounds accesses assuming that it had allocated enough
new (contiguously numbered) registers.  This resulted in instructions
that accessed size-1 GRFs which register numbers beyond
virtual_grf_next (i.e. registers that were never allocated).

Finally, this manifested as live variable analysis and instruction
scheduling accessing their temporary array with an out of bounds index
(as they're all sized based on virtual_grf_next), and the program would
segfault.

It looks like the hardware's Render Target Write message requires you to
send four components, even for RT formats such as RG or RGB.  This patch
continues to use all four MRFs, but doesn't bother to fill any data for
the last few, which should be unused.

+2 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
cb18472eca i965/vs: Fix texelFetchOffset() on pre-Gen7.
Commit 4650aea7a5 fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+18 piglits on Sandybridge.

NOTE: This and 4650aea7a5 are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
217b62bf00 i965/fs: Fix texelFetchOffset() on pre-Gen7.
Commit f41ecade7b fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+15 piglits on Sandybridge.

NOTE: This and f41ecade7b are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
7fde071f04 meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().
This isn't saved/restored by _mesa_meta_begin, so we need to do it
manually (like we do for the read/draw framebuffers).  Additionally,
we neglected to re-bind before the glRenderbufferStorage call.

+13 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
3edd2ba22b mesa: Unbind ARB_transform_feedback2 binding points on Delete too.
DeleteBuffer needs to unbind from these binding points as well, based on
the same rationale as the previous patch.

+51 oglconforms (together with the last patch).

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
05b086ce93 mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.
_mesa_lookup_bufferobj returns NULL for 0, which caused us to say
"there's no such buffer object" and raise an error, rather than
correctly binding the shared NullBufferObj.

Now you can unbind your buffers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:33 -07:00
Kenneth Graunke
cb8ed93dd0 mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
According to the GL 3.1 spec, section 2.9 ("Buffer Objects"):
"If a buffer object is deleted while it is bound, all bindings to that
 object in the current context (i.e. in the thread that called
 DeleteBuffers) are reset to zero."

The code already checked for a number of cases, but neglected these
newer binding points.

+21 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:33 -07:00
Kenneth Graunke
25edfbfccf glsl/builtins: Fix textureGrad() for Array samplers.
We were incorrectly assuming that the coordinate's dimensionality is
equal to the gradient's dimensionality.  For array types, the coordinate
has one more component.

Fixes 12 subcases of oglconform's glsl-bif-tex-grad test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:33 -07:00
Kristian Høgsberg
2c4f6ceeb4 configure.ac: Fail if egl x11 platform dependencies are not available
Currently, if you pass --with-egl-platforms=x11 but xcb-dri2 isn't available
we just silently fail and disables building the EGL DRI2 driver.

This commit cleans up the EGL platfrom checking and fails if a selected
platform can't find its required dependencies.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-05 14:34:33 -04:00
Alex Deucher
75f9d24ac4 r600g: add new Trinity PCI ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:16:42 -04:00
Alex Deucher
6ce298f9ce r600g: add new Sumo, Palm, BTC pci ids
Note this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:15:16 -04:00
Alex Deucher
01b7eb7c74 radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:12:21 -04:00
Paul Berry
555e00fdc3 Fix .gitignore for ralloc-test
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-04 18:11:43 -07:00
Vinson Lee
105f307d90 st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fix uninitialized scalar field defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-06-02 13:18:40 -07:00
Kenneth Graunke
adbfc4a09a i965: Implement texture buffer objects on Gen6.
Commit a07cf3397e added support for TBOs
on Gen7, but missed Gen6.

Passes piglit -t texture_buffer and oglconform's buffermapping
basic.read.texture tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-02 12:02:42 -07:00
Kenneth Graunke
608c3d2083 mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).
According to Table 6.17 in the GL 2.1 specification, DEPTH_TEXTURE_MODE,
TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC need to be restored on
glPopAttrib(GL_TEXTURE_BIT).

Makes a number of oglconform tests happier.

v2: Make restoration conditional on the ARB_shadow and ARB_depth_texture
    extensions, as suggested by Brian.  I'm not sure that any
    implementations still remain that don't support those, but why not?

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-02 12:02:42 -07:00
Eric Anholt
775ba11dcd automake: Connect the libdricore target to make clean.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50480
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-01 16:25:39 -07:00
Tapani Pälli
a9cfd95c24 automake: use -m32 in CCASFLAGS when using --enable-32-bit
this fixes libdricore directory build with --enable-32-bit on a x86_64 system

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-01 16:25:39 -07:00
Tom Stellard
0ebf2318b3 radeon/llvm: Fix VTX_READ patterns
The VTX_READ instructions were using the ADDRParam ComplexPattern which
allows a load instruction's offset to be a register, but VTX_READ
instructions can only handle an immediate offset.

Also, the load_param pattern fragment had an erroneous return true;
statement that was causing it to match the wrong load instructions.
2012-06-01 16:52:26 -04:00
Tom Stellard
c108831d44 radeon/llvm: Emit 2 bytes for vertex fetch offsets 2012-06-01 16:52:26 -04:00
Tom Stellard
85a68814ee radeon/llvm: Only use indirect (vertex fetch) parameters for kernels
Kernel parameters can only be retrieved via vertex fetchs.  Direct
parameters (i.e parameters stored in the constant buffer) are not
supported yet.
2012-06-01 16:52:26 -04:00
Kenneth Graunke
fb79ecb62d intel: Change vendor string to "Intel Open Source Technology Center".
Tungsten Graphics has not existed for several years, and the majority of
ongoing development and support is done by Intel.  I chose to include
"Open Source Technology Center" to distinguish it from, say, the closed
source Windows OpenGL driver.

The one downside to this patch is that applications that pattern match
against "Intel" may start applying workarounds meant for the Windows
driver.  However, it does seem like the right thing to do.

This does change oglconform behavior.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-01 14:24:57 -07:00
Ian Romanick
adfe531841 glsl: Remove spurious printf messages
These look like debug messages from the switch-statement development.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-06-01 12:27:04 -07:00
Tom Stellard
d6c2d3722d radeon/llvm: Eliminate CFGStructurizer dependency on AMDIL instructions
Add some hooks to the R600,SI InstrInfo and RegisterInfo classes, so
that the CFGStructurizer pass can run without any relying on AMDIL
instructions.
2012-06-01 11:28:11 -04:00
Tom Stellard
65917004d9 radeon/llvm: Change prefix on tablegen files to AMDGPU 2012-06-01 11:28:11 -04:00
Tom Stellard
afea59bf65 radeon/llvm: Remove deadcode from the R600LowerInstructions pass 2012-06-01 11:28:10 -04:00
Tom Stellard
883a0af53a radeon/llvm: Remove AMDIL GLOBALSTORE* instructions 2012-06-01 11:28:10 -04:00
Tom Stellard
f2781271c7 radeon/llvm: Remove AMDIL GLOBALLOAD* instructions 2012-06-01 11:28:10 -04:00
Adam Rak
6a829a1b72 r600g: compute support for evergreen
Tom Stellard:
  - Updated for gallium interface changes
  - Fixed a few bugs:
    + Set the loop counter
    + Calculate the correct number of pipes
  - Added hooks into the LLVM compiler
2012-06-01 11:28:10 -04:00
Tom Stellard
46a13b3b11 clover: Add function for building a clover::module for non-TGSI targets v6
v2:
  -Separate IR type and LLVM triple
  -Do the OpenCL C->LLVM IR and linking steps for all PIPE_SHADER_IR
   types.

v3:
  - Coding style fixes
  - Removed compatibility code for LLVM < 3.1
  - Split build_module_llvm() into three functions:
    compile(), link(), and build_module_llvm()

v4:
  - Use struct pipe_compute_program

v5:
  - Don't malloc memory for struct pipe_llvm_program

v6:
  - Fix serialization of llvm bytecode

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
f2606413ec gallium: Add struct pipe_llvm_program_header v3
This structure is used as a header that precedes LLVM bytecode programs
that are passed to the drivers.

v2:
  - s/pipe_compute_program/pipe_llvm_program/

v3:
  - Rename to struct pipe_llvm_program_header
  - Drop the char * prog member

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
741463e18d clover: Remove target argument from compile_program_tgsi()
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
d724190bce clover: Add constructors to some of the module classes v3
This is for the llvm code that can't use extended initializers.

v2:
  - Use const references for vector arguments
  - Move constructor defs before data members
  - Initialize all values in the default constructors

v3:
  - Fix typo
2012-06-01 11:28:09 -04:00
Tom Stellard
5cc08efe8f clover: Add necessary flags to libclllvm_la_CXXFLAGS
$(LLVM_CFLAGS) for LLVM defines
-DLIBCLC_PATH for libclc path
-DCLANG_RESOURCE_DIR for clang includes
$(DEFINES) for -DHAVE_LLVM
2012-06-01 11:28:09 -04:00
Tom Stellard
7a6b5d42d8 clover: Link to the necessary LLVM and Clang libs 2012-06-01 11:28:09 -04:00
Tom Stellard
d416780f39 configure.ac: Add variables LLVM_CPPFLAGS and LLVM_LIBDIR 2012-06-01 11:28:09 -04:00
Tom Stellard
c79e7668b2 configure.ac: Add option for libclc path 2012-06-01 11:28:09 -04:00
Tom Stellard
613323b256 clover: Add a function for retrieving a device's preferred ir v3
A device now has two function for getting information about the IR
it needs to return.

ir_format() => returns the preferred IR
ir_target() => returns the triple for the target that is understood by
                 clang/llvm.

v2:
  - renamed ir_target() to ir_format()
  - renamed llvm_triple() to ir_target()

v3:
  - Remove unnecessary include
  - Do proper conversion from std::vector<char> to std::string

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:09 -04:00
Francisco Jerez
c4c51153bc gallium/compute: Add PIPE_COMPUTE_CAP_IR_TARGET v4
v2: Tom Stellard
  - Update CAP description

v3: Tom Stellard
  - TGSI targets should pass an empty string for this CAP.

v4: Tom Stellard
  - TGSI targets can ignore this CAP.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:27:53 -04:00
Tom Stellard
1d118a2a76 gallium: Add PIPE_SHADER_IR_LLVM to enum pipe_shader_ir v2
v2:
  - s/PIPE_SHADER_IR_LLVM_R600/PIPE_SHADER_IR_LLVM/

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:26:57 -04:00
Tom Stellard
d85e512374 configure.ac: Add HAVE_OPENCL AM_CONDITIONAL v2
v2:
  - Drop HAVE_OPENCL variable for non-automake builds
  - s/HAVE_OPENCL/HAVE_GALLIUM_COMPUTE

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:26:57 -04:00
Brian Paul
091a61a8d5 scons: generate the glapitable.h file too 2012-06-01 08:27:21 -06:00
Brian Paul
8009fca501 svga: fix saturated TEX instructions
TEX instructions can't do saturation.  Do the TEX into a temp reg w/out
saturation, then do a MOV_SAT.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-31 12:54:04 -06:00
Brian Paul
dff36e900c scons: add code to generate the various GL API files
This fixes recent build breakage when we began building the generated
API files from xml as part of the normal build process.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
2012-05-31 09:40:35 -06:00
Brian Paul
185ed21058 draw: simplify index buffer specification
Replace draw_set_index_buffer() and draw_set_mapped_index_buffer() with
draw_set_indexes() which simply takes a pointer and an index size.
2012-05-31 09:40:35 -06:00
Kenneth Graunke
151bf6e6cf glsl/tests: Plumb $(PYTHON2) and $(PYTHON_FLAGS) into optimization-test.
Some distributions (like Arch Linux) make /usr/bin/python Python 3,
rather than Python 2.  Since compare_ir uses /usr/bin/env python,
such systems will fail to run optimization-test, causing 'make check' to
always fail.

Automake's TESTS_ENVIRONMENT variable provides a mechanism to run
programs or set environment variables in the test environment.
Ideally, I think we would want to use AM_TESTS_ENVIRONMENT, since
TESTS_ENVIRONMENT is supposed to be user-overridable.  However, it isn't
supported using the default/serial test runner.

Fixes 'make check' on Arch Linux and Gentoo.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-05-30 21:49:41 -07:00
Kenneth Graunke
a44ccdc876 ralloc: Add some basic unit tests.
I started writing unit tests for a new piece of code, and discovered
they all failed due to a bug in ralloc.  Clearly it needs a test suite.

v2: Rename to 'ralloc-test' and fix copyright date.  (idr review)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 21:49:41 -07:00
Kenneth Graunke
1559b2e2d7 ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.
If an object is allocated out of the NULL context, info->parent will be
NULL.  Using the PTR_FROM_HEADER macro would be incorrect: it would say
that ralloc_parent(ralloc_context(NULL)) == sizeof(ralloc_header).

Fixes the new "null_parent" unit test.

NOTE: This is a candidate for the 7.9, 7.10, 7.11, and 8.0 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 21:49:40 -07:00
Kenneth Graunke
2224fb6047 automake: Check for 'indent' and fall back to 'cat' if not found.
The glapi generator code uses indent to produce more readable code.
However, we don't want to make GNU indent a hard build dependency; check
for it in configure.ac and fall back to 'cat' if it's not available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50484
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
2012-05-30 13:39:30 -07:00
Oliver McFadden
ff3eef1aff mesa: don't compile integer clear shaders for unsupported APIs
Discovered while running the Khronos conformance test suite and
receiving "implementation error: meta program compile failed."

This bug was recently introduced by the i965 clear patch set and would
only be detected while using the ES2 API and only on gen6+ hardware.

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 15:20:34 +03:00
Paul Berry
47b64c9290 i965/blorp: Implement destination clipping and scissoring
This patch implements clipping and scissoring of the destination rect
for blits that use the blorp engine (e.g. MSAA blits).
2012-05-29 15:35:35 -07:00
Eric Anholt
6a15790632 mesa: Clean up some dricore-related detritus in the old Makefile.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:51 -07:00
Eric Anholt
f9d1562f35 automake: Convert dricore building to automake.
This is performed in a subdirectory to avoid needing to convert all of
src/mesa/Makefile in one go.

I can now cherry-pick a commit containing glapi XML changes, do "(cd
src/mapi/glapi/gen && make) && make", and get a working driver.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:48 -07:00
Eric Anholt
e86c40a84d automake: Add a prefix variable to the common sources lists.
In order to do the minimal change for libdricore conversion to
automake, I need to put its Makefile.am in a subdirectory.  Automake
gets whiny/broken if you use GNU make features like "addprefix" or
"$(FILES:%=../%)" to munge your *_SOURCES.  So, use a plain old
variable to be able to substitute in that "../"

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:45 -07:00
Eric Anholt
7d7fe1b037 automake: Rename variables in sources.mak to be automake compatible.
*_SOURCES is reserved for files lists for particular automake targets.
 Also, "-" in the variable names is not allowed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:42 -07:00
Eric Anholt
b284d4773b mesa: Remove generated source files during make clean.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:40 -07:00
Eric Anholt
79273b1a7a glapi: Enable silent rules for generation when used from automake.
This variable won't be set when called from non-automake makefiles,
but it cleans up shared-glapi's output.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:37 -07:00
Eric Anholt
559d592448 shared-glapi: Don't forget to clean our built file.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:33 -07:00
Eric Anholt
26eaee3245 mesa: Restore installing of libGL for non-dri builds.
Reported-by: Sven Joachim <svenjoac@gmx.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:30 -07:00
Eric Anholt
0ce0f7c0c8 mesa: Remove the generated glapi from source control, and just build it.
Mesa already always depends on python to build.  The checked in
changes are not reviewed (because any trivial change rewrites the
world).  We also have been pushing commits between xml change and
regen where at-build-time xml-generated code disagrees with committed
xml-generated code.  And worst of all, sometimes we ("I") check in
*stale* xml-generated code.

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-29 11:51:57 -07:00
Kurt Roeckx
f92b2e5e90 i830: Fix crash for GL_STENCIL_TEST in i830Enable()
commit 87f12bb2d9 tried to fix rb->mt
being NULL, but change this case wrong.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 11:33:02 -07:00
Marcin Slusarz
8924133627 nv50: hook up forgotten short constant buffer upload method
Fixes crash in xorg st.
2012-05-29 20:24:45 +02:00
Tom Stellard
83169900fb radeon/llvm: Update and fix some comments 2012-05-29 11:59:01 -04:00
Tom Stellard
89ece086bc radeonsi: Remove use.sgpr* intrinsics, use load instructions instead
We now model loading uses sgpr values with LLVM IR load instructions that
use the USER_SGPR address space.

The definition of the sgpr parameter to the use_sgpr() helper function
in radeonsi_shader.c has changed so that you can pass raw sgpr values
rather than having to divide the sgpr value you want to use by the dword
width of the type you want to load.
2012-05-29 11:55:53 -04:00
Tom Stellard
467f51613e radeonsi: Handle TGSI CONST registers
We now emit LLVM load instructions for TGSI CONST register reads,
which are lowered in the backend to S_LOAD_DWORD* instructions.
2012-05-29 11:55:52 -04:00
Tom Stellard
32b83e0366 radeon/llvm: Remove AMDILIntrinsicInfo::GetDeclaration fuction body
This function was causing compile errors in the tablegen'd code for
some intrinsic definitions.  I don't think we really need this function,
so I'm removing the function body just as a temporary solution.  I'll
look into removing the entire AMDILIntrinsicInfo class later.
2012-05-29 11:55:52 -04:00
Tom Stellard
49fb99bd13 radeon/llvm: Remove AMDILTargetMachine 2012-05-29 11:55:52 -04:00
Christoph Bumiller
94a25b216b nouveau: unreference fences on resource destruction 2012-05-29 17:00:20 +02:00
Christoph Bumiller
1a21e36b68 nvc0: optimize blend cso by checking which by-RT data actually differs
Can save about 200 bytes of command buffer space.
2012-05-29 17:00:18 +02:00
Christoph Bumiller
f09ee76c98 nvc0: don't upload UCPs if the shader doesn't use them 2012-05-29 17:00:15 +02:00
Christoph Bumiller
79eed0d224 nvc0/ir: allow 64-bit constant loads on nve4
Looks like only 128-bit access doesn't work.
2012-05-29 17:00:10 +02:00
Christoph Bumiller
40c224a573 nvc0/ir: fix texture barrier insertion to prevent WAW hazards
Fixes, for instance, object highlighting in Diablo 3 (wine).
2012-05-29 15:01:41 +02:00
Christoph Bumiller
0d818cdacc nvc0/ir: TEX doesn't support JOIN modifier either 2012-05-29 15:01:41 +02:00
Christoph Bumiller
f80c2874ec gallium: add st_api feature mask to prevent advertising MS visuals
v2: use a define for the maximum sample count
v3: also test odd sample counts (r300 supports MS3)

While multisample renderbuffers are supported by mesa, MS visuals
are not, so we need a way to tell dri/st not to advertise them even
if the gallium driver does support multisampled surfaces.

Otherwise applications selecting these non-functional visuals would
run into trouble ...

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-29 15:01:41 +02:00
Roy Spliet
6404095fba nv30: Fix generic passing to fragment program in NV34. 2012-05-25 22:42:54 +02:00
Christoph Bumiller
384ef28cb3 nv30: handle user index buffers 2012-05-25 22:42:54 +02:00
Tom Stellard
704eac0916 radeon/llvm: Use a custom inserter for MASK_WRITE 2012-05-25 15:40:59 -04:00
Tom Stellard
4863477e22 radeon/llvm: Use tablegen pattern to lower bitconvert 2012-05-25 15:40:59 -04:00
Tom Stellard
667cdba211 radeon/llvm: Use a custom inserter to lower FNEG 2012-05-25 15:40:58 -04:00
Tom Stellard
d784bc7740 radeon/llvm: Use a custom inserter to lower CLAMP 2012-05-25 15:40:58 -04:00
Tom Stellard
17f8528923 radeon/llvm: Use a custom inserter to lower FABS 2012-05-25 15:40:58 -04:00
Kai Wasserbäch
2df2c31087 r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50318

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2012-05-25 20:41:01 +02:00
Brian Paul
1609efb418 draw: fix primitive restart bug by using the index buffer offset
The code which scans the index buffer for restart indexes wasn't adding
the index buffer offset so we were always starting at offset=0.  The
offset is usually zero so it wasn't noticed before.

Fixes a failure in the piglit primitive-restart test when testing
vertex data + index data in a single VBO.

NOTE: This is a candidate for the 8.0 branch.
2012-05-25 10:02:22 -06:00
Brian Paul
93ea5cd80b svga: remove the special zero-stride vertex array code
This code actually hasn't been needed for some time now.  We can just
treat a zero-stride vertex array like any other non-zero-stride array.
2012-05-25 10:02:22 -06:00
Brian Paul
dcb4ec5ae1 gallium/docs: beef up the docs related to color clamping
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-05-25 10:02:22 -06:00
Brian Paul
9c85687439 util: add GALLIUM_LOG_FILE option for logging output to a file
Useful for logging different runs to files and diffing, etc.
2012-05-25 10:02:21 -06:00
Paul Berry
ab014adaed i965/msaa: Enable 4x MSAA on Gen7.
Basic 4x MSAA support now works on Gen7.  This patch enables it.

As with Gen6, MSAA support is still fairly preliminary.  In
particular, the following are not yet supported:
- 8x oversampling (Gen7 has hardware support for this, but we do not
  yet expose it).
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centrold interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
  GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
  GL_SAMPLE_COVERAGE_INVERT).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
4725ba03ca i965/msaa: Implement manual blending operation for Gen7.
On Gen6, the blending necessary to blit an MSAA surface to a non-MSAA
surface could be accomplished with a single texturing operation.  On
Gen7, the WM program must fetch each sample and blend them together
manually.  From the Bspec (Shared Functions/Messages/Initiating
Message/Message Types/sample):

    [DevIVB+]:Number of Multisamples on the associated surface must be
    MULTISAMPLECOUNT_1.

This patch implements the manual blend operation.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
8b1f467cce i965/msaa: Modify blorp code to account for Gen7 MSAA layouts.
Since blorp uses color textures and render targets to do all its work
(even when blitting stencil and depth data), it always has to
configure the Gen7 GPU to use the new "sliced" MSAA layout.  However,
when blitting stencil or depth data, the actual MSAA layout is
interleaved (as in Gen6).  Therefore, blorp has to do extra coordinate
transformation work to account for the interleaving manually.

This patch causes blorp to perform the necessary extra coordinate
transformations.

It also modifies the blorp SURFACE_STATE setup code for Gen7, so that
it does not try to correct the surface width and height to account for
MSAA, since "sliced" MSAA layout doesn't affect the surface width or
height.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
31f3dfd59b i965/msaa: Validate Gen7 surface state constraints.
When a Gen7 SURFACE_STATE is configured for MSAA, a number of
additional constaints come in to play.  This patch adds a function
gen7_check_surface_setup() which verifies that all of those
constraints are met.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
455ac56272 i965/msaa: Properly handle sliced layout for Gen7.
Starting in Gen7, there are two possible layouts for MSAA surfaces:

- Interleaved, in which additional samples are accommodated by scaling
  up the width and height of the surface.  This is the only layout
  available in Gen6.  On Gen7 it is used for depth and stencil
  surfaces only.

- Sliced, in which the surface is stored as a 2D array, with array
  slice n containing all pixel data for sample n.  On Gen7 this layout
  is used for color surfaces.

The "Sliced" layout has an additional requirement: it must be used in
ARYSPC_LOD0 mode, which means that the surface doesn't leave any extra
room between array slices for miplevels other than 0.

This patch modifies the surface allocation functions to use the
correct layout when allocating MSAA surfaces in Gen7, and to set the
array offsets properly when using ARYSPC_LOD0 mode.  It also modifies
the code that populates SURFACE_STATE structures to ensure that
ARYSPC_LOD0 mode is selected in the appropriate circumstances.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
0e11b2c5af i965/msaa: Add defines for Gen7.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
b08545199a i965/blorp: Enable blorp blits on Gen7.
Gen7 support for blorp (blits using the render bath) now works for
non-MSAA purposes.  This patch enables it.

Since blorp operations re-use the logic for HiZ ops, this required
adding a case to the switch statement in gen7_blorp_emit_wm_config(),
to allow for the case where no HiZ op is being performed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
1c73c705fa i965/blorp: Implement proper texel fetch messages for Gen7.
On Gen6, texel fetch is always accomplished using the SAMPLE_LD
message, which accepts arguments (u, v, r, lod, si).  On Gen7, there
are two* texel fetch messages: SAMPLE_LD for non-MSAA surfaces, taking
arguments (u, lod, v), and SAMPLE_LD2DSS for MSAA surfaces, taking
arguments (si, u, v).

*Technically, there are other texel fetch messages, but they are used
for "compressed" MSAA surfaces, which we don't yet support.

This patch adds the proper message types and argument orderings for
Gen7.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
f2cdfa4c85 i965/blorp: Use 16 pixel dispatch on Gen7.
Gen7 hardware requires us to enable at least one WM dispatch mode,
even if there is no program being dispatched to.  When this code was
only used for HiZ operations (which don't use a WM program), we used
32-pixel dispatch, because it didn't matter.  But blit programs are
compiled for 16-pixel dispatch.  So just enable 16-wide dispatch
unconditionally.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Enable 16-wide dispatch unconditionally rather than add the
unnecessary complication of using 32-wide dispatch when there is no WM
program.
2012-05-25 08:45:11 -07:00
Paul Berry
f7df7917e0 i965/blorp: Allocate space for push constants on Gen7.
On Gen7, push constants for shader programs are stored in the URB, so
blorp code needs to set aside space for them.  This was previously
unnecessary because blorp code was based on HiZ operations, which
don't require any shaders.

This patch adds a call from gen7_blorp_exec() to
gen7_allocate_push_constants(), to ensure that push constants are
assigned the correct location in the URB.  It also extracts a new
function gen7_emit_urb_state() from gen7_upload_urb(), which is
re-used by gen7_blorp_emit_urb_config() to ensure that the URB regions
used by all the pipeline stages leave room for the push constants.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
de9752a4e5 i965/blorp: Set the dynamic state upper bound.
We know from previous bug fixes (commits
c25e5300cb and
b2ace06cbb) that texture border color
doesn't work if the dynamic state upper bound is set to 0.  Although
the blorp engine doesn't make use of texture borders, it seems like we
ought to err on the safe side and set this value properly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
f77959b2c9 i965/blorp: Factor gen6_blorp_emit_batch_head into separate functions.
This patch separates out the portions of gen6_blorp_emit_batch_head()
that emit 3DSTATE_MULTISAMPLE, 3DSTATE_SAMPLE_MASK, and
STATE_BASE_ADDRESS.  This paves the way for making the blorp code work
on Gen7, where additional command packets
(3DSTATE_PUSH_CONSTANT_ALLOC_VS and 3DSTATE_PUSH_CONSTANT_ALLOC_PS)
need to be emitted before 3DSTATE_MULTISAMPLE.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
34a5f12e35 i965/blorp: Use MSDISPMODE_PERSAMPLE rendering when necessary
This patch modifies the "blorp" WM program so that it can be run in
MSDISPMODE_PERSAMPLE (which means that every single sample of a
multisampled render target is dispatched to the WM program, not just
every pixel).

Previously we were using the ugly hack of configuring multisampled
destination surfaces as single-sampled, and generating sample indices
other than zero by swizzling the pixel coordinates in the WM program.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-25 08:45:10 -07:00
Paul Berry
233c207e9e i965/blorp: Emit sample index in SAMPLE_LD message when necessary
This patch modifies the function brw_blorp_blit_program::texel_fetch()
to emit the SI (sample index) argument to the SAMPLE_LD message when
reading from a sample index other than zero.

Previously we were using the ugly hack of configuring multisampled
source surfaces as single-sampled, and accessing sample indices other
than zero by swizzling the texture coordinates in the WM program.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:10 -07:00
Paul Berry
665dc82bdc i965/blorp: Generalize sampling code in preparation for Gen7
This patch generalizes the function
brw_blorp_blit_program::texture_lookup() so that it prepares the
arguments to the sampler message based on a caller-provided array
rather than assuming the argument order is always (u, v).

This paves the way for the messages we will need to use in Gen7, which
use argument orders (u, lod, v) and (si, u, v) (si=sample index).

It will also will allow us to read from arbitrary sample indices on
Gen6, by supplying the arguments (u, v, r, lod, si) to the SAMPLE_LD
message instead of just (u, v).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:10 -07:00
Paul Berry
52fcc36f11 i965/msaa: Expand odd-sized MSAA surfaces to account for interleaving pattern.
Gen6 MSAA buffers (and Gen7 MSAA depth/stencil buffers) interleave
MSAA samples in a complex pattern that repeats every 2x2 pixel block.
Therefore, when allocating an MSAA buffer, we need to make sure to
allocate an integer number of 2x2 blocks; if we don't, then some of
the samples in the last row and column will be cut off.

Fixes piglit tests "EXT_framebuffer_multisample/unaligned-blit {2,4}
color msaa" on i965/Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-25 08:45:10 -07:00
Thomas Gstädtner
93594f38be gallium/targets: pass ldflags parameter to MKLIB
Without passing the -ldflags parameter before $(LDFLAGS) in some cases
flags will be passed to MKLIB which it does not understand.
This might be -m64, -m32 or similar.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Thomas Gstädtner <thomas@gstaedtner.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-25 09:36:24 -06:00
Vadim Girlin
a1a0974401 Revert "r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen"
This reverts commit 60bf0f05b4.

It seems round_mode behaves differently in some cases depending on  the
instruction/slot. Reverting it for now.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50232

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:28:08 +04:00
Vadim Girlin
1c5c4243c9 radeon/llvm: add FLT_TO_UINT, UINT_TO_FLT instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:46 +04:00
Vadim Girlin
5a1b59b4e6 radeon/llvm: prepare to revert the round mode state to default
Use TRUNC before FLT_TO_INT on evergreen/cayman.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:33 +04:00
Vadim Girlin
7fa7c608cb radeon/llvm: fix sampler index in llvm_emit_tex
Sampler index isn't a second source operand for some tgsi texture
instructions. Let's assume it's always the last.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50230

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:23 +04:00
Vadim Girlin
029776753b radeon/llvm: fix opcode for RECIP_UINT_r600
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50312

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:23:06 +04:00
Vadim Girlin
6806f81fb4 radeon/llvm/loader: convert hardcoded gpu name to option
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:38 +04:00
Vadim Girlin
482041a538 r600g: add RECIP_INT, PRED_SETE_INT to r600_bytecode_get_num_operands
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50315

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:12 +04:00
Vinson Lee
35f302d97e i915g: Check for geometry shader earlier in i915_set_constant_buffer.
Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-24 18:50:07 -07:00
Vinson Lee
5cf693266f scons: Fix SCons build infrastructure for FreeBSD.
This patch gets the FreeBSD SCons build working again. The build still
fails though.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-24 18:49:40 -07:00
Tom Stellard
33e7db9a1d radeon/llvm: Lower UDIV using the Selection DAG 2012-05-24 14:12:32 -04:00
Tom Stellard
d088da917b radeon/llvm: Remove auto-generated AMDIL->ISA conversion code 2012-05-24 14:12:32 -04:00
Tom Stellard
662ccbfc21 radeon/llvm: Remove AMDIL instructions MULHI, SMUL 2012-05-24 14:12:32 -04:00
Tom Stellard
177b420283 radeon/llvm: Remove AMDIL bitshift instructions (SHL, SHR, USHR) 2012-05-24 14:12:32 -04:00
Tom Stellard
9d41a401dc radeon/llvm: Remove AMDIL FTOI and ITOF instructions 2012-05-24 14:12:32 -04:00
Tom Stellard
a8ba697c1e radeon/llvm: Remove AMDIL EXP* instructions 2012-05-24 14:12:31 -04:00
Tom Stellard
dd9927eb36 radeon/llvm: Remove AMDIL ADD instructions 2012-05-24 14:12:31 -04:00
Tom Stellard
1404e6b9fc radeon/llvm: Remove AMDIL binary instrutions (OR, AND, XOR, NOT) 2012-05-24 14:12:31 -04:00
Tom Stellard
3059c075a7 radeon/llvm: Remove AMDILMachinePeephole pass 2012-05-24 14:12:31 -04:00
Tom Stellard
e9d8901a80 radeon/llvm: Remove AMDIL CMP instructions and associated lowering code 2012-05-24 14:12:31 -04:00
Tom Stellard
ea00632fe0 radeon/llvm: Remove AMDIL ROUND_NEAREST instruction 2012-05-24 14:12:31 -04:00
Tom Stellard
0bfa3b3e96 radeon/llvm: Remove AMDIL ROUND_POSINF instruction 2012-05-24 14:12:31 -04:00
Tom Stellard
d4984f3463 radeon/llvm: Add custom SDNode for FRACT 2012-05-24 14:12:30 -04:00
Tom Stellard
5523502ff9 radeon/llvm: Use -1 as true value for SET* integer instructions 2012-05-24 14:12:30 -04:00
Tom Stellard
86dfae1103 radeon/llvm: Handle SETGE_INT, SETGE_UINT, and SETGT_UINT opcodes
Support for these was inadvertently dropped in commit
cee23ab246
2012-05-24 14:12:30 -04:00
Tom Stellard
cc7a6d2691 radeon/llvm: Avoid error with SI in EmitInstrWithCustomInserter()
We need to return immediately after inserting instructions that require
S_WAITCNT so that the parent class' custom inserter won't try to insert
them again.
2012-05-24 14:12:30 -04:00
Vinson Lee
0f6a3a7de3 tgsi: Initialize Padding struct fields.
Fix uninitialized scalar variable defects report by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-23 21:58:37 -07:00
Kenneth Graunke
88128516d4 i965: Gut the separate OpenGL ES extension enabling.
We should just set the bits of functionality that we support; the
GL/ES1/ES2 flags in extensions.c will take care of advertising the
appropriate extensions for the current API.

This enables the GL_EXT_texture_compression_dxt1 extension on ES1/ES2
when libtxc_dxtn is installed or the force_s3tc driconf option is set.
The main extension code set this up properly, but the ES-specific code
failed to do so.

Otherwise, the extension strings reported by es1_info, es2_info, and
glxinfo all remain the same.

This patch manually disables the ARB_framebuffer_object bit on ES
to preserve the behavior of 1c0f5d8324.

v2: Rebase, fix the i915 Makefile, and unconditionally set the
    OES_draw_texture bit as core Mesa will only apply it to ES1 now.

Tested-by: Daniel Charles <daniel.charles@intel.com> [v1]
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 17:17:54 -07:00
Kenneth Graunke
d4667516b6 mesa: Remove the OES_draw_texture extension from ES2.
This extension appears to be written against ES 1.0.
In ES 2.0, you really want to be using FBOs instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 17:03:35 -07:00
Jordan Justen
dc50145253 i965: use cut index to handle primitive restart when possible
If the primitive restart index and the primitive type can
be handled by the cut index feature, then use the hardware
to handle the primitive restart feature.

The VBO module's software handling of primitive restart is
used as a fall back.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Jordan Justen
f9389fbfb2 i965: add flag to enable cut_index
When brw->prim_restart.enable_cut_index is set, the cut index
will be enabled when uploading index_buffer commands.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Jordan Justen
df7d1323de i965: create code path to handle primitive restart in hardware
For newer hardware we disable the VBO module's software handling
of primitive restart. We now handle primitive restarts in
brw_handle_primitive_restart.

The initial version of brw_handle_primitive_restart simply calls
vbo_sw_primitive_restart, and therefore still uses the VBO
module software primitive restart support.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Paul Berry
9f6932cb83 glsl/tests: Add .gitignore for uniform initialization unit test.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 14:24:33 -07:00
Paul Berry
aa173e16a0 glsl/constant propagation: kill whole var if LHS involves array indexing.
When considering which components of a variable were killed by an
assignment, constant propagation would previously just use the write
mask of the assignment.  This worked if the LHS of the assignment was
simple, e.g.:

v.xy = ...; // (assign (xy) (var_ref v) ...)

But it did the wrong thing if the LHS of the assignment involved an
array indexing operator, since in this case the write mask is always
(x):

v[i] = ...; // (assign (x) (deref_array (var_ref v) (var_ref i)) ...)

In general, we can't predict which vector component will be selected
by array indexing, so the only safe thing to do in this case is to
kill the entire variable.

Fixes piglit tests {fs,vs}-vector-indexing-kills-all-channels.shader_test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-23 14:21:48 -07:00
Ian Romanick
b45052b3f7 glsl/tests: Add test for uniform initialization by the linker
v2: Put unit tests in src/glsl/tests rather than tests/glsl.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
49da2590c2 mesa: Use initializers to configure samplers
Now that the linker handles initializers of samplers just like any
other uniform, a bunch of this annoying code is unnecessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
75dac69262 ir_to_mesa: Don't set initial uniform values again
This work is now done by the linker, so we don't need to keep doing it
here.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
c343b980d6 ir_to_mesa: Propagate initial values in _mesa_associate_uniform_storage
The linker may have set initial values for uniforms.  Propagate these
values to the driver's backing storage when it is first associated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
76027f5b5c glsl: Propagate sampler uniform initializers to gl_shader_program::SamplerUnits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:07 -07:00
Ian Romanick
b610881317 glsl: Initialize samplers to 0, propagate sampler values to the gl_program
The spec requires that samplers be initialized to 0.  Since this
differs from the 1-to-1 mapping of samplers to texture units assumed
by ARB assembly shaders (and the gl_program structure), be sure to
propagate this date from the gl_shader_program to the gl_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
CC: Vadim Girlin <vadimgirlin@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49088
2012-05-23 11:42:07 -07:00
Ian Romanick
a2e623054b glsl: Set initial values for uniforms in the linker
v2: Fix handling of arrays-of-structure.  Thanks to Eric Anholt for
pointing this out.

v3: Minor comment change based on feedback from Ken.

Fixes piglit glsl-1.20/execution/uniform-initializer/fs-structure-array
and glsl-1.20/execution/uniform-initializer/vs-structure-array.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:41:49 -07:00
Eric Anholt
29362875f2 i965/gen6+: Add support for GL_ARB_blend_func_extended.
v2: Add support for gen6, and don't turn it on if blending is
    disabled. (fixes GPU hang), and note it in docs/GL3.txt

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 10:46:15 -07:00
Eric Anholt
175ad8050e mesa: Keep a computed value for dual source blend func with each buffer.
The i965 driver needed this as well for hardware setup, so instead of
duplicating the logic, just save it off.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-23 10:45:43 -07:00
Eric Anholt
68216f3581 i965/gen6+: Add support for fast depth clears.
Improves citybench high-res performance 3.0% +- 0.4%, n=10.  Improves
Lightsmark 1024x768 performance 0.74% +/- 0.20% (n=78).  No
significant difference on openarena (n=5, didn't fast clear) or nexuiz
(n=3).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:40:11 -07:00
Eric Anholt
5b248e5982 i965/gen6: Add CC viewport state setup to blorp code.
While it doesn't have the same warning in the simulator as in gen7,
let's emit it out of paranoia.  We wouldn't want our resolves of some
previous clear to get clamped to some current clamping value.

Suggested-by: pretty much everyone
2012-05-23 10:39:45 -07:00
Eric Anholt
39a91be20d i965/gen7: Add CC viewport setup to blorp code.
When doing fast clears, a fulsim warning said that the batch was being
emitted without the viewport set up.  While the fast clear pass I was
looking at doesn't use the clear value, the later resolves which also
didn't set up the vieport would trigger the same.  It's not obvious
from the error message whether it meant "fast clear value gets clamped
to something you haven't defined" or "fast clear value doesn't get
clamped, and I saw it was out of the current (uninitialized) range,
and you probably wanted it clamped to that (uninitialized) range".  Be
paranoid and assume the first case.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
54308f78a2 i965: Drop a layer of indirection in doing HiZ resolves.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
072634da4a i965: Replace intel_need_resolve with the hiz ops it maps to.
Having this enum separate caused us to need a bunch of helper
functions to translate to the op to be executed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
5b226ad603 i965: Add an interface for doing hiz ops from C code.
This required moving gen6_hiz_op, and I put it in intel_resolve_map.h
for the next commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
7da9795070 i965: Rename the clear function for this driver.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
3e1656567c i965: Simplify the remaining clear logic by relying on the meta clear.
The GLSL clear path doesn't need any buffer presence checks, since
those are already handled in the normal drawing path code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
7c3e88f1fc i965: Switch blit color clears to tri clears on gen4/5.
Our understanding is that the 3D engine is supposed to be faster
anyway.  We used to have more overhead in our tri clear path than we
do today, which would have led to this choice.  But given that we
almost always see a depth clear along with a color clear, the path was
hardly exercised anyway.

Also, the color mask logic was broken in the presence of
GL_EXT_draw_buffers2's per-buffer colormask.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
fa15b0f3f0 i965: Remove dead logic for non-tri depth/stencil clears.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
a3967ff441 i965: We always have GLSL, so always use it for tri clears.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
03c9044c2e i915: Drop gen4+ code from the forked clear code.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
11892ea986 intel: Fork the intel_clear.c file between i915 and i965.
This logic is wasted on i965 when we want to just always do GLSL tri
clears.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Vadim Girlin
c91b4edff9 st/mesa: set stObj->lastLevel in guess_and_alloc_texture
Fixes lockups/asserts with depthstencil-render-miplevels tests and r600g.
Should also fix https://bugs.freedesktop.org/show_bug.cgi?id=50033

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-23 06:07:00 +04:00
Paul Berry
ea8e854b2c i965: Completely annotate the batch bo when aub dumping.
Previously, when the environment variable INTEL_DEBUG=aub was set,
mesa would simply instruct DRM to start dumping data to an .aub file,
but we would not provide DRM with any information about the format of
the data in various buffers.  As a result, a lot of the data in the
generate .aub file would be unannotated, making further data analysis
difficult.

This patch causes the entire contents of each batch buffer to be
annotated using the data in brw->state_batch_list (which was
previously used only to annotate the output of INTEL_DEBUG=bat).  This
includes data that was allocated by brw_state_batch, such as binding
tables, surface and sampler states, depth/stencil state, and so on.

The new annotation mechanism requires DRM version 2.4.34.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-22 15:19:00 -07:00
Paul Berry
1b87a93983 intel: When AUB dumping, flush before emitting final bitmap command.
When we are generating an AUB dump, we make a final call to
aub_dump_bmp() as the context is being destroyed, to ensure that any
rendering performed before the application exits can be seen during a
simulation run.  However, we were doing this before flushing the batch
buffer; as a result simulation runs would not always see the effect of
all rendering commands.

This patch flushes the batch buffer just before making the final call
to aub_dump_bmp(), to ensure that all rendering is properly captured
in the final bitmap.
2012-05-22 15:19:00 -07:00
José Fonseca
7a75e7d6e8 llvmpipe: Fix alpha testing precision on rgba8 formats.
This is a long standing problem, that recently surfaced with the change
to enable perspective correct color interpolation.

A fix for all possible formats is left to the future.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-05-22 19:23:49 +01:00
Vinson Lee
e4fb332af1 scons: Do not build glx and egl on Cygwin.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-22 10:15:14 -07:00
Christoph Bumiller
89155ba71d nv30: check for NULL vertex buffers in prevalidate_vbufs 2012-05-22 15:22:10 +02:00
Christoph Bumiller
a054fd8268 nv50: make unaligned index buffer offsets work again
Messed up in ef7bb28129.
2012-05-22 12:50:12 +02:00
Christoph Bumiller
91fb5e0394 nvc0: don't set NEW_IDXBUF in nvc0_switch_pipe_context if none is bound 2012-05-22 12:45:19 +02:00
James Benton
8a933e36d1 llvmpipe: Added a error counter to lp_test_conv.
Useful for keeping track of progress when fixing errors!

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:53 +01:00
James Benton
383c1b649b llvmpipe: Changed known failures in lp_test_conv.
To comply with the recent fixes to lp_bld_conv.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:51 +01:00
James Benton
4203a0b034 llvmpipe: Added fixed point types tests to lp_test_conv.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:49 +01:00
James Benton
a3d4af0c00 gallivm: Fixed erroneous optimisation in lp_build_min/max.
Previously assumed normalised was 0 to 1, but it can be -1 to 1
if type is signed.
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:47 +01:00
James Benton
fdeb0394cb gallivm: Compensate for lp_const_offset in lp_build_conv.
Fixing a /*FIXME*/ to remove errors in integer conversion in lp_build_conv.
Tested using lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:46 +01:00
James Benton
f89b1f4ba4 gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:44 +01:00
Brian Paul
c286278481 docs: add link to 8.0.3 release notes 2012-05-21 09:26:04 -06:00
Paul Seidler
a0dffe8701 tests: include mesa headers
else they will fail for fresh installs

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:42:19 -06:00
Lukas Rössler
6178b653c7 glu: fix two Clang warnings
This patch removes two Clang warnings in GLU:

The first one seems to be an actual bug in mapdesc.cc: Clang complains
that sizeof(dest) will return the size of REAL*[MAXCOORDS], instead of
the intended REAL[MAXCOORDS][MAXCOORDS]. The second one is just
cosmetic because Clang doesn't like extra parentheses.

NOTE: This is a candidate for the 8.0 branch

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:29:23 -06:00
Homer Hsing
ed9d1bef81 docs: fix a typo
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:07:20 -06:00
ojab
3d2bf91cc1 Filter out -Wcovered-switch-default from LLVM_CFLAGS
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 08:37:06 +01:00
Tom Stellard
cee23ab246 radeon/llvm: Handle selectcc DAG node
R600 can now select instructions from the selectcc DAG node, which is
typically lowered to one of the SET* instructions.
2012-05-20 16:27:31 -04:00
Brian Paul
239792fb22 st/mesa: use pipe_sampler_view_release() in st_destroy_context_priv()
Fixes another case of sampler views being created by one context,
shared by another, then deleted by the first, leaving a dangling
pipe context pointer.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
c9cb9cf050 mesa: use F_TO_I() instead of IROUND()
Use it where performance matters more and the exact method of float->int
conversion/rounding isn't terribly important.  There should no net change
here since F_TO_I() is the new name of the old IROUND() function.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
699c1894ee mesa: reimplement IROUND(), add F_TO_I()
The different implementations of IROUND() behaved differently and in
the case of fistp, depended on the current x86 FPU rounding mode.
This caused some tests like piglit roundmode-pixelstore and
roundmode-getintegerv to fail on 32-bit x86 but pass on 64-bit x86.

Now IROUND() always rounds to the nearest integer (away from zero).
The new F_TO_I function converts a float to an int by whatever means
is fastest.  We'll use this where we're more concerned with performance
and not too worried to how the conversion is done.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
31d59c78f0 mesa: fix Z32_FLOAT -> uint conversion functions
The IROUND converted all arguments to 0 or 1.  That's not what we wanted.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
c3991e1c57 st/mesa: remove unused pipe variable 2012-05-19 08:28:57 -06:00
Brian Paul
bd302f36c4 svga: whitespace, comments, formatting clean-ups 2012-05-19 08:28:57 -06:00
Brian Paul
6792969cbc st/mesa: added st_print_current_vertex_program(), for debugging 2012-05-19 08:28:56 -06:00
Brian Paul
2786343896 svga: return PIPE_OK instead of 0
And fix the emit_rss() function's return type.
2012-05-19 08:28:56 -06:00
Brian Paul
fc71e0b4a8 svga: fix zero-stride vertex array bug
For zero-stride vertex arrays, the svga driver copies the value into
the constant value and uses that value in the shader.  The recent
gallium-userbuf changes caused a regression in this.  An example
symptom was per-primitive glColor3f() calls getting ignored.

Where we copied the vertex value from the vertex buffer to the
constant buffer we neglected to take into account the
pipe_vertex_buffer::buffer_offset field.  Adding that value to the
source offset fixes the problem.  Actually, it looks like we should
have been doing this all along, but it never was an issue before for
some reason.
2012-05-19 08:28:56 -06:00
Brian Paul
0161691f35 mesa: add GLSL_REPORT_ERRORS debug flag
If the MESA_GLSL env var contains "errors", GLSL compilation and
link errors will be reported to stderr.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-19 08:28:56 -06:00
Brian Paul
1c333745f3 mesa: add some comments on shaderapi.c functions 2012-05-19 08:28:56 -06:00
Vinson Lee
315140969d mesa: Remove undefinition of _P symbol.
IRIX isn't used anymore.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-18 23:24:33 -07:00
Ian Romanick
0c6f4cd335 Import release notes for 8.0.3, add news item
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-18 16:27:17 -07:00
Jeremy Huddleston
27b821bc95 darwin: Address a build failure on Leopard and earlier OS versions
<https://trac.macports.org/ticket/34499>

Regression-from: 51691f0767
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-18 11:32:40 -07:00
Michel Dänzer
d59b2c4b53 radeonsi: Only honour point related rasterizer state when rendering points.
Avoids hangs when not rendering points.
2012-05-18 18:13:56 +02:00
Michel Dänzer
dd9d619459 radeonsi: Fix parameter cache offsets for fragment shader inputs. 2012-05-18 15:01:10 +02:00
Vinson Lee
e8a86d36f3 gallium/tgsi/text: Ensure ret is initialized in parse_immediate_data.
Fix uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-17 21:59:08 -07:00
Tom Stellard
c20e741799 radeon/llvm: Fix segfault while lowering lrp intrinsic 2012-05-17 20:42:16 -04:00
Tom Stellard
7e3cd8df18 radeon/llvm: Add DAG nodes for MIN instructions
Also, remove the AMDIL MIN* instruction defs.
2012-05-17 20:42:16 -04:00
José Fonseca
3f7a5ffac7 llvmpipe: Avoid adding floating point zero to flat inputs.
Which could clobber integer inputs, if the addition is not optimized away
(e.g., if optimizations are disabled for debugging purposes).
2012-05-18 01:03:13 +01:00
José Fonseca
00eb74b275 Fix fetching integer inputs. 2012-05-18 00:55:13 +01:00
Olivier Galibert
5d10d75727 llvmpipe: Implement TXQ.
Piglits test for fragment shaders pass, vertex shaders fail.  The
actual failure seems to be in the interpolators, and not the
textureSize query.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-18 00:27:28 +01:00
Olivier Galibert
1ec421823b llvmpipe: Don't mess with the provoking vertex when inverting a triangle.
Fixes a bunch of piglit tests related to flat interpolation of floats.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-18 00:07:18 +01:00
Tom Stellard
c6c8a05c50 radeon/llvm: Lower lrp intrinsic during ISel 2012-05-17 14:48:10 -04:00
Tom Stellard
ef8e66bc16 radeon/llvm: Remove AMDIL MAD instruction defs 2012-05-17 14:48:10 -04:00
Tom Stellard
d07473fcf4 radeon/llvm: Remove AMDIL MUL_IEEE* instructions 2012-05-17 14:48:10 -04:00
Tom Stellard
5187948bc2 r600g: Handle MUL_IEEE in r600_bytecode_get_num_operands 2012-05-17 14:48:09 -04:00
Tom Stellard
1fe70c6ae1 radeon/llvm: Expand fsub during ISel 2012-05-17 14:48:09 -04:00
Tom Stellard
9916f2d2af radeon/llvm: Remove AMDIL floating-point ADD instruction defs 2012-05-17 14:48:09 -04:00
Tom Stellard
91484de22d radeon/llvm: Remove AMDIL CMOVLOG* instruction defs 2012-05-17 14:48:09 -04:00
Tom Stellard
9a020092ae radeon/llvm: Move lowering of ABS_i32 to ISel 2012-05-17 14:48:09 -04:00
Tom Stellard
89b945591b radeon/llvm: Remove sub patterns from AMDILInstrPatterns.td 2012-05-17 14:48:09 -04:00
Tom Stellard
431bb79a41 radeon/llvm: Add custom SDNodes for MAX
We now lower the various intrinsics for max to SDNodes and then use
tablegen patterns to lower the SDNodes to instructions.
2012-05-17 14:48:09 -04:00
Jordan Justen
602913192d state_tracker: remove sw_primitive_restart from st_context
The VBO module now can handle primitive restart in software
if required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
eef193560e state_tracker: remove software handling of primitive restart
The VBO module now can handle primitive restart in software
if required. Therefore this support is no londer required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
f16b39f05c state_tracker: set PrimitiveRestartInSoftware if needed
If the PIPE_CAP_PRIMITIVE_RESTART screen param is not set, then enable
PrimitiveRestartInSoftware to enable software primitive restart
support in the VBO module.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
862667b6d9 vbo: use software primitive restart in the VBO module
When PrimitiveRestartInSoftware is set, the VBO module will handle
primitive restart scenarios before calling the vbo->draw_prims
drawing function.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Jordan Justen
fc22fde9d8 mesa: add PrimitiveRestartInSoftware to gl_context.Const
If set, then the VBO module will handle all primitive
restart scenarios before calling the driver draw_prims.

Software primitive restart support is disabled by default.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Jordan Justen
bc8e0f5b0f vbo: add software primitive restart support
vbo_sw_primitive_restart implements primitive restart in software
by splitting primitive draws apart.

This is based on similar support in mesa/state_tracker/st_draw.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Eric Anholt
5a827d9a2b mesa: Check for framebuffer completeness before looking at the rb.
Otherwise, an incomplete framebuffer could have a NULL
_ColorReadBuffer and we'd deref that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
8b7ba92605 mesa: Fix assertion failure when a cube face is not present.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
aa5ec13775 glsl: Drop the extra NULL specifiction on ir_assignment constructors.
It's an implied argument, and I don't think being explicit about it
helps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
9c4e9ce051 glsl: Fix assertion failure on handling switch on uint expressions.
Fixes piglit glsl-1.30/execution/switch/fs-uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
bbbc7c7d56 glsl: Reject non-scalar switch expressions.
The comment quotes spec saying that only scalar integers are allowed,
but we only checked for integer.

Fixes piglit switch-expression-const-ivec2.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
5d6ea16dfe glsl: Let the constructor figure out the types of switch-related expressions.
I noticed this while unindenting the code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
5462f3679a glsl: Fix indentation of switch code.
I managed to completely trash it in 22d81f15.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
aa02884c4f i965/vs: Fix up swizzle for dereference_array of matrices.
Fixes assertion failure in piglit:
vs-mat2-struct-assignment.shader_test
vs-mat2-array-assignment.shader_test

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
ef691885c9 mesa: Throw error on glGetActiveUniform inside Begin/End.
Fixes piglit GL_ARB_shader_objeccts/getactiveuniform-beginend.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
05c200bac0 glsl: Improve the local dead code optimization to eliminate unused channels.
Total instructions: 261582 -> 261316
135/2147 programs affected (6.3%)
36752 -> 36486 instructions in affected programs (0.7% reduction)

This excludes a tropics shader that now gets 16-wide mode and throws
off the numbers.  5 shaders are hurt: two extra MOVs in 4 tropics
shaders it looks like because we don't split register names according
to independent webs, and one gstreamer shader where it looks like
try_rewrite_rhs_to_dst() is falling on its face.

This should also help avoid a regression in VSes from idr's ARB
programs to GLSL work.
2012-05-17 10:05:23 -07:00
Eric Anholt
f220f73b9c i965/fs: Do more register coalescing by using the interference graph.
By using the live variables code for determining interference, we can
handle coalescing in the presence of control flow, which the other
register coalescing path couldn't.

Total instructions: 207184 -> 206990
74/1246 programs affected (5.9%)
33993 -> 33799 instructions in affected programs (0.6% reduction)

There is a newerth shader that loses out, because of some extra MOVs
that now get their dead-code nature obscured by coalescing.  This
should be fixed by doing better at dead code elimination.
2012-05-17 10:05:23 -07:00
Christoph Bumiller
1befacc764 nouveau: place static buffers in VRAM if preferred by the driver 2012-05-17 15:24:58 +02:00
Christoph Bumiller
717f55d79d nv50/ir: fix reversed order of lane ops in quadops 2012-05-17 15:24:58 +02:00
Christoph Bumiller
e6caafd9d7 nv50,nvc0: handle user vertex buffers
And restructure VBO validation a little in the process.
2012-05-17 15:24:58 +02:00
Christoph Bumiller
ef7bb28129 nv50,nvc0: handle user index buffers 2012-05-17 15:24:58 +02:00
Christoph Bumiller
fcb2868210 nv50,nvc0: handle user constbufs without wrapping them in a resource 2012-05-17 15:24:58 +02:00
Christoph Bumiller
07323a80a2 st/mesa: set PIPE_BIND_STREAM_OUTPUT for TFB target in st_bufferobj_data 2012-05-17 15:24:58 +02:00
Jeremy Huddleston
d65bd195ec darwin: Eliminate a possible race condition while destroying a surface
Introduced by: c60ffd2840
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:30 -07:00
Jeremy Huddleston
a73a800b32 darwin: Unlock our mutex before destroying it
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:29 -07:00
Michel Dänzer
7446a0407d gallium/radeon: Fix r300g tiling breakage.
Commit 11f056a3f0 broke the r300g build. Fix it
up, and reinstate some code which isn't needed by r600g and radeonsi but is
by r300g.
2012-05-16 23:52:19 +02:00
Francisco Jerez
03e3bc4ba5 gallium/auxiliary/pipe-loader: Fix usage of anonymous union.
Anonymous unions aren't part of the C99 standard.  Fixes build on GCC
versions older than 4.6.

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

Reported-by: Michael Lange <michaell@gmx.org>
2012-05-16 18:51:35 +02:00
Michel Dänzer
88a2e2388b radeonsi: Initial tiling support.
Largely based on the corresponding Evergreen support in r600g.
2012-05-16 18:30:50 +02:00
Michel Dänzer
11f056a3f0 r600g: Set tiling information for BOs being shared.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48747
2012-05-16 18:30:45 +02:00
Michel Dänzer
76d6a64de3 st/xorg: Better handling of EXA copies.
Always use the resource_copy_region hook. If a source and destination rectangle
overlap, copy to/from a temporary pixmap.
2012-05-16 18:30:39 +02:00
Michel Dänzer
0201c7d0af radeonsi: Bump MAX_DRAW_CS_DWORDS.
I missed this when updating si_context_draw().
2012-05-16 18:30:07 +02:00
José Fonseca
9af1ba565d draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.
Starting with LLVM 3.0, named structures are meant not for debugging, but
for recursive data types, previously also known as opaque types.

The recursive nature of these types leads to several memory management
difficulties.  Given that we don't actually need recursive types, avoid
them altogether.

This is an attempt to address fdo bugs 41791 and 44466. The issue is
somewhat random so there's no easy way to check how effective this is.
2012-05-16 15:00:23 +01:00
Olivier Galibert
982df3c1a5 llvmpipe: Color slot interpolation can be flat or perspective, not linear.
Fixes a bunch of glsl 1.10 interpolation piglit tests.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-16 13:12:04 +01:00
Homer Hsing
4050756804 configure.ac: Fix typos in the r600-llvm-compiler option
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 19:02:27 -04:00
José Fonseca
563489e5c9 gallivm: Add MCRegisterInfo.h to silence benign warnings about missing implementation.
Trivial.
2012-05-15 23:48:24 +01:00
Paul Berry
6335e0b073 i965/blorp: Move exec() out of brw_blorp_params.
No functional change.  This patch replaces the
brw_blorp_params::exec() method with a global function
brw_blorp_exec() that performs the operation described by the params
data structure.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-15 15:15:26 -07:00
Paul Berry
19e9b24626 i965/gen6: Initial implementation of MSAA.
This patch enables MSAA for Gen6, by modifying intel_mipmap_tree to
understand multisampled buffers, adapting the rendering pipeline setup
to enable multisampled rendering, and adding multisample resolve
operations to brw_blorp_blit.cpp. Some preparation work is also
included for Gen7, but it is not yet enabled.

MSAA support is still fairly preliminary.  In particular, the
following are not yet supported:
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centroid interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
  GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
  GL_SAMPLE_COVERAGE_INVERT).

Fixes piglit tests "EXT_framebuffer_multisample/accuracy" on
i965/Gen6.

v2:
- In intel_alloc_renderbuffer_storage(), quantize the requested number
  of samples to the next higher sample count supported by the
  hardware.  This ensures that a query of GL_SAMPLES will return the
  correct value.  It also ensures that MSAA is fully disabled on Gen7
  for now (since Gen7 MSAA support doesn't work yet).
- When reading from a non-MSAA surface, ensure that s_is_zero is true
  so that we won't try to read from a nonexistent sample.
2012-05-15 15:09:23 -07:00
Paul Berry
506d70be21 i965/gen6+: Add code to perform blits on the render path ("blorp").
This patch expands the "blorp" component to be able to perform blits
as well as HiZ resolves.  The new blitting code is located in
brw_blorp_blit.cpp.  This includes the necessary fragment shader code
to look up pixels in the source buffer (which is configured as a
texture) and output them to the destination buffer (which is
configured as the render target).

Most of the time the fragment shader code is simple and
straightforward, since it merely has to apply a coordinate offset,
read from the texture, and write to the render target.  However, in
the case of blitting stencil buffers, things are more complicated,
since the GPU stores stencil data using W tiling, and W tiling is not
supported for textures or render targets.  So, we set up the stencil
buffers as Y tiled, and emit fragment shader code that adjusts the
coordinates to account for the difference between W and Y tiling.
Furthermore, since a rectangular region in W tiling does not
necessarily correspond to a rectangular region in Y tiling, we widen
the rectangle primitive to the nearest tile boundary and have the
fragment shader "kill" any pixels that don't fall inside the actual
desired destination rectangle.

All of this is a necessary prerequisite for implementing MSAA, since
we'll need to be able to blit between multisample color, depth, and
stencil buffers and their non-multisampled counterparts, and none of
the existing blitting mechanisms support multisampling.

In addition, the new blitting code should speed up operations where we
previously fell back to software rasterization, such as blitting of
stencil buffers.  The current fallback sequence is: first we try to do
a blit using the hardware blitting engine.  If that fails we try to do
a blit using the render path.  If that also fails then we do the blit
using a meta-op (which may or may not fall back to software
rasterization).

Note that blitting using the render path has some limitations at the
moment: it only supports a few formats, and it doesn't support
clipping or scissoring.  These limitations will be addressed in future
patch series.

v2:
- Add the code that configures the WM program to
  gen{6,7}_emit_wm_config() and gen7_emit_ps_config() rather than
  creating separate ...enable() functions.
- Call intel_prepare_render before determining which miptrees we are
  blitting from/to, because it may cause miptrees to be reallocated.
- Allow the blit to mirror X and/or Y coordinates.
- Disable blorp blits on Gen7 for now, since they aren't working yet.
2012-05-15 15:09:23 -07:00
Paul Berry
36e3413418 i965: Expose surface setup internals for use by blits.
This patch exposes the functions brw_get_surface_tiling_bits and
gen7_set_surface_tiling, so that they can be re-used when setting up
surface states in gen6_blorp.cpp and gen7_blorp.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-15 15:09:22 -07:00
Paul Berry
586b389474 i965: split gen{6,7}_blorp_exec functions into manageable chunks.
This patch splits up the gen6_blorp_exec and gen7_blorp_exec
functions, which were very long, into simple component functions.
With a few exceptions, there is one function per state packet.

This will allow blit functionality to be added without significantly
complicating the code.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Rename the functions gen{6,7}_emit_wm_disable() to
gen{6,7}_emit_wm_config() (since the WM is not actually disabled
during HiZ ops; it simply doesn't have a program).  Also, on gen7,
split out the configration of 3DSTATE_PS to a separate function
gen7_emit_ps_config().
2012-05-15 15:09:22 -07:00
Paul Berry
2c5510b71b i965: Parameterize HiZ code to prepare for adding blitting.
This patch groups together the parameters used by the HiZ functions
into a new data structure, brw_hiz_resolve_params, rather than passing
each parameter individually between the HiZ functions.  This data
structure is a subclass of brw_blorp_params, which represents the
parameters of a general-purpose blit or resolve operation.  A future
patch will add another subclass for blits.

In addition, this patch generalizes the (width, height) parameters to
a full rect (x0, y0, x1, y1), since blitting operations will need to
be able to operate on arbitrary rectangles.  Also, it renames several
of the HiZ functions to reflect the expanded role they will serve.

v2: Rename brw_hiz_resolve_params to brw_hiz_op_params.  Move
gen{6,7}_blorp_exec() functions back into gen{6,7}_blorp.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-15 15:09:22 -07:00
Kenneth Graunke
610910a66d i965: Implement guardband clipping on Ivybridge.
Improves performance in Citybench:
- 320x240: 9.19589% +/- 0.557621%
- 1280x480: 3.90797% +/- 0.774429%

No apparent difference in OpenArena.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-15 14:52:24 -07:00
Kenneth Graunke
85cd30406f i965: Implement guardband clipping on Sandybridge.
Improves performance in Citybench:
- 320x240:  19.8008% +/- 0.937818%
- 1280x480: 6.53856% +/- 0.859083%

No apparent difference in OpenArena nor Xonotic.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-15 14:52:24 -07:00
José Fonseca
5994a641d8 llvmpipe: Add a test for lp_build_sgn.
Only floating point though, but better than nothing.
2012-05-15 22:39:25 +01:00
José Fonseca
9fb4eef6a1 gallivm: Fix lp_build_sgn for normalized/fixed-point integers.
These types got broken with the recent commit that fixed lp_build_sgn
for negative integers.
2012-05-15 22:39:24 +01:00
José Fonseca
c95cea50a9 gallivm: Fix lp_build_const_xxx for negative integers.
Do proper rounding.

Thanks to Olivier Galibert for investigating this.
2012-05-15 22:39:24 +01:00
Brian Paul
1459c18f45 svga: fix FBO / viewport bugs
When drawing to a FBO, the viewport wasn't always set correctly.  It
was fine in the usual case of the viewport dims matching the surface
dims but broken otherwise.  In particular, this was happening because
the viewport scale is negative for FBO rendering.

The piglit fbo-viewport test exercises this.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-15 14:56:54 -06:00
Vadim Girlin
4a8d47c264 radeon/llvm: add support for texture offsets, fix TEX_LD
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:53:20 +04:00
Vadim Girlin
fa5a963dd6 radeon/llvm: add SET_GRADIENTS*, fix SAMPLE_G
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:53:06 +04:00
Vadim Girlin
b655f78b25 radeon/llvm: increase const regs count
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:26 +04:00
Vadim Girlin
12a2374da3 radeon/llvm: use IntrNoMem property for intrinsics where possible
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:16 +04:00
Vadim Girlin
63a8595271 radeon/llvm: use correct intrinsic for CEIL
Should be round_posinf instead of round_neginf.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:06 +04:00
Vadim Girlin
0298238bdd radeon/llvm: improve ABS_i32 lowering
We can save one instruction by lowering it to:
  SUB_INT tmp, 0, src
  MAX_INT dst, src, tmp

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:53 +04:00
Vadim Girlin
76e4898ba3 radeon/llvm: fix BUILD_VECTOR lowering for replicated value
We expect that all elements will be assigned even if they are equal

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:38 +04:00
Vadim Girlin
4b8db65dbf radeon/llvm: add names for AMDGPU* passes
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:22 +04:00
Vadim Girlin
76ba7e2205 radeon/llvm: add generated files to .gitignore
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:02 +04:00
Paul Berry
821c34ecd9 Add .gitignore files for recently-added gallium projects
This patch adds .gitignore files to ignore the makefiles generated by
the gallium pipe loader and the clover OpenCL state tracker.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-05-15 07:39:05 -07:00
José Fonseca
e88f9b9546 glsl: Fix lower_discard_flow prototype mismatch.
Should fix MSVC link failure.
2012-05-15 12:27:15 +01:00
Eric Anholt
9e9ae280e2 Revert "i965/fs: Jump from discard statements to the end of the program when done."
This reverts commit 31866308fc.

Fixes piglit glsl-fs-discard-exit-3 and unigine tropics rendering.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:53 -07:00
Eric Anholt
3de1395fa5 glsl: Implement the GLSL 1.30+ discard control flow rule in GLSL IR.
Previously, I tried implementing this in the i965 driver, but did so
in a way that violated the intent of the spec, and broke Tropics.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:51 -07:00
Eric Anholt
e21b9f1f19 glsl: Remove the opt_discard_simplification pass.
This conflicts with the GLSL 1.30+ rules for derivatives after a
discard has occurred.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:44 -07:00
Eric Anholt
f42cdc7984 i965/fs: Remove the requirement of no dead code for interference checks.
This will be convenient when I want to comment out optimization code
to see the raw program being optimized, but more importantly will let
the interference check be used during optimization.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:53:19 -07:00
Eric Anholt
d7787adda8 i965/fs: Add support for copy propagation.
We could do more by handling abs/negate and non-GRF sources, but this is
a good start.  Improves tropics performance 0.30% +/- .17% (n=43).

shader-db results:
Total instructions: 208032 -> 207184
60/1246 programs affected (4.8%)
23286 -> 22438 instructions in affected programs (3.6% reduction)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:53:19 -07:00
Eric Anholt
f7a71e2570 i965/fs: When doing no work for live interval calculation, do no allocation.
When I had a bug causing the backend to never finish optimizing, it
also sent me deep into swap.  This avoids extra memory allocation per
trip through optimization, and thus may reduce the peak memory
allocation of the driver even in the success case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:51:00 -07:00
Eric Anholt
206eca631b i965/gen7: Set tile_x/y to 0 in the no-stencil case.
Fixes compiler warnings.
2012-05-14 16:51:00 -07:00
Eric Anholt
1e188f2dae intel: Fix signed/unsigned comparison warnings. 2012-05-14 16:51:00 -07:00
Eric Anholt
1c1040dcf0 intel: Fix compile warning from 7b6424143d 2012-05-14 16:51:00 -07:00
Eric Anholt
cdca6e3c9f intel: Fix compiler warning from 3cd7bee48f 2012-05-14 16:51:00 -07:00
Kenneth Graunke
a4e9b5a768 i965/fs: Add a local common subexpression elimination pass.
Total instructions: 18210 -> 17836
49/163 programs affected (30.1%)
12888 -> 12514 instructions in affected programs (2.9% reduction)

This reduces Lightsmark's "Scale down filter" shader from 395
instructions to 283, a whopping 28%.  It also reduces register pressure
significantly: the SIMD8 program now uses 29 registers instead of 101,
giving us more than enough room for a SIMD16 program.

v2: Add && !inst->conditional_mod to the "skip some instructions" check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-14 15:13:55 -07:00
Kenneth Graunke
d1029f9988 i965/fs: Use a const reference in fs_reg::equals instead of a pointer.
This lets you omit some ampersands and is more idiomatic C++.  Using
const also marks the function as not altering either register (which
was obvious, but nice to enforce).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-14 15:12:46 -07:00
Oliver McFadden
bf78806133 mesa: print the Git SHA1 in GL_VERSION for ES1 and ES2.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 19:13:44 +03:00
Oliver McFadden
60e8a49440 mesa: GLES specifies restrictions on uniform matrix transpose.
GL_INVALID_VALUE is generated if transpose is not GL_FALSE.

http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 19:13:43 +03:00
Michel Dänzer
8969de7e98 radeonsi: Keep around copies of original sampler states.
Fixes crashes when restoring sampler states after blits.
2012-05-14 17:56:03 +02:00
Michel Dänzer
1deb2be2b7 radeonsi: Flesh out shader interpolation related code.
Handle perspective interpolation and ceontroid vs. center.
2012-05-14 17:56:03 +02:00
Michel Dänzer
de52a56a0e radeonsi: Add proper SI family names. 2012-05-14 17:56:02 +02:00
Michel Dänzer
23e4fe2a53 radeonsi: Separate states for samplers and sampler views.
And reset nregs on updates. Prevents eventual assertion failure.
2012-05-14 17:56:02 +02:00
Michel Dänzer
36abadd0db radeonsi: Fixups for drawing with an index buffer.
Mostly using the DRAW_INDEX_2 type 3 packet instead of DRAW_INDEX, which is
no longer supported on SI.
2012-05-14 17:56:02 +02:00
Vinson Lee
599140119e vl: Initialize pipe_vertex_buffer.user_buffer fields.
Fix uninitialized scalar variable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-14 08:44:16 -07:00
James Benton
24678700ed llvmpipe: Calculate fixed point coordinates for triangle setup earlier.
This allows us to calculate the triangle's area using fixed point,
previously it was cacluated in floating point space. It was possible
that a triangle which had negative area in floating point space had
a positive area in fixed point space.

Fixes fdo 40920.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 16:07:49 +01:00
Tom Stellard
ec201667bf radeon/llvm: Coding style fixes for R600CodeEmitter.cpp 2012-05-14 10:40:58 -04:00
Tom Stellard
224e187f98 radeon/llvm: Lower bitcast instructions to copies 2012-05-14 10:40:58 -04:00
Marek Olšák
ed9955dc29 radeonsi: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-13 14:32:57 +02:00
Marek Olšák
05ea705c7c r600g: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-13 14:32:57 +02:00
Marek Olšák
b2d6386086 r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap (EG) 2012-05-12 23:13:45 +02:00
Marek Olšák
b496136af8 gallium: remove user_buffer_create from the interface
Nothing uses it now.
2012-05-12 23:13:45 +02:00
Marek Olšák
1a840cc592 gallium/graw: stop using user_buffer_create
This is compile-tested.
2012-05-12 23:13:45 +02:00
Marek Olšák
685a28fd8a gallium/util: remove unused parameter nr_vertex_buffers in util_draw_max_index 2012-05-12 23:13:45 +02:00
Francisco Jerez
b70736fa82 clover: Fix build on i386. 2012-05-12 19:43:06 +02:00
Francisco Jerez
fcab4d4a34 clover: Check the total work-group size provided to clEnqueueNDRangeKernel. 2012-05-12 19:43:01 +02:00
Christoph Bumiller
5c9bccc97e clover, gallium: add PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK
This is not necessarily the product of MAX_BLOCK_SIZE[i].

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-05-12 19:33:48 +02:00
Francisco Jerez
ec848d2730 r600g: Handle compute caps. 2012-05-12 19:17:18 +02:00
Francisco Jerez
4065639310 r300g: Handle compute caps. 2012-05-12 19:17:13 +02:00
José Fonseca
f96540847e auxiliary/util: Ensure pipe_constant_buffer::user_buffer is initialized. 2012-05-12 17:23:52 +01:00
José Fonseca
7b49d4f05d scons: Fix missing gbm symbols in st/egl. 2012-05-12 17:10:32 +01:00
José Fonseca
96e73cc4ae targets/egl-static: Fix some missing symbols. 2012-05-12 17:10:32 +01:00
José Fonseca
fd687e06f0 trace: Fix pipe_context::clear dumping. 2012-05-12 17:10:31 +01:00
José Fonseca
b275bed549 trace: Fix pipe_shader_state dumping. 2012-05-12 17:10:31 +01:00
José Fonseca
e9efcd99d1 scons: Link r600_drm.so against libdrm-radeon 2012-05-12 17:10:31 +01:00
José Fonseca
9a23a69f45 trace: Match NULL context members. 2012-05-12 17:10:31 +01:00
Marek Olšák
7c799f8f6b gallium/docs: remove documentation of redefine_user_buffer 2012-05-12 13:09:19 +02:00
Michel Dänzer
74b9ef83cf radeonsi: Fixed point vertex formats aren't supported. 2012-05-12 12:27:10 +02:00
Michel Dänzer
24bc382010 radeonsi: Fixups for recent build infrastructure changes.
In particular for the pipe loader changes.
2012-05-12 12:12:21 +02:00
Dave Airlie
31a25dac98 r600g: setup COLOR1 for possible dual-src in the framebuffer bind
As pointed out by Marek, if we have only one cb, we may as well add this
single register write here rather than adding it in the draw loop.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-12 08:25:21 +01:00
Roy Spliet
e253ead78e nv30: Silence pipe_cap warnings
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:48 +10:00
Roy Spliet
897d235132 nv30/shader: SSG, LIT only requires one source register
Fixes crashing due to assertion error

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:47 +10:00
Ben Skeggs
6660041483 nouveau/vieux: finish != flush, how about we do that..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:47 +10:00
Marek Olšák
9d6b46b1cd r300g/swtcl: move vertex buffer updates into set_vertex_buffers 2012-05-12 00:50:53 +02:00
Marek Olšák
735d0d93a7 r300g/swtcl: move index buffer updates from swtcl_draw_vbo into set_index_buffer 2012-05-12 00:50:53 +02:00
Marek Olšák
21b012d3b0 r300g/swtcl: malloc vertex and index buffers (don't use radeon DRM to get them)
Vertex and index buffers are never used by hardware, only by Draw.
SWTCL chipsets usually have very little memory, so this might help
with stability and reliability.
2012-05-12 00:50:53 +02:00
Marek Olšák
8a963d122d r300g/swtcl: don't do stuff which is only for HWTCL 2012-05-12 00:50:52 +02:00
Marek Olšák
f808984f43 r300g: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-12 00:50:52 +02:00
Marek Olšák
4fd60ad6da r300g: remove user_buffer_create 2012-05-12 00:50:52 +02:00
Marek Olšák
bdba35befa r300g: fix breakage after gallium-userbuf merge 2012-05-12 00:50:52 +02:00
Brian Paul
550de24c17 llvmpipe: add cast to silence warning 2012-05-11 16:16:11 -06:00
Andreas Betz
9d6e908f14 vega: fix 565 color unpacking bug
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-11 16:13:14 -06:00
Brian Paul
93bcf7825d mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flags
Instead of having to hack the code to enable these debugging options,
set them through the MESA_DEBUG env var.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-11 16:13:14 -06:00
Brian Paul
014306578b mesa: implement DEBUG_ALWAYS_FLUSH debug option
This flag has been around for a while but it wasn't actually used anywhere.

Now, setting this flag causes a glFlush() to be issued after each
drawing call (including glBegin/End, glDrawElements, glDrawArrays,
glDrawPixels, glCopyPixels and glBitmap).
2012-05-11 16:13:14 -06:00
Brian Paul
da35c2b38c mesa: define DEBUG_SILENT flag, use in output_if_debug() 2012-05-11 16:13:14 -06:00
Brian Paul
88cd47187c mesa: clean-up the debug/verbose flag setup code
Split the verbose and debug flag setup code into separate functions.
2012-05-11 16:13:14 -06:00
Brian Paul
443195bdf8 mesa: do FLUSH_VERTICES() in _mesa_flush/finish()
This was being done in the _mesa_Flush/Finish() calls but if there
was an internal call to _mesa_flush/finish() the FLUSH_VERTICES()
wouldn't happen.  Looks like only the intel and radeon drivers made
such calls in MakeCurrent().
2012-05-11 16:13:14 -06:00
Brian Paul
1bc16bf98a mesa: fix glMaterial / dlist bug
When glColorMaterial() is used to latch glColor commands to a material
attribute, glMaterial calls to change that material should become no-ops.
This failed to work properly when the glMaterial call was inside a
display list.

This removes the Material function from the vbo_attrib_tmp.h template
file.  We have separate/different implementations for the "save" and
"exec" cases now.

NOTE: This is a candidate for the 8.0 branch.
2012-05-11 16:13:14 -06:00
Brian Paul
f272490546 mesa: fix/add error check in _mesa_ColorMaterial()
_mesa_material_bitmask() will record a GL error and return 0 if
face or mode are illegal.  Return early in that case.

NOTE: This is a candidate for the 8.0 branch.
2012-05-11 16:13:14 -06:00
Tom Stellard
bcfc97dbf4 radeon/llvm: More comments and cleanups 2012-05-11 15:09:52 -04:00
José Fonseca
23c0d469e5 gallivm: Fix copy'n'paste typo bug translating CEIL opcode.
Trivial.
2012-05-11 16:44:42 +01:00
Marek Olšák
d3bab0c7be r600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE 2012-05-11 17:36:11 +02:00
Marek Olšák
7435c04398 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2012-05-11 16:42:20 +02:00
Marek Olšák
bb4c5d72d7 Merge branch 'gallium-userbuf'
Conflicts:
	src/gallium/docs/source/screen.rst
	src/gallium/drivers/nv50/nv50_state.c
	src/gallium/include/pipe/p_defines.h
	src/mesa/state_tracker/st_draw.c
2012-05-11 16:38:13 +02:00
Tom Stellard
4d11a6a0c7 radeon/llvm: Fix Evergreen/Cayman tablegen predicates
Some Evergreen/Cayman instructions were being enabled for SI.
2012-05-11 09:43:47 -04:00
José Fonseca
96956dc507 gallium/tgsi: s/TGSI_BUFFER/TGSI_TEXTURE_BUFFER/
For consistency.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-11 14:37:00 +01:00
José Fonseca
223831ca14 gallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.
Some code relies on the existing of an invalid texture target. It seems
safer to bring it back than to deal with unintended consequences.

This partially reverts commit a4ebb04214.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-11 14:36:20 +01:00
James Benton
11aa82cc0b llvmpipe: Fix triangle bounding box calculation to be correctly inclusive or exclusive
Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-11 13:21:23 +01:00
James Benton
0c8a8a35e1 llvmpipe: Change triangle rasterization comparison from < 0 to <= 0
Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-11 13:21:21 +01:00
Francisco Jerez
60e7b08101 clover: Implement CL_MEM_COPY_HOST_PTR. 2012-05-11 12:39:44 +02:00
Alexey Shvetsov
19eae45e01 gallium/targets/pipe-loader: Prepend DESTDIR to the installation directory.
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
2012-05-11 12:39:44 +02:00
Tom Stellard
79d77b38b8 clover: Assorted build fixes.
Contains the following patches squashed in:

commit 9fff1dc0875f7c9591550fa3ebbe1ba7a18483fa
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:20:03 2012 +0100

    configure.ac: Build gallium loader when OpenCL is enabled

commit 542111cb02957418c6a285cb6ef2924e49adc66e
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:30:29 2012 +0100

    configure.ac: Add sw/null to GALLIUM_WINSYS_DIRS for gallium loader

commit 876f8de46062dde76b6075be3b6628f969b16648
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Thu Feb 9 11:26:05 2012 -0500

    configure.ac: Require gcc > 4.6.0 for clover

commit 99049d50fa3d9a23297ae658189c19c89dca1766
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:32:06 2012 +0100

    configure.ac: Require Gallium drm loader when gallium loader is enabled

    No longer silently exclude this when building OpenCL drivers
    for nouveau and r600.
2012-05-11 12:39:44 +02:00
Francisco Jerez
c6db1b3396 clover: Import OpenCL state tracker. 2012-05-11 12:39:44 +02:00
Francisco Jerez
309a186987 gallium/tests/trivial: Import compute unit tests.
Add a test program that tries to exercise some of the language
features commonly used by compute programs at the Gallium API level:

   - Correctness of the values returned by the grid parameters.
   - Proper functioning of resource LOADs and STOREs.
   - Subroutine calls.
   - Argument passing to the compute parameter through the INPUT
     memory space.
   - Mapping of buffer objects to the GLOBAL memory space.
   - Proper functioning of the PRIVATE and LOCAL memory spaces.
   - Texture sampling and constant buffers.
   - Support for multiple kernels in the same program.
   - Indirect resource indexing.
   - Formatted resource loads and stores (i.e. with channel conversion
     and scaling) using several different formats.
   - Proper functioning of work-group barriers.
   - Atomicity and semantics of the atomic opcodes.

As of now all of them seem to pass on my nvA8.
2012-05-11 12:39:44 +02:00
Francisco Jerez
b52a0f2281 gallium/gbm: Switch to auxiliary/pipe-loader.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:44 +02:00
Francisco Jerez
66f7fd99fa gallium/tests/trivial: Switch to the pipe loader.
It simplifies things slightly, and besides, it makes possible to
execute the trivial tests on a hardware device instead of being
limited to software rendering.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:44 +02:00
Francisco Jerez
317be33d73 gallium: Add "pipe-loader" target.
This target generates pipe driver modules intended to be consumed by
auxiliary/pipe-loader.  Most of it was taken from the "gbm" target --
the duplicated code will be replaced with references to this target in
a future commit.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:43 +02:00
Francisco Jerez
e136453062 gallium: Add pipe loader for device enumeration and driver multiplexing.
The goal is to have a uniform interface to create winsys and
pipe_screen instances for any driver, exposing the device enumeration
capabilities that might be supported by the operating system (for now
there's a "drm" back-end using udev and a "sw" back-end that always
returns the same built-in devices).

The typical use case of this library will be:
>
> struct pipe_loader_device devs[n];
> struct pipe_screen *screen;
>
> pipe_loader_probe(&devs, n);
>[pick some device from the array...]
>
> screen = pipe_loader_create_screen(dev, library_search_path);
>[do something with screen...]
>
> screen->destroy(screen);
> pipe_loader_release(&devs, N);
>

A part of the code was taken from targets/gbm/pipe_loader.c, which
will be removed and replaced with calls into this library by a future
commit.
2012-05-11 12:39:43 +02:00
Francisco Jerez
2faf01c840 gallium/tgsi/text: Replace open-coded integer parsing with parse_int(). 2012-05-11 12:39:43 +02:00
Francisco Jerez
40123dae43 gallium/tgsi/text: Parse immediates of non-float data types. 2012-05-11 12:39:43 +02:00
Francisco Jerez
e9072863b1 gallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types. 2012-05-11 12:39:43 +02:00
Francisco Jerez
a426b0d5bc gallium/tgsi/text: Make label parsing optional for branch instructions.
Structured branch instructions like IF, ELSE, BGNLOOP, ENDLOOP no
longer require a label argument, make it optional for them.
2012-05-11 12:39:43 +02:00
Francisco Jerez
49468a1b2a st/mesa: Use local temporary registers.
Local makes more sense in most places because non-inline function
calls are unimplemented anyway.
2012-05-11 12:39:42 +02:00
Francisco Jerez
b52e374ad3 gallium/tgsi/ureg: Support local temporary emission. 2012-05-11 12:39:42 +02:00
Francisco Jerez
1b8aecc797 gallium/tgsi/ureg: Lift the restriction on releasing temporaries over UREG_MAX_TEMP. 2012-05-11 12:39:42 +02:00
Francisco Jerez
0a62af3bcc gallium/util: Define util_strchrnul.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:42 +02:00
Francisco Jerez
57c048f291 gallium/compute: Drop TGSI dependency.
Add a shader cap for specifying the preferred shader representation.
Right now the only supported value is TGSI, other enum values will be
added as they are needed.

This is mainly to accommodate AMD's LLVM compiler back-end by letting
it bypass the TGSI representation for compute programs.  Other drivers
will keep using the common TGSI instruction set.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-11 12:39:42 +02:00
Francisco Jerez
2644952bd4 gallium/tgsi: Introduce the "LOCAL" register declaration modifier.
This change will be useful to implement function parameter passing on
top of TGSI.  As we don't have a proper stack, a register-based
calling convention will be used instead, which isn't necessarily a bad
thing given that GPUs often have plenty of registers to spare.

Using the same register space for local temporaries and
inter-procedural communication caused some inefficiencies, because in
some cases the register allocator would lose the freedom to merge
temporary values together into the same physical register, leading to
suboptimal register (and sometimes, as a side effect, instruction)
usage.

The LOCAL declaration modifier specifies that the value isn't intended
for parameter passing and as a result the compiler doesn't have to
give any guarantees of it being preserved across function boundaries.

Ignoring the LOCAL flag doesn't change the semantics of a valid
program in any way, because local variables are just supposed to get a
more relaxed treatment.  IOW, this should be a backwards-compatible
change.
2012-05-11 12:39:41 +02:00
Francisco Jerez
c2d31a83a8 gallium/tgsi: Add support for atomic opcodes. 2012-05-11 12:39:41 +02:00
Francisco Jerez
9e550c3423 gallium/tgsi: Add support for barriers. 2012-05-11 12:39:41 +02:00
Francisco Jerez
581ddbcf93 gallium/tgsi: Define system values used to query the compute grid parameters. 2012-05-11 12:39:41 +02:00
Francisco Jerez
b8e808f1ef gallium/tgsi: Add resource write-back support.
Define a new STORE opcode with a role dual to the LOAD opcode, and add
flags to specify that a shader resource is intended for writing.
2012-05-11 12:39:41 +02:00
Francisco Jerez
82c90b2da8 gallium/tgsi: Add support for raw resources.
Normal resource access (e.g. the LOAD TGSI opcode) is supposed to
perform a series of conversions to turn the texture data as it's found
in memory into the target data type.

In compute programs it's often the case that we only want to access
the raw bits as they're stored in some buffer object, and any kind of
channel conversion and scaling is harmful or inefficient, especially
in implementations that lack proper hardware support to take care of
it -- in those cases the conversion has to be implemented in software
and it's likely to result in a performance hit even if the pipe_buffer
and declaration data types are set up in a way that would just pass
the data through.

Add a declaration flag that marks a resource as typeless.  No channel
conversion will be performed in that case, and the X coordinate of the
address vector will be interpreted in byte units instead of elements
for obvious reasons.

This is similar to D3D11's ByteAddressBuffer, and will be used to
implement OpenCL's constant arguments.  The remaining four compute
memory spaces can also be understood as raw resources.
2012-05-11 12:39:41 +02:00
Francisco Jerez
a4ebb04214 gallium/tgsi: Define the TGSI_BUFFER texture target.
This texture type was already referred to by the documentation but it
was never defined.  Define it as 0 to match the pipe_texture_target
enumeration values.
2012-05-11 12:39:40 +02:00
Francisco Jerez
63428372ca gallium/tgsi: Introduce the compute processor. 2012-05-11 12:39:40 +02:00
Francisco Jerez
1279923d72 gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.
Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration
to a separate token -- they only make sense for FS inputs and we need
room for other flags in the top-level declaration token.
2012-05-11 12:39:40 +02:00
Francisco Jerez
5f55cbc7d9 gallium: Add context hooks for binding shader resources. 2012-05-11 12:39:40 +02:00
Francisco Jerez
a5f44cc8c2 gallium/tgsi: Split sampler views from shader resources.
This commit splits the current concept of resource into "sampler
views" and "shader resources":

"Sampler views" are textures or buffers that are bound to a given
shader stage and can be read from in conjunction with a sampler
object.  They are analogous to OpenGL texture objects or Direct3D
SRVs.

"Shader resources" are textures or buffers that can be read and
written from a shader.  There's no support for floating point
coordinates, address wrap modes or filtering, and, unlike sampler
views, shader resources are global for the whole graphics pipeline.
They are analogous to OpenGL image objects (as in
ARB_shader_image_load_store) or Direct3D UAVs.

Most hardware is likely to implement shader resources and sampler
views as separate objects, so, having the distinction at the API level
simplifies things slightly for the driver.

This patch introduces the SVIEW register file with a declaration token
and syntax analogous to the already existing RES register file.  After
this change, the SAMPLE_* opcodes no longer accept a resource as
input, but rather a SVIEW object.  To preserve the functionality of
reading from a sampler view with integer coordinates, the
SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS)
but take a SVIEW register instead of a RES register as argument.
2012-05-11 12:39:39 +02:00
Francisco Jerez
d9d82dcd00 gallium: Basic compute interface.
Define an interface that exposes the minimal functionality required to
implement some of the popular compute APIs.  This commit adds entry
points to set the grid layout and other state required to keep track
of the usual address spaces employed in compute APIs, to bind a
compute program, and execute it on the device.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-05-11 12:39:39 +02:00
Michel Dänzer
c2f1fbf912 radeonsi: Properly translate vertex format swizzle.
egltri_screen works correctly!
2012-05-11 11:54:58 +02:00
Tom Stellard
03d9c24c04 radeon/llvm: Remove AMDILMCCodeEmitter.cpp 2012-05-10 15:54:43 -04:00
Tom Stellard
628e5b208a radeon/llvm: Remove SILowerShaderInstructions.cpp 2012-05-10 15:41:32 -04:00
Tom Stellard
f8e9c29020 radeonsi/llvm: Move lowering of RETURN to ConvertToISA pass 2012-05-10 15:41:32 -04:00
Tom Stellard
fa63f97652 radeon/llvm: Add some comments 2012-05-10 15:41:31 -04:00
Tom Stellard
92faa21d29 radeon/llvm: Move util functions into AMDGPU namespace 2012-05-10 15:41:31 -04:00
Paul Berry
c569182461 i965/hiz: Convert gen{6,7}_hiz.h to gen{6,7}_blorp.h
This patch renames the gen6_hiz.h and gen7_hiz.h files to correspond
to the renames of the corresponding .cpp files (see previous commit).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:01 -07:00
Paul Berry
ea1274c9a6 i965/hiz: Convert gen{6,7}_hiz.c to C++
This patch converts the files gen6_hiz.c and gen7_hiz.c to C++, in
preparation for expanding the HiZ code to support arbitrary blits.

The new files are called gen6_blorp.cpp and gen7_blorp.cpp to reflect
the expanded role that this code will serve--"blorp" stands for "BLit
Or Resolve Pass".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:01 -07:00
Paul Berry
20b153b9ca i965/hiz: Make void pointer type casts explicit
Previous to this patch, gen6_hiz.c contained two implicit type casts
from void * to a a non-void pointer type.  This is allowed in C but
not in C++.  This patch makes the type casts explicit, so that
gen6_hiz.c can be converted into a C++ file.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Paul Berry
f28a7d0e77 intel: Work around differences between C and C++ scoping rules.
In C++, if a struct is defined inside another struct, or its name is
first seen inside a struct or function, the struct is nested inside
the namespace of the struct or function it appears in.  In C, all
structs are visible from toplevel.

This patch explicitly moves the decalartions of intel_batchbuffer to
toplevel, so that it does not get nested inside a namespace when
header files are included from C++.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Paul Berry
434fc8bde4 intel: Add extern "C" declarations to headers
These declarations are necessary to allow C++ code to call C code
without causing unresolved symbols (which would make the driver fail
to load).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Tom Stellard
b0bb125736 radeon/llvm: Auto-encode RAT_WRITE_CACHELESS_eg 2012-05-10 11:52:00 -04:00
Tom Stellard
fa3747ff2c radeon/llvm: Delete all instructions that have been custom lowered 2012-05-10 11:34:32 -04:00
Michel Dänzer
839cbd7853 radeonsi: Set NONE format for unused vertex shader position export slots. 2012-05-10 13:54:39 +02:00
Michel Dänzer
8f45cea81f radeonsi: Eliminate one more magic number for texture image resources. 2012-05-10 13:54:27 +02:00
Michel Dänzer
36d2914a19 radeonsi: Fix vertex buffer resource for stride 0. 2012-05-10 13:54:27 +02:00
Tom Stellard
788fd04dac radeon/llvm: Remove AMDGPUConstants.pm 2012-05-09 12:49:44 -04:00
Tom Stellard
c2e081030e radeon/llvm: Don't rely on tablegen for lowering int_AMDGPU_load_const 2012-05-09 12:49:44 -04:00
Tom Stellard
d0403cafd4 radeon/llvm: Make sure the LOAD_CONST def uses the isSI predicate 2012-05-09 12:49:44 -04:00
Brian Paul
a1c5513c17 svga: implement CEIL opcode translation
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-09 10:53:15 -06:00
Christoph Bumiller
f7665ca4fc glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil
The implementation using FLR was buggy, the second negation could
get lost.
2012-05-09 17:13:14 +02:00
Christoph Bumiller
6ae12bac59 gallium/drivers: handle TGSI_OPCODE_CEIL 2012-05-09 17:09:30 +02:00
Kai Wasserbäch
8c98635d4f r600g: Handle TGSI_OPCODE_CEIL (v2)
v2: Enabled CEIL on Cayman too.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-09 09:40:16 -04:00
Dave Airlie
729d914824 gallivm: implement iabs/issg opcode.
Reimplemented by Olivier Galibert <galibert@pobox.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-09 08:26:55 +01:00
Yuanhan Liu
f939776cb2 i965: fix wrong cube/3D texture layout
Fix wrong cube/3D texture layout for the tailing levels whose width or
height is smaller than the align unit.

From 965 B-spec http://intellinuxgraphics.org/VOL_1_graphics_core.pdf at
page 135:
   All of the LOD=0 q-planes are stacked vertically, then below that,
   the LOD=1 qplanes are stacked two-wide, then the LOD=2 qplanes are
   stacked four-wide below that, and so on.

Thus we should always inrease pack_x_nr, which results to the pitch of LODn
may greater than the pitch of LOD0. So we should refactor mt->total_width
when needed.

This would fix the following webgl test case on all gen4 platforms:
  conformance/textures/texture-size-cube-maps.html

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-05-09 15:13:56 +08:00
Tom Stellard
5aaaa6a426 radeon/llvm: Remove AMDILUtilityFunctions.cpp 2012-05-08 15:47:46 -04:00
Tom Stellard
21ab46eae8 radeon/llvm: Remove some unused functions from AMDILInstrInfo 2012-05-08 15:47:46 -04:00
Tom Stellard
f903da7335 radeon/llvm: Add some comments and fix coding style 2012-05-08 15:47:46 -04:00
Tom Stellard
a8d82c44f7 radeon/llvm: Remove the EXPORT_REG instruction 2012-05-08 15:47:46 -04:00
Tom Stellard
8a4c25dd7e radeon/llvm: Use a custom inserter to lower RESERVE_REG 2012-05-08 15:47:46 -04:00
Tom Stellard
94e797d0fa radeon/llvm: Use a custom inserter to lower STORE_OUTPUT 2012-05-08 15:47:46 -04:00
Tom Stellard
4226433625 radeon/llvm: Remove AMDGPULowerShaderInstructions class
It is no longer used.
2012-05-08 15:47:46 -04:00
Tom Stellard
ad385c402e radeon/llvm: Use a custom inserter to lower LOAD_INPUT 2012-05-08 15:47:45 -04:00
Tom Stellard
52a7f212d3 radeon/llvm: Remove the ReorderPreloadInstructions pass 2012-05-08 15:47:45 -04:00
Tom Stellard
e042b3aeed radeon/llvm: Remove old comment from AMDIL.h 2012-05-08 15:47:45 -04:00
Paul Berry
e19741c4d8 Add bin/compile to .gitignore
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 13:10:00 -07:00
Olivier Galibert
363c14ae0c glsl: Change built-in constant expression evaluation to run the IR.
This removes code duplication with
ir_expression::constant_expression_value and builtins/ir/*.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert
2ff7b121ca glsl: Add an origin pointer in the function signature object.
This points to the object with the function body, allowing us to map
from a built-in prototype to the actual body with IR code to execute.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert
8ec01ba2ff glsl: Add methods to copy parts of one ir_constant into another.
- copy_masked_offset copies part of a constant into another,
  assign-like.

- copy_offset copies a constant into (a subset of) another,
  funcall-return like.

These methods are to be used to trace through assignments and function
calls when computing a constant expression.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:50 -07:00
Olivier Galibert
a270e86d38 glsl: Add a constant_referenced method to ir_dereference*
The method is used to get a reference to an ir_constant * within the
context of evaluating an assignment when calculating a
constant_expression_value.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:47 -07:00
Olivier Galibert
6e4852a3a5 glsl: Add a variable context to constant_expression_value().
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:46 -07:00
Olivier Galibert
27a198388e glsl: Extend ir_constant::zero to handle more types.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:38 -07:00
Kenneth Graunke
f72e9b2041 glsl: Fix broken constant expression handling for <, <=, >, and >=.
We were looping over all the vector components, but only dealing with
the first one.  This was masked by the fact that constant expression
handling on built-ins went through custom code for the lessThan()
/function/ rather than the ir_binop_less expression operator.

NOTE: This is a candidate for all release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:28:44 -07:00
Brian Paul
c55ebc3e3e vbo: add some comments 2012-05-08 12:12:03 -06:00
Brian Paul
ad5e3609d4 mesa: remove needless casts in save_EdgeFlag() 2012-05-08 12:12:03 -06:00
Brian Paul
2428de1c50 mesa: minor clean-ups in dlist material code 2012-05-08 12:12:03 -06:00
Brian Paul
b13ecbadea mesa: fix error strings in dlist code 2012-05-08 12:12:03 -06:00
Marek Olšák
c5e473fbe2 mesa: add gl_context::NewDriverState and use it for vertex arrays
The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use
the same flag to notify the driver. Since we've run out of bits in NewState
and NewState is for core Mesa anyway, we need to find another way.

This patch is the first to start decoupling the state flags meant only
for core Mesa and those only for drivers.

The idea is to have two flag sets:
- gl_context::NewState - used by core Mesa only
- gl_context::NewDriverState - used by drivers only (the flags are defined
                               by the driver and opaque to core Mesa)

It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module
that the user changed vertex arrays, and the vbo module in turn sets
a driver-specific flag to notify the driver that it should update its vertex
array bindings.

The driver decides which bits of NewDriverState should be set and stores them
in gl_context::DriverFlags. Then, Core Mesa can do this:
ctx->NewDriverState |= ctx->DriverFlags.NewArray;

This patch implements this behavior and adapts st/mesa.
DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS.

Core Mesa only sets NewDriverState. It's the driver's responsibility to read
it whenever it wants and reset it to 0.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Marek Olšák
50f7e75f9e mesa: move gl_client_array*[] from vbo_draw_func into gl_context
In the future we'd like to treat vertex arrays as a state and
not as a parameter to the draw function. This is the first step
towards that goal. Part of the goal is to avoid array re-validation
for every draw call.

This commit adds:
const struct gl_client_array **gl_context::Array::_DrawArrays.

The pointer is changed in:
* vbo_draw_method
* vbo_rebase_prims - unused by gallium
* vbo_split_prims - unused by gallium
* st_RasterPos

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Marek Olšák
a7ac9c9c7d vbo: move vbo_draw_method into vbo_context.h
I'll need vbo_context in that function soon.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Vadim Girlin
d6aa7cd7f8 radeon/llvm: add suport for cube textures
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
e98e209528 radeon/llvm: add support for CUBE ALU instruction
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
996fa375ec radeon/llvm: add support for some ALU instructions
Add support for IABS, NOT, AND, XOR, OR, UADD, UDIV, IDIV, MOD, UMOD, INEG,
I2F, U2F, F2U, F2I, USEQ, USGE, USLT, USNE, ISGE, ISLT, ROUND, MIN, MAX,
IMIN, IMAX, UMIN, UMAX

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
e9be193430 radeon/llvm: add missing cases for BREAK/CONTINUE
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
e740b60845 radeon/llvm: add support for AHSR/LSHR/LSHL instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
95ed0e9b6b radeon/llvm: add support for TXQ/TXF/DDX/DDY instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
d8a1204854 radeon/llvm: add support for VertexID, InstanceID
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
e3e7ae732c radeon/llvm: fix live-in handling for inputs
Set the input registers as live-in for entry basic block.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
757f471ba9 radeon/llvm: add support for v4i32
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
06db74a753 radeon/llvm: fix ABS_i32 instruction lowering
Swap source operands.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
3a6a1cd75f radeon/llvm: use integer comparison for IF
Replacing "float equal to 1.0f" with "int not equal to 0".
This should help for further optimization of boolean computations.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
2a88dfc521 radeon/llvm: use bitcasts for integers
We're using float as default type, so basically for every instruction that
wants other types for dst/src operands we need to perform the bitcast
to/from default float. Currently bitcast produces no-op MOV instruction,
will be eliminated later.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:21 +04:00
Tom Stellard
3f8c37967a r600g: Fix out of tree builds that use the LLVM backend
https://bugs.freedesktop.org/show_bug.cgi?id=49567
2012-05-07 15:05:25 -04:00
Tom Stellard
c425c3823f radeon/llvm: Remove references to DebugFlag and isCurrentDebugType()
These weren't being used at all and they were causing build failures
when LLVM was built with NDEBUG defined and mesa was not.

https://bugs.freedesktop.org/show_bug.cgi?id=49110
2012-05-07 14:01:53 -04:00
Paul Berry
714b4f6184 i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen7, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
2012-05-07 10:50:33 -07:00
Paul Berry
a683012a80 i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen6, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

(Note that we have only ever observed this GPU hang on Gen6 when HiZ
is enabled, so another possible stopgap would be to disable HiZ).

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
2012-05-07 10:50:04 -07:00
Paul Berry
b9819a027d fbo: Only reuse depth/stencil attachments if the parameters match.
When the user attaches a texture to one of the depth/stencil
attachment points (GL_STENCIL_ATTACHMENT or GL_DEPTH_ATTACHMENT), we
check to see if the same texture is also attached to the other
attachment point, and if so, we re-use the existing texture
attachment.  This is necessary to ensure that if the user later
queries what is attached to GL_DEPTH_STENCIL_ATTACHMENT, they will not
receive an error.

If, however, the user attaches buffers to the two different attachment
points using different parameters (e.g. a different miplevel), then we
can't re-use the existing texture attachment, because it is pointing
to the wrong part of the texture.  This might occur as a transitory
condition if, for example, if the user attached miplevel zero of a
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, rendered to
it, and then later attempted to attach miplevel one of the same
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT.

This patch causes Mesa to check that GL_STENCIL_ATTACHMENT and
GL_DEPTH_ATTACHMENT use the same attachment parameters before
attempting to share the texture attachment.

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 depth_stencil_shared"
and "texturing/depthstencil-render-miplevels 1024
stencil_depth_shared".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-07 10:48:53 -07:00
Paul Berry
3ec0e55b63 i965: Fix mipmap offsets for HiZ and separate stencil buffers.
When rendering to a miplevel other than 0 within a color, depth,
stencil, or HiZ buffer, we need to tell the GPU to render to an offset
within the buffer, so that the data is written into the correct
miplevel.  We do this using a coarse offset (in pages), and a fine
adjustment (the so-called "tile_x" and "tile_y" values, which are
measured in pixels).

We have always computed the coarse offset and fine adjustment using
intel_renderbuffer_tile_offsets() function.  This worked fine for
color and combined depth/stencil buffers, but failed to work properly
when HiZ and separate stencil were in use.  It failed to work because
there is only one set of fine adjustment controls shared by the HiZ,
depth, and stencil buffers, so we need to choose tile_x and tile_y
values that are compatible with the tiling of all three buffers, and
then compute separate coarse offsets for each buffer.

This patch fixes the HiZ and separate stencil case by replacing the
call to intel_renderbuffer_tile_offsets() with calls to two functions:
intel_region_get_tile_masks(), which determines how much of the
adjustment can be performed using offsets and how much can be
performed using tile_x and tile_y, and
intel_region_get_aligned_offset(), which computes the coarse offset.

intel_region_get_tile_offsets() is still used for color renderbuffers,
so to avoid code duplication, I've re-worked it to use
intel_region_get_tile_masks() and intel_region_get_aligned_offset().

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 X" where X is one of
(depth, depth_and_stencil, depth_stencil_single_binding, depth_x,
depth_x_and_stencil, stencil, stencil_and_depth, stencil_and_depth_x).

On i965 Gen7, the variants of
"texturing/depthstencil-render-miplevels" that contain a stencil
buffer still fail, due to another problem: Gen7 seems to ignore the 3
LSB's of the tile_y adjustment (and possibly also tile_x).

v2: Removed spurious comments.  Added assertions to check
preconditions of intel_region_get_aligned_offset().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-07 10:47:49 -07:00
Chad Versace
1c0f5d8324 intel: Disable ARB_framebuffer_object in ES contexts
This patch removes ARB_framebuffer_object from the GLES1 and GLES2
extension lists in intel_extensions_es.c.

Fixes a crash in the Android browser on Ice Cream Sandwich.

The Android browser crashed because it did the following, which is legal
in GLES2 but not in ARB_framebuffer_object.
    glGenFramebuffers(1, &fb);
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // render render render...
    glDeleteFramebuffers(1, &fb);
    // go do other stuff...
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // This bind unexpectedly failed, and the app panics.

The semantics of glBindFramebuffer specified by ARB_framebuffer_object (a
desktop GL extension) and GLES2 specs are incompatible. The ideal solution
to fix this is to create separate API entry points for glBindFramebuffer,
one for GL and the other for GLES2. But, until that work is complete,
disabling ARB_framebuffer_object in GLES2 contexts safely fixes the problem.

Likewise, the semantics of glBindFramebuffer in ARB_framebuffer_object and
of glBindFramebufferOES in OES_framebuffer_object (a GLES1 extension) are
incompatible. Even though the functions have different names, the semantic
difference still results in a bug because both API calls are implemented
by a single function, _mesa_BindFramebufferEXT, which handles the semantic
difference incorrectly. Again, disabling ARB_framebuffer_object in GLES1
contexts safely fixes this problem.

According to the ARB_framebuffer_object spec, the extension is an
amalgamation of
    EXT_framebuffer_object
    EXT_framebuffer_blit
    EXT_packed_depth_stencil
    EXT_framebuffer_multisample
By disabling this extension, however, no functionality is removed from
GLES1 and GLES2 contexts because 1) the first three extensions are
explicitly enabled in Intel's ES extension lists and 2) no functionality
of the last extension is exposed in an ES context.

Note: This is a candidate for the 8.0 branch.
See-also: http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg21006.html
CC: Charles Johnson <charles.f.johnson@intel.com>
CC: Sean Kelley <sean.v.kelley@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-07 08:38:12 -07:00
Brian Paul
64c510bb72 mesa: bump version to 8.1.0 in configs/default 2012-05-07 07:30:04 -06:00
Marcin Slusarz
ecc7e5e85b nv50: handle VP without inputs 2012-05-07 14:05:35 +02:00
Christoph Bumiller
c19672f90a nvc0/ir: allow abs,neg source modifiers with ceil,floor,trunc 2012-05-06 22:03:06 +02:00
Christoph Bumiller
28d6a268af nv50/ir/opt: don't lose saturation in tryCollapseChainedMULs 2012-05-06 22:03:06 +02:00
Christoph Bumiller
38a20281fc nvc0/ir: fix lowering of textureGrad 2012-05-06 22:03:06 +02:00
Christoph Bumiller
9dfac63ae0 nouveau: fix nouveau_scratch_runout_release bo count underflow 2012-05-06 22:03:06 +02:00
Jordan Justen
5795d3b5ae mesa: Add primitive restart support to glArrayElement
When primitive restart is enabled, and glArrayElement is called
with the restart index value, then call glPrimitiveRestartNV.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul<brianp@vmware.com>
2012-05-05 20:35:08 -07:00
Baldo Davide
0ad0bc5af5 auxiliary/os: Add missing signal.h include.
The signal.h include was missed in the commit
bc16c73407 which leads to broken
compilations under Linux.

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-05 04:51:32 +01:00
Kenneth Graunke
3cd7bee48f intel: Remove pointless software fallback for glBitmap on Gen6.
We already have a meta path below that works just fine; no apparent
regressions in oglconform.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46834
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-04 17:19:43 -07:00
Eric Anholt
4595288ba8 glsl: Fix regression in function out-parameter lvalue detection.
When doing the var->assigned change in
f2475ca424, I overzealously indented the
second block of code into the "if (var)" test.  Revert these blocks to
the way they were before, just taking advantage of "var" to avoid
re-calling variable_referenced().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49066
2012-05-04 14:00:32 -07:00
Eric Anholt
3362c7d9b6 mesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE. 2012-05-04 14:00:32 -07:00
Eric Anholt
dc42910e98 i965/fs: Fix regression in comparison handling from ANDs change.
I had fixed up the logic ops for delayed ANDing, but not equality
comparisons on bools.  Fixes new piglit fs-bool-less-compare-true.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
2012-05-04 14:00:32 -07:00
Eric Anholt
b2ee5a08ba glsl: Don't consider unused FS out variables as being statically assigned.
I only considered var->assigned for FragColor and FragData, but
ignored when it was false for out vars.  Fixes piglit
write-gl_FragColor-and-not-user-output.frag

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49068
2012-05-04 14:00:32 -07:00
Eric Anholt
fcd57280ae i965: Add a comment about the state flag for sRGBEnabled.
I thought this might be _NEW_COLOR, but it isn't.
2012-05-04 14:00:32 -07:00
Eric Anholt
b7406404ab intel: Return success when asked to allocate a 0-width/height renderbuffer.
It seems silly that GL lets you allocate these given that they're
framebuffer attachment incomplete, but the webgl conformance tests
actually go looking to see if the getters on 0-width/height
depth/stencil renderbuffers return good values.  By failing out here,
they all got smashed to 0, which turned out to be correct for all the
getters they tested except for GL_RENDERBUFFER_INTERNAL_FORMAT.  Now,
by succeeding but not making a miptree, that one also returns the
expected value.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-04 14:00:32 -07:00
Eric Anholt
6508b0b9b0 glsl: Always copy the index when cloning a variable.
The index is also used for GL_ARB_blend_func_extended.  Cloning in
i965 was dropping a non-ARB_explicit_attrib_location index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-04 14:00:32 -07:00
Eric Anholt
b7932e183c i965: Add support for GL_ARB_draw_buffers_blend.
Tested with piglit fbo-draw-buffers-blend and intel oglconform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-04 14:00:32 -07:00
Christoph Bumiller
9ef549d7cd nv50: fix typo causing NULL-deref in nv50_resource_resolve
Introduced in b328949a37.
2012-05-04 18:00:46 +02:00
Christoph Bumiller
dffc2fb4e6 nv50/ir: move expansion of IMUL to later stage and handle memory operands 2012-05-04 18:00:40 +02:00
Christoph Bumiller
02fac29305 nv50: implement stream output 2012-05-04 18:00:07 +02:00
Christoph Bumiller
8a44ecdae8 nv50: enable array textures 2012-05-04 18:00:03 +02:00
Brian Paul
c66dc0ea8e svga: specify 4-byte aligned vertex elements
We haven't found a case where this is needed, but it would be prudent
for some hosts, per Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-04 08:12:53 -06:00
Brian Paul
e039fd079b gallivm: fix comment typo 2012-05-04 08:07:58 -06:00
Brian Paul
a0c380a744 docs: another viewperf bug 2012-05-04 08:07:58 -06:00
Brian Paul
a36581ccc0 mesa: do more teximage error checking for generic compressed formats
When glTexImage or glCopyTexImage is called with internalFormat being a
generic compressed format (like GL_COMPRESSED_RGB) we need to do the same
error checks as for specific compressed formats.  In particular, check if
the texture target is compatible with the format.  None of the texture
compression formats we support so far work with GL_TEXTURE_1D, for example.

See also https://bugs.freedesktop.org/show_bug.cgi?id=49124

NOTE: This is a candidate for the 8.0 branch.
2012-05-04 08:07:58 -06:00
Vinson Lee
5cc4b4aaf4 scons: Do not build EGL on Solaris.
The current EGL headers do not support Solaris.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-03 22:58:35 -07:00
Jeremy Huddleston
51691f0767 darwin: Use ASL for logging
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:34 -07:00
Jeremy Huddleston
cf5db0a418 darwin: Make reported errors more user-friendly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Jeremy Huddleston
244dc05214 darwin: Fix an error message
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Robert Hooker
c384c5d4d7 egl_dri2: Fix out of tree builds with the wayland backend enabled
Otherwise it fails like so:

  CC     egl_dri2.lo
In file included from egl_dri2.h:40:0,
                 from egl_dri2.c:42:
../../../../../../src/egl/wayland/wayland-drm/wayland-drm.h:8:41:
fatal error: wayland-drm-server-protocol.h: No such file or directory
compilation terminated.
2012-05-03 11:45:59 -04:00
Kristian Høgsberg
4fddb2ba21 gbm: Add gbm_bo_write entry point
This new gbm entry point allows writing data into a gbm bo.  The bo has
to be created with the GBM_BO_USE_WRITE flag, and it's only required to
work for GBM_BO_USE_CURSOR_64X64 bos.

The gbm API is designed to be the glue layer between EGL and KMS, but there
was never a mechanism initialize a buffer suitable for use with KMS
hw cursors.  The hw cursor bo is typically not compatible with anything EGL
can render to, and thus there's no way to get data into such a bo.

gbm_bo_write() fills that gap while staying out of the efficient
cpu->gpu pixel transfer business.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2012-05-03 10:57:32 -04:00
Tom Stellard
b4789860c4 r600g/llvm: Mask write of pred_inst in llvm_if() 2012-05-03 09:20:24 -04:00
Tom Stellard
9e522bd201 r600g/llvm: Lower ULT A, B, C to SETGT_UINT A, C, B 2012-05-03 09:20:23 -04:00
Tom Stellard
a2e08a40f5 r600g: Print integer values of literal constants in shader dumps 2012-05-03 09:20:23 -04:00
Tom Stellard
18617d7423 r600g: Add support for reading BREAK_LOGICALZ_i32 from bytestream 2012-05-03 09:20:23 -04:00
Tom Stellard
ddb4dac133 r600g/llvm: Don't duplicate R600 intrinsics installed by LLVM
At this point, in order for OpenCL to work correctly with r600g, OpenCL
specific intrinsics need to be defined in the LLVM tree.  So, we need
to check for these intrinsics in the LLVM include directory to make sure
not to re-define them.
2012-05-03 09:20:17 -04:00
Tom Stellard
1bd3dafeca r600g: Fix the evergreen offset/end register definitions 2012-05-02 15:59:57 -04:00
Dylan Noblesmith
d5a10dba64 glsl: report errors via GL_ARB_debug_output
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:23 +00:00
Dylan Noblesmith
8c99906cf5 glsl: add gl_context member
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Dylan Noblesmith
58fee81c78 mesa: add _mesa_shader_debug()
This should be the one entrypoint libglsl needs
for GL_ARB_debug_output.

v2: added comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Dylan Noblesmith
48e8a010ae glsl: consolidate error/warning code
And lay the groundwork for GL_ARB_debug_output.

v2: Add descriptive comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Tom Stellard
c8fb30abf1 radeon/llvm: Fix MachineInstr dump 2012-05-02 11:53:13 -04:00
Adam Rak
4731f1f52d r600g: fixed the bug with VTX fetches in TEX clauses for evergreen
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard
d0f6274489 winsys/radeon: Get max_pipes from the kernel
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard
e42df8e10a r600g: Add support for reading vertex fetches from bytestream
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Tom Stellard
6f50f939ef r600g: Add support for reading native instructions from the LLVM bytestream
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Tom Stellard
94a6a36379 r600g: Add FC_NATIVE instruction
This is a pseudo instruction that enables the LLVM backend to encode
instructions and pass it through r600_bytecode_build()

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Dave Airlie
4a26454e97 r600g: bypass alpha for integer types (v2)
This moves the alpha test control to derived state and disables alpha
testing for integer fbs.

fbo-blending test in piglit gets further when we do this (not a pass
but less fail).

v2: drop the fb_sx_alpha_test_control

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-02 12:06:22 +01:00
José Fonseca
494619ebac gallivm: Use debug_printf in lp_build_printf.
So that its output can be seen on GUI window apps.

Tested-by: James Benton <jbenton@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-05-02 10:24:34 +01:00
José Fonseca
9ad2cb1885 gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().
Brittle, complex, and unecesary. Just use function pointer constant.
2012-05-02 10:24:34 +01:00
José Fonseca
6cd76b800b gallivm: Add a lp_build_const_func_pointer() helper.
To be reused in all places where we want to call C code.
2012-05-02 10:24:34 +01:00
José Fonseca
0005bd9da2 gallivm: Cleanup/simplify lp_build_const_string_variable.
- Move to lp_bld_const where it belongs
- Rename to lp_build_const_string
- take the length from the argument (and don't count the zero terminator twice)
- bitcast the constant to generic i8 *
2012-05-02 10:24:34 +01:00
James Benton
c23fd547c0 gallivm: Added lp_build_const_mask_aos_swizzled
Allows the creation of const aos masks which have the mask swizzled
to match the correct format.

Updated existing mask creation code to use the swizzled version where
necessary (tgsi register masks and llvmpipe aos blending).

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:24:34 +01:00
José Fonseca
7d1f414103 gallivm: Move loop var declaration to beginning of scope. 2012-05-02 10:24:33 +01:00
James Benton
f64fe7d333 gallivm: added a debug function which allows llvm to print vectors of 16 unsigned ints
This is useful for debugging the linear llvm path as it handles pixels in this format

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:24:33 +01:00
James Benton
16b081f1b0 llvmpipe: add masking support to aos blend
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:23:52 +01:00
James Benton
9bc58d941a llvmpipe: Check when a shader does not satisfy 0 < imm < 1.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:23:21 +01:00
James Benton
c426e63aa0 gallivm: fixed memory leak in lp_build_tgsi_aos
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 10:13:00 +01:00
James Benton
0b0f4628d6 llvmpipe: Added support for color masks in AoS blending.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:12:48 +01:00
James Benton
85d09d1c61 gallivm: added aligned pointer get/set 2012-05-02 10:12:48 +01:00
James Benton
630fa26886 gallivm: llvm c-style for loops, allows us to create loops with conditions on entry, rather than condition check on loop 2012-05-02 10:12:48 +01:00
Viktor Novotný
83a02427e5 dri/nv10-nv20: Add support for S3TC
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2012-05-02 03:14:29 +02:00
Viktor Novotný
6d5efe96ee dri/nouveau: Add general support for compressed formats.
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2012-05-02 03:13:42 +02:00
Kenneth Graunke
b389b608d8 glsl: Remove some completed tasks from the old "TODO" file. 2012-05-01 14:46:43 -07:00
Tom Stellard
d742d812d8 radeon/llvm: Fix build for updated LLVM 3.1 release branch 2012-05-01 16:42:58 -04:00
Brian Paul
07f5dabc01 softpipe: use any_swizzle() helper in sp_tex_sample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
b5e44c2cfb softpipe: whitespace, comment clean-ups in sp_tex_sample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
92d899303a softpipe: implement coord clamping for texel fetches (TXF)
The GL spec says out of bounds fetches produce undefined results.
Use clamping to avoid failed assertions or crashes.

Fixes failed assertion in https://bugs.freedesktop.org/show_bug.cgi?id=49125
but the test still fails.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
7b610d5516 xlib: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
4433b0302d intel: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
264b584294 nouveau: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
47941bfaea radeon: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-05-01 11:39:34 -06:00
Tom Stellard
ff10dbf35f radeon/llvm: Add subtarget feature: DumpCode
With this feature enabled, the LLVM backend will dump the MachineIntrs
prior to emitting code.  The mesa env variable R600_DUMP_SHADERS will enable
this feature in the backend.
2012-05-01 13:12:27 -04:00
Brian Paul
8dd3e341b3 svga: check for and skip null vertex buffer pointers
Fixes regressions with google earth and other things.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-01 08:14:23 -06:00
Brian Paul
b5752e16e8 softpipe: cast away const to silence warning 2012-05-01 08:14:19 -06:00
Brian Paul
6e588dff57 svga: cast away const to silence warning 2012-05-01 08:14:19 -06:00
Vinson Lee
2d75a1e25e glsl: Initialize member variable in ir_copy_propagation_elements_visitor.
Fix uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-30 22:28:05 -07:00
Marek Olšák
96863baa42 u_vbuf: set user buffer pointer for drivers which support user buffers
It's not common to end up in u_vbuf and at the same time support user buffers
in a driver, but such a combination should work.
2012-05-01 00:19:45 +02:00
Dragomir Ivanov
7bf3fe851c r600g/llvm: Remove unnecessary dynamic casts
When the result of dynamic_cast is not checked, it can be replaced with
static_cast

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-30 16:43:34 -04:00
Dragomir Ivanov
7ed04fa7d8 r600g/llvm: Add pattern for llvm.AMDGPU.kill v2
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-30 16:43:34 -04:00
Tom Stellard
4da1fcacf1 r600g/llvm: Fix handling of MASK_WRITE instructions
We can't delete MASK_WRITE instructions from the program, because this
will cause instructions being masked by MASK_WRITE to be marked dead and
then deleted in the dce pass.
2012-04-30 16:43:34 -04:00
Tom Stellard
77d2780cbc radeon/llvm: Use a custom emit function for TGSI_OPCODE_KIL 2012-04-30 16:43:34 -04:00
Marek Olšák
8c5ff5a41f st/mesa: unmap upload buffer after uploading indices and constants 2012-04-30 20:56:25 +02:00
Sean V Kelley
fd0082c47e i965: Support Android RGBX8888 format for EGL generated images
Enabled MESA_FORMAT_RGBX8888_REV for RGBX.  Android software
requires RGBX8888 format to be supported for software rendering.
That requires EGL to be capable of generating images from this
format.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-30 11:22:46 -07:00
Sean V Kelley
81f95ce13d egl/android: Add support for RGBX_8888 used in Android native buffers
Add new format __DRI_IMAGE_FORMAT_XBGR8888 to __DRI_IMAGE.
HAL_PIXEL_FORMAT_RGBX_8888 now maps to __DRI_IMAGE_FORMAT_XBGR8888.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-30 11:22:46 -07:00
David Herrmann
1de377bd30 egl-fbdev: Fix compile-error by including errno.h
We use errno and EINVAL so include errno.h.

This patch introduced this bug:
http://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/state_trackers/egl/fbdev/native_fbdev.c?id=b60120608f6ddf4098bc324363197c979ee04cb7

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Cc: Chia-I Wu <olv@lunarg.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-04-30 13:27:05 -04:00
Ander Conselvan de Oliveira
249817e928 intel: set dri_format field for all images
Only images created with intel_create_image() had the field properly
set. Set it also on intel_dup_image(), intel_create_image_from_name()
and intel_create_image_from_renderbuffer().
2012-04-30 13:18:16 -04:00
Ander Conselvan de Oliveira
fc7d224e29 intel: properly return the image format on intel_query_image 2012-04-30 13:13:34 -04:00
Ander Conselvan de Oliveira
6c84f2992f gbm: add gbm_bo_get_device() function 2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
55aab92495 gbm: update documentation to reflect current behavior 2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
310d8d189d gbm: add gbm_bo_get/set_user_data()
This allows the user to associate some data to a gbm_bo and get a
callback when the bo is destroyed.
2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
f641c57cfa gbm: remove unused fields from gbm_dri_surface 2012-04-30 13:09:39 -04:00
Brian Paul
a53394ba66 svga: add cases for recently added PIPE_CAP queries 2012-04-30 10:38:05 -06:00
Dylan Noblesmith
18bb6852b2 mesa: reject immutable textures in glEGLImageTargetTexture2DOES()
GL_ARB_texture_storage says:

    The commands eglBindTexImage, wglBindTexImageARB, glXBindTexImageEXT or
    EGLImageTargetTexture2DOES are not permitted on an immutable-format
    texture.
    They will generate the following errors:
      - EGLImageTargetTexture2DOES: INVALID_OPERATION
      - eglBindTexImage: EGL_BAD_MATCH
      - wglBindTexImage: ERROR_INVALID_OPERATION
      - glXBindTexImageEXT: BadMatch

Fixing the EGL and GLX cases requires extending the DRI interface,
since setTexBuffer2 doesn't currently return any error information.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-30 14:52:47 +00:00
José Fonseca
4c23acb269 scons: Fix build without llvm.
radeonsi depends on llvm, so it must be disabled if llvm support is not enabled.
2012-04-30 07:47:01 +01:00
Marek Olšák
3ed72dd31d st/xorg: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
889c9a566c st/xa: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
fa20733a62 st/vega: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
0279d15c99 st/vega: use cso_draw_arrays 2012-04-30 01:18:49 +02:00
Marek Olšák
46fe17930e cso: cso_context should install u_vbuf by itself and not st/mesa
so that it's installed in the other state trackers too
2012-04-30 01:18:49 +02:00
Marek Olšák
f656607c35 st/xorg: fix compilation - wrong libkms include file 2012-04-30 01:18:49 +02:00
Marek Olšák
3b5f4b173b gallium/util: stop using user buffers in util_draw_texquad 2012-04-30 01:18:49 +02:00
Marek Olšák
3ac0683d63 gallium: remove pipe_resource::user_ptr
It's unused now.
2012-04-30 01:18:49 +02:00
Marek Olšák
65d451d9fa radeonsi: don't create temporary user buffer for r600_upload_const_buffer 2012-04-30 01:18:48 +02:00
Marek Olšák
0b7d48cbad gallium: add void *user_buffer to pipe_constant_buffer
This reduces CPU overhead when updating constants.
2012-04-30 01:18:48 +02:00
Marek Olšák
01bf5569c4 st/mesa: reorder code in draw_vbo 2012-04-30 01:18:47 +02:00
Marek Olšák
944b97990b st/mesa: remove more unnecessary code in draw_vbo
The variables set here are not used anywhere.
2012-04-30 01:16:03 +02:00
Marek Olšák
bf469f4edc gallium: add void *user_buffer in pipe_index_buffer
Adapted drivers: i915, llvmpipe, r300, r600, radeonsi, softpipe.

User index buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
2012-04-30 01:14:28 +02:00
Marek Olšák
43995c9470 gallium: remove pipe_context::redefine_user_buffer 2012-04-30 01:14:28 +02:00
Marek Olšák
4552fd50d9 gallium: add void *user_buffer in pipe_vertex_buffer
This reduces CPU overhead in st_draw_vbo and removes a lot of unnecessary code
in that function which was required only to comply with the gallium interface,
but wasn't any useful really.

Adapted drivers: i915, llvmpipe, r300, softpipe.
No changes required in: r600, radeonsi.

User vertex buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
2012-04-30 01:14:26 +02:00
Marek Olšák
7a05459726 st/mesa: make user constant buffers optional 2012-04-30 01:09:57 +02:00
Marek Olšák
507337864f gallium: change set_constant_buffer to be UBO-friendly 2012-04-30 01:09:57 +02:00
Marek Olšák
1b749dc34f gallium: add PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT
This is required for any serious constant buffer support.
Constant buffer offsets on ATI and NVIDIA DX10 and DX11 GPUs must be
a multiple of 256.

In OpenGL, this can be queried via GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT.
2012-04-30 01:09:57 +02:00
Marek Olšák
8c655f499c st/mesa: make user index buffers optional
v2: use a separate upload buffer for indices
2012-04-30 01:09:57 +02:00
Marek Olšák
989bdaab51 st/mesa: only set index buffer when drawing is indexed
and restructure the code a bit
2012-04-30 01:09:57 +02:00
Marek Olšák
437ab1d6df gallium: add PIPE_CAP_USER_INDEX_BUFFERS and PIPE_CAP_USER_CONSTANT_BUFFERS 2012-04-30 01:09:57 +02:00
José Fonseca
4c15a77f27 scons: Parse = operator in source lists too.
Should fix the scons build.
2012-04-29 21:44:05 +01:00
Christoph Bumiller
b328949a37 nv50,nvc0: fix depth/stencil resolve
Cannot sample depth/stencil with a single view, and needed to use
different shader code for nve4.
2012-04-29 18:03:18 +02:00
Christoph Bumiller
d46f969b84 nvc0/ir/opt: INTERP does not support JOIN 2012-04-29 18:03:15 +02:00
Christoph Bumiller
1f4c154f02 nv50/ir/opt: try to convert ABS(SUB) to SAD 2012-04-29 18:03:11 +02:00
Christoph Bumiller
d6ab3106cf nvc0/ir: try to use the optimal texture op mode
Don't really know what they are yet but for groups of textures, the
last one should use mode "p" and the others "t".
2012-04-29 18:02:37 +02:00
Christoph Bumiller
afcd7b5d16 nvc0/ir: initial implementation of nve4 scheduling hints 2012-04-29 17:59:06 +02:00
Christoph Bumiller
00fe442253 nvc0/ir: implement better placement of texture barriers
Put them before first uses instead of right after the texturing
instruction and cull unnecessary barriers.
2012-04-29 17:56:57 +02:00
Christoph Bumiller
163b290f88 nv50/ir/tgsi: fix handling of early RET
We have to actually emit RET, too, of course, not just the PRERET.
2012-04-29 17:55:36 +02:00
Christoph Bumiller
d9baa004ea nvc0/ir/emit: fix emitTXQ 2nd src 2012-04-29 17:55:13 +02:00
Christoph Bumiller
3a9f036e00 nvc0/ir/target: integer ADD doesn't support ABS modifier 2012-04-29 17:54:34 +02:00
Marek Olšák
18bcb962bb u_vbuf: unbind vertex buffers on destroy 2012-04-29 17:41:37 +02:00
Marek Olšák
7622496d7b u_blitter: fix resource leak 2012-04-29 17:31:27 +02:00
Marek Olšák
63ca2eda13 radeonsi: make r600_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
c69248fa3f r600g: make r600_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
498e71c156 r300g: make r300_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
a784d86508 r300g: use u_default_transfer_inline_write 2012-04-29 14:48:45 +02:00
Marek Olšák
2ed1cdb2a5 radeonsi: use u_default_transfer_inline_write 2012-04-29 14:48:45 +02:00
Marek Olšák
0a6120244e winsys/radeon: simplify buffer map/unmap functions
The idea is not to use pb_map and pb_unmap wrappers, calling straight
into the winsys.
2012-04-29 14:46:52 +02:00
Dylan Noblesmith
8e90913e9f mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0
As noted in commit be4e46b21a,
this was missing before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-29 11:18:31 +00:00
Dylan Noblesmith
e4c97f1e60 autoconf: pass -Wall to automake
And fix these warning that appear at autoreconf time:
"`:='-style assignments are not portable"

v2: Fix the recently-converted-to-automake r600.
2012-04-29 11:17:47 +00:00
Vinson Lee
e372aa6949 glsl: Remove unused member predicate from ir_dead_functions_visitor.
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-28 14:00:36 -07:00
Kenneth Graunke
b443ca96a5 i965/fs: Fix FB writes that tried to use the non-existent m16 register.
A little analysis shows that the worst-case value for "nr" is 17:
- base_mrf = 2                       ... 2
- header present (say gen == 5)      ... 4
- aa_dest_stencil_reg (stencil test) ... 5
- SIMD16 mode: += 4 * reg_width      ... 13
- source_depth_to_render_target      ... 15
- dest_depth_reg                     ... 17

This resulted in us setting base_mrf to 2 and mlen to 15.  In other
words, we'd try to use m2..m16.  But m16 doesn't exist pre-Gen6.  Also,
the instruction scheduler data structures use arrays of size 16, so this
would cause us to access them out of bounds.

While the debugger system routine may need m0 and m1, we don't use it
today, so the simplest solution is just to move base_mrf back to 1.
That way, our worst case message fits in m1..m15, which is legal.

An alternative would be to fail on SIMD16 in this case, but that seems
a bit unfortunate if there's no real need to reserve m0 and m1.

Fixes new piglit test shaders/depth-test-and-write on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48218
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-27 16:53:37 -07:00
Vinson Lee
6af4c9006c glsl: Remove unused member mem_ctx from ir_dead_functions_visitor.
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-26 21:09:42 -07:00
Ben Skeggs
9856fd02a0 nv30: properly init window information
Should fix >2k rendering issues reported on nv4x.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-27 09:32:57 +10:00
Tom Stellard
a2f7ecfa74 radeonsi/llvm: Silence a warning 2012-04-25 18:09:05 -04:00
Tom Stellard
21d3dd831e radeon/llvm: Remove unused header files 2012-04-25 12:52:44 -04:00
Tom Stellard
30f2a38cef radeon/llvm: Remove AMDILMachineFunctionInfo.cpp 2012-04-25 12:52:44 -04:00
Tom Stellard
540ec964db radeon/llvm: Remove AMDILModuleInfo.cpp 2012-04-25 12:52:43 -04:00
José Fonseca
914244e59d gallivm: Use lp_build_alloca instead of LLVMBuildAlloca on the loop limiter.
To ensure that the alloca is at the top of the function body, otherwise
LLVM will not eliminate them, causing stack misalignment on 32bits.

Reviewed-by: James Benton <jbenton@vmware.com>
2012-04-25 18:09:38 +01:00
Tom Stellard
9f45093433 radeon/llvm: Remove AMDILELFWriterInfo.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
d96682169e radeon/llvm: Remove AMDILLiteralManager.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
ba333a6518 radeon/llvm: Remove AMDILInliner.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
160d4a7891 radeon/llvm: Remove AMDILBarrierDetect.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
0e7161cce8 radeon/llvm: Remove AMDILPrintfConvert.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
04993c9630 radeon/llvm: Remove GlobalManager and KernelManager 2012-04-25 09:02:16 -04:00
Tom Stellard
8d3bf7ced5 radeon/llvm: Remove AsmPrinter files 2012-04-25 09:02:16 -04:00
Tom Stellard
ba9bd41880 radeon/llvm: Remove IOExpansion files 2012-04-25 09:02:16 -04:00
Tom Stellard
4b11f4321b radeon/llvm: Remove AMDILPointerManager.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
76940ba852 radeonsi/llvm: Fix initialization of SIMachineFunctionInfo
SIMachineFunctionInfo needs to be initialized before any of the
AMDIL passes.
2012-04-25 09:02:16 -04:00
José Fonseca
63da1aa5be mesa/st: Fix derreference after free. 2012-04-25 11:41:13 +01:00
Marek Olšák
1781d26faa gallium/docs: document the new vertex fetch CAPs 2012-04-24 23:10:46 +02:00
Christoph Bumiller
29a0c8cd60 nv50: fix typo in nv50_fragprog_assign_slots 2012-04-24 20:05:35 +02:00
Eric Anholt
e9df9636b9 glsl: Add implementation of inverse() for mat2/3/4.
This is taken from the ogl-math project, with Inverse renamed to adj
(since it's not actually the inverse), transposed, and our types
plugged in.  There are potential CSE opportunities in this code
(particularly for hardware with RCP but not DIV), but we should be
doing CSE anyway, so don't hand-optimize.

Fixes piglit inverse tests.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:15:47 -07:00
Eric Anholt
7de1331662 glsl: Add support for generating builtin code from GLSL instead of IR.
This takes advantage of the builtin compiler to generate IR into a
string, the same way we read GLSL for function prototypes for our
profiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:01:10 -07:00
Eric Anholt
41b47441d7 glsl: Make ir_reader parse the "temporary" variable qualifier.
This lets ir_reader eat the output of builtin_compiler on actual
function definitions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:01:07 -07:00
Eric Anholt
6a6cb03507 glsl: Add doxygen explaining what main.cpp is for.
I keep getting lost in the Makefile trying to figure out what to edit
to work on builtin_compiler or glsl_compiler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:00:54 -07:00
Eric Anholt
4650aea7a5 i965/vs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
2012-04-24 10:00:54 -07:00
Eric Anholt
f41ecade7b i965/fs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
2012-04-24 10:00:54 -07:00
Christoph Bumiller
587c221a29 nv50,nvc0: handle new vertex fetch caps 2012-04-24 13:37:03 +02:00
Christoph Bumiller
a48e5dee94 nv50,nvc0: don't initialize the draw module, we don't use it
But some day we might (e.g. for blending 16 bpp formats on nv50).
2012-04-24 13:35:44 +02:00
Christoph Bumiller
2170fed8f4 nv50: enable shader watchdog timer 2012-04-24 12:26:31 +02:00
Jeremy Huddleston
1a33c1b2b8 darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
2012-04-24 00:26:48 -07:00
Marek Olšák
2a311b18fc radeonsi: stop using u_vbuf and adapt to gallium interface changes 2012-04-24 01:39:22 +02:00
Marek Olšák
89c4888710 u_vbuf: don't call u_vbuf_upload_buffers if there's nothing to upload 2012-04-24 01:39:22 +02:00
Marek Olšák
634066946e u_vbuf: don't upload user buffers if the driver supports them 2012-04-24 01:39:22 +02:00
Marek Olšák
6fe30fbc96 u_vbuf: optimize u_vbuf_translate_find_free_vb_slots 2012-04-24 01:39:22 +02:00
Marek Olšák
b5e5e61439 u_vbuf: turn bool arrays into bitmasks and loops into bitwise operations
Optimized functions:
- u_vbuf_need_minmax_index
- u_vbuf_mapping_vertex_buffer_blocks
2012-04-24 01:39:22 +02:00
Marek Olšák
eaf8fe3335 u_vbuf: take advantage of all new vertex fetch caps 2012-04-24 01:39:22 +02:00
Marek Olšák
a0e352f5eb u_vbuf: simplify u_vbuf_set_vertex_buffers 2012-04-24 01:39:22 +02:00
Marek Olšák
039f53b814 u_vbuf: rename native_attribs -> driver_attribs 2012-04-24 01:39:22 +02:00
Marek Olšák
23b948057a r600g: move updating vertex buffer state into set_vertex_buffers 2012-04-24 01:39:22 +02:00
Marek Olšák
3e3737e9e2 st/mesa: always expose ARB_ES2_compatibility
u_vbuf translates GL_FIXED too if needed.
2012-04-24 01:39:22 +02:00
Marek Olšák
a78fd815d4 st/mesa: always expose ARB_half_float_vertex
u_vbuf kicks in and translates it to float if it's unsupported.
2012-04-24 01:39:22 +02:00
Marek Olšák
e0773da1e8 gallium: make user vertex buffers optional
This couldn't be split because it would break bisecting.

Summary:
* r300g,r600g: stop using u_vbuf
* r300g,r600g: also report that the FIXED vertex type is unsupported
* u_vbuf: refactor for use in the state tracker
* cso: wire up u_vbuf with cso_context
* st/mesa: conditionally install u_vbuf
2012-04-24 01:39:22 +02:00
Marek Olšák
79eafc14ca i915g: report that all vertex formats are supported
So that u_vbuf isn't enabled.
2012-04-24 01:39:22 +02:00
Marek Olšák
428855eea3 r600g: don't share u_upload_mgr with u_vbuf, create its own 2012-04-24 01:39:22 +02:00
Marek Olšák
e54cc2c070 r300g: don't share u_upload_mgr with u_vbuf, create its own 2012-04-24 01:39:22 +02:00
Marek Olšák
ae799a4948 u_vbuf: pull u_vbuf_draw_max_vertex_count into r300g 2012-04-24 01:39:22 +02:00
Marek Olšák
7fe3631a7a u_vbuf: make use of the new CAPs to determine what to do
This adds the ability to initialize u_vbuf_caps before creating u_vbuf itself.
It will be useful for determining if u_vbuf should be used or not.

Also adapt r300g and r600g.
2012-04-24 01:39:22 +02:00
Marek Olšák
978c1aa1d0 gallium drivers: report that user vertex buffers are supported 2012-04-24 01:39:21 +02:00
Marek Olšák
c9a9d1ba11 gallium: add CAPs for vertex fetcher
Supported vertex formats will be queried using
is_format_supported(.., PIPE_BIND_VERTEX_BUFFER, ..).
2012-04-24 01:39:21 +02:00
Marek Olšák
a52b3338c6 u_vbuf: remove u_vbuf_resource 2012-04-24 01:39:21 +02:00
Marek Olšák
7d36478d88 u_vbuf: use user_ptr from pipe_resource 2012-04-24 01:39:21 +02:00
Marek Olšák
e8ab3b1ce7 gallium: add user_ptr in pipe_resource
I need to access the pointer in st/mesa when I only have pipe_resource.
2012-04-24 01:39:21 +02:00
Marek Olšák
5ec7c28fdb u_vbuf: override draw_vbo 2012-04-24 01:39:21 +02:00
Marek Olšák
889238c8b1 u_vbuf: override create/bind/destroy_vertex_elements_state 2012-04-24 01:39:21 +02:00
Marek Olšák
2d03d4f4a3 u_vbuf: override set_vertex_buffers 2012-04-24 01:39:21 +02:00
Marek Olšák
31714ea4d5 u_vbuf: override set_index_buffer
This makes u_vbuf_mgr call the driver instead of the other way around.
2012-04-24 01:39:21 +02:00
Marek Olšák
76c4760e5d st/mesa: use cso_set_index_buffer and cso_draw_vbo
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Marek Olšák
0f00786868 gallium/util: use cso_draw_arrays in util_draw_vertex_buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Marek Olšák
76eefcc70c cso: add set_index_buffer and draw_vbo passthrough functions
v2: use util_draw_init_info

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Jeremy Huddleston
d9c9c7a111 darwin: Don't build gallium
fe3f98ed70 intentionally broke it, so
don't build it.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Jonas Maebe
c60ffd2840 apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Marek Olšák
802ca81e26 vbo: call UpdateState directly when notifying a driver about _NEW_ARRAY
Core Mesa doesn't need to know about this.

This also removes the hack in recalculate_input_bindings.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
6fc565a94b vbo: do FLUSH_CURRENT before validating and updating state
This fixes an assertion failure since:
   commit 81afdd20f3
   vbo: don't check twice whether it's valid to render

FLUSH_CURRENT may set _NEW_CURRENT_ATTRIB.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
edec3fa812 r300g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
f940c0a3d9 r600g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 22:58:02 +02:00
Brian Paul
7f5420762c r600g: init vars to silence warnings 2012-04-23 13:29:06 -06:00
Han Shen(沈涵)
b352d676e4 bin/mklib: remove '-m32' for arm linux
-m32 is not a valid option for ARM.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-04-23 13:27:07 -06:00
Brian Paul
99ed0b2f9b st/mesa: no-op glCopyPixels if source region is out of bounds
If the source region for a glCopyPixels is completely outside the
source buffer bounds, no-op the copy.  Fixes a failed assertion.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-04-23 13:27:07 -06:00
Tom Stellard
d7f9b6ce13 radeon/llvm: Don't print an error message when there is no error
A blank line with an empty error message was being printed even when the
target lookup succeeded.
2012-04-23 09:34:05 -04:00
Tom Stellard
f5fc3ac284 radeon/llvm: Lower VCREATE_v4f32 for R600 and SI 2012-04-23 09:34:05 -04:00
Tom Stellard
519789d7e6 r600g/llvm: Let ISel handle lowering to {INSERT,EXTRACT}_SUBREG 2012-04-23 09:34:05 -04:00
Tom Stellard
3c0f521cbf r600g/llvm: Only emit an instruction's explicit operands 2012-04-23 09:34:05 -04:00
Tom Stellard
b3863eb9a5 r600g/llvm: Handle copies between vector registers 2012-04-23 09:34:05 -04:00
Tom Stellard
d4da0a0627 r600g/llvm: Remove debugging hack from R600InstrInfo::copyPhysReg() 2012-04-23 09:34:05 -04:00
Tom Stellard
90a42df0d0 r600g/llvm: Tell the code emitter to ignore KILL and BUNDLE 2012-04-23 09:34:04 -04:00
Tom Stellard
fa52aeb396 r600/llvm: Add LOAD_VTX instruction 2012-04-23 09:34:04 -04:00
Tom Stellard
ced73ea5df r600g: Add hooks for the LLVM shader compiler
The LLVM backend can now be enabled for r600g by using the
--enable-r600-llvm-compiler configure flag.  If you configure with this
flag, you can still use the default compiler by setting the envrionment
variable R600_USE_LLVM=0

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:34:04 -04:00
Tom Stellard
2da9610566 r600g: Add TGSI->LLVM implementation v2
v2: Add case for ARUBA in r600_llvm_gpu_string()

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:34:04 -04:00
Tom Stellard
509ddb0a04 radeon: Move radeon_llvm_emit.cpp declarations into their own header
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:33:55 -04:00
Tom Stellard
6e238bf27c radeon: Remove HAVE_LLVM ifdefs
Only LLVM 3.1 is supported, so these are not necessary.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 08:53:48 -04:00
Vadim Girlin
65b35b63d3 r600g: fix gpr number calculation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 08:53:47 -04:00
Tom Stellard
adb8eca1d8 configure.ac: Move HAVE_LLVM definition into configure.ac
Otherwise HAVE_LLVM won't be included in the $(DEFINES) variable for
Automake generated Makefiles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 08:53:47 -04:00
Dave Airlie
62b0323cf6 r600g: split add_reg into add_reg and add_reg_bo variants
This shaves 2k off the final dri.so, and removes lots of pointless
NULL, 0 passing.

most like pointless - but it looked nicer to me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-23 10:23:46 +01:00
Jonas Maebe
8d09f4d0cc glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
than sizeof(struct _glapi_struct) bytes.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-22 20:39:32 -07:00
Dave Airlie
e6aad9ba04 r600g: enable GLSL130 on all cards
Alexandre Demers sent me some cayman results with no major problems.

I'll rip out the env var in a week or so.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-22 08:09:05 +01:00
Dave Airlie
47d22e56de r600g: enable dual src blending on r600 cards
tested on my rv610 and it passes the tests with no hangs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 17:46:35 +01:00
Dave Airlie
7745cf2be4 r600g: enable GLSL 1.30 for r600 class
Full piglit run on my rv610 with no regressions.

This only leaves cayman, however my cayman is resisting my attempt
to get through a full piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 17:40:32 +01:00
Dave Airlie
12bedaa24b r600: enable glsl 1.30 on r700
I've done a piglit run on rv740 and confirmed no regressions.

We don't get GL3 on r700 due to transform feedback being busted still.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 10:38:31 +01:00
Dave Airlie
5f457f6618 r600g: report INTEGERS cap if glsl130 is on.
This cap is used by u_blitter to decide if it can use integers
in vertex data.

fixes some crashes with glsl130 in piglit

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 19:33:22 +01:00
Dave Airlie
7af9f6325e r600g: enable glsl 130 on evergreen.
I've done a piglit run on my SUMO machine and I see no regressions.

Lots of things to fix (skip->fail), but hey maybe we can fix them
if we can see them.

I'll try and work my way across r600,700,cayman sometime if nobody
else gets to them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 19:01:57 +01:00
Vadim Girlin
951b888be4 r600g: disable I2F conversion for InstanceID if integers are supported
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 17:44:06 +01:00
Vadim Girlin
e382a0c142 r600g: store glsl_feature_level in the r600_screen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 17:43:24 +01:00
Brian Paul
b0e048f0b9 mesa: move gl_array_attrib::NewState to gl_array_object::NewArrays
The field wasn't actually used before and it's not used now either.
But this is a more logical place for it and will hopefully allow
doing smarter draw/array validation (per array object) in the future.

Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-20 07:32:33 -06:00
Brian Paul
0615eb8fc3 docs: recommend 2GB of RAM for Viewperf tests 2012-04-20 07:10:17 -06:00
Eric Anholt
137c5ece7d i965: Convert live interval computation to using live variable analysis.
Our previous live interval analysis just said that anything in a loop
was live for the whole loop.  If you had to spill a reg in a loop,
then we would consider the unspilled value live across the loop too,
so you never made progress by spilling.  Eventually it would consider
everything in the loop unspillable and fail out.

With the new analysis, things completely deffed and used inside the
loop won't be marked live across the loop, so even if you
spill/unspill something that used to be live across the loop, you
reduce register pressure.  But you usually don't even have to spill
any more, since our intervals are smaller than before.

This fixes assertion failure trying to compile the shader for the
"glyphy" text rasterier and piglit glsl-fs-unroll-explosion.

Improves Unigine Tropics performance 1.3% +/- 0.2% (n=5), by allowing
more shaders to be compiled in 16-wide mode.
2012-04-19 17:44:55 -07:00
Eric Anholt
34b17ee598 i965: Move the old live interval analysis code next to the new live vars code.
I'm about to replace the insides of this using the new analysis.
2012-04-19 17:44:55 -07:00
Eric Anholt
0d6c96a5c3 i965: Add support for live variable analysis using dataflow analysis. 2012-04-19 17:44:54 -07:00
Eric Anholt
080b125c64 i965: Add basic block generator.
This takes the fs_inst list generated by the visitor, and generates a
list of basic blocks with edges between them.  This is a building
block for data-flow analysis.
2012-04-19 17:44:54 -07:00
Eric Anholt
8890c75951 i965/fs: Suppress printing the whole loop in BRW_OPCODE_DO annotation. 2012-04-19 17:44:54 -07:00
Eric Anholt
4b2a4cb7c2 glsl: Properly throw compile-time errors for conflicting FS output writes.
We were checking for these at link time previously, which is not as
early as mandated, and would actually fail to detect conflicting
writes if dead code removal removed some writes.

Fixes failures in piglit
glsl-*/compiler/fragment-outputs/write-gl_Frag*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:45 -07:00
Eric Anholt
f2475ca424 glsl: Track in each ir_variable whether it was ever assigned.
This will be used for some compile-and-link-time error checking, where
currently we've been doing error checking only at link time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:36 -07:00
Eric Anholt
cc7e0de009 glsl: Convert the tests directory to automake.
This runs optimization-test and produces the usual automake test
output, which may be interesting to automated build systems.

This doesn't convert the tests to be individually exposed to the
automake runner, because automake doesn't like wildcards (due to being
nonportable in make, not that we care).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:31 -07:00
Eric Anholt
86f270e0a9 glsl: Fix up some comments in structure splitting, based on array-split work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:28 -07:00
Eric Anholt
6de5da0796 glsl: Don't allow array splitting on function arguments.
This is the reason the declaration member existed in the reference
visitor, but I didn't copy the code from structure splitting that
avoided setting it.

This wasn't currently a problem, because we don't allow splitting of
in/out variables.  But that would be nice to change some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:14 -07:00
Eric Anholt
538ba0a363 glsl: Rename the "whole_array_access" member in array splitting.
This was carried over from structure splitting, without thinking about
whether the name still made sense in this context.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:12 -07:00
Eric Anholt
36a8c9caaf glsl: Fix up a comment explaining what a visitor class does.
Ken noted that some of the "actual work" was happening in the caller
of this class.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:09 -07:00
Eric Anholt
c07290ddb2 glsl: Use the column_types() helper method.
Ken noted this in a review of this patch that I pushed early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:02 -07:00
Eric Anholt
40da3b0320 glx: Use AM_CPPFLAGS to pass -I and -D to both C and C++ compiles.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-04-19 16:32:46 -07:00
Marek Olšák
bf3304a84b Revert "mesa: only update _MaxElement when we actually need it"
This reverts commit 0de5a21470.

I was wrong, we use it in the vbo module too.
This fixes a performance regression in Nexuiz.
2012-04-19 20:48:52 +02:00
Michel Dänzer
dbf48e88eb radeonsi: Fix VGPR_BIT() definition.
Fixes encoding of VOP3 shader instructions.

The shift was wrong for source registers 2 and 3, and the resulting value was
only 32 bits, so the shift in SICodeEmitter::VOPPostEncode() didn't work as
intended.
2012-04-19 19:59:54 +02:00
Michel Dänzer
09b2cd7ade radeonsi: Replace magic numbers for vertex buffer resource. 2012-04-19 19:59:54 +02:00
Michel Dänzer
9918fbd026 radeonsi: (User) SGPR related cleanups.
Use the same user SGPRs for the same purpose in vertex and pixel shaders.

Better calculation of the number of SGPRs to reserve.
2012-04-19 19:59:54 +02:00
Michel Dänzer
de12c6cb54 radeonsi: Fix sampler offsets for shader intrinsic.
The sampler number is in TGSI source register 1, and the S_LOAD_DWORD*
instructions take offsets in DWORDs, not bytes.
2012-04-19 19:59:54 +02:00
Brian Paul
7103a18c12 docs: overhaul the Mesa build/install instructions
Rearrange thing in general.  Mark the legacy Makefile system as deprecated.
2012-04-19 11:22:47 -06:00
Brian Paul
f64bae2e2a docs: freshen up the download/unpack instructions 2012-04-19 11:22:47 -06:00
Brian Paul
0e5327ecf4 mesa: move unrefs of array objects earlier in _mesa_free_context_data()
If a non-default array object was bound at context destruction time
we'd try to unreference the array object after it was already deleted
in _mesa_free_varray_data().  Now do the unref first.

Fixes a regression from commit 86f53e6d6b.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-19 11:22:37 -06:00
Christoph Bumiller
939b26639f nv50,nvc0: prevent multiple flushes when user spins on get_query_result 2012-04-19 14:56:04 +02:00
Christoph Bumiller
90b5301cea nv50/ir/opt: swap VP inputs to first source where possible 2012-04-19 14:56:03 +02:00
Marek Olšák
97e2f625b8 vbo: remove vbo_context::mat_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
8c990de0d6 vbo: remove vbo_context::generic_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
fa48137f29 vbo: remove vbo_context::legacy_currval
It's not nice when you have several variables pointing to the same array
and you wanna ask your editor "where is this used" and you only get an answer
for one of the four currval, legacy_currval, generic_currval, mat_currval,
which is quite useless, because you never see the whole picture.

Let's get rid of the additional pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
f9c40dbb0d vbo: remove unused variables in vbo_context
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
81afdd20f3 vbo: don't check twice whether it's valid to render
It's already done in _mesa_validate_Draw* and it's not needed to do it again
unless I am missing something.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
fb4a34e60e mesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & valid
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
576c8c592a mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputs
This is a frequently-updated state and _NEW_ARRAY already causes revalidation
of the vbo module. It's kinda counter-productive to recompute arrays
in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
784dd51198 mesa,vbo: properly detect when vertex arrays need to be recalculated
This moves the RebindArrays flag into the vbo module, consolidates the code,
and adds missing vbo_draw_method calls.

Also with this change, the vertex arrays are not needlessly recalculated twice.
The issue with the old code was:
- If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set.
- _mesa_update_state is called and the vp_varying_inputs change causes
  regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM.
- The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets
  the recalculate_inputs flag to TRUE again.
- The new code sets the flag to FALSE after the second _mesa_update_state,
  because there can't possibly be any change which would require recalculating
  the arrays.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
0de5a21470 mesa: only update _MaxElement when we actually need it
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
233da380a9 st/mesa: use bitshifting to define state flags
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Michel Dänzer
e1a173fb33 radeonsi: MIMG shader instructions require waiting for the results. 2012-04-19 09:36:52 +02:00
Michel Dänzer
2308cf8daf radeonsi: Replace more magic numbers for sampler state. 2012-04-19 09:36:52 +02:00
Michel Dänzer
a1b67da0e1 radeonsi: Fix mip filter encoding in sampler state.
Blits are starting to work.
2012-04-19 09:36:51 +02:00
Michel Dänzer
81c847f0f7 radeonsi: Set tiling mode index for depth/stencil buffers. 2012-04-19 09:36:51 +02:00
Kenneth Graunke
14e9942841 glsl: Remove unused mem_ctx field from ir_array_splitting_visitor.
Vinson reported that we failed to initialize this, which would lead to
all kinds of crashes if we actually used it.  Since we don't use it,
we may as well just delete the broken code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 19:11:10 -07:00
Kenneth Graunke
4f96e9830f i965: Rename BRW_MAX_SURFACES to BRW_MAX_WM_SURFACES.
Now that we use separate binding tables for WM, VS, and GS, and have
BRW_MAX_VS_SURFACES and BRW_MAX_GS_SURFACES macros, we really shouldn't
have an unqualified BRW_MAX_SURFACES macro.  It's confusing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 18:28:31 -07:00
Kenneth Graunke
5177f6b1b9 i965: Fix outdated comments about binding tables.
They had a number of issues:
- A paragraph states that we use a single binding table, but we don't.
- We labelled the WM binding table diagram as SOL/WM.
- The WM diagram had an "Only relevant to the WM" comment.  Duh.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 18:28:31 -07:00
Mathias Fröhlich
86f53e6d6b mesa: Use array object constructor.
This change uses the array object factory for gl_array_objects. This
prevents crashes when deriving from gl_array_object.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-04-18 19:51:16 +02:00
Brian Paul
8ec18dfc1a svga: flush drawing before clearing
We don't normally clear immediately after drawing something.  But as it
was, the drawing would incorrectly appear after the clear.

Fixes piglit clear-varray-2.0 failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-18 08:34:48 -06:00
Brian Paul
168a3b8627 pipebuffer: split up assertion
The problem with assert(a && b) is you don't know which term is zero
when there's a failure.
2012-04-18 08:34:48 -06:00
Brian Paul
cf736aa098 svga: return PIPE_OK instead of 0 2012-04-18 08:34:48 -06:00
Marek Olšák
bdb0ad77c2 gallium/u_gen_mipmap: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.
2012-04-18 16:19:39 +02:00
Marek Olšák
462dcf6173 gallium/u_blit: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.
2012-04-18 16:19:39 +02:00
Marek Olšák
5db9cedeaf gallium: remove PIPE_TRANSFER_NOOVERWRITE, use equivalent UNSYNCHRONIZED 2012-04-18 16:19:39 +02:00
Marek Olšák
a8a478999c st/mesa: write vertices directly into the buffer for glClear fallback 2012-04-18 16:19:39 +02:00
Marek Olšák
2b151bbb95 st/mesa: use u_upload_mgr to upload vertices for glClear fallback 2012-04-18 16:19:39 +02:00
Marek Olšák
6c1fbe912f st/mesa: write vertices directly into the buffer in glDrawPixels 2012-04-18 16:19:39 +02:00
Marek Olšák
b69dad1683 st/mesa: use u_upload_mgr to upload vertices for glDrawPixels 2012-04-18 16:19:39 +02:00
Marek Olšák
0a43fd4c01 st/mesa: use u_upload_mgr to upload vertices for glDrawTexOES 2012-04-18 16:19:39 +02:00
Marek Olšák
3e8093d068 st/mesa: write vertices directly into the buffer for glBitmap 2012-04-18 16:19:39 +02:00
Marek Olšák
76d9a99d6b st/mesa: use u_upload_mgr to upload vertices for glBitmap
instead of recreating the vertex buffer for each draw_vbo call.
2012-04-18 16:19:38 +02:00
Michel Dänzer
0ef90e52d1 radeonsi: Improve calculation of number of pixel shader interpolants. 2012-04-18 10:53:59 +02:00
Michel Dänzer
bb79126420 radeonsi: Fix calculation of pitch value in sampler view state. 2012-04-18 10:52:33 +02:00
Michel Dänzer
f2c81a4bff radeonsi: Set tiling mode index in sampler view state.
Hardcode index for linear mode for now.
2012-04-18 10:51:48 +02:00
Michel Dänzer
29d7186e4c radeonsi: Replace magic numbers with register definitions in sampler state. 2012-04-18 10:49:00 +02:00
Michel Dänzer
c4bf6517ed radeonsi: Fix white border color type in sampler state. 2012-04-18 10:48:26 +02:00
Kenneth Graunke
32f7676e9c glsl/builtins: Rework profiles to use the new '.glsl' common suffix.
Deletes a lot of pointless duplication, as well as some run-time effort.

Conveniently, GLSL 1.40 no longer needs a .vert variant, since it
doesn't define any built-ins specific to the vertex shader stage.

ARB_texture_rectangle and OES_EGL_image_external also only need a single
profile, since the .vert and .frag variants were identical.

I didn't bother with EXT_texture_array and OES_texture_3D because
they're so tiny that the savings would be miniscule.

Cuts the generated builtin_function.cpp from 1.7MB to 1.0MB (41%).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:18 -07:00
Kenneth Graunke
fbea94ae59 glsl/builtins: Support stage-agnostic built-in profiles.
The built-in subsystem uses "profiles," or GLSL shaders containing
prototypes for all built-ins supported within a particular language
version (or extension) and shader stage.

Since profiles were stage-specific, we had to cut and paste almost all
the prototypes between (e.g.) 110.vert and 110.frag.  Naturally, this
led to sundry cut and paste bugs, where someone fixed an issue in .frag
but neglected to update .vert, or vice-versa.  Geometry shaders would
have only made this worse.

This patch introduces support for a new '.glsl' profile suffix which
contains prototypes common to all shader stages.  The existing '.frag'
and '.vert' profiles need only contain the few stage-specific built-ins.

Not only does this remove duplication, it makes built-in setup slightly
faster: we don't need to re-read the common prototypes and function
bodies for both the vertex and fragment shader stage.

Internally, this was trivial.  We already create a list of gl_shader
objects to search through for built-ins: one for the core language
version/stage, and additional shaders for any extensions in use.  This
patch simply adds another shader to the list: core/common, core/stage,
and extensions.

The next patch will update the profiles to remove the duplication.
It's separated out purely to make review easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:15 -07:00
Kenneth Graunke
7e35d97a02 glsl: Make the standalone compiler accept '.glsl' files.
These ought to be treated as 'any stage', but for now, they're just
treated as vertex shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:04:57 -07:00
Brian Paul
a5e95a419e mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()
Accelerates a few glReadPixels cases for WebGL.
See https://bugs.freedesktop.org/show_bug.cgi?id=48545

v2: Per Jose, use bit twiddling for the swizzle case instead of ubyte
arrays (it's about 44% faster).

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-17 13:22:18 -06:00
Dave Airlie
b814506e87 configure.ac: add IA64 support.
ia64 on Linux can use DRI as well.

Reported-by: russiane39 on #radeon
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=48788
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-17 19:59:26 +01:00
Kenneth Graunke
f4f6e1f5a0 glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.
The GLSL 1.30 -> 4.10 specs all erroneously say "vec2" for a few
overloads of textureProjGradOffset, while most overloads and all other
texturing functions use ivec types.

The GLSL 4.20 specification corrects these to "ivec2", but doesn't
mention this as being a conscious change in behavior.  Nor does the
ARB_shading_language_420pack extension.  So presumably it was a typo.

At any rate, our builtin functions all use ivec already, so the fact
that these prototypes use plain vecs will only lead to applications
dying in a fire when trying to use them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-17 11:27:51 -07:00
Christoph Bumiller
48aec56559 nv50: specify location of UCPs to code generator
Was made configurable in e44089b2f7
for Kepler but forgot to update nv50.
2012-04-17 18:35:16 +02:00
Tom Stellard
6077b347ae r600g: Use automake to generate Makefile 2012-04-17 09:54:02 -04:00
Eric Anholt
35f2fb70d3 Revert "glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function."
This reverts commit 4ec449a6ed.

I meant to not push this one.  Review found that a link error is not
mandated: it should link, but you get undefined rendering if you rely
on a missing stage.

     page 42/55 section 2.11 "Vertex Shaders":

     "If the program object has no vertex shader, or no program object
      is currently in use, the results of vertex shader execution are
      undefined."

(and similar for page 160/173 section 3.9 "Fragment Shaders" for FS,
and page 45/58 section 2.11.2 "Program Objects" for program being 0)

It turns out the commit was broken anyway, because it was missing a
"goto done", so linkstatus got smashed back to true later and the
error just showed up as a warning in the infolog.
2012-04-16 13:50:05 -07:00
Eric Anholt
f084b5ad32 docs: Update GLSL 1.40 status.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
252d99e4fa docs: Update that int textures got done for GL3.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
45f460f61e docs: Update that ARB_draw_instanced is on in i965.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
61c4e5cd68 docs: Update TBO support.
All I know of that needs finishing in Mesa is to enable the extension
in a GL3.1 core context on i965 -- we're not going to expose it in
non-3.1 core contexts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
4ec449a6ed glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
acd4024e0a glsl: Add remaining *sampler2DRect* texture functions.
Fixes the new piglit texelFetch() tests on these.  Note that the rest
of the new functions are not tested (same as the non-2DRect versions
of most of them).
2012-04-16 11:59:29 -07:00
Eric Anholt
b9fed9f3d5 glsl: Fix the prototype of textureProjGradOffset(sampler2DShadow)
Indirectly caught by Ken's review of my GLSL 1.40 changes where I
copy-and-pasted this line.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:19 -07:00
Eric Anholt
56e2f97697 glsl: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.
The non-integer versions were already reserved in 1.30, but apparently
these were forgotten.

Fixes piglit glsl-1.40/compiler/reserved/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:21 -07:00
Eric Anholt
d91c8edd85 glsl: Add textureSize(*samplerBuffer) support.
Fixes the corresponding new tests in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:18 -07:00
Eric Anholt
9a01e09ee5 glsl: Fix comment typo in 1.40 work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:16 -07:00
Eric Anholt
ecc4c361a6 mesa: Remove dead _mesa_sizeof_glsl_type().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:14 -07:00
Eric Anholt
9d921b168b gtest: Don't actually install a library.
The whole point of importing it was that you're not supposed to
install this library.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=411825
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:25:39 -07:00
Brian Paul
6f89f5a524 svga: add case for PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-16 10:35:36 -06:00
Dylan Noblesmith
a3d56734df autoconf: add AM_PROG_CC_C_O
Prevents this error with Automake 1.9:

src/gallium/drivers/Makefile.am: C objects in subdir but
`AM_PROG_CC_C_O' not in `configure.ac'
autoreconf: automake failed with exit status: 1

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 15:45:32 +00:00
Christoph Bumiller
847c898702 nvc0: fix nve4 linear copies 2012-04-16 00:38:17 +02:00
Christoph Bumiller
1ce9205f79 targets/xvmc-nouveau: fix accidental hardcoded include path
5b0cd37324 wasn't meant to be pushed.
2012-04-15 16:40:53 +02:00
Christoph Bumiller
e55c276255 nv50: use correct semantic map value for undefined PointSize output 2012-04-15 16:30:13 +02:00
Christoph Bumiller
5b0cd37324 targets/xvmc-nouveau: add libdrm include path 2012-04-15 16:26:21 +02:00
Ben Skeggs
d37f90f131 nv30: init sample_mask to some default value at context creation time
Fixes demos/lodbias.
2012-04-15 22:18:02 +10:00
Ben Skeggs
29128e5ee2 nv30: fix some sifm transfer issues 2012-04-15 21:56:20 +10:00
José Fonseca
abfe759172 scons: Fix egl-static build due to conflicting symbols.
radeonsi and r600 have duplicate symbols, so it's not possible to
statically link both.  Remove the newcomer, radeonsi, until duplicate
symbols are fixed.
2012-04-15 11:32:21 +01:00
Christoph Bumiller
e44089b2f7 nvc0: add initial support for nve4+ (Kepler) chipsets
Most things that work on Fermi should work on Kepler too.

There are a few performance optimizations left to do, like better
placement of texture barriers and adding scheduling data to the
shader instructions (without them, a thread group will be masked
for 32 cycles after each single instruction issue).
2012-04-15 00:08:51 +02:00
Tom Stellard
69a921892d radeonsi: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS/
Fixes build broken by commit 0d29fb017b
2012-04-14 17:40:35 -04:00
Christoph Bumiller
a6fcf14c23 nv50/ir/opt: extend handleCVT for nv50's SET u32 to f32 chain 2012-04-14 21:54:04 +02:00
Christoph Bumiller
a9f22b91e5 nv50/ir: print interpolation mode 2012-04-14 21:54:04 +02:00
Christoph Bumiller
dcc91fc5d3 nv50: update FP linkage state on one/two-sided lighting switch 2012-04-14 21:54:04 +02:00
Christoph Bumiller
df982399cc nv50: delete old shader compiler files 2012-04-14 21:54:04 +02:00
Christoph Bumiller
0bbf1659df nv50: hook up to new shader code generator 2012-04-14 21:54:04 +02:00
Christoph Bumiller
322bc7ed68 nv50/ir: import nv50 target 2012-04-14 21:54:04 +02:00
Christoph Bumiller
15ce0f76e2 nv50/ir: fix off-by-ones in CSE and nvc0 insnCanLoad 2012-04-14 21:54:04 +02:00
Christoph Bumiller
ce04221081 nv50/ir/tgsi: generate UCPs with actual outputs instead of SVs
gl_ClipDistance is treated the same way, this is just nicer and
easier assign slots for them on nv50.
2012-04-14 21:54:04 +02:00
Francisco Jerez
d07e4421ab nv50/ir: Fix type of the instruction created by mkCmp() for dst in FILE_FLAGS. 2012-04-14 21:54:04 +02:00
Christoph Bumiller
f8c3212cbb nv50/ir: fix Instruction::isCommutationLegal for WAW 2012-04-14 21:54:03 +02:00
Francisco Jerez
93508b5b0d nv50/ir/opt: Add isOptSupported() check in logical arith optimization. 2012-04-14 21:54:03 +02:00
Francisco Jerez
f4dbdcbfcf nv50/ir/ra: Fix live set propagation in the secondary passes of buildLiveSets(). 2012-04-14 21:54:03 +02:00
Christoph Bumiller
2fc014f8c0 nv50/ir/opt: don't regard OP_WRSV as dead code 2012-04-14 21:54:03 +02:00
Christoph Bumiller
a765d7880f nv50/ir: add isUniform query to Values 2012-04-14 21:54:03 +02:00
Christoph Bumiller
e43a3a66a9 nv50/ir: rewrite the register allocator as GCRA, with spilling
This is more flexible than the linear scan, and we don't need the
separate allocation pass for constrained values anymore.
2012-04-14 21:54:03 +02:00
Christoph Bumiller
99319328d4 nv50/ir/tgsi: only export x-component of PSIZE 2012-04-14 21:54:03 +02:00
Christoph Bumiller
12a2f5121d nvc0: fix emission of 3rd src in SET_AND,OR,XOR 2012-04-14 21:54:03 +02:00
Francisco Jerez
f01efba60a nv50/ir: Fix BuildUtil::mkSelect and mkClobber 2012-04-14 21:54:03 +02:00
Christoph Bumiller
054fab5b48 nv50/ir: fix reg file conflicts with undefined-value placeholders 2012-04-14 21:54:03 +02:00
Christoph Bumiller
51327a2df2 nv50/ir/opt: silence warning (int < Elements() signedness) 2012-04-14 21:54:03 +02:00
Christoph Bumiller
ef7f9f68cf nv50/ir/opt: fix combineSt access to wrong instruction 2012-04-14 21:54:03 +02:00
Christoph Bumiller
bb9c15bac4 nv50/ir/opt: another insn NULL check in phi elimination 2012-04-14 21:54:03 +02:00
Francisco Jerez
4ece0dbd2f nv50/ir/ssa: Take into account function inputs and outputs. 2012-04-14 21:54:02 +02:00
Francisco Jerez
4a44f94caf nv50/ir: Clean up before calculating instruction ordering for a new function. 2012-04-14 21:54:02 +02:00
Francisco Jerez
a539785187 nv50/ir/ra: Allocate registers for function arguments. 2012-04-14 21:54:02 +02:00
Francisco Jerez
530ff61ba7 nv50/ir: Take into account function args in the live range calculation code. 2012-04-14 21:54:02 +02:00
Francisco Jerez
ed255dbae2 nv50/ir/ra: Use matching physical regs for function args in caller and callee. 2012-04-14 21:54:02 +02:00
Francisco Jerez
a3dd45e1c2 nv50/ir/tgsi: Infer function inputs/outputs.
Edit: Don't do it for the main function of (graphics) shaders,
its inputs and outputs always go through TGSI_FILE_INPUT/OUTPUT.
This prevents all TEMPs from counting as live out and reduces
register pressure.
2012-04-14 21:54:02 +02:00
Francisco Jerez
9bb36d54a2 nv50/ir/tgsi: Replace the inlining logic with proper function calls. 2012-04-14 21:54:02 +02:00
Francisco Jerez
56d40aa51b nv50/ir: Decouple DataArray from the dictionary that maps locations to values.
The point is to keep an independent dictionary for each function.

The array that was being used as dictionary has been converted into a
"bimap" for two different reasons: first, because having an almost
empty instance of an array with as many entries as registers there are
in the program, once for every function, would be wasteful, and
second, because we want to be able to map Value pointers back to
locations at some point.
2012-04-14 21:54:02 +02:00
Christoph Bumiller
d41f293bf0 nv50/ir/opt: don't delete instruction in removeFlow before its last use 2012-04-14 21:54:02 +02:00
Christoph Bumiller
be161e66d6 nv50/ir/opt: check BB equality before instruction ordering in CSE 2012-04-14 21:54:02 +02:00
Christoph Bumiller
44e84d6f16 nv50/ir/opt: don't copy-propagate cond MOVs or MOVs to other reg files
We've never encountered the latter on nvc0, but on nv50 we have moves
between GPRs and address regs.
2012-04-14 21:54:02 +02:00
Christoph Bumiller
ca1fc2b864 nv50/ir/opt: don't replace conditional definitions in CSE 2012-04-14 21:54:02 +02:00
Francisco Jerez
90f0fac655 nv50/ir/opt: Update the symbol size when combining loads and stores. 2012-04-14 21:54:02 +02:00
Christoph Bumiller
5df92c81c3 nv50/ir: initialize FlowInstruction::builtin 2012-04-14 21:54:01 +02:00
Francisco Jerez
1e95794173 nv50/ir/opt: Fix for function calls. 2012-04-14 21:54:01 +02:00
Francisco Jerez
98116cc3dc nv50/ir: Build a "symbol" table with the binary offsets of each function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
5e4b2a1a47 nv50/ir: Add support for removing functions from a program. 2012-04-14 21:54:01 +02:00
Francisco Jerez
d32ebb8c30 nv50/ir: Scan program functions in DFS-postorder.
The reason is that several passes (regalloc, function argument
binding, inlining) are going to require the callees of a function to
be processed before the caller.
2012-04-14 21:54:01 +02:00
Francisco Jerez
78de8c8ab5 nv50/ir: Deal with graph iterators using RAII. 2012-04-14 21:54:01 +02:00
Francisco Jerez
898b0981b6 nv50/ir: Add convenience method for calculating the live sets of a function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
3e9150cd96 nv50/ir: Add support code for calculating the clobber set of a BB or function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
d6d1f0e4a2 nv50/ir/opt: Don't lose modifiers during constant folding. 2012-04-14 21:54:01 +02:00
Francisco Jerez
14d5f975a6 nv50/ir/opt: Improve modifier handling. 2012-04-14 21:54:01 +02:00
Francisco Jerez
784848a94d nv50/ir: Add support for cloning FlowInsns, ImmediateVals and BBs. 2012-04-14 21:54:01 +02:00
Francisco Jerez
a05e6a3fa2 nv50/ir: Decouple object cloning logic from the sub-object recursion policy. 2012-04-14 21:54:01 +02:00
Francisco Jerez
da28ba00d8 nv50/ir: Make sure that several IR objects are destroyed on takedown. 2012-04-14 21:54:01 +02:00
Christoph Bumiller
9362d4bc0a nv50/ir: make Instruction::src/def container private 2012-04-14 21:54:00 +02:00
Francisco Jerez
8cc2eca5df nv50/ir: Add support for unlimited instruction arguments. 2012-04-14 21:54:00 +02:00
Christoph Bumiller
15d224f7a7 nv50/ir: temporarily exclude nv50 code emitter from build
It's not used yet and shouldn't have been included in the first
place.
2012-04-14 21:54:00 +02:00
Christoph Bumiller
f113b6f959 nv50/ir: copy value size in SSA-rename pass 2012-04-14 21:54:00 +02:00
Christoph Bumiller
55f9bdb64e nv50/ir/opt: improve post-multiply and check target for support 2012-04-14 21:54:00 +02:00
Christoph Bumiller
56cf2da022 nv50/ir: add setFlagsDef/Src helper
Will be used by nv50 target.
2012-04-14 21:54:00 +02:00
Christoph Bumiller
286abcb51e nv50/ir: add isAccessSupported check for memory access coalescing 2012-04-14 21:54:00 +02:00
Christoph Bumiller
c04d6d95e0 nv50/ir: add function for splitting a BasicBlock
Fixes to initial implementation by Francisco Jerez.
2012-04-14 21:54:00 +02:00
Francisco Jerez
0056e1b988 nv50/ir: Allow attaching two nodes when either one is already inside the graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez
099b81396e nv50/ir: Allow inserting isolated nodes to a graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez
1829484458 nv50/ir: Fix memory corruption in Function::orderInstructions().
"iter" doesn't reference a BasicBlock directly, but a Node::Graph,
i.e. BasicBlock::get() is casting to the wrong pointer type.
2012-04-14 21:54:00 +02:00
Francisco Jerez
ab382fbc35 nv50/ir: Fix up insertion of PHI instructions using bb->insertHead(). 2012-04-14 21:54:00 +02:00
Christoph Bumiller
fc740e7924 nv50/ir: fix insertHead and remove for BBs with PHI ops only 2012-04-14 21:54:00 +02:00
Francisco Jerez
349cb60ed5 nv50/ir: Don't crash on zero sized BitSets. 2012-04-14 21:54:00 +02:00
Francisco Jerez
f0a7ec9a2f nv50/ir: Fix Interval::clear(). 2012-04-14 21:53:59 +02:00
Christoph Bumiller
cd6d63fa60 nv50/ir/tgsi: handle inferSrcType(NOT) to be u32 2012-04-14 21:53:59 +02:00
Francisco Jerez
658c0bee71 nv50/ir/opt: Fix OP_NOT to modifier conversion. 2012-04-14 21:53:59 +02:00
Dave Airlie
f8741ff21e r600g: disable dual-src hangs evergreen for some reason.
This did work previously, so I've broken something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-14 20:25:59 +01:00
Tom Stellard
0b59909e78 r300/compiler: Exit immediately from rc_vert_fc() if there is an error
This way we correctly report "Too many temporaries" errors.

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

Note: This is a candidate for the stable branches.
2012-04-14 12:11:29 -04:00
Tom Stellard
73249239cf r300/compiler: Copy all instruction attributes during local transfoms
Instruction attributes like WriteALUResult and ALUResultCompare
were being discarded during the some of the local transformations.

This fixes the following piglit tests:

glsl1-inequality (vec2, pass)
loopfunc
fs-any-bvec2-using-if
fs-op-ne-bvec2-bvec2-using-if
fs-op-ne-ivec2-ivec2-using-if
fs-op-ne-mat2-mat2-using-if
fs-op-ne-vec2-vec2-using-if
fs-op-ne-mat2x3-mat2x3-using-if
fs-op-ne-mat2x4-mat2x4-using-if

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

NOTE: This is a candidate for the stable branches.
2012-04-14 10:02:19 -04:00
Tom Stellard
b2df031a95 r300/compiler: Fix nested flow control in r500 vertex shaders 2012-04-13 22:24:16 -04:00
Tom Stellard
4a269a8dc0 r300/compiler: Clear loop registers in vertex shaders w/o loops
The loop registers weren't being cleared, so any shader that was
executed after a shader containing loops was at risk of having a loop
randomly inserted into it.

This fixes over one hundred piglit tests, although these test
only failed during full piglit runs and would pass if
run individually.  The exact number of piglit tests that this patch
fixes will vary depending on the version of piglit and the order the
tests are run.

NOTE: This is a candidate for the stable branches.
2012-04-13 22:23:46 -04:00
Eric Anholt
3f349d4e18 glsl: If an "if" has no "then" or "else" code left, remove it.
Cuts 8/1068 instructions from glyphy's fragment shaders on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-13 17:13:23 -07:00
Eric Anholt
8bb0091e68 glsl: Add a helper for generating temporary variables in ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:20 -07:00
Eric Anholt
d32780d504 glsl: Add a helper for ir_builder to make dereferences for assignments.
v2: Fix writemask setup for non-vec4 assignments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:17 -07:00
Eric Anholt
7e88f8ce8f glsl: Make a little tracking class for emitting IR lists.
This lets us significantly shorten p->instructions->push_tail(ir), and
will be used in a few more places.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:14 -07:00
Eric Anholt
b782352745 glsl: Add common swizzles to ir_builder.
Now we can fold a bunch of our expression setup in ff_fragment_shader
into single-line, parseable commits.

v2: Make it actually work.  I wasn't setting num_components in the
    mask structure, and not setting up a mask structure is way easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:10 -07:00
Eric Anholt
d6e6566206 glsl: Let ir_builder expressions take un-dereferenced variables.
Having to explicitly dereference is irritating and bloats the code,
when the compiler can detect and do the right thing.

v2: Use a little shim class to produce the automatic dereference
    generation at compile time as opposed to runtime, while also
    allowing compile-time type checking.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:03 -07:00
Eric Anholt
599aac95ff glsl: Create an ir_builder helper for hand-generating IR.
The C++ constructors with placement new, while functional, are
extremely verbose, leading to generation of simple GLSL IR expressions
like (a * b + c * d) expanding to many lines of code and using lots of
temporary variables.  By creating a new ir_builder.h that puts simple
generators in our namespace and taking advantage of ralloc_parent(),
we can generate much more compact code, at a minor runtime cost.

v2: Replace ir_instruction usage with just ir_rvalue.
v3: Drop remaining missed as_rvalue() in v2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 16:59:45 -07:00
Christoph Bumiller
0e8ad4cc74 nv50,nvc0: fix handling of user vbufs with stride < access size 2012-04-14 06:14:21 +02:00
Christoph Bumiller
7a40ae4a31 nvc0: prefix all macro methods with MACRO
Some of them have non-macro counterparts.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
ce713cd520 nvc0: replace VERTEX_DATA push mode with translate to buffer
While pushing vertices through the FIFO is relatively fast on nv50,
it's horribly slow on nvc0.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
edbfeed56f nvc0: improve vertex state validation
Now updating vertex attribute format only when necessary.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
784f49e696 nvc0: track texture dirty state individually 2012-04-14 06:14:21 +02:00
Christoph Bumiller
2206a7f513 nv50,nvc0: use new scratch buffers code 2012-04-14 06:14:21 +02:00
Christoph Bumiller
680f20351e nouveau: add new shared scratch buffers 2012-04-14 06:14:21 +02:00
Christoph Bumiller
36158c1994 nvc0: only force early fragment tests if requested by shader 2012-04-14 06:14:21 +02:00
Christoph Bumiller
2d06ee8bf7 nv50,nvc0: hold references to the framebuffer surfaces 2012-04-14 06:14:21 +02:00
Marek Olšák
687c05661f r300g: align vertex buffer suballocations to 4 2012-04-13 23:18:04 +02:00
Marek Olšák
7864933acd u_blitter: align vertex buffer suballocations to 4 2012-04-13 23:18:04 +02:00
Brian Paul
286e50a87d docs: document another viewperf bug in Maya-03 2012-04-13 14:31:33 -06:00
Marcin Slusarz
f2509df95c xorg/nouveau: switch to libdrm_nouveau-2.0 2012-04-13 21:55:56 +02:00
Martin Peres
3dd12ccc06 targets/{egl-static,gbm}: further clean-up the nvfx remains 2012-04-14 03:12:39 +02:00
Christoph Bumiller
21b50ce63b nvc0: remove include of old libdrm_nouveau's nouveau_reloc.h 2012-04-14 03:05:02 +02:00
Christoph Bumiller
802d02c453 nv50,nvc0: handle PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-14 02:40:30 +02:00
Christoph Bumiller
42ec248eb7 nv30: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS
Merge accident.
2012-04-14 02:40:09 +02:00
Ben Skeggs
a2fc42b899 nv30: import new driver for GeForce FX/6/7 chipsets, and Quadro variants
The primary motivation for this rewrite was to have a maintainable driver
going forward, as nvfx was quite horrible in a lot of ways.

The driver is heavily based on the design of the nv50/nvc0 3d drivers we
already have, and uses the same common buffer/fence code.  It also passes
a HEAP more piglit tests than nvfx did, supports a couple more features,
and a few more to come still probably.

The CPU footprint of this driver is far far less than nvfx, and translates
into far greater framerates in a lot of applications (unless you're using
a CPU that's way way newer than the GPUs of these generations....)

Basically, we once again have a maintained driver for these chipsets \o/

Feel free to report bugs now!
2012-04-14 02:56:34 +10:00
Christoph Bumiller
6d1cdec3ba nouveau: switch to libdrm_nouveau-2.0 2012-04-14 02:56:33 +10:00
Christoph Bumiller
3c7872f35f nvc0: remove obsolete nvc0_push2.c
Slower version of nvc0_push.c, was only used to ascertain that
bugs were not the new version's fault.
2012-04-14 02:56:33 +10:00
Christoph Bumiller
a3fee8fc86 nouveau: remove automatic buffer migration heuristics 2012-04-14 02:56:32 +10:00
Ben Skeggs
66c7dc5688 nvfx: completely remove this driver (GeForce FX/6/7)
This driver hasn't been maintained properly for a very long time, and for
many very good reasons.  It's horrible.

A new driver supporting these chipsets will appear with the commits that
port vieux/nv50/nvc0 to libdrm_nouveau-2.0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-14 02:56:30 +10:00
Ben Skeggs
f3d8bd3f7b nouveau: rework and simplify nv04/nv05 driver a bit
TEXTURED_TRIANGLE and MULTITEX_TRIANGLE are both a bit special in that if
you use any other graph object in the meantime they'll forget their state
and spew a lovely METHOD_CNT error at you when you try to draw.

The pre-newlib driver has a flush_notify() hook which does this state
re-emit, and a number of random workarounds like extra flushes and state
dirtying after various operations to solve this issue.

I'm taking a slightly different approach to things instead, which has the
nice side-effect of removing the divergent code-paths for ttri/mtri, the
flush/dirty workarounds and the need for flush_notify.  Also gives a few
FPS boost in OA, yay.
2012-04-14 02:56:12 +10:00
Ben Skeggs
2e47d01c9e nouveau/vieux: switch to libdrm_nouveau-2.0 2012-04-14 02:56:12 +10:00
Dave Airlie
7308b6e75f docs: update GL3.txt for ARB_blend_func_extended
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
1f2b539451 gallium: document dual source blending restrictions on gallium
As per Brian's suggestion, document the restrictions on dual src blending.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
d1cc87c0b6 r600g: initial r600 dual src blending support
survives piglit with no regressions on rv610/evergreen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
4b1c3b920e softpipe: add dual source blending support
This adds support for a single dual source blending MRT to softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
c59d32d1ce util: add dual blend helper function (v2)
This is just a function to tell if a certain blend mode requires dual sources.

v2: move to inlines as per Brian's suggestion

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
a21df96507 st/mesa: add ARB_blend_func_extended support to state tracker.
This adds the blend mode mapping, it also uses the var->index in the
glsl to tgsi convertor - this is the other half of my using 4 in the GLSL
compiler.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
0d29fb017b gallium: rename DUAL_SOURCE_BLEND cap to MAX_DUAL_SOURCE_RENDER_TARGETS
Though I don't think we'll ever expose > 1.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
1256a5dcc8 glsl: add support for ARB_blend_func_extended (v3)
This adds index support to the GLSL compiler.

I'm not 100% sure of my approach here, esp without how output ordering
happens wrt location, index pairs, in the "mark" function.

Since current hw doesn't ever have a location > 0 with an index > 0,
we don't have to work out if the output ordering the hw requires is
location, index, location, index or location, location, index, index.
But we have no hw to know, so punt on it for now.

v2: index requires layout - catch and error
    setup explicit index properly.

v3: drop idx_offset stuff, assume index follow location

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:01 +01:00
Dave Airlie
f8cf79936b mesa: add support for ARB_blend_func_extended (v4)
Add implementations of the two API functions,
Add a new strings to uint mapping for index bindings
Add the blending mode validation for SRC1 + SRC_ALPHA_SATURATE
Add get for MAX_DUAL_SOURCE_DRAW_BUFFERS

v2:
Add check in valid_to_render to address case in spec ERRORS.

v3:
Add index to ir.h so this patch compiles on its own
fixup comment

v4: fixup Brian's comments

The GLSL patch will setup the indices.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:18:55 +01:00
Tom Stellard
a75c6163e6 radeonsi: initial WIP SI code
This commit adds initial support for acceleration
on SI chips.  egltri is starting to work.

The SI/R600 llvm backend is currently included in mesa
but that may change in the future.

The plan is to write a single gallium driver and
use gallium to support X acceleration.

This commit contains patches from:
Tom Stellard <thomas.stellard@amd.com>
Michel Dänzer <michel.daenzer@amd.com>
Alex Deucher <alexander.deucher@amd.com>
Vadim Girlin <vadimgirlin@gmail.com>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

The following commits were squashed in:

======================================================================

radeonsi: Remove unused winsys pointer

This was removed from r600g in commit:

commit 96d882939d
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Feb 17 01:49:49 2012 +0100

    gallium: remove unused winsys pointers in pipe_screen and pipe_context

    A winsys is already a private object of a driver.

======================================================================

radeonsi: Copy color clamping CAPs from r600

Not sure if the values of these CAPS are correct for radeonsi, but the
same changed were made to r600g in commit:

commit bc1c836938
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jan 23 03:11:17 2012 +0100

    st/mesa: do vertex and fragment color clamping in shaders

    For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
    the perfect place for a fallback.
    The exceptions are:
    - r500 (vertex clamp only)
    - nv50 (both)
    - nvc0 (both)
    - softpipe (both)

    We also have to take into account that r300 can do CLAMPED vertex colors only,
    while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
    with the two new CAPs.

======================================================================

radeonsi: Remove PIPE_CAP_OUTPUT_READ

This CAP was dropped in commit:

commit 04e3240087
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Feb 23 23:44:36 2012 +0100

    gallium: remove PIPE_SHADER_CAP_OUTPUT_READ

    r600g is the only driver which has made use of it. The reason the CAP was
    added was to fix some piglit tests when the GLSL pass lower_output_reads
    didn't exist.

    However, not removing output reads breaks the fallback for glClampColorARB,
    which assumes outputs are not readable. The fix would be non-trivial
    and my personal preference is to remove the CAP, considering that reading
    outputs is uncommon and that we can now use lower_output_reads to fix
    the issue that the CAP was supposed to workaround in the first place.

======================================================================

radeonsi: Add missing parameters to rws->buffer_get_tiling() call

This was changed in commit:

commit c0c979eebc
Author: Jerome Glisse <jglisse@redhat.com>
Date:   Mon Jan 30 17:22:13 2012 -0500

    r600g: add support for common surface allocator for tiling v13

    Tiled surface have all kind of alignment constraint that needs to
    be met. Instead of having all this code duplicated btw ddx and
    mesa use common code in libdrm_radeon this also ensure that both
    ddx and mesa compute those alignment in the same way.

    v2 fix evergreen
    v3 fix compressed texture and workaround cube texture issue by
       disabling 2D array mode for cubemap (need to check if r7xx and
       newer are also affected by the issue)
    v4 fix texture array
    v5 fix evergreen and newer, split surface values computation from
       mipmap tree generation so that we can get them directly from the
       ddx
    v6 final fix to evergreen tile split value
    v7 fix mipmap offset to avoid to use random value, use color view
       depth view to address different layer as hardware is doing some
       magic rotation depending on the layer
    v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
       evergreen, align bytes per pixel to a multiple of a dword
    v9 fix handling of stencil on evergreen, half fix for compressed
       texture
    v10 fix evergreen compressed texture proper support for stencil
        tile split. Fix stencil issue when array mode was clear by
        the kernel, always program stencil bo. On evergreen depth
        buffer bo need to be big enough to hold depth buffer + stencil
        buffer as even with stencil disabled things get written there.
    v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
        old ddx overestimate those. Fix linear case when pitch*height < 64.
        Fix r300g.
    v12 Fix linear case when pitch*height < 64 for old path, adapt to
        libdrm API change
    v13 add libdrm check

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>

======================================================================

radeonsi: Remove PIPE_TRANSFER_MAP_PERMANENTLY

This was removed in commit:

commit 62f44f670b
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Mar 5 13:45:00 2012 +0100

    Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"

    This reverts commit 0950086376.

    It was decided to refactor the transfer API instead of adding workarounds
    to address the performance issues.

======================================================================

radeonsi: Handle PIPE_VIDEO_CAP_PREFERED_FORMAT.

Reintroduced in commit 9d9afcb5ba.

======================================================================

radeonsi: nuke the fallback for vertex and fragment color clamping

Ported from r600g commit c2b800cf38.

======================================================================

radeonsi: don't expose transform_feedback2 without kernel support

Ported from r600g commit 15146fd1bc.

======================================================================

radeonsi: Handle PIPE_CAP_GLSL_FEATURE_LEVEL.

Ported from r600g part of commit 171be75522.

======================================================================

radeonsi: set minimum point size to 1.0 for non-sprite non-aa points.

Ported from r600g commit f183cc9ce3.

======================================================================

radeonsi: rework and consolidate stencilref state setting.

Ported from r600g commit a2361946e7.

======================================================================

radeonsi: cleanup setting DB_SHADER_CONTROL.

Ported from r600g commit 3d061caaed.

======================================================================

radeonsi: Get rid of register masks.

Ported from r600g commits
3d061caaed13b646ff40754f8ebe73f3d4983c5b..9344ab382a1765c1a7c2560e771485edf4954fe2.

======================================================================

radeonsi: get rid of r600_context_reg.

Ported from r600g commits
9344ab382a1765c1a7c2560e771485edf4954fe2..bed20f02a771f43e1c5092254705701c228cfa7f.

======================================================================

radeonsi: Fix regression from 'Get rid of register masks'.

======================================================================

radeonsi: optimize r600_resource_va.

Ported from r600g commit 669d8766ff.

======================================================================

radeonsi: remove u8,u16,u32,u64 types.

Ported from r600g commit 78293b99b2.

======================================================================

radeonsi: merge r600_context with r600_pipe_context.

Ported from r600g commit e4340c1908.

======================================================================

radeonsi: Miscellaneous context cleanups.

Ported from r600g commits
e4340c1908a6a3b09e1a15d5195f6da7d00494d0..621e0db71c5ddcb379171064a4f720c9cf01e888.

======================================================================

radeonsi: add a new simple API for state emission.

Ported from r600g commits
621e0db71c5ddcb379171064a4f720c9cf01e888..f661405637bba32c2cfbeecf6e2e56e414e9521e.

======================================================================

radeonsi: Also remove sbu_flags member of struct r600_reg.

Requires using sid.h instead of r600d.h for the new CP_COHER_CNTL definitions,
so some code needs to be disabled for now.

======================================================================

radeonsi: Miscellaneous simplifications.

Ported from r600g commits 38bf276348 and
b0337b679a.

======================================================================

radeonsi: Handle PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION.

Ported from commit 8b4f7b0672.

======================================================================

radeonsi: Use a fake reloc to sleep for fences.

Ported from r600g commit 8cd03b933c.

======================================================================

radeonsi: adapt to get_query_result interface change.

Ported from r600g commit 4445e170be.
2012-04-13 10:32:06 -04:00
Dylan Noblesmith
e55cf4854d st/vega: silence enum cast warnings
clang warns on these:

stroker.c:626:19: warning: implicit conversion from enumeration
type 'VGPathCommand' to different enumeration type 'VGPathSegment'
[-Wconversion]

No change in the underlying value.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:27:11 +00:00
Dylan Noblesmith
dd32df3829 i965: fix typo
Noticed by clang:

brw_wm_surface_state.c:330:30: warning: initializer overrides prior
initialization of this subobject [-Winitializer-overrides]
      [MESA_FORMAT_Z24_S8] = 0,
                             ^
brw_wm_surface_state.c:326:30: note: previous initialization is here
      [MESA_FORMAT_Z24_S8] = 0,
                             ^

No functionality change, since the array is declared static so
it was zero-initialized by default.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-13 14:25:12 +00:00
Dylan Noblesmith
52d021d4d7 mesa: fix truncated value warning
Silences a clang warning:

format_pack.c:2546:30: warning: implicit conversion from 'int' to
'GLubyte' (aka 'unsigned char') changes value from 65535 to 255
[-Wconstant-conversion]
               d[i] = d[i] ? 0xffff : 0x0;
                           ~ ^~~~~~

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
75fe7d1995 mesa: don't cast away const
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
2bb91274e2 egl-static: fix printf warning
Noticed by clang:

egl_st.c:57:50: warning: field precision should have type 'int',
but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
      ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT,
                                               ~~^~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
6a491b5728 st/vega: fix uninitialized values
C still treats array arguments exactly like pointer arguments.
By sheer coincidence, this still worked fine on 64-bit
machines where 2 * sizeof(float) == sizeof(void*), but not
on 32-bit.

Noticed by clang:

text.c:76:51: warning: sizeof on array function parameter will
return size of 'const VGfloat *' (aka 'const float *') instead of
'const VGfloat [2]' [-Wsizeof-array-argument]
   memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyphOrigin));

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
071501a681 egl: fix uninitialized values
Noticed by clang:

eglimage.c:48:28: warning: argument to 'sizeof' in 'memset' call is
the same expression as the destination; did you mean to dereference
it? [-Wsizeof-pointer-memaccess]
   memset(attrs, 0, sizeof(attrs));
          ~~~~~            ^~~~~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
520521e380 util: fix uninitialized table
Most of the 256 values in the 'generic_to_slot' table were supposed to
be initialized with the default value 0xff, but were left at zero
(from CALLOC_STRUCT()) instead.

Noticed by clang:

u_linkage.h:60:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination;
      did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
   memset(table, 0xff, sizeof(table));
          ~~~~~               ^~~~~

Also fix a signed/unsigned comparison and a comment typo here.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:07 +00:00
Dylan Noblesmith
ccff749712 util: fix undefined behavior
container_of() can legally return anything, even invalid addresses
that cause segfaults, when 'sample' is an uninitialized pointer.

Bug exposed by clang.

NOTE: This is a candidate for the 8.0 branch.
2012-04-13 14:25:07 +00:00
Vinson Lee
10ec14865a ir_to_mesa: Fix uninitialized member in add_uniform_to_shader.
Fix uninitialized scalar field defect reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-12 22:43:23 -07:00
Neil Roberts
4f2eafe4dc wayland-drm: Implement wl_buffer.damage in old versions of Wayland
Commit 272bc48976 removed the damage implementation for the
wl_buffer_interface because that has been removed from git master of
Wayland. However this breaks building with the 0.85 branch of Wayland
because it would end up initialising the struct incorrectly.

For the time being it's quite convenient for some compositors to track
the 0.85 branch of Wayland because the protocol is stable but they
will also want to track the master branch of Mesa so that they can use
the gbm surface changes.

This patch adds a compile-time check for the version of Wayland so
that it can work with either Wayland master or the 0.85 branch.

krh: Edited to also account for API changes in 6802eaa68, which
removes the timestamp argument from wl_resource_destroy().
2012-04-12 23:14:22 -04:00
Stéphane Marchesin
368878cc5f Revert "i915g: Implement stipple with draw."
This reverts commit 3cff45fdb1.
2012-04-12 18:31:10 -07:00
Stéphane Marchesin
05265bee85 Revert "i915g: Remove unused poly stipple state."
This reverts commit be6a02266d.
2012-04-12 18:30:59 -07:00
Ian Romanick
0d2bc18e4d tests/glx: Point at the imported copy of gtest
This is just in case there's one installed on the system.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:19:19 -07:00
Eric Anholt
94726d263e glx: Hook up the unit tests again using the internal gtest.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:18:00 -07:00
Ian Romanick
3d000e7dd1 gtest: Fix up import of gtest 1.6.0
The include files were all missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:17:52 -07:00
Eric Anholt
19a4c0646b gtest: Build as a convenience library.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:17:43 -07:00
Eric Anholt
fe358c0ffa gtest: Import sources from gtest 1.6.0.
The upstream of gtest has decided that the intended usage model is for
projects to import the source and use it, which is reflected in their
recent removal of the gtest-config tool.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-12 17:17:10 -07:00
Marek Olšák
6f03692775 cso: unreference saved vertex buffers when restoring
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-12 19:17:47 +02:00
Eric Anholt
249fc70561 i965: When the kernel lacks the LLC check, assume it's present on gen >= 6.
The param wasn't added until drm-intel-next for 3.4, so we were
missing our various LLC fast-paths.
2012-04-11 18:12:12 -07:00
Eric Anholt
e3df28337b intel: Drop backwards compat code for not having libdrm with the LLC check. 2012-04-11 18:12:12 -07:00
Eric Anholt
80ecb8f15b i965/fs: Avoid generating extra AND instructions on bool logic ops.
By making a bool fs_reg only have a defined low bit (matching CMP
output), instead of being a full 0 or 1 value, we reduce the ANDs
generated in logic chains like:

   if (v_texcoord.x < 0.0 || v_texcoord.x > texwidth ||
       v_texcoord.y < 0.0 || v_texcoord.y > 1.0)
      discard;

My concern originally when writing this code was that we would end up
generating unnecessary ANDs on bool uniforms, so I put the ANDs right
at the point of doing the CMPs that otherwise set only the low bit.
However, in order to use a bool, we're generating some instruction
anyway (e.g. moving it so as to produce a condition code update), and
those instructions can often be turned into an AND at that point.  It
turns out in the shaders I have on hand, none of them regress in
instruction count:

Total instructions: 262649 -> 262545
39/2148 programs affected (1.8%)
14253 -> 14149 instructions in affected programs (0.7% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
32ae8d3b32 i965/fs: Try to avoid generating extra MOVs to do saturates.
This change (before the previous two) produced a .23% +/- .11%
performance improvement in Unigine Tropics at 1024x768 on IVB.

Total instructions: 269270 -> 262649
614/2148 programs affected (28.6%)
179386 -> 172765 instructions in affected programs (3.7% reduction)

v2: Move some of the logic of finding the instruction that produced
    the result of an expression tree to a helper.
2012-04-11 18:08:21 -07:00
Eric Anholt
3bdccbc3e0 glsl: Extend the array splitting optimization pass to matrices.
This should fit in well with our lower_mat_op_to_vec code: now, in
addition to having expressions on each column of a matrix, we also
split the columns to separate variables so they can be tracked
individually by the copy propagation, dead code, and other passes.

This optimizes out some more code generation in unigine and gstreamer
shaders.

Total instructions: 269342 -> 269270
14/2148 programs affected (0.7%)
2226 -> 2154 instructions in affected programs (3.2% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
60177d5e2a glsl: Add an array splitting pass.
I've had this code laying around almost done for a long time.  The
idea is like opt_structure_splitting, that we've got a bunch of
transforms at the GLSL IR level that only understand scalars and
vectors, which just skip complicated dereferences.  While driver
backends may manage some optimization after they split matrices up
themselves, it would be better to bring all of our optimization to
bear on the problem.

While I wasn't expecting changes quite yet, a few programs end up
winning: a gstreamer convolution shader, and the Humus dynamic
branching demo:
Total instructions: 269430 -> 269342
3/2148 programs affected (0.1%)
1498 -> 1410 instructions in affected programs (5.9% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
fda662f4df glsl: Don't apply optimization passes to builtins.
The builtins we have are generally optimized, having been
hand-written.  This avoids generating bad code when an optimization
pass prints debug output.
2012-04-11 18:08:21 -07:00
Brian Paul
0fd4165261 docs: document yet another viewperf bug 2012-04-11 12:02:11 -06:00
Brian Paul
71d69161ab mesa: add _mesa_total_texture_memory() debug function
This function can be called in gdb to find out how much memory is used
by all texture objects.
2012-04-11 07:00:01 -06:00
Brian Paul
223654b81d mesa: new _mesa_total_buffer_object_memory() debug function
This function can be called in gdb to find out how much memory is used
by buffer objects.
2012-04-11 07:00:01 -06:00
Chad Versace
5154b45217 mapi: Fix Android build
The Android build was broken by
    commit ca760181b4
    Author: Kristian Høgsberg <krh@bitplanet.net>
    Date:   Fri Mar 16 12:55:40 2012 -0400

    shared-glapi: Convert to automake

The offending change was that it redefined the filepaths in sources.mak
like this:
    - FOO_FILES := bar.c
    + FOO_FILES := $(TOP)/src/mapi/mapi/bar.c
This broke the build because source filepaths in Android makefiles must be
relative to the makefile.

Ideally, this could be fixed by reverting the change in sources.mak and
making shared-glapi's Makefile.am use $(addprefix $(TOP)/src/mapi/mapi,
$(FOO_FILES)). However, automake doesn't understand builtin GNU make
functions, such as addprefix. So, it seems that automake and Android can
no longer share sources.mak.

Fix the build by duplicating the source lists from sources.mak into
Android.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-10 21:07:12 -07:00
Mandeep Singh Baines
0695cf68f5 egl_dri2: fix aux buffer leak in drm platform
Keep a reference to any newly allocated aux buffers to avoid
re-allocating for every st_framebuffer_validate() (i.e. leaking).

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-04-10 19:08:12 -04:00
Paul Berry
a27c7d80af i965: Stop lying about cpp and height of a stencil buffer.
When using a separate stencil buffer, i965 requires that the pitch of
the buffer (in the 3DSTATE_STENCIL_BUFFER command) be specified as 2x
the actual pitch.

Previously this was accomplished by doubling the "cpp" and "pitch"
values stored in the intel_region data structure, and halving the
height.  However, this was confusing, and it led to a subtle (but
benign) bug: since a stencil buffer is W-tiled, its true height must
be aligned to a multiple of 64; we were accidentally aligning its faux
height to a multiple of 64, causing memory to be wasted.

Note that for window system stencil buffers, the DDX also doubles the
cpp and pitch values.  To facilitate fixing this DDX server bug in the
future, we fix the cpp and pitch values we receive from the X server
only if cpp has the "incorrect" value of 2.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Clarify comments about the DDX.
2012-04-10 11:19:05 -07:00
Pekka Paalanen
272bc48976 wayland-drm: remove wl_buffer.damage
This is a related fix for the Wayland change:

commit 83685c506e76212ae4e5cb722205d98d3b0603b9
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Mar 26 16:33:24 2012 -0400

    Remove wl_buffer.damage and simplify shm implementation

Apparently, this should also fix a memory leak. When wl_buffer.damage
was removed from Wayland and Mesa was not fixed, wl_buffer.destroy ended
up in the (empty) damage function instead of calling
wl_resource_destroy().

Spotted during build as:
  CC     wayland-drm-protocol.lo
wayland-drm.c:80:2: warning: initialization from incompatible pointer type
wayland-drm.c:82:1: warning: excess elements in struct initializer
wayland-drm.c:82:1: warning: (near initialization for 'drm_buffer_interface')

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-10 13:06:56 -04:00
Vinson Lee
70d038e46e st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fixes uninitialized member defects reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-09 22:32:23 -07:00
Chad Versace
36fef005b1 main: Fix memory leak in _mesa_make_extension_string()
I forgot to free the string returned by strdup().

Note: This is a candidate for the stable branches.
CC: Johannes Obermayr <johannesobermayr@gmx.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-09 17:31:51 -07:00
Vadim Girlin
783e4da72a r600g: check gpr count limit
This should help to prevent gpu lockups.
See https://bugs.freedesktop.org/show_bug.cgi?id=48472

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-09 18:05:57 -04:00
Vadim Girlin
4b06280ea3 glsl: fix variable ordering in the output_read_remover
Use the hash of the variable name instead of the pointer value.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-09 18:04:00 -04:00
Eric Anholt
a07cf3397e i965: Add support for sampling texture buffer objects on gen7+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:27 -07:00
Eric Anholt
0b3729c987 i965: Add real support for texturing/rendering with MESA_FORMAT_RGBA8888_REV.
This was hacked in in one place for EGL image stuff, but the right
thing to do was just to provide the mapping from the mesa format to
the native hardware format, which includes render target support.

This turns out to be required for GL_ARB_texture_buffer_object, which
sees data in this layout.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:15 -07:00
Eric Anholt
aa8ce1be4a i965/gen7: Fix the /* ignored */ comment on constant surface setup.
It turns out this field *is* used, and it's the stride between samples
from the buffer.  Discovered during TBO debugging.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:12 -07:00
Eric Anholt
bf82ce3c66 mesa: Add support for the GL 3.1 R/RG formats in texture buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:49 -07:00
Eric Anholt
664355f05b mesa: Track a gl_format for the texture buffer format.
There was a function full of unused mappings from the GLenum to
datatype/comps, but that wasn't all the information a driver would
want, which includes the other fields that a gl_format has.  Given
that all the texture buffer formats were represented in gl_format,
just use that as our description.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:44 -07:00
Eric Anholt
dcf42dbd06 mesa: Handle updating texture state for buffer textures.
We have to skip some work that wants to look at texture images, since
buffer textures don't have any of that complexity.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:33 -07:00
Eric Anholt
18c2ee0df5 mesa: Create the default (name==0) buffer texture.
All that should be needed is that it exists.  Fixes segfaults on first
_mesa_update_context() with a samplerBuffer-using shader active but
without a particular buffer texture enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:30 -07:00
Eric Anholt
bb430ced7f glsl: Add texelFetch(*samplerBuffer) entrypoints to GLSL 1.40.
Fix texelFetch(sampler2DRect) and textureSize(samplerBuffer)
generation to not reference a LOD at the same time because it's easier
than not fixing it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:27 -07:00
Eric Anholt
6598552521 glsl: Add support for parsing [iu]samplerBuffer types in GLSL 1.40.
The samplerBuffer type will be undefined in !glsl 1.40, and the
keyword is marked as reserved.  The [iu]samplerBuffer types are not
marked as reserved pre-1.40, so they don't have separate tokens and
fall through to normal type handling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:06 -07:00
Eric Anholt
6d0f5684c1 mesa: Set the correct initial value of the texture buffer object format.
Fixes piglit GL_ARB_texture_buffer_object/get

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:03 -07:00
Eric Anholt
44f2cee0fd mesa: Set up glTexBuffer{,ARB} for display list compile.
We're supposed to just immediately call it.  Fixes piglit
GL_ARB_texture_buffer_object/dlist

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:33:57 -07:00
Eric Anholt
62bdb187f8 glapi: regen for TBO change. 2012-04-09 14:33:53 -07:00
Eric Anholt
0be44a3541 glapi: Mark TexBuffer as an alias of TexBufferARB.
This is set correctly in gl.spec, but was missed in Mesa.  As a
result, only one of the two was hooked up in Mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:33:41 -07:00
Eric Anholt
eb7a71dea7 glsl: Drop the round-trip through ast_type_specifier for many builtin types.
We have lexer recognition of a bunch of our types based on the
handling.  This code was mapping those recognized tokens to an enum
and then to a string of their name.  Just drop the enums and provide
the string directly in the parser.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:30:46 -07:00
Kenneth Graunke
b2c0df2b60 glsl: Use (const char *) in AST nodes rather than plain (char *).
Nothing actually relied on them being mutable, and there was at least
one cast which discarded const qualifiers.  The next patch would have
introduced many more.

Casting away const qualifiers should be avoided if at all possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-09 14:30:34 -07:00
Eric Anholt
68b99be409 ff_fragment_shader: Remove some dead fields.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-09 14:09:21 -07:00
Kenneth Graunke
430562a980 x86-64: Don't print "Initializing x86-64 optimizations" in debug builds.
In "release" builds, Mesa would print this message if the MESA_DEBUG
variable was set.  Make it so for debug builds as well.

I build debug builds all the time, but I'm not debugging this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:39 -07:00
Kenneth Graunke
781e2d5cfa ir_to_mesa: Remove pretense of support for function calls.
While ir_to_mesa contains code that attempts to support functions, I
honestly doubt it's been tested and have little confidence that it
works.

The comment in visit(ir_function *ir) doesn't inspire confidence:
/* Ignore function bodies other than main() -- we shouldn't see calls to
 * them since they should all be inlined before we get to ir_to_mesa.
 */

Furthermore, hardware drivers such as i915, i965, and (AFAICT) r200
don't support the BGNSUB/ENDSUB/CAL opcodes anyway.  Only swrast does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:37 -07:00
Kenneth Graunke
f78f48b6d2 i965: Remove vestiges of function call support from the old VS backend.
This never worked.  brwProgramStringNotify also explicitly rejects
programs that use CAL and RET.  So there's no need for this to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:27 -07:00
Yuanhan Liu
c653287549 i915: set SPRITE_POINT_ENABLE bit correctly
When SPRITE_POINT_ENABLE bit is set, the texture coord would be
replaced, and this is only needed when we called something like
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE).

And more,  we currently handle varying inputs as texture coord,
we would be careful when setting this bit and set it just when
needed, or you will find the value of varying input is not right
and changed.

Thus we do set SPRITE_POINT_ENABLE bit only when all enabled tex
coord units need do CoordReplace. Or fallback is needed to make
sure the rendering is right.

With handling the bit setup at i915_update_sprite_point_enable(),
we don't need the relative code at i915Enable then.

This patch would _really_ fix the webglc point-size.html test case and
of course, not regress piglit point-sprite and glean-pointSprite
testcase.

NOTE: This is a candidate for stable release branches.

v2: fallback just when all enabled tex coord units need do
    CoordReplace (Eric)
v3: move the sprite point validate code at I915InvalidateState (Eric)
v4: sprite point enable bit update based on _NEW_PROGRAM, too
    add relative _NEW-state comments to show what state is being used(Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:17 +08:00
Yuanhan Liu
8b5b3b93d7 glx: fix compile warnings
Fix 'set but not used' warnings; gl_version, gl_versions_profiles and
glx_extensions variables are used just only HAVE_XCB_GLX_CREATE_CONTEXT
is defined. Thus those warnings are shown when that macro isn't defined.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:10 +08:00
Johannes Obermayr
7bb1c784a3 st/xa: Link with -Wl,-r instead of -r.
This is required to link with clang:
  /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400160.
2012-04-07 20:33:44 +02:00
Johannes Obermayr
a50d695ac2 tgsi: Fix conflict with fortify printf redirect in glibc.
Fixes clang error:

   tgsi/tgsi_dump.c:72:12: error: no member named '__printf_chk' in 'struct dump_ctx'
         ctx->printf( ctx, "%u", e );
         ~~~  ^
   /usr/include/bits/stdio2.h:109:3: note: expanded from macro 'printf'
     __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
     ^

 Idea stolen from:
   http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg210998.html

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-07 20:33:37 +02:00
Brian Paul
299c9052e8 st/mesa: fix max_offset computation for base vertex
Add the maximum base vertex offset to max_index for computing the
buffer size.  Fixes a failed assertion in the u_upload_mgr.c code with
the VMware svga driver.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48141

v2: incorporate Marek's suggestions.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-04-06 14:18:53 -06:00
Brian Paul
ecc480524b svga: add missing cases for PIPE_CAP_x queries
Return 0 for features we don't support.  Added debug_printf()
warnings when we fail to handle a new PIPE_CAP_x case.  That will
alert us to interfaces changes in the future.  We don't want to
just ignore new PIPE_CAPs and possibly miss something important.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-06 14:10:50 -06:00
Brian Paul
d7707ef5a5 svga: return 1 for PIPE_CAP_VERTEX_COLOR_UNCLAMPED query
Before, we weren't clamping the vertex colors produced by ARB vertex
programs.  This could result in some rendering being too bright (in
ETQW, for example).

Also add cases for PIPE_CAP_VERTEX_COLOR_CLAMPED and
PIPE_CAP_FRAGMENT_COLOR_CLAMPED with comments to be complete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-06 14:10:50 -06:00
Brian Paul
0adc5d9cfd svga: handle TGSI_SEMANTIC_CLIPDIST/VERTEX semantics
We can't support these vertex attributes, but don't die in an assertion.
Issue a warning instead.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48142
2012-04-06 14:10:50 -06:00
Brian Paul
0cd68001f8 gallium/docs: fix typos 2012-04-06 14:10:50 -06:00
Kenneth Graunke
2a80a1e2a7 i965: Actually upload sampler state pointers for the VS unit on Gen6.
We already program all the sampler state correctly, we just didn't give
the GPU a pointer to it for the VS stage.  Thus, any texturing other
than texelFetch() wouldn't work.

Fixes piglit test vs-textureLod-miplevels and 99 of oglconform's
glsl-bif-tex subtests.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-05 18:37:34 -07:00
James Benton
cf68959f99 gallivm: Updated lp_build_log2_approx to use a more accurate polynomial.
Tested with lp_test_arit with 100% passes and piglit tests with 100%
pass for log but some tests still fail for pow.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-05 20:34:11 +01:00
James Benton
7c639feb2f gallivm: Updated lp_build_polynomial to compute odd and even terms separately to decrease data dependency for faster runtime.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-05 20:32:54 +01:00
Alexandre Demers
129d5138d6 xatracker: fix the build of a 32bit lib on a 64bit os
we were missing cflags.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2012-04-05 00:18:25 -04:00
Marek Olšák
34e53adc51 r600g: inline r600_upload_index_buffer 2012-04-04 13:09:47 +02:00
Marek Olšák
e9abb2cd6e r600g: inline r600_upload_const_buffer 2012-04-04 13:09:47 +02:00
Marek Olšák
82a7fe6f5c r600g: handle DISCARD_WHOLE_RESOURCE for buffers
This should prevent stalls and therefore increase perfomance in some cases.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
c7d0e9ec32 r600g: invalidate caches at the beginning of CS
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
a633d82ce3 r600g: remove dead code after the rework
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
68bbfc1afe r600g: rework state emission of constant buffers
Framerate in ipers:
  before: 43.6 FPS
  after:  46.6 FPS

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
c76462b45f r600g: rework state emission of vertex buffers
This reduces a little of CPU overhead.
The idea is to translate pipe vertex buffers directly into the CS
and not using any intermediate representations.

Framerate in Torcs:
  before: 32.2
  after:  34.6

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
5c03d1fa0f r600g: kill off the fallback for crazy src_offset values
st/mesa doesn't allow src_offset to be greater than stride and the maximum
stride r600 supports is 2047.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Alexandre Demers
3ea3695b04 st/xvmc: fix library installation dir
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47878

v2: some reordering and while at it also fix the
    comment in Makefile.xvmc

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-04-04 10:57:50 +02:00
Marek Olšák
75f8990547 r300g/swtcl: fix crash when back color is present in vertex shader
The shader transformation code sometimes produced invalid TGSI.
2012-04-04 04:28:41 +02:00
Marek Olšák
ba86e03167 r300g/swtcl: initialize some Draw options 2012-04-04 04:28:41 +02:00
Marek Olšák
c3481f3410 r300g/swtcl: fix polygon offset 2012-04-04 04:28:41 +02:00
Marek Olšák
3b8fe06eb6 r300g/swtcl: don't expose shader subroutine support
RET in the main function doesn't work. This should be fixed in Draw, but meh.
2012-04-04 04:28:41 +02:00
Marek Olšák
6bede55241 r300g: initialize state & render functions before creating u_vbuf & u_blitter 2012-04-04 04:28:40 +02:00
Marek Olšák
da2123051c r300g/swtcl: don't enter u_vbuf_mgr 2012-04-04 04:28:40 +02:00
Marek Olšák
5ce0598a03 r300g/swtcl: don't print an error when getting ClipVertex
Draw can do it just fine.
2012-04-04 04:28:40 +02:00
Benjamin Franzke
9ba3cecaa0 st/egl: Update to the new wl_shm_pool interface 2012-04-03 20:28:20 +02:00
Marek Olšák
900be21e09 u_blitter: don't use user buffers 2012-04-03 20:05:53 +02:00
Vinson Lee
4f513002f6 gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.
llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-03 10:55:45 -07:00
Christian König
24ca588ce6 st/vdpau: fix deadlock in PresentationQueueQuerySurfaceStatus
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-04-03 17:33:26 +02:00
Marek Olšák
7f2156c9bd r600g: remove dead code in r600_update_derived_state 2012-04-03 17:09:47 +02:00
James Benton
5db9d76a6a gallivm: Maximum loop iterations
Limits maximum loop iterations in a TGSI shader to prevent infinite
loops from occurring, any iteration in any loop counts towards this
limit

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-03 10:11:27 +01:00
José Fonseca
d312b224b6 gallivm: Simplify/reorder minimax helper. 2012-04-03 09:12:47 +01:00
Vinson Lee
431b458f24 swrast: Fix memory leaks in blit_linear.
Fixes Coverity resource leak defects.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-02 21:47:41 -07:00
Kenneth Graunke
f75c2d5314 glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.
Variables have types, expression trees have types, but statements don't.
Rather than have a nonsensical field that stays NULL in the base class,
just move it to where it makes sense.

Fix up a few places that lazily used ir_instruction even though they
actually knew the particular subclass.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:46 -07:00
Kenneth Graunke
82065fa20e glsl: Remove ir_call::get_callee() and set_callee().
Previously, set_callee() performed some assertions about the type of the
ir_call; protecting the bare pointer ensured these checks would be run.

However, ir_call no longer has a type, so the getter and setter methods
don't actually do anything useful.  Remove them in favor of accessing
callee directly, as is done with most other fields in our IR.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:43 -07:00
Kenneth Graunke
d884f60861 glsl: Convert ir_call to be a statement rather than a value.
Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
  stream, treating it as an untyped statement.  Yet, it was a subclass
  of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
  arbitrary expression trees.  While this fit naturally with the source
  language, it meant that expressions might not be pure, making it
  difficult to transform and optimize them.  To combat this, we always
  emitted ir_call directly in the RHS of an ir_assignment, only using
  a temporary variable in expression trees.  Many passes relied on this
  assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue).  Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one.  They cannot be embedded in expressions.

All expression trees are now pure, without exception.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:41 -07:00
Kenneth Graunke
622eed0750 glsl: Split out ir_reader's ability to read ir_dereference_variables.
Most of the time, we just want to read an ir_dereference, so there's no
need to have these in separate functions.  However, the next patch will
want to read an ir_dereference_variable directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:38 -07:00
Kenneth Graunke
d0fa0cb52c glsl: Move constant expression handling from calls to signatures.
When translating a call from AST to HIR, we need to decide whether it
can be evaluated to a constant before emitting any code (namely, the
temporary declaration, assignment, and call.)

Soon, ir_call will become a statement taking a dereference of where to
store the return value, rather than an rvalue to be used on the RHS of
an assignment.  It will be more convenient to try evaluation before
creating a call.  ir_function_signature seems like a reasonable place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:36 -07:00
Kenneth Graunke
807e967c61 glsl: Use ir_rvalue to represent generic error_type values.
Currently, ir_call can be used as either a statement (for void
functions) or a value (for non-void functions).  This is rather awkward,
as it's the only class that can be used in both forms.

A number of places use ir_call::get_error_instruction() to construct a
generic value of error_type.  If ir_call is to become a statement, it
can no longer serve this purpose.

Unfortunately, none of our classes are particularly well suited for
this, and creating a new one would be rather aggrandizing.  So, this
patch introduces ir_rvalue::error_value(), a static method that creates
an instance of the base class, ir_rvalue.  This has the nice property
that you can't accidentally try and access uninitialized fields (as it
doesn't have any).  The downside is that the base class is no longer
abstract.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:34 -07:00
Kenneth Graunke
ac0f8bae8d glsl: Combine AST-level and IR-level parameter mode checking loops.
generate_call() and ast_function_expression::hir() both tried to verify
that 'out' and 'inout' parameters used l-values.  Irritatingly, it
turned out that this was not redundant; both checks caught -some- cases.

This patch combines the two into a single "complete" function that does
all the parameter mode checking.  It also adds a comment clarifying why
AST-level checking is necessary in the first place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:32 -07:00
Kenneth Graunke
909e889967 glsl: Split up function matching and call generation a bit more.
We used to have one big function, match_signature_by_name, which found
a matching signature, performed out-parameter conversions, and generated
the ir_call.  As the code for matching against built-in functions became
more complicated, I split it internally, creating generate_call().

However, I left the same awkward interface.  This patch splits it into
three functions:
1. match_signature_by_name()

   This now takes a name, a list of parameters, the symbol table, and
   returns an ir_function_signature.  Simple and one purpose: matching.

2. no_matching_function_error()

   Generate the "no matching function" error and list of prototypes.
   This was complex enough that I felt it deserved its own function.

3. generate_call()

   Do the out-parameter conversion and generate the ir_call.  This
   could probably use more splitting.

The caller now has a more natural workflow: find a matching signature,
then either generate an error or a call.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:29 -07:00
Kenneth Graunke
0405bd08ca glsl: Don't trust loop analysis in the presence of function calls.
Function calls may have side effects that alter variables used inside
the loop.  In the fragment shader, they may even terminate the shader.
This means our analysis about loop-constant or induction variables may
be completely wrong.

In general it's impossible to determine whether they actually do or not
(due to the halting problem), so we'd need to perform conservative
static analysis.  For now, it's not worth the complexity: most functions
will be inlined, at which point we can unroll them successfully.

Fixes Piglit tests:
- shaders/glsl-fs-unroll-out-param
- shaders/glsl-fs-unroll-side-effect

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:19 -07:00
Kenneth Graunke
252d3118dd i965/aub: Dump a final bitmap from DestroyContext.
Certain applications don't call SwapBuffers before exiting.  Yet, we'd
really like to see a bitmap containing the final rendered image even if
they choose never to present it.

In particular, Piglit tests (at least with -auto -fbo) fall into this
category.  Many of them failed to dump any images at all.

Dumping one final image at context destruction time seems to work.
We may wish to pursue a more elegant solution later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-02 13:47:53 -07:00
Marek Olšák
42bc0b9b9d r600g: unduplicate code for PS partial flush 2012-04-01 23:57:50 +02:00
Marek Olšák
bc95152f1d r600g: determine in advance if hw has vertex cache 2012-04-01 23:57:50 +02:00
Marek Olšák
669d8766ff r600g: optimize r600_resource_va
Avoid calling get_radeon_bo and inline it.
2012-04-01 23:57:50 +02:00
Marcin Slusarz
68e4c83ffa targets/{xvmc,vdpau,va}: remove all objects on make clean 2012-04-01 17:42:48 +02:00
Eugeni Dodonov
a45247fb1b intel: add PCI IDs for Ivy Bridge GT2 server variant
Those IDs are used by Bromolow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-04-01 10:50:55 -03:00
Vinson Lee
4123d0b321 linker: Fix memory leak in count_uniform_size::visit_field.
Fixes a Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-31 11:15:41 -07:00
Kenneth Graunke
bd2410b48d intel: Add some PCI IDs for Haswell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:31 -07:00
Kenneth Graunke
4848122a96 i965: Set "Shader Channel Select" fields in Haswell's SURFACE_STATE.
These can be used to implement EXT_texture_swizzle without baking
state-dependent swizzle instructions into the shader and forcing
recompiles.

For now, just set them to pass-through mode, so everything continues to
work as it did on Ivybridge.  We can optimize this later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:31 -07:00
Kenneth Graunke
a23dcc18e7 i965: Fill in Sample Mask in Haswell's 3DSTATE_PS.
We only need one sample, since we don't support multisampling yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:23 -07:00
Kenneth Graunke
fc8edbe016 i965: Set "Stencil Buffer Enable" bit on Haswell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:21 -07:00
Kenneth Graunke
b4410ac394 i965: Set Line Stipple enable bit in 3DSTATE_SF for Haswell.
Apparently this needs to be the same as in 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:03 -07:00
Kenneth Graunke
1b3a199097 i965: Update max VS/PS threads shift offsets for Haswell.
These now start at bit 23 instead of bit 24/25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:02 -07:00
Kenneth Graunke
1ba8c6ad03 i965: Disable HiZ on Haswell for now.
Getting HiZ working means updating all the state packets for resolves
and clears.  It's not worth doing until we get the basics working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:38:59 -07:00
Kenneth Graunke
180aecb6dc i965: Add initial IS_HASWELL() macros.
For now, these all return 0, as I don't yet want to enable Haswell
support.  Eventually they will be filled in with proper PCI IDs.

Also add an is_haswell field similar to is_g4x to make it easy to
distinguish Gen7 and Gen7.5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:38:48 -07:00
Kenneth Graunke
01044fce6b i965: Avoid explicit accumulator operands in SIMD16 mode on Gen7.
According to the BSpec ISA volume's "Accumulator Register" section:

"[DevIVB] SIMD16 execution on dwords is not allowed when accumulator is
 explicit source or destination operand."

Fixes piglit tests:
- fs-multiply-const-ivec4
- fs-multiply-const-uvec4
- fs-multiply-ivec4-const
- fs-multiply-uvec4-const

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-30 14:27:54 -07:00
Marek Olšák
99a192ce7d gallium/postprocess: document serious issue causing undefined behavior 2012-03-30 18:14:06 +02:00
Marek Olšák
ead0a89c96 r600g: cleanup after get_query_result change
Finally, union r600_query_result can be removed.
2012-03-30 17:12:52 +02:00
Marek Olšák
6d73382afc r300g: cleanup after get_query_result change 2012-03-30 17:12:51 +02:00
Marek Olšák
452d07759d gallium/util: add helper function util_query_clear_result 2012-03-30 17:12:51 +02:00
Marek Olšák
4445e170be gallium: adapt to get_query_result interface change
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-30 17:12:51 +02:00
Marek Olšák
102ed41ae6 gallium: make get_query_result return union* and not void*
This replaces the cryptic void* parameter with a union.
(based on union r600_query_result)

Users of this can still pass uint64* in it, but that cannot work for every
query type, obviously. Most importantly, the code now documents what should
be expected from get_query_result.

This also adds pipe_query_data_pipeline_statistics as per the D3D11 docs.

v2: fix indentation, add comments and use the doxygen style

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-30 17:12:51 +02:00
Tom Stellard
7d87c71a70 configure: Add --with-llvm-shared-libs
This option allows targets to link against the LLVM shared library
instead of the static libs.  With LLVM 2.9, his saves ~11 MB for each of
the r300 target libraries.
2012-03-30 09:13:04 -04:00
Kristian Høgsberg
2402ce04ae shared-glapi: Include from builddir
Fixes out-of-tree builds.

https://bugs.freedesktop.org/show_bug.cgi?id=47649
2012-03-29 09:25:15 -04:00
Vinson Lee
a7b8e16dc6 gallivm: Fix method overriding in raw_debug_ostream.
Use matching type qualifers to avoid method hiding.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-28 22:46:17 -07:00
Ander Conselvan de Oliveira
4a976b60b1 egl_dri2: use gbm_surface as the native window type in drm platform 2012-03-28 22:14:34 -04:00
Ander Conselvan de Oliveira
fd6acb97fb gbm: Create hooks for dri2_loader_extension in dri backend
Pass a dri2_loader extension to the dri driver when gbm creates the dri
screen.  The implementation jumps through pointers in the gbm device
so that an EGL on GBM implementation can provide the real implementations.
2012-03-28 22:14:34 -04:00
Ander Conselvan de Oliveira
0d1ef1f57f gbm: Add gbm_surface interface
The idea here is to be able to create an egl window surface from a
gbm_surface.  This avoids the need for the surfaceless extension and
lets the EGL platform handle buffer allocation, while keeping the user
in charge of somehow presenting the buffers (using kms page flipping,
for example).

gbm_surface_lock_front_buffer() locks a surface's front buffer and
returns a gbm bo representing it.  This bo should later be returned
to the gbm surface using gbm_surface_release_buffer().
2012-03-28 22:14:34 -04:00
Brian Paul
7f16246ace draw: fix missing immediates bug in polygon stipple code
The function that counts the number of TGSI immediates also needs to
emit the immediates.  This fixes assorted failures when using polygon
stipple with fragment shaders that have their own immediates.

NOTE: This is a candidate for the 8.0 branch.
2012-03-28 11:43:18 -06:00
Christian König
fc0a5e21d7 vl: move winsys helper out of winsys directory
They aren't winsys of their own,
just help dealing with them.

v2: add some more comments in vl_winsys.h

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-28 15:47:41 +02:00
Jon TURNEY
ba83b8b4ae Use -no-undefined libtool flag in src/glx/Makefile.am
"Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-28 13:03:52 +01:00
Yuanhan Liu
9cb777eb71 intel: fix un-blanced map_refcount issue
This is a regression introduced by commit cdcfd5, which forget to
increase the map_refcount for successfully-mapped region. Thus caused a
wrong non-blanced map_refcount.

This would fix the regression found in the two following webglc testcase
on Pineview platform:
   texture-npot.html
   gl-max-texture-dimensions.html

Cc: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-28 09:51:38 +08:00
Wang YanQing
7a6324dbfe glx:dri_common.c: check psc->driScreen->createDrawable return value
createDrawable may return NULL value, we should check it, or it will
make a segment failed.

[minor-indent-issue-fixed-by: Yuanhan Liu]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-28 09:51:16 +08:00
Marek Olšák
9773369ab4 r600g: also disable transform feedback on cayman
It's said to cause troubles there.
The env var is R600_STREAMOUT again.
2012-03-28 02:21:03 +02:00
Marek Olšák
393d741788 r600g: enable transform feedback on everything that isn't r700
Use R700_STREAMOUT=1 if you wanna hack transform feedback on r700.
2012-03-27 21:06:59 +02:00
Benjamin Franzke
ad22e647e0 st/egl: Also remove wl_buffer_damage in wayland backend
As commit 03eca9d92d does for egl_dri2.
2012-03-27 18:51:53 +02:00
ojab
60b58822f0 gallivm: Use InitializeNativeTargetDisassembler().
To initialize only native LLVM Disassembler on LLVM >= 3.1.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-03-27 16:28:30 +01:00
Ander Conselvan de Oliveira
410aa3eb45 egl_dri2: make flush extension useable by drm platform 2012-03-27 08:28:07 -04:00
Kristian Høgsberg
03eca9d92d wayland: Stop using wl_buffer.damage 2012-03-27 08:28:07 -04:00
Neil Roberts
03f617f413 Add support for GL_EXT_unpack_subimage on GLES2
This extension just permits GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_ROWS
and GL_UNPACK_SKIP_PIXELS to be passed to glPixelStore on GLES2 so it
is trivial to implement.
2012-03-27 08:28:06 -04:00
Benjamin Franzke
860f4846c7 gles: Enable the GL_EXT_read_format_bgra extension
Also fixes the usage of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,
which may be set to a BGRA format e.g. for a MESA_FORMAT_ARGB8888 fb.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-27 09:03:19 +02:00
Benjamin Franzke
e9a5457d73 gles1: Enable GL_EXT_texture_format_BGRA8888 in APIspec
The extension is already exposed for GLES1, but the APIspec
doesnt allow the usage of GL_BGRA_EXT in glTex(Sub)Image2D.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-27 09:03:19 +02:00
Dylan Noblesmith
aebd549243 glapi: regenerate enums.c
For previous four commits:

    glapi: add GL_ARB_texture_float
    glapi: add GL_ARB_depth_buffer_float
    glapi: add GL_ARB_texture_compression_rgtc
    glapi: add ARB_texture_rg
2012-03-26 21:35:24 +00:00
Dylan Noblesmith
91c8bedb8a glapi: add GL_ARB_texture_float
And add some missing core GL 3.0 enums that came from this
extension, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 21:35:17 +00:00
Dylan Noblesmith
50fa821854 glapi: add GL_ARB_depth_buffer_float
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 21:35:04 +00:00
Dylan Noblesmith
faf954f151 glapi: add GL_ARB_texture_compression_rgtc
Noticed this was missing when writing the "glapi: sort ARB extensions
by number" commit, which at least shows it was effective.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:28:25 +00:00
Dylan Noblesmith
bae4cd6882 glapi: add ARB_texture_rg
Noticed it was missing based on the lack of a descriptive enum
name from this bug's error message:

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

This moves two enums out of GL3x.xml. Though since this and
GL_ARB_texture_compression_rgtc are both strict subsets of GL3,
both extensions should have had all their enums in that file
to begin with, not just two of them.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:28:25 +00:00
Dylan Noblesmith
a419595a87 regen for "glapi: sort ARB extensions by number" 2012-03-26 21:28:10 +00:00
Dylan Noblesmith
1ae2e39d01 glapi: sort ARB extensions by number
And add comments to fill in for extensions that aren't there.

Noticed the comment about "ARB extensions sorted by extension number"
didn't extend to the <xi:include> directives when it became clear
GL_ARB_texture_rg was missing, going by the error message seen here:

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

This makes it easier to notice in the future if an extension is missing
when it shouldn't be.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:27:15 +00:00
Vinson Lee
b688700edc mesa: Fix memory leak in generate_mipmap_compressed.
Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 14:08:11 -07:00
Dave Airlie
7449ae4597 glsl: fix linker error message context for frag shader output.
A later error prints this properly, fix this case to do the same.

v2: remove attribute as per Ian's suggestion
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-03-26 18:48:46 +01:00
Dave Airlie
a83c1d61c2 glapi: ARB_blend_func_extended support + regen. (v2)
This adds the xml file covering ARB_blend_func_extended.

v2: fix SRC1_ALPHA

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-26 18:42:41 +01:00
Kenneth Graunke
7a348b91ce glsl: Make ir_dereference_variable ctor assert the variable exists.
This also seems like a bad idea.  There were too many instances for me
to thoroughly scan the code as I did with the last two patches, but a
quick scan indicated that most callers newly allocate a variable,
dereference it, or NULL-check.  In some cases, it wasn't clear that the
value would be non-NULL, but they didn't check for error_type either.

At any rate, not checking for this is a bug, and assertions will trigger
it earlier and more reliably than returning error_type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:57 -07:00
Kenneth Graunke
dca19a7711 glsl: Explicitly NULL-check variables before making a dereference.
The constructor currently returns a ir_dereference_variable of error
type when provided NULL, but that's about to change in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:55 -07:00
Kenneth Graunke
2cd652f810 glsl: Make ir_dereference_record constructor assert the variable exists.
Providing a NULL pointer to the ir_dereference_record() constructor
seems like a bad idea.  Currently, if provided NULL, it returns a
partially constructed value of error type.  However, none of the callers
are prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:53 -07:00
Kenneth Graunke
25b0d45d03 glsl: Make ir_dereference_array constructor assert the variable exists.
Providing a NULL pointer to the ir_dereference_array() constructor seems
like a bad idea.  Currently, if provided NULL, it returns a partially
constructed value of error type.  However, none of the callers are
prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:51 -07:00
Kenneth Graunke
ced54dcf9b glsl: Comment that expression flattening is used for matrix operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:44 -07:00
Christian König
7f6af49092 st/vdpau: clear video surface at least once
So if anything goes wrong we won't display a random image.

v2: flush before using the surface with the decoder.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-26 12:39:40 +02:00
Christian König
9f777699ed st/vdpau: invert interlaced buffer checks
That wasn't working as supposed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-26 12:39:40 +02:00
Dave Airlie
7b6424143d intel: fix TFP at 16-bpp
don't ask why I had to debug this.

tested to fix g-s and kwin at 16-bpp on Ironlake.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:15:52 +01:00
Dave Airlie
d6c5ad52b2 drisw: fix image stride calculation for 16-bit.
If you ran g-s in 16-bpp we'd do a bunch of memory corruption.

now it just misrenders for some other reasons.

applies to stable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-25 17:15:23 +01:00
Dave Airlie
ba3a4d79a7 glsl: fix compiling warning from gcc 4.7
ir_validate.cpp: In member function ‘virtual ir_visitor_status ir_validate::visit_leave(ir_swizzle*)’:
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::x’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::y’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::z’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::w’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-25 17:12:24 +01:00
Dave Airlie
b78a77f979 glsl: initialise const force glsl extension warning in fake ctx
valgrind complained about an uninitialised value being used in
glsl_parser_extras.cpp, and this was the one it was giving out about.

Just initialise the value in the fakectx.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:12:24 +01:00
Dave Airlie
989e013b80 makefile: add phony am--refresh target
for some reason when I configure --with-dri-drivers="" the src/mesa/drivers/dri
Makefile tries to call the am--refresh target in the toplevel Makefile,
we don't have one, and I'm not sure what it should look like.

This makes things continue on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:09:35 +01:00
Dave Airlie
ea663d56e2 docs/GL3.txt: document ARB_blend_func_extended state
I've written softpipe version in my tree, + gallium/mesa/glsl changes,
however r600 currently hangs the GPU.
2012-03-24 16:35:46 +00:00
Dave Airlie
2c778375a1 glx/drisw: avoid segfaults when we fail to get visual
piglit glx-tfp segfaults on llvmpipe when run vs a 16-bit radeon screen,

it now fails instead of segfaulting, much prettier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-24 13:05:19 +00:00
Vinson Lee
0f3aa9f4bd mesa: Fix memory leak in _mesa_get_uniform_location.
Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-23 22:52:57 -07:00
Brian Paul
318669f196 st/mesa: fix mipmap image size computation w.r.t. texture arrays
The image height or depth is the array_size for array textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-23 10:08:49 -06:00
Brian Paul
281d0fd3a9 mesa: set numFaces=6 for cube maps in _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-23 10:08:49 -06:00
Dylan Noblesmith
8d9decb75f intel: fix null dereference processing HiZ buffer
Or technically, a near-null dereference.

https://bugs.freedesktop.org/show_bug.cgi?id=46303
https://bugs.freedesktop.org/show_bug.cgi?id=46739

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-22 20:51:38 +00:00
Christopher Yeleighton
0c406afab0 docs: fix html in bugs.html
https://bugs.freedesktop.org/show_bug.cgi?id=47310
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-22 08:15:11 -06:00
Christian König
f23a2cb5d2 st/vdpau: improve frame dumping functionality a bit
Just a workaround until we get a real unit-
testing tool for VDPAU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-22 09:47:04 +01:00
Christian König
fa66fda5b0 st/vdpau: add VC-1 startcode if none is found in the stream
v2: only advanced profile needs that.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-22 09:47:04 +01:00
Eric Anholt
e07b1603e2 glx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.
When a GL LD_PRELOAD library like apitrace was used,
glXGetProcAddress() would return the preload's symbols instead of
libGL's symbol, leading to infinite recursion when the returned
function was called.  This didn't hit apitrace on most apps because
who calls glXGetProcAddress() on the global functions.

The -Bsymbolic, which was present in mklib before automake conversion,
causes the glxcmds.c:GLX_functions table to be resolved at link time,
so that LD_PRELOADs don't affect it any more.

Fixes crashes when running wine under apitrace.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-03-21 13:55:41 -07:00
Brian Paul
20836c8185 st/mesa: set MaxUnrollIterations = 255
The default was 32 for the EmitNoLoops=0 case.  This allows the oZone3D
soft shadows test to work properly with the vmware driver.  Jose reported
that SM3 supports up to 255 loop iterations.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-21 13:46:44 -06:00
Brian Paul
7feabfe23d glsl: propagate MaxUnrollIterations to the optimizer's loop unroller
Instead of the hard-coded value of 32.  Note that MaxUnrollIterations
defaults to 32 so there's no net change.  But the gallium state tracker
can override this.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 13:46:36 -06:00
Eric Anholt
9bd38f3c67 intel: Make use of the new GPU-unsynchronized map functionality in libdrm.
Improves Unigine Tropics performance at 1024x768 by 2.06236% +/-
0.50272% (n=11).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
8308869311 intel: Drop the tracking of bo_map vs bo_map_gtt for unmapping.
drm_intel_bo_unmap() supports both in the current libdrm version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
f97da4ed71 i965: Avoid flushing the batch for busy BOs for ARB_mbr with INVALIDATE_BUFFER.
Unigine Tropics uses INVALIDATE_BUFFER and not UNSYNCHRONIZED to reset
the buffer object when its streaming wraps.  Don't penalize it by
flushing the batch at the wrap point, just allocate a new BO and get
to using it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
2222aa06e1 intel: Handle devid overrides using libdrm.
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
0247d89183 intel: Ask libdrm to dump an AUB file if INTEL_DEBUG=aub.
It also asks for BMPs in the aub file at SwapBuffers time.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:05 -07:00
Eric Anholt
218f3a5663 intel: Bump libdrm requirement to 2.4.32.
We'll need this for AUB dumping and unsynchronized maps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:05 -07:00
Jakob Bornecrantz
3a4ded6d1f docs: Add 8.0.2 md5sums
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 0bf0ba44de)
2012-03-21 19:23:20 +00:00
Jakob Bornecrantz
7bb7e5ffbb docs: Add 8.0.2 release notes
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 5f7204c3bb)
2012-03-21 19:23:20 +00:00
Jakob Bornecrantz
56d05a8d3a mesa: Include mesa ES mapi generated files
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 770f785a6f)
2012-03-21 19:23:20 +00:00
Eric Anholt
f1c1c9eabe glsl: Don't require gl_Position to be written in GLSL 1.40.
Fixes piglit glsl-1.40/execution/tf-no-position.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:07:54 -07:00
Jon TURNEY
0bc4407744 mapi: Use -no-undefined libtool flag in src/mapi/shared-glapi/Makefile.am
Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library
is linked.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-21 11:31:45 -07:00
Eric Anholt
668ed95993 drirc: Add missing XML attributes that made the driconf application whine.
These are used for pretty presentation of the application name in the
UI.

Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 09:47:57 -07:00
Alex Deucher
b4082f492b r600g: add support for TN (trinity) APUs
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-03-20 19:43:59 -04:00
Eric Anholt
d09fce51f0 i965: Change the hiz-override env var to a driconf option.
The force-enable option is dropped, now that the hardware we were
concerned about has HiZ on by default.  Now, instead of doing
INTEL_HIZ=0 to test disabling hiz, you can set hiz=false.

v2: Disable separate stencil on gen6 when HIZ is turned off.
    (previously, this had to be done manually in addition).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-20 15:47:48 -07:00
Eric Anholt
447aff5b02 i965: Drop the INTEL_FORCE_GS environment variable.
This was a debug option during gen6 transform feedback bringup (and a
similar one existed during gen4 bringup).  However, it looks like
we're done with that, and we don't anticipate it being used again,
either for geometry shaders or transform feedback.

Suggested by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:31:44 -07:00
Eric Anholt
7e6221f2e3 intel: Drop the INTEL_NO_BLIT debug environment variable.
This was added in the i915/i965 merge from the i915 driver, but I
don't recall it ever being used since then.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:27:46 -07:00
Eric Anholt
67d3ff760a intel: Drop the INTEL_STRICT_CONFORMANCE environment variable.
If you want to test the graphics driver, you want to test it under the
conditions that users will see, not some set of additional fallbacks.
If you want to test swrast, run the swrast driver (or no_rast=true)
instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:27:46 -07:00
Anuj Phogat
cdcfd5d1d6 intel: Fix a case when mapping large texture fails
This patch handles a case when mapping a large texture fails
in drm_intel_gem_bo_map_gtt(). These changes avoid assertion
failure later in the driver as reported in following bugs:

https://bugs.freedesktop.org/show_bug.cgi?id=44970
https://bugs.freedesktop.org/show_bug.cgi?id=46303

Testing: No regressions in piglit quick.tests

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-20 15:11:39 -07:00
Kenneth Graunke
2097af9728 Add Makefile to shared-glapi .gitignore 2012-03-20 11:50:51 -07:00
Kenneth Graunke
dfce56ba4d Add Makefile.in to toplevel .gitignore
To avoid redundancies, this patch also removes Makefile.in from the
other .gitignore files.

Acked-by: Eric Anholt <eric@anholt.net>
2012-03-20 11:50:50 -07:00
Paul Berry
b41ab3b42c Add .deps/, .libs/, and *.la to toplevel .gitignore
To avoid redundancies, this patch also removes .deps, .libs, and *.la
from .gitignore files in subdirectories.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 11:50:50 -07:00
Brian Paul
75f82b5d58 mesa: only test cube face widths in _mesa_test_texobj_completeness()
As Eric pointed out, we know the cube faces are square at this point
so we only need to test the texture widths for consistency.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 09:43:10 -06:00
Brian Paul
2cbccfdcb0 softpipe: set max cube texture size to 4Kx4K
The max size was 16Kx16K so a 4 byte/pixel, six-sided cube would require
6 GBytes of memory.  If mipmapped, 8 GB.  Reduce the max size to 4K to
make the total size more reasonable.

Fixes a crash with the new piglit max-texture-size test.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-20 08:23:32 -06:00
Brian Paul
73fd269d2f mesa: add integer texture completeness check
Per the spec, only nearest filtering is supported for integer textures.
Otherwise, the texture is incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
f4a93e0665 mesa: rework texture completeness testing
Instead of gl_texture_object::_Complete there are now two fields:
_BaseComplete and _MipmapComplete.  The former indicates whether the base
texture level is valid.  The later indicates whether the whole mipmap is
valid.

With sampler objects, a single texture can appear to be both complete and
incomplete at the same time.  See the GL_ARB_sampler_objects spec for more
details.  To implement this we now check if the texture is complete with
respect to a sampler state.

Another benefit of this is we no longer need to invalidate a texture's
completeness state when we change the minification/magnification filters
with glTexParameter().

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
b219b2c310 mesa: add _mesa_is_mipmap_filter() helper
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
ff005bdb7c mesa: use _mesa_dirty_texobj() in glTexParameter code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
878c69fe54 mesa: use _mesa_dirty_texobj() function
To mark the texture object as incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
d335e69b9a mesa: rewrite/consolidate code in _mesa_test_texobj_completeness()
Merge the mipmap level checking code that was separate cases for 1D,
2D, 3D and CUBE before.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
e86d0dea8e mesa: use new baseImage var to simplify _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
fbbbb98fc4 mesa: add comments in _mesa_test_texobj_completeness() related to the spec
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
085d2bb97e mesa: better debug message in _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
4c9537f7d0 mesa: move some code in _mesa_test_texobj_completeness()
Move the simple MaxLevel < BaseLevel test earlier to be closer to where
we error-check BaseLevel.  Also, use the local baseLevel var in more places.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
4c385d382f mesa: use switch(target) in _mesa_test_texobj_completeness()
and add missing case for GL_TEXTURE_BUFFER.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
cfd5b14dac mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
3f7509beff mesa: make _mesa_reference_sampler_object() an inline function
To make the no-change case faster, as we do for the other object-reference
functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Eric Anholt
0225a15b69 glsl: Don't include the deprecated structure types in GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-19 22:14:02 -07:00
Eric Anholt
56118ef929 mesa: Validate the drawing primitive against the transform feedback mode.
Fixes piglit GL_EXT_transform_feedback/negative-prims.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-19 22:01:53 -07:00
Eric Anholt
7ca4f07b5b mesa: Fold error generation into _mesa_valid_prim_mode().
We want to start emitting an INVALID_OPERATION from here for transform
feedback.  Note that this forced dlist.c to almost not use this
function, since it wants different behavior during dlist compile.
Just pull the non-TF, non-GS test out for compile, because:

1) TF doesn't matter in that case because there's no drawing.
2) I don't think we're going to see GSes and display lists in the same
   context, if we don't do GL_ARB_compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-19 22:01:22 -07:00
Kristian Høgsberg
ca760181b4 shared-glapi: Convert to automake
This fixes a build problem where EGL links to libgbm.la, which encodes
a relative path to it's libglapi.so dependency.  The relative path
breaks when the linker tries to resolve it from src/egl/main instead
of src/gbm.  Typically we silently fall back to the system
libglapi.so, which is wrong and breaks when there isn't one.

Morale of the story: don't mix mklib and libtool.
2012-03-19 11:13:06 -04:00
Alex Deucher
91ddfa72b4 r600g: fix r600_get_backend_mask() for virtual addresses
I don't think we should hit this path for virtual addresses,
but just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-03-19 10:52:46 -04:00
Yuanhan Liu
40c995c1fd i915: fallback for NPOT cubemap texture
Although some hardware support NPOT cubemap, but it seems we don't know
the right layout for NPOT cubemap. Thus seems we need do fallback for
other platforms as well.

See comments inline the code for more detailed info.

v2: give a more detailed info about why we need fallback for other
    platfroms as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46666

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-19 10:06:48 +08:00
Marek Olšák
a2e7629e68 r600g: fix point rendering
Accidentally broken in c7eaf274a9.
2012-03-19 03:00:04 +01:00
Brian Paul
03f8a97d71 st/mesa: add null pointer check in st_texture_image_map()
If we failed to allocate a memory resource for the texture we'd crash
when we tried to map it.  Now we propogate the NULL back up to the
texstore code and generate GL_OUT_OF_MEMORY.

Fixes a crash with the upcoming piglit max-texture-size test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-17 16:15:59 -06:00
Alex Hultman
c3fe44c5f9 docs: add info for installing dependencies on fedora
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-17 16:15:28 -06:00
Brian Paul
aec47e7d42 dri_util: add copyright/license blurb 2012-03-17 16:15:28 -06:00
Jeremy Huddleston
90a51753c4 darwin: Link against libxcb
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
Jeremy Huddleston
f9e1295cff darwin: Build create_context.c
Fixes a build regression from: 588042a8ec

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
Jeremy Huddleston
61f6aff5d9 darwin: config file cleanups
Set our default compiler based on what our installed XCode prefers

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:01:46 -07:00
Eric Anholt
31866308fc i965/fs: Jump from discard statements to the end of the program when done.
From the GLSL 1.30 spec:

     The discard keyword is only allowed within fragment shaders. It
     can be used within a fragment shader to abandon the operation on
     the current fragment. This keyword causes the fragment to be
     discarded and no updates to any buffers will occur. Control flow
     exits the shader, and subsequent implicit or explicit derivatives
     are undefined when this control flow is non-uniform (meaning
     different fragments within the primitive take different control
     paths).

v2: Don't emit the final HALT if no other HALTs were emitted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-16 11:55:38 -07:00
Eric Anholt
bddb2edab6 i965: Add disasm for gen6+ UIP/JIP on BREAK/CONT/HALT.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-16 11:55:35 -07:00
Eric Anholt
c0795742a3 glsl: Add GLSL 1.40 textureSize() implementations for sampler2DRect.
By setting lod to 0 in the builtin function implementation, we avoid
needing to update all the visitors to ignore LOD in this case, when
the hardware drivers actually want to ask for LOD 0 for rectangular
textures.

Fixes piglit spec/GLSL-1.40/textureSize-*Rect.

v2: Change style of looking for substrings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
e06ab8c363 glsl: Set up generated builtin functions handling for GLSL 1.40.
Otherwise, when we go to use ir_reader on the generated code, we won't
have the types present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
3645b77b71 glsl: Add support for integer sampler2DRect variants in GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
c72840630b glsl: Drop ftransform() from GLSL 1.40 profile.
This is the one builtin function claimed to be dropped due to the
ARB_compatibility split.

Fixes piglit spec/GLSL-1.40/compiler/ftransform.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
590ad64fc8 glsl: Copy GLSL 1.30 builtin profile to GLSL 1.40.
All that's changed is the #version changing to 140.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
25c729bf9f glsl: When failing to compile some builtins, print the error.
This makes the process slightly more debuggable, though it would be
nice if the build just failed immediately instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
497aab39f0 glsl: Let the builtin compiler process GLSL 1.40 shaders.
This is required to put the new 1.40 builtins in place, since they
require new types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:49 -07:00
Eric Anholt
177ccd246f glsl: Update builtin variables for GLSL 1.40.
Mostly this is a matter of removing variables that have been moved to
the compatibility profile.  There's one addition: gl_InstanceID is
present in the core now.

This fixes the new piglit tests for GLSL 1.40 builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Eric Anholt
c5ff9a8b9e glsl: Hook up the current GLSL 1.30 types and builtins for 1.40.
This gets a basic #version 140 shader compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Eric Anholt
ac5a5b3243 glsl: Add support for parsing #version 140.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Kenneth Graunke
99cd475cc9 i965: Enable SIMD16 mode for shaders with loops on Gen6+.
The hardware supports it; there's no reason not to.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-14 15:02:48 -07:00
Vinson Lee
fe34006908 gallivm: Fix createOProfileJITEventListener namespace with llvm-3.1.
llvm-3.1svn r152620 refactored the OProfile profiling code.
createOProfileJITEventListener was moved from the llvm namespace to the
llvm::JITEventListener namespace.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-14 09:30:40 -07:00
Tom Stellard
dc382e5c35 noop: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
3f3f10f78c identity: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
26ab747284 galahad: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
fe3f98ed70 gallium/drivers: Use automake to generate makefile 2012-03-14 10:25:59 -04:00
Christopher Yeleighton
ea738548e5 docs: fix html in banner.html
https://bugs.freedesktop.org/show_bug.cgi?id=47304

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-14 08:06:37 -06:00
Eric Anholt
ead3589aa2 glsl: Avoid extra if statements for logic and/or with no side effects.
This avoids extra if statements in the common case of just comparing
two expressions that don't involve assignments or function calls,
along with simplifying the handling of constant expressions.  Reduces
i965 instructions generated in unigine tropics and sanctuary,
yofrankie, warsow, gstreamer shaders, and the weston compositor.

shader-db results:
Total instructions: 213052 -> 212752
38/1246 programs affected (3.0%)
14309 -> 14009 instructions in affected programs (2.1% reduction)
2012-03-13 13:50:08 -07:00
Dylan Noblesmith
b536ac6b2b mesa: add back glGetnUniform*v() overflow error reporting
The error was removed in:

commit 719909698c
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Oct 18 16:01:49 2011 -0700

    mesa: Rewrite the way uniforms are tracked and handled

The GL_ARB_robustness spec doesn't say the implementation
should truncate the output, so just return after setting
the required error like it did before the above commit.

Also fixup an old comment and add an assert.

NOTE: This is a candidate for the 8.0 branch.
2012-03-13 15:59:24 +00:00
Anuj Phogat
cc5b0ffae0 mesa: Fix the cause of piglit test fbo-array failure
Handle the special case of glFramebufferTextureLayer() for which we pass
teximage = 0 internally in framebuffer_texture(). This patch makes failing
piglit test fbo-array, fbo-depth-array to pass.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47126

V4: Removed the duplicated code.
Note: This is a candidate for the stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-12 11:58:12 -07:00
Brian Paul
6830e6515c mesa: fix _mesa_DebugMessageCallbackARB() to silence warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-12 12:54:25 -06:00
Brian Paul
82195815ec radeon: remove use of DD_FLATSHADE
This got missed earlier <sigh>.
2012-03-12 12:47:03 -06:00
Christopher Yeleighton
7f94d9819d docs: fix up html tags in autoconf.html
http://bugs.freedesktop.org/show_bug.cgi?id=47241

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-12 12:22:34 -06:00
Brian Paul
534cbbe658 mesa: add more comments about textarget in framebuffer_texture() 2012-03-12 11:40:44 -06:00
Brian Paul
92c42d8170 mesa: renumber remaining DD_ constants
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
741bfef26c mesa: remove unused DD_TRI_CULL_FRONT_BACK
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d710bbcd74 mesa: remove unused DD_FLATSHADE
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d269b1f310 mesa: remove unused DD_TRI_TWOSTENCIL
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
291e4104ae mesa: remove _DD_NEW_x flags
They're no longer used anywhere.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d2b849a227 tnl: stop using _DD_NEW_x flags
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
938aaec981 swrast: s/_DD_NEW_SEPARATE_SPECULAR/_MESA_NEW_SEPARATE_SPECULAR/
Another step toward removing the _DD_NEW_x flags

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
5edd7b8c46 mesa: define _MESA_NEW_SEPARATE_SPECULAR
This will replace the soon-to-be-removed _DD_NEW_SEPARATE_SPECULAR flag.
Note: there's a similar composite _MESA_NEW_NEED_EYE_COORDS flag set already.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
22d6268df7 i915: remove occurances of _DD_NEW_x flags
Just use the corresponding _NEW_x flags intead.  The _DD_NEW_x flags
will be removed in a following patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
f21dfa9d4b mesa: remove ctx->Driver.ClearColor() hook
The driver Clear() function should just grab the clear color out of the
context.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
9c53fc593e mesa/gdi: remove clear_color() function
Setup the clearing color in the clear() function.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
fdbb717b24 xlib: remove clear_color() function
Just setup the clearing color in clear_buffers().

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
c90ae6b501 radeon/r200: remove ClearColor driver functions
The state.color.clear value was never used anywhere.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
5f80218884 mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooks
Not used by any drivers.  Drivers can easily access the values
from the Mesa context at glClear() time.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
e0ed951e13 radeon/r200: remove ClearDepth() and ClearStencil() driver hooks
The computed stencil.clear and depth.clear values aren't used anywhere.
Those fields have been removed too.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
5bb2059be7 radeon/r200: remove hyperz/fast clear testing code
The flags which were computed were never actually used.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Kenneth Graunke
5ac910c014 docs: Fix unclosed anchor tag in xlibdriver.html.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47205
2012-03-11 23:39:54 -07:00
José Fonseca
901a118327 egl/drm: Include errno.h
Fixes scons build.
2012-03-11 19:51:00 +00:00
David Fries
b60120608f Set close on exec flag FD_CLOEXEC
Set the close on exec flag when opening dri character devices, so they
will be closed and free any resouces allocated in exec.

Signed-off-by: David Fries <David@Fries.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 19:05:50 +00:00
José Fonseca
5ea18503e7 mapi/glapi: Fix glDebugMessageCallbackARB arg type to GLDEBUGPROCARB
Necessary to prevent type mismatches on MinGW.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:30 +00:00
José Fonseca
10d3b6500b glapi/gen: Add support for pointer types.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:29 +00:00
José Fonseca
7221f52389 mesa: Prevent collision of ERROR define on Windows.
This issue might recur on other OSes. If so then it might be better
to remove the C-preprocessor magic, and use fully qualified defines
instead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:29 +00:00
José Fonseca
fa476782fd include: Fix glDebugMessageCallbackARB's prototype.
Seems to be a bug in Khronos headers, as

http://www.opengl.org/registry/specs/ARB/debug_output.txt states userParam
is not a const pointer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:23:45 +00:00
Marek Olšák
bb1d126b23 mesa: expose ARB_debug_output 2012-03-10 21:42:06 +01:00
Marek Olšák
d7d0d2890a mesa: display list dispatch for ARB_debug_output 2012-03-10 21:42:06 +01:00
Marek Olšák
0e4508e077 mesa: print GL errors via debug_output 2012-03-10 21:42:06 +01:00
nobled
ae4a8a59b7 mesa: implement the last of GL_ARB_debug_output
Store client-defined message IDs in a hash table,
and sort them by severity into three linked lists
so they can be selected by severity level later.
2012-03-10 21:42:06 +01:00
nobled
41308d9699 mesa: add struct for managing client debug namespaces
The final piece of the puzzle for GL_ARB_debug_output.
2012-03-10 21:42:06 +01:00
nobled
f6f3093940 mesa: add control for categories of application-provided messages
This state is needed for deciding whether or not to log
application messages with IDs that haven't been specifically
passed to glDebugMessageControlARB yet.

State for each individual ID number ever passed to
glDebugMessageControlARB (per-context) still needs to be added.
2012-03-10 21:42:06 +01:00
nobled
4667cb2162 mesa: add yet more context fields for GL_ARB_debug_output 2012-03-10 21:42:06 +01:00
nobled
c68f0b8cab mesa: add glDebugMessageControlARB
Controlling the output of client-provided messages
isn't done yet.
2012-03-10 21:42:05 +01:00
nobled
76414cded8 mesa: add message-toggle booleans for GL_ARB_debug_output 2012-03-10 21:42:05 +01:00
nobled
5dd750d685 mesa: add some GL_ARB_debug_output functions 2012-03-10 21:42:05 +01:00
nobled
ed087ee498 mesa: add infrastructure for GL_ARB_debug_output
Marek v2: don't add the extension to extensions.c yet
2012-03-10 21:42:05 +01:00
Marek Olšák
3917503b9a glapi: regenerate files 2012-03-10 21:42:05 +01:00
nobled
a0d6732182 glapi: add ARB_debug_output.xml
Marek v2: replace GLDEBUGPROCARB with void*
2012-03-10 21:42:04 +01:00
nobled
5ab088c7e2 mesa: split error handling into its own file
Also add _mesa_vsnprintf.
2012-03-10 21:42:04 +01:00
Kenneth Graunke
60218b604a drirc: Add force_glsl_extensions_warn workaround for Unigine Heaven.
Unfortunately, Unigine Heaven 3.0 still needs this.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-09 15:21:10 -08:00
José Fonseca
105ef87842 svga: Disable bogus assertions concerning min_index/max_index.
min_index/max_index are merely conservative guesses, so we can't
make buffer overflow detection based on their values.

Tested-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-09 18:57:17 +00:00
Brian Paul
f5d0ced242 mesa: fix GL_LUMINANCE handling in glGetTexImage
There are several cases in which we need to explicity "rebase" colors
(ex: set G=B=0) when getting GL_LUMINANCE textures:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679

Also fixes the new piglit getteximage-luminance test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-09 08:45:33 -07:00
Brian Paul
9917988223 svga: add null vs pointer check in update_need_pipeline()
Based on a patch submitted by Vic Lee.  The other part of his patch
which checked the fs pointer wasn't needed.

This fixes a crash when clear() is called before any VS or FS is set.
But this can only happen when the driver is used without the Mesa
state tracker.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-09 08:25:18 -07:00
Christoph Bumiller
fb3cb5c2dd nv50: add support for R8G8_R8B8 and G8R8_B8R8 formats 2012-03-09 15:21:01 +01:00
Christoph Bumiller
95df2d0ca7 nv50,nvc0: share the format table code 2012-03-09 15:19:28 +01:00
Christian König
63d53063f7 vl: handle DRI2GetBuffers reply with multiple buffers
This fixes a crash in XBMC, but we still doesn't see a picture.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:45:09 +01:00
Christian König
85dbb22796 vl/mpeg12: make bitstream decoder more robust
Just another xine workaround.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:51 +01:00
Christian König
9a3c2776ac st/vdpau: fix two small memory leaks
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:34 +01:00
Christian König
2e5f3cdca5 st/vdpau: add xine workaround
For reasons I don't understand xine tries to set
the surface format by using a zero pitch.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:20 +01:00
Christian König
7236f170e4 vl/video_buffer: add YUYV and UYVY support
This gets xine working with VDPAU.

v2: some minor bugfixes.
v3: create the resource with the subsampled
    format to avoid tilling problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:04 +01:00
Christian König
fb016854bc r600g: add support for subsampled rgb formats
v2: r600 formats are msb first!

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:49 +01:00
Christian König
461c34c0cb gallivm: add support for R8G8_R8B8 and G8R8_B8R8 formats
Just to keep lp_test_format happy.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:27 +01:00
Christian König
4f41f8edb3 gallium: add R8G8_R8B8 and G8R8_B8R8 formats
v2: simplify implementation by using correct swizzle
v3: fix mix with successor patch

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:40:54 +01:00
Christian König
5c8040aee6 u_format: fix a comment about subsampled formats
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:36:34 +01:00
Brian Paul
5beba3d0ba mesa: use _mesa_rebase_rgba_float/uint() in glGetTexImage code
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:58 -07:00
Brian Paul
ad897fff77 mesa: use _mesa_rebase_rgba_float/uint() in glReadPixels code
See the comments for _mesa_rebase_rgba_float() for details.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:53 -07:00
Brian Paul
774c402765 mesa: add _mesa_rebase_rgba_float/uint() functions
These will be used by glReadPixels() and glGetTexImage() to fix issues
with reading GL_LUMINANCE and other formats.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:36 -07:00
Eric Anholt
be5f27a84d glsl: Refine the loop instruction counting.
Before, we were only counting top-level instructions.  But if we have
an assignment of a giant expression tree (such as the ones eventually
generated by glsl-fs-unroll), we were counting the same as an
assignment of a variable deref.

glsl-fs-unroll-explosion now fails in a reasonable amount of time on
i965 because the unrolling didn't go ridiculously far.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-08 11:19:12 -08:00
Marek Olšák
7f1cbf12bc r600g: enable ARB_draw_instanced 2012-03-08 12:21:47 +01:00
Christian König
ac1dd440b8 vl/video_buffer: add YUVA and VUYA support
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
d6119ac9fa gallium: remove format aliases
They are incomplete and don't make to much sense.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
d5fc3746fe st/vdpau: cleanup YCBCR matching functions
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
5d5b414a7b st/vdpau: fix chroma_format handling in VideoSurfaceQueryGetPutBitsYCbCrCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Marek Olšák
f6546535c9 r600g: use SX_MISC to implement rasterizer discard
Yeah I am reworking it again. This is way simpler than the other methods.
2012-03-08 11:23:24 +01:00
Marek Olšák
c7eaf274a9 Revert "r600g: fix and improve rasterizer discard for r600-r700"
I will use SX_MISC instead.

This reverts commit 597fd6dc8c.
2012-03-08 11:23:24 +01:00
Marek Olšák
80e4d18f84 Revert "r600g: rework rasterizer discard for evergreen"
I will use SX_MISC instead.

This reverts commit 734792e83f.

Conflicts:

	src/gallium/drivers/r600/evergreen_hw_context.c
	src/gallium/drivers/r600/evergreen_state.c
	src/gallium/drivers/r600/r600_hw_context.c
	src/gallium/drivers/r600/r600_pipe.h
2012-03-08 11:23:24 +01:00
Zack Rusin
831de96db8 svga: fix the rasterizer state resets
draw module calls back into the driver and sets certain parts
of the state to whatever it needs, unfortunately unless you
get the ordering of calls to draw just right you'll end up
reseting your own driver state. That's what was happening to us
draw module would under certain conditions reset our own driver
state.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-07 19:17:27 -05:00
Johannes Obermayr
d249bd9cbd glx: Also put a symlink from libGL.so in lib/ for now.
This fixes the libGLU.so.* build when a system libGL.so is not present
since it is relying on the lib/ to build against until it gets
converted to automake.

Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2012-03-07 09:37:46 -08:00
Benjamin Franzke
ab6e081914 gbm_dri: Fix DRIimage lookup callback
That is by making the dri extension variables static in gbm_dri.c.

The image_lookup_extension is provided by egl_dri2 when using x11 or wayland
platforms, when using the drm platform, gbm_dri has a wrapper for it.
Both use the same variables name image_lookup_extension.

Since -fvisibility=hidden was (probably by mistake) removed when converting to
automake, the "image_lookup_extension" symbol from egl_dri2.c became exported
in libEGL.so, so "image_lookup_extension" from gbm_dri.c was ignored.
This resulted in calling incorrect callbacks.

We cant make the image_lookup_extension static in egl_dri2.c right now,
since its used across multiple files.

Bugzilla: https://bugs.freedesktop.org/attachment.cgi?id=58099
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-03-07 18:17:56 +01:00
Brian Paul
6c1dea5445 mesa: handle array textures in strip_texture_border()
If the texture is a 1D array, don't remove the border pixel from the
height.  Similarly for 2D array textures and the depth direction.
Simplify the function by assuming the border is always one pixel.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-07 08:17:20 -07:00
Brian Paul
4f869e9cb5 docs: add more MinGW prerequisite tips
Provided by Charles Huber on the mesa-users list.
2012-03-07 08:08:36 -07:00
Marek Olšák
d0f8561574 r600g: only emit SX_SURFACE_SYNC on r700 if there's CS checker support
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47039
2012-03-07 13:52:58 +01:00
Yuanhan Liu
43af02ac73 i965: handle gl_PointCoord for Gen4 and Gen5 platforms
This patch add the support of gl_PointCoord gl builtin variable for
platform gen4 and gen5(ILK).

Unlike gen6+, we don't have a hardware support of gl_PointCoord, means
hardware will not calculate the interpolation coefficient for you.
Instead, you should handle it yourself in sf shader stage.

But badly, gl_PointCoord is a FS instead of VS builtin variable, thus
it's not included in c.vue_map generated in VS stage. Thus the current
code doesn't aware of this attribute. And to handle it correctly, we
need add it to c.vue_map manually to let SF shader generate the needed
interpolation coefficient for FS shader. SF stage has it's own copy of
vue_map, thus I think it's safe to do it manually.

Since handling gl_PointCoord for gen4 and gen5 platforms is somehow a
little special, I added a lot of comments and hope I didn't overdo it ;)

v2: add a /* _NEW_BUFFERS */ comment to note the state flag dependency
    and also add the _NEW_BUFFERS dirty mask (Eric).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45975
Piglit: glsl-fs-pointcoord and fbo-gl_pointcoord

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-07 13:30:01 +08:00
Yuanhan Liu
cf2f9ef015 i915: move the FALLBACK_DRAW_OFFSET check outside the drawing rect check
We have to do fallback when the 'Clipped Drawing Rectangle X/Y Max'
exceed the hardware's limit no matter the drawing rectangle offset
changed or not.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46665

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-07 13:20:20 +08:00
nobled
4aa1ac5fe9 dri/nouveau: don't use nested functions
It's a GNU extension that isn't supported by clang right now:
http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Nested-Functions.html
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

With this, clang now compiles the nouveau classic driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44061

(Types changed from e.g. 'unsigned char' to 'GLubyte' so that the types can
be concatenated to form a unique function name without any whitespace
interfering.)

[ Francisco Jerez: give meaningful names to the dispatch functions. ]
2012-03-06 21:26:21 +01:00
Vinson Lee
1633dcd890 gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.
llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
MCRegisterInfo argument.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 10:31:12 -08:00
Dave Airlie
ef3e26c2e4 draw/llvm: add clip distance support
This add clipdistance support like the non-llvm draw paths,
if we have a clip distance we compare with it instead of doing
the dot4.

We also have to put the have_clipvertex bit into the emitted
vertex header.

Fixes vs-clip-distance-all-planes-enabled, vs-clip-distance-const-reject,
vs-clip-distance-enables, vs-clip-distance-implicitly-sized,
vs-clip-distance-in-param, vs-clip-distance-uint-index.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:37:33 +00:00
Dave Airlie
9c465a95ac draw/llvm: fix storing of clipvertex and positions into pre_clip_pos (v2)
This fixes the rest of the piglit clipvertex tests.

v2: fixup comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:37:02 +00:00
Dave Airlie
cb4bcbcb1d draw/llvm: fix clipvertex setting up clipmask. (v2)
We incorrectly setup clipmask for gl_ClipVertex, this fixes the clipmask
setup.

v2: fix comment

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

fix comment
2012-03-06 09:34:52 +00:00
Dave Airlie
357afb68e4 gallium: add llvm-related TODOs. (v2)
This is just a simple text file containing a list of goals for gallivm/llvmpipe
and some info on what is required to get there along with some info on who
is looking at things.

v2: add EXT_texture_array.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:23:57 +00:00
Anuj Phogat
a9523af0e8 mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()
_mesa_max_texture_levels() is also used to test valid texture target
in _mesa_GetTexLevelParameteriv(). GL_TEXTURE_CUBE_MAP is not allowed
as texture target in glGetTexLevelParameter(). So, this should throw
GL_INVALID_ENUM error.

Few other functions which use _mesa_max_texture_levels() like
getcompressedteximage_error_check() and getteximage_error_check()
also don't accept GL_TEXTURE_CUBE_MAP.

Above fix makes piglit fbo-cubemap test to fail. This is because of
incorrect texture target passed to _mesa_max_texture_levels() in
framebuffer_texture(). Fixing that as well

Note: This is a candidate for the stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-05 19:02:08 -08:00
Jon TURNEY
71f4a960f8 egl: Use -no-undefined libtool flag
"Use -no-undefined to assure libtool that the library has no
unresolved symbols at link time, so that libtool will build a shared
library on platforms require that all symbols are resolved when the
library is linked."

If I had a dollar for every time I wrote this patch, I'd have about
$10 :-)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-05 18:39:29 -08:00
Daniel Vetter
f172eae8b2 i965: fixup W-tile offset computation to take swizzling into account
There's even a comment in the code containing the right swizzling
computations!

Previously this has not been noticed because we need to manually
enabled swizzling on snb/ivb (kernel 3.4 will do that) and we
don't use the separate stencil on ilk (where the bios enables
swizzling). This fixes

piglit ./bin/fbo-stencil  readpixels GL_DEPTH32F_STENCIL8 -auto

on recent drm-intel-next kernels.

Also remove the comment about ivb, it's stale now.

Swizzling detection is done by allocating a temporary x-tiled
buffer object. Unfortunately kernels before v3.2 lie on snb/ivb
because they claim that swizzling is enable, but it isn't. The
kernel commit that fixes this for backport to pre-v3.2 is

commit acc83eb5a1e0ae7dbbf89ca2a1a943ade224bb84
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 12 20:49:16 2011 +0200

    drm/i915: fix swizzling on gen6+

But if the kernel doesn't lie, this now works on swizzling and
not swizzling machines.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-05 12:02:47 -08:00
Benjamin Franzke
3ff04ea236 meta: Fix compilation without FEATURE_EXT_transform_feedback
That is when building with --disable-opengl.
Fix for commit cb045880b1.

CC: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-05 20:35:23 +01:00
Benjamin Franzke
84f107d287 meta: Fix compilation without FEATURE_feedback
That is when building with --disable-opengl.
Fix for commit c5f4024a79.

CC: Chad Versace <chad@chad-versace.us>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-05 20:35:23 +01:00
Benjamin Franzke
e6aa32ac7f wayland: Use new wl_display_disconnect
This replaces the previously used wl_display_destroy.
wl_display_destroy was povided by wayland-client.so and
wayland-server.so, to resolve that conflict its renamed client-side.
2012-03-05 20:34:42 +01:00
Roland Scheidegger
da5e9fce47 gallivm: fix floating type in lp_build_mod helper
untested, but cannot have worked before.
2012-03-05 19:09:56 +01:00
Christian König
05579339c0 st/vdpau: make the interface thread save
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:32 +01:00
Christian König
1d0c357a97 st/vdpau: implement support for high-precision output timing
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:25 +01:00
Christian König
4f5469f8d6 st/vdpau: implement support for extra mixer layers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:16 +01:00
Marek Olšák
e363dd5c7d r600g: replace atom_ prefix with _state and _cmd suffixes 2012-03-05 16:22:28 +01:00
Marek Olšák
330b6c85c9 r600g: cleanup includes 2012-03-05 15:57:32 +01:00
Marek Olšák
6f50d3d19d winsys/radeon: cleanup includes 2012-03-05 15:31:35 +01:00
Marek Olšák
6ed5855009 r600g: move r600_context_bo_reloc to r600_pipe.h
so that we don't have to include r600_hw_context_priv.h outside of
the *hw_context* files.
2012-03-05 15:31:35 +01:00
Marek Olšák
45d731fdf9 r600g: remove unused function r600_context_reg_bo 2012-03-05 15:31:35 +01:00
Marek Olšák
8a56ed8d6d r600g: remove unused definitions 2012-03-05 15:14:40 +01:00
Marek Olšák
0d91ddf1d4 r600g: don't enable tiling for STAGING and STREAM usage cases
Reviewed by: Christian König <christian.koenig@amd.com>
2012-03-05 14:55:46 +01:00
Marek Olšák
29e55bc5f1 winsys/radeon: add usage parameter to cs_is_buffer_referenced
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
96ef4ddc3d r600g: initialize DB_DEPTH_CONTROL at beginning of CS
Otherwise streamout with rasterizer discard will make the kernel upset
if the state tracker doesn't set a depth-stencil-alpha state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
428146c14f r600g: initialize VS_GS_OUT_PRIM_TYPE
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
6187503f95 r600g: initialize SX_SURFACE_SYNC
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
f71f5edf78 r600g: if pixel shader is NULL, bind a dummy one
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
914b4bb80c r600g: add support for missing colorbuffer formats
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
c60d789b3b r600g: remove support for SCALED colorbuffer formats
Unused by the current stack and APIs, therefore untestable.
It was used to facilitate the transition to integers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
515a64a28c r600g: permit blitting between textures with STREAM and STAGING usage
Eventually I'd like to make every format blittable, so that the function
can go away.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
597fd6dc8c r600g: fix and improve rasterizer discard for r600-r700
For polygons, we have been using face culling with success, but that doesn't
work for points and lines.

Setting the point size and line width to 0 fixes it.

Also improve it even more by setting SCREEN_SCISSOR to a zero area.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
734792e83f r600g: rework rasterizer discard for evergreen
Implement it right using STRMOUT_CONFIG.RAST_STREAM. This fixes rasterizer
discard with points and lines.

This also adds another derived state. It's a combination of rasterizer discard
and streamout enable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
ca78a47b05 r600g: make some scissor regs invariant on r600-r700
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
cd5d02bf51 r600g: make some scissor regs invariant on evergreen
We only need one scissor for the framebuffer.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
aacd653834 r600g: rework scissor for r600-r700
We must use VPORT_SCISSOR, because that's the only one we can use for multiple
scissor rectangles in ARB_viewport_array.

R700 can use the VPORT_SCISSOR_ENABLE bit, but R600 doesn't have that and must
emit a 8192x8192 rectangle if scissor is disabled.

This commit also cleanups magic numbers in create_rs_state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
2881d456a5 r600g: rework scissor for evergreen
VPORT_SCISSOR is the OpenGL scissor. How do I know? Because there are
16 of them just like GL4.1 has multiple scissor rectangles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
370c8b5ee7 r600g: remove obsolete todo comments
Also use XXX in the other ones, because it's the most used word for that
purpose in Mesa.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
0018db1126 r600g: correctly handle queries which don't need begin_query
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
09ec30f028 r600g: don't suspend timer queries for u_blitter
Timer queries should be able to measure the time spent in u_blitter as well.

Queries are split into two groups: the timer ones and the others (streamout,
occlusion), because we should only suspend non-timer queries for u_blitter,
and later if the non-timer queries are suspended, the context flush should
only suspend and resume the timer queries.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
eabcecc26b r600g: release query buffers in destroy_query
This fixes a memory leak introduced with the rework.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
83667acfd9 r600g: move all query code into r600_query.c
And rename or inline functions where appropriate.
There is no reason to keep this stuff in r600_hw_context.c.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:14 +01:00
Marek Olšák
62f44f670b Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"
This reverts commit 0950086376.

It was decided to refactor the transfer API instead of adding workarounds
to address the performance issues.
2012-03-05 13:47:49 +01:00
Yuanhan Liu
058fc6521e i915: fix wrong rendering of gl_PointSize on Pineview
The current code would ignore the point size specified by gl_PointSize
builtin variable in vertex shader on Pineview. This patch servers as
fixing that.

This patch fixes the following issues on Pineview:
webglc: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

v2: pick Eric's nice tip for fixing this issue in hardware rendering.
v3: the last arg of EMIT_ATTR specify the size in _byte_. (Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-05 10:42:58 +08:00
Yuanhan Liu
9962280c33 tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled
We may specify the point size in a glsl vertex shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-05 10:39:54 +08:00
Tom Stellard
befcce264c r300/compiler: Add support for inline literals
On R500 chips, shader instructions can take 7-bit (3-bit mantissa, 4-bit
exponent) floating point values as inputs in place of registers.
2012-03-04 19:36:27 -05:00
Christian König
95594bae47 vl: fix shader in/out numbering
Fix all the other wrong numberings.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-03 10:53:07 +01:00
Eric Anholt
31b044506e egl: Also put a symlink from libEGL.so in lib/ for now.
This fixes the egl_gallium.so driver build when no system libEGL.so is
present, since it's relying on the lib/ to build against until it gets
converted to automake.
2012-03-02 18:42:25 -08:00
Kurt Roeckx
489ac8e73a i915: Fix i830 polygon stipple from PBOs.
This is a direct port of the i915 patch in
a856da6324.

Fixes glean's pbo test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:32:15 -08:00
Kurt Roeckx
024ece7523 i915: Compute maximum number of verts using the actual batchbuffer size.
We were looking at the size of batch.map for how big the batchbuffer
was, but on 865 we just use a single-page batchbuffer due to hardware
limits.

v2: Removed check for sizeof map < bo->size, since that's always false.
    [change by anholt]
NOTE: This is a candidate for release branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
2012-03-02 17:16:13 -08:00
Chris Wilson
33b07893e9 i830: Compute initial number of vertices from remaining batch space
In order to prevent an overflow of the batch buffer when emitting
triangles, we need to limit the initial primitive to fit within the
current batch. To do we need to measure the remaining space and thence
compute the maximum number of vertices that fit into that space.

Reported-by: Kurt Roeckx <kurt@roeckx.be>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:12 -08:00
Alban Browaeys
7d13a6e64b dri/i915: Fix off-by-one in i830 clip region size.
The hardware, like i915, uses an inclusive bounds on min and max for
the drawing rectangle, but we were providing a number for exclusive.
The number of bits used by the hardware only covers this value going
up to the maximum size, so when we programmed 2048 as the maximum
inclusive X, it saw a maximum X of 0 and clipped all rendering.  This
caused rendering failures in gnome-shell.

Fixes piglit fbo-maxsize.

v2: dropped changes to the blitter, which does use an exclusive x2, y2.
    [change by anholt]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45558
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:12 -08:00
Eric Anholt
ae92180d72 intel: Don't enable GL_ARB_draw_instanced pre-gen4.
swtnl doesn't handle this extension.
2012-03-02 17:16:11 -08:00
Eric Anholt
4d4f2daefa i915: Fix piglit fbo-nodepth-test on i830.
This is a direct port of fc4fba52cf from
i915, and fixes GPU hangs when running piglit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:11 -08:00
Christian König
a9073e3486 vl/compositor: fix shader in/out numbering
Michel pointed out that my assumption of a global
index namespace is incorrect and breaks r300g.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 16:07:18 +01:00
Christian König
54faecf607 st/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:20 +01:00
Christian König
d14c879d82 st/vdpau: implement OutputSurfacePutBitsYCbCr
v2: the csc_matrix is optional

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:20 +01:00
Christian König
8d0808214a st/vdpau: implement VideoSurfaceGetBitsYCbCr
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:12 +01:00
Christian König
222600972c st/vdpau: implement OutputSurfaceQueryGetPutBitsNativeCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:06 +01:00
Christian König
507fd8026a st/vdpau: implement OutputSurfaceGetBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:37:59 +01:00
Christian König
494e0025d9 st/vdpau: implement OutputSurfacePutBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
a0571b135e st/vdpau: implement OutputSurfaceQueryPutBitsIndexedCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
379f46c8ac st/vdpau: fix default swizzle for Output/Bitmap samplers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
503cfbc7ba st/vdpau: add support for per vertex colors
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
bf19596870 st/vdpau: implement BitmapSurfaceQueryCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
abf31e3822 st/vdpau: implement OutputSurfaceRenderBitmapSurface
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
2ec6af0c63 st/vdpau: implement BitmapSurfaceGetParameters
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
e44731265d st/vdpau: implement BitmapSurfacePutBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
3aa087fa04 st/vdpau: implement BitmapSurfaceCreate/Destroy
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
f8ac7e0348 st/vdpau: avoid an unnessasary copy
Delay the actual mixer rendering until we really
know which surface is the real destination.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
14766f8200 vl/csc: simplify matrix handling
A csc matrix is only 4x3 not 4x4, also define a VDPAU compatible type for it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
74a4e90894 vl/compositor: add support for per layer dst areas
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
b90727bb24 vl/compositor: add per vertex color suport
Used in subtitles, for example.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
d645dc65b6 vl/compositor: replace pipe_video_rect with u_rect
So we support things like flipping also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
32c4381d4a vl/compositor: split shaders and state
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:20 +01:00
Vinson Lee
834f515988 Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."
This reverts commit d5a6c17254.

llvm-3.1svn r151687 makes MemoryObject accessor members const again.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-01 10:36:06 -08:00
Brian Paul
0605c6d861 Revert "st/mesa: don't unreference user attribs up front."
This reverts commit 72931ca4b9.

This commit caused a few piglit regressions (quad-invariance, draw-batch,
etc) with the vmware svga driver.
2012-03-01 08:55:24 -07:00
Christian König
c14c84f383 vl: move dirty area handling into winsys abstraction
Fixing uninitialized areas in SwapBuffers mode.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:55 +01:00
Christian König
91ac681113 vl: hide X latency by using asynchronous requests
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:51 +01:00
Christian König
66480c0f56 vl: use SwapBuffers instead of CopyBuffers
This should speed things up a bit, but also shows
some bugs with the kernel implementation.

v2: require xcb-dri2 version 1.8

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:46 +01:00
Christian König
f56784f9d0 st/xvmc: remove dst buffer texture workaround
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:39 +01:00
Christian König
80b40a4841 vl: rewrite vl DRI backend using XCB
v2: also set array_size of texture

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 14:37:44 +01:00
José Fonseca
6b024464e8 egl: Don't include strings.h on Windows.
strings.h is needed for the declaration of strcasecmp(), but only on
non-Windows platforms.
2012-03-01 06:37:30 +00:00
Yuanhan Liu
ffee498fb8 mesa: let GL3 buf obj queries not depend on opengl major version
While the ARB_map_buffer_range extension spec says nothing about these
queries -- they were added in GL 3.0 --, it seems like this could be an
error in the extension spec.  This is one of the extensions, like
ARB_framebuffer_object, that "back ports" OpenGL 3.0 functionality to
previous versions.  These extensions are supposed to provide identical
functionality to OpenGL 3.0.  The other cases of mismatches have been
determined to be bugs in the extension specs.

And tools like apitrace rely on such queries to function properly.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-03-01 06:17:48 +00:00
José Fonseca
8c34a41278 gallivm: Update comments and prototype of vector-selects.
No runtime behavior change. As vector selects are still not very well
supported by LLVM.
2012-03-01 06:00:48 +00:00
Brian Paul
b5653880f6 docs: remove mention of components no longer in main Mesa tree 2012-02-29 20:54:33 -07:00
Brian Paul
3b744cb61a st/mesa: remove old assertion 2012-02-29 20:53:47 -07:00
Brian Paul
dab5f98404 r300g: init chan=0 to silence warning 2012-02-29 20:53:46 -07:00
Kenneth Graunke
c59bdee12e i965: Disable PrimitiveID upload.
We currently don't support gl_PrimitiveID, and I believe asking the
hardware to generate it results in vertex cache invalidations.

This could result in slowdowns for applications that use gl_InstanceID,
which would be counter-productive.  Just turn it off for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Kenneth Graunke
e9bcdc2c37 i965: Enable the GL_ARB_draw_instanced extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Kenneth Graunke
e568b00562 i965: Fix swizzles for system values such as gl_InstanceID.
visit(ir_variable *) sets dst_reg::writemask to the appropriate channel
for system values.  Unfortunately, visit(ir_dereference_variable *) then
calls swizzle_for_size, which for a float, sets the swizzle to .x.

This works for gl_VertexID, since we store it in the .x component (see
brw_draw_upload.c:732 - VID), but fails for gl_InstanceID (IID) since we
store it in the .y channel.

To fix this, avoid calling swizzle_for_size on ir_var_system_values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Ian Romanick
1e6a2c1059 glsl: Make gl_InstanceID available with GL_ARB_draw_instanced extension
Originally ARB_draw_instanced only specified that ARB decorated name.
Since no vendor actually implemented that behavior and some apps use
the undecorated name, the extension now specifies that both names are
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-02-29 14:57:15 -08:00
Eric Anholt
767ba60831 mesa: Add missing error check for first < 0 in glDrawArraysInstanced().
Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
871518dbf8 mesa: Fix display lists for draw_elements_base_vertex with draw_instanced.
Fixes piglit GL_ARB_draw_elements_base_vertex/dlist-arb_draw_instanced

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
3c69a18b6a mesa: Fix display list handling for GL_ARB_draw_instanced.
When you called them in a display list compile before, you would just
end up calling through NULL.

Fixes piglit GL_ARB_draw_instanced/dlist.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
d534b68404 mesa: Fix typo in comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:11 -08:00
Kenneth Graunke
b2ace06cbb i965: Fix Gen6+ dynamic state upper bound on older kernels.
Kernels prior to 271d81b84171d84723357ae6d172ec16b0d8139c (March 2011)
don't support relocations outside of the target buffer object.  Rather
than guarding this with a I915_PARAM_HAS_RELAXED_DELTA check, just
smash the bound to 0xfffff001 like we do on Ironlake.

This effectively gives us no upper bound check, just like we did prior
to commit 271d81b84171d84723357ae6d172ec16b0d8139c.

Daniel Vetter would also like to mention that this relies on the guard
page at the end of the GTT.

NOTE: This is a candidate for release branches.
Fixes a regression since 271d81b84171d84723357ae6d172ec16b0d8139c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46766
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-29 12:59:54 -08:00
Eric Anholt
e5f895485e egl/drivers: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:41 -08:00
Eric Anholt
88612029f6 egl/main: Convert to automake.
The drivers/ walk-through-subdirs makefile is converted as well so I
didn't need to keep EGL_DRIVERS_DIRS along with the per-driver
HAVE_EGL_DRIVER_WHATEVER.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
28d92eff73 egl: Clean up some flow of EGL platform handling.
The default case code was set up in a separate way, while this makes
it more normal.  I wanted to add code to the explicit x11 platform and
default x11 platform cases in the next commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
d019cf9124 egl: Drop the non-builtin-drivers support.
The two drivers both did builtin mode, so drop the non-builtin build
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
9f0f00c319 egl: Drop _EGL_MAIN entrypoint obfuscation.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
8ffb098234 glx: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Mathias Fröhlich
ba1d921bdf mesa: Push the shine table into the tnl module.
All users of the shine table outside of the tnl module
are gone. Move the implementation into the tnl module and
prefix the public functions with _tnl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:28 +01:00
Mathias Fröhlich
8e5bc6dd1d mesa: Do not invalidate shine tables in compute light positions.
Since the shine tables are now only used in the tnl lighting stage, where
they are validated through the tnl driver function NotifyMaterialChange
called in tnl/t_vb_light.c, we can not omit calling
_mesa_validate_all_lighting_tables (which only validates the shine tables)
in main/light.c.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:24 +01:00
Mathias Fröhlich
7793a63d3d mesa: Avoid revalidating shine tables in _tnl_RasterPos.
Now that _tnl_RasterPos no longer uses the shine tables, avoid
revalidating them.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:20 +01:00
Mathias Fröhlich
a1b1f8ff86 mesa: Avoid using the shine table for _tnl_RasterPos
Use direct computation of pow for computing the shininess
in _tnl_RasterPos. Since the _tnl_RasterPos function is still
used by plenty drivers that do only need the shine table for
_tnl_RasterPos but do not make use of swtnl computations, this
enables pushing down the shine table computation and validation
into the tnl module, which will happen in a followup change.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:16 +01:00
Mathias Fröhlich
703ada1e45 mesa: Avoid explicit invalidation of shine tables.
Since the shine tables are implicitly invalidated by having
a different shininess value than the current one, we can
omit the explicit invalidation of the shine table.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:07 +01:00
Mathias Fröhlich
619baeae3c mesa: Remove gl_light_attrib::_Flags.
This variable is only used locally in _mesa_update_lighting.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:36:44 +01:00
Mathias Fröhlich
6b48d7e83d mesa: Remove _CosCutoffNeg from light state.
It is only used as a temporary variable during computation of
_CosCutoff. So, don't store it.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:35:37 +01:00
Brian Paul
7f9692b97d util: replace format equality test with compatibility test in blit code
This lets us use the resource_copy_region() path when blitting from
R8G8B8A8 to R8G8B8x8, for example.

v2: be smarter when src_format==dst_format

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:40:37 -07:00
Brian Paul
ce671c7ace util: better comment for util_is_format_compatible() 2012-02-29 08:40:37 -07:00
Brian Paul
9b9c7da966 mesa: use arrayObj var in more places in client_state() 2012-02-29 08:39:20 -07:00
Brian Paul
6eba268ec6 mesa: asst. fixes for texture arrays and borders
For 1D array textures, there is no border on the height dimension.
For 2D array textures, there is no border on the depth dimension.
2012-02-29 08:39:20 -07:00
Brian Paul
738482eec9 mesa: check for no state change in VertexAttribDivisor()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:39:20 -07:00
Brian Paul
9e68a8fa72 util: fix assertions in u_blitter.c code
Assertions of the form assert(a && b) should be written as separate assertions
so that you can actually tell which part is false when there's a failure.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-02-29 08:39:20 -07:00
Brian Paul
84870e2156 mesa: reorder things in mtypes.h
Move structs, enums, etc so they're in more logical order.  In particular,
the shader and transform feedback-related structs/enums were pretty
scattered around.
2012-02-29 08:39:20 -07:00
Brian Paul
83fed5e130 svga: fix max_lod clamping in update_tss_binding()
After biasing we need to clamp to be sure we don't exceed the number of
levels in the mipmap.  This fixes an assertion at svga_sampler_view.c:70

v2: simplify the biasing, clamping code per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:34:37 -07:00
Christian König
fce888a706 st/vdpau: fix use of *.o in Makefile.vdpau
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-29 00:02:30 +01:00
Christian König
acbc3c9678 st/xvmc: fix use of *.o in Makefile.xvmc
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-29 00:02:07 +01:00
Eric Anholt
0da5086443 i965: Avoid blocking on the GPU for setting the HiZ op vertex data.
We need to allocate new space every time to avoid blocking on the last
HiZ op completing.  There are two easy ways to do this:
brw_state_batch() and intel_upload_data().  brw_state_batch() is
simpler and avoids another buffer allocation.

Improves Unigine Tropics performance 0.376416% +/- 0.148722% (n=7).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-28 14:08:56 -08:00
Kenneth Graunke
b823b99ec0 glcpp: Don't strlen() the output for every token being printed.
The ralloc string appending functions were originally intended for
simple, non-hot-path uses like printing to an info log.

Cuts Unigine Tropics load time by around 20% (6 seconds).

v2: Avoid strlen() on every newline, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
2012-02-28 13:07:12 -08:00
Kenneth Graunke
8292b7419d ralloc: Make rewrite_tail increase "start" by the new text's length.
Both callers of rewrite_tail immediately compute the new total string
length by adding the (known) length of the existing string plus the
length of the newly appended text.  Unfortunately, callers generally
won't know the length of the new text, as it's printf-formatted.

Since ralloc already computes this length, it makes sense to add it in
and save the caller the effort.  This simplifies both existing callers,
but more importantly, will allow for cheap-appending in the next commit.

v2: The link_uniforms code needs both the old and new length.
    Apply the obvious fix (which sadly makes it less of a cleanup).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
2012-02-28 13:07:12 -08:00
Dave Airlie
579ccae73d gallivm: add major integer opcodes to the tgsi action handler
This adds support for all the opcodes needed for native integer
support with GLSL 1.20 enabled, and some of the ones for GLSL1.30
support.

I've split them between non-cpu and cpu along the same lines
Tom's code did for the other ones I think, but I'm open to review
on which ones should go where.

With instance ids fixed I get no regressions on my box here
with LLVM 2.8, will test with later LLVMs as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:56:18 +00:00
Dave Airlie
e2a2b33544 gallivm: drop deprecated opcodes
These are integer opcodes not deprecated ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:53:16 +00:00
Dave Airlie
2a76609681 gallivm: only do rcp/mul for floating
rcp asserts on type.floating so don't go passing non-floating
things into it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:52:36 +00:00
José Fonseca
9773370eda svga: Advertise SVGA3D_DEVCAP_MAX_POINT_SIZE.
Backends usually advertise a SVGA3D_DEVCAP_MAX_POINT_SIZE between 63 and
256, so an hardcoded max point size of 80 is often incorrect.

This limitation does not apply for anti-aliased points (as they are done
via draw module) but we still advertise the same limit for both, because
all others pipe drivers do.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-28 15:38:53 +00:00
Neil Roberts
d9c4209777 mesa: Don't disable fast path for normalized types
Mesa has a fast path for the generic fallback when using glReadPixels
for RGBA data which uses memcpy.  However it was really difficult to
hit this case because it would not be used if any transferOps are
enabled.  Any type apart from floating point or non-normalized integer
types (so any of the common types) would force enabling clamping so
the fast path could not be used.  This patch makes it ignore clamping
when determining whether to use the fast path if the data type of the
buffer is an unsigned normalized type because in that case clamping
will not have any effect anyway.

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

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-28 07:56:21 -07:00
Brian Paul
c51264c379 gallium: remove trailing comma to silence warning 2012-02-28 07:56:21 -07:00
Brian Paul
1535794722 mesa: minor comment, whitespace fixes in teximage.c 2012-02-28 07:55:10 -07:00
Dave Airlie
a46548e0ef gallivm: add frem support to the lp_build_mod helper.
for completeness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:43:14 +00:00
Dave Airlie
aec11e4daa gallivm: add bitarit xor and not ops.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:42:17 +00:00
Dave Airlie
72931ca4b9 st/mesa: don't unreference user attribs up front.
postpone unreferences until end of function, as the ones in use will
get naturally dereferenced.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:33:06 +00:00
Dave Airlie
fd4a3d463c mesa/vbo: inline vbo_sizeof_ib_type.
Can't see any reason this wouldn't be better off as an inline.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:32:26 +00:00
Dave Airlie
4ffc8b9ae4 gallivm: add integer and unsigned mod arit functions. (v2)
use a single entry point, as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:31:49 +00:00
Brian Paul
c3e3df9b18 tgsi: remove trailing comma to silence warning 2012-02-27 20:28:37 -07:00
Brian Paul
2aeadabc7e xlib: silence unused var warning 2012-02-27 20:28:37 -07:00
José Fonseca
67e501ad29 svga: Remove unused SVGA_TEX_UNITS constant. 2012-02-27 19:24:43 +00:00
José Fonseca
e567b34f0d svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.
Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the
driver is hardwired to only support up to the value defined by
SVGA3D_TEMPREG_MAX, so clamp to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-27 19:24:42 +00:00
Marek Olšák
bf4fedcef3 r600g: use u_default_transfer_flush_region for all resource types 2012-02-27 16:22:40 +01:00
Marek Olšák
ab13288821 r600g: use u_default_transfer_inline_write for all resource types 2012-02-27 16:22:34 +01:00
Marek Olšák
335facb502 gallium/util: add fast path for buffers in u_default_transfer_inline_write
v2: fix indentation, add assertions
2012-02-27 16:22:26 +01:00
Marek Olšák
615baedc77 gallium/util: set correct usage flags in u_default_transfer_inline_write
The DISCARD flags should improve performance in drivers which handle them.
2012-02-27 16:22:13 +01:00
Marek Olšák
4c02baade9 r600g: fix streamout cache flush for r600
Figured out by trial and error.
2012-02-27 16:21:45 +01:00
Christian König
15e60d9976 vl: fix a douple free in xsp winsys backend
There are a couple of more bugs, but it is only
useful for debugging anyway.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-27 12:57:24 +01:00
Christian König
20be286709 vl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-27 12:53:49 +01:00
Marek Olšák
897af1d499 r600g: cleanup r600_transfer_struct
Especially rename staging_texture to staging and change its type
to r600_resource. I will reuse it for buffers later.
2012-02-27 02:03:24 +01:00
Marek Olšák
622b65d33b r600g: check for R600_STREAMOUT env var in winsys 2012-02-27 02:03:24 +01:00
Marek Olšák
b85fc0ac7e r600g: move initialization of use_surface flag into screen_create
Also change the type to bool and give it a less ambiguous name.
2012-02-27 02:03:23 +01:00
Marek Olšák
81c0484862 r600g: properly check whether texture is busy in get_transfer 2012-02-27 02:03:23 +01:00
Marek Olšák
d334d591a7 r600g: rename r600_resource_texture::depth to bool is_depth
It's used as a boolean.
2012-02-27 02:03:23 +01:00
Marek Olšák
04e3240087 gallium: remove PIPE_SHADER_CAP_OUTPUT_READ
r600g is the only driver which has made use of it. The reason the CAP was
added was to fix some piglit tests when the GLSL pass lower_output_reads
didn't exist.

However, not removing output reads breaks the fallback for glClampColorARB,
which assumes outputs are not readable. The fix would be non-trivial
and my personal preference is to remove the CAP, considering that reading
outputs is uncommon and that we can now use lower_output_reads to fix
the issue that the CAP was supposed to workaround in the first place.
2012-02-27 02:03:23 +01:00
Marek Olšák
74d303521e gallium/rtasm: properly detect SSE and SSE2
This should fix crashes on ancient processors.
2012-02-27 02:03:23 +01:00
Tom Stellard
e6fa2d89e1 r300g: Use automake to generate Makefile v3
v2:
  - s/$(top_builddir)/$(top_srcdir)/
  - Always generate Makefile.in

v3:
  - Fixes from Matt Turner
  - Use Mesa CFLAGS
2012-02-26 15:13:47 -05:00
Tom Stellard
edf3307977 r300g: Reorganize the compiler unit tests 2012-02-26 15:13:47 -05:00
Tom Stellard
7acbbc0704 r300/compiler: Schedule KIL instructions before output writes 2012-02-26 15:13:46 -05:00
Tom Stellard
134a0a5ff8 r300/compiler: Use the smart scheduler for r300 cards 2012-02-26 15:13:40 -05:00
Tom Stellard
342cac7166 r300/compiler: Fix bug when lowering KILP on r300 cards
KILP instruction inside IF blocks were being lowered to an unconditional
KIL.  Since r300 doesn't support branching, when the IF's were lowered
to conditional moves, the KIL would always be executed.  This is not a
problem with the mesa state tracker, because the GLSL compiler handles
lowering IF's, but this bug was appearing in the VDPAU state tracker,
which does not use the GLSL compiler.

Note: This is a candidate for the stable branches.
2012-02-26 09:18:41 -05:00
Christian König
2a97a00e28 vl/compositor: fix a simple typo
Otherwise the dirty area tracking won't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:58 +01:00
Christian König
dcf8ee7d6a st/xvmc: move xvmc state tracker out of xorg subdir
The xvmc state tracker is completely seperate and
doesn't shares code or anything else with the
xorg state tracker.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:26 +01:00
Christian König
1448e829e8 vl: rework winsys interface
Throw out all the old and now unneeded stuff.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:14 +01:00
Christian König
b34c35a524 vl: cleanup dri winsys abstraction
There was way to much dead code in it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:00 +01:00
Vinson Lee
c5e6460022 scons: Don't build the assembly sources on Mac OS X.
This patch allows the Mac OS X SCons build to complete. The assembly
sources contain psuedo-ops that not are supported on Mac OS X.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-25 00:25:43 -08:00
Stéphane Marchesin
6512bc4e67 i915g: Fix fallout from 8e4540ec2a
Fixes piglit regressions from that change.
2012-02-24 15:17:27 -08:00
Zack Rusin
5d9bfc4d3f svga: Fix stencil op mapping
We were inverting the meaning of the stencil op flags: in svga/d3d
the normal incr/decr wraps and the SAT ops clamp.
This fixes piglit failures (at least stencil-twoside and stencil-wrap).
We should backport this everywhere we can.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-24 14:55:56 -05:00
Brian Paul
e0095548c0 svga: fix use of SVGA3D_x vs. PIPE_FORMAT_x in svga_is_format_supported()
Two of the switch cases used PIPE_FORMAT_ tokens instead of SVGA3D_ tokens.
As it happens, the token values are equal for these formats so there's no
net change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-02-24 10:15:37 -07:00
Brian Paul
590321c39d mesa/gdi: include swrast.h to fix compilation 2012-02-24 09:27:35 -07:00
Brian Paul
d7d4a1955b st/mesa: initialize the MaxViewport, MaxRenderbufferSize constants
Use the max 2D/rect texture size as the limit.  If that's not true
for some devices we'll need new PIPE_CAP_ queries.
2012-02-24 08:03:15 -07:00
Brian Paul
2b0aa3fb21 mesa: move more swrast-related #defines out of core Mesa 2012-02-24 08:03:15 -07:00
Brian Paul
7ad880f49f mesa: remove STENCIL_BITS use 2012-02-24 08:03:14 -07:00
Brian Paul
074637bf99 xlib: remove STENCIL_BITS 2012-02-24 08:03:13 -07:00
Brian Paul
5f60a00743 st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS
Remove some Mesa/swrast stuff.
2012-02-24 08:03:13 -07:00
Brian Paul
630ab0d27b mesa: remove last of MAX_WIDTH, MAX_HEIGHT
Define new MAX_VIEWPORT_WIDTH/HEIGHT and MAX_RENDERBUFFER_SIZE values
instead.
2012-02-24 08:03:12 -07:00
Brian Paul
70d3363757 mesa: remove MAX_WIDTH from prog_execute.h
define a PROG_MAX_WIDTH var instead.  It has to match MAX_WIDTH in
swrast.  More elaborate refactoring could fix that (someday).
2012-02-24 08:03:12 -07:00
Brian Paul
0a543eb5c4 st/glx: remove MAX_WIDTH/HEIGHT usage 2012-02-24 08:03:11 -07:00
Brian Paul
3ff527fb68 intel: remove MAX_WIDTH usage in intelInitContext() 2012-02-24 08:03:11 -07:00
Brian Paul
cb49def3d6 swrast: check max renderbuffer size against SWRAST_MAX_WIDTH 2012-02-24 08:03:10 -07:00
Brian Paul
a3b2c3a421 osmesa: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:10 -07:00
Brian Paul
df22829b9c dri/swrast: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:09 -07:00
Brian Paul
3f8a61ffa2 xlib: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:08 -07:00
Brian Paul
47d88ef204 swrast: define, use SWRAST_MAX_WIDTH/HEIGHT
We'll get rid of MAX_WIDTH, MAX_HEIGHT soon.
2012-02-24 08:03:08 -07:00
Brian Paul
b5d096ac1a mesa: remove some cruft from config.h 2012-02-24 08:03:07 -07:00
Brian Paul
cfecffeedc mesa: minor comment clean-ups in config.h 2012-02-24 08:03:07 -07:00
Brian Paul
99d22c4e38 mesa: remove WIN32 MAX_WIDTH work-around in config.h
There aren't any more stack-allocated arrays dimensioned by MAX_WIDTH
so there shouldn't be any more stack overflows.
2012-02-24 08:03:06 -07:00
Brian Paul
ed65c5ccc3 swrast: remove MAX_WIDTH array in s_span.c 2012-02-24 08:03:06 -07:00
Brian Paul
30ea34a8d9 swrast: simplify mask array code 2012-02-24 08:03:05 -07:00
Brian Paul
fb1650b202 swrast: stop using MAX_WIDTH arrays in triangle code 2012-02-24 08:03:05 -07:00
Brian Paul
32bf36106e swrast: remove MAX_WIDTH arrays in stencil code
Use some per-context temporary arrays instead.
2012-02-24 08:03:04 -07:00
Brian Paul
401810b658 swrast: remove MAX_WIDTH arrays in s_drawpix.c 2012-02-24 08:03:04 -07:00
Brian Paul
0c70d2c5bb swrast: remove MAX_WIDTH arrays in s_zoom.c 2012-02-24 08:03:03 -07:00
Brian Paul
237b2fca7a swrast: remove MAX_WIDTH arrays in s_depth.c 2012-02-24 08:03:03 -07:00
Brian Paul
837b55517e swrast: remove MAX_WIDTH arrays in s_copypix.c 2012-02-24 08:03:02 -07:00
Brian Paul
08687c7912 mesa: move/fix MAX_WIDTH/HEIGHT-related assertions
Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for swrast.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 08:02:54 -07:00
Brian Paul
3e88e43224 st/mesa: stop using MAX_WIDTH in st_cb_texture.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:59 -07:00
Brian Paul
62c69c340e st/mesa: stop using MAX_WIDTH in st_cb_drawpixels.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:58 -07:00
Brian Paul
531eaca41b mesa: stop using MAX_WIDTH in glReadPixels code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:58 -07:00
Brian Paul
2e09fe4b9c mesa: stop using MAX_WIDTH in texstore code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:57 -07:00
Marek Olšák
a0a9e56cfe u_blitter: decrease minimum buffer range alignment to 4 for copy_buffer 2012-02-24 02:28:59 +01:00
Marek Olšák
59fbd8c6be u_blitter: check for invalid values in copy_buffer 2012-02-24 02:28:54 +01:00
Marek Olšák
df00dc3c81 r600g: rework queries
We always mapped the query buffer in begin_query, causing stalls
if the buffer was busy.

This commit reworks it such that the query buffer is only mapped
in get_query_result as it's supposed to be.

The query buffer is no longer treated as a ring buffer. Instead, the results
are just appended and when the buffer is full, we create a new one. One query
can have more than one query buffer, though that's a very rare case.
Begin_query releases all query buffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
5b84a8c3c3 r600g: cleanup magic numbers in set_xx_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
89293287b8 r600g: remove duplicated evergreen_context_ps_partial_flush
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
84db8f9a22 r600g: remove duplicated evergreen_context_pipe_state_set_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
edc0ce292b r600g: remove duplicated set_xx_resource functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
985bd5487e r600g: remove duplicated function r600_state_sampler_init
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
cf59ed3f23 r600g: fixup name of evergreen-specific function
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
04d2828b03 r600g: simplify fail paths in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
99d5c1a13b gallium/u_slab: fix possible crash in util_slab_destroy
It may happen if util_slab_create has not been called.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
6a94c9dde0 r600g: fix possible crashes in destroy_context when failing in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
9670e72f6e r600g: consolidate common context init code
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
f841b8a833 r600g: define GROUP_FORCE_NEW_BLOCK in common header
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Jakob Bornecrantz
bed7b4aa5f st/dri: Fix crash in st/dri from dri format commit
Introduced with 8de5c355fa, it would probably just crash.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jesse Barnes <jbarnes@virtousgeek.org>
2012-02-23 19:16:58 +01:00
Paul Berry
bc39de8c0b glapi: Fix incorrect enum value.
From http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt:

    Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
    and GetDoublev:

    TEXTURE_CUBE_MAP_SEAMLESS                   0x884F

This caused a change in enums.c, which is manually built from the .xml
files.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-23 09:35:44 -08:00
Brian Paul
4a72d859b4 util: add mutex lock in u_debug_memory.c code
The linked list of memory allocations was not protected by a mutex.
This lead to sporadic failures with multi-threaded apps.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:10 -07:00
Brian Paul
810584270d svga: no-op sampler view referencing if no change
Just to be safe with ref counting and avoid atomic operations.
2012-02-23 07:49:09 -07:00
Brian Paul
0fffaa512c svga: use pipe_sampler_view_release() to avoid segfault
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:09 -07:00
Brian Paul
be05388ce9 st/wgl: check for hPbuffer=0 in wgl pbuffer functions
Per the GL_WGL_pbuffer spec, generate ERROR_INVALID_HANDLE and
return FALSE (and don't segfault).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
José Fonseca
9ffc8ea8f4 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-23 07:49:08 -07:00
Brian Paul
6835103878 st/mesa: use pipe_sampler_view_release()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
Brian Paul
4fdf42883f gallium: added pipe_sampler_view_release() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
c68334ffc0 st/mesa: add floating point formats in st_new_renderbuffer_fb()
To allow creating floating point buffers / pbuffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
09d0fa5be8 svga: re-enable deleted surface caching
Basically, instead of immediately freeing deleted surfaces, hang onto
them in a cache to do quick re-allocation.  This helps when surfaces
are frequently destroyed and then reallocated a bit later.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
500e7c5860 svga: implement surface cache size limit
There was a SVGA_HOST_SURFACE_CACHE_BYTES symbol, but it was never
used.

Now when we go to add a newly deleted surface to the cache we check
if the cache size would be exceeded.  If so, try to free the least
recently "unused" surfaces until the cache is smaller.  If we can't
do that, simply don't cache the newly deleted surface.  The alternative
involves flushing and waiting and we don't want to do that.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
32f669e7fc svga: add svga_format_size() function
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
8a9cad6384 svga: use dummy shaders when translation fails
Before, if shader translation failed for any reason we'd keep trying
to translate the shader over and over again during state validation.
The dummy fragment shader emits solid red so that might be visual
clue that translation is failing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
4516fcc57f svga: move temp register index assertions
The assertion recently added in dst_register() was invalid because that
function is also (suprisingly) used to declare constant registers.

Move the assertion to the callers where we're really creating temp
registers and add some code to prevent emitting invalid temp register
indexes for release builds.

Also, update the comment for get_temp().  It didn't return -1 if it
ran out of registers and none of the callers checked for that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
f12f67c00a svga: check that we don't exceed temp register limit
And assert on the register index in dst_register().  The dest can
only be an output or temp reg and there's more of the later.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:05 -07:00
José Fonseca
a1482b21cb scons: Update windows llvm libraries for version 3.0. 2012-02-23 12:29:29 +00:00
Alex Corscadden
1702d8bdd8 Add a test for the compare opcode.
This is a test for the compare opcode (CMP).  This should draw a green triangle
in the fs-test.
2012-02-23 12:29:29 +00:00
Satyajit Sarangi
132daa87fb r600g: Fix build when libdrm is installed to non-standard dir.
Signed-off-by: Satyajit Sarangi<kernel.saty@gmail.com>
Signed-off-by: Tom Stellard <tstellar@gmail.com>
2012-02-22 20:39:01 -05:00
Paul Berry
80513ec8b4 i915: Initialize swrast_texture_image structure fields.
Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale
fields to swrast) moved the initialization of the Width, Height, and
DepthScale fields to _swrast_alloc_texture_image_buffer().  However,
i915 doesn't call this function because it performs its own buffer
allocation.  As a result, the Width, Height, and DepthScale fields
weren't getting initialized properly, and some operations requiring
swrast would fail.

This patch ensures that Width, Height, and DepthScale are properly
initialized by separating the code that sets them into a new function,
_swrast_init_texture_image(), which is called by
intel_alloc_texture_image_buffer() as well as
_swrast_alloc_texture_image_buffer().  It also moves the
initialization of _IsPowerOfTwo into this function.

Fixes piglit test fbo/fbo-cubemap on i915.

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

This is a candidate for the 8.0 branch.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-22 13:33:20 -08:00
Jesse Barnes
0beed7f072 intel: bump DRI_IMAGE extension version to 3
To indicate support for the format query.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:55:06 -08:00
Jesse Barnes
8de5c355fa gbm: track buffer format through DRI drivers
GBM needs the buffer format in order to communicate with DRM and clients
for things like scanout.

So track the DRI format requested in the various back ends and use it to
return the DRI format back to GBM when requested.  GBM will then map
this into the GBM surface type (which is in turn based on the DRM fb
format list).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:41:40 -08:00
José Fonseca
d35d3d612a tests/graw: Add a bunch of tests.
These were rotting in an internal branch, but contain nothing confidential,
and would be much more useful if kept up-to-date with latest gallium
interface changes.

Several authors including Keith Whitwell, Zack Rusin, and Brian Paul.
2012-02-22 15:22:31 +00:00
Brian Paul
0df14f9a55 mesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image
About a 10% improvement over the swizzle-copy path.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-22 11:56:20 +00:00
José Fonseca
3dd7b53178 gallium/cso: Put the comment about shader in the code for future reference. 2012-02-22 08:41:19 +00:00
Eric Anholt
ab79d2be2e i965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:50 -08:00
Eric Anholt
6ca50f381c i965: Correct the size of the state batch space allocated for binding tables.
In the gen6 GS case, we were under-counting and so other state would
get smashed.  In the VS case, we were over-counting, so everything was
fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:48 -08:00
Eric Anholt
9fa6377a75 i965: Fix a bad comment in gen6 sol setup.
This was copy and paste from the VS where I had similar code.  We're
only looking at things derived from BRW_NEW_VERTEX_PROGRAM in this
block.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:46 -08:00
Eric Anholt
96ba94cad2 i965/gen6: Fix the size of the GS surface binding table.
I obviously didn't test on gen6 before pushing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:39 -08:00
Marek Olšák
5d2de9232d r600g: move invariant register updates into start_cs for evergreen and cayman 2012-02-21 21:42:27 +01:00
Marek Olšák
fbebd431ec r600g: move invariant register updates into start_cs for r6xx-r7xx 2012-02-21 21:42:27 +01:00
Marek Olšák
e2809849ec r600g: add a depth misc state which depends on occlusion queries
This is a state which is derived from other states and is actually the first
state which doesn't correspond to any gallium state.

There are two state flags:
  bool occlusion_query_enabled
  bool flush_depthstencil_enabled

Additional flags can be added later if needed, e.g. bool hiz_enabled.
The emit function will have to figure out the register values by itself.

It basically just emits the registers when the state changes.
This commit also adds a few helper functions for writing registers directly
into a command stream.
2012-02-21 21:42:27 +01:00
Marek Olšák
8f5c172c85 r600g: consolidate the main draw code
The code was almost the same for r600 and eg. What can't be consolidated is
in the *_prepare functions.
2012-02-21 21:42:27 +01:00
Marek Olšák
182fd4c544 r600g: move all invariant state from draw_vbo into start_cs 2012-02-21 21:42:27 +01:00
Marek Olšák
f126253040 r600g: turn init_config into a command buffer for starting a CS
This is the first pure command buffer. It contains CS initialization
packets and emits invariant state (i.e. the registers which never or rarely
change).

The affected registers are removed from *_hw_context.c, so that both ways
of emitting commands can co-exist.

v2: emit context_control in cayman's start_cs too
2012-02-21 21:42:27 +01:00
Kenneth Graunke
172bb92db1 i965: Only set Last Render Target Select on the last FB write.
Fixes GPU hangs in OilRush, Trine, and Amnesia: The Dark Descent,
which all use MRT (multiple render targets).

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38720
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40059
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45216
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 12:36:20 -08:00
Marek Olšák
32f833e5a5 gallium/cso: kill off non-functional shader caching
Suggested by José.

We don't provide shader caching in CSO. Most of the time the api provides
object semantics for shaders anyway, and the cases where it doesn't
(eg mesa's internall-generated texenv programs), it will be up to
the state tracker to implement their own specialized caching.
2012-02-21 21:09:16 +01:00
Marek Olšák
a6ef7f7ce4 gallium/util: remove u_simple_screen
Deprecated and unused.
2012-02-21 21:09:16 +01:00
Marek Olšák
96d882939d gallium: remove unused winsys pointers in pipe_screen and pipe_context
A winsys is already a private object of a driver.
2012-02-21 21:09:16 +01:00
Eric Anholt
f33d100fa7 intel: Silence valgrind warning for getparam ioctl argument.
It was concerned that the 4 pad bytes on LP64 were uninitialized.
2012-02-21 12:04:07 -08:00
Eric Anholt
5a7942c2f1 i965: Rename the original binding table to mention that it's the WM now.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:16 -08:00
Eric Anholt
f9c3ea32cd i965: Split the gen6 GS binding table to a separate table.
Improves VS state change microbenchmark performance by 7.08729% +/-
1.22289% (n=10) on gen7, because we don't upload the 64 dwords of
unused binding table any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:14 -08:00
Eric Anholt
07e00b3040 i965: Split the VS binding table to a separate table.
This is a step toward making the samplers/binding tables reflect
sampler uniform mappings instead of embedding those in the programs.
No significant performance difference on the microbenchmark (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:12 -08:00
Eric Anholt
8387156620 i965/gen6+: Avoid recomputing whether we use noperspective.
Improves VS state change microbenchmark performance 2.38246% +/-
1.15046% (n=20).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:10 -08:00
Eric Anholt
e9cfaed1a5 i965/gen7: Skip checking if we need a GS program for now.
We always say no.  Improves VS state change microbenchmark performance
7.68747% +/- 1.40826% (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:08 -08:00
Eric Anholt
71d71d5e89 i965: Compute required barycentric interp modes once at FS compile time.
Improves VS state change microbenchmark performance 1.78817% +/-
0.556878% (n=25).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:06 -08:00
Eric Anholt
f0cecd43d6 i965: Move VUE map computation to once at VS compile time.
With this and the previous patch, 640x480 nexuiz is running 0.169118%
+/- 0.0863696% faster (n=121).  On a VS state change microbenchmark,
performance is increased 8.28645% +/- 0.460478% (n=52).

v2: Fix CACHE_NEW_VS comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:02 -08:00
Eric Anholt
9f3d3216cf i965: Make the userclip flag for the VUE map come from VS prog data.
This reduces recomputation of state based on non-clipping-related
transform changes, and is a step toward removing VUE map
recomputation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:53:37 -08:00
Anuj Phogat
b5c409363c mesa: fix issues with texture border and array textures
For a 1D texture array, the border only applies to the width.  For a 2D
texture array the border applies to the width and height but not the depth.
Sucha cases were  not handled correctly in _mesa_init_teximage_fields().

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-21 10:46:55 -08:00
Jerome Glisse
e372e53ee0 radeon/r600g: fix virtual address space allocation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-21 12:34:54 -05:00
José Fonseca
6fd62c998a llvmpipe: Remove lp_test_sincos.
Completely replaced by lp_test_arit.
2012-02-21 16:04:54 +00:00
Christian König
37f97e1753 vl: add support for bob deinterlacing
v2: return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE
    for unknown picture structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:27 +01:00
Christian König
0f194fc9e4 st/vdpau: Use transfer_inline_write to upload ycbcr data
Uses less code and looks at least a bit cleaner than mapping manually.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:20 +01:00
Christian König
736dda82ca st/vdpau: remove unnecessary tracing and adjust tracing levels a bit
Tracing function entry/exits is a bit pointless
when VDPAU_TRACE=1 does the same thing.

v2: use WARN instead of ERR for application problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:11 +01:00
José Fonseca
a206c4cd69 gallivm: Fix TGSI_OPCODE_ARR's translation.
Like TGSI_OPCODE_ARL, destination should be an integer.

This fixes invalid LLVM IR on an internal state tracker (currently Mesa
never emits this opcode).

In the future consider making ADDR register also a integer-as-float array,
like all other register kinds, or simply replace ADDR & ARR/ARL with
integer temp and instructions.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-02-21 08:23:20 +00:00
Vinson Lee
d394bc5853 st/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.
Fixes this GCC warning.
native_drm.c:153:1: warning: ‘drm_display_authenticate’ defined but not
used [-Wunused-function]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 13:17:23 -08:00
José Fonseca
dbadd39508 llvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-02-20 17:07:22 +00:00
Brian Paul
d2003ee7b7 mesa: check for no state change in glPrimitiveRestartIndex()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:34 -07:00
Brian Paul
45453d8f69 mesa: check for no state change in Enable/DisableVertexAttribArray()
Avoid setting dirty state flags when enabling or disabling a vertex
attribute arrays when there's no change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:33 -07:00
Brian Paul
e14b357367 mesa: add missing return after _mesa_error() in update_array()
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:33 -07:00
Tom Stellard
e1044b4082 r300g: Fix build when libdrm is installed to non-standard dir 2012-02-19 19:40:32 -05:00
Kenneth Graunke
df5963c256 i965: Make the dummy fragment shader work in SIMD16 mode.
If you're resorting to the dummy shader, you've probably already turned
off SIMD16 mode.  But if you didn't, it would die in a fire.

We could either fail to compile in SIMD16 mode...or just fix it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-18 20:12:46 -08:00
Kenneth Graunke
393b42240f i965: Fix GPU hangs in the dummy fragment shader.
The dummy FB write failed to specify EOT and a message length, causing
the GPU to hang.  Now we can enjoy "everyone's favorite color" again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-18 20:12:38 -08:00
Vinson Lee
0342ffba1f st/vega: Remove unused variable.
Fixes this GCC warning.
mask.c: In function ‘mask_layer_fill’:
mask.c:387:12: warning: variable ‘alpha_color’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-18 11:09:27 -08:00
Vinson Lee
e77e88740d st/glx: Remove unused variables.
Fixes these GCC warnings.
glx_api.c: In function ‘choose_visual’:
glx_api.c:678:8: warning: variable ‘trans_value’ set but not used
[-Wunused-but-set-variable]
glx_api.c:677:8: warning: variable ‘trans_type’ set but not used
[-Wunused-but-set-variable]
glx_api.c:663:8: warning: variable ‘min_ci’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-18 11:02:01 -08:00
Dave Airlie
c67a1f1d53 draw: add missing streamout state setup for draw/llvm.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-18 12:44:10 +00:00
Kenneth Graunke
6e738d35c5 vbo: Eliminate short-circuiting in invalid-start case.
Now that we have a index_range_invalid flag, we can just use that rather
than calling vbo_validated_drawrangeelements directly and returning.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-17 14:57:11 -08:00
Kenneth Graunke
112b02c324 vbo: Rework checking of 'end' against _MaxElement.
This failed to take basevertex into account:

If basevertex < 0:
   (end + basevertex) might actually be in-bounds while 'end' is not.
   We would have clamped in this case when we probably shouldn't.
   This could break application drawing.

If basevertex > 0:
   'end' might be in-bounds while (end + basevertex) might not.
   We would have failed to clamp in this place.  There's a comment
   indicating the TNL module depends on max_index being in-bounds;
   if so, it would likely break horribly.

Rather than trying to clamp correctly in the face of basevertex, simply
delete the clamping code and indicate that we don't have a valid range.
This causes _tnl_vbo_draw_prims to use vbo_get_minmax_indices() to
compute the actual bounds, which is much safer.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:55 -08:00
Kenneth Graunke
f00c97b23f vbo: Ignore invalid element ranges which are outside VBO bounds.
Some applications, such as Regnum Online, appear to pass invalid
start/end values to glDrawRangeElements.  In particular, the 'start'
index sometimes exceeds the maximum array element.  This is clearly
invalid behavior, and although the spec isn't clear, seems to result
in undefined, implementation-specific behavior.

This patch takes the conservative approach and simply ignores the range,
while issuing a warning indicating that the application is broken and
should be fixed.

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45214
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44701
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:44 -08:00
Kenneth Graunke
f9be8543aa vbo: Remove pedantic warning about 'end' beind out of bounds.
The application supplied [start, end] range is merely a conservative
hint of the ranges of index values inside the index buffer.  There is no
requirement that all vertices in the range [start, end] be referenced.

Passing an 'end' value larger than the maximum legal index is perfectly
acceptible; applications can legally pass 0xffffffff when they don't
have a tighter bound readily available.

Thus, the warning doesn't indicate a correctness issue; it could only
indicate a performance issue.  However, it does not even do that.

glDrawRangeElements is designed to optimize non-VBO vertex data uploads
by providing an upper bound on the size of buffers a driver would need
to allocate.  With VBOs, the data is already in an uploaded buffer, so
the range doesn't help.

The clincher is: we only know _MaxElement for VBOs.  For user-space
arrays, we just set it to 2,000,000,000 (see mesa/main/varray.h:63.)
So we can only check this in the case where it is not useful.

Many applications, including the Unigine demos, currently trigger this
warning, which suggests the applications are buggy when they're actually
fine.  Eliminating the warning should confuse users less while not
actually losing any benefit to application developers.

NOTE: This is a candidate for release branches.

Suggested-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:24 -08:00
Eric Anholt
e2dce7f7ee intel: Fix rendering from textures after RenderTexture().
There's a serious trap for drivers: RenderTexture() does not indicate
that the texture is currently bound to the draw buffer, despite
FinishRenderTexture() signaling that the texture is just now being
unbound from the draw buffer.

We were acting as if RenderTexture() *was* the start of rendering and
that we could make texturing incoherent with the current contents of
the renderbuffer.  This caused intel oglconform sRGB
Mipmap.1D_textures to fail, because we got a call to TexImage() and
thus RenderTexture() on a texture bound to a framebuffer that wasn't
the draw buffer, so we skipped validating the new image into the
texture object used for rendering.

We can't (easily) make RenderTexture() indicate the start of drawing,
because both our driver and gallium are using it as the moment to set
up the renderbuffer wrapper used for things like MapRenderbuffer().
Instead, postpone the setup of the workaround render target miptree
until update_renderbuffer time, so that we no longer need to skip
validation of miptrees used as render targets.  As a bonus, this
should make GL_NV_texture_barrier possible.

(This also fixes a regression in the gen4 small-mipmap rendering since
3b38b33c16, which switched
set_draw_offset from image->mt to irb->mt but didn't move the irb->mt
replacement up before set_draw_offset).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44961
NOTE: This is a candidate for the 8.0 branch.
2012-02-17 13:31:27 -08:00
Eric Anholt
308c6be802 intel: Improve the fallback debug for framebuffer status checks. 2012-02-17 13:31:27 -08:00
Eric Anholt
a1fd13fff1 mesa: Only end render-to-texture at bind time for drawbuffers.
If we're only starting for new draw buffers, why would we end for old
read buffers along with draw buffers?
2012-02-17 13:31:27 -08:00
Dave Airlie
7199b0b681 gallivm: fetch immediates to correct type (v2)
Fetch float/uint/int immediates.

v2: bitcast to uint/int to floats as per Jose's suggestions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
117a0e91af gallivm: enable stores of integer types. (v2) + fix ARL
Infer from the operand the type of value to store.
MOV is untyped but we use the float store path.

v2: make MOV use float store path.

I've had to squash merge the ARL fix to be stored
as an integer in here to avoid regressions in a number
of piglit tests.

From now on ARL stores to an integer just like HW does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
141f2c2fc9 gallivm: enable fetch for integer opcodes. (v2)
The infers the type of data required using the opcode,
and casts the input to the appropriate type.

So far this only handles non-indirect constant and temporaries.

v2: as per Jose suggestion, fetch immediates via floats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
66461aa249 gallivm: add uint/int bld to the base builder. (v2)
These are used inside the action handlers for the integer opcodes.

v2: use uint_bld/int_bld, drop higher level uint_bld.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
f667a6f3ce gallivm: fix build gather to take a bld context
Then pass the correct build context to it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
Dave Airlie
639fbe2e75 gallivm: pass build context to exec_mask_store.
For now just pass the current context, but when we want to
store int or unsigned we need to pass those later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
Dave Airlie
13e2e51f70 tgsi: add source/destination type from opcodes. (v2)
These two functions produce the src/dst types for an opcode.

MOV is special since it can be used to mov float->float and int->int,
so just return VOID.

v2: use a new enum for the opcode type as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
José Fonseca
9be0f9b0e4 gallivm: Initialize x86 disassembler on x86_64 too. 2012-02-17 17:22:23 +00:00
José Fonseca
e648f5e197 llvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.
Instead of assuming 4 wide vectors.
2012-02-17 16:17:28 +00:00
José Fonseca
b5941e33d0 llvmpipe: Specify lp_test_arit's target precision per function. 2012-02-17 16:10:22 +00:00
José Fonseca
fc79c4fbd4 llvmpipe: Add a negation test to lp_test_arit. 2012-02-17 15:57:54 +00:00
Ian Romanick
f767ee5404 docs: News and release notes link for 8.0.1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-16 23:31:50 -08:00
Ian Romanick
578dc605b6 docs: Add 8.0.1 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d38a295289)
2012-02-16 23:31:50 -08:00
Ian Romanick
61cf89c002 docs: Add 8.0.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fe77fd3983)
2012-02-16 23:31:50 -08:00
Marek Olšák
e05bc52b9c r300g: don't use pipe_screen::winsys 2012-02-17 01:39:48 +01:00
Marek Olšák
c9e9cfbf60 r300g: don't use pipe_context::winsys 2012-02-17 01:26:56 +01:00
Ian Romanick
f16c40d2f6 mesa: Update the version string to 8.1-devel
The numeric version was updated in 46883e0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-16 15:29:26 -08:00
Brian Paul
ca1b2da300 docs: replace gitweb link with cgit link 2012-02-16 13:35:02 -07:00
Brian Paul
6f3d918409 mesa: add missing texture integer test in glTexSubImage()
If the texture format is integer, the incoming user data must also be
integer (and similarly for non-integer textures).

NOTE: This is a candidate for the stable branches.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-16 09:37:11 -07:00
Marek Olšák
b0b8121813 r600g: remove the workaround for quads and provoking vertex 2012-02-16 17:15:50 +01:00
Marek Olšák
73191026b4 r600g: remove redundant r600_context::vs_so_stride_in_dw 2012-02-16 15:56:59 +01:00
Kenneth Graunke
709f50928e i965: Emit Ivybridge VS workaround flushes.
I recently discovered this text in the BSpec.  It seems wise to comply,
though I haven't observed it to fix anything yet.

Fixes a regression in glean/fbo since 28cfa1fa21.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-15 22:17:39 -08:00
Eric Anholt
b631b471d8 mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.
Fixes (with the previous commit) piglit GL_ARB_multisample/pushpop.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 15:31:33 -08:00
Eric Anholt
4b6e45c7d6 mesa: Fix push/pop of multisample coverage invert.
In the table of of push/pop attributes, this one doesn't fall under
the enable group.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 15:31:24 -08:00
Ian Romanick
3e22d4e5fc swrast: Only avoid empty _TexEnvPrograms
If the generated shader for _TexEnvProgram is empty, force the use of
the fixed-function code.  Otherwise, go ahead and use the shader.
This works around a mysterious issue on i915 where fixed-function
software fallbacks are not working correctly.

This isn't really the fix we want, but it works around the issue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
2012-02-15 14:50:40 -08:00
Ian Romanick
8f3be33985 glapi: Include GLES2 headers for ES2 extension functions
This fixes build errors like

In file included from glapi_dispatch.c:91:
../../../src/mapi/glapi/glapitemp.h:4641: error: no previous prototype for
'glDrawBuffersNV'

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lucas Stach <dev@lynxeye.de>
2012-02-15 14:50:00 -08:00
Brian Paul
7539a0d677 st/mesa: fix typo: s/patent/parent/ 2012-02-15 14:37:07 -07:00
Brian Paul
456a02b0c7 st/mesa: remove unused st_equal_formats() function
It was incomplete and didn't take byte swapping into account either.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
c9d0526084 st/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()
st_equal_formats() is no longer used now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
b549fd138e st/mesa: remove INLINE qualifiers
from st_get/create_texture_sampler_view_from stobj() functions.
No real value in these cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
9600b0762b st/mesa: simplify st_create_texture_sampler_view()
Implement in terms of st_create_texture_sampler_view_format().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
91ec17835f st/mesa: remove unused st_get_texture_sampler_view()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
0315cb9f8f st/mesa: use private pipe_sampler_view in decompress_with_blit()
Similar to the previous commit.  Also fix incorrect setting of the
sampler view's state after it's created.  We need to specify the
first/last_level fields in the template instead.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
c5ba6a7807 st/mesa: use private pipe_sampler_view in st_render_mipmap()
Rather than the one in st_texture_object.  This sampler view really has
no connection to the one used for rendering.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
0bda900743 mesa: use z32f_x24s8 struct in format pack/unpack code
And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row().
As suggested by José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-15 14:08:50 -07:00
Brian Paul
dba7ad0ca9 st/mesa: assorted clean-ups in st_cb_fbo.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
418306397f st/mesa: remove st_framebuffer_renderbuffer()
Just use _mesa_framebuffer_renderbuffer().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
ea2aca036c st/mesa: remove st_get_default_texture()
Just use _mesa_get_fallback_texture() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
c04db7f7fa mesa: fix _mesa_get_fallback_texture() to handle all texture targets
Previously, this function only handled 2D textures.

The fallback texture is used when we try to sample from an incomplete
texture object.  GLSL says sampling an incomplete texture should return
(0,0,0,1).

v2: use a 1-texel texture image, per José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
447071cfb0 st/mesa: improve assertion/check for stencil format 2012-02-15 14:07:43 -07:00
Brian Paul
f1334f232f gallium: fix some comments in p_state.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
82ddd1129e mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code
Added in _mesa_pack_uint_24_8_depth_stencil_row().  This could be hit
by something like glDrawPixels(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8)
into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
5e81d3b853 st/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
5a70e12fc0 st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
The st_renderbuffer_alloc_storage() function is used to allocate both
window-system buffers and user-created renderbuffers.  The later kind
are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for
those surfaces.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
fc855f85d0 st/mesa: use u_surface_default_template() helper
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
d9ae5db6e3 st/mesa: remove redundant memset(surface_template,0)
The subsequent u_surface_default_template() call does that for us.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
2e12b4cfef st/mesa: remove st_renderbuffer::stride
It was only used for software buffers and easily computed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
d765c8ee8c st/mesa: remove st_renderbuffer::format
We only used it in a few places that can implemented differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
dbe88515c5 mesa: fix comment typos in fbobject.c 2012-02-15 14:07:43 -07:00
Kenneth Graunke
4b27406820 i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.
Commit dc7f449d1a introduced a new method
for avoiding MOVs: try to rewrite the destination of the instruction
that produced the RHS so it writes into the LHS.

Unfortunately, this is not safe for swizzled texturing operations, as
they return a set of four contiguous registers.  Consider the following:

(assign (x)
        (var_ref vec_ctor_x)
        (swiz x (tex vec4 (var_ref m_sampY) (var_ref m_cordY) 0 1 ())))

In this case, the source and destination registers are equal, since
reg_offset is 0 for both.  Yet, this is only a partial move: the texture
operation generates four registers, and the LHS only covers one.

Fixes color distortion in XBMC when using GLSL shaders.

NOTE: This is a candidate for the 8.0 branch (with the previous commit).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44333
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-15 11:44:37 -08:00
Kenneth Graunke
8ab02b5118 i965/fs: Add a new fs_inst::regs_written function.
Certain instructions write more than one register.  Texturing, for
example, returns 4 registers.  (We set rlen to 4 even for TXS and float
shadow sampling.)  Some math functions return 2.  Most return 1.

The next commit introduces a use of this function.

NOTE: This is a candidate for the 8.0 branch (dependency of a fix).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-15 11:44:05 -08:00
Dave Airlie
c89b471f8c llvmpipe: fix fogcoord writing (v2)
this fixes the fogcoord related piglit tests, like I fixed them in softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-15 19:25:27 +00:00
Anuj Phogat
66bf25f1a2 meta: Avoid FBO resizing/reallocating in decompress_texture_image
Reallocate/resize decompress FBO only if texture image width/height is
greater than existing decompress FBO width/height.

This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 09:23:13 -08:00
Christian König
78734e375a st/vdpau: fix a small memory leak
The matrix filter wasn't freed on mixer destruction.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-14 22:32:08 +01:00
Christian König
553e820387 vl: fix low strength denoise filter
A filter strength of zero or one doesn't make any
sense. Thanks to Andy Furniss for pointing this out.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-14 22:31:29 +01:00
Jerome Glisse
356eb0aadb r600g: fix tiling with cayman and virtual memory
The virtual address but follow the alignment requirement of the
tiled surface. The bo from handle case is not properly fix. Need
bigger change for a proper fix. Work around that by enforcing 1M
alignment for those bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-14 15:56:09 -05:00
Paul Berry
6b0a07f9ce i915: Fix type of "specoffset" variable.
Commit 2e5a1a2 (intel: Convert from GLboolean to 'bool' from
stdbool.h.) converted the "specoffset" local variable (in
intel_tris.c) from a GLboolean to a bool.  However, GLboolean was the
wrong type for specoffset--it should have been a GLuint (to match the
declaration of specoffset in struct intel_context).

This patch changes specoffset to the proper type.

Fixes piglit test general/two-sided-lighting-separate-specular.

This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45917
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 11:40:02 -08:00
Eric Anholt
93831a54c7 i965/fs: Enable register spilling on gen7 too.
It turns out the same messages work on gen7, we were just being paranoid.

Fixes the penumbra shadows mode of Lightsmark since the register
allocation fix.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 10:19:04 -08:00
Eric Anholt
a7f46eadea i965: Report the failure message when failing to compile the fragment shader.
We just abort later, but at least this should result in more
informative bug reports.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 10:19:04 -08:00
Simon Farnsworth
8cd03b933c r600g: Use a fake reloc to sleep for fences
r300g is able to sleep until a fence completes rather than busywait because
it creates a special buffer object and relocation that stays busy until the
CS containing the fence is finished.

Copy the idea into r600g, and use it to sleep if the user asked for an
infinite wait, falling back to busywaiting if the user provided a timeout.

Note: this is a candidate for the stable branches.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-14 09:56:23 -05:00
Marek Olšák
014198ec88 r600g: consolidate set_blend_color code 2012-02-14 15:51:59 +01:00
Marek Olšák
5cc9aa0e02 r600g: consolidate more translate functions 2012-02-14 15:49:24 +01:00
Marek Olšák
d214275ace r600g: inline r600_translate_ds_func 2012-02-14 15:49:24 +01:00
Marek Olšák
85571ed53c r600g: remove unused variable 2012-02-14 15:49:24 +01:00
Marek Olšák
9a20130e5f r600g: consolidate some translate functions 2012-02-14 15:49:23 +01:00
Marek Olšák
39b0da9f8d Revert "r600g: don't advertise integer textures without GLSL 1.3"
This reverts commit 2c06bcb909.

It breaks u_blitter trying to blit compressed textures as uint.
2012-02-14 15:48:37 +01:00
Marek Olšák
2c06bcb909 r600g: don't advertise integer textures without GLSL 1.3 2012-02-14 15:04:51 +01:00
Anuj Phogat
4042702591 meta: Add pixel store/pack operations in decompress_texture_image
This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.

It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:

 - Test all mipmaps with byte swapping enabled
 - Test all small mipmaps with all allowable alignment values
 - Test subimage packing for all mipmap levels

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40864

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-13 11:07:48 -08:00
Brian Paul
df1cd55ebf mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case
in _mesa_error_check_format_and_type().

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967
2012-02-13 08:47:59 -07:00
Stéphane Marchesin
d2c54fb522 gallivm: Replace architecture test with PIPE_ARCH_*
X86Target is a variable, and therefore isn't defined at compile time. So
 LLVM_NATIVE_ARCH == X86Target
is translated into
 0 == 0
and since X86 is first, we always pick it.

Therefore we replace the logic with PIPE_ARCH_*.

https://bugs.freedesktop.org/show_bug.cgi?id=45420
2012-02-12 16:32:15 -08:00
Stéphane Marchesin
a2caf952a1 i915g: Remove useless draw calls. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
633f21652a i915g: Add a way to profile the contents of command buffers. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
8b3e0b2715 i915g: Fix comments. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
c1896cdc91 i915g: Don't emit state when it's already bound. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
be6a02266d i915g: Remove unused poly stipple state. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
3cff45fdb1 i915g: Implement stipple with draw. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
175adf0776 i915g: Fix comment. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
4dc0425261 i915g: Move ureg defines to the header so we can share them. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
8e4540ec2a i915g: Separate declarations and program in the fragment program struct.
We need this later to fixup fragment programs properly.
2012-02-12 16:32:14 -08:00
Dave Airlie
094eeff199 st/mesa: only resolve if number of samples is > 1
Marek: this fixes a firefox crash and maybe even:
https://bugs.freedesktop.org/show_bug.cgi?id=45943

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-02-12 21:35:27 +01:00
Brian Paul
bd1ae51b13 swrast: fix span color type selection
Fixes a regression from commit 660ed923de.
The basic idea is to look at the format of the dest renderbuffer and
choose either GLubyte or GLfloat for colors.  The previous code used
_mesa_format_to_type_and_comps() which could return a bunch types other
than ubyte/float.

Determine the datatype at renderbuffer mapping time to avoid frequent
calls to the format query functions.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45578
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45577
2012-02-12 11:22:31 -07:00
Dave Airlie
b72d5767e3 extensions: remove unused code.
Comparing an unsigned to < 0 is pointless.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-12 16:09:50 +00:00
Dave Airlie
449cae141e mesa/texparam: drop double semicolons
no idea where these came from, drop them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-12 16:09:50 +00:00
Marek Olšák
6cd9159cea r300g: always fail to create a multisample resource
Just to be safe.
2012-02-12 13:07:51 +01:00
Marek Olšák
6d89a795a5 r300g: assert-fail when calling resource_resolve
And reset the dest pointer to NULL after it.
2012-02-12 13:07:51 +01:00
Alex Deucher
c565ff60d6 gallium/xvmc: r300 and r600 now depend on libdrm_radeon
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=45907

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-11 10:57:24 -05:00
Vinson Lee
d5a6c17254 gallivm: Change getExtent and readByte to non-const with llvm-3.1.
Fix build with llvm-3.1svn.

llvm-3.1svn r149918 changed BufferMemoryObject::getExtent and
BufferMemoryObject::readByte from const member functions to non-const
member functions in include/llvm/Support/MemoryObject.h.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-10 23:24:48 -08:00
Kenneth Graunke
3340b47c22 i965: Fix border color on Ironlake.
Ironlake appears to check our pointer against the General State Base
Address upper bound, rather than ignoring the zero bound as it ought.

Unfortunately, since we leave GSBA set to zero, there is no logical
upper bound.  Set it to the maximum possible value, which should work
since our virtual addresses only go up to 2GB.

+94 piglits.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-10 20:47:49 -08:00
Eric Anholt
7d55f37b0e i965/fs: Add support for generating MADs.
Improves nexuiz performance 0.65% +/- .10% (n=5) on my gen6, and .39%
+/- .11% (n=10) on gen7.  No statistically significant performance
difference on warsow (n=5, but only one shader has MADs).

v2: Add support for MADs in 16-wide by using compression control.
v3: Don't generate MADs when it will force an immediate to be moved to a temp.
    (it's not clear whether this is a win or not, but it should result in less
     questionable change to codegen compared to v2).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2012-02-10 18:18:52 -08:00
Eric Anholt
a1bfafc5a9 i965/fs: Add missing register allocation for 3rd sources.
Our only instruction with a 3rd source so far was linterp, and that
value was never register-allocated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-10 17:08:04 -08:00
Eric Anholt
2b28fd6ca6 i965: Add support for the MAD opcode on gen6+.
v2: Fix MRF handling on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-02-10 17:08:03 -08:00
Ian Romanick
46883e01ba Bump version to 8.1 (devel)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-10 15:34:44 -08:00
Alex Deucher
a8cc228edd radeon: build fix after 9d9111108e
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-10 11:31:23 -05:00
Alex Deucher
5e1495b2d9 r600g: 128 bit formats require tile_type = 1 on cayman
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-02-10 11:31:23 -05:00
Alex Deucher
acca690c25 r600g: fix tex tile_type offset for cayman
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-02-10 11:31:23 -05:00
Brian Paul
ad9455314d st/wgl: refactor stw_pixelformat_init()
Replace duplicated code with add_color_format_variants() helper.
2012-02-10 16:23:27 +00:00
José Fonseca
9646762261 st/wgl: Properly support non-displayble pixel formats, and implement float pixelformats as as one.
WGL_ARB_pixel_format establishes the existence of pixel formats which
are invisible to GDI.

However we still need to pass a valid pixelformat to GDI, so that
context creation/binding works.

The actual WGL_TYPE_RGBA_FLOAT_ARB implementation is from Brian Paul.
2012-02-10 16:23:27 +00:00
José Fonseca
90a95f4d2c st/wgl: Invoke SetPixelFormat twice for pbuffers. 2012-02-10 16:23:27 +00:00
José Fonseca
0cf554fa9b st/wgl: Just pass pPixelFormat to stw_pixelformat_get_info().
Avoids the likely error of forgetting to subtract one.
2012-02-10 16:23:27 +00:00
José Fonseca
6beed86ab8 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-10 16:23:27 +00:00
Brian Paul
5ee8969b11 mesa: remove unused gl_shared_state::DriverData field 2012-02-10 08:26:31 -07:00
Brian Paul
9e0931e355 docs: remove link to the GLSL compiler page
The page is terribly out of date.
(cherry picked from commit 65526d54aa)
2012-02-10 08:08:39 -07:00
Brian Paul
7028e6dc46 docs: add VMware link
(cherry picked from commit 6aa9ce2687)
2012-02-10 08:08:39 -07:00
Brian Paul
d01de08c4c docs: update info about supported systems, GPUs, APIs
Add link to Intel's Linux graphics page, etc.
(cherry picked from commit 14cf3dd826)
2012-02-10 08:08:39 -07:00
Brian Paul
ad8eec9eec docs: add news item for 8.0 release
(cherry picked from commit 7aef839760)
2012-02-10 08:08:39 -07:00
Ian Romanick
94846f8cd1 docs: Add 8.0 MD5 checksums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fb56b0972d)
2012-02-10 08:08:39 -07:00
Brian Paul
d925b0d4a7 mesa: fix proxy texture target initialization
The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in
alloc_proxy_textures() because the elements in the targets[] array
were in the wrong order.

This didn't actually cause any failures since we never really use the
proxy texture's Target field.  But let's get it right.

NOTE: This is a candidate for the 8.0 branch.
2012-02-10 08:08:39 -07:00
Brian Paul
3e59fb570a mesa: remove unused gl_pixelmap::Map8[] array
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
80fd3d2ca8 st/mesa: stop using Map8[] tables in load_color_map_texture()
Use the float tables instead.  Pixel maps are seldom used so this
shouldn't be a big deal.  Next, we can get rid of the gl_pixelmap::Map8
array.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
0d6ef4e299 mesa: remove unused _mesa_map_ci8_to_rgba8()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
fcca8f0b7a mesa: fix error handling in get_tex_rgba_compressed() 2012-02-10 08:06:57 -07:00
Brian Paul
1a4f398a63 mesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy() 2012-02-10 08:06:57 -07:00
Brian Paul
07459ba509 mesa: push row stride adjustment down into _mesa_decompress_image()
There's a mismatch in row strides for compressed textures between
what Driver.MapTextureImage() returns and what the software fetch-texel
functions use.  Move it down a layer.  The next step would be to fix
this in the fetch-texel functions.
2012-02-10 08:06:57 -07:00
Brian Paul
9d9111108e mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function 2012-02-10 08:06:57 -07:00
Brian Paul
d1b7967242 mesa: make _mesa_invalidate_shine_table() static 2012-02-10 08:06:57 -07:00
Brian Paul
ae509f88a5 mesa: remove gl_light::_SpotExpTable field
Just use pow() instead.  Spot lights aren't too common and fixed-function
lighting isn't as important as it used to me.

This saves 32KB per context.  Each table was 4KB and there's 8 lights.
2012-02-10 08:06:56 -07:00
Brian Paul
4dacf793c8 meta: replace abort() with _mesa_problem()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:56 -07:00
Brian Paul
068b9dc268 mesa: fix comment typo 2012-02-10 08:06:56 -07:00
Christian König
36cd50152c st/vdpau: use matrix filter to blur/sharpen video
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:10:05 +01:00
Christian König
d7db6343dd vl: add a matrix/convolution filter
Can be used for gaussian, mean, laplacian, emboss, sharpness...

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:09:27 +01:00
Christian König
bbb48e983d st/vdpau: use median filter for noise reduction
And while at it implement the rest of the feature
querying also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:06:07 +01:00
Christian König
a9ffcceee9 vl: add a median filter for noise reduction
This is a shader based median filter, generally
used for noise reduction, it could still need some
improvements, but should usually work out of the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:06:00 +01:00
Eric Anholt
a7750c9fb5 i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-09 19:03:19 -08:00
Eric Anholt
cdcfaa64e3 i965/gen7: Fix the length of the DS state packet in the HiZ op.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-09 19:03:18 -08:00
Eric Anholt
e5b225afbd i965/gen7: Fix GPU hangs from the HiZ op.
The wm max threads is in the same dword as the dispatch enable.  The
hardware gets super angry if you set max threads to 0, even if you
aren't dispatching threads.
2012-02-09 19:03:18 -08:00
Mathias Fröhlich
67007080b7 glsl: Avoid excessive loop unrolling.
Avoid unrollong loops that are either nested loops or
where the loop body times the unroll count is huge.

The change is far from being perfect but it extends the
loop unrolling decision heuristic by some additional
safeguard. In particular this cuts down compilation of
a shader precomputing atmospheric scattering integral
tables containing two nesting levels in a loop from
something way beyond some minutes (I never waited for
it to finish) to some fractions of a second.

This fixes piglit tests glsl-fs-unroll-explosion and
glsl-vs-unroll-explosion on r600g.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-02-09 21:23:16 +01:00
Anuj Phogat
ea228d97f8 mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type + 2 * border.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case:
max_values negative.textureSize.textureCube
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-09 11:59:38 -08:00
Dave Airlie
23c52caafb st/mesa: exit the update fragment samplers/textures loops early.
If we have no more enabled samplers and we've reset all the previously
used ones, no need to keep going around this loop.

(just moved some stuff around to clean it up a bit).

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-09 19:39:30 +00:00
Dave Airlie
86163b81a4 st/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.
From what I can see we were taking the debug path all the time,
when we probably only want it for enable debug path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-09 19:39:30 +00:00
Chia-I Wu
50683d2aa6 mesa: enable remap table when --enable-shared-glapi
As libGL will use libglapi for function lookups, we need to enable the remap
table.

Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45660
2012-02-09 10:39:50 -05:00
Brian Paul
781f84a3c2 vbo: unmap vertex store before executing lists
We don't want our VBOs mapped when we're drawing.  This change checks
if the vertex store VBO is mapped before we execute a list, unmaps it,
then remaps it after drawing.  This situation pops up when building a
nested display list in GL_COMPILE_AND_EXECUTE mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-09 08:18:50 -07:00
Christoph Bumiller
8b4f7b0672 gallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Just let the hardware do it if it can and avoid drivers having to
check for the special case on each draw call.

v2: update the draw module
2012-02-09 15:01:34 +01:00
Carl Worth
26de5273ac dri: Emit a critical error if the swrast driver fails to load.
Something has gone wrong if swrast is requested but cannot be
loaded. The user really should be made aware of this, (and instructed
to set LIBGL_DEBUG for more details).

The wording of this error message is updated from "reverting to
indirect rendering" to the more objectively descriptive "failed to
load driver: swrast". The former wording makes assumptions about what
the calling code will decide to do next, rather than simply describing
what went wrong within the current function. The new wording is
consistent with the critical errors recently added for hardware
drivers that fail to load.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
6c9af97740 dri: Emit a critical error if a named driver fails to load.
Something has gone wrong if we were asked to load a driver of a
specific name, but it failed to load for some reason. The user really
should be made aware of this, (and instructed to set LIBGL_DEBUG for
more details).

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
92bef0bfa1 dri: Add a CriticalErrorMessageF macro.
Sometimes an error is so sever that we want to print it even when the
user hasn't specifically requested debugging by setting LIBGL_DEBUG.

Add a CriticalErrorMessageF macro to be used for this case. (The error
message can still be slienced with the existing LIBGL_DEBUG=quiet).

For critical error messages we also direct the user to set the
LIBGL_DEBUG environment variable for more details.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
c09504c343 dri: Clarify comments on InfoMessageF and ErrorMessageF macros.
The description of ErrorMessageF was misleading in the case of
LIBGL_DEBUG being unset, (the previous comment could be understood to
mean the error should be printed, but the code does not print in this
case).

InfoMessageF previously had no comment at all.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Chad Versace
5497cc428f glsl: Fix Android build
The build was broken by the line below, added in commit 4f82fed4.
  s_expression.cpp:26: #include <limits>

Mesa's half of the fix is to add 'external/astl/include' to the include
path. The other half of the fix requires implementing
numeric_limits<float>::infinity() in astl, for which I have patches
submitted upstream for review.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-08 15:17:12 -08:00
Christian König
192467108b r600g: fix handling of outputs as TEX addr sources
Outputs should be treated in the same way as
inputs and temporaries here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2012-02-08 19:25:18 +01:00
Chad Versace
b44c459cc3 i965: Remove file i965/junk, accidentally added in 7b36c68 2012-02-08 09:19:56 -08:00
Dave Airlie
833a33bf6e st/mesa: avoid vertex texture and sampler updates for 0 case
If we had no vertex textures or samplers previously and we have none now,
don't bother doing the enables dance.

I was profiling nexuiz on noop and noticed these two functions in the
profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03%
for texture and samplers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-08 12:12:10 +00:00
Kenneth Graunke
33f4461ec9 i965: Remove broken symlink to intel_decode.c.
Eric removed intel_decode.c in 61b9ccd9e2.
2012-02-07 18:15:44 -08:00
Eric Anholt
7c857a6b15 i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.
We were doing saturate-based clamping on the [0,width] or [0,height]
coordinate, which meant only the first pixel was addressable.

Fixes piglit ARB_texture_rectangle/texwrap-RECT-bordercolor

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-07 16:03:30 -08:00
Eric Anholt
07e621c523 i965/fs: Move GL_CLAMP handling to coordinate setup.
We should be able to merge self-move instruction into the MRF move
anyway, and this simplifies things for the next commit.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-07 16:03:30 -08:00
Eric Anholt
94866ffbb8 i965: Fix HiZ change compiler warning. 2012-02-07 16:03:30 -08:00
Chad Versace
7b36c68ba6 i965: Rewrite the HiZ op
The HiZ op was implemented as a meta-op. This patch reimplements it by
emitting a special HiZ batch. This fixes several known bugs, and likely
a lot of undiscovered ones too.

==== Why the HiZ meta-op needed to die ====

The HiZ op was implemented as a meta-op, which caused lots of trouble. All
other meta-ops occur as a result of some GL call (for example, glClear and
glGenerateMipmap), but the HiZ meta-op was special. It was called in
places that Mesa (in particular, the vbo and swrast modules) did not
expect---and were not prepared for---state changes to occur (for example:
glDraw; glCallList; within glBegin/End blocks; and within
swrast_prepare_render as a result of intel_miptree_map).

In an attempt to work around these unexpected state changes, I added two
hooks in i965:
  - A hook for glDraw, located in brw_predraw_resolve_buffers (which is
    called in the glDraw path). This hook detected if a predraw resolve
    meta-op had occurred, and would hackishly repropagate some GL state
    if necessary. This ensured that the meta-op state changes would not
    intefere with the vbo module's subsequent execution of glDraw.
  - A hook for glBegin, implemented by brwPrepareExecBegin. This hook
    resolved all buffers before entering
    a glBegin/End block, thus preventing an infinitely recurring call to
    vbo_exec_FlushVertices. The vbo module calls vbo_exec_FlushVertices to
    flush its vertex queue in response to GL state changes.

Unfortunately, these hooks were not sufficient. The meta-op state changes
still interacted badly with glPopAttrib (as discovered in bug 44927) and
with swrast rendering (as discovered by debugging gen6's swrast fallback
for glBitmap). I expect there are more undiscovered bugs. Rather than play
whack-a-mole in a minefield, the sane approach is to replace the HiZ
meta-op with something safer.

==== How it was killed ====

This patch consists of several logical components:
  1. Rewrite the HiZ op by replacing function gen6_resolve_slice with
     gen6_hiz_exec and gen7_hiz_exec. The new functions do not call
     a meta-op, but instead manually construct and emit a batch to "draw"
     the HiZ op's rectangle primitive. The new functions alter no GL
     state.
  2. Add fields to brw_context::hiz for the new HiZ op.
  3. Emit a workaround flush when toggling 3DSTATE_VS.VsFunctionEnable.
  4. Kill all dead HiZ code:
     - the function gen6_resolve_slice
     - the dirty flag BRW_NEW_HIZ
     - the dead fields in brw_context::hiz
     - the state packet manipulation triggered by the now removed
       brw_context::hiz::op
     - the meta-op workaround in brw_predraw_resolve_buffers (discussed
       above)
     - the meta-op workaround brwPrepareExecBegin (discussed above)

Note: This is a candidate for the 8.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reported-by: xunx.fang@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44927
Reported-by: chao.a.chen@intel.com
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-07 15:15:03 -08:00
Ian Romanick
d59466279e intel: Avoid divide by zero for very small linear blits
If size is small (such as 1),

   pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);

makes pitch = 0.  Then

   height = size / pitch;

causes a division-by-zero exception.  If pitch is zero, set height to
1 and avoid the division.

This fixes piglit's bin/getteximage-formats test and glean's
bufferObject test.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44971
2012-02-07 10:00:32 -08:00
Ian Romanick
65b096aedd intel: Remove num_mapped_regions assertion from _intel_batchbuffer_flush
There are cases where a buffer can be mapped while another buffer is
flushed.  This can happen in the CopyPixels meta-op path for piglit's
fbo-mipmap-copypix.  After some discussion with Eric, it seems this
assertion is no longer necessary, and it has always been too strict.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43328
Cc: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-07 10:00:31 -08:00
Tobias Droste
d048ab5558 gallium/gbm: r300 and r600 now depend on libdrm
fixes undefined references in libradeonwinsys.a when linking

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2012-02-07 11:12:09 -05:00
Brian Paul
7335cf1c32 r600g: remove unused vars to silence warnings 2012-02-07 07:48:46 -07:00
Brian Paul
938671397f mesa: remove unused _mesa_error_check_format_type() function
This was only used by glReadPixels and glDrawPixels.  Now those
functions do the corresponding error checks.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:45:40 -07:00
Brian Paul
b8f7eef4ef mesa: stop using _mesa_error_check_format_type() in glReadPixels
Basically the same story as the previous commit.  But we were
already calling _mesa_source_buffer_exists() in ReadPixels().
Yeah, we were calling it twice.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:45:38 -07:00
Brian Paul
6bed7a861d mesa: stop using _mesa_error_check_format_type() in glDrawPixels
The _mesa_error_check_format_type() function does two things: check
that format/type is legal and check that the destination (or source
buffer for glReadPixels) actually exists.  Just move the relevant
parts of that into _mesa_DrawPixels().

We'll do a similar change in glReadPixels then get rid of the function
altogether.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
675d44629c mesa: remove redundant format/type checks in glReadPixels()
These are done in _mesa_error_check_format_and_type().

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
8b3a517673 mesa: remove redundant format/type checks in glGetTexImage()
The _mesa_error_check_format_and_type() function will catch all those
cases now.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
627b435dfe mesa: new _mesa_error_check_format_and_type() function
This replaces the _mesa_is_legal_format_and_type() function.

According to the spec, some invalid format/type combinations to
glDrawPixels, ReadPixels and glTexImage should generate
GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION.

With the old function we didn't make that distinction and generated
GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION.  The new
function returns one of those errors or GL_NO_ERROR.

This will also let us remove some redundant format/type checks in
follow-on commit.

v2: add more checks for ARB_texture_rgb10_a2ui at the top of
_mesa_error_check_format_and_type() per Ian.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Dave Airlie
699e3b9821 scons: fix typo in package version
pointed out on irc by GArik_

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:26:48 +00:00
Dave Airlie
ff60bd8058 radeon: only init surface manage on r600
r300 fails to init the manager and then fails to init.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:20:09 +00:00
José Fonseca
2470e918cc scons: Require same pkg-config versions as configure. 2012-02-07 11:41:08 +00:00
José Fonseca
f763ad5130 scons: r300/r600 now depends on libdrm.
As they now indirectly include on libdrm/radeon_surface.h.
2012-02-07 11:40:58 +00:00
Brian Paul
aed51e3e6a mesa: support more format/type combos in _mesa_dump_image() 2012-02-06 17:56:43 -07:00
Brian Paul
4ab8403c25 util: fix typo in debug_printf_once comment 2012-02-06 17:56:43 -07:00
Jerome Glisse
c0c979eebc r600g: add support for common surface allocator for tiling v13
Tiled surface have all kind of alignment constraint that needs to
be met. Instead of having all this code duplicated btw ddx and
mesa use common code in libdrm_radeon this also ensure that both
ddx and mesa compute those alignment in the same way.

v2 fix evergreen
v3 fix compressed texture and workaround cube texture issue by
   disabling 2D array mode for cubemap (need to check if r7xx and
   newer are also affected by the issue)
v4 fix texture array
v5 fix evergreen and newer, split surface values computation from
   mipmap tree generation so that we can get them directly from the
   ddx
v6 final fix to evergreen tile split value
v7 fix mipmap offset to avoid to use random value, use color view
   depth view to address different layer as hardware is doing some
   magic rotation depending on the layer
v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
   evergreen, align bytes per pixel to a multiple of a dword
v9 fix handling of stencil on evergreen, half fix for compressed
   texture
v10 fix evergreen compressed texture proper support for stencil
    tile split. Fix stencil issue when array mode was clear by
    the kernel, always program stencil bo. On evergreen depth
    buffer bo need to be big enough to hold depth buffer + stencil
    buffer as even with stencil disabled things get written there.
v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
    old ddx overestimate those. Fix linear case when pitch*height < 64.
    Fix r300g.
v12 Fix linear case when pitch*height < 64 for old path, adapt to
    libdrm API change
v13 add libdrm check

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-06 18:36:37 -05:00
Jon TURNEY
8937c166ef Have __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the server does
There is a mismatch between the way the X server and GLX library
calculates the image size for format GL_DEPTH_STENCIL(|_NV|_EXT)

See https://bugs.freedesktop.org/show_bug.cgi?id=30102

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-02-06 23:00:44 +00:00
Christian König
814be043fa st/vdpau: use dst surface size if clip width/height is zero
Just another fix for gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 21:29:40 +01:00
Christian König
97349dfa79 st/vdpau: implement vlVdpOutputSurfaceQueryCapabilities
Fixing some problems with gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-02-06 21:26:49 +01:00
Christoph Bumiller
189e6c7e81 nv50: fix bad assertion on Elements(phi->src) in regalloc
The array is phi->src, phi->src[i] is just a pointer.
2012-02-06 12:19:57 +01:00
Jon TURNEY
ffc8494db5 dri: Don't build libdricommon.la if we don't need it
Refine 80aa78142d "dri: make sure to build libdricommon.la"
so we don't build libdricommon if we aren't building a dri driver which needs it (i.e.
if we are just building swrast)

In particular, this restores the ability to build the swrast dri driver without having to
have a xf86drm.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-02-06 11:10:51 +00:00
Christian König
9001682846 vl: add VL_MAX_SURFACES define
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
8abbdb8865 vl: rename VL_MAX_PLANES to VL_NUM_COMPONENTS
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
70a7695b4d vl: prefix size defines with VL_
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
3ac959492d vl: remove assert on unknown video profile
It's perfectly valid to ask for an unknown
profile and get unknown code as a result.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
14f47d164d st/xvmc: respect caps when creating video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
8f54929c5d st/vdpau: use interlacing capabilities
Recreate video buffer if need arises.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
8bfadc802f st/vdpau: implement uploads to interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
f3f03c67e9 vl: add interlacing capabilities
Let the driver control interlaced or progressive
format of video buffers.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
3841d3fd13 vl: add a simple weave deinterlacer
Well it's not so simple, since it does
deinterlacing and scaling at the same time.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:05 +01:00
Christian König
9f9628c72b vl/video_buffer: fix interlaced surface ordering
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Christian König
4ccae0dfaa vl/video_buffer: fix height of interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Roland Scheidegger
1f4a853b1e mesa: check_index_bounds off-by-one fix
in check_index_bounds the comparison needs to be "greater equal" since
contrary to the name _MaxElement is the count of the array (this matches
similar code in vbo_exec_DrawRangeElementsBaseVertex).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-06 01:04:28 +01:00
Eric Anholt
b3c84a80cd mesa: Fix xcb-dri2 link flags leaking into LIBS.
Fixes the build of builtin_compiler on my 32-bit build where xcb-dri2
is in a custom prefix but the custom prefix flags weren't available.
It shouldn't have been in LIBS anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-04 22:04:35 +01:00
Eugeni Dodonov
84e5f1c635 intel: check for LLC support when reading maps
This checks for advertised LLC support by the GPU instead of relying on
the GPU generation for detection.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-04 18:21:22 -02:00
Eugeni Dodonov
7def293204 intel: verify if hardware has LLC support
Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In
case the libdrm version does not supports this check, fallback to older
way of detecting it which assumed that GPUs newer than GEN6 have it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-04 18:21:22 -02:00
Dave Airlie
fa2a76a21c draw: fix fog coord export.
This does what we do in the hw drivers, and only export the X.

fixes the fogcoord.dp* tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-04 17:50:43 +00:00
Chih-Wei Huang
f8be4f33d3 vbo: fix a building error
Signed-off-by: Marek Olšák <maraeo@gmail.com>

NOTE: This is a candidate for the 8.0 branch.
2012-02-04 08:59:09 +01:00
José Fonseca
8184228e8b llvmpipe: Make more resilient to out-of-memory situations.
Most of the code was alright, but we were missing a few paths.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 18:51:14 +00:00
Keith Whitwell
9a1fd9a37c llvmpipe: clear storage for newly allocated resources
Was previously being done in a state-tracker, but in a way which was
difficult for some drivers to optimize.  Push down to this level and
make it the individual drivers responsibility.
2012-02-03 18:51:14 +00:00
Ian Romanick
87b4c9b322 intel: FBOs with texture border are unsupported
FBOs differ from textures in a significant way.  With textures, we can
strip the border and get correct rendering except when the application
fetches texels outside [0,1].

With an FBO, the pixel at (0,0) is in the border.  The
ARB_framebuffer_object spec says:

    "If the attached image is a texture image, then the window
    coordinates (x[w], y[w]) correspond to the texel (i, j, k), from
    figure 3.10 as follows:

                           i = (x[w] - b)

                           j = (y[w] - b)

                           k = (layer - b)

    where <b> is the texture image's border width..."

Since the border doesn't exist, we can never render any pixels in the
correct location.  Just mark these FBOs FRAMEBUFFER_UNSUPPORTED.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42336
2012-02-03 10:50:01 -07:00
Ville Syrjala
0fcc518964 gallium/dri: Handle xserver that doesn't send needless DRI2 invalidate events
Ever since xserver commit 531869448d07e00ae241120b59f3aaaa5709d59c,
the server no longer sends invalidate events to clients, unless they
have performed a GetBuffers request since the drawable was last
invalidated.

If the drawable gets invalidated immediately after the GetBuffers
request was processed by the X server, it's possible that Xlib
will process the invalidate event while waiting for the GetBuffers
reply. So the server, thinking the client knows that the buffers
are invalid, is waiting for another GetBuffers request before
sending any more invalidate events. The client, on the other hand,
believes the buffers to be valid, and thus is expecting to receive
another invalidate event before it has to send another GetBuffers
request. The end result is that the client never again sends
a GetBuffers request.

To avoid this problem, take a snapshot of the lastStamp before
doing GetBuffers, and retry if the snapshot and the current
lastStamp no longer match after the GetBuffers reply has been
processed.

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-03 12:02:58 +00:00
Eric Anholt
57e44371a5 glsl: Add error case for switch() with two default cases.
Fixes piglit switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:07:04 +01:00
Eric Anholt
140632190c glsl: Throw an error when faced with a duplicated switch() case label.
The error message I chose matches gcc's error.  Fixes piglit
switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:07:02 +01:00
Eric Anholt
01a5a2c9d7 glsl: Add other missing error location information for switch statements.
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:59 +01:00
Eric Anholt
663dcbbffe glsl: Add missing location info to case labels.
Otherwise, the upcoming error messages said the location was 0:0(0).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:57 +01:00
Eric Anholt
2c3e10e719 glsl: Throw the required error when a case label is a non-constant.
It's not quite spelled out in the spec text, but the grammar indicates
that only constant values are allowed as switch() case labels (and
only constant values make sense, anyway).

Fixes piglit glsl-1.30/compiler/switch-statement/switch-case-uniform-int.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:54 +01:00
Eric Anholt
22d81f154f glsl: Save and restore the whole switch state for nesting.
This stuffs them all in a struct for sanity.  Fixes piglit
glsl-1.30/execution/switch/fs-uniform-nested.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:50 +01:00
Eric Anholt
b8c9252570 dri: Add Unigine Tropics as an app that requires the GLSL warn workaround.
I wasn't seeing it be needed because of the previous bug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-03 09:26:32 +01:00
Eric Anholt
4dd2743d45 dri: Fix typo in xml file that made all applications use the workaround.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-03 09:26:23 +01:00
Eric Anholt
27af00eac8 mesa: Fix the error message function names for glFlushMappedBufferRange().
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:05 +01:00
Eric Anholt
f20fb80a91 mesa: Fix bad-enum/no-buffer error handling for buffer object functions.
For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:02 +01:00
Brian Paul
84a1273e7f glsl: move array_sizing_visitor class outside of link_intrastage_shaders()
To silence warnings with gcc 4.4.x on Linux and llvm-g++ 4.2 on Mac.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 20:10:51 -07:00
Brian Paul
8cbe699c0d gallium/postprocess: move declarations before code
To fix MSVC build.
2012-02-02 15:14:10 -07:00
Lauri Kasanen
81938d2137 gallium/postprocess: Just to be safe, reference all buffers from outside
Even though it should be safe to use them for one frame, better be sure.
Suggested by Michael Dänzer.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:09 -05:00
Lauri Kasanen
c5976017e3 gallium/postprocess: Fix depth logic
This prevents a possible lapse of the depth buffer - the situation where
the app and pp have different depth buffers.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:06 -05:00
Carl Worth
cd2e2187cb glsl: Avoid ralloc_stealing a long-lived object to a short-lived parent
In commit 6ecee54a9a a call to
talloc_reference was replaced with a call to talloc_steal. This was in
preparation for moving to ralloc which doesn't support reference
counting.

The justification for talloc_steal within token_list_append in that
commit is that the tokens are being copied already. But the copies are
shallow, so this does not work.

Fortunately, the lifetime of these tokens is easy to understand. A
token list for "replacements" is created and stored in a hash table
when a function-like macro is defined. This list will live until the
macro is #undefed (if ever).

Meanwhile, a shallow copy of the list is created when the macro is
used and the list expanded. This copy is short-lived, so is unsuitable
as a new parent.

So we can just let the original, longer-lived owner continue to own
the underlying objects and things will work.

This fixes bug #45082:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

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

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth
64fd26a8a8 glsl: Add glcpp tests for a macro used twice
This test cases exposes a bug as described in this bug report:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

Clearly, some memory is getting (incorrectly) freed on the first macro
invocation, leading to problems with the second macro invocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Carl Worth
7ab1c7f792 glcpp: Fix so that trailing punctuation does not prevent macro expansion
The trick here is that flex always chooses the rule that matches the most
text. So with a input text of "two:" which we want to be lexed as an
IDENTIFIER token "two" followed by an OTHER token ":" the previous OTHER
rule would match longer as a single token of "two:" which we don't want.

We prevent this by forcing the OTHER pattern to never match any
characters that appear in other constructs, (no letters, numbers, #,
_, whitespace, nor any punctuation that appear in CPP operators).

Fixes bug #44764:

	GLSL preprocessor doesn't replace defines ending with ":"
	https://bugs.freedesktop.org/show_bug.cgi?id=44764

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

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth
e931b0e05b glcpp: Add new test showing bug where a trailing ':' prevents macro expansion
This demonstrates a bug that was recently triggered in piglit.

Here is the original bug report (containing a test case almost identical
to this one):

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Ian Romanick
2e8f8cb383 mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float
GL_RG_INTEGER only has two components, not three.  I'll be surprised
if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER,
...).  This was found by inspection.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 10:07:14 -07:00
Ian Romanick
5c341b7df3 mesa: Fix copy-and-paste bug in do_row_3D
Several of the half-float cases used 4 as the texel size when it
should have been some smaller value.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43325
2012-02-02 10:07:14 -07:00
Ian Romanick
660ed923de mesa: Convert colors if span ChanType and renderbuffer data type don't match
This is a partial revert of f9874fe.  It turns out that the types
don't always match.  Specifically, this can happen when doing
glCopyPixels from a float FBO to a RGBA8 FBO.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:14 -07:00
Ian Romanick
e06b1c65bc mesa: Set the gl_array_object::ARBsemantics flag at the right time
With 0963990 the flag was only set when Bind created the object.  In
all cases where ::ARBsemantics could be true, this path never
happened.  Instead, add a _Used flag to track whether a VAO has ever
been bound.  On the first Bind, set the _Used flag, and set the
ARBsemantics flag to the correct value.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
2012-02-02 10:07:14 -07:00
Ian Romanick
af1477b088 mesa: Add unpack_uint_z_row support for floating-point depth buffers
This is a hack, and it will result in incorrect rendering.  However,
it does eliminate spurious warnings in several piglit CopyPixels tests
that involve floating-point depth buffers.

The real solution is to add a zf field to SWspan to store float Z
values.  When a float depth buffer is involved, swrast should also
populate the zf field.  I'll consider this post-8.0 work.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:01 -07:00
Brian Paul
e20e30b28c Revert "Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi""
This reverts commit 4e5a8937d1.
... to fix build with --enable-osmesa
2012-02-02 08:17:43 -07:00
José Fonseca
edb1970795 draw: Avoid NULL pointer dereference when binding NULL fragment shaders.
Now that the draw module avoids flushing, it may flush precisely when
binding a NULL shader, so care must be taken when restoring the original
fragment shader.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:30 +00:00
José Fonseca
efd73f72d8 mapi/glapi: Never use a generic no-op entry-point on Windows.
When GLAPIENTRY is __stdcall (ie Windows), the stack is popped by the
callee making the number/type of arguments significant, therefore
using a generic no-op causes stack corruption for many entry-points.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:24 +00:00
ojab
db312b62f2 gallivm: Fix LLVM-2.7 build.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-02-02 09:04:10 +00:00
José Fonseca
54fd495c41 gallivm: Remove MSVC RT hack.
The hack never worked reliably, and docs/llvmpipe.html is quite clear on
the requirement of matching CRT when building LLVM and Mesa already.
2012-02-02 09:04:10 +00:00
Anuj Phogat
15986d21eb mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1)

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case: max_values
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-01 18:49:22 -08:00
Zack Rusin
cff0eac702 svga: fix a crash happening before setting fragment shaders.
In certain situations API's will call pipe->clear which doesn't
require fragment shader, but then we'd try to verify the pipeline
and assume fragment shader was always set. This was leading to
crash when API would just call simple clear's before anything else.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 16:34:57 -05:00
Brian Paul
3279561e9a st-api: fix typos, whitespace, line wrapping 2012-02-01 14:02:35 -07:00
Brian Paul
e53557996e vbo: fix node_attrsz[] usage in vbo_bind_vertex_list()
The node_attrsz[] array is initially copied from the node->attrsz[]
array but some values get rewritten.  Thereafter, we need to use the
node_attrsz[] values.

Fixes a bug when replaying a display list that uses generic vertex
array[16] (at least).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-01 13:45:09 -07:00
Brian Paul
f09910f399 nv50: add assertions missed in earlier nv50 commit 2012-02-01 08:22:16 -07:00
Colin Walters
0d736b2076 build: Note that we don't support srcdir != builddir
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-01 15:02:29 +00:00
Brian Paul
541bb2e33f nv50: use larger arrays to silence warnings and fix buffer overflows
The warnings were:
nv50_pc_regalloc.c: In function ‘pass_generate_phi_movs’:
nv50_pc_regalloc.c:423:41: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp: In member function ‘bool nv50_ir::MemoryOpt::replaceStFromSt(nv50_ir::Instruction*, nv50_ir::MemoryOpt::Record*)’:
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds

And add some assertions to catch this sooner in debug builds.
2012-02-01 07:19:54 -07:00
Brian Paul
a1471e4877 mesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)
This fixes a dangling texture object pointer bug hit via wglShareLists().
When we push the GL_TEXTURE_BIT state we may push references to the default
texture objects which are owned by the gl_shared_state object.  We don't
want to accidentally delete that shared state while the attribute stack
references shared objects.  So keep a reference to it.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:44 -07:00
Brian Paul
361cd53a77 mesa: use new _mesa_reference_shared_state() function
This cleans up the reference counting of shared context state.
The next patch will use this to fix an actual bug.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:40 -07:00
Brian Paul
133c5727b5 mesa: remove stray comment in PopAttrib() code 2012-02-01 06:52:30 -07:00
Matt Turner
7ef94c6a0b Revert "automake: src/mesa/drivers/osmesa"
This reverts commit 275ac7e5c1.
2012-01-31 21:34:42 -05:00
Matt Turner
a99164956f Revert "automake: src/glsl and src/glsl/glcpp"
This reverts commit 9947656168.
2012-01-31 21:33:59 -05:00
Matt Turner
70dd17152d Revert "src/glsl/glcpp: wire up glcpp-test to make check"
This reverts commit 2bb9f9e1fd.
2012-01-31 21:33:21 -05:00
Matt Turner
8c436b4ea6 Revert "Make sure libGL.so links with libglsl"
This reverts commit f53e7e981e.
2012-01-31 21:33:07 -05:00
Matt Turner
f6cc4347de Revert "glsl: Fix optimization tests after converting src/glsl to automake."
This reverts commit ffe376d5a7.
2012-01-31 21:32:33 -05:00
Marek Olšák
b0337b679a r600g: shorten expressions accessing family and chip_class 2012-01-31 23:28:55 +01:00
Marek Olšák
267bddaacb r300g: don't use pipe_context::winsys 2012-01-31 23:28:50 +01:00
Marek Olšák
38bf276348 r600g: remove unused variable num_dest_buffers 2012-01-31 23:28:42 +01:00
Marek Olšák
f661405637 r600g: use the new code for streamout flush as well 2012-01-31 23:12:31 +01:00
Marek Olšák
70d40fc675 r600g: rename r600_reg::flush_flags -> sbu_flags
There is no other use for that.
2012-01-31 23:12:30 +01:00
Marek Olšák
6d0a011acb r600g: fix computation of how many dwords is needed for a flush at the end of CS 2012-01-31 23:12:30 +01:00
Marek Olšák
1c5625cdb9 r600g: remove unused r600_reg::flush_mask 2012-01-31 23:12:30 +01:00
Marek Olšák
0671400dcc r600g: remove more dead code 2012-01-31 23:12:30 +01:00
Marek Olšák
74027a9ba2 r600g: remove dead code for tracking relocations 2012-01-31 23:12:30 +01:00
Marek Olšák
4fd97b46a0 r600g: remove unused flush code 2012-01-31 23:12:30 +01:00
Marek Olšák
0813e58a3e r600g: rework cache flushing
This also significantly improves the RV670 flush by using the CB1 flush
*always* and also DEST_BASE_0_ENA, which appears to magically fix some tests.
I am not entirely sure, but it's possible that RV670 flushing is fixed
completely.

v2: fix cayman by flushing texture cache instead of vertex cache

Thanks to Dave Airlie for testing Cayman.
2012-01-31 23:12:30 +01:00
Marek Olšák
2fe521fa41 r600g: add a new simple API for state emission 2012-01-31 23:12:30 +01:00
Marek Olšák
621e0db71c r600g: remove redundant pm4 and pm4_cdwords in r600_context
These only mirrored radeon_winsys_cs.
2012-01-31 23:12:30 +01:00
Marek Olšák
3b04671920 r600g: consolidate some context_draw code 2012-01-31 23:12:30 +01:00
Marek Olšák
302862defa r600g: remove the now-useless internal flush callback 2012-01-31 23:12:30 +01:00
Marek Olšák
bc70bcfc69 r600g: don't initialize the screen and winsys pointer twice 2012-01-31 23:12:30 +01:00
Marek Olšák
e4340c1908 r600g: merge r600_context with r600_pipe_context
The split made no sense.
2012-01-31 23:12:30 +01:00
Marek Olšák
78293b99b2 r600g: remove u8,u16,u32,u64 types 2012-01-31 23:12:30 +01:00
Paul Berry
ffe376d5a7 glsl: Fix optimization tests after converting src/glsl to automake.
Commit 99476561 (automake: src/glsl and src/glsl/glcpp) changed the
build system so that src/glsl/glsl_test is not built by default.  This
inadvertently broke "make check", since the tests in
src/glsl/tests/lower_jumps (which are run by "make check") rely on
glsl_test.

This patch ensures that "make check" builds glsl_test before running
any tests.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-31 10:15:08 -08:00
Matt Turner
f53e7e981e Make sure libGL.so links with libglsl
Can't link against *.la files if we're not using libtool to link.

Fixes undefined symbol: _ZN23ir_hierarchical_visitor5visitEP11ir_variable
2012-01-31 12:04:19 -05:00
Christian König
d36f89c8cf vl: fix some missing prototypes error
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45444
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-31 17:12:05 +01:00
Brian Paul
3fc6e4e025 osmesa: set RefCount = 1 in new_osmesa_renderbuffer()
This was lost during the renderbuffer overhaul work.  Fixes a failed
refcount assertion.
2012-01-31 07:44:55 -07:00
Vinson Lee
136791ebc1 osmesa: Fix osmesa_context.DataType type.
Fixes these GCC warnings.
osmesa.c: In function ‘osmesa_renderbuffer_storage’:
osmesa.c:417: warning: comparison is always false due to limited range of data type
osmesa.c:423: warning: comparison is always false due to limited range of data type
osmesa.c:431: warning: comparison is always false due to limited range of data type
osmesa.c:437: warning: comparison is always false due to limited range of data type
osmesa.c:447: warning: comparison is always false due to limited range of data type
osmesa.c:453: warning: comparison is always false due to limited range of data type
osmesa.c:463: warning: comparison is always false due to limited range of data type
osmesa.c:466: warning: comparison is always false due to limited range of data type
osmesa.c:476: warning: comparison is always false due to limited range of data type
osmesa.c:479: warning: comparison is always false due to limited range of data type

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-31 07:43:36 -07:00
Brian Paul
6386f80dbd vega: memset data array to zero to silence uninitialized var warnings 2012-01-31 07:01:29 -07:00
ojab
97329efc5f Initialize only native LLVM Disassembler.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-31 08:11:24 +00:00
Matt Turner
5920f18fae Remove autoreconf generated files
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:10:10 -05:00
Matt Turner
2bb9f9e1fd src/glsl/glcpp: wire up glcpp-test to make check
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:10:03 -05:00
Matt Turner
82060adcde glcpp-test: don't return failure if valgrind tests aren't run
Success was (tests-passed AND valgrind-tests-passed) but this meant that
if the valgrind tests weren't run it would be considered a failure.

The logic is now (tests-passed AND (!valgrind OR valgrind-tests-passed))
which lets us return success if the valgrind tests aren't run.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:57 -05:00
Matt Turner
9947656168 automake: src/glsl and src/glsl/glcpp
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:38 -05:00
Matt Turner
dfb6142548 autoconf: use AC_PROG_YACC/LEX
Needed for automake. Using AC_PROG_PATH(bison/flex) causes automake to
fail to build .y and .l files.

It is up to the builder to use bison/flex instead of yacc/lex.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:32 -05:00
Matt Turner
4ff8fd93e8 glsl: rename Makefile.sources' _SOURCES variables
automake uses variables named *_SOURCES.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:25 -05:00
Matt Turner
275ac7e5c1 automake: src/mesa/drivers/osmesa 2012-01-30 21:09:18 -05:00
Kenneth Graunke
e3b5200496 glsl: Rename class variable_entry to ir_variable_refcount_entry.
Exporting a publicly visible class with a generic name like
"variable_entry" via ir_variable_refcount.h is kind of mean.

Many IR transformers would like to define their own "variable_entry"
class.  If they accidentally include this header, the compiler/linker
may get confused and try to instantiate the wrong variable_entry class,
leading to bizarre runtime crashes.

The hope is that renaming this one will allow .cpp files to safely
declare and use their own file-scope "variable_entry" classes.

This avoids crashes caused by converting src/glsl to automake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 17:44:52 -08:00
Marek Olšák
bed20f02a7 r600g: get rid of r600_context_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:32 +01:00
Marek Olšák
85db520251 r600g: don't use r600_context_reg on r6xx-r7xx
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:30 +01:00
Marek Olšák
b1b969f670 r600g: don't use r600_context_reg on evergreen
Just getting rid of things which use the register mask.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:27 +01:00
Marek Olšák
9344ab382a r600g: get rid of the mask in r600_pipe_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:23 +01:00
Marek Olšák
4a058aebb2 r600g: get rid of the mask parameter in pipe_state_add_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:18 +01:00
Marek Olšák
0569f13d2b r600g: don't use register mask for TA_CNTL_AUX
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:16 +01:00
Marek Olšák
a494301f7f r600g: don't use register mask for PA_CL_CLIP_CNTL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:13 +01:00
Marek Olšák
97acf2ca59 r600g: don't use register mask for PA_CL_VS_OUT_CNTL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:07 +01:00
Marek Olšák
121940ecc7 r600g: set full register mask for PA_CL_CLIP_CNTL
We don't set the other bits anywhere else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:03 +01:00
Marek Olšák
a652cc40b9 r600g: don't use register mask for PA_SU_SC_MODE_CNTL
It's always emitted in draw_vbo.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:00 +01:00
Marek Olšák
2000086fcd r600g: don't add PA_SC_LINE_STIPPLE to rasterizer_state
It's always emitted in draw_vbo.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:56 +01:00
Marek Olšák
84b4b2a8aa r600g: don't use register mask for CB_COLOR_CONTROL on r6xx-r7xx
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:53 +01:00
Marek Olšák
9c0b50ca0b r600g: don't set CB_TARGET_MASK in set_framebuffer_state
It's emitted in draw_vbo, always.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:50 +01:00
Marek Olšák
2ffa8af9db r600g: set full register mask for CB_COLOR_CONTROL on evergreen
We don't set the other bits anywhere else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:46 +01:00
Marek Olšák
e3032a0523 r600g: use a more clever way to disable per-vertex point size
This uses point size clamping to force point size to a particular value,
making the vertex shader output irrelevant.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:37 +01:00
Marek Olšák
b6233f4d2e r600g: don't use register mask for DB_RENDER_CONTROL
We don't set the other bits anywhere else except the other DSA states,
which are mutually-exclusive with this one.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:32 +01:00
Marek Olšák
3d061caaed r600g: cleanup setting DB_SHADER_CONTROL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:29 +01:00
Marek Olšák
a2361946e7 r600g: rework and consolidate stencilref state setting
Stop using the register mask.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:25 +01:00
Marek Olšák
5345e3ea86 r600g: don't use register mask for SQ_GPR_RESOURCE_MGMT_1
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:15:51 +01:00
Marek Olšák
177845daa1 st/mesa: kill off point size clamping in vertex shaders
This fixes the gl_PointSize transform feedback test.
Point size clamping should happen at the rasterizer stage,
i.e. after the vertex and geometry shaders and transform feedback.

Drivers are expected to do this by themselves.
2012-01-31 00:54:34 +01:00
Marek Olšák
f183cc9ce3 r600g: set minimum point size to 1.0 for non-sprite non-aa points 2012-01-31 00:54:34 +01:00
Marek Olšák
ac3a765589 r300g: set minimum point size to 1.0 for non-sprite non-aa points 2012-01-31 00:54:34 +01:00
Marek Olšák
cb43954308 svga: set POINTSIZEMIN to 1.0 for non-sprite non-aa points
v2: add the helper function, improve the condition
2012-01-31 00:54:34 +01:00
Marek Olšák
b478fcb9a9 st/mesa: simplify initialization of light_twoside
Core Mesa does this for us, see update_two_size in state.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-31 00:54:34 +01:00
Brian Paul
6e9a1650e5 mesa: consolidate general ubyte texstore code
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Brian Paul
4c7e44e8e6 mesa: use _mesa_pack_ubyte_rgba_rect() in texstore code
Simplifies the general case code in the ubyte-valued texture format
functions.  More consolidation to come in subsequent commits.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Brian Paul
66940ad2d7 mesa: added _mesa_pack_ubyte_rgba_rect()
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Eric Anholt
ff2497dca3 dri: Add a default drirc to be installed to provide application workarounds.
Specifially, this being present works around a bug in Unigine
Sanctuary on i965 which previously resulted in bad rendering.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:44:24 -08:00
Eric Anholt
642247883f i965: Add a driconf option to force GLSL extension behavior to "warn".
This can be used to work around broken application behavior, like in
Unigine where it attempts to use texture arrays without declaring
either "#extension GL_EXT_texture_array : enable" or "#version 130".

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:44:11 -08:00
Eric Anholt
b9e27cc142 mesa: Add a flag for forcing all GLSL extensions to "warn".
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:41:49 -08:00
Eric Anholt
61b9ccd9e2 intel: Use libdrm's decode functionality instead of the gpu-tools copy.
While typing out the new decode, I added a fallback mode for dumping
when we fail to re-map the BO after execution.  This should get us a
minimal dump when trying to dump a batch that results in a GPU hang.
2012-01-30 11:32:55 -08:00
Eric Anholt
493faa010d i965: Fix segfault with INTEL_DEBUG=batch on gen7 with samplers present.
This was a leftover from the conversion of this file for state streaming.
2012-01-30 11:32:55 -08:00
Eric Anholt
9195191e50 i965/vs: Avoid allocating registers in to the gen7 MRF hack region.
This is the corresponding fix to the previous one for the FS, but I
don't have a particular test for it.

NOTE: This is a candidate for the 8.0 branch.
2012-01-30 11:32:55 -08:00
Eric Anholt
e910241e97 i965/fs: Fix rendering corruption in unigine tropics.
We were allocating registers into the MRF hack region, resulting in
sparkly renering in a few of the scenes.  We could do better
allocation by making an MRF class, having MRFs conflict with the
corresponding GRFs, and tracking the live intervals of the "MRF"s and
setting up the conflicts.  But this is way easier for the moment.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:32:55 -08:00
Eric Anholt
b9aab8b3b3 autoconf: Enable missing-prototypes errors when available.
After the removal of the dri driver link test, this should help avoid
the original problem that it was designed to catch: The warning about
a missing prototype due to typoing a function name scrolling by in the
Mesa build spew, and you not noticing until you try to run an
application and it falls back to swrast.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:32:54 -08:00
Matt Turner
ef3cec5804 Rename R300_NO_TCL envvar to RADEON_NO_TCL
The envvar works for R100 and R200 too, and the classic R300 driver
doesn't even exist anymore.

"RADEON_NO_TCL" is already mentioned in the code and is the same envvar
used for the R300g driver.
2012-01-30 14:24:03 -05:00
José Fonseca
647ca47cc3 gallivm: Don't use C99 member initializers. 2012-01-30 19:05:58 +00:00
José Fonseca
dde807b9dc gallivm: Move declaration before code. 2012-01-30 18:59:29 +00:00
ojab
25ee5a27f3 Use only native engine & bitwriter LLVM libraries for linking.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-30 18:51:59 +00:00
Tom Stellard
bc2875aa48 gallivm: Add a new interface for doing TGSI->LLVM conversions
lp_bld_tgsi_soa.c has been adapted to use this new interface, but
lp_bld_tgsi_aos.c has only been partially adapted, since nothing in
gallium currently uses it.

v2:
- Rename lp_bld_tgsi_action.[ch] => lp_bld_tgsi_action.[ch]
- Initialize tgsi_info in lp_bld_tgsi_aos.c
- Fix copyright dates
2012-01-30 13:37:01 -05:00
Tom Stellard
82b71db03d gallium: Move duplicated helper macros to tgsi_exec.h 2012-01-30 13:37:00 -05:00
Tom Stellard
6b63e25b3d gallium: Prefix #defines in tgsi_exec.h with TGSI_ 2012-01-30 13:37:00 -05:00
Tom Stellard
9ee1bcf7a5 gallium: Unify defines of CHAN_[XYZW] in tgsi_exec.h 2012-01-30 13:37:00 -05:00
Tom Stellard
5204974462 gallivm: Add function lp_bld_gather_values() 2012-01-30 13:37:00 -05:00
Tom Stellard
df16945790 tgsi: Add output_mode to struct tgsi_opcode_info v2
v2:
- Rename output_type to output_mode
- Add shorthand definitions for TGSI_OUTPUT_*
2012-01-30 13:37:00 -05:00
Benjamin Franzke
c72d7df168 st/dri: Support 24bit formats in dri2_allocate_buffer
Prior commit 576161289d,
the parameter format was bpp, thus both 24bit and 32bit formats were
requested with format set to 32. Handle 24bit seperately now.

Fixes RGBX formats in wayland platform for egl_dri2 (EGL_ALPHA_SIZE=0).

Note: This is a candidate for the 8.0 branch.
2012-01-30 17:15:44 +01:00
Dave Airlie
fef395c0c3 mesa/format_unpack: add LUMINANCE 8/16 UINT/INT
This just copies what the LUMINANCE_ALPHA bits do.

Fixes piglit tests on softpipe complaining about missing unpack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 13:55:15 +00:00
Dave Airlie
29cf90b414 r600g: fix udiv/idiv/umod/imod on cayman
Cayman needs some of the MUL instructions spread across a full slot
of vectors.

It also no longer has RECIP_UINT, the recommendation is to replace it
with a U2F + RECIP_IEEE + MUL + F2U.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 13:53:15 +00:00
Dave Airlie
a33937d043 r600g: enable blend_bypass for uint/sint 2012-01-30 13:23:07 +00:00
Dave Airlie
cb40165974 r600g: fix fragcoord.w test on cayman 2012-01-30 13:23:07 +00:00
Marek Olšák
f9f8ce3ead r600g: remove unused streamout code 2012-01-30 01:27:25 +01:00
Marek Olšák
ce816dd831 r600g: disable printing debug info for streamout 2012-01-30 01:27:25 +01:00
Brian Paul
c946fc061a gallium: remove trailing comma to silence warning 2012-01-29 15:02:43 -07:00
Juan Zhao
03dae29472 add wayland cflags when building wayland-egl
to fix the header file missing when building wayland-egl
2012-01-29 16:51:27 +01:00
Christoph Bumiller
672ad90f54 nvfx,nv50,nvc0: handle PIPE_CAP_GLSL_FEATURE_LEVEL 2012-01-29 13:24:11 +01:00
Matt Turner
10c85526a2 dri: don't link with DRICORE_LIB_DEPS
DRI_LIB_DEPS is sufficient since it includes DRICORE_LIB_DEPS
2012-01-28 22:02:08 -05:00
Marek Olšák
335d49ef15 scons: don't add -Wmissing-field-initializers
The warning is absolutely useless. It doesn't actually say that there are
uninitialized variables. It points out the fact that there are missing
initializers and that variables are initialized to zero implicitly, which is
exactly what we want and what we commonly make use of.

C90 and C99 require all unspecified variables in the initializer list to be set
to zero.
2012-01-29 02:19:58 +01:00
Marek Olšák
41a4e274a4 st/mesa: use table-driven approach to exposing extensions for formats (v3)
The check for ctx->API was unnecessary, because OES extensions are not exposed
in desktop GL.

Also require renderbuffer support for ARB_texture_rgb10_a2ui,
as per the spec.

Tested by comparing old and new glxinfo with softpipe and r600g.

v2: fix bugs
v3: rename need_only_one -> need_at_least_one
    rename num_elements -> num_mappings
    add comments
    use const when appropriate

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-29 02:19:58 +01:00
Marek Olšák
c21d7b1e30 st/mesa: use table-driven approach to exposing extensions based on CAPs
This change is not exactly equivalent (sometimes we checked for non-zero,
sometimes if >0 or >1), but the behavior shouldn't change, because all drivers
report 0 for unsupported CAPs.

Exposing CAP_STREAM_OUTPUT_PAUSE_RESUME without CAP_MAX_STREAM_OUTPUT_BUFFERS
is a driver bug and st/mesa does no checking if the latter is supported as
well. Drivers must report CAPs consistently.

v2: make the array const
2012-01-29 02:19:57 +01:00
Marek Olšák
171be75522 st/mesa: add PIPE_CAP_GLSL_FEATURE_LEVEL, cleanup st_extensions.c
v2: handle the cap in r300 and r600 as well

Additional info for r600g:
   The env var R600_GLSL130=1 enables GLSL 1.3.
   Along with R600_STREAMOUT=1, it enables full GL 3.
2012-01-29 02:16:00 +01:00
Mathias Fröhlich
1d01429c6a state_stracker: Fix access to uninitialized memory.
Fix an access to uninitialized memory pointed out by valgrind in
glsl_to_tgsi_visitor::simplify_cmp(void).

Note: This is a candidate for the 8.0 branch.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-01-29 00:15:48 +01:00
Vinson Lee
743432039c draw: Remove unused variables.
Fix this GCC warning.
draw_pipe_clip.c: In function ‘interp’:
draw_pipe_clip.c:122:13: warning: variable ‘clip_dist’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-28 11:22:48 -08:00
Vadim Girlin
1a9d2b7642 r600g: fix linear and flat interpolation
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-28 16:20:37 +00:00
Yuanhan Liu
eaf360e5bf i965: fix inverted point sprite origin when rendering to FBO
When rendering to FBO, rendering is inverted. At the same time, we would
also make sure the point sprite origin is inverted. Or, we will get an
inverted result correspoinding to rendering to the default winsys FBO.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44613

NOTE: This is a candidate for stable release branches.

v2: add the simliar logic to ivb, too (comments from Ian)
    simplify the logic operation (comments from Brian)

v3: pick a better comment from Eric
    use != for the logic instead of ^ (comments from Ian)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-28 09:59:13 +08:00
Brian Paul
d250287d53 mesa: remove byteswap check in fast_read_rgba_pixels_memcpy()
It's handled by _mesa_format_matches_format_and_type() now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
07ff5adc32 mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb9_e5, r11_g11_b10f, argb2101010_uint functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
6f55ef3740 mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb332, signed rgba8888, signed rgba888_rev functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
453d4b40bc mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgba5551, argb1555, argb2101010 formats.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
f6af4c511f mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb565, argb8888, rgb888, argb4444 functions.
2012-01-27 18:21:45 -07:00
Brian Paul
b27792335e mesa: use _mesa_format_matches_format_and_type() in texstore code
This simplifies the code quite a bit, consolidates some cases and
possibly catches more cases for the memcpy path.

More such changes will follow.  Do just a few at a time to help bisect
any possible regressions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
94a0d38c24 mesa: implement more cases in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
51aab798a3 mesa: use swapBytes parameter in _mesa_format_matches_format_and_type()
This will let us use memcpy in more situations.  We can also remove
the checks for byte spapping that happen before the calls to
_mesa_format_matches_format_and_type().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
06aa607ba7 mesa: added swapBytes parameter to _mesa_format_matches_format_and_type()
Not actually used yet though.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
952ca07852 mesa: rewrite, simplify some of the logic in _mesa_format_matches_format_and_type()
In preparation for adding GL_PACK/UNPACK_SWAP_BYTES support.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
966720f507 mesa: add BGR888 code in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
b019228d6b mesa: fix error in _mesa_format_matches_format_and_type() for RGB888
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
370e5d2106 mesa: remove redundant byte swap check
The outer conditional already did the test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
343100d1fc mesa: remove LSB-first pixel packing check in glReadPixels
GL_UNPACK_LSB_FIRST only applies to bitmap data, not glReadPixels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Chad Versace
ab1195cf11 swrast: Fix implicit declaration warnings
In a recent commit,
    commit 1c0f1dd42a
    Author: Chad Versace <chad.versace@linux.intel.com>
    swrast: Fix fixed-function fragment processing
I defined a new function,_swrast_fragment_program, but neglected
to #include s_fragprog.h for clients of that function.

Note: This is a candidate for the 8.0 branch.
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27 16:53:51 -08:00
Alex Deucher
b8f7550a31 r600g: remove unsupported evergreen CB formats
The evergreen+ CB no longer supports the following formats
compared to 6xx/7xx:
- COLOR_4_4
- COLOR_3_3_2
- COLOR_6_5_5
- COLOR_8_24_FLOAT
- COLOR_24_8_FLOAT
- COLOR_11_11_10
- COLOR_11_11_10_FLOAT

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-27 18:46:03 -05:00
José Fonseca
3409118371 mesa: Avoid void * arithmetic.
Should fix MSVC build.
2012-01-27 21:54:12 +00:00
Chad Versace
1c0f1dd42a swrast: Fix fixed-function fragment processing
On i965, _mesa_ir_link_shader is never called. As a consequence, the
current fragment program (ctx->FragmentProgram->_Current) exists but is
invalid because it has no instructions. Yet swrast continued to attempt to
use the empty program.

To avoid using the empty program, this patch 1) defines a new function,
_swrast_use_fragment_program, which checks if the current fragment program
exists and differs from the fixed function fragment program, and, when
appropriate, 2) replaces checks of the form
    if (ctx->FragmentProgram->_Current == NULL)
with
    if (_swrast_use_fragment_program(ctx))

Fixes the following oglconform regressions on i965/gen6:
    api-fogcoord(basic.allCases.log)
    api-mtexcoord(basic.allCases.log)
    api-seccolor(basic.allCases.log)
    api-texcoord(basic.allCases.log)
    blend-separate(basic.allCases)
    colorsum(basic.allCases.log)

The tests were ran with the GLXFBConfig:
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x021 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24 8  0  0  0  0  0 0 None

(Note: I originally believed that the hunk in
_swrast_update_fragment_program was unnecessary. But it is required to fix
blend-separate.)

Note: This is a candidate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reveiwed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27 13:34:26 -08:00
Anuj Phogat
5665b5cc31 mesa: set clamp bit in glGetTexImage for GL_UNSIGNED_NORMALIZED
Color clamping should be enabled in glGetTexImage if texture dataType is
GL_UNSIGNED_NORMALIZED and format is GL_LUMINANCE or GL_LUMINANCE_ALPHA

Fixes 2 Intel oglconform test cases: pxconv-gettex and pxtrans-gettex
https://bugs.freedesktop.org/show_bug.cgi?id=40864

NOTE: This is a candidate for the 8.0 branch

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 13:22:52 -08:00
Eric Anholt
5f65598cc7 mesa: Don't round-trip integer texture data through a floating point temp.
This was losing bits of precision.  Fixes (with the previous commits):
piglit EXT_texture_integer/getteximage-clamping
piglit EXT_texture_integer/getteximage-clamping GL_ARB_texture_rg
oglc advanced.mipmap.upload

Regresses oglc negative.typeFormatMismatch.teximage from fail to
abort, because it's been hitting texstore for a format/type combo that
shouldn't happen.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:13 -08:00
Eric Anholt
dadbec1e90 mesa: When unpacking signed integer pixel data, don't clamp to 0.
In the core, we always treat spans of int/uint data as uint, so this
extract function was truncating storage of integer pixel data to a n
int texture to (0, max_int) instead of (min_int, max_int).  There is
probably missing code for handling truncation on conversion between
pixel formats, still, but this does improve things.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:11 -08:00
Eric Anholt
8b97bb02fb mesa: Add clamping for packing of integer data.
Mostly fixes piglit EXT_texture_integer/getteximage-clamping.  The
remaining failure involves precision loss on storing of int32 texture
data (something I knew was an issue, but wasn't trying to test).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:08 -08:00
Eric Anholt
de24ccabd6 mesa: Add missing format unpack for some integer texture formats.
This cut and paste is pretty awful.  I'm tempted to do a lot of this
using preprocessor tricks for customizing the parameter type from a
template function, but that's just a different sort of hideous.

Fixes 8 Intel oglconform int-textures cases.

NOTE: This is a candidate for the 8.0 branch.
v2: Add alpha formats, too.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:00:46 -08:00
Eric Anholt
3a8cf3357a i965: Don't allow rendering to non-GL_RED/RG/RGBA integer textures.
Fixes piglit EXT_texture_integer/fbo-blending.
2012-01-27 11:46:10 -08:00
Eric Anholt
796f44d779 intel: Pass the gl_renderbuffer to render_target_supported() vtable method.
I'm going to want to go looking at it for an integer texture fix.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
7cac88679b intel: Make a renderbuffer wrapping a texture have the same _BaseFormat.
Otherwise, when you asked for the _BaseFormat of an rb wrapping a
GL_RGB texture, you got GL_RGBA because that's what we were storing
the texture data as.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
b73f5df648 intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.
NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
74484c5d41 intel: Drop intel_wrap_miptree().
Most of this function was just calling
intel_renderbuffer_update_wrapper(), which was called immediately
afterwards in the only caller.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:09 -08:00
Eric Anholt
a4586d2e2e intel: Comment typo fix. 2012-01-27 11:46:09 -08:00
Eric Anholt
531e44415b mesa: Fix handling of glCopyBufferSubData() for src == dst.
Fixes piglit ARB_copy_buffer-overlap, on swrast, which previously
assertion failed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 11:44:31 -08:00
Eric Anholt
42e9936ce6 intel: Fix accum buffer mapping since the swrast rework.
A pure swrast-allocated buffer gets an irb of NULL, so we segfaulted
in the clear-accum test.  Just look at the swrast renderbuffer pointer
for handling swrast rbs.
2012-01-27 11:28:16 -08:00
Eric Anholt
3d8c27f882 mesa: Fix display list handling for GL_EXT_framebuffer_multisample.
From the extension spec:

    Added to section 5.4, as part of the discussion of which commands
    are not compiled into display lists:

    "Certain commands, when called while compiling a display list, are
    not compiled into the display list but are executed immediately.
    These are: ..., RenderbufferStorageMultisampleEXT..."

Fixes piglit EXT_framebuffer_multisample/dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 11:28:15 -08:00
Eric Anholt
25dd80555d mesa: Fix display list handling for EXT_framebuffer_object.
Noticed when handling a similar problem in EXT_framebuffer_multisample.

From the EXT_framebuffer_object spec:

    Added to section 5.4, as part of the discussion of which commands
    are not compiled into display lists:

    "Certain commands, when called while compiling a display list, are
    not compiled into the display list but are executed immediately.
    These are: ..., GenFramebuffersEXT, BindFramebufferEXT,
    DeleteFramebuffersEXT, CheckFramebufferStatusEXT,
    GenRenderbuffersEXT, BindRenderbufferEXT, DeleteRenderbuffersEXT,
    RenderbufferStorageEXT, FramebufferTexture1DEXT,
    FramebufferTexture2DEXT, FramebufferTexture3DEXT,
    FramebufferRenderbufferEXT, GenerateMipmapEXT..."

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 11:28:15 -08:00
Brian Paul
8b3c99a5eb gallivm: Swizzle constants into the right AoS ordering.
Constants array is always assumed to be RGBA, which means we need to
swizzle the constant elements into place to match the AoS ordering
(e.g., BGRA) that was passed to lp_build_tgsi_aos().

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-27 18:25:32 +00:00
José Fonseca
07635a4799 draw: Ensure that prepare is always run after LLVM garbagge collection.
Should avoid dangling pointer derreference with

  glean --run results --overwrite --quick --tests texSwizzle

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 18:24:14 +00:00
Jeremy Huddleston
b728eefb06 configure.ac: Don't use $CLANG since it will collide with the static analyzer.
We just prefix the $CLANG environment variable in configure.ac with acv_mesa_

Found by: tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 09:04:13 -08:00
Marek Olšák
3d993aff25 Revert "r600g: use S_028B20_BUFFER_0_EN macro for streamout buffer enable"
This reverts commit d6cd514edb.

It broke multiple streamout buffers, because it only enabled the first one.
2012-01-27 17:49:41 +01:00
Matt Turner
9895f77249 i965/automake: use $top_srcdir instead of relative links
Fixes out-of-tree builds.
2012-01-27 00:35:10 -05:00
Matt Turner
64afb575b0 dri common: add .gitignore 2012-01-27 00:16:33 -05:00
Matt Turner
0c17823167 configure.ac: remove shared/static options
now that libtool provides them.
2012-01-26 19:36:52 -05:00
Matt Turner
80aa78142d dri: make sure to build libdricommon.la 2012-01-26 19:32:16 -05:00
Eric Anholt
c885039442 i965: Drop the missing symbols link test.
This was horribly broken and has cost everyone more time than we were
ever going to save using it.  It might have been fixable, but the
problem it was originally trying to solve can be better solved with
-Werror=missing-prototypes and -Werror=implicit-function-declaration.

Also, it was always producing a big scary warning about how the link
test was non-portable.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44928
2012-01-26 16:14:55 -08:00
Eric Anholt
1237a56916 nouveau: Fix missing dri common symbols after automake conversion. 2012-01-26 16:14:35 -08:00
Eric Anholt
5fa27eafc8 radeon: Fix missing dri common symbols after automake conversion.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 16:14:32 -08:00
Eric Anholt
45389caf05 dri: Move the compile of the common files to a convenience library.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 16:14:22 -08:00
Eric Anholt
29ea1c4461 i915: Fix driver after automakeification. 2012-01-26 16:13:39 -08:00
Kenneth Graunke
259b65e2e7 i965/vs: Use the sampler for VS pull constant loading on Ivybridge.
Substantially increases performance in GLBenchmark PRO:
- 320x240   => 3.28x
- 1920x1080 => 1.47x
- 2560x1440 => 1.27x

The LD message ignores the sampler unit index and SAMPLER_STATE pointer,
instead relying on hard-wired default state.  Thus, there's no need to
worry about running out of sampler units or providing SAMPLER_STATE;
this small patch should be all that's required.

NOTE: This is a candidate for release branches.
      (It requires the preceding commit to compile.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-26 23:53:54 -08:00
Kenneth Graunke
5f4575d42f i965: Expose brw_set_sampler_message for use outside brw_eu_emit.c.
brw_SAMPLE is full of complex workarounds for original Broadwater
hardware, and I'd rather avoid all that for my next Ivybridge patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-26 23:53:46 -08:00
Brian Paul
04341e51ce svga: reset vertex buffer offset in svga_release_user_upl_buffers()
This function releases the buffer that contains user-space vertex data.
The buffer_offset field points into that buffer.  So reset the
buffer_offset to zero when we release the buffer so that subsequent
draws don't inadvertantly get a bad offset.

Fixes error messages / failed assertions (in the draw module's bounds/size
checking code) when running piglit's polygon-mode test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-26 11:38:30 -07:00
José Fonseca
6549e721ad mapi: Make initMagic unsigned.
To avoid signed/unsigned comparison warnings against INIT_MAGIC
0xff8adc98, which doesn't fit on signed integers.
2012-01-26 17:33:33 +00:00
José Fonseca
1d1033926d scons: Remove references to u_thread.c
For future reference: always run "git grep" on refactorings.
2012-01-26 17:29:38 +00:00
Matt Turner
b7a81b6e51 Fix visibility of u_thread functions by inlining them
-fvisibility=hidden was preventing them from being exported, which
combined with shared-glapi was causing undefined symbol errors at
runtime.

We don't want to make these functions part of the ABI, and given
how simple they are, we simply inline them.
2012-01-26 12:05:33 -05:00
Brian Paul
0a966a686e nouveau: include s_context.h to silence missing prototype warnings 2012-01-26 08:16:54 -07:00
Brian Paul
88e7f56dd7 swrast: silence uninitialized var warnings 2012-01-26 08:16:33 -07:00
Lucas Stach
5ce7418739 nvfx: fix nv3x fallout from state validation changes
From c998f732d42da5e962fe5da294493132c3e8dc5f Mon Sep 17 00:00:00 2001
From: Lucas Stach <dev@lynxeye.de>
Date: Tue, 24 Jan 2012 09:46:32 +0100
Subject: [PATCH] nvfx: fix nv3x fallout from state validation changes

Apparently nv3x needs some curde hacks to work properly. This
is clearly not the right fix, but it's the behaviour of the old
code and fixes regressions seen by users.
2012-01-26 14:15:29 +01:00
Benjamin Franzke
1b417e1767 gbm: Add back link flags for udev, dl and glapi
They were left out when migrating to automake.
2012-01-26 13:23:25 +01:00
Benjamin Franzke
412042523e configure: Use WAYLAND_SCANNER_RULES only if available
This has the drawback that when creating configure for
distribution, wayland needs to be available for the packager.

Also the the macros has the wayland prefix hardcoded, so
we cant copy it in mesa right now.
2012-01-26 11:49:47 +01:00
Jakob Bornecrantz
b6d3a435a0 draw: Only run prepare when state, prim and opt changes
In bad applications like ipers which does a lot of draw calls with
no state changes this helps to greatly reduce time spent in prepare.
In ipers around 7% of CPU was spent in various prepare functions,
after this commit no prepare function show on the profile.

This commit also has the added benefit of now grouping all pipelined
drawing into a single draw call if the driver uses vbuf_render.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:46 -08:00
Jakob Bornecrantz
eb65ccbc21 draw: Don't revalidate pipeline on backend flushes
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:40 -08:00
Jakob Bornecrantz
4a79545bdf draw: Remove reduced_prim
Conflicts:

	src/gallium/auxiliary/draw/draw_context.c

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:36 -08:00
Benjamin Franzke
8b902056d5 automake: src/egl/wayland
So we can use the wayland scanner makro, which is way
better than our previous runtime-pkgconfig hack.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 10:07:11 +01:00
Paul Berry
dc435ae774 i965/gen6/GT1: Increase max_vs_entries to 256.
Previously, max_vs_entries was set to 128 for GT1, and 256 for GT2,
based on the PRM (see Vol2, part1, p28).  However, Bspec section 1.6.5
indicates that the maximum number of VS entries is 256 for GT1.

No piglit regressions on GT1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-25 09:43:14 -08:00
Paul Berry
6bc08ee569 i965/gen6: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
When storing data in a buffer of type DYNAMIC_DRAW, we don't create a
drm_intel_bo for it; instead we store the data in system memory and
defer allocation of the GPU buffer until it is needed.  Therefore, in
brw_update_sol_surface(), we can't just consult the "buffer" field of
the intel_buffer_object structure; we need to call
intel_bufferobj_buffer() to ensure that the deferred allocation
occurs.

This parallels a similar fix for gen7 (see commit ba6f4c9).

Fixes piglit test EXT_transform_feedback/buffer-usage on gen6.

This is a candidate for the 8.0 release branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-25 09:42:49 -08:00
Ander Conselvan de Oliveira
33f8a3cfbe gbm: fix copy & paste error in gbm_bo_get_handle documentation 2012-01-25 12:21:37 -05:00
José Fonseca
4ac37b0b81 mesa/st: Assign inputsRead at right (previous) location.
Fixes the

  src/mesa/state_tracker/st_glsl_to_tgsi.cpp:4032:src_register: Assertion `t->inputMapping[index] < (sizeof(t->inputs)/sizeof(*(t->inputs)))' failed.

assertion failure introduced in 697b9945fb
2012-01-25 13:48:18 +00:00
Marek Olšák
69c8f468ba mesa: remove ctx->Const.sRGBCapable
It always had the same value as ctx->Extensions.EXT_framebuffer_sRGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-25 12:35:37 +01:00
Marek Olšák
8ec05f06cb r600g: handle start_component from stream_output_info when possible 2012-01-25 12:35:20 +01:00
Marek Olšák
15146fd1bc r600g: don't expose transform_feedback2 without kernel support 2012-01-25 12:35:19 +01:00
Marek Olšák
3363e87d7d mesa: allow exposing GL3 without EXT_texture_integer
Strictly speaking, it's not legal to expose EXT_texture_integer without
EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4
is available without checking for it).

The check in compute_version is removed as well, because that's already
covered by GLSLVersion >= 130.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
636802f615 mesa: add missing integer alpha formats to _mesa_base_fbo_format
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
0cf0418363 st/mesa: require all s3tc formats for EXT_texture_compression_s3tc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
925fd2e1dd st/mesa: simplify enabling EXT_packed_depth_stencil and ARB_fbo
- use OR to combine bind flags
- combine both conditionals into one
- move the ARB_fbo enable where it belongs

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
95dab55751 mesa: remove obsolete comment in version.c
Pointed out by Brian Paul.
2012-01-25 12:35:19 +01:00
Marek Olšák
fc878cf7a4 gallium/docs: document more CAPs 2012-01-25 12:35:19 +01:00
Marek Olšák
c2b800cf38 r600g: nuke the fallback for vertex and fragment color clamping 2012-01-25 12:35:19 +01:00
Marek Olšák
7023ed9e62 r300g: nuke the fallback for fragment color clamping 2012-01-25 12:35:19 +01:00
Marek Olšák
697b9945fb st/mesa: inline if(1) conditional
v2: fix typo
2012-01-25 12:35:18 +01:00
Marek Olšák
732f69c94e st/mesa: move fragment shader tgsi tokens into st_fp_variant
The TGSI code may vary depending on the clamp_color bit.
2012-01-25 12:35:18 +01:00
Marek Olšák
bc1c836938 st/mesa: do vertex and fragment color clamping in shaders
For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
the perfect place for a fallback.
The exceptions are:
- r500 (vertex clamp only)
- nv50 (both)
- nvc0 (both)
- softpipe (both)

We also have to take into account that r300 can do CLAMPED vertex colors only,
while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
with the two new CAPs.
2012-01-25 12:35:18 +01:00
Christian König
c2e2b58a58 st/xvmc: remove xorg-server dependency
Fixing a circular build dependency.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-25 10:34:26 +01:00
Benjamin Franzke
36fb83e4a8 st/mesa: Fix recurring surfaceless contexts
A current incomplete framebuffer was incorrectly used as a
st_framebuffer. When accessing st_framebuffer childs bad things happen:
e.g. st_framebuffer::iface was used to check whether its an incomplete
fb, instead we need to compare st_framebuffer::Base against
mesa_get_incomplete_framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44919
Note: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 10:12:09 +01:00
Eric Anholt
422b18794e mesa: Fix CopyTex{Sub,}Image error checks for integer vs non-integer.
Fixes Intel oglconform negative.typeFormatMismatch.copyteximage.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
ee9804af14 mesa: Add missing integer R/RG cases to _mesa_is_color_format().
This is part of fixing Intel oglconform
negative.typeFormatMismatch.copyteximage.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
6bf0f6ae86 meta: Detect currently-unsupported integer CopyTexSubImage and complain.
This code is unprepared for handling integer (particularly, the
baseFormat of the TexFormat comes out as GL_RGBA, not GL_RGBA_INTEGER,
so the direct call of Driver.ReadPixels crashes due to the int vs
non-int error checking not having happened).  I'm frankly tempted to
convert this code to MapRenderbuffer/MapTexImage rather than doing it
as meta ops, now that we have that support.

Improves the remaining crash in Intel oglconform for int-textures to
just a rendering failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
d6c58545a1 mesa: Add the remaining from/to types for GL_EXT_texture_integer (and R/RG).
This aborts and crashes in intel oglconform's int-textures into being
just rendering failures.  Clamping isn't handled yet.

v2: Add missing "break".
v3: Drop the int/uint distinction, since they don't need different clamping.
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com> (v2)
2012-01-24 16:35:47 -08:00
Eric Anholt
08acd4bd61 mesa: Add support for glGetTexImage on GL_TEXTURE_1D_ARRAY
Similarly to how we handle this in texstore, we have to remap height
to depth so that we MapTextureImage each image layer individually.

Fixes part of Intel oglconform's int-textures advanced.fbo.rtt

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:34:02 -08:00
Eric Anholt
86ca4f9cb6 mesa: s/GLuint col/GLint col/ to avoid signed/unsigned comparison warnings.
Suggested-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:23:22 -08:00
Eric Anholt
9f1e64d085 mesa: Add support for glGetTexImage() from integer textures.
This is a step toward fixing Intel oglconform's
int-textures advanced.fbo.rtt.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:23:22 -08:00
Eric Anholt
f6e82cd2a1 i965/gen6+: Work around GPU hangs with logic ops on integer textures.
This doesn't result in correct rendering -- GL requires that logic ops
work, while the hardware specs say it doesn't do them.  I'm not sure
how we would want to handle this.

NOTE: This is a candidate for the 8.0 branch.
2012-01-24 16:20:21 -08:00
Eric Anholt
04b4880d7c i965/gen6+: Disable blending, alpha test, and dither on integer FBOs.
Fixes GPU hangs and some rendering failures in piglit
EXT_texture_integer/fbo-blending

NOTE: This is a candidate for the 8.0 branch.
2012-01-24 16:00:04 -08:00
Brian Paul
4a1c660599 mesa/gdi: remove wmesa_set_renderbuffer_funcs() function
The code is no longer relevant.
Note: this driver is probably broken now.  There's no implementation
of ctx->Driver.Map/UnmapRenderbuffer().
2012-01-24 15:13:20 -07:00
Brian Paul
a9bf149e7f dri/swrast: remove obsolete swrast_span.c file from source list 2012-01-24 15:08:20 -07:00
Brian Paul
ba151a333b swrast: fix uninitialized variable warning 2012-01-24 14:12:39 -07:00
Brian Paul
cf386f0a2b swrast: make rowStride variable signed in put_z32_values()
As with commit aed5c8299f
2012-01-24 14:12:38 -07:00
Brian Paul
89bb19adb0 intel: use swrast code to map/unmap renderbuffers for swrast rendering 2012-01-24 14:12:38 -07:00
Brian Paul
4baf90353d mesa: update comments, fix whitespace in dd.h 2012-01-24 14:12:38 -07:00
Brian Paul
9403cc3aba swrast: remove unused StoreTexel code
No longer needed since we do all rendering to texture with the buffer
mapping and pixel packing functions.
2012-01-24 14:12:37 -07:00
Brian Paul
1caf698191 swrast: use Map/UnmapTextureImage() in framebuffer map/unmap code
When we're actually rendering into a texture, map the texture image
instead of the corresponding renderbuffer.  Before, we just copied
a pointer from the texture image to the renderbuffer.  This change
will make the code usable by hardware drivers.
2012-01-24 14:12:37 -07:00
Brian Paul
56d83ac4bf mesa: remove ctx->Driver.Map/UnmapTexture() hooks
No longer used anywhere.
2012-01-24 14:12:37 -07:00
Brian Paul
8b8a54afd9 nouveau: stop calling ctx->Driver.Map/UnmapTexture()
And remove unused nouveau_texture_map/unmap()
2012-01-24 14:12:36 -07:00
Brian Paul
4bbab2275f tnl: remove ctx->Driver.Map/UnmapTexture() calls
ctx->Driver.MapTexture() always points to _swrast_map_texture().
We're already reaching into swrast from t_vb_program.c anyway.
This will let us remove the ctx->Driver.Map/UnmapTexture() functions.
2012-01-24 14:12:36 -07:00
Brian Paul
bde356a158 swrast: move some renderbuffer functions to s_renderbuffer.c 2012-01-24 14:12:35 -07:00
Brian Paul
1839a7fc9f intel: remove intel_span_supports_format()
It always returned True.
2012-01-24 14:12:34 -07:00
Brian Paul
6c1e27ba21 swrast: remove a few extra _mesa_get_format_bytes() calls 2012-01-24 14:12:34 -07:00
Brian Paul
1da7d6c919 mesa: update comments for gl_renderbuffer 2012-01-24 14:12:33 -07:00
Brian Paul
1888dd52a3 mesa/swrast/drivers: remove obsolete gl_renderbuffer fields
This removes the last of the legacy fields from gl_renderbuffer.
2012-01-24 14:12:33 -07:00
Brian Paul
becbb64313 dri/swrast: use swrast_renderbuffer type 2012-01-24 14:12:33 -07:00
Brian Paul
0c1862851f swrast: use swrast_renderbuffer instead of gl_renderbuffer 2012-01-24 14:12:32 -07:00
Brian Paul
797c18be1f osmesa: use swrast_renderbuffer 2012-01-24 14:12:32 -07:00
Brian Paul
c080202db5 radeon: derive radeon_renderbuffer from swrast_renderbuffer 2012-01-24 14:12:31 -07:00
Brian Paul
9f8ed9d662 intel: derive intel_renderbuffer from swrast_renderbuffer
Drivers that rely on swrast need to do this, as with swrast_texture_image.
2012-01-24 14:12:31 -07:00
Brian Paul
d16e71eeb4 xlib: derive xmesa_renderbuffer from swrast_renderbuffer 2012-01-24 14:12:31 -07:00
Brian Paul
f2479530b8 swrast: allocate swrast_renderbuffers instead of gl_renderbuffers 2012-01-24 14:12:30 -07:00
Brian Paul
34988272d9 swrast: new swrast_renderbuffer type
This will let us move the swrast-specific fields out of gl_renderbuffer.
2012-01-24 14:12:30 -07:00
Brian Paul
924de7dc96 intel: use intel_rb_format() to get renderbuffer format
This will make future changes cleaner and less invasive.
2012-01-24 14:12:29 -07:00
Brian Paul
1048d55d5f dri/swrast: rename swrast_renderbuffer to dri_swrast_renderbuffer
To prevent name collision with future swrast_renderbuffer in the swrast
module.
2012-01-24 14:12:29 -07:00
Brian Paul
c45771905f swrast: use stencil packing function in s_stencil.c 2012-01-24 14:12:28 -07:00
Brian Paul
881ef2a9db swrast: use color packing functions in s_span.c 2012-01-24 14:12:28 -07:00
Brian Paul
8696a52102 swrast: remove s_spantemp.h 2012-01-24 14:12:27 -07:00
Brian Paul
b0f0d7a811 xlib: remove xm_span.c and related code 2012-01-24 14:12:27 -07:00
Brian Paul
59a5b5a193 mesa: remove gl_renderbuffer::Wrapped
There's no such thing as renderbuffer wrappers anymore.
2012-01-24 14:12:27 -07:00
Brian Paul
ab331140c6 swrast: rewrite, simplify the the render-to-texture code 2012-01-24 14:12:26 -07:00
Brian Paul
7a36345f70 mesa: rename gl_renderbuffer::Data to Buffer
To better indicate that this pointer to the malloc'd memory.
2012-01-24 14:12:26 -07:00
Brian Paul
f6a3979a04 mesa: move freeing of software renderbuffers into swrast 2012-01-24 14:12:25 -07:00
Brian Paul
f9874feef4 mesa: remove gl_renderbuffer::DataType 2012-01-24 14:12:24 -07:00
Brian Paul
1e1b5cb01a mesa: remove gl_renderbuffer:RowStride field 2012-01-24 14:12:24 -07:00
Brian Paul
82846fea4d mesa: finally, remove the GetRow/PutRow/etc functions 2012-01-24 14:12:23 -07:00
Brian Paul
304f7a1327 dri: remove all the obsolete spantmp files 2012-01-24 14:12:23 -07:00
Brian Paul
a4c6dedb27 radeon: remove obsolete GetRow/PutRow code 2012-01-24 14:12:22 -07:00
Brian Paul
f892debdc2 nouveau: remove obsolete GetRow/PutRow code 2012-01-24 14:12:21 -07:00
Brian Paul
41869c4942 intel: remove most of the span Get/PutRow code 2012-01-24 14:12:21 -07:00
Brian Paul
cb5fa9ea62 dri/swrast: remove obsolete GetRow/PutRow code 2012-01-24 14:12:20 -07:00
Brian Paul
2873555a76 osmesa: remove obsolete GetRow/PutRow code 2012-01-24 14:12:19 -07:00
Brian Paul
2e80c7e5bf xlib: remove obsolete GetRow/PutRow code 2012-01-24 14:12:18 -07:00
Brian Paul
0d2f0c8bb8 mesa: remove obsolete PutRow, etc assignments 2012-01-24 14:12:17 -07:00
Brian Paul
d65bbfa947 swrast: remove Get/PutRow()-related code 2012-01-24 14:12:16 -07:00
Brian Paul
a4a566a610 st/mesa: remove gl_renderbuffer::GetPointer stuff 2012-01-24 14:12:16 -07:00
Brian Paul
0ff817f200 swrast: stop using Put/GetRow/Values() in swrast code
All color buffer rendering is now done by accessing mapped renderbuffer
memory.  We're now able to get rid of all the GetRow/PutRow stuff.
2012-01-24 14:12:15 -07:00
Brian Paul
b766d4bb43 swrast: use gl_renderbuffer::StrideInBytes in depth/stencil code 2012-01-24 14:12:15 -07:00
Brian Paul
7d1ddec921 mesa: use gl_renderbuffer::Map for all depth/stencil accesses
Instead of using the obsolete gl_renderbuffer::Data field.
Color buffer are still accessed through GetRow/PutRow().
2012-01-24 14:12:14 -07:00
Brian Paul
14da67d9b9 intel: make intel_renderbuffer_map/unmap() static 2012-01-24 14:12:13 -07:00
Brian Paul
827c1d66f6 mesa: add new gl_renderbuffer fields
These are temporary, actually, but they'll make follow-on work easier to
implement in a step-by-step manner.  Eventually the Map and RowStrideBytes
fields will go into a new swrast_renderbuffer type, but adding that type
now would involve touching a _lot_ of code that'll eventually be removed.

The fields marked as obsolete will go away completely at some point.
2012-01-24 14:12:12 -07:00
Brian Paul
fc9f74839d swrast: flush pending rendering before unmapping buffers 2012-01-24 14:12:12 -07:00
Brian Paul
33257803d9 swrast: new assertions in _swrast_pixel_address() 2012-01-24 14:12:11 -07:00
Brian Paul
e34a54ff45 swrast: use _swrast_pixel_address() in more places 2012-01-24 14:12:11 -07:00
Brian Paul
bd3c10c0f0 swrast: s/Data/Map/ in swrast_texture_image
To indicate that it points to mapped texture memory.
2012-01-24 14:12:10 -07:00
Brian Paul
ecb8594c18 swrast: remove gl_renderbuffer::DataType check in DrawPixels()
The field will be going away so update this code.
2012-01-24 14:12:09 -07:00
Brian Paul
7726be1c1b swrast: remove gl_renderbuffer::DataType assertions
This field will go away, so remove some uses of it.
2012-01-24 14:12:09 -07:00
Brian Paul
ca6d86d26b st/mesa: remove gl_renderbuffer:DataType assignments
That field is only used by swrast code so there's no reason to mess
with it in the gallium state tracker.

This also lets us remove the unused st_format_data() type function and
related code.
2012-01-24 14:12:08 -07:00
Brian Paul
ff57b0f037 swrast: make _swrast_get_values(), _swrast_get_row() static
They were only called from in s_span.c
2012-01-24 14:12:07 -07:00
Brian Paul
267fb17884 swrast: remove dstType param from _swrast_read_rgba_span()
It was always GL_FLOAT.
2012-01-24 14:12:06 -07:00
Brian Paul
64be85540f swrast: remove unused _swrast_put_row() 2012-01-24 14:12:05 -07:00
Ian Romanick
34c353ce46 mesa: Don't resurrect deleted ARB VAOs in glPopClientAttrib
When ARB VAOs are used, glPopClientAttrib does not resurrect a deleted
VAO or VBO.  This difference between the two spec is, unfortunately,
not very well spelled out in the specs.

Fixes oglc vao(advanced.pushPop.deleteVAO) and
vao(advanced.pushPop.deleteVBO) tests.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Ian Romanick
0963990153 mesa: Rename gl_array_object::VBOonly to ::ARBsemantics
There are more differences between Apple and ARB than just requiring
that all arrays be stored in VBOs.  Additional uses will be added in
following commits.

Also, set the flag at Bind time instead of Gen time.  The ARB_vao spec
specifies that behavior.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Ian Romanick
9be3be3c66 swrast: Use fixed-function processing instead _TexEnvProgram for DrawPixels
This is a hack to work around drivers such as i965 that:

    - Set _MaintainTexEnvProgram to generate GLSL IR for
      fixed-function fragment processing.
    - Don't call _mesa_ir_link_shader to generate Mesa IR from the
      GLSL IR.
    - May use swrast to handle glDrawPixels.

Since _mesa_ir_link_shader is never called, there is no Mesa IR to
execute.  Instead do regular fixed-function processing.

Even on platforms that don't need this, the software fixed-function
code is much faster than the software shader code.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44749
2012-01-24 12:30:57 -08:00
Ian Romanick
34db7a8c1e mesa: Make sure _TexEnvProgram points at the current ff fragment program
At least one place, the _mesa_need_secondary_color function in
state.h, uses this to make decisions.  The next patch in this series
will add another dependency.  Ideally, this field would go away and be
replace by a flag or something.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-24 12:30:52 -08:00
Brian Paul
3e01c3f3ba softpipe: move var initialization to silence warning 2012-01-24 11:15:43 -07:00
Brian Paul
64cb0cae55 r600g: remove unused variable 2012-01-24 11:15:23 -07:00
Alexander von Gluck
873f3ae92e glsl: Don't use newlocale on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:42 -07:00
Alexander von Gluck
02a1f9f14d mesa: Don't use newlocale on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:41 -07:00
Alexander von Gluck
32876a452f svga: fix typedef conflicts on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:41 -07:00
Alexander von Gluck
1550b0668e llvmpipe: fix symbol conflict on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:40 -07:00
Alexander von Gluck
bca6cd2d71 scons: Remove Haiku one-offs for gallium drivers
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:40 -07:00
Michel Dänzer
7219af5ec1 gallium/postprocess: Proper reference counting of pp_jimenezmlaa depth buffer.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40776

NOTE: This is a candidate for the stable branches.
2012-01-24 17:57:56 +01:00
Matt Turner
027ce0c493 Revert "Always build shared glapi"
This reverts commit adefee50d9.

Shared glapi was never tested with --enable-xlib-glx and turns out
to cause a lot of problems.

Conflicts:

	configure.ac
2012-01-24 11:34:42 -05:00
Matt Turner
a208468e04 gbm: install libgbm.so into lib
This partially reverts commit 90e2568534.
2012-01-24 11:32:02 -05:00
Adam Jackson
fba8257f6a llvmpipe: Fix math error in LP_DEBUG=counters output
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-24 10:51:15 -05:00
Vadim Girlin
738334e80c r600g: fix inconsistency with INTERP* opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:31 -05:00
Vadim Girlin
65c0f77bcc r600g: replace raw opcodes with names in the is_alu_trans/vector
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:28 -05:00
Vadim Girlin
315cf30607 r600g: add missing opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:26 -05:00
Vadim Girlin
d89c96c75d r600g: fix loop break/continue operations
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-24 21:33:24 +10:00
Vadim Girlin
c4d644bac1 r600g: fix fragcoord.w
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-24 21:33:24 +10:00
Benjamin Franzke
468c7ea2ac targets/gbm: Fix install path
GBM_BACKEND_INSTALL_DIR was deleted by commit
06ad64ad29.
Since we dont need this configurable, use $(INSTALL_LIB_DIR)/gbm now.
2012-01-24 10:12:59 +01:00
Benjamin Franzke
ab52be6826 gbm/Makefile.template: Remove builtin-compile path
Builtins are handled by the main gbm Makefile since
06ad64ad29.
2012-01-24 10:00:52 +01:00
Benjamin Franzke
90e2568534 egl,gbm_gallium: Fix linkage against gbm from automake
Add src/gbm/.libs to ldflags.
The gbm lib is src/gbm/.libs/ instead of lib/
as of commit 06ad64ad29.
2012-01-24 10:00:52 +01:00
Vadim Girlin
5a84cc4ebc r600g: fix interpolation with clipvertex
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-24 08:24:58 +00:00
Chad Versace
aed5c8299f swrast: Fix unsigned promotion in pointer arithmetic
When rowstride was negatie, unsigned promotion caused a segfault here:

299│    if (rb->Format == MESA_FORMAT_S8) {
300│       const GLuint rowStride = rb->RowStride;
301│       for (i = 0; i < count; i++) {
302│          if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
303├>            stencil[i] = *(map + y[i] * rowStride + x[i]);
304│          }
305│       }
306│    }

Fixes segfault in oglconform
separatestencil-neu(NonPolygon.BothFacesBitmapCoreAPI),
though test still fails.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-23 17:44:52 -08:00
Ian Romanick
b48d4b64e9 meta: Fallback for glBlitFramebuffer from a multisample surface
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44818
2012-01-23 15:17:45 -08:00
Paul Berry
e2274aa739 i965/vs: Fix bogus assertion in emit_block_move()
i965 processes assignments of whole structures using
vec4_visitor::emit_block_move, a recursive function which visits each
element of a structure or array (to arbitrary nesting depth) and
copies it from the source to the destination.  Then it increments the
source and destination register numbers so that further recursive
invocations will copy the rest of the structure.  In addition, it sets
the swizzle field for the source register to an appropriate value of
swizzle_for_size(...) for the size of each element being copied, so
that later optimization passes won't be fooled into thinking that
unused vector elements are live.

This all works fine.  However, emit_block_move also contains an
assertion to verify, before setting the swizzle field for the source
register, that the source register doesn't already contain a
nontrivial swizzle.  The intention is to make sure that the caller of
emit_block_move hasn't already done some swizzling of the data before
the call, which emit_block_move would then counteract when it
overwrites the swizzle field.  But the assertion is at the lowest
level of nesting of emit_block_move, which means that after the first
element is copied, instead of checking the swizzle field set by the
caller, it checks the swizzle field used when moving the previous
element.  That means that if the structure contains elements of
different vector sizes (which therefore require different swizzles),
the assertion will erroneously fire.

This patch moves the assertion from emit_block_move to the calling
function, vec4_visitor::visit(ir_assignment *).  Since the caller is
non-recursive, the assertion will only happen once, and won't be
fooled by emit_block_move's modification of the swizzle field.

This patch also reverts commit fe006a7 (i965/vs: Fix swizzle related
assertion), which attempted to fix the bug by making the assertion
more lenient, but only worked properly for structures, arrays, and
matrices in which each constituent vector is the same size.

This fixes the problem described in comment 9 of
https://bugs.freedesktop.org/show_bug.cgi?id=40865.  Unfortunately, it
doesn't fix the whole bug, since the test in question is also failing
due to lack of register spilling support in the VS.

Fixes piglit test vs-assign-varied-struct.  No piglit regressions on
Sandy Bridge.

This is a candidate for the 8.0 release branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40865#c9
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 14:45:08 -08:00
Alex Deucher
c9cd170f2e r600g: clean up register headers
- CP_INTERRUPT packet doesn't exist
- remove lots of r6xx copy/paste remnants from evergreen reg header
- fix some cayman specific registers

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-23 16:44:53 -05:00
Eric Anholt
3353626a6a i965/vs: Enable workaround-free math on gen7.
This is similar to a commit that did the same for the FS.

Shaves several more instructions off of the VS in Lightsmark, but no
statistically significant performance difference (n=5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 12:51:03 -08:00
Eric Anholt
1fde76b877 i965/vs: Use the embedded-comparison SEL on gen6+, like the FS does.
Shaves a few instructions off of the VS in Lightsmark, but no
statistically significant performance difference on gen7 (n=5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 12:50:54 -08:00
Matt Turner
06ad64ad29 automake: src/gbm
libgbm.so.1.0.0 (instead of libgbm.so.1.0) is installed now
along with libgbm.so.1 (no change).
2012-01-23 15:18:12 -05:00
Eric Anholt
36473395f1 autoconf: Fix build of dri symbols test to not manually link expat.
AC_CHECK_LIB has this nasty behavior, like the cflags tests, of
automatically putting the tested value into the global LIBS on
success.  This caused -lexpat to end up in LIBS, but without the
--with-expat dir, so my 32-bit build on a 64 system using expat from a
custom prefix could only find the system expat and fail to link on the
one current consumer of the LIBS variable: the dri driver test link.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 11:34:05 -08:00
Kenneth Graunke
c25e5300cb i965: Fix border color on Sandybridge and Ivybridge.
While reading through the simulator, I found some interesting code that
looks like it checks the sampler default color pointer against the bound
set in STATE_BASE_ADDRESS.  On failure, it appears to program it to the
base address itself.

So I decided to try programming a legitimate bound, and lo and behold,
border color worked.

+92 piglits on Sandybridge.  Also fixes Lightsmark on Ivybridge.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-23 10:38:14 -08:00
Jon TURNEY
4e5a8937d1 Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi"
Since we now always build shared glapi, this exposes the fact that libOSMesa was
underlinked when glapi was built shared.

Fix this by doing the same thing as drivers/X11/Makefile already does, ensuring
that the library is linked with the shared glapi library.

(I'm not clear why we link with both glapi.a and glapi.so, so this may be all wrong)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-23 18:24:39 +00:00
Jon TURNEY
0fce6d3a77 Don't build shared dricore when unneeded
Refine "always build shared dricore" so we don't build it if we don't need
it because we aren't actually building any dri drivers because of --disable-driglx-direct

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-23 18:17:48 +00:00
Dave Airlie
d01e166391 r600g: cayman fix integer multiplies
Looks insane, but it does appear we need a full slot per input/output.

This fixes another 180 or so piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 13:59:57 +00:00
Dave Airlie
f01431d035 r600g: cayman initial integer support
Adds all the easier lowhanging opcodes.

Fixes ~3000 piglit tests with GLSL1.30 enabled on cayman.

This just leaves the mul/div/mod ops to fix up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 12:26:19 +00:00
Vadim Girlin
13daa059c0 r600g: fix VS fog export
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 10:01:35 +00:00
Matt Turner
4c84819a1b dri: install dri_interface.h
Broken in commit 129213e7.

Reported-by Kai Wasserbäch <kai@dev.carbon-project.org>
2012-01-22 17:16:02 -05:00
Dave Airlie
b9c706c8c5 r600g: shift integer ops are trans unit only on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:25:38 +00:00
Vadim Girlin
9733a89f6d r600g: replace trans/vector-only instruction lists with ranges (v2)
airlied : assert on cayman cases to keep compiler happy

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:13:00 +00:00
Dave Airlie
38ffc23e7b Revert "r600g: replace trans/vector-only instruction lists with ranges"
This reverts commit 946309067c.

Until we check the cayman bits out properly
2012-01-22 17:09:54 +00:00
Dave Airlie
a9d8809f16 r600g: srgb mode is only valid on certain format types.
"If set, forces degamma on XYZ if format is
FMT_8_8_8_8, FMT_BC1, FMT_BC2, or FMT_BC3"

Don't claim support for sRGB on any other formts.

This fixes glean texture_srgb.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:53:46 +00:00
Dave Airlie
9783bba9bd r600g: initial cube shadow sampling
It doesn't pass the piglit test, but it seems to be a lot closer
than it was before. I need to track down if there is another problem.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:17:47 +00:00
Vadim Girlin
840a342cd0 r600g: take into account kcache banks for bank swizzle check
Due to the changes for multiple kcache banks support, now we are assigning
final SRCx_SEL values for kcache access at the later stage, when building the
bytecode. So we need to take into account kcache banks to distinguish
the constants with the same address but different bank index.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin
60bf0f05b4 r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin
946309067c r600g: replace trans/vector-only instruction lists with ranges
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Vadim Girlin
cb15783364 r600g: fix some interpolation tests for evergreen
Same fix as previously done by Dave Airlie for r600/r700

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Matt Turner
fd827a8d3e configure.ac: use AC_PROG_MKDIR_P
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45057
2012-01-21 22:43:54 -05:00
Matt Turner
d387899388 Remove src/mesa/ppc
It didn't actually do anything except modify the GL_RENDERER string.
2012-01-21 22:43:54 -05:00
Andrei Slăvoiu
309ba0cfa2 Fix mistake in 349845f7b 2012-01-21 11:36:26 -05:00
Vadim Girlin
54e8dcaad6 r600g: implement clip vertex v2
Clip planes are uploaded as a constant buffer and used by the vertex
shader to produce corresponding clip distances for hw clipping.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Vadim Girlin
d649bf51ec r600g: improve kcache line sets handling v2
Add support for multiple kcache banks (constant buffers).
Lock the required lines only.
Allow up to 4 kcache line sets in the alu clause by using ALU_EXTENDED on eg+.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Dave Airlie
261dc72fe3 r600g: no need to do CUBE coordinate handling for TXQ.
Fixes texSize on cube.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 22:17:25 +10:00
Vadim Girlin
8b1471f8ca r600g: make INTERP_LOAD_P0 vector-only
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 11:07:22 +00:00
Vinson Lee
e9bcf4d56b glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning on non-debug builds.
glsl_types.cpp: In member function 'gl_texture_index
glsl_type::sampler_index() const':
glsl_types.cpp:157: warning: control reaches end of non-void function

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-20 23:53:59 -08:00
Alex Deucher
d6cd514edb r600g: use S_028B20_BUFFER_0_EN macro for streamout buffer enable
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 18:06:37 -05:00
Alex Deucher
90b36b50f5 r600g: update streamout support for virtual addresses
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 18:06:37 -05:00
Matt Turner
687a7302a5 Remove reference to now deleted dri/Makefile.targets 2012-01-20 16:54:12 -05:00
Matt Turner
129213e7a2 automake: src/mesa/drivers/dri 2012-01-20 15:54:08 -05:00
Matt Turner
349845f7b2 automake: src/mesa/drivers/dri/swrast 2012-01-20 15:54:08 -05:00
Matt Turner
3f96434f86 automake: src/mesa/drivers/dri/nouveau 2012-01-20 15:54:08 -05:00
Matt Turner
b38d7a0a24 automake: src/mesa/drivers/dri/r200 2012-01-20 15:54:08 -05:00
Matt Turner
e0ee818e2f automake: src/mesa/drivers/dri/radeon 2012-01-20 15:54:08 -05:00
Matt Turner
3c87dfce40 automake: src/mesa/drivers/dri/i915 2012-01-20 15:54:08 -05:00
Vadim Girlin
c60dcc49e4 r600g: fix streamout on evergreen
Enable it in the evergreen_context_draw if needed.
Same as already done in the r600_context_draw for r6xx/r7xx.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 15:10:39 -05:00
Vadim Girlin
c97632642a r600g: fix combined MEM_STREAM instructions
BURST_COUNT is clipped with ARRAY_SIZE, so set it to the max value
to avoid clipping.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 15:09:42 -05:00
Matt Turner
2b3a8cbc89 Always build shared dricore
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:42 -05:00
Matt Turner
adefee50d9 Always build shared glapi
libglapi.so, libGL.so, libGLESv2.so, libGLESv1_CM.so must all
come from the same version of Mesa or bad things may happen.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:42 -05:00
Matt Turner
2fdbbeca43 Remove -ffast-math from default CFLAGS
Fixes glsl-const-folding-01. inversesqrt(1.0) != 1.0 was evaluating as
true.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:14 -05:00
Chad Versace
ba5252e590 intel/gen6: Some framebuffers having separate depthstencil should be unsupported
When the framebuffer has separate depth and stencil buffers, and HiZ is
not enabled on the depth buffer, mark the framebuffer as unsupported. This
happens when trying to create a framebuffer with Z16/S8 because we haven't
enabled HiZ on Z16 yet.

Fixes gles2conform test stencil8.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44948
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed--by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-20 10:37:19 -08:00
Chad Versace
f74d8aacbf mesa: Loosen glBlitFramebuffer restrictions on depthstencil buffers (v2)
This loosens the format validation in glBlitFramebuffer. When blitting
depth bits, don't require an exact match between the depth formats; only
require that the two formats have the same number of depth bits and the
same depth datatype (float vs uint). Ditto for stencil.

Between S8_Z24 buffers, the EXT_framebuffer_blit spec allows
glBlitFramebuffer to blit the depth and stencil bits separately. So I see
no reason to prevent blitting the depth bits between X8_Z24 and S8_Z24 or
the stencil bits between S8 and S8_Z24. However, we of course don't want
to allow blitting from Z32 to Z32_FLOAT.

Fixes Piglit fbo/fbo-blit-d24s8 on Intel drivers with separate stencil
enabled.

The problem was that, on Intel drivers with separate stencil, the default
framebuffer has separate depth and stencil buffers with formats X8_Z24 and
S8. The test attempts to blit the depth bits from a S8_Z24 buffer into the
default framebuffer.

v2: Check that depth datatypes match.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44665
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-20 10:35:49 -08:00
Christoph Bumiller
ab69d584f9 nvc0: fix some limit cap values
NOTE: This is a candidate for the 8.0 branch.
2012-01-20 19:24:31 +01:00
Christoph Bumiller
0d27be3d79 nvc0: handle discontiguous outputs in stream_output_info 2012-01-20 19:24:31 +01:00
Christoph Bumiller
d540af554a mesa: allocate transform_feedback_info::Outputs array dynamically
The nvc0 gallium driver is advertising 128 MAX_INTERLEAVED_COMPS
which made it always assert in the linker when TFB was used since
the Outputs array was smaller than that maximum.

v2: added assertions

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-20 19:24:31 +01:00
Dave Airlie
c96b983403 r600g: fixup AR handling (v5)
So it appears R600s (except rv670) do AR handling different using a different
opcode. This patch fixes up r600g to work properly on r600.

This fixes ~100 piglit tests here (in GLSL1.30 mode) on rv610.

v3: add index_mode as per the docs.

This still fails any dst relative tests for some reason I can't quite see yet,
but it passes a lot more tests than without.

v4: add a nop after dst.rel this could be improved using a second pass,
where we only insert nops if two instructions are sure to collide.
The docs say r600, rv610, rv630 needs this, and not rv670, rs780, rs880,
need AMD to confirm rv620, rv635.

v5: add is_nop_inst.

NOTE: This is a candidate for stable branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-20 17:58:53 +00:00
Brian Paul
0e019cbd1c mesa: include arrayobj.h to silence implicit function declaration warning
Caused by commit 7a1e941ebe.
2012-01-20 10:55:18 -07:00
Mathias Fröhlich
7a1e941ebe mesa: Fix and speedup gl_array_object::_MaxElement computation.
Use a bitmask approach to compute gl_array_object::_MaxElement.
To make this work correctly depending on the shader type actually used,
make use of the newly introduced typed bitmask getters.
With this change I gain about 5% draw time on some osgviewer examples.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:20 +01:00
Mathias Froehlich
2a207c4bf9 mesa: Introduce enabled bitfield helper functions.
Depending on the installed shader type, different arrays are used
from gl_array_object. Provide helper functions that compute
the bitmask of these arrays that are finally enabled for a given
shader type. The will be used in a followup change.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:11 +01:00
Mathias Fröhlich
f60e892c50 mesa: Use BITFIELD64_RANGE for VERT_BIT_*_ALL.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:05 +01:00
Stéphane Marchesin
63dbd3fefb i915g: Fix indentation. 2012-01-19 19:27:34 -08:00
Stéphane Marchesin
2f9df215a2 i915g: Fix indentation and comment. 2012-01-19 19:27:34 -08:00
Paul Berry
4f82fed493 glsl: Fix isinf() for non-C99-compliant compilers.
Commit ede60bc467 (glsl: Add isinf() and
isnan() builtins) uses "+INF" in the .ir file to represent infinity.
This worked on C99-compliant compilers, since the s-expression reader
uses strtod() to read numbers, and C99 requires strtod() to understand
"+INF".  However, it didn't work on non-C99-compliant compilers such
as MSVC.

This patch modifies the s-expression reader to explicitly check for
"+INF" rather than relying on strtod() to support it.

This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44767
Tested-by: Morgan Armand <morgan.devel@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-19 18:45:22 -08:00
Alex Deucher
5e576efef2 r600g: fix typo in evergreen register
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-19 21:09:20 -05:00
Brian Paul
7f2e12812a svga: move svga_texture() casts/calls in svga_surface_copy()
To fix failed assertions when calling glCopyBufferSubData().

svga_texture() asserts that the resource is a texture.  Simply move the
calls to svga_texture() after the code that handles non-texture copies
so that we don't call it with non-texture resources.

Fixes glean bufferObject failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 16:23:12 -07:00
Brian Paul
fdae0eaf22 st/mesa: copy num_immediates field when copying the immediates array
Two assignments to num_immediates were missing in
get_pixel_transfer_visitor() and get_bitmap_visitor().
The uninitialized value led to valgrind errors and crashes in some
cases.

Added new assertions to catch future problems in this area.  Also
changed num_immediates to unsigned to avoid signed/unsigned
comparison warnings.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 15:12:14 -07:00
Ian Romanick
f0ea46790f mesa: Set default access flags based on the run-time API
The default access flags for OpenGL ES (via GL_OES_map_buffer) and
desktop OpenGL are different.  The code previously tried to handle
this, but the decision was made at compile time.  Since the same
driver binary can be used for both OpenGL ES and desktop OpenGL, the
decision must be made at run-time.

This should fix bug #44433.  It appears that the test case does
various map and unmap operations and inspects the state of the buffer
object around each.  When it sees that GL_BUFFER_ACCESS does not match
its expectations, it fails.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44433
2012-01-19 09:34:01 -08:00
Brian Paul
75f37ddba7 st/mesa: add fallback pipe formats for (compressed) R, RG formats
If we don't find an exact PIPE_FORMAT_x for a GL_(COMPRESSED)_RED/RG format,
try uncompressed formats.  We were already doing this for the RGB(A) formats.

Fixes piglit arb_texture_compression-internal-format-query test.

NOTE: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 09:41:30 -07:00
Stéphane Marchesin
32b07bb149 i915g: Don't avoid flushing when we have a pending fence.
Otherwise the fence will never arrive.
Also check for a NULL i915->batch.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 19:25:41 -08:00
Stéphane Marchesin
2b4afdba05 i915g: Don't invert signalled/unsignalled fences
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 19:25:41 -08:00
Kenneth Graunke
dcdfd1905c i965: Fix disassembly of data port writes on Ivybridge.
msg_type moved by a bit, so the message type was being disassembled
incorrectly.  In particular, render target writes were showing up as
"OWORD block write".

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 14:42:04 -08:00
Kenneth Graunke
a608be5d33 i965: Fix disassembly of sampler messages on Ivybridge.
Compared to sampler_gen5, simd_mode shifted by a bit and msg_type grew
by a bit.  So we were printing slightly incorrect numbers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 14:42:04 -08:00
Kenneth Graunke
2e712e41db i965/vs: Take attributes into account when deciding urb_entry_size.
Both the VF and VS share space in the URB.  First, the VF stores
attributes (shader inputs) there.  The VS then reads the attributes,
executes, and reuses the space to store varyings (shader outputs).

Thus, we need to calculate the amount of URB space necessary for inputs,
outputs, and pick whichever is greater.

The old VS backend correctly did this (brw_vs_emit.c:408), but the new
VS backend only considered outputs.

Fixes vertex scrambling in GLBenchmark PRO on Ivybridge.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41318
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-18 14:42:04 -08:00
Stéphane Marchesin
81da773f84 st/dri: Remove useless flush front.
In the following scenario:
- CreateContext C1
- MakeCurrent C1
- DestroyContext C1 (does not actually destroy the first context, postponed
 until the next MakeCurrent)
 - CreateContext C2
 - MakeCurrent C2
MakeCurrent will call flush on a half destroyed context, leading to crashes.
Since the other paths (destroy and makecurrent) already flush the context,
there is no need to flush here, so we remove this useless flush front call.

This fixes GPU crashes with Chrome and gallium drivers.
2012-01-18 13:22:27 -08:00
Ian Romanick
8a47242755 intel: Set depth to 6 for cubemaps
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41216
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43212
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43250
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Jin Yang <jin.a.yang@intel.com>
2012-01-18 12:48:37 -08:00
Kristian Høgsberg
221c678329 gbm: Validate usage flags in gbm_bo_create_from_egl_image()
The entry point is supposed to validate that the EGLImage is suitable for
the passed in usage flags, but that was never implemented.
2012-01-18 15:32:51 -05:00
Eric Anholt
2f868f1ddd i965: Add support for Z16 depth formats.
v2: Don't flag the format as being HiZ ready (there's DRI2 handshake
    pain to go through).

Fixes piglit gl-3.0-required-sized-texture-formats

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:36 -08:00
Eric Anholt
f0d5c92a4c i965/gen7: Set up surface horizontal alignment field.
This is required for Z16 support for texturing, which is the first
thing to have a horizontal alignment of 8.  Renderbuffers don't need
it, since they're always set up as the only mip level, but do it for
completeness anyway.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:36 -08:00
Eric Anholt
fc767ff590 i965/gen7: Remove stale comment.
This field is actually set up above.

NOTE: This is a candidate for the 8.0 branch, to avoid conflicts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:21 -08:00
Eric Anholt
aad3a46ff4 glsl: Fix leak of linked uniform names at relink/free of the shader_program.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
5a0f395bcf glsl: Fix leak of LinkedTransformFeedback.Varyings.
I copy-and-pasted the thing I was allocating for as the context, so
the first time it would be NULL (root of a ralloc context) and they'd
chain off each other from then on.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
0f68d88034 mesa: Fix leak of uniform storage records on shader program link/free.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
cbd464a117 i965: Fix leak of the program cache BO on context destroy.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
7f278e15ad i965/vs: Fix leak of an empty hash_table structure per compile.
This statement got duplicated above, probably in a rebase resolution,
so we never freed the extra one.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
b2be486962 i965: Fix refcount leak of the gl_program structure.
Fixes a leak of almost 200kb on a minimal shader_runner program
(algebraic-add-add-1).

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
b972744c78 mesa: Make the register allocator allocation take a ralloc context.
This fixes a memory leak on i965 context destruction.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:11 -08:00
Brian Paul
a9eda41539 svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0
The legal range for the device is apparently [-16.0, +15.0].
Limiting the range to [-15, +15] fixes piglit's lodbias test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
fd890873b2 svga: fix min/max lod clamping
The interaction between the mipmap lod min/max limits and the texture
base/max level limits is kind of tricky.  Changing the base level
didn't work as expected before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
5abcd198b8 svga: add 0.5 in float->int conversion of sample min/max lod
This makes lod clamping more consistent with other drivers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
84c7c14697 st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers
when mapping renderbuffers or texture images.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 10:44:05 -07:00
Brian Paul
64fdfefb9d mesa: use GL_MAP_INVALIDATE_RANGE_BIT in glTexImage paths
Update the dd.h docs to indicate that GL_MAP_INVALIDATE_RANGE_BIT
can be used with GL_MAP_WRITE_BIT when mapping renderbuffers and
texture images.

Pass the flag when mapping texture images for glTexImage, glTexSubImage,
etc.  It's up to drivers whether to actually make use of the flag.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-18 10:44:05 -07:00
Brian Paul
1d7048f12e mesa: try RGBA_FLOAT16 before RGBA_FLOAT32 when choosing A,L,LA,I formats
To try to use less tex memory and maybe get better performance.
Spotted by Roland Scheidegger.

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
7628696004 mesa: fix tex format selection for GL_R32F and other R/G float formats
The i965 driver advertises GL_ARB_texture_float and GL_ARB_texture_rg
support but the ctx->TextureFormatSupported[] table entries for
MESA_FORMAT_R_FLOAT32 and MESA_FORMAT_RGBA_FLOAT32 are false on gen 4
hardware.  So the case for GL_R32F would fail and we'd print an
implementation error.

This patch adds more Mesa tex format options for GL_R32F and other R/G
formats so we fall back to 16-bit formats when 32-bit formats aren't
available.

Eric made the same fix in commit 6216a5b4 for the non R/G formats.

v2: try 16-bit formats before 32-bit formats and try RG formats before
RGBA where possible.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=44039

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
481011ffcd docs: add more potential dependencies for vmware guest driver 2012-01-18 10:44:05 -07:00
Alexander von Gluck IV
5481b5adcf scons: Add more machine architectures to the machine map
* BePC, BeBox, BeMac for Haiku.
* Add sparc architecture as Mesa looks for it.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 16:46:16 +00:00
Dave Airlie
0196433ce5 r600g: fix ISLT on r600/700
This fixes ISLT like evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 22:14:49 +10:00
Dave Airlie
5893e686b6 r600g: make r600/700 use correct ineg.
Noticed by Vadim Girlin on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 21:54:07 +10:00
Dave Airlie
1fc001ea15 r600g: fix some of the interpolation tests.
This enables linear gradients if we need a linear,
it also sets the flat shade flag for color/constant interpolations.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 20:13:16 +10:00
Kenneth Graunke
5acc7f38d4 i965: Bump Ivybridge's fake MRF range to g112-127 instead of g111-126.
When I originally implemented the hack to use GRFs 111+ as fake MRFs, I
did so purely to avoid rewriting all the code that dealt with MRFs.
However, it turns out that a similar hack is actually required.

Newly discovered language in the BSpec indicates that SEND instructions
with EOT set "should" use g112-g127 as their source registers.  Based on
assertions in the simulator, this is actually a requirement on certain
platforms.

Since we're faking MRFs already, we may as well use the officially
sanctioned range.  My guess is that we avoided this issue because we
seldom use m0: URB writes in the new VS backend start at m1, and RT
writes in the new FS backend start at m2.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-18 00:45:01 -08:00
Kenneth Graunke
bdedd03b70 i965: Remove the INTEL_OLD_VS option.
Now that we no longer generate Mesa IR from GLSL IR, it's impossible to
use the old vertex shader backend for GLSL programs.  There's simply no
Mesa IR to codegen from.

Any attempt to do so would result in immediate GPU hangs, presumably due
to the driver uploading an empty program with no EOT message.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-18 00:45:00 -08:00
Kenneth Graunke
d56ad273c0 mesa: Support GL_VERTEX_ATTRIB_ARRAY_INTEGER in GL 3.0 contexts.
According to Table 6.8 (Page 348) in the OpenGL 3.0 specification,
glGetVertexAttribiv supports GL_VERTEX_ATTRIB_ARRAY_INTEGER.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 00:45:00 -08:00
Vadim Girlin
b69728cba5 r600g: fix UINT_TO_FLT on evergreen
It should be processed as trans-only.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 08:03:41 +00:00
Chad Versace
a6dd4bf5fc i965/gen5: Fix rendering of depth buffers without stencil [v2]
Fixes the following OGLConform tests on gen5:
    depth-stencil(misc.state_on.depth_int)
    fbo_db_ARBfp(basic.OnlyDepthBuffDrawBufferRender)

The problem was that, if the depth buffer's Mesa format was X8_Z24, then
we emitted the hardware format D24_UNORM_X8. But, on gen5, D24_UNORM_S8
must be emitted.

This bug was introduced by:
    commit d84a180417
    Author: Eric Anholt <eric@anholt.net>
    i965: Base HW depth format setup based on MESA_FORMAT, not bpp.

v2: Deref 'intel' directly. Move the branch for newer chipset to top.
    Quote the PRM. As requested by Ken.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43408
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 17:26:45 -08:00
Anuj Phogat
ce1c949b16 intel: Return if pointer to intel_context is null
It is better to test if(intel == NULL) and simply return in that case.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 16:58:38 -08:00
Alex Deucher
46ce25722b r600g: add workaround for original R600 PS setup
The original R600 requires the UNCACHED_FIRST_INST bit
to be set in the PS.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is candidate for the stable branches.
2012-01-17 18:46:46 -05:00
Paul Berry
c03ad08e8d i965: Add .gitignore file to exclude automake build artifacts from git.
With the conversion to automake in commit
e326480e4e, several additional build
artifacts are created:

  src/mesa/drivers/dri/i965/.deps/
  src/mesa/drivers/dri/i965/.libs/
  src/mesa/drivers/dri/i965/Makefile
  src/mesa/drivers/dri/i965/Makefile.in
  src/mesa/drivers/dri/i965/i965_dri.la
  src/mesa/drivers/dri/i965/i965_symbols_test

This patch adds all of these files to .gitignore.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-17 15:44:26 -08:00
Anuj Phogat
f1a9a9bcd1 mesa: Add condition in glGetTexImage for zero size textures
TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D()
with width = 0. Texture with zero size skips miptree allocation due to a
condition in function _mesa_store_teximage3d(). While calling glGetTexImage()
it results in assertion failure in intel_map_texture_image() due to null mt
pointer.

This patch fixes the issue by detecting the zero size texture early in
glGetTexImage and glGetCompressedTexImage functions. In such a case function
simply returns doing nothing.
Verified that below mentioned bug is fixed by this patch.

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

NOTE: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-17 15:14:44 -08:00
Alex Deucher
94556f3594 radeon: share common fog code between radeon and r200
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-17 18:09:25 -05:00
Alex Deucher
e77c495d09 radeon: fix fog coordinate emit
Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-01-17 18:03:28 -05:00
Alex Deucher
afdd6f8c34 r200: fix fog coordinate emit
Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-01-17 18:03:28 -05:00
Dave Airlie
ba59a1a0d8 r600g: fix recip_uint on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 06:53:02 +10:00
Vadim Girlin
7383e754b7 r600g: fix USLT for r600-eg 2012-01-17 15:25:12 -05:00
Alexander von Gluck IV
183133271c scons: Don't set visibility to hidden on Haiku
The Haiku swrast driver is out of tree.
2012-01-17 20:02:41 +00:00
Alexander von Gluck IV
64ae209d50 scons: Add Haiku build support
Enables building stock Mesa under the Haiku operating system.
2012-01-17 20:01:14 +00:00
Vadim Girlin
4ba4853c0a r600g: rework IDIV/UDIV and implement MOD/UMOD (v2)
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-17 19:53:20 +00:00
Eric Anholt
7fa5c919b0 mesa: Enable silent automake rules when available.
Finally, a quiet build for the i965 driver, at least!  (Note, you can
still get verbose builds at build-time by saying "make V=1")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-17 10:35:24 -08:00
Eric Anholt
e326480e4e i965: Convert the build to using automake.
This does introduce a warning by the automake build system, that the
missing-symbols test build is non-portable.  That's true -- Mac OS X
can't take something built as a loadable module and just link it as a
library.  Of course, we aren't building this on OS X at all, so it
would be nice to be able to suppress it, but I haven't found a way.

Still, the build is going to be much quieter than we have ever had
before, so I think this is a fair tradeoff until we find a way to shut
that warning up.

v2: Put a link in /lib to avoid transition pains for people.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2012-01-17 10:35:24 -08:00
Eric Anholt
a14582d7e2 intel: Drop the version override code now that we don't have any left.
Fixes a compiler warning.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 10:35:24 -08:00
Eric Anholt
ccf0d31a21 intel: Fix warnings of undefined ffs().
For some reason these started showing up with the automake conversion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 10:35:24 -08:00
Scott Moreau
e0897009f8 Complete ARGB8888 naming convention format renames missed 2012-01-17 10:36:12 -05:00
Chad Versace
7e08bf08d1 i965: Fix gen6,gen7 when used with a non-HiZ capable DDX
Nothing works if HiZ is enabled and the DDX is incapable of HiZ (that is,
the DDX version is < 2.16).

The problem is that the refactoring that eliminated
intel_renderbuffer::stencil_rb broke the recovery path in
intel_verify_dri2_has_hiz().  Specifically, it broke line
intel_context.c:1445, which allocates the region for
DRI_BUFFER_DEPTH_STENCIL. That allocation was creating a separate stencil
miptree, despite the buffer being a packed depthstencil buffer. Havoc
ensued.

This patch introduces a bool flag that prevents allocation of that stencil
miptree.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44103
Tested-by: Ian Romanick <idr@freedesktop.org>
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-16 16:38:36 -08:00
Vinson Lee
8e543cc098 softpipe: Silence unused variable warning on non-LLVM builds.
Fix this GCC warning with non-LLVM builds.
sp_screen.c: In function ‘softpipe_get_shader_param’:
sp_screen.c:141:28: warning: unused variable ‘sp_screen’ [-Wunused-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-16 16:13:51 -08:00
Anuj Phogat
dd7220652e intel: Fix segfault in glXSwapBuffers with no bound context
Calling glXSwapBuffers with no bound context causes segmentation
fault in function intelDRI2Flush. All the gl calls should be
ignored after setting the current context to null. So the contents
of framebuffer stay unchanged. But the driver should not seg fault.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44614

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Yi Sun <yi.sun@intel.com>
2012-01-16 15:07:17 -08:00
Vinson Lee
6fe133889c llvmpipe: Remove unused variable 'packed' from lp_test_round.
Fix this GCC warning.
lp_test_round.c: In function ‘test_round’:
lp_test_round.c:126:13: warning: variable ‘packed’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-16 12:44:06 -08:00
Vinson Lee
eeff1ee746 util: Silence GCC unused-but-set-variable warning.
Fix this GCC 4.6 warning with 64-bit builds.
u_debug_stack.c: In function ‘debug_backtrace_capture’:
u_debug_stack.c:45:17: warning: variable ‘frame_pointer’ set but not
used [-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-16 12:41:55 -08:00
José Fonseca
455090c4c4 vl: Make array initialization portable.
Should fix MSVC build.
2012-01-16 12:21:40 +00:00
Stéphane Marchesin
23d4a0569d i915g: Fix the blending for the A8 destination buffer case.
The i915 GPU can't do A8 dst, so we abuse GREEN8 buffers for that
purpose. However, things get hairy as we start to do blending,
because then GL_DST_*_ALPHA should be replaced with GL_DST_*_COLOR.
This is what we do here.

Fixes piglt fbo-alpha.
2012-01-15 23:39:49 -08:00
Matt Turner
6e9478e382 r200: remove left-over EGL_SOURCES variable
Rest was removed in 2a928899e.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-15 12:09:52 -05:00
Dave Airlie
850021f225 r600g: fix mullo_uint trans slot only on r600/r700
This fixes 8 piglit tests that currently assert.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:53:41 +00:00
Vadim Girlin
91d4729696 r600g: implement clip distances
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:19:42 +00:00
Vadim Girlin
725a820b92 r600g: implement two-sided lighting (v3)
v2: select the colors in the pixel shader

v3: fix rs state creation for pre-evergreen

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:19:41 +00:00
Vadim Girlin
d84ab821c5 r600g: add support for ISHR/USHR/SHL on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin
332e1d6d84 r600g: implement IDIV/UDIV on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin
42539d569a r600g: implement ISSG on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
6b44470bb2 r600g: implement IABS on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
beb297f284 r600g: implement F2U on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
5d97c5033b r600g: add FLT_TO_UINT opcode for evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Vadim Girlin
a9302de4a3 r600g: fix F2I on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Christian König
2eabd05b75 vl: fix YV12 handling
We actually implemented YV21 instead of YV12, so fix the plane ordering.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
020a6f6cd8 st/vdpau: recreate video buffer if decode doesn't like it
Recreate the video buffer if the decoder can't handle it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
4a4811ea17 st/vdpau: recreate video buffer if format doesn't match
Recreate the video buffer in PutBitsYCbCr if the format doesn't match.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
9d9afcb5ba vl: reintroduce PIPE_VIDEO_CAP_PREFERED_FORMAT
Create the video buffers in the format the driver preffers.
This temporary creates problems with decoder less VDPAU video playback.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
d6aa0ad55d vl: add h264 infrastructure
No implementation so far, just the defines for
VDPAUs picture info structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
8ea416f35d vl: move away from state like parameters
Again based on Maartens work, but keep begin_frame
and end_frame functions for now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
9af70c90db vl/video_buffer: add support for interlaced buffers
Add the infrastructure, but not the decode implementation.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
12b49ca2df vl/video_buffer: improve constructor
Add a second extened constructor that takes plane
textures for the video buffer. Also provide a
function for texture templates.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
e027759336 vl/video_buffer: use template style create params
Just like in the rest of gallium, this reduces the
number of parameters significantly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Dave Airlie
39491d1d31 r600g: vertex id support.
This requires GLSL 1.30 enabled, which requires integer types enabled,
so don't bother doing an INT to FLT conversion on it.

We should probably remove the instance id flt->int conversion when
turning on native integers.

this passes the three piglit tests with GLSL 1.30 forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 08:17:38 +00:00
Dave Airlie
9a401a2fd6 r600g: make u2f trans only
as per the r600 isa doc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 08:17:38 +00:00
Lucas Stach
c82879a071 nvfx: random cleanups of the state validation code
Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:39:47 +01:00
Lucas Stach
bf8daf1c0a nvfx: drop render temporaries code
This code is unneeded now, we don't use render temps any more.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:39:05 +01:00
Lucas Stach
f428ae6f72 nvfx: rework state_fb code to get rid of render temps
This commit rewrites a lot of the state_fb code to support
rendering to targets not aligned to 64 byte.

This allows us to drop the render temporaries as unaligned
targets are the only use-case where they are really needed. The
temporaries code was used for a lot of things more, but apparently
those also work without temps.

There is one regression in piglit fbo-clear-formats, but this will
be fixed with the use of real hardware clears and doesn't matter in
practice as no real application tries to scissor clear a 2x2 pixel
render target.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:37:41 +01:00
Lucas Stach
7f918683c4 nvfx: say no to stream output caps
nvfx doesn't support any kind of stream out, so silence the
unused cap warnings.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:37:03 +01:00
Marek Olšák
5596db7411 mesa: update compute_version for GL3
only check ARB_fbo, add shader_texture_lod as a requirement

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-15 07:29:48 +01:00
Marek Olšák
2449695e82 gallium: improve the pipe_stream_output_info struct (v2)
There are 3 changes:

1) stride is specified for each buffer, not just one, so that drivers don't
   have to derive it from the outputs

2) new per-output property dst_offset, which specifies the offset
   into the buffer in dwords where the output should be stored,
   so that drivers don't have to compute the offsets manually;
   this will also be useful for gl_SkipComponents
   from ARB_transform_feedback3

3) register_mask is removed, instead, there is start_component
   and num_components; register_mask with non-consecutive 1s
   doesn't make much sense (some hardware cannot do packing of components)

Christoph Bumiller: fixed nvc0.

v2: resolve merge conflicts in Draw and clean it up
2012-01-15 07:28:35 +01:00
Dave Airlie
faa90abfe0 r600g: add r600 version of UINT_TO_FLT conversion.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 22:03:28 +00:00
Dave Airlie
bfcffd4d72 r600g: fix r600 f2i to be trans only emitted.
This fixes a lot of asserts about the trans unit being used already.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 19:59:51 +00:00
Dave Airlie
55bd1c8365 r600g: add missing case for uint->flt conversion.
fixes some piglits like vs-decrement-uint.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:50:43 +00:00
Dave Airlie
5250bd00c0 r600g: add missing r32 uint/sint fbo formats.
Fixes the GL3 required formats test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:42:42 +00:00
Jerome Glisse
bb1f0cf350 r600g: add support for virtual address space on cayman v11
Virtual address space put the userspace in charge of their GPU
address space. It's up to userspace to bind bo into the virtual
address space. Command stream can them be executed using the
IB_VM chunck.

This patch add support for this configuration. It doesn't remove
the 64K ib size limit thought this limit can be extanded up to
1M for IB_VM chunk.

v2: fix rendering
v3: fix rendering when using index buffer
v4: make vm conditional on kernel support add basic va management
v5: catch the case when we already have va for a bo
v6: agd5f: update on top of ioctl changes
v7: agd5f: further ioctl updates
v8: indentation cleanup + fix non cayman
v9: rebase against lastest mesa + improvement from Marek & Michel
v10: fix cut/paste bug
v11: don't rely on updated radeon_drm.h

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-13 18:00:53 -05:00
Roland Scheidegger
6c2c2c5a07 scons: Fix libGL.so build. 2012-01-13 22:39:14 +01:00
Brian Paul
548526f2e9 docs: add links to xf86-video-vmware wiki pages 2012-01-13 13:46:27 -07:00
Chad Versace
e13c99a004 i965: Comment gen6_hiz_get_framebuffer_enum()
Make the comments precise. Explain why each branch is needed and correct.
Document the potential pitfall in the true-branch.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-13 10:26:01 -08:00
Neil Roberts
9462b84478 gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES
When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer
with GL_DRAW_FRAMEBUFFER will report a 'user error' because
get_framebuffer_target validates that this enum from the framebuffer
blit extension is only used on GL. To work around it this patch makes
it use the GL_FRAMEBUFFER enum instead in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43418
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-13 10:06:30 -08:00
Brian Paul
27915708ed docs: new page describing how to build, install VMware SVGA3D guest driver 2012-01-13 10:54:58 -07:00
Brian Paul
b0af16abf1 mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()
The AL44 format occupies one byte, not two.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-13 09:51:28 -07:00
Brian Paul
540a8b2cfd osmesa: fix renderbuffer format selection
The gl_renderbuffer::Format field wasn't always set properly.  This
didn't matter much in the past but with the recent swrast/renderbuffer
mapping changes, core Mesa will be directly touching OSMesa colorbuffers
so using the right MESA_FORMAT_x value is important.

Unfortunately, there aren't MESA_FORMATs for all the possible OSmesa
format/type combinations, such as GL_FLOAT / OSMESA_ARGB.  If anyone
runs into these we can add new Mesa formats.

v2: add warnings for unsupported formats, fix ARGB_REV mix-up.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-13 09:50:33 -07:00
Brian Paul
0c14bbbc86 docs: freshen up the introduction page with Mesa 8.0 info, etc 2012-01-13 09:50:33 -07:00
Tom Stellard
9611237051 gallivm: Allow target specific intrinsics in lp_declare_intrinsic()
Target specific intrinsics are also prefixed with llvm, so this assert
was preventing us from using them.
2012-01-13 11:45:49 -05:00
Rob Bradford
baab68e1a6 gbm: Add documentation for the public facing API 2012-01-13 09:31:24 -05:00
Rob Bradford
d036354105 doxygen: Add link to the gbm documentation to the header 2012-01-13 09:31:24 -05:00
Rob Bradford
245341f406 doxygen: Add doxygen file and build infrastructure for gbm 2012-01-13 09:31:23 -05:00
Vinson Lee
3e18ad7fd7 i965: Fix Coverity wrong sizeof argument defect.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:19:34 -08:00
Paul Berry
fcd5af4a91 i965: Set pitch of pull constant buffers to 16.
We always access pull constant buffers using the message types "OWord
Block Read" or "OWord Dual Block Read".  According to the Sandy Bridge
PRM, Vol 4 Part 1, pages 214 and 218, when using these messages:

    "the surface pitch is ignored, the surface is treated as a
    1-dimensional surface.  An element size (pitch) of 16 bytes is
    used to determine the size of the buffer for out-of-bounds
    checking if using the surface state model."

Previously we were setting the pitch for pull constant buffers to the
size of the whole constant buffer--this made no sense and would have
led to incorrect behavior if it were not for the fact that the pitch
is ignored.

For clarity, this patch sets the pitch for pull constant buffers to 16
bytes, consistent with the hardware's behavior.

v2: Clarify the meaning of the ignored values by writing them as (16 - 1).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Paul Berry
f6f43bd5a2 i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Commit 9bdc44a528 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Christoph Bumiller
af0ce1dba8 nv50/ir: make use of TGSI_INTERPOLATE_COLOR
Flat SHADE_MODEL still overrides any non-flat interpolation
qualifier, but pulling that state out of the rasterizer cso
isn't really worth the effort, is it ?

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Christoph Bumiller
7b6881932a nvc0: fix submission of VertexID and EdgeFlag in push mode
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Brian Paul
cb254b75d7 osmesa: fix glReadPixels, etc
Needed to implement the Map/UnmapRenderbuffer() driver hooks.
This fixes glRead/Draw/CopyPixels, etc.

See https://bugs.freedesktop.org/show_bug.cgi?id=44723

Note: This is a candidate for the 8.0 branch.

Tested-by: Kevin Hobbs <hobbsk@ohiou.edu>
2012-01-12 13:49:15 -07:00
Brian Paul
062a4b601e intel: move declaration before code 2012-01-12 13:49:15 -07:00
Brian Paul
6dbdc03956 intel: fix mapping of malloc'd renderbuffers
This fixes accum buffer operations.  The accumulation buffer is the
only malloc-based renderbuffer for the intel drivers.

v2: apply x/y offset to returned pointer

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-12 13:49:15 -07:00
Eric Anholt
9be6654c1f mesa: Throw the required error for glCopyPixels from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copypixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:20 -08:00
Eric Anholt
6950a4faf6 mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copyteximage.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:18 -08:00
Eric Anholt
86b7c6707f mesa: Throw the required error for glReadPixels() from a multisampled FBO.
Fixes piglit EXT_framebuffer_multisample-negative-readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:15 -08:00
Eric Anholt
0e8d156c3c mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.
Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:13 -08:00
Eric Anholt
f83756f80f meta: Add GL_RED/GL_RG support to meta CopyTexImage.
Fixes some _mesa_problem()s in oglconform.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:10 -08:00
Eric Anholt
e6d6a10c5a i965/gen7: Fix depth buffer rendering to tile offsets.
Previously, we were saying that everything from the starting tile to
region width+height was part of the limits of our depthbuffer, even if
the tile was near the bottom of the depthbuffer.  This mean that our
range was not clipping to buffer buonds if the start tile was anything
but the start of the buffer.

In bebc91f0f3, this was changed to
saying that we're just rendering to a region of the size of the
renderbuffer.  This is great -- we get a range that should actually
match what we want.  However, the hardware's range checking occurs
after the X/Y offset addition, so we were clipping out rendering to
small depth mip levels when an X/Y offset was present.  Just add
tile_x/y to the width in that case -- the WM won't produce negative
x/y values pre-offset, so we just need to get the left/bottom sides of
the region to cover our buffer.

Fixes the following Piglit regressions on gen7:
    spec/ARB_depth_buffer_float/fbo-clear-formats
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:33:55 -08:00
Brian Paul
003dd8adf3 mesa: remove incorrect (float) cast in mipmap do_row()
The array holds GLuint values so remove the float cast.
Note, however, that to compute the average of four GLuints we really
want to do (a+b+c+d)/4 but that could overflow.  This change doesn't
address that for now.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:55 -07:00
Brian Paul
706400f0a7 swrast: use BITFIELD64_BIT() macro to fix MSVC warnings
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:50 -07:00
Brian Paul
decd018b99 mesa: fix ir_variable declaration
ir_variable is a class, not a struct.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:44 -07:00
Brian Paul
a240c998ac mesa: fix incorrect float vs. int values in a few places
In the first case, the newImage[] array contains GLuint values.
In the second case, the parameter type is GLuint, but the maxDepth
value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV).
Pass ~OU just to be safe.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:19 -07:00
Brian Paul
2f0fa456e3 meta: fix incorrect argument order in setup_texture_coords() call
And pass integer width, height values.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:01:59 -07:00
Brian Paul
36ede89687 mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:58:45 -07:00
Brian Paul
185ee042ac mesa: whitespace, 80-column wrapping in buffers.c 2012-01-12 09:23:55 -07:00
Brian Paul
45a3b54063 mesa: remove obsolete comment on _mesa_dest_buffer_exists() 2012-01-12 09:23:55 -07:00
Brian Paul
50ad155d48 st/mesa: whitespace fixes, 80-column wrapping 2012-01-12 09:23:55 -07:00
Brian Paul
eab036a6ea mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitions
We include both imports.h and u_math.h in the state tracker.  This
leads to multiple, conflicting definitions of ffs() with MSVC.
Use FFS_DEFINED to skip the ffs() in u_math.h.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:18:34 -07:00
Brian Paul
8cfaab59e0 st/mesa: re-order #includes in st_manager.c
include mesa headers before gallium headers to avoid problem with
ffs() being defined in u_math.h and then again in imports.h

The next commit will add some #ifdefs to prevent multiple definitions
of ffs().
2012-01-12 08:39:17 -07:00
Brian Paul
0c57323de8 sofpipe: remove extraneous semicolon 2012-01-12 08:30:52 -07:00
Brian Paul
9f2963b631 st/mesa: fix struct vs. class compilation warning
glsl_to_tgsi_visitor is earlier defined as a class, not a struct.
Fixes MSVC warning.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 08:29:16 -07:00
Dave Airlie
3e044bcc4b r600g: don't advertise integers yet on r600.
Still some work to be done before this is finished.

This is a candidate for 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 15:06:24 +00:00
Brian Paul
c7188ece0e configs: fix, simplify RADEON_LIBS, RADEON_CFLAGS
Fixes build problems with the r200, radeon drivers.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 07:54:19 -07:00
Brian Paul
9a548c27aa mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Call ffs() and ffsll() everywhere.  Define our own ffs(), ffsll()
functions when the platform doesn't have them.

v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation.  The #else clause was recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
2012-01-12 07:30:58 -07:00
Thomas Hellstrom
87118d84ff configure: Add the svga gallium driver to the default gallium drivers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
Thomas Hellstrom
8a4f7d1cdc st/xa: Bump version to 1.0.0 according to the README
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
José Fonseca
ce2929dde0 svga: Fix user clip planes.
Dirty flags also need to be updated in face of recent interface change.

Fixes regression in compiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 12:05:31 +00:00
Dave Airlie
16b5fda032 softpipe: bump max texture array layers to 256.
This as per GL3 specification.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 11:17:07 +00:00
Thomas Hellstrom
4dac89d92c gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device
Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 11:20:16 +01:00
Brian Paul
90d654b09d vbo: fix breakage from previous commit
Don't know how that slipped by.
2012-01-11 20:23:12 -07:00
Brian Paul
bbc74ffad6 vbo: fix void * arithmetic compilation error on MSVC
Also, call vbo_sizeof_ib_type() once and fix argument cast in
MapBufferRange() call.
2012-01-11 20:05:02 -07:00
Marek Olšák
4c0d88c145 docs/GL3: consolidate FBO extensions into one ARB 2012-01-12 03:59:21 +01:00
Marek Olšák
571e1947d0 docs/GL3: document r300 extension support 2012-01-12 03:59:21 +01:00
Marek Olšák
272896b885 docs/GL3: document what's missing for GL3 2012-01-12 03:59:21 +01:00
Yuanhan Liu
42d4972bf0 vbo: introduce vbo_get_minmax_indices function
Introduce vbo_get_minmax_indices() function to handle the min/max index
computation for nr_prims(>= 1). The old code just compute the first
prim's min/max index; this would results an error rendering if user
called functions like glMultiDrawElements(). This patch servers as
fixing this issue.

As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made
vbo_get_minmax_index() static.

v2: per Roland's suggestion, put the indices address compuation into
    vbo_get_minmax_index() instead.

    Also do comination if possible to reduce map/unmap count

v3: per Brian's suggestion, use a pointer for start_prim to avoid
    structure copy per loop.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 10:47:41 +08:00
Brian Paul
459a44460e mesa: remove const qualifier from fProg to silence warning
The args to _mesa_reference_shader_program() can't be const.
2012-01-11 18:22:17 -07:00
Brian Paul
fe1b38960b mesa: include uniforms.h to silence warning, remove unused var 2012-01-11 18:22:17 -07:00
Jakob Bornecrantz
6fe42b603d mesa: Include glx tests Makefile.in in tarball
Fix suggested by Kenneth Graunke.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Kenneth Graunke <kenneth@whitescape.org>
2012-01-12 00:44:12 +01:00
Anuj Phogat
c979fe3e20 Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACK
glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if
intel->is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 14:25:11 -08:00
Jakob Bornecrantz
04e262ebe9 mesa: Remove unused opengl version macro
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11 23:17:40 +01:00
Jakob Bornecrantz
c076882fbd rbug: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-11 21:53:23 +01:00
Ian Romanick
1c17745200 i965: Don't use _mesa_ir_link_shader to do our dirty work
Instead, do the uniform setting and input / output mapping directly in
brw_link_shader.  Hurray for not generating Mesa IR!  However, once
the i965 driver stops calling _mesa_ir_link_shader, UsesClipDistance
and UsesKill are no longer set.

Ideally gen6_upload_vs_push_constants should use the
gl_shader_program, but I don't see a way to propagate the information
there.  The other alternative, since this is the only usage, is to
move gl_vertex_program::UsesClipDistance to brw_vertex_program.

The compile (and precompile) stages use UsesKill to determine the
cache key for the shader.  This is then used to determine whether or
not to compile the shader.  Calculating this data during compilation
is too late.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2012-01-11 12:51:24 -08:00
Ian Romanick
efdc8bf189 i965: Don't calculate masks of used FS inputs
This previously enabled some optimizations in the fragment shader
(interpolation, etc.) if some input components were always 0.0 or
1.0.  However, this data was generated by analyzing Mesa IR.  The
next patch in this series removes generation of Mesa IR for GLSL
paths.  When we detect that case, just set the used mask to ~0 and
circumvent the optimizations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
6c0df75803 linker: Calculate used samplers and shadow samplers in the linker
It used to be done in ir_to_mesa, and that was kind of a bad place.

I didn't change st_glsl_to_tgsi because there is some strange stuff
happening in the code that generates glDrawPixels shaders.  It looked
like this would break horribly if I touched anything.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
6a992c3288 linker: Calculate the sampler to texture target mapping during linking
Track the calculated data in gl_shader_program instead of the
individual assembly shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
32be81de39 glsl: Add glsl_type::sampler_index
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
195ee502c3 mesa: Validate sampler settings using uniform storage
Rather than looking at the settings in individual assembly programs,
look at the settings in the top-level uniform values.  The old code
was flawed because examining each shader stage in isolation could
allow inconsitent usage across stages (e.g., bind unit 0 to a
sampler2D in the vertex shader and sampler1DShadow in the fragment
shader).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
b527dd65c8 mesa: Track fixed-function fragment shader as a shader
Previously the fixed-function fragment shader was tracked as a
gl_program.  This means that it shows up in the driver as a Mesa IR
program instead of as a GLSL IR program.  If a driver doesn't generate
Mesa IR from the GLSL IR, that program is empty.  If the program is
empty there is either no rendering or a GPU hang.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
ca5b30bf81 mesa: Use static buffer for uniform name
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
f409a710e3 mesa: Use uniform interfaces in fixed-function fragment shader code
Poking directly at the backing resources works only by luck.  Core
Mesa code should only know about the gl_uniform_storage structure.
Soon other code that looks at samplers will use the gl_uniform_storage
structures instead of the data in the gl_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:23 -08:00
Matt Turner
151b4f3369 Clean up GL3 status
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-11 15:49:56 -05:00
Matt Turner
3a343ef346 configure.ac: use AC_PROG_SED
It looks like AC_PROG_SED was added in 2.59b, and wasn't in the
original 2.59 in the original 2.59.  Presumably that's why, though
it could've been an oversight.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-11 15:49:56 -05:00
Matt Turner
198892c044 configure.ac: don't set HAVE_GTEST twice
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-11 15:49:56 -05:00
Kenneth Graunke
28cfa1fa21 i965: Don't reallocate push constant URB space on new VS programs.
The gen7_urb atom depends on CACHE_NEW_VS_PROG and CACHE_NEW_GS_PROG,
causing gen7_upload_urb() to be called when switching to a new VS
program.

In addition to partitioning the URB space between the VS and GS,
gen7_upload_urb() also allocated space for VS and PS push constants.
Unfortunately, this meant that whenever CACHE_NEW_VS was flagged, we'd
reallocate the space for the PS push constants.  According to the BSpec,
after sending 3DSTATE_PUSH_CONSTANT_ALLOC_PS, we must reprogram
3DSTATE_CONSTANT_PS prior to the next 3DPRIMITIVE.

Since our URB allocation for push constants is entirely static, it makes
sense to split it out into its own atom that only subscribes to
BRW_NEW_CONTEXT.  This avoids reallocating the space and trashing
constants.

Fixes a rendering artifact in Extreme Tuxracer, where instead of a snow
trail, you'd get a bright red streak (affectionately known as the
"bloody penguin bug").

This also explains why adding VS-related dirty bits to gen7_ps_state
made the problem disappear: it made 3DSTATE_CONSTANT_PS be emitted after
every 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-11 12:13:49 -08:00
Kenneth Graunke
10a6fde333 glx/dri: Initialize api even if num_attribs == 0.
Both dri2_create_context_attribs and drisw_create_context_attribs call
dri2_convert_glx_attribs, expecting it to fill in *api on success.

However, when num_attribs == 0, it was returning true without setting
*api, causing the caller to use an uninitialized value.

Tested-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:13:49 -08:00
Brian Paul
dce4c368b5 svga: don't reference count svga_sampler_view's texture
svga_sampler_view contains a pointer to a pipe_resource (base class of
svga_texture) and svga_texture contains a pointer to an svga_sampler_view.
This circular dependency prevented the objects from ever being freed when
they pointed to each other.  Make the svga_sampler_view::texture pointer
a "weak reference" (no reference counting) to break the dependency.

This is safe to do because the pipe_resource/texture always has a longer
lifespan than the sampler view so when svga_sampler_view stops referencing
the texture, the texture's refcount never hits zero.

Fixes a memory leak seen with google earth and other apps.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-11 13:10:43 -07:00
Eric Anholt
35cdd7b6db i965: Fix compiler warning from uninitialized "success" value.
This shouldn't happen, because the DDX should only load this driver if
IS_965.  But better to do something defined in that case.
2012-01-11 12:07:15 -08:00
Eric Anholt
ba6f4c9ee2 i965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
Fixes piglit EXT_transform_feedback/buffer-usage.
2012-01-11 12:06:34 -08:00
Eric Anholt
2c623c2be5 i965/vs: Try to emit more components of constant vectors at once.
We were naively emitting each component at a time, even if we were
emitting the same value to multiple channels.  Improves on a codegen
regression from the old VS to the new VS on some unigine shaders
(because we emit constant vecs/matrices as immediates instead of
loading them as push constants, so we had over 4x the instructions for
using them).

shader-db results:
Total instructions: 58594 -> 58540
11/870 programs affected (1.3%)
765 -> 711 instructions in affected programs (7.1% reduction)
2012-01-11 12:06:34 -08:00
Brian Paul
f1b33c74dc mesa: add _mesa_HashNumEntries() function
Useful when debugging to find the number of texture objects, shader
programs, etc.
2012-01-11 12:58:45 -07:00
José Fonseca
6811704830 st/wgl: Return NULL for NULL HDCs in wglGetExtensionsStringARB.
WGL_ARB_extensions_string states that wglGetExtensionsStringARB should
return NULL for invalid HDCs.  And some applications rely on it.

Reviewed-By: "Keith Whitwell" <keithw@vmware.com>
2012-01-11 12:51:40 -07:00
Dave Airlie
2d80cad16e llvmpipe: disable native integers
llvmpipe shouldn't be reporting native integer support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 19:48:56 +00:00
Brian Paul
0a20051e6d xlib: stop calling XShmQueryVersion()
It caused an X protocol error in some (rare) situations.
This is a follow-on to the previous commits which fixes a bug reported
by Wayne E. Robertz.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Brian Paul
7f6de60c58 st/glx/xlib: call register_with_display() in glXChooseFBConfig()
This is the same fix as the previous commit, except it's for the gallium
glx/xlib state tracker.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Brian Paul
ecbdb173bb xlib: call register_with_display() in Fake_glXChooseFBConfig()
as we do in Fake_glXChooseVisual().  This registers the MesaGLX
extension on the display so we can clean up buffers, etc. when
the display connection is closed.

Fixes a bug reported by Wayne E. Robertz.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Christoph Bumiller
b424bf69df nv50/ir: handle TGSI_OPCODE_ISSG 2012-01-11 20:26:58 +01:00
Christoph Bumiller
9d503992d7 nv50/ir: handle TGSI_TEXTURE_SHADOWCUBE 2012-01-11 20:26:52 +01:00
Christoph Bumiller
f6b994b305 nv50,nvc0: zero out program struct on program_destroy
Prevent any state from carrying over to a new translation in cases
where we assume that data is still zero from initial calloc (these
would require us to do individual zeroing before translation which
would be more code).
2012-01-11 20:26:47 +01:00
Kristian Høgsberg
58dc1b28d1 wayland-drm: Drop the non-premul formats, use format codes from drm_fourcc.h 2012-01-11 14:24:00 -05:00
José Fonseca
1306644a67 draw: Store the new pre_clip_pos member as well.
Again, not much testing nor peer review, but should be better than what's
now.
2012-01-11 18:11:28 +00:00
Kristian Høgsberg
513d1feee4 egl_dri2: Put the _eglError call in the case switch case
Log an error in case we get an unknown format, not in case for XRGB32.
I botched the edit of Roberts patch.
2012-01-11 12:44:58 -05:00
Dave Airlie
3f80b69b5f st/mesa: rename translate_texture_target, and make translate_opcode static.
As suggested by Brian.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
fffca9046c softpipe: route correct coordinates for shadow cube sampling.
This fixes the shadow cube map sampling on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
2f275466f7 glsl_to_tgsi: add support for shadow cube map sampling.
This along with the TGSI support lets the piglit sampler-cube-shadow
test pass on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
0ec30805a4 tgsi: add TGSI_TEXTURE_SHADOWCUBEMAP
This adds support for shadow cubemap texture sampling instructions.

This is required for GL 3.0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
José Fonseca
ec4d691474 llvmpipe: Update for TGSI_INTERPOLATE_COLOR.
Not thoroughly tested nor reviewed. But should at least prevent the
assertion failure.
2012-01-11 17:35:14 +00:00
Robert Bragg
670f182a1f egl_dri2/wayland: handle creating xrgb8888 images
When creating an EGLImage from a struct wl_buffer * this ensures
that we create an XRGB8888 image if the wayland buffer doesn't have an
alpha channel. To determine if a wl_buffer has a valid alpha channel
this patch adds an internal wayland_drm_buffer_has_alpha() function.

It's important to get the internal format for an EGLImage right so that
if a GL texture is later created from the image then the GL driver will
know if it should sample the alpha from the texture or flatten it to
a constant of 1.0.

This avoids needing fragment program workarounds in wayland compositors
to manually ignore the alpha component of textures created from wayland
buffers.

krh: Edited to use wl_buffer_get_format() instead of wl_buffer_has_alpha().

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-01-11 12:16:47 -05:00
Paul Berry
765ed3a6a9 glx: Suppress unused variable warning for cmdlen
No functional change.  In the function
__indirect_glAreTexturesResident(), the variable cmdlen is only used
if USE_XCB is not defined.  This patch avoids a compile warning in the
event that USE_XCB is defined.

v2: just move cmdlen declaration inside the #else part.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 07:57:56 -08:00
Paul Berry
d3150ebc8c mesa: Move transform feedback error check to reduce array overflow risk.
Previous to this patch, we didn't do the limit check for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS until the end of the
store_tfeedback_info() function, *after* storing all of the transform
feedback info in the gl_transform_feedback_info::Outputs array.  This
meant that the limit check wouldn't prevent us from overflowing the
array and corrupting memory.

This patch moves the limit check to the top of tfeedback_decl::store()
so that there is no risk of overflowing the array.  It also adds
assertions to verify that the checks for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS are sufficient to avoid
array overflow.

Note: strictly speaking this patch isn't necessary, since the maximum
possible number of varyings is MAX_VARYING (16), whereas the size of
the Outputs array is MAX_PROGRAM_OUTPUTS (64), so it's impossible to
have enough varyings to overflow the array.  However it seems prudent
to do the limit check before the array access in case these limits
change in the future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-11 07:57:56 -08:00
Paul Berry
642e5b413e mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), we need to handle transform feedback of gl_ClipDistance
specially, to account for the fact that the hardware represents it as
an array of vec4's rather than an array of floats.

The previous way this was accounted for (translating the request for
gl_ClipDistance[n] to a request for a component of
gl_ClipDistanceMESA[n/4]) doesn't work when performing transform
feedback on the whole unsubscripted array, because we need to keep
track of the size of the gl_ClipDistance array prior to the lowering
pass.  So I replaced it with a boolean is_clip_distance_mesa, which
switches on the special logic that is needed to handle the lowered
version of gl_ClipDistance.

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]-no-subscript".

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:57:56 -08:00
Paul Berry
be4e9f7a0c mesa: Fix computation of transform feedback num_components.
The function tfeedback_decl::num_components() was not correctly
accounting for transform feedback of whole arrays and gl_ClipDistance.
The bug was hard to notice in tests, because it only affected the
checks for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS.

This patch fixes the computation, and adds an assertion to verify
num_components() even when MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
and MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS are not exceeded.

The assertion requires keeping track of components_so_far in
tfeedback_decl::store(); this will be useful in a future patch to fix
non-multiple-of-4-sized gl_ClipDistance.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:57:56 -08:00
Dave Airlie
c62e02000d st_extensions: fixup GLSL 1.30 related enables (v3)
This just fixes up the enables for native integers and EXT_texture_integer
support in st/mesa.

It also set the MaxClipPlanes to 8.

We should consider exposing caps for MCP vs MCD, but since core
mesa doesn't care yet maybe we can wait for now.

v2: use 32-bit formats as per Marek's mail.

v3: add calim's fix for INT_DIV_TO_MUL_RCP disabling.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
cc94f0541c st_glsl_to_tgsi: use ISSG and fixup IABS
It doesn't look like the GLSL compiler will produce sign op
for an unsigned anyways (seems insane anyways).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
b6cbc28533 tgsi: add ISSG support
This adds integer version of SSG that GLSL 1.30 can produce.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
0fe2b397bb softpipe: enable clamping control
This enables fragment clamping in softpipe, it passes more
tests than it did previously with no regressions, There are still
a couple of failures in the SNORM types to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
e809b7a678 softpipe: fix texel fetch swizzles
This fixes a number of texelFetch swizzle tests, and consoldiates
the swizzle handling in a new function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Stéphane Marchesin
3235435e80 i915g: Fix bugs in the shader optimizer. 2012-01-11 02:25:42 -08:00
Dave Airlie
5840ec2d41 softpipe: fix llvm build
Thanks to Wubbbi on #dri-devel for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 10:16:56 +00:00
Dave Airlie
1865f341d8 draw: clipdistance support (v2)
Add support for using the clipdistance instead of clip plane.

Passes all piglit clipdistance tests.

v2: fixup some comments from Brian in review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 08:20:11 +00:00
Dave Airlie
f7e3e46f72 tgsi_scan: add support to count number of output clip distances
Just add support to the scanner to count the number of clip distances.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 08:08:12 +00:00
Dave Airlie
40c5987ed8 draw/softpipe: add clip vertex support. (v2)
softpipe always clipped using the position vector, however for unclipped
vertices it stored the position in window coordinates, however when position
and clipping are separated, we need to store the clip-space position and
the clip-space vertex clip, so we can interpolate both separately.

This means we have to take the clip space position and store it to use later.

This allows softpipe to pass all the clip-vertex piglit tests.

v2: fix llvm draw regression, the structure being passed into llvm needed
updating, remove some hardcoded ints that should have been enums while there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:35 +00:00
Dave Airlie
34a78b7ef6 tgsi/softpipe: add VertexID support.
This required changing the system value semantics, so we stored
a system value per vertex, instance id is the only other system
value we currently support, so I span it across the channels.

This passes the 3 vertexid-* piglit tests + lots of instanceid tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:35 +00:00
Dave Airlie
02932f37fa softpipe: allow softpipe to set shader params depending on runtime llvm (v3)
If draw isn't using llvm we can support vertex texture and integers,
These will be fixed up later, but for now allow this check to happen
at run-time.

v2: since 3e22c7a253 we can ask draw for a non-llvm
context. Just track if ask and set the vars accordingly. This probably isn't perfect but should cover the cases we care about.

v3: use debug option, restructure to store in screen, as suggested by Jakob.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:27 +00:00
Dave Airlie
092cf9a5b5 mesa/clear: fix crashes with illegal clear tests.
Mesa shouldn't call into the drivers if there are no renderbuffers
bound to the attachments for the buffers to be cleared.

Fixes a number of the clearbuffer-* tests on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:06:25 +00:00
Dave Airlie
863554168e mesa: fix cubemap depth completeness test
This fixes the test to allow cube/depth combinations on GL3
or EXT_gpu_shader4.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:02:32 +00:00
Eric Anholt
916e206ef0 glsl: Add error checking for applying interpolation qualifiers to other vars.
Fixes piglit
glsl-1.30/compiler/interpolation-qualifiers/local-smooth-01.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
be4e46b21a i965: Claim to support 4 multisamples on gen6+.
We're not quite ready to actually support it in the implementation,
but at least this allows GL 3.0 API-reliant applications to hopefully
run successfully, though they won't get multisampling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
3d4efc583c i965: Increase the number of array texture levels to the hardware limit.
The EXT_texture_array required only 64, but GL 3.0 required 256.
Since we're already exposing values that can get us way beyond our
ability to map the single object directly, go ahead and expose all the
way to hardware limits.

Tested with new piglit EXT_texture_array/maxlayers on gen7.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
057f9ae54b glsl: Fix copy_propagation_elements bug in handling self-copies.
We were doing the kill of the updated channels, then adding our copy
to the list of available stuff to copy.  But if the copy was updating
its own source channels, we didn't notice, breaking this code:

	R0.xyzw = arg0 + arg1;
	R0.xyzw = R0.wwwx;
	gl_FragColor.xyzw = clamp(R0.xyzw, 0.0, 1.0);

Fixes piglit glsl-copy-propagation-self-2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
254b24f195 i965: Fix compiler warnings from hiz changes. 2012-01-10 16:44:16 -08:00
Chad Versace
f7cbd80028 i965/gen7: Fix batch length for 3DSTATE_HIER_DEPTH_BUFFER
Change from 5 to 3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 16:31:52 -08:00
Chad Versace
06ad9adcb0 i965/gen7: Enable HiZ
This patch modifies all batches needed for HiZ. The batch length for
3DSTATE_HIER_DEPTH_BUFFER is also corrected from 4 to 3.

Performance +6.7% on Citybench.
    num-frames: 400
    resolution: 1918x1031
    avg-hiz-off: 127.90 fps
    avg-hiz-on: 136.50 fps
    kernel: git://people.freedesktop.org/~anholt/linux.git branch=gen7-reset-sol sha=23360e4

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:38 -08:00
Chad Versace
bebc91f0f3 i965: Replace references to stencil region size with buffer size
It is unwise to use a stencil region's size to determine its
renderbuffer's size, because at region creation we fudge the width and
height to accomodate interleaved rows. (See the comment for MESA_FORMAT_S8
in intel_miptree_create()). Most users of stencil_region->{width,height}
should be converted to use stencil_rb->{Width,Height}.

We have already done the replacement in several locations. This patch
continues the replacement in {brw,gen7}_emit_depthbuffer(). To make those
functions look consistent, I've also done the equivalent replacement for
the depth buffer.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:27 -08:00
Chad Versace
b755f5894c i965: Fix misnamed GEN7_WM_DEPTH_RESOLVE
It was named GEN6_WM_DEPTH_RESOLVE. Luckily, this caused no conflict,
because the value is identical for gen6 and gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:05 -08:00
Christoph Bumiller
bd38459fe9 nv50: fix clip state validation
Don't create clip outputs if no clip planes are enabled.

Move clip validation after program validation: we were calling
linkage validation in case the VP needed rebuilding before the
FP was validated.

The vertex program needs to be built first because when
ClipDistance is used we'll want to only enable those outputs that
are also written.
2012-01-10 21:45:31 +01:00
Brian Paul
8597c986d7 draw: remove unused 'so' variable in draw_pt_so_emit() 2012-01-10 12:40:10 -07:00
Brian Paul
991479ef51 mesa: fix > vs. >> typo in EXPAND_3_8() macro
Found by Eirik Byrkjeflot Anonsen.
2012-01-10 12:37:38 -07:00
Brian Paul
d6533df90d st/mesa: remove unnecessary memset()/zero call
The u_surface_default_template() function does the memset()/zero now.

Jakob Bornecrantz <jakob@vmware.com>
2012-01-10 12:37:38 -07:00
Brian Paul
2e87660ca6 util: use memset() to initialize surface, sampler_view templates
These initialization functions weren't initializing all the fields so
some had undefined values.  The callers of these functions sometimes use
a structure assignment to initialize new objects from these templates
so we'd just propagate the undefined values.  That made for some confusing
info when debugging, plus it could lead to bugs.

v2: fix surf pointer mix-up: "&surf" -> "surf"

Jakob Bornecrantz <jakob@vmware.com>
2012-01-10 12:37:38 -07:00
Brian Paul
6bf5daf331 mesa: use STATIC_ASSERT in a few more places 2012-01-10 12:37:37 -07:00
José Fonseca
f9b2d2fea5 scons: Fix libGL.so build. 2012-01-10 17:42:02 +00:00
Brian Paul
8fe6755ed5 mesa: move _mesa_clear_accum_buffer() inside FEATURE_accum test
Fixes _mesa_clear_accum_buffer() being multiply defined if
FEATURE_accum is false.

Tested-by: Chih-Wei Huang <cwhuang@android-x86.org>
2012-01-10 09:09:02 -07:00
Brian Paul
9b1117095a mesa: add missing color buffer datatype check for glBlitFramebuffer()
Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
2012-01-10 09:09:02 -07:00
Jakob Bornecrantz
ca21c85ab0 svga: Drop execbuf throttling
This code isn't used anymore in preference for DRI2 client side swap buffers
throttling or throttling done inside the xa or xorg driver.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:45 +01:00
Jakob Bornecrantz
1c9a46dbbe svga: Add somewhat sensible fallback and silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:45 +01:00
Jakob Bornecrantz
b5f31333a6 svga: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:44 +01:00
Jakob Bornecrantz
13c78e7786 svga: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:44 +01:00
Jakob Bornecrantz
f700370946 svga: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:44 +01:00
Jakob Bornecrantz
4a605293b2 svga: Ignores
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:43 +01:00
Jakob Bornecrantz
1ec4ae1930 mesa: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
Reviewed-by Ian Romanick <ian.d.romanick@intel.com>
2012-01-10 16:59:43 +01:00
Jakob Bornecrantz
230cc36611 mesa: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
Reviewed-by Ian Romanick <ian.d.romanick@intel.com>
2012-01-10 16:59:43 +01:00
Jakob Bornecrantz
54f6b64e7e draw: Silence warning
This peice of code has been here since the inital commit (c5c5cd71) and the
code that used instance_id_index was removed in (caede752) by José.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:03:43 +01:00
Jakob Bornecrantz
9af9e12bc5 target-helpers: If neither softpipe or llvmpipe is used just return the screen
So the targets can drop the sw_wrapper winsys when no sw driver is being used.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 15:53:18 +01:00
Dave Airlie
ec8cbd79ac draw/softpipe: EXT_transform_feedback support (v2)
This replaces the current code with an implementation compatible with
the new gallium interface. I've left some of the remains of the interface
intact so llvmpipe keeps building correctly, and I'll take a look at fixing
llvmpipe up later.

v2: fixup as per Brian's review

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10 12:07:51 +00:00
Dave Airlie
67e3cbf163 gallium: introduce GLSL based interpolation rules. (v2)
This introduces an unspecified interpolation paramter that is only allowed for
color semantics, so a specified GLSL interpolation will override the ShadeModel
specified interpolation, but not vice-versa.

This fixes a lot of the interpolation tests in piglit.

v2: rename from unspecified to color

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10 11:54:44 +00:00
Christoph Bumiller
5a7c343352 nvc0: fix FP header clip distance mask 2012-01-10 00:39:47 +01:00
Christoph Bumiller
e4210a42bc nvc0/ir: TXF array index already is an integer 2012-01-10 00:39:41 +01:00
Christoph Bumiller
7fd802b96c nv50/ir: handle TGSI_SEMANTIC_VERTEXID 2012-01-10 00:39:35 +01:00
Christoph Bumiller
ca03372657 nv50/ir/tgsi: translate SNE as unordered comparison
Fixes isnan().
2012-01-10 00:39:29 +01:00
Christoph Bumiller
4021979182 nv50/ir/ra: don't coalesce contraint-moves
This could lead to incorrect code when fixed regs are involved.

Surprisingly, the increased freedom actually leads to lower
register usage in some cases. Still want to find a better way
to treat constraints though ...
2012-01-10 00:39:12 +01:00
Christoph Bumiller
601fb4b746 nvc0: enable shader watchdog timer
Prevent infinite loops in shaders from locking up the GPU.
2012-01-10 00:38:19 +01:00
Christoph Bumiller
be1ae976a4 nv50/ir/tgsi: handle TGSI_OPCODE_IABS 2012-01-10 00:37:47 +01:00
Christoph Bumiller
ae828413c4 nv50/ir/opt: optimize u32 MOD by power of 2 into AND 2012-01-10 00:37:37 +01:00
Christoph Bumiller
6ab6110133 nv50/ir/opt: s/SHL/SHR in optimization of u32 DIV 2012-01-10 00:37:32 +01:00
Christoph Bumiller
b85e93c0ca nv50/ir,nvc0: make ClipDistance and ClipVertex work 2012-01-10 00:37:19 +01:00
Christoph Bumiller
f37c3a3335 nv50,nvc0: handle new PIPE_CAPs 2012-01-10 00:37:03 +01:00
Christoph Bumiller
7c6ca0367b nvc0/ir/emit: fix modifiers of f32 add with long immediate 2012-01-10 00:36:59 +01:00
Christoph Bumiller
405bd00f3c nvc0/ir: fix default insertion position in pre-SSA lowering pass
Always set position to insert before the current instruction,
the previous behaviour led to confusion (bug in checkPredicate
for BBs with only a single conditional branch).
2012-01-10 00:36:46 +01:00
Marek Olšák
dc4c821f08 Squash-merge branch 'gallium-clip-state'
Conflicts:
	src/gallium/auxiliary/tgsi/tgsi_strings.c
	src/mesa/state_tracker/st_atom_clip.c

commit d919791f2742e913173d6b335128e7d4c63c0840
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 17:59:22 2012 +0100

    d3d1x: adapt to new clip state

commit cfec82bca3fefcdefafca3f4555285ec1d1ae421
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 14:16:51 2012 +0100

    gallium/docs: update for clip state changes

commit c02bfeb81ad9f62041a2285ea6373bbbd602912a
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 14:21:43 2012 +0100

    tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS

commit d4e0a785a6a23ad2f6819fd72e236acb9750028d
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jan 5 08:30:00 2012 -0700

    tgsi: consolidate TGSI string arrays in new tgsi_strings.h

    There was some duplication between the tgsi_dump.c and tgsi_text.c
    files.  Also use some static assertions to help catch errors when
    adding new TGSI values.

    v2: put strings in tgsi_strings.c file instead of the .h file.

    Reviewed-by: Dave Airlie <airlied@redhat.com>

commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 12:48:09 2012 +0100

    gallium: extend user_clip_plane_enable to apply to clip distances

commit f1d5016c07f786229ed057effbe55fbfd160b019
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jan 6 02:39:09 2012 +0100

    nvfx: adapt to new clip state

commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jan 6 01:41:39 2012 +0100

    st/mesa: fix DrawPixels with GL_DEPTH_CLAMP

commit c86ad730aa1c017788ae88a55f54071bf222be12
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Tue Jan 3 23:51:30 2012 +0100

    nv50: adapt to new clip state

commit 3a8ae6ac243bae5970729dc4057fe02d992543dc
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Tue Jan 3 23:32:36 2012 +0100

    nvc0: adapt to new clip state

commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Dec 29 01:32:51 2011 +0100

    draw: initalize pt.user.planes in draw_init

    This fixes a crash in glean/fpexceptions.

commit e3056524b19b56d473f4faff84ffa0eb41497408
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Dec 26 06:26:55 2011 +0100

    svga: adapt to new clip state

commit c5bfa8b37d6d489271df457229081d6bbb51b4b7
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 14:11:51 2011 +0100

    r600g: adapt to new clip state

commit f11890905362f62627c4a28a8255b76eb7de7df2
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 14:10:26 2011 +0100

    r300g: adapt to new clip state

commit e37465327c79a01112f15f6278d9accc5bf3103f
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 12:39:16 2011 +0100

    draw: adapt to new clip state

    This adds a regression in the LLVM clipping path. Can anybody see anything
    wrong with the code? It works for every other case, just glean/fpexceptions
    crashes when doing the "Infinite clip plane test".

commit b474d2b18c72d965eefae4e427c269cba5ce6ba2
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 13:14:59 2011 +0100

    u_blitter: don't save/set/restore clip state

commit 9dd240ea91f523a677af45e8d0adb9e661e28602
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 13:11:56 2011 +0100

    gallium: don't cso_save/set/restore clip state

    The enable bits are in the rasterizer state.

commit a4f7031179f5f4ad524b34b394214b984ac950f6
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 12:58:55 2011 +0100

    gallium: default depth_clip to 1

    depth_clip = !depth_clamp

commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Dec 26 06:14:19 2011 +0100

    trace,util: update state logging to new clip state

    Also dump the other missing flags.

commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 10:43:43 2011 +0100

    st/mesa: adapt to new clip state

commit b7b656a42fca19d7c85267f42649a206a85a2c72
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Dec 17 15:45:19 2011 +0100

    gallium: move state enable bits from clip_state to rasterizer_state
2012-01-10 00:25:05 +01:00
Kenneth Graunke
a48cc138a8 i965: Fix zeroing of unused attributes in 3DSTATE_SBE.
This brings the code in sync with gen6_sf_state.c; presumably the
mistake was a botched rebase on initial Ivybridge bring-up patches.

Found by diffing batch buffer dumps and noticing the random values.
Thanks to Eric for catching the obvious mistake.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:11 -08:00
Kenneth Graunke
7cb40da7a5 i965: Re-sync outdated comments about Gen6+ push constants.
In f3e9ccb3b, I renamed gen6_upload_wm_constants to
gen6_upload_wm_push_constants, but neglected to update this comment.

I don't think there ever was a gen7_prepare_wm_constants function; it
was probably a search and replace error.  Of course, "prepare" functions
died a while back as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:10 -08:00
Kenneth Graunke
647b890e7d i965: Update dirty bit comments for the gen7_ps_state atom.
CACHE_NEW_SAMPLER doesn't cover max_wm_threads, but it does cover
brw->sampler.count.  BRW_NEW_PS_BINDING_TABLE is obvious, but it's
probably worth adding a comment anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
ef034f1094 i965: Annotate the use of _NEW_PROGRAM in Gen6+ SF state atoms.
The dirty bit was already correctly in place, but there was no comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
62ca17101c i965: Add missing _NEW_PROGRAM dirty bit to the brw_sf_state atom.
Also, annotate the use of _NEW_POINT as long as we're adding a comment.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
60343b67f7 i965: Add missing _NEW_PROGRAM dirty bit to the gen7_sbe_state atom.
According to a comment in gen6_sf_state, calls to get_attr_override need
both _NEW_PROGRAM and _NEW_LIGHT.  Since Gen7 reuses the same function,
the same dirty bits should apply.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
f497906ec0 i965: Remove BRW_NEW_CURBE_OFFSETS dirty bit from Gen7 atoms.
The BRW_NEW_CURBE_OFFSETS dirty bit is only flagged by the
brw_curbe_offsets state atom which is only used on Gen4-5.

Since it's never flagged, there's no reason to depend on it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:08 -08:00
Kenneth Graunke
74d7ef0961 i965: Remove BRW_NEW_URB_FENCE dirty bit from Gen6+ atoms.
The BRW_NEW_URB_FENCE dirty bit is only flagged by the
brw_recalculate_urb_fence state atom which isn't used on Gen6+.

Since it's never flagged, there's no reason to depend on it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:08 -08:00
Kenneth Graunke
4874fcb028 i965: Add missing _NEW_BUFFERS dirty bit to Gen6+ DEPTH_STENCIL atoms.
This brings the dirty bits in line with the comments.

This does /not/ need to be cherry-picked to stable branches because the
access requiring _NEW_BUFFERS was added in master as part of HiZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:08 -08:00
Andy Clayton
6c29452f38 glsl: fix glsl optimization infinite loop from copy_propagation_elements
The trick was to produce an assignment in the IR along the lines of:

      (assign  (xyzw) (var_ref R0)  (swiz wwww (var_ref R0) ))

which occurs only rarely even in code that looks like it should do
this, because of the assignment temporaries generated in ast_to_hir.

From the IR above, this optimization pass would then propagate
references of R0 into R0.wwww (seems reasonable), but without this
patch, a later reference of R0.wwww would see R0 first, turning that
into R0.wwww.wwww, which triggered opt_swizzle_swizzle, and then we
looped back to this code to do it again.  Avoid that by skipping over
the usual ir_rvalue visitor's ir_swizzle hook, so that we get
handle_rvalue() on the ir_swizzle itself, not its referenced value.
Looking at only the swizzle will always optimize away at least as much
as looking at the swizzle's refererenced value.

We now still claim to propagate r0.w into r0.w, but at least we don't
trigger the loop.

v2: Rewrite commit message (changes by anholt)

Fixes piglit glsl-copy-propagation-self-1
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34006
2012-01-09 13:05:21 -08:00
Jakob Bornecrantz
6afa7cdf93 softpipe: Document new llvm flag
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2012-01-09 21:39:32 +01:00
Jakob Bornecrantz
8783d4227f softpipe: Don't use llvm in draw
But add a option to force it on for testing.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09 21:39:06 +01:00
Jakob Bornecrantz
f4863f3923 draw: Fail if we fail to enable llvm when asked for it
The r300 driver requires LLVM when building and other drivers that
depend on it for all TNL, like i915g will be a lot slower without it.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09 21:39:03 +01:00
Jakob Bornecrantz
3e22c7a253 draw: Make it possible to create a llvm free context
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09 21:38:52 +01:00
Kenneth Graunke
a53cb348ba mesa: Bump version to 8.0 (devel)
Also update the release notes to mention that Mesa 8.0 implements
OpenGL 3.0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 12:01:55 -08:00
Jerome Glisse
b82a2a848c radeon/winsys: fix get info ioctl error checking
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-01-09 14:59:56 -05:00
Eric Anholt
30f86aec01 i965/fs: Fix projector==1.0 optimization pre-gen6.
The optimization was supposed to turn an attribute component that was
always 1.0 into a mov of 1.0.  But by leaving loop this patch removes
out of that test, we applied the projection correction to the 1.0 and
got some other value, breaking openarena once it was converted to
using the new compiler backend.

Originally this hunk was separate from the former loop to make the
generated instructions slightly better pipelined.  We now have
automatic instruction scheduling to handle that, and the generated
instruction sequence looked the same to me after this change (except
for the bugfix).
2012-01-09 10:59:38 -08:00
Eric Anholt
83dc891b41 i965/fs: Fix GPU hangs with 16-wide integer div/mod on gen7.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 10:47:09 -08:00
Paul Berry
108cba21de mesa: Fix bogus transform feedback error message when subscripting non-array.
Previous to this patch, if the client requested transform feedback
using a subscript, but the variable was not an array
(e.g. "gl_FrontColor[0]"), we would produce a bogus error message like
"Transform feedback varying gl_FrontColor[0] found, but it's an array
([] expected)".

Changed the error message to e.g. "Transfrorm feedback varying
gl_FrontColor[0] requested, but gl_FrontColor is not an array."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-09 10:30:35 -08:00
Brian Paul
b87b857d90 mesa: fix error message in _mesa_BlitFramebufferEXT() 2012-01-09 08:11:33 -07:00
Brian Paul
3f1fab0684 mesa: check depth, stencil formats (not depths) in glBlitFramebuffer
We were only comparing the number of depth and stencil bits but the
extension spec actually says the formats must match:

    The error INVALID_OPERATION is generated if BlitFramebufferEXT is
    called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT
    and the source and destination depth or stencil buffer formats do
    not match.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 08:11:33 -07:00
Brian Paul
84c38c739e mesa: add missing error check for linear blit of integer colors
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 08:11:33 -07:00
Brian Paul
edca96547a swrast: convert blit_linear() to Map/UnmapRenderbuffer()
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 08:11:33 -07:00
Brian Paul
7274538da7 mesa: add _mesa_unpack_ubyte_rgba_row() function
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 08:11:33 -07:00
Brian Paul
301fba5445 mesa: rename _mesa_unpack_int_rgba_row() to _mesa_unpack_uint_rgba_row()
Since it returns uint values, not int.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 08:11:33 -07:00
Christian König
8c2bfa34a0 vl: replace decode_buffers with auxiliary data field
Based on patches from Maarten Lankhorst <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-01-09 12:21:22 +01:00
Kenneth Graunke
37240d2132 i965: Actually enable SIMD16 dispatch on Ivybridge.
Commit acf82657f4 supposedly enabled
SIMD16 dispatch, but neglected to set the "16 Pixel Dispatch Enable"
bit, so nothing actually got enabled.

Furthermore, it neglected to set up the Dispatch GRF Start Register for
kernel 2, which is the SIMD16 program.

Increases performance in Nexuiz by ~15% at 800x600 (n=3).

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-08 14:38:03 -08:00
Marek Olšák
ed22f8ed2c nvfx: remove unused-but-set variables 2012-01-08 19:09:37 +01:00
Kenneth Graunke
a56a732c69 i965: Correct _NEW_TRANSOFORM typos.
Using the proper spelling, _NEW_TRANSFORM, makes searching work better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-07 20:01:59 -08:00
Kenneth Graunke
6a26005c1e i965: Correct misspellings of "invariant".
$ dict invarient
No definitions found for "invarient", perhaps you mean:
gcide:  Invariant
wn:  invariant

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-07 20:01:59 -08:00
Bryan Cain
73b26e4d12 glsl_to_tgsi: emit IABS for absolute value of integers 2012-01-07 16:20:28 -06:00
Brian Paul
56b57aa360 mesa: rework ctx->Driver.CopyTexSubImage() parameters
Replace target, level parameters with gl_texture_image.
Add gl_renderbuffer parameter to indicate source buffer for the copy.

This removes some redundant code in the drivers to find the source
renderbuffer and the destination texture image (which we already had
in _mesa_CopyTexSubImage).

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-07 15:04:23 -07:00
Bryan Cain
4c0f1fb5ec gallium: add an IABS opcode to TGSI
This is a necessary operation that is missing from TGSI.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-07 15:37:32 -06:00
Brian Paul
291e374ea5 mesa: remove unused _mesa_unpack_uint_rgba_row() prototype 2012-01-07 14:34:44 -07:00
Bryan Cain
673535f607 glsl_to_tgsi: fix emission of boolean constants
We use 0xffffffff for true, but visit(ir_constant *) was emitting 1.
2012-01-07 15:33:36 -06:00
Bryan Cain
c4529d10be glsl_to_tgsi: remove bad assertion 2012-01-07 15:33:36 -06:00
Brian Paul
282292f24c swrast: fix Z testing of points/lines for 16-bit depth buffers
We were comparing 32-bit Z buffer values against 16-bit fragment values.
Need to do scaling like for the 24-bit case.

Triangle Z testing was OK since it didn't hit this code path.
2012-01-07 14:16:27 -07:00
Brian Paul
8dffb6bdab swrast: s/GLbitfield/GLbitfield64/ for sw_span::arrayAttribs
This is a bitfield of FRAG_BIT_x values so it should be 64-bits now.
2012-01-07 14:16:27 -07:00
Brian Paul
7d960a352f swrast: s/GLint/GLuint/ to silence MSVC signed/unsigned comparison warning 2012-01-07 14:16:27 -07:00
Brian Paul
5fc6db6708 meta: add some 'f' suffixes to silence MSVC warnings 2012-01-07 14:16:27 -07:00
Brian Paul
6bf7d40214 mesa: add some 'f' suffixes to silence MSVC warnings 2012-01-07 14:16:27 -07:00
Brian Paul
70754dd1fb util: silence some MSVC type conversion warnings 2012-01-07 14:16:27 -07:00
Brian Paul
f0f623a907 draw: replace assert(0) with debug_warn_once()
If the assertion was hit, it probably meant that we were unable to allocate
or map a vertex buffer.  Instead of dying in a debug build, issue a warning
and continue.
2012-01-07 14:16:27 -07:00
Brian Paul
94bf2d48e1 util: add debug_warn_once() macro
Emits a warning message, but only once to avoid tons of repeated warnings.
2012-01-07 14:16:27 -07:00
Brian Paul
994c33db87 draw: whitespace fixes, etc. 2012-01-07 14:16:27 -07:00
Brian Paul
488dd2c191 gallium: make vbuf_render::set_primitive() return void
All the implementations of this function always return TRUE.
2012-01-07 14:16:27 -07:00
Brian Paul
59d2c4f8e5 svga: fix assorted whitespace issues, add copyright comment 2012-01-07 14:16:27 -07:00
Brian Paul
78028dc2bd svga: add switch cases for PIPE_SHADER_CAP_OUTPUT_READ
Silences unhandled switch case warning.
Return 0 since we don't want to read from output regs.
2012-01-07 14:16:27 -07:00
Brian Paul
4c502e05e8 mesa: add/update comments in _mesa_copy_buffer_subdata() 2012-01-07 14:16:27 -07:00
Marek Olšák
2bdf93449a u_vbuf: don't unroll indices if mapping vertex buffers blocks 2012-01-07 20:48:28 +01:00
Dave Airlie
784026139c draw: fix missing include for u_format.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:57:12 +00:00
Dave Airlie
a103c61d27 st/mesa: add support for clip vertex.
We need to pass the pre-projection matrix clip planes into the driver,
instead of the post for the case we have a vertex shader that writes clip
vertex.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:36:25 +00:00
Dave Airlie
9cea86f501 gallium: add new semantic for clip vertex.
This is to match the gl_ClipVertex output from GLSL 1.20.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:36:24 +00:00
Dave Airlie
17707d89f4 draw: don't translate non-floats to float.
translate signed/unsigned integers to coresponding uint/sint r32g32b32a32 types.

This fixes a bunch of piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:31:43 +00:00
Dave Airlie
e1ff84371c st/mesa: fix default interpolation for colors.
Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

this is the final version that fixes the reflect regression.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:30:23 +00:00
Kenneth Graunke
be21ded2ae glsl/builtins: Add missing mix(genType, genType, bvec) built-ins.
The IR for mix(float, float, bool) was missing a write mask, causing the
IR reader to die horribly.  Furthermore, I neglected to add any of the
new prototypes to the 1.30 profiles.

Fixes oglconform's glsl-bif-com advanced.mix test cases.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44477
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-06 18:18:15 -08:00
Kenneth Graunke
7ccf04ebcf i965/vs: Fix invalid array access in copy propagation.
Accessing virtual_grf_reg_map[inst->dst.reg] is invalid if
inst->dst.file != GRF.  Since is_direct_copy already implies a GRF
destination, we can just move the check earlier.

Fixes a regression in commit 07ee9f374f.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44302
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 18:17:46 -08:00
Kenneth Graunke
de88e00c94 configure.ac: Remove unused GLUT substitutions.
GLUT was removed from the main tree a while ago; nothing uses these
substitutions.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-06 18:16:10 -08:00
Ian Romanick
1f125374e7 glsl: Don't mark assignment temporaries as read-only
The various l-value errors this was designed to catch are now caught
by other means.  Marking the temporaries as read-only now just
prevents sensible error messages from being generated.  It's

0:0(0): error: function parameter 'out p' references the read-only variable '_post_incdec_tmp'

versus

0:13(5): error: function parameter 'out p' references a post-decrement operation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-06 14:32:50 -08:00
Ian Romanick
208b5b113f glsl: Emit extra errors for l-value violations in 'out' or 'inout' parameters
Somethings, like pre-increment operations, were not previously caught.
After the 8.0 release, this code needs some major refactoring and
clean-up.  It's a mess. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
2012-01-06 14:32:50 -08:00
Ian Romanick
e9015e99d0 glsl: Emit errors for assignments to non-l-value expressions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
2012-01-06 14:32:50 -08:00
Ian Romanick
fa0a9ac5cd glsl: Track descriptions of some expressions that can't be l-values
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-06 14:32:50 -08:00
Brian Paul
c87247f6a8 mesa: remove gl_framebuffer:_DepthBuffer, _StencilBuffer fields
These were used by swrast to make a combined depth+stencil buffer look
like separate depth and stencil buffers.  But that's no longer needed
after rewriting the depth/stencil code in swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:34 -07:00
Brian Paul
21b28d520f swrast: remove s_depthstencil.[ch] files
The code is no longer used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:29 -07:00
Brian Paul
030e408181 swrast: remove calls to _swrast_update_depth/stencil_buffer()
These functions updated the gl_renderbuffer::_DepthBuffer and
_StencilBuffer fields.  But those fields are no longer used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:19 -07:00
Eric Anholt
deb6dd6b4d i965: Turn on ARB_depth_buffer_float by default.
Everything about this that we have tests for works except for the
deprecated metaops.  The conclusion we came to on IRC sounded like we
were OK with turning it on as long as core functionality works.  The
remaining failures (copypixels, drawpixels) should just be a matter of
finishing the MapRenderbuffer for them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:49:21 -08:00
Eric Anholt
3786a3e644 swrast: Convert the glBlitFramebuffer(GL_NEAREST) path to MapRenderbuffer().
Fixes on i965:
ARB_depth_buffer_float/fbo-depthstencil-GL_DEPTH32F_STENCIL8-blit
ARB_depth_buffer_float/fbo-stencil-GL_DEPTH32F_STENCIL8-blit

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:15 -08:00
Eric Anholt
61ea677bdd mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.
We were converting our ubyte stencil value to a float.  Just write it
as a uint, which overwrites the X24 part of X24S8 with 0 but shouldn't
matter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:08 -08:00
Eric Anholt
38c6f1e6ca swrast: Fix use of uninitialized value in rbmapping changes.
I'm so surprised that gcc didn't catch this that I feel like I must be
misreading.  srcMap is what we initialize (along with dstMap) from
this map value right after this check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:01 -08:00
Eric Anholt
fb5252a351 swrast: Use the fast copypixels code to implement fast glBlitFramebuffer().
They were meaning to do the same thing of memcpying rows, so just
write the code once.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:48:55 -08:00
Eric Anholt
cedbfc0050 swrast: Move the check for fast_copy_pixels() ability to caller.
I'm going to reuse this function from glBlitFramebuffer() handling,
which wants to do the same thing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:48:47 -08:00
Eric Anholt
60982976ee i965: Add sensible disasm for the JMPI instruction.
We care about the jump distance, not that the first src is always the
ip register.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:48:32 -08:00
Eric Anholt
cd2a24a4c2 i965/gen7: Enable transform feedback as long as kernel support is present.
The last major issue (intervening-read) is fixed, so let's turn this
on for real.  The only other known issue is a hardware limitation for
tesselation with flat shading.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-06 09:17:17 -08:00
Eric Anholt
6c0b70e774 i965/gen7: Fix up the transform feedback buffer pointers on later batches.
Fixes piglit EXT_transform_feedback/intervening-read

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:17:14 -08:00
Eric Anholt
7f91c8bf2b i965/gen7: Flush the batch between transform feedbacks.
We need the kernel to reset our pointers to 0 in between.  Note that
the initialization of function pointer had to move to after
InitContext since we didn't have intel->gen set up yet.

Fixes piglit EXT_transform_feedback/immediate-reuse

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:17:04 -08:00
Eric Anholt
c4089d444a i965/gen7: Use the updated interface for SO write pointer resetting.
The new kernel patch I submitted makes the interface opt-in, so all
batchbuffers aren't preceded by the 4 MI_LOAD_REGISTER_IMMs.  This
requires the updated i915_drm.h present in libdrm 2.4.30.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:16:32 -08:00
Alex Deucher
e60daf7e25 r600g: remove obsolete MULTIWRITE comment
fs writes all is implemented in the shader on eg+.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-06 10:15:37 -05:00
Kenneth Graunke
938490c3fe glsl_to_tgsi: Remove the obsolete remove_output_reads pass.
This is now handled by the GLSL compiler, so this code is dead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:37:02 +00:00
Vincent Lejeune
10937e6512 glsl_to_tgsi: Use the GLSL compiler's new remove-output-reads pass.
The existing glsl_to_tgsi::remove_output_read pass did not work properly
when indirect addressing was involved; this commit replaces it with a
lowering pass that occurs before TGSI code generation.

Fixes varying-array related piglit tests.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:52 +00:00
Vincent Lejeune
6d4b35c036 glsl: Add a lowering pass to remove reads of shader output variables.
This is similar to Gallium's existing glsl_to_tgsi::remove_output_read
lowering pass, but done entirely inside the GLSL compiler.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:44 +00:00
Dave Airlie
293a3916bd draw: fix piglit base vertex + user vertex array tests
This fixes
draw-elements-base-vertex user_varrays
draw-elements-instanced-base-vertex user_varrays
for softpipe with no llvm support (DRAW_USE_LLVM=false)

I'm not sure if this is the correct answer, but these tests were showing
a max_index of 7, then trying to fetch up to 43, maybe it should be fixing
max_index earlier somewhere to take care of this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:35 +00:00
ojab
2fe6c254f7 Strip LLVM svn rev from llvm-config --version output.
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
2012-01-05 22:44:16 -08:00
Vinson Lee
44c089bd48 mesa: Remove 'texelBytes' declarations that are only used in assertions.
This patch silences these GCC warnings.
warning: unused variable 'texelBytes'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 22:37:06 -08:00
Paul Berry
33fe021116 mesa: Fix transform feedback of unsubscripted arrays.
It is not explicitly stated in the GL 3.0 spec that transform feedback
can be performed on a whole varying array (without supplying a
subscript).  However, it seems clear from context that this was the
intent.  Section 2.15 (TransformFeedback) says this:

    When writing varying variables that are arrays, individual array
    elements are written in order.

And section 2.20.3 (Shader Variables), says this, in the description
of GetTransformFeedbackVarying:

    For the selected varying variable, its type is returned into
    type. The size of the varying is returned into size. The value in
    size is in units of the type returned in type.

If it were not possible to perform transform feedback on an
unsubscripted array, the returned size would always be 1.

This patch fixes the linker so that transform feedback on an
unsubscripted array is supported.

Fixes piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{4,8}]-no-subscript" and
"EXT_transform_feedback/output_type *[2]-no-subscript".

Note: on back-ends that set
gl_shader_compiler_options::LowerClipDistance (for example i965),
tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]" still fail.  I hope to address this in
a later patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry
cab179a165 Add .gitignore files to exclude unit test build artifacts from git
With the addition of unit tests in commit
3ef3ba4d2e, several additional build
artifacts are created:

  bin/depcomp
  bin/missing
  tests/Makefile
  tests/Makefile.in
  tests/glx/Makefile
  tests/glx/Makefile.in
  tests/glx/.deps/
  tests/glx/.gitignore

This patch adds all of these files to .gitignore.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry
4357f8b4dc mesa: Avoid segfault when getting an unbound transform feedback buffer name.
Previously we were using
gl_transform_feedback_object::Buffers[i]->Name to service an indexed
get request for GL_TRANSFORM_FEEDBACK_BUFFER_BINDING.  However, if no
buffer has been bound, gl_transform_feedback_object::Buffers[i] is
NULL, so this was causing a segfault.

This patch switches to using
gl_transform_feedback_object::BufferNames[i], which is equal to
gl_transform_feedback_object::Buffers[i]->Name if
gl_transform_feedback_object::Buffers[i] is not NULL, and 0 if it is
NULL.

Fixes piglit test "EXT_transform_feedback/get-buffer-state
indexed_binding".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:12 -08:00
Paul Berry
456279bb33 mesa: Fix transform feedback of gl_ClipDistance.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), references to gl_ClipDistance (a float[8] array) will
be converted to references to gl_ClipDistanceMESA (a vec4[2] array).

This patch modifies the linker so that requests for transform feedback
of gl_ClipDistance are similarly converted.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipDistance".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
913a5c238b mesa: Make tfeedback_decl::var_name a const char *.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
367b83f890 gallium: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
e8357cb03d i965: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
2169331d40 mesa: Add gl_transform_feedback_info::ComponentOffset.
When using transform feedback, there are three circumstances in which
it is useful for Mesa to instruct a driver to stream out just a
portion of a varying slot (rather than the whole vec4):

(a) When a varying is smaller than a vec4, Mesa needs to instruct the
driver to stream out just the first one, two, or three components of
the varying slot.

(b) In the future, when we implement varying packing, some varyings
will be offset within the vec4, so Mesa will have to instruct the
driver to stream out an arbitrary contiguous subset of the components
of the varying slot (e.g. .yzw or .yz).

(c) On drivers that set gl_shader_compiler_options::LowerClipDistance,
if the client requests that an element of gl_ClipDistance be streamed
out using transform feedback, Mesa will have to instruct the driver to
stream out a single component of one of the gl_ClipDistance varying
slots.

Previous to this patch, only (a) was possible, since
gl_transform_feedback_info specified only the number of components of
the varying slot to stream out.  This patch adds
gl_transform_feedback_info::ComponentOffset, which indicates which
components should be streamed out.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
989b5722dc i965: Fix transform feedback of gl_ClipVertex.
Previously, on i965 Gen6 and above, we weren't allocating space for
gl_ClipVertex in the VUE, since the VS was automatically converting it
to clip distances.  This prevented transform feedback from being able
to capture gl_ClipVertex.

This patch goes aheads and allocates space for gl_ClipVertex in the
VUE on Gen6 and above.  The old behavior is retained on Gen5 and
below, since (a) transform feedback is not yet supported on those
platforms, and (b) those platforms don't currently support
gl_ClipVertex anyhow.

Note: this constitutes a slight waste of VUE space for shaders that
use gl_ClipVertex and don't use transform feedback to capture it.
However, that seems preferable to making the VUE map (and all of the
state that depends on it) dependent on transform feedback settings.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipVertex".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
15f4bca2df i965: Fix transform feedback of gl_PointSize.
On i965 Gen6 and above, gl_PointSize is stored in component W of the
first VUE slot (which corresponds to VERT_RESULT_PSIZ in the VUE map).
Normally we store varying floats in component X of a VUE slot, so we
need special case logic for gl_PointSize.

For Gen6, we do this with a ".wwww" swizzle in the GS.  For Gen7, we
shift the component mask by 3 to select the W component.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_PointSize".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
1be0fd8c86 mesa: Fix extra memset in store_tfeedback_info()
Commit 9d36c96d6e (mesa: Fix
glGetTransformFeedbackVarying()) accidentally added an extra memset()
call to the store_tfeedback_info() function, causing
prog->LinkedTransformFeedback.NumBuffers to be erased.

This patch removes the extra memset and rearranges the other
operations in store_tfeedback_info() to be in the correct order.

Fixes piglit tests "EXT_transform_feedback/api-errors *unbound*"

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-05 13:26:48 -08:00
Brian Paul
a44d715d2b swrast: use memmove() instead of memcpy() in the SHIFT_ARRAY macro
The src/dst arrays would overlap but dst was less than src so a simple
version of memcpy() would do the right thing.  But this isn't guaranteed
when memcpy() is optimized.

Fixes demos/copypix when the dest region was clipped by the left side of
the window.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-05 12:49:45 -07:00
Bryan Cain
59be691638 st/mesa: add support for gl_ClipDistance 2012-01-05 13:03:26 -06:00
Bryan Cain
6951870e57 gallium: add support for clip distances 2012-01-05 13:03:25 -06:00
Marek Olšák
f82d40d4b1 glx/dri2: print FPS when env var LIBGL_SHOW_FPS is 1 (v2)
This is useful for apps which don't print FPS.
Only enabled in SwapBuffers.

v2: track state per drawable, use libGL prefix

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2012-01-05 18:29:11 +01:00
Marek Olšák
c77efc6bb6 r300/compiler: fix buffer underflow when setting SEM_WAIT on last instruction
Do it after we check whether inst_end != -1.
Also move the code structure at the beginning of r300_fragment_shader_code
to detect underflows easily with valgrind.
2012-01-05 18:29:11 +01:00
Marek Olšák
c2cc630f28 u_vbuf: use cso_cache to cache vertex element states
Improves performance to 28 fps in Cogs.
2012-01-05 18:29:11 +01:00
Marek Olšák
ce44bae366 u_vbuf: implement another upload codepath which unrolls indices
Improves performance from cca 1 fps to 23 fps in Cogs.
This new codepath is not always used, instead, there is a heuristic which
determines whether to use it. Using translate for uploads is generally
slower than what we have had already, it's a win only in a few cases.
2012-01-05 18:29:11 +01:00
Marek Olšák
2b851526c1 u_vbuf: cleanup variable names to be consistent 2012-01-05 18:29:11 +01:00
Marek Olšák
64242b23c1 u_vbuf: cleanup the computation of how many vertices to upload/translate 2012-01-05 18:29:11 +01:00
Marek Olšák
c897b943f4 u_vbuf: convert min_index,max_index to start,count 2012-01-05 18:29:11 +01:00
Marek Olšák
1ae9e588fa util: add helper function util_dump_draw_info 2012-01-05 18:29:11 +01:00
Marek Olšák
345b1a31c9 trace: dump primitive restart info 2012-01-05 18:29:11 +01:00
Marek Olšák
d1f11ed3ef translate: implement translation of 10_10_10_2 types
This is for GL_ARB_vertex_type_2_10_10_10_rev.
I just took the code from u_format_table.c. It's based on pack_rgba_float.
I had no other choice. The u_format hooks are not exactly compatible
with translate. The cleanup of it is left for future work.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
0a8a7144a1 translate: implement translation of (pure) integer formats
The conversion is limited to only a few cases, because converting to any other
type shouldn't happen in any driver.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
1ba3240b28 u_format: implement fetch_rgba_uint and fetch_rgba_sint for integer formats
Fetching int as float and vice versa is not allowed.
Fetching unsigned int as signed int and vice versa is not allowed either.
Doing conversions like that isn't allowed for samplers in OpenGL.

The three hooks could be consolidated into one fetch hook, which would fetch
uint as uint32, sint as sint32, and everything else as float. The receiving
parameter would be void*. This would be useful for implementing vertex fetches
for shader model 4.0, which has untyped registers.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
0950086376 gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY
Please see the diff for further info.

This paves the way for moving user buffer uploads out of drivers and should
allow to clean up the mess in u_upload_mgr in the meantime.

For now only allowed for buffers on r300 and r600.

Acked-by: Christian König <deathsimple@vodafone.de>
2012-01-05 18:29:11 +01:00
Marek Olšák
7cd1c62b6b gallium: remove deprecated PIPE_TRANSFER_DISCARD
PIPE_TRANSFER_DISCARD_RANGE is defined the same.
2012-01-05 18:29:11 +01:00
Marek Olšák
5968e4068c u_vbuf: translate per-vertex, per-instance, and constant attribs separately
We don't wanna convert per-instance or constant (zero-stride) attribs into
ordinary vertex attribs.

More importantly, the translation of instance attribs now finally works.
2012-01-05 18:29:11 +01:00
Marek Olšák
dbd60d27e8 u_vbuf: take start_instance into account when uploading instanced attribs 2012-01-05 18:29:11 +01:00
Marek Olšák
f94d390213 u_upload_mgr: remove the 'flushed' parameter
Not used by anybody.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
c727cc175b u_vbuf: don't map user buffers, just obtain a pointer to them 2012-01-05 18:29:11 +01:00
Marek Olšák
f430f794ac u_vbuf: only map a subrange of buffers to translate 2012-01-05 18:29:11 +01:00
Marek Olšák
214b87aa04 gallium: fix behavior of pipe_buffer_map_range
To match what transfer_map returns. Really, subtracting the offset leads
to bugs if someone expects it to work exactly like transfer_map.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
fb0aa34fab u_vbuf: remove the workaround for half floats and translate 2012-01-05 18:29:11 +01:00
Marek Olšák
1acef6a746 translate: implement translation of half floats in the generic codepath 2012-01-05 18:29:11 +01:00
Eric Anholt
501e2e3b6d mesa: Remove the dead Varyings list in the program.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-05 09:11:29 -08:00
Eric Anholt
9d36c96d6e mesa: Fix glGetTransformFeedbackVarying().
The current implementation was totally broken -- it was looking in an
unpopulated structure for varyings, and trying to do so using the
current list of varying names, not the list used at link time.

v2: Fix leaking of memory into the program per re-link.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-05 09:11:29 -08:00
Jakob Bornecrantz
cc1d8a466a svga: Trim the dri binary a bit on scons release builds
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-05 17:23:32 +01:00
Jakob Bornecrantz
2bb9c64489 svga: Fix texture cube param cap
Spotted by Thomas Hellstrom.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-05 17:23:32 +01:00
Brian Paul
85b5dac705 tgsi: consolidate TGSI string arrays in new tgsi_strings.h
There was some duplication between the tgsi_dump.c and tgsi_text.c
files.  Also use some static assertions to help catch errors when
adding new TGSI values.

v2: put strings in tgsi_strings.c file instead of the .h file.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 09:01:43 -07:00
Brian Paul
188aca3492 gallium: add STATIC_ASSERT macro 2012-01-05 08:19:23 -07:00
Brian Paul
6aed626c35 mesa: only map src/dest regions in _mesa_copy_buffer_subdata()
We were wastefully mapping the whole source/dest buffers before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-01-05 08:14:32 -07:00
Brian Paul
b330f1f13c mesa: print more info in buffer_object_subdata_range_good() error message 2012-01-05 08:14:26 -07:00
Brian Paul
a61e164ae0 st/mesa: 80-column wrapping 2012-01-05 08:14:01 -07:00
Kenneth Graunke
9d21b5dd26 Revert "configure.ac: remove deprecated --with-driver="
This reverts commit 5a478976ae.

It broke the build.  DRI drivers were no longer being installed by
`make install` (and probably not being built at all).  It appears to be
due to a few small, subtle mistakes, and the fix isn't clear enough to
simply commit without going through review.  In the meantime, revert it.
2012-01-04 23:49:18 -08:00
Matt Turner
cb96b06130 glsl: rename VERSION to VERSION_TOK for automake
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-04 19:27:56 -08:00
Matt Turner
5172383de0 configure.ac: bump AC_PREREQ to 2.60
All other xorg modules require at least 2.60 (released in 2006), so we
may as well increase it to match.  It's also doubtful anyone tests the
build with 2.59 (from 2003), so it may not even work anyway.
2012-01-04 19:23:39 -08:00
Matt Turner
5a478976ae configure.ac: remove deprecated --with-driver=
See 9e7a4147.
2012-01-04 19:23:22 -08:00
Ian Romanick
f22ecaa14f i965: Enable EXT_texture_integer by default
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-with-reservations-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 16:54:21 -08:00
Ian Romanick
0e52be58f0 mesa: Add missing GL_RG_INTEGER cases
Adds two missing '|| srcFormat == GL_RG_INTEGER' in assertions and a
bunch of missing pixel converions cases.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 16:52:46 -08:00
Kenneth Graunke
a0a0a909f2 i965: Fix infinite loop regression in intel_miptree_all_slices_resolve.
Commit 0ed11e3331 fixed a "use after free"
bug by getting the next pointer before deleting the current node.

Unfortunately, it also made "next" never get updated if i->need != need.

Fixes infinite loops in piglit tests fbo-depth-array and fbo-depthtex.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-04 15:51:51 -08:00
Kenneth Graunke
fbbbc8c04e i965/vs: Use the proper dimensionality for the sampler result register.
textureSize() returns an int, ivec2, or ivec3, but never an ivec4.
Creating the destination register as an ivec4 triggered later failures,
even though the register did hold the proper values.

For example, piglit test vs-textureSize-compare calls textureSize on a
2D texture and compares the result to an expected value.  Unfortunately,
our generated code also tried to compare the third and fourth components
which were undefined, and failed.

Fixes piglit test vs-textureSize-compare as well as 19 subcases of
oglconform's glsl-bif-tex-size test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44339
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 15:07:40 -08:00
Kenneth Graunke
207cbc68dc i965: Add missing _NEW_TEXTURE dirty bit to brw_vs_prog state atom.
Commit d45814c925 totally added a data
dependency on _NEW_TEXTURE, even including the comment, but didn't
actually add the dirty bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 15:07:40 -08:00
Paul Berry
86bb45ffc3 mesa: Additional error checks for transform feedback.
From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT
    if no binding points would be used, either because no program object is
    active or because the active program object has specified no varying
    variables to record.

    ...

    The error INVALID_VALUE is generated by BindBufferRangeEXT or
    BindBufferOffsetEXT if <offset> is not word-aligned.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors no_prog_active
- EXT_transform_feedback/api-errors interleaved_no_varyings
- EXT_transform_feedback/api-errors separate_no_varyings
- EXT_transform_feedback/api-errors bind_offset_offset_1
- EXT_transform_feedback/api-errors bind_offset_offset_2
- EXT_transform_feedback/api-errors bind_offset_offset_3
- EXT_transform_feedback/api-errors bind_offset_offset_5

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:53 -08:00
Paul Berry
ebfad9f6a1 mesa: Check that all buffers are bound in BeginTransformFeedback.
From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is generated by
    BeginTransformFeedbackEXT if any transform feedback buffer object
    binding point used in transform feedback mode does not have a
    buffer object bound.

This required adding a new NumBuffers field to the
gl_transform_feedback_info struct, to keep track of how many transform
feedback buffers are required by the current program.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors interleaved_unbound
- EXT_transform_feedback/api-errors separate_unbound_0_1
- EXT_transform_feedback/api-errors separate_unbound_0_2
- EXT_transform_feedback/api-errors separate_unbound_1_2

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:48 -08:00
Paul Berry
1979e22e13 mesa: Fix typos in transform feedback error messages.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:40 -08:00
Ian Romanick
3946448951 glsl: Don't use base type for bit-not when there's an error
Other parts of the compiler assume that expressions will have
well-formed types or the error type.  Just using the type of the thing
being operated on can cause expressions like ~3.14 or ~false to not
have a well-formed type.  This could then result in an assertion
failure in the context epxression handler.

If there is an error processing the expression, set the type of the IR
expression to error.

Fixes piglit's bit-not-0[789].frag tests.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
2012-01-04 12:43:10 -08:00
Ian Romanick
4becf676e0 glx: More hacking around versions of XCB that lack GLX_ARB_create_context support
Detect whether a new enough version of XCB is installed at configure
time.  If it is not, don't enable the extension and don't build the
unit tests.

v2: Move the AM_CONDIATION outside the case-statement so that it is
invoked even for non-GLX builds.  This prevents build failures with
osmesa, for example.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Robert Hooker <robert.hooker@canonical.com>
2012-01-04 12:43:10 -08:00
Brian Paul
c2e537fef2 gallium/util: fix argument cast in x32_s8_get_tile_rgba() call 2012-01-04 13:35:13 -07:00
Brian Paul
2a0c515b89 st/mesa: remove st_CompressedTexSubImage1D/2D/3D()
Just use the core Mesa functions instead.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:41 -07:00
Brian Paul
2972547047 st/mesa: fix indentation in st_copy_texsubimage() 2012-01-04 13:30:35 -07:00
Brian Paul
5d67d4fbeb st/mesa: remove st_TexImage(), use core Mesa code instead
The core Mesa code does the equivalent memory allocation, image mapping,
storing and unmapping.  We just need to call prep_teximage() first to
handle the 'surface_based' stuff.

The other change is to always use the level=0 mipmap image when accessing
individual mipmap level images that are stored in resources/buffers.
Apparently, we were always using malloc'd memory for individual mipmap
images, not resource buffers, before.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:35 -07:00
Brian Paul
19840c46f3 st/mesa: refactor gl_TexImage() code into prep_teximage()
Preparation for st_TexImage() removal/refactoring.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:35 -07:00
Ian Romanick
18f53efa01 intel: Re-enable GL_OES_standard_derivatives on GEN4+
This extension only needs to be disabled on GEN3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 10:31:16 -08:00
Eric Anholt
43f12e5eb8 intel: Re-allow blitting glCopyBufferSubData() on gen >= 6.
This was disabled a year ago due to not having a story for handling
the blitter at the time.  We're fine with using the blitter now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Eric Anholt
8aa7fa770c intel: Fix pitch handling for linear blits.
The new assert in intelEmitCopyBlit() gets angry if we don't align to
dwords.  Rather than make the assert have a special case for height ==
1 on the assumption that the hardware doesn't use it in that case,
just supply a correct pitch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Eric Anholt
15e309cf84 intel: Fix bad read/write flags on self-copies for glCopyBufferSubData().
We didn't consume these flags in any way that would produce a
functional difference, but we might have some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Adam Jackson
3bc4959b14 Remove xmesa_xf86.h
This was a leftover from libGLcore.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-04 11:32:38 -05:00
Adam Jackson
2af17433b5 drisw: Fix drawable creation against non-default screens
We don't want to match the visual against the default screen.  If the
drawable is on a non-default screen then the appropriate visual might not
exist on the default screen.  Conversely, if the same visual is
available on multiple screens then simply selecting for the right VID is
sufficient, since the server has promised that the same visual is
compatible with multiple screens.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-04 11:23:55 -05:00
Brian Paul
892a2542a3 mesa: remove unused _mesa_init_teximage_fields() target parameter
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-01-04 08:12:28 -07:00
Christian König
7b181d16c3 vl/mpeg2: simple fix to get xine running again
Otherwise xines xxmc plugin will just display green blocks.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-04 16:01:09 +01:00
Ian Romanick
4535874c1a ff_fragment_shader: Don't generate swizzles for scalar combiner inputs
There are a couple scenarios where the source could be zero and the
operand could be either SRC_ALPHA or ONE_MINUS_SRC_ALPHA.  For
example, if the source was ZERO.  This would result in something like
(0).w, and a later call to ir_validate would get angry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
2012-01-03 19:21:19 -08:00
Anuj Phogat
0ed11e3331 Fix read from pointer after free
Coverity reported a read from pointer after free defect in
src/mesa/drivers/dri/intel/intel_mipmap_tree.c. Bug# 44205
In intel_miptree_all_slices_resolve() function, i = i->next was
executing after freeing i. I have defined a temporary variable
(next) to store the value of i->next before freeing i

Reported-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-03 19:04:03 -08:00
Matt Turner
2f1ab63fab configure.ac: fix typo from 3ef3ba4d2 2012-01-03 21:58:37 -05:00
Christoph Bumiller
7e291e922e st/mesa: use SINT/UINT formats for VertexAttribIPointer
Reviewed-by: Dave Airlie <airlied@redhat.com>

v2: added assertion that packed formats are not pure integer
2012-01-03 23:00:31 +01:00
Dave Airlie
69111847a2 tgsi/softpipe: disable FAST_MATH
In the interest of softpipe preferring correctness over speed and passing more
piglit tests, set this to off by default. For speed you really want llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 16:19:08 +00:00
Morgan Armand
e763b6e788 softpipe: remove the 32bits limitation on depth(-stencil) formats
This patch remove the 32bits limitation. As a side effect, it bring the support for the GL_ARB_depth_buffer_float extension.
No regression have been found on piglit, and all tests for GL_ARB_depth_buffer_float pass successfully.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 16:19:08 +00:00
Alexander von Gluck
2ae591bdf1 gallium: use Haiku provided debug_printf in OS.h
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-03 08:10:49 -07:00
Vadim Girlin
d4bf5cefb0 glsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage
If glUniform1i and friends are going to dump data directly in
driver-allocated, the pointers have to be updated when the storage
moves.  This should fix the regressions seen with commit 7199096.

I'm not sure if this is the only place that needs this treatment.  I'm
a little uncertain about the various functions in st_glsl_to_tgsi that
modify the TGSI IR and try to propagate changes about that up to the
gl_program.  That seems sketchy to me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

v2:

Revalidate when shader_program is not NULL.
Update the pointers for all _LinkedShaders.
Init glsl_to_tgsi_visitor::shader_program to NULL in the
get_pixel_transfer_visitor & get_bitmap_visitor.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-03 09:28:58 -05:00
Ian Romanick
f433fe015e glx: Hack around versions of XCB that lack GLX_ARB_create_context support
A lot of tests in 'make check' will fail under these circumstances,
but at least the build should work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 10:24:10 +00:00
Ian Romanick
b518dfb513 mesa: XCB is no longer optional for GLX or DRI
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 10:24:01 +00:00
Brian Paul
14aff23e1b intel: include version.h in intel_screen.c to silence warning
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-02 15:20:15 -07:00
Ian Romanick
596d9f6dd1 dri_util: Fix order of error and data parameters to dri2CreateContextAttribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 13:39:41 -08:00
Dave Airlie
77058335eb r600g: add missing colorswaps for r8 uint/sint.
fixes some warnings in GL3.0 tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-02 20:45:20 +00:00
Ian Romanick
3ef3ba4d2e tests/glx: Add unit tests for GLX_ARB_create_context GLX protocol
This adds a new tests directory at the top-level and some extra build
infrastructure.  The tests use the Google C++ Testing Framework, and
they will only be built if configure can detect its availability.  The
tests are automatically wired-in to run with 'make check'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
8a4b36de05 glx: Don't use 'new' as a function parameter name
Using 'new' as a function parameter name prevents including
glxclient.h the unit tests (future patch) that use the Google C++
Testing Framework.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
e6280c3ba9 glx: Enable GLX_EXT_create_context_es2_profile
This extension is only enabled if the underlying driver advertises
support for OpenGL ES 2.0.  This happens either through the getAPIMask
function in version 2 of the DRI2 extension or implicity through
version 2 of the DRISW extension.

Since there is no OpenGL ES 2.0 protocol, this extension is marked as
only available with direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
e532b6288f dri2: Add plumbing to get context version requirements and flags to drivers
This adds support for DRI_DRI2 version 3 to all of the DRI2 drivers.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
296fe21ae5 glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contexts
This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRISW
version 3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
b45f77dc4c glx/dri: Add utility function dri2_convert_glx_attribs
This converts all of the GLX data from glXCreateContextAttribsARB to
the values expected by the DRI driver interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
4c7898cb13 st/mesa: Reject forward-looking contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
d9de33c304 dri_util: Mostly stub implementation of dri2CreateContextAttribs
This adds the function and modifies dri2CreateNewContextForAPI to call
it.  At this point only version 2 of the DRI2 API is advertised to the
loader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
c9d25cf73f glx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile
Note that these extensions are not automatically enabled for screens
capable of direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
78aa71a3ce glx: Connect glXCreateContextAttribsARB to glXGetProcAddress
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
588042a8ec glx: Initial implementation of glXCreateContextAttribsARB
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
48ffc6a155 glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts
This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRI2 version
3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
6a0640971f glx: Implement glx_screen_vtable::create_context_attribs for indirect contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
43409fa7b0 glx: Add glx_screen_vtable::create_context_attribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
eacd61bfef glx: Use __glX_send_client_info with XCB
__glX_send_client_info only supports XCB, so use that instead of
__glXClientInfo when USE_XCB is defined.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
6ccda72bf8 glx: Add __glX_send_client_info super function
This function picks the correct client-info protocol (based on the
server's GLX version and set of extensions) and sends it to the
server.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Christoph Bumiller
fc7ac4da7d glsl-to-tgsi: handle ir_unop_round_even 2012-01-02 21:16:03 +01:00
Bryan Cain
09497e020a glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced() 2012-01-02 14:09:45 -06:00
Paul Berry
7cbcce383c swrast: Remove dead code in _swrast_clear_depth_buffer()
This code was generating the gcc warning:

  variable ‘clearValue’ set but not used [-Wunused-but-set-variable]

Reviewed-by: Brian Paul <brianp@vmare.com>
2012-01-02 11:10:57 -08:00
Brian Paul
01a63f4bf5 radeon: move declarations before code 2012-01-02 11:55:40 -07:00
Brian Paul
5edc6fef4c radeon: add casts to silence warnings 2012-01-02 11:55:39 -07:00
Brian Paul
d939838267 radeon: remove unused tex image function prototypes 2012-01-02 11:55:39 -07:00
Brian Paul
d69d287068 mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions
The were always zero.  When doing a sub-texture replacement we account
for the dstX/Y/Zoffsets when we map the texture image.  So no need to
pass them into the texstore code anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Brian Paul
e833b98182 intel: pass xoffset, yoffset = 0 to _mesa_texstore()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Eric Anholt
c82c24b18b i965: Silence gcc warning about uninitialized "inst" in assert() case. 2012-01-02 10:38:47 -08:00
Eric Anholt
bf2c7469fb i965: Silence gcc warning from resizing EU store changes. 2012-01-02 10:38:47 -08:00
Christian König
bce506ffc0 vl: seperate shader buffers from components
Buffers for shader based decoding can now be
released without its component still being around.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-01-02 12:47:15 +01:00
Marek Olšák
2cd7e5b737 r300g: inline r300_resource_set_properties 2012-01-01 11:47:06 +01:00
Marek Olšák
ce9d61fec6 r300g: rework resource_copy_region, not changing pipe_resource
Changing pipe_resource was wrong, because it can be used by other contexts
at the same time. This fixes the last possible race condition in r300g
that I know of.

This also fixes blitting NPOT compressed textures. Random pixels sometimes
appeared at the right-hand edge of the texture.

Finally, this removes r300_texture_desc::stride_in_pixels. It makes little
sense with sampler views and surfaces being able to override width0, height0,
and the format entirely.
2012-01-01 11:47:05 +01:00
Marek Olšák
ce31970af1 u_blitter: expose functions for setting default views and surfaces for copying
And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.
2012-01-01 11:47:05 +01:00
Dave Airlie
b5fd0e04a7 st_glsl_to_tgsi: translate interp mode for front/back color
this fixes a bunch of interpolation tests on softpipe at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:48:19 +00:00
Dave Airlie
c44f6e0489 softpipe: reorder LIT to fix fp-lit-src-equals-dst
This reorders the LIT operation like the r600 one to fix the
fp-lit-src-equals-dst piglit test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:17:23 +00:00
Dave Airlie
24668a38d1 llvmpipe: fix blending for intensity formats
This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 12:37:48 +00:00
Brian Paul
99fbf7ce34 st/mesa: remove stImage->base.Face/Level assignments in st_TexImage()
This fixes a regresssion (broken cube maps) caused by the
ctx->Driver.TexImage parameter simplification commit.  The target var
is always GL_TEXTURE_CUBE_MAP at this point so the Face field was always
getting set to zero.

These field assignments aren't needed anyway since core Mesa sets them.
2011-12-30 16:42:27 -07:00
Dave Airlie
bed4c7ea5e u_format: fix latc fetches.
This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2011-12-30 21:20:18 +00:00
Dave Airlie
0c6ee788f2 u_format/rgtc: fix alpha values in returned texels.
This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc
on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 20:31:34 +00:00
Alexander von Gluck
141d961d84 glsl: fix usage of potentially undefined data_end union
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-30 08:48:51 -07:00
Brian Paul
797960dbec st/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=44234
2011-12-30 08:38:58 -07:00
Brian Paul
bec2ea8ef4 mesa: simplify Driver.GetCompressedTexImage() parameters
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
94a0c518dc mesa: simplify Driver.CompressedTex[Sub]Image function parameters
As with previous commits, the target, level and texObj info can be
obtained through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
92c64624cd mesa: simplify Driver.TexImage() parameters
As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
da0cc82a09 mesa: simplify Driver.TexSubImage() parameters
There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
c22a95c4f2 st/mesa: remove TexSubImage code, use core mesa routines instead.
Since the move to Map/UnmapTextureImage, the core mesa routines are
equivalent to what the state tracker was doing.

The TexImage functions can be replaced too, but there's a few differences
that will need to be handled.
2011-12-30 08:24:55 -07:00
Dave Airlie
4ca624f8e0 u_format: fix inv_swizzles generation
inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.

This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.

Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 13:43:52 +00:00
Michel Dänzer
7dd2d29a56 r600g: Manage fences per screen rather than per context.
A fence is a screen object and can outlive the context it was created from.
The previous code would access freed memory in that case, resulting in
various problems.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=44151
       https://bugs.freedesktop.org/show_bug.cgi?id=44007

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

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-12-30 10:45:31 +01:00
Stéphane Marchesin
0e57b66fa1 i915g: Allocate tmp for KILP
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=44297
2011-12-30 01:33:26 -08:00
Yuanhan Liu
efa1fac215 vbo: introduce vbo_sizeof_ib_type() function
introduce vbo_sizeof_ib_type() function to return the index data type
size. I see some place use switch(ib->type) to get the index data type,
which is sort of duplicate.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 13:53:40 +08:00
Stéphane Marchesin
ded02bd54b llvmpipe: Remove useless draw_install_pstipple_stage call.
It is #ifdef'd out, and is already called unconditionnaly a couple lines above.

Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
2011-12-29 12:28:44 -08:00
Chad Versace
747f030762 intel: Fix memory leak in intel_miptree_create()
On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-29 10:47:44 -08:00
Eric Anholt
069901e2f5 i965/fs: Allow constant propagation into IF with embedded compare.
This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.
2011-12-29 09:33:56 -08:00
Eric Anholt
6a1e19d0f6 intel: Drop the batchbuffer flush on glRenderbufferStorage().
There's nothing batchbuffer-related here.  State updates by the caller
will trigger re-emitting of any new hardware state.
2011-12-29 09:33:56 -08:00
Eric Anholt
2529fde36e intel: Drop the batchbuffer flush on glFramebufferRenderbuffer().
There should be nothing special about this call compared to other
callers of intel_draw_buffer().
2011-12-29 09:33:56 -08:00
Eric Anholt
b890f1090c intel: Make the batchbuffer flush debug more useful.
We were printing out the line triggering the flush, but a variety of
different causes just printed the line number for intel_flush()'s call
of intel_batchbuffer_flush().  Plumb the line numbers from the caller
of intel_flush() on through.
2011-12-29 09:33:56 -08:00
Eric Anholt
7f854a5028 intel: Fix performance regression in Lightsmark since HiZ changes.
Since the refactor in d7b33309fe, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43329
2011-12-29 09:33:56 -08:00
Eric Anholt
ab7794cada intel: Don't consider miptrees for other texture targets to match.
We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.
2011-12-29 09:33:56 -08:00
Vinson Lee
0ddb759991 mesa: Use __builtin_ffsll on Mac OS X.
Fixes this GCC warning.
arrayobj.c: In function '_mesa_update_array_object_max_element':
arrayobj.c:310: warning: implicit declaration of function 'ffsll'

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-28 23:27:55 -08:00
Stéphane Marchesin
11cdf24d15 i915g: Add missing draw_flush call.
Fixes a bunch of corruption bugs, especially some missing clipped triangles.
2011-12-28 12:36:26 -08:00
José Fonseca
62e968d6da mesa: Re-add main/bitset.h to fix classic nouveau build failure.
bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'`
-- and the state stored is too big to fit in 64bit integers (it requires
approximately 87 bits), so there is no obvious alternative here.

This effecively reverts commit 196800d798.
2011-12-28 11:14:52 +00:00
Mathias Fröhlich
196800d798 mesa: Remove now unused main/bitset.h.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
1ef3a94536 mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.
Since commit 82b9661894 and
34eae1c72a vbo support
is mandatory for all drivers. So, remove the remaining
FEATURE_ARB_vertex_buffer_object guards.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
ccbf192f59 mesa: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
45cd15bfae radeon: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
19c46d3d7b nouveau: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
b49b1e4642 i915: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
50e0091a9d mesa: Convert RENDERINPUTS* macros to GLbitfield64.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Stéphane Marchesin
b50d250e02 i915g: Only apply the optimization to output vars.
This is a bit overkill, but otherwise we need to rename subsequent uses, which is a future TODO.
Reported by CME.
2011-12-27 17:08:26 -08:00
Kenneth Graunke
07ee9f374f i965/vs: Properly clear cur_value when propagating direct copies.
Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:38 -08:00
Kenneth Graunke
443c8d1ab7 i965/vs: Fix incorrect subscript when resetting copy propagation records.
In this code, 'i' loops over the number of virtual GRFs, while 'j' loops
over the number of vector components (0 <= j <= 3).

It can't possibly be correct to see if bit 'i' is set in the destination
writemask, as it will have values much larger than 3.  Clearly this is
supposed to be 'j'.

Found by inspection.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:37 -08:00
Chad Versace
7420c9dab4 i965: Create mock implementation of GL_OES_EGL_image_external
In Android IceCreamSandwich, SurfaceFlinger requires GL_OES_image_external
for basic compositing tasks. Without the extension, SurfaceFlinger fails
to start.

Despite the incompleteness of the extension's implementation introduced by
this patch, it is good enough to enable SurfaceFlinger and to unblock the
people who need to begin testing Mesa on IceCreamSandwich.

To enable the extension, set the environment variable
MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external". Ideally, Android
should set this in init.rc.

WARNING: This implementation of GL_OES_EGL_image_external is not complete.
Some of it is even incorrect. When we begin to really implement
GL_OES_EGL_image_external, much of the patch will need reverting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Chad Versace
7e5ffd9be2 meta: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()
If the meta flag MESA_META_TEXTURE is present, then disable the texture
target GL_TEXTURE_EXTERNAL_OES.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Alexander von Gluck
ac8a933aa8 mklib: tab cleanup, no functional change
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:18:25 -07:00
Alexander von Gluck
a3752fa63b mesa: fpclassify is available on Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:56 -07:00
Alexander von Gluck
2e60c955c2 glu: remove BeOS define as BeOS is not longer a target platform
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:51 -07:00
Alexander von Gluck
9e4c8ce3bc gallium: use Mesa pthread_barrier_t on Haiku, as it is incomplete under Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:30 -07:00
Dave Airlie
157566860d gallium/u_pack: fix l8/i8 pack color ub
just noticed this in passing, not sure it actually fixes any issus.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-27 10:35:09 +00:00
Mathias Fröhlich
91d950bad1 vbo: Clean up recalculate_input_bindings.
Now the gl_array_object's layout matches the one used in
recalculate_input_bindings. Make use of this and remove the
bind_array_obj function.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-27 08:57:41 +01:00
Alexander von Gluck
a5608a5098 mklib: Add Haiku build support
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-26 16:23:03 -07:00
Johannes Obermayr
aa284042a3 Fix build with LLVM >= r145623.
This is a workaround for https://bugs.freedesktop.org/show_bug.cgi?id=43861.

Actually the issue which makes -pedantic failing should be solved.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-26 16:12:10 -07:00
Brian Paul
98dffd9764 swrast: assert _swrast_map_teximage() x, y is multiple of block size 2011-12-26 15:22:26 -07:00
Brian Paul
08a81c8697 swrast: replace assertion with conditional in _swrast_map_teximage()
Just in case we ran out of memory when trying to allocate the texture
memory.
2011-12-26 15:22:26 -07:00
Brian Paul
62f2d6ef03 mesa: fix signed/unsigned comparison warnings 2011-12-26 15:22:26 -07:00
Brian Paul
0a7602b938 vbo: signal _NEW_ARRAY when transitioning between glBegin/End, glDrawArrays
This fixes a regression seen with the isosurf demo when switching between
glBegin/End and glDrawArrays (do it several times).  The problem was the
driver wasn't getting _NEW_ARRAY when the arrays were subtly changed:
(vertex3f, normal3f) vs. (normal3f, vertex3f).

This patch fixes that by signaling _NEW_ARRAY whenever we transition
between glBegin/End and glDrawArrays mode and display lists.

The patch also fixes up the initialization of the map_vp_none[] array
to stop putting strange values in the last five elements of the array.

v2: remove DRAW_ELEMENTS, don't distinguish between glDrawArrays and
glDrawElements

v3: add DRAW_DISPLAY_LIST for the display list case, just to be safe.

Reviewed-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 15:21:32 -07:00
Mathias Fröhlich
31bf243a92 mesa: remove leftovers from color indexed rendering.
Remove gl_light::_dli and gl_light::_sli.
Both are only used for a value previously used in
color indexed rendering. Also both variables are only used
and never written.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 21:47:06 +01:00
Mathias Fröhlich
5584a8eb19 mesa: remove unused _mesa_copy_materials.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 21:46:56 +01:00
Christian König
7ac114f94a vl: call decode_bitstream only once
Submit all bitstreams at once to decode_bitstream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-26 16:37:47 +01:00
Yuanhan Liu
3aa3c3f758 i965: increase the brw eu instruction store size dynamically
Here is the final patch to enable dynamic eu instruction store size:
increase the brw eu instruction store size dynamically instead of just
allocating it statically with a constant limit. This would fix something
that 'GL_MAX_PROGRAM_INSTRUCTIONS_ARB was 16384 while the driver would
limit it to 10000'.

v2: comments from ken, do not hardcode the eu limit to (1024 * 1024)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:24:42 +08:00
Yuanhan Liu
8d1b378939 i965: call next_insn() before referencing a instruction by index
A single next_insn may change the base address of instruction store
memory(p->store), so call it first before referencing the instruction
store pointer from an index.

This the final prepare work to enable the dynamic store size.

v2: comments from Ken, define emit_endif as bool type

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:23:12 +08:00
Yuanhan Liu
328e6a5497 i965: get the jmp distance by instruction index
If dynamic instruction store size is enabled, while after the brw_JMPI()
and before the brw_land_fwd_jump() function, the eu instruction store
base address(p->store) may change. Thus, the safe way to reference the
jmp instruction is by index instead of by the instruction address.

v2: comments from Eric, don't change the prototype of brw_JMPI

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:21:56 +08:00
Yuanhan Liu
0a17093eaf i965: let the if_stack just store the instruction index
If dynamic instruction store size is enabled, while after
the brw_IF/ELSE() and before the brw_ENDIF() function, the
eu instruction store base address(p->store) may change.

Thus let if_stack just store the instruction index. This is
somehow more flexible and safe than store the instruction
memory address.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-26 11:19:17 +08:00
Marek Olšák
2175634e73 r600g: fix a warning that a variable may be uninitialized 2011-12-25 10:18:48 +01:00
Marek Olšák
1b9577b833 gallium: remove PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS
It's the same as PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-25 10:18:47 +01:00
Marek Olšák
ec9b154b8c st/mesa: use a cast wrapper function to get st_transform_feedback_object 2011-12-25 10:18:43 +01:00
Marek Olšák
7191298829 st/mesa: DrawTFB should use the vertex count from the last call of EndTFB
From ARB_transform_feedback2:
    ... the vertex count used for the rendering operation is
    set by the previous EndTransformFeedback command.
2011-12-25 09:24:51 +01:00
Marek Olšák
ec4851253b r300g: mapping buffers for read should be unsynchronized
The GPU never uses them for write.
2011-12-24 21:28:43 +01:00
Marek Olšák
93f4e3cb6c winsys/radeon: move managing GEM domains back to drivers
This partially reverts commit 363ff84475.

It caused severe performance drops in Nexuiz. Reported by Phoronix.

Tested by me on r300g and by IRC people on r600g.
2011-12-24 21:28:43 +01:00
Paul Berry
e6e9becd50 i965 gen6: Fix incorrect order of dwords in gen6_update_sol_indices()
When updating SOL indices, we were accidentally putting the starting
index in dword 1 and the SVBI number to increment in dword 2--these
should be reversed.  Usually both of these values are zero, so we
didn't see any problem.  However, if a transform feedback operation
spans multiple batch buffers, the starting index will be nonzero.

Fixes piglit test "EXT_transform_feedback/intervening-read output".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-24 09:12:27 -08:00
Paul Berry
b31f62c907 i965 gen6: Fix transform feedback of triangle strips.
When rendering triangle strips, vertices come down the pipeline in the
order specified, even though this causes alternate triangles to have
reversed winding order.  For example, if the vertices are ABCDE, then
the GS is invoked on triangles ABC, BCD, and CDE, even though this
means that triangle BCD is in the reverse of the normal winding order.
The hardware automatically flags the triangles with reversed winding
order as _3DPRIM_TRISTRIP_REVERSE, so that face culling and two-sided
coloring can be adjusted to account for the reversed order.

In order to ensure that winding order is correct when streaming
vertices out to a transform feedback buffer, we need to alter the
ordering of BCD to BDC when the first provoking vertex convention is
in use, and to CBD when the last provoking vertex convention is in
use.

To do this, we precompute an array of indices indicating where each
vertex will be placed in the transform feedback buffer; normally this
is SVBI[0] + (0, 1, 2), indicating that vertex order should be
preserved.  When the primitive type is _3DPRIM_TRISTRIP_REVERSE, we
change this order to either SVBI[0] + (0, 2, 1) or SVBI[0] + (1, 0,
2), depending on the provoking vertex convention.

Fixes piglit tests "EXT_transform_feedback/tessellation
triangle_strip" on Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-24 09:12:27 -08:00
Brian Paul
5c818c6277 mesa: consolidate texstore functions
The code for storing 1D, 2D and 3D tex images (whole or sub-images) was
all pretty similar.  This consolidates those six paths.

v2: rework switch statement to catch unexpected targets

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 09:25:41 -07:00
Brian Paul
afebe13986 mesa: fix _mesa_store_texsubimage2d() for GL_TEXTURE_1D_ARRAY
For 1D arrays, map each slice separately.  Note that this was handled
correctly in _mesa_store_teximage2d() but not here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 09:25:41 -07:00
Brian Paul
9b26aa4c7a mesa: update comment for MapTextureImage() 2011-12-24 09:25:41 -07:00
Brian Paul
c60ac7b179 swrast: rewrite glDrawPixels(GL_DEPTH) with zoom
This gets rid of another renderbuffer->PutRow() call and _DepthBuffer
usage.  We always work with 32-bit uint Z values now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:41 -07:00
Brian Paul
bf0c0ccbc9 swrast: stop using _DepthBuffer in triangle code
The only consequence is we can only use the occlusion_zless_16_triangle()
function with MESA_FORMAT_Z16.
2011-12-24 09:25:40 -07:00
Brian Paul
7a7b521ff2 mesa: remove gl_renderbuffer::PutRowRGB()
No longer used anywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
6e7bc79578 swrast: stop using PutRowRGB() in triangle code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
743c664c8c swrast: refactor/rewrite fast_draw_rgba_pixels()
Use Map/UnmapRenderbuffer() for the special, optimized cases we care about.

Note that we're dropping some seldom-used cases in the new fast-path
code: as CI->RGB conversion and zooming.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:36 -07:00
Brian Paul
e66858fb67 swrast: move swrast_render_start/finish() call in drawpixels code
We don't want to call these functions where we'll be using
Map/UnmapRenderbuffer().  So push them further down in the drawpixels
cases so that we can switch over to Map/UnmapRenderbuffer() step by step.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:54 -07:00
Brian Paul
d9d0d4198f swrast: new fast_draw_depth_stencil() for glDrawPixels(GL_DEPTH_STENCIL)
Stop using deprecated renderbuffer PutRow() function.  Note that we
aren't using Map/UnmapRenderbuffer() yet because this call is inside
a swrast_render_start/finish() pair.

v2: use _mesa_pack_uint_24_8_depth_stencil_row(), per Eric.
2011-12-24 08:59:54 -07:00
Brian Paul
826f36b1d8 swrast: remove the copy_depth_stencil_pixels() function
Hopefully glCopyPixels(GL_DEPTH_STENCIL) will be handled by the
fast copy function.  Otherwise, just do the copy with separate
depth + stencil copies.  That's effectively what the removed code
did anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:54 -07:00
Brian Paul
e6c6b1c147 swrast: stop using depth/stencil wrappers in CopyPixels code
The functions that read depth/stencil values understand all (packed)
depth/stencil buffer formats now so there's no reason to use the
wrappers.

Also, improve the format checks in fast_copy_pixels() to catch mismatched
depth/stencil cases.

v2: fix the test for combined depth+stencil buffers, per Eric.
2011-12-24 08:59:54 -07:00
Brian Paul
bd31fb3463 swrast: remove needless assignment in draw_depth_stencil_pixels()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:53 -07:00
Brian Paul
7cf2d75d4f swast: replace renderbuffer->GetPointer() with _swrast_pixel_address()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:53 -07:00
Brian Paul
242fd9df3b swrast: use _swrast_pixel_address() helper function
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:50 -07:00
Brian Paul
d00d39a016 swrast: rewrite stencil test code
Stop using the deprecated renderbuffer Get/Put Row/Values functions.
Consolidate code paths, etc.  The file is nearly half the size it used
to be!

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
8b913bda3a swrast: remove dead code in s_stencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
70df474941 swrast: rewrite _swrast_read_stencil_span()
Use format pack/unpack functions instead of deprecated renderbuffer
GetRow/PutRow functions.

v2: use get_stencil_address(), s/destVals/newVals/

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
4d6b0927ab swrast: rewrite _swrast_read_depth_span_float()
Stop using the deprecated renderbuffer GetRow() function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
82f28c0a12 mesa: rewrite _swrast_depth_bounds_test()
Stop using the deprecated renderbuffer functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
29a9983969 swrast: rewrite depth-testing code
Consolidate code, stop using the deprecateted renderbuffer Put/Get
Row/Values() functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
8e7c388b31 swrast: stop using _swrast_get_values() in z/depth code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
e23e8cbf39 swrast: stop using _swrast_get_values() in stencil code
That function will go a way in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
89fb81d521 swrast: do fast_copy_pixels() with Map/UnmapRenderbuffer()
v2: use memmove() instead of memcpy() in case of overlap

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
95970677b9 swrast: replace GetRow() call with _mesa_unpack_ubyte_stencil_row()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
fc41473b9f mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()
The former was only used for clearing buffers.  The later wasn't used
anywhere!  Remove them and all implementations of those functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
c4b5f0cadb swrast: rewrite color buffer clearing to use Map/UnmapRenderbuffer()
v2: use _mesa_pack_colormask() helper and fix incorrect masking arithmetic

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:26 -07:00
Brian Paul
f1a2aa5cb3 mesa: add _mesa_pack_colormask()
For generating bit-wise colormasks for arbitrary pixel formats.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:26 -07:00
Brian Paul
488d7fc67d mesa: add _mesa_get_format_max_bits()
Returns max bits per channel for the given format.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
fd104a8459 swrast: do depth/stencil clearing with Map/UnmapRenderbuffer()
Another step toward getting rid of the renderbuffer PutRow/etc functions.

v2: fix assorted depth/stencil clear bugs found by Eric

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
fb758aab27 mesa: split get_tex_rgba() into compressed/uncompressed versions
This just splits one big function into two smaller ones for better
readability.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
5e6a6e49e9 mesa: fix comments in getteximage_error_check() 2011-12-24 08:00:29 -07:00
Jian Zhao
26195c8417 mesa: move the format and type check before select_tex_image()
Move the format and type check before select_tex_image, or it will fail to
report the mismatch error if the teximage is null.

Reported-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Jian Zhao <jian.j.zhao@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-24 08:00:29 -07:00
Maarten Lankhorst
1fdecef886 vl: Fix inverted logic in vlc checks
Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-24 15:36:46 +01:00
Alexandre Demers
3258cd9e61 egl,glx,wgl: Fixes stapi->createContext usage
Fixed the build failure, fixed a warning where attributs and error arguments had
been
inverted and fixed another call that was missing an argument.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 11:11:33 +00:00
Eric Anholt
e71375d375 i965/gen7: Fix feedback for flat-shaded tristrips versus provoking vertex.
Fixes piglit tesselation triangle_strip flat_last.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:07:20 -08:00
Eric Anholt
c8223d8c8d i965/gen7: Add support for transform feedback.
Fixes almost all of the transform feedback piglit tests.  Remaining
are a few tests related to tesselation for
quads/trifans/tristrips/polygons with flat shading.

v2: Incorporate Paul's feedback (squash with previous, state flag note,
    static assert, update FINISHME)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:07:09 -08:00
Eric Anholt
8f0baace98 i965/gen7: Move SOL stage disable to gen7_sol_state.c
We'll be growing more code in here as we actually enable the unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:02:25 -08:00
Eric Anholt
e1425a54b1 i965/gen7: Add register definitions for GL_EXT_transform_feedback.
v2: Make the buffer enable bitfield take an index argument.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:02:12 -08:00
Eric Anholt
43e0d77597 i965/gen7: Make primitives_written counting work.
The code was relying on gs.prog_data's copy of the
number-of-verts-per-prim, which segfaulted on gen7 since it doesn't
make a GS program.  We can easily calculate that value right here.

v2: Fix svbi_0_starting_index regression.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 22:02:09 -08:00
Eric Anholt
bf2a93db4d i965/gen7: Enable EXT_transform_feedback extension under 3.0 override.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:02:04 -08:00
Matt Turner
7a8f52e4b4 glsl: remove old autogen.sh
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 17:03:00 -08:00
Paul Berry
f2f14bc4a9 i965 Gen6+: Invalidate VF address-based cache on flush
Although there is not much documentation of this fact, there are in
fact two separate VF caches:

- an "index-based" cache (described in the Sandy Bridge PRM, vol 2
  part 1, section 2.1.2 "Vertex Cache").  This cache stores URB
  handles of vertex shader outputs; its purpose is to avoid redundant
  invocations of the vertex shader when drawing in random access mode
  (e.g. glDrawElements()), and the same vertex index is specified
  multiple times.  It is automatically invalidated between
  3D_PRIMITIVE commands and between instances within a single
  3D_PRIMITIVE command.

- an "address-based" cache (mentioned briefly in vol 2 part 1, section
  1.7.4 "PIPE_CONTROL Command").  This cache stores the data read from
  vertex buffers; its purpose is to avoid redundant memory accesses
  when doing instanced drawing or when multiple 3D_PRIMITIVE commands
  access the same vertex data.  It needs to be manually invalidated
  whenever new data is written to a buffer that is used for vertex
  data.

Previous to this patch, it was not necessary for Mesa to explicitly
invalidate the address-based cache, because there were no reasonable
use cases in which the GPU would write to a vertex data buffer during
a batch, and inter-batch flushing was taken care of by the kernel.

However, with transform feedback, there is now a reasonable use case:
vertex data is written to a buffer using transform feedback, and then
that data is immediately re-used as vertex input in the next drawing
operation.  To make this use case work, we need to flush the
address-based VF cache between transform feedback and the next draw
operation.  Since we are already calling
intel_batchbuffer_emit_mi_flush() when transform feedback completes,
and intel_batchbuffer_emit_mi_flush() is intended to invalidate all
caches, it seems reasonable to add VF cache invalidation to this
function.

As with commit 63cf7fad13 (i965: Flush
pipeline on EndTransformFeedback), this is not an ideal solution.  It
would be preferable to only invalidate the VF cache if the next draw
call was about to consume data generated by a previous draw call in
the same batch.  However, since we don't have the necessary dependency
tracking infrastructure to figure that out right now, we have to
overzealously invalidate the cache.

Fixes Piglit test "EXT_transform_feedback/immediate-reuse".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 15:16:51 -08:00
Paul Berry
e25c4d0926 i965 gen6: Resend binding table pointer after updating SOL bindings.
After creating new binding table entries for transform feedback, we
need to set the dirty flag BRW_NEW_SURFACES, so that a new binding
table pointer will be sent to the hardware.  Otherwise the new binding
table entries will not take effect.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 15:16:51 -08:00
Paul Berry
9cfa8a74ce i965: Rename BRW_NEW_WM_SURFACES to BRW_NEW_SURFACES.
The surface states tracked by BRW_NEW_WM_SURFACES are no longer used
for just WM.  They are also used for vertex texturing and transform
feedback.  To avoid confusion, this patch renames BRW_NEW_WM_SURFACES
to BRW_NEW_SURFACES.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 15:16:51 -08:00
Kenneth Graunke
9df8662e28 i965: Don't use BRW_DEPTHFORMAT_D24_UNORM_X8_UINT on Gen4.
X8 depth formats weren't supported until Ironlake (Gen 5).

Fixes GPU hangs introduced in d84a180417.
One example test case was "fbo-missing-attachment-blit from".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-23 12:15:20 -08:00
Paul Berry
cb045880b1 mesa: Pause transform feedback during meta ops.
Fixes piglit tests "EXT_transform_feedback/generatemipmap buffer" and
"EXT_transform_feedback/generatemipmap prims_written" on i965 Gen6.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
772d4fef42 i965 gen6: Implement transform feedback pause/resume functionality.
Although i965 gen6 does not yet support ARB_transform_feedback2 or
NV_transform_feedback2, it needs to support pause/resume functionality
so that meta-ops will work correctly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
87c7e5fb87 mesa: Disable certain error checks when transform feedback is paused
When transform feedback is paused, it is legal to change programs or
to perform drawing operations using a drawing mode that doesn't match
the transform feedback mode.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
08ce48733d mesa: Ensure that Paused is reset to false on EndTransformFeedback.
If a client calls BeginTransformFeedback(), then
PauseTransformFeedback(), then EndTransformFeedback(), we need to make
sure that the transform feedback object is not left in a "paused"
state, otherwise the next call to BeginTransformFeedback() will leave
transform feedback paused.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
a3a4d01e41 mesa: Save and restore GL_RASTERIZER_DISCARD state during meta ops.
During meta-operations (such as _mesa_meta_GenerateMipmap()), we need
to be able to draw even if GL_RASTERIZER_DISCARD is enabled.  This
patch causes _mesa_meta_begin() to save the state of
GL_RASTERIZER_DISCARD and disable it (so that drawing can be done
during the meta-op), and causes _mesa_meta_end() to restore it.

Fixes piglit test "EXT_transform_feedback/generatemipmap discard" on
i965 Gen6.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Ian Romanick
b5b2081d75 dri2: Add createContextAttribs entry point for DRISW version 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:49:53 -08:00
Ian Romanick
1ab545494a dri2: Add createContextAttribs entry point for DRI2 version 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:49:53 -08:00
Ian Romanick
d18152028e st-api: Have context_create explain why creation failed
This won't be used in the client-side libGL, but the xserver has to
generate a different protocol error depending on the reason context
creation failed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-12-23 08:49:50 -08:00
Ian Romanick
358ecff1ea st-api: Clean-up OpenGL profile handling
There seems to have been two different ways to communicate the
profile.  There were flags and there were profiles.  I've opted to
remove the profile flags and use ST_PROFILE_DEFAULT (compatibility
profile) and ST_PROFILE_OPENGL_CORE (core profile) consistently
instead.

Also change the values of the ST_CONTEXT_FLAG_DEBUG and
ST_CONTEXT_FLAG_FORWARD_COMPATIBLE flags to match the WGL and GLX
values.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-12-23 08:49:47 -08:00
Ian Romanick
ed4a65c3cf glx: Propagate the glXIsDirect protocol error back to the application
If the server returned BadContext, the error would just get droped on
the floor.

Fixes the piglit test glx-import-context-single-process

NOTE: This is a candidate for the 7.11 branch, but it also requires
the previous patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:40:30 -08:00
Ian Romanick
fba400072f glx: Deliver an xlib style error to the application from an XCB error
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:40:30 -08:00
Maarten Lankhorst
efa93ae449 vl: improve vlc functions and handling
Only initialize vlc in MPEG2 decoding once for all slices,
add more sanity checks to vlc decoding functions, support
multiple vlc input buffer, improve documentation of the
vlc functions.

v2: also implement multiple inputs for the vlc functions
v3: some bug fixes for buffer size and alignment corner cases
v4: rework of the patch, some more improvements

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-23 16:31:26 +01:00
Maarten Lankhorst
ebe7c687ce nouveau: Fix bugs in nouveau_video_buffer
Double free and array overflow, even if only 2 members are
used the last one needs to be set to NULL explicitly.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com
2011-12-23 16:21:25 +01:00
Lauri Kasanen
2eafd07323 gallivm: Close a memory leak
Hi all

This fixes a memory leak of 32 bytes on exit.

From 924f8fdccb41b011f372bc57252005bcdb096105 Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <curaga@operamail.com>
Date: Thu, 22 Dec 2011 21:28:33 +0200
Subject: [PATCH] gallivm: Close a memory leak

As reported by "valgrind --leak-check=full glxgears".

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-12-22 23:03:18 +00:00
Dave Airlie
7fd8dc3aa9 softpipe: try and use back color for a slot if color fails.
In the case where a front and back output are specified, the draw code will
copy the back output into the front color slot and everything is happy.

However if no front is specified then the draw code will do a bad copy (separate patch), but also the frag shader won't pick up the color as there there is
no write to COLOR from the vertex shader just BCOLOR.

This patch fixes that problem so if it can't find a vertex shader output
for the front color slot, it will go and lookup and use one for the back color
slot.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-22 12:25:33 +00:00
Dave Airlie
d61d39922b format_unpack: add 8/16 rgba/rgb types.
fixing these makes piglit fbo-integer pass on softpipe.

modified to re-order things, haven't addressed Eric's concerns,
can't find anything in spec that mentions sign extensions, it does say
integers aren't clamped or modified.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-22 12:25:32 +00:00
Eric Anholt
f1d89638c0 i965: Don't make consumers of brw_CONT/brw_WHILE track if depth in loop.
The codegen backends all had this same tracking, so just do it at the
EU level.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Eric Anholt
ce6be334bb i965: Don't make consumers of brw_WHILE do pre-gen6 BREAK/CONT patching.
The EU code itself can just do this work, since all the consumers were
duplicating it.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Eric Anholt
32118cfe37 i965: Don't make consumers of brw_DO()/brw_WHILE() track loop start.
This is a similar cleanup to what we did for brw_IF(), brw_ELSE(),
brw_ENDIF() handling.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Eric Anholt
9f8814752f i965: Drop unused do_insn argument from gen6_CONT().
The branch distances get patched up later at the WHILE instruction.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Paul Berry
d44878e754 mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.
This makes it easier to keep track of which dirty bits correspond to
which pieces of context, since it makes _NEW_RASTERIZER_DISCARD
correspond with ctx->RasterDiscard.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-21 13:33:35 -08:00
Paul Berry
aee96806f0 mesa: Move RasterDiscard to toplevel of gl_context.
Previously we were storing the RasterDiscard flag (for
GL_RASTERIZER_DISCARD) in gl_context::TransformFeedback.  This was
confusing, because we use the _NEW_TRANSFORM flag (not
_NEW_TRANSFORM_FEEDBACK) to track state updates to it, and because
rasterizer discard has effects even when transform feedback is not in
use.

This patch makes RasterDiscard a toplevel element in gl_context rather
than a subfield of gl_context::TransformFeedback.

Note: We can't put RasterDiscard inside gl_context::Transform, since
all items inside gl_context::Transform need to be pieces of state that
are saved and restored using PushAttrib and PopAttrib.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-21 13:33:31 -08:00
Kristian Høgsberg
636f2fc46c egl/x11: Merge the right version of Frederiks change
Argh, I merged an older broken version of the swapbuffer change instead of
Frederiks fixed version.  This diffs gets us back to the right version.
2011-12-21 10:29:30 -05:00
Fredrik Höglund
352c889c10 egl_dri2/x11: Add support for the DRI2 SwapBuffers request 2011-12-20 22:11:18 -05:00
Fredrik Höglund
655f2c1d65 egl_dri2/x11: Add support for eglSwapInterval 2011-12-20 22:11:17 -05:00
Paul Berry
3a2e71874b i965 gen6: Turn on transform feedback extension unconditionally.
Previously, we only enabled transform feedback when
MESA_GL_VERSION_OVERRIDE was 3.0 or greater, since transform feedback
support was not completely finished, so it didn't make sense to
advertise support for it unless absolutely necessary.

Now that transform feedback is fully implemented on gen6, we can
enable this extension unconditionally.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
c59393b706 i965 gen6: Implement transform feedback queries.
This patch adds software-based PRIMITIVES_GENERATED and
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries that work by keeping
track of the number of primitives that are sent down the pipeline, and
adjusting as necessary to account for the way each primitive type is
tessellated.

In the long run we'll want to replace this with a hardware-based
implementation, because the software approach won't work with geometry
shaders or primitive restart.  However, at the moment, we don't have
the necessary kernel support to implement a hardware-based query (we
would need the kernel to save GPU registers when context switching, so
that drawing performed by another process doesn't get counted).

Fixes Piglit tests EXT_transform_feedback/query-primitives_generated-*
and EXT_transform_feedback/query-primitives-written-*.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
c5e17a8498 i965: Convert if/else to switch statements in brw_queryobj.c
Previously, i965 only supported two query types: GL_TIME_ELAPSED_EXT
and GL_SAMPLES_PASSED_ARB, and it distinguished between the two using
if/else statements that compared query->Base.Target to
GL_TIME_ELAPSED_EXT.

This patch changes the if/else statements to switch statements so that
we can add more query types without having to have a chain of
else-ifs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
f8328c998b i965 gen6: Ensure correct transform feedback indices on new batch.
We don't currently have kernel support for saving GPU registers on a
context switch, so if multiple processes are performing transform
feedback at the same time, their SVBI registers will interfere with
each other.  To avoid this situation, we keep a software shadow of the
state of the SVBI 0 register (which is the only register we use), and
re-upload it on every new batch.

The function that updates the shadow state of SVBI 0 is called
brw_update_primitive_count, since it will also be used to update the
counters for the PRIMITIVES_GENERATED and
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
163611d7b2 mesa: Add a function to query whether a meta-op is in progress.
This is needed by i965 to ensure that transform feedback counters are
not incremented during meta-ops.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
dc7b6d7d6d mesa: Add count_tessellated_primitives() function.
This function computes the number of primitives that will be generated
when the given drawing operation is performed.  It accounts for the
tessellation that is performed on line strips, line loops, triangle
strips, triangle fans, quads, quad strips, and polygons, so it is
suitable for implementing the primitive counters needed by transform
feedback.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
291ae4e639 mesa: Remove unnecessary FLUSH_VERTICES in bind_buffer_range
It isn't necessary to call FLUSH_VERTICES from bind_buffer_range,
because transform feedback buffers are not allowed to be changed when
transform feedback is active.

Thanks to Marek Olšák for pointing out this bug.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-20 15:22:28 -08:00
Paul Berry
7d2ff0bf0b i965 gen6: Implement rasterizer discard.
This patch enables rasterizer discard functionality (a part of
transform feedback) in Gen6, by generating an alternate GS program
when rasterizer discard is active.  Instead of forwarding vertices
down the pipeline, the alternate GS program uses a URB Write message
to deallocate the URB entry that was allocated by FF sync and
terminate the thread.

Note: parts of the Sandy Bridge PRM seem to imply that we could do
this more efficiently, by clearing the GEN6_GS_RENDERING_ENABLE bit,
and not allocating a URB entry at all.  However, it's not clear how we
are supposed to terminate the thread if we do that.  Volume 2 part 1,
section 4.5.4, says "GS threads must terminate by sending a URB_WRITE
message with the EOT and Complete bits set.", and my experiments so
far confirm that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:08 -08:00
Kenneth Graunke
21504b462a i965: Implement bounds checking for transform feedback output.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-20 15:17:23 -08:00
Paul Berry
63cf7fad13 i965: Flush pipeline on EndTransformFeedback.
A common use case for transform feedback is to perform one draw
operation that writes transform feedback output to a buffer, followed
by a second draw operation that consumes that buffer as vertex input.
Since vertex input is consumed at an earlier pipeline stage than
writing transform feedback output, we need to flush the pipeline to
ensure that the transform feedback output is completely written before
the data is consumed.

In an ideal world, we would do some dependency tracking, so that we
would only flush the pipeline if the next draw call was about to
consume data generated by a previous draw call in the same batch.
However, since we don't have that sort of dependency tracking
infrastructure right now, we just unconditionally flush the buffer
every time glEndTransformFeedback() is called.  This will cause a
performance hit compared to the ideal case (since we will sometimes
flush the pipeline unnecessarily), but fortunately the performance hit
will be confined to circumstances where transform feedback is in use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-20 15:00:29 -08:00
Paul Berry
c3161b629f i965 gen6+: Make intel_batchbuffer_emit_mi_flush() actually flush.
Previous to this patch, the function intel_batchbuffer_emit_mi_flush()
was a bit of a misnomer.  On Gen4+, when not using the blit engine, it
didn't actually flush the pipeline--it simply generated a PIPE_CONTROL
command with the necessary bits set to flush GPU caches.  This was
usually sufficient, since in most situations where
intel_batchbuffer_emit_mi_flush() was called, all we really care about
was ensuring cache coherency.

However, with the advent of OpenGL 3.0, there are two cases in which
data output by one stage of the pipeline might be consumed, in a later
draw operation, by an earlier stage of the pipeline:

(a) When using textures in the vertex shader.

(b) When using drawing with a vertex buffer that was previously
    generated using transform feedback.

This patch addresses case (a) by changing
intel_batchbuffer_emit_mi_flush() so that on Gen6+, it sets the
PIPE_CONTROL_CS_STALL bit (this forces the pipeline to actually
flush).  (Case (b) will be addressed by the next patch in the series).

This is not an ideal solution--in a perfect world, the driver would
have some buffer dependency tracking so that we would only have to
flush the pipeline in the two cases above.  Until that dependency
tracking is implemented, however, it seems prudent to have
intel_batchbuffer_emit_mi_flush() actually flush the pipeline, so that
we get correct rendering, at the expense of a (hopefully small)
performance hit.

The change is only applied to Gen6+, since at the moment only Gen6+
supports the OpenGL 3.0 features that make a full pipeline flush
necessary.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-20 15:00:28 -08:00
Paul Berry
6ca61441b5 i965 gen6: Turn on transform feedback extension.
This patch advertises support for EXT_transform_feedback on Intel
Gen6.

Since transform feedback support is not completely finished yet, for
now we only advertise support for it when MESA_GL_VERSION_OVERRIDE is
3.0 or greater (since transform feedback is required by GL version
3.0).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:00:28 -08:00
Paul Berry
9308f29830 i965 gen6: Initial implementation of transform feedback.
This patch adds basic transform feedback capability for Gen6 hardware.
This consists of several related pieces of functionality:

(1) In gen6_sol.c, we set up binding table entries for use by
transform feedback.  We use one binding table entry per transform
feedback varying (this allows us to avoid doing pointer arithmetic in
the shader, since we can set up the binding table entries with the
appropriate offsets and surface pitches to place each varying at the
correct address).

(2) In brw_context.c, we advertise the hardware capabilities, which
are as follows:

   MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 64
   MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS        4
   MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS    16

OpenGL 3.0 requires these values to be at least 64, 4, and 4,
respectively.  The reason we advertise a larger value than required
for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS is that we have already
set aside 64 binding table entries, so we might as well make them all
available in both separate attribs and interleaved modes.

(3) We set aside a single SVBI ("streamed vertex buffer index") for
use by transform feedback.  The hardware supports four independent
SVBI's, but we only need one, since vertices are added to all
transform feedback buffers at the same rate.  Note: at the moment this
index is reset to 0 only when the driver is initialized.  It needs to
be reset to 0 whenever BeginTransformFeedback() is called, and
otherwise preserved.

(4) In brw_gs_emit.c and brw_gs.c, we modify the geometry shader
program to output transform feedback data as a side effect.

(5) In gen6_gs_state.c, we configure the geometry shader stage to
handle the SVBI pointer correctly.

Note: ordering of vertices is not yet correct for triangle strips
(alternate triangles are improperly oriented).  This will be addressed
in a future patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-20 15:00:23 -08:00
Paul Berry
1413f955eb i965 gs: Move vue_map to brw_gs_compile.
This patch stores the geometry shader VUE map from a local variable in
compile_gs_prog() to a field in the brw_gs_compile struct, so that it
will be available while compiling the geometry shader.  This is
necessary in order to support transform feedback on Gen6, because the
Gen6 geometry shader code that supports transform feedback needs to be
able to inspect the VUE map in order to find the correct vertex data
to output.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 14:32:16 -08:00
Paul Berry
fd5d0c8b12 i965 gen6+: Use 1-wide null operands for IF instructions
The Sandy Bridge PRM, volume 4, part 2, section 5.3.10 ("5.3.10
Register Region Restrictions") contains the following restriction on
the execution size and operand width of instructions:

   "3. ExecSize must be equal to or greater than Width."

When emitting an IF instruction in single program flow mode on Gen6+,
we use an ExecSize of 1, therefore the Width of each operand must also
be 1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 14:32:16 -08:00
Paul Berry
38b118d49d mesa: Fix off-by-one error in transform feedback size check.
In _mesa_BindBufferRange(), we need to verify that the offset and size
specified by the client do not exceed the size of the underlying
buffer.  We were accidentally doing this check using ">=" rather than
">", so we were generating a bogus error if the client specified an
offset and size that fit exactly in the underlying buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 14:32:16 -08:00
Paul Berry
942d452047 mesa: Record transform feedback strides/offsets in linker output.
This patch adds two new fields to the gl_transform_feedback_info
struct:

- BufferStride records the total number of components (per vertex)
  that transform feedback is being instructed to store in each buffer.

- Outputs[i].DstOffset records the offset within the interleaved
  structure of each transform feedback output.

These values are needed by the i965 gen6 and r600g back-ends, so it
seems better to have the linker provide them rather than force each
back-end to compute them independently.

Also, DstOffset helps pave the way for supporting
ARB_transform_feedback3, which allows the transform feedback output to
contain holes between attributes by specifying
gl_SkipComponents{1,2,3,4} as the varying name.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-20 14:32:16 -08:00
Jon TURNEY
9f8573b7ae Fix compilation on cygwin after commit 762c9766c9
Fix compilation on cygwin after commit 762c9766c9
"Use VERT_ATTRIB_* indexed array in gl_array_object" added the first non-driver
use of ffsll(), which exposes the fact that this isn't provided on cygwin.

Found by tinderbox, see [1]

[1] http://tinderbox.freedesktop.org/builds/2011-11-30-0017/logs/libGL/#build

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-20 13:45:27 +00:00
Maarten Lankhorst
704d22dfc1 xvmc: Remove unused variable
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-20 13:12:54 +01:00
Maarten Lankhorst
68651c3243 vl: Remove unused declaration
csc is not used for rgba and gives a warning.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-20 13:12:39 +01:00
Maarten Lankhorst
72325ee6e3 vl: Use pipe clear_render_target instead of util_clear_render_target
Mapping to software and uploading again clearing is killing performance.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-20 13:05:49 +01:00
Pekka Paalanen
dae2fca705 mesa: fix a leak in _mesa_delete_texture_image()
Valgrind complains about a definitely lost block allocated in
intelNewTextureImage(). This leak was apparently created by
6e0f9001fe, "mesa: move
gl_texture_image::Data, RowStride, ImageOffsets to swrast", as it
removes the free() from _mesa_delete_texture_image().

Put the free() back, fixes a Valgrind error.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-20 11:58:23 +02:00
Chia-I Wu
249c6f1934 st/egl: error check and clamp coordinates in eglPostSubBufferNV
EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
2011-12-20 17:26:18 +08:00
Chia-I Wu
eb7d1b9474 egl_dri2/x11: error check coordinates in eglPostSubBufferNV
EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
2011-12-20 17:26:18 +08:00
Fredrik Höglund
7577284213 st/egl: Add support for EGL_NV_post_sub_buffer
Signed-off-by: Fredrik Höglund <fredrik@kde.org>

[olv: remove #ifdef checks]
2011-12-20 17:09:06 +08:00
Fredrik Höglund
71b8fc9872 egl_dri2/x11: Add support for EGL_NV_post_sub_buffer
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
2011-12-20 17:05:11 +08:00
Fredrik Höglund
7d46b45c5b egl: add EGL_NV_post_sub_buffer
v2: Handle EGL_POST_SUB_BUFFER_SUPPORTED_NV in
    _eglParseSurfaceAttribList()

Signed-off-by: Fredrik Höglund <fredrik@kde.org>

[olv: remove #ifdef checks]
2011-12-20 17:04:46 +08:00
Chia-I Wu
f63e129d5f egl: KHR_reusable_sync entrypoints are missing from eglGetProcAddress 2011-12-20 17:00:01 +08:00
Chia-I Wu
f957cac772 egl: remove #ifdef's for official extensions
There is no point in having them when we distribute eglext.h.

As for unofficial extensions, there is a chance that we might remove some of
them evetually.  Keeping the #ifdef's for now should make that easier.
2011-12-20 16:59:09 +08:00
Chia-I Wu
ed1ff2acec egl: remove EGL_ANDROID_swap_rectangle
We never support this unofficial extension, and it has been removed from
Android recently.  There is no point in keeping it.
2011-12-20 16:20:17 +08:00
Chia-I Wu
b7acfe7755 egl: update headers
Update to revision 15052.

EGL_MESA_drm_image is now official.  But apparently we have our own extension
to it and we need this in eglmesaext.h:

  #ifdef EGL_MESA_drm_image
  /* Mesa's extension to EGL_MESA_drm_image... */
  #ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
  #define EGL_DRM_BUFFER_USE_CURSOR_MESA		0x0004
  #endif
  #endif

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-20 16:12:14 +08:00
Chia-I Wu
ab7bb10a2a egl: move unofficial extensions to eglmesaext.h
As suggested by Ian in

  http://lists.freedesktop.org/archives/mesa-dev/2011-December/016035.html

Note that eglext.h has to include eglmesaext.h at the end instead of the
beginning because some extensions in eglmesaext.h depend on the official
extensions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-20 16:11:41 +08:00
Stéphane Marchesin
67e6a40605 i915g: Add unsupported caps. 2011-12-19 18:33:03 -08:00
Stéphane Marchesin
1981042341 i915g: Turn an assert into a debug message, print more debug info for missing depth swz.
Also fix indentation a bit.
2011-12-19 18:28:26 -08:00
Stéphane Marchesin
a7534d8943 i915g: Make the pipe_sampler_state struct non const and get rid of useless memcpy. 2011-12-19 18:28:26 -08:00
Stéphane Marchesin
c661843ab6 i915g: Implement KILP. 2011-12-19 18:24:39 -08:00
Stéphane Marchesin
3c01aefe5f i915g: Add two unsupported caps. 2011-12-19 18:24:39 -08:00
Stéphane Marchesin
9c76ba04f8 i915g: Put the templates at the beggining of the structures.
Seriously. This fixes fragment-and-vertex-texturing in piglit and probably
a boatload of other stuff.
2011-12-19 18:24:39 -08:00
Kenneth Graunke
37d24a70da i965: Advertise our vertex shader texture units.
Previously, we advertised 0 VS texture units.  Now that we have proper
support for using the sampling engine in the VS, we can advertise 16,
which is conveniently the number required for OpenGL 3.0.

v2: Enable on Gen4.  I hacked up my tests to not use flat ivec varyings
    and they pass.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:11 -08:00
Kenneth Graunke
8e34021099 i965/vs: Implement EXT_texture_swizzle support for VS texturing.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:11 -08:00
Kenneth Graunke
d45814c925 i965/vs: Add texture related data to brw_vs_prog_key.
Now that this is all factored out, it's trivial to do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
387a3d43d1 i965/fs: Only set brw_wm_prog_key data for samplers used by the WM.
This should avoid state-dependent FS recompiles when samplers that are
only used by the VS change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
1b05fc7cdd i965/fs: Factor out texturing related data from brw_wm_prog_key.
The idea is to reuse this for the VS and (in the future) GS as well.

v2: Include yuvtex data since we're not dropping GL_MESA_ycbycr.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
328b693a19 i965/vs: Add support for texel offsets.
The visit() half computes the values to put in the header based on the
IR and simply stuffs that in the vec4_instruction; the emit() half uses
this to set up the message header.  This works out well since emit() can
use brw_reg directly and access individual DWords without kludgery.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
475d70d6ef i965/fs: Factor out texture offset bitfield computation.
We'll want to reuse this for the VS, and it's complex enough that I'd
rather not cut and paste it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
d93aa54d2d i965/vs: Implement vec4_visitor::visit(ir_texture *).
This translates the GLSL compiler's IR into vec4_instruction IR,
generating code to load coordinates, LOD info, shadow comparitors, and
so on into the appropriate message registers.

It turns out that the SIMD4x2 parameters are identical on Gen 5-7, and
the Gen4 code is similar enough that, unlike in the FS, it's easy enough
to support all generations in a single function.

v2: Load zeros for missing coordinates (fixing vs-texelFetch-sampler1D
and 2D on G45), and fix G45 message length for shadow comparisons.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
ca182cd0fa i965/vs: Implement vec4_visitor::generate_tex().
This is the part that takes the vec4_instruction IR and turns it into
actual Gen ISA.

v2: Add Gen4 messages, don't retype m0 to UW.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
7ff68176f0 i965: Add missing SIMD4x2 sample_l_c message #defines.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:09 -08:00
Kenneth Graunke
79d981cd03 i965: Don't minify depth when setting up cube map miptrees on Gen4.
Prior to Ironlake, cube maps were stored as 3D textures.  In recent
refactoring, we removed a separate "layers" parameter in favor of using
depth.  Unfortunately, depth was getting minified, which is only correct
for actual 3D textures.

Fixes piglit tests:
- bugs/crash-cubemap-order
- fbo/fbo-cubemap
- texturing/cubemap

Also changes texturing/cubemap npot from abort to fail.

This hasn't seen a full test run since Piglit on Mesa master hangs
GM45 a lot.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 16:33:09 -08:00
Ian Romanick
c66242a6c6 glx: Remove GLX_USE_APPLEGL cruft in extension string handling
All of the extensions require that both libGL and either the server or
the direct rendering driver (or both) enable the extension before it's
advertised.  It seems safe to assume that none of the other components
on OS X will enable these extensions, so all the #ifdef blocks here
just clutter the code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 14:55:31 -08:00
Ian Romanick
d3f7597bc9 glx: GLX 1.4 does not require GLX_INTEL_swap_event
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
8e5efbe62b glx: Remove some extensions that are not, and never will be, supported
There are a few unsupported extensions (e.g., the ATI and NV float
extensions) that are still in the list.  There is some small chance
that these may be supported some day.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
e4be406f09 glx: Explicitly reject servers that only support GLX 1.0
__glXInitialize calls AllocAndFetchScreenConfigs.
AllocAndFetchScreenConfigs unconditionally sends a glXQuerySeverString
request to the server.  This request is only supported with GLX 1.1 or
later, so we were already implicitly incompatible with GLX 1.0
servers.  How many more similar bugs lurk in the code that nobody has
noticed in years?

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
a832aa5ba0 glx: Initialize share_xid in CreateContext
Previously the share_xid was only set in the glXImportContextEXT path,
and it was left set to None in all of the other create-context paths.

Fixes the piglit test glx-query-context-info-ext.

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>
2011-12-19 14:55:31 -08:00
Ian Romanick
b1ffb3335f glx: Make parameter types for __glXSendError match protocol types
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 14:55:31 -08:00
Ian Romanick
6f76efa922 glx: Make __glXSendError available in non-Apple builds
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 14:55:31 -08:00
Ian Romanick
4dbd13cb3f glx: Send DestroyContext protocol at the correct times
Send the DestroyContext protocol immediately when glXDestroyContext is
called, and never call it when glXFreeContextEXT is called.  In both
cases, either destroy the client-side structures or, if the context is
current, set xid to None so that the client-side structures will be
destroyed later.

I believe this restores the behavior of the original SGI code.  See
src/glx/x11 around commit 5df82c8.  The spec doesn't say anything
about glXDestroyContext not really destroying imported contexts (it
acts like glXFreeContextEXT instead), but that's what the original
code did.  Note that glXFreeContextEXT on a non-imported context does
not destroy it either.

Fixes the piglit test glx-free-context.

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>
2011-12-19 14:55:31 -08:00
Ian Romanick
3b9b42250c glx: Don't segfault if glXGetContextIDEXT is pased a NULL context
Fixes the piglit test glx-get-context-id.

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>
2011-12-19 14:55:30 -08:00
Ian Romanick
5a849e864e glx: Fix handling of property list received from the server in glXImportContextEXT
The primary problem was that the number of reply bytes read is clamped
to sizeof(propList), but the loop that processes the properties tries
to examine all of the properties sent by the server.  If the server
sends 47,000 properties, we only read 3 but process all 47,000.

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>
2011-12-19 14:55:30 -08:00
Ian Romanick
7c2f1160c2 glx: Don't segfault if xcb_glx_is_direct_reply returns NULL
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>
2011-12-19 14:55:30 -08:00
Ian Romanick
c4a8c54c3b 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>
2011-12-19 14:55:30 -08:00
Eric Anholt
507e71e45a 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>
2011-12-19 13:20:11 -08:00
Eric Anholt
4790c4ae24 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>
2011-12-19 13:20:11 -08:00
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
Marek Olšák
36d66f8d4a u_blitter: implement copy_buffer using stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
b177e2c54c u_blitter: restore stream output targets 2011-12-15 18:51:48 +01:00
Christoph Bumiller
1114b192af trace: implement stream output interface 2011-12-15 18:51:48 +01:00
Marek Olšák
6a00e4eaee noop: implement stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
8a9a37cebe gallium: utility helper functions for stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
861a029ddb 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
2011-12-15 18:51:48 +01:00
Marek Olšák
4f4a1be200 gallium: disable stream output in drivers that support it
I am going to make interface changes and I don't want to break compilation.
2011-12-15 18:50:44 +01:00
Marek Olšák
14bb957b99 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.
2011-12-15 18:50:44 +01:00
Thomas Hellstrom
3baaa1bbd7 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>
2011-12-15 08:28:22 +01:00
Thomas Hellstrom
aa7d7656f5 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>
2011-12-15 08:28:09 +01:00
Thomas Hellstrom
11c9459ba0 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>
2011-12-15 08:27:47 +01:00
Chia-I Wu
7aadb53ef0 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.
2011-12-15 15:07:00 +08:00
Fredrik Höglund
a06f58fee5 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/]
2011-12-15 15:02:56 +08:00
Fredrik Höglund
fa0f70e45e 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>
2011-12-15 15:00:15 +08:00
Eric Anholt
3f41f7d1a0 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>
2011-12-14 17:12:41 -08:00
Eric Anholt
7eb0aa398b 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>
2011-12-14 13:18:48 -08:00
Eric Anholt
950310e7a3 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>
2011-12-14 13:18:46 -08:00
Eric Anholt
a91c31668f 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>
2011-12-14 13:18:44 -08:00
Eric Anholt
f22068d5be 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>
2011-12-14 13:18:38 -08:00
Eric Anholt
8967f75095 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>
2011-12-14 13:18:18 -08:00
Eric Anholt
faa44bc2f6 intel: Fix uninitialized values in debug output for renderbuffer mapping. 2011-12-14 13:18:03 -08:00
Eric Anholt
b2469ff043 swrast: Add a note about overlapping support for framebuffer blit.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-14 13:18:00 -08:00
Eric Anholt
657f3214e7 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>
2011-12-14 13:17:45 -08:00
Christian König
5d1de8bc7d 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>
2011-12-14 14:22:37 +01:00
Christian König
9e51c200a7 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>
2011-12-14 14:20:44 +01:00
Christian König
167b1b32c5 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>
2011-12-14 14:19:41 +01:00
Jian Zhao
606d3a3c3d Add mismatch check for glGetTexImage or it will return -1 and may lead to segment fault.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-14 17:22:47 +08:00
Kenneth Graunke
c87cb98bb4 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>
2011-12-13 22:54:16 -08:00
Ian Romanick
7e9cb2ac6d 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
0c6b930322 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
bc35da409b 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
af50f3bf44 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
2e16875873 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
c0d2f4c123 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
e089a0e2ee 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>
2011-12-13 16:07:17 -08:00
Ian Romanick
090dd9428d 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>
2011-12-13 16:07:17 -08:00
Marek Olšák
35d2764f85 r300g: take advantage of KEEP_TILING_FLAGS flush flag
This fixes at least two multi-context-related races.
2011-12-13 21:34:18 +01:00
Marcin Slusarz
10e931219f nouveau: get rid of winsys object
Its only purpose was to destroy itself.
2011-12-13 21:06:29 +01:00
Stéphane Marchesin
642d11da20 i915g: Roll back to the previous shader limits.
Those shader limits seem to be responsible for a piglit hang.
2011-12-13 11:26:49 -08:00
Stéphane Marchesin
f41fd6b6c3 i915g: Update TODO. 2011-12-13 11:26:49 -08:00
Marek Olšák
41b75dc92c winsys/radeon: add flush option not to rewrite tiling flags in registers
Not used yet.
2011-12-13 18:41:17 +01:00
Marek Olšák
df809ae923 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>
2011-12-13 17:49:00 +01:00
Marek Olšák
8a11d40c4e mesa: fix an out-of-bounds access in prog_print.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-13 17:49:00 +01:00
Bryan Cain
3b15f5046c glsl_to_tgsi: fix typo in comment 2011-12-13 10:39:52 -06:00
Bryan Cain
d24b44c37d glsl_to_tgsi: emit both operands of shift and bitwise operations
Fixes these operations when native integers are enabled.
2011-12-13 10:39:52 -06:00
Benjamin Franzke
2a58453e25 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.
2011-12-13 15:32:43 +01:00
Brian Paul
cbd65fe149 mesa: update comments for _DepthBuffer, _StencilBuffer fields
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:38 -07:00
Brian Paul
6596aeb4ff 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>
2011-12-13 06:45:38 -07:00
Brian Paul
d7c0fac90b swrast: add debug code to test combined depth/stencil buffers
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
8ba9c22cdb mesa: remove unused depthstencil.[ch] files
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
6e1228976b 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>
2011-12-13 06:45:37 -07:00
Brian Paul
2ac02ea29f swrast: update depth/stencil wrapper sizes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
23527eb357 mesa: build swrast/s_depthstencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
ba35094068 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>
2011-12-13 06:45:37 -07:00
Brian Paul
c0a55cf68a 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>
2011-12-13 06:45:37 -07:00
Brian Paul
2750809b2e radeon: stop using _DepthBuffer, _StencilBuffer fields
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:36 -07:00
Brian Paul
a782db5570 nouveau: stop using _DepthBuffer, _StencilBuffer fields
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:36 -07:00
Brian Paul
d124092864 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>
2011-12-13 06:45:36 -07:00
Brian Paul
02d12719e3 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>
2011-12-13 06:45:36 -07:00
Brian Paul
22e806f570 swrast: add missing state validation calls for Blit, Clear 2011-12-13 06:45:36 -07:00
Alex Deucher
23895cc006 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>
2011-12-12 09:48:15 -05:00
Marek Olšák
fc52534f01 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>
2011-12-12 08:04:51 +01:00
Marek Olšák
4298c88f65 r300g: integer and fixed-point 16.16 textures are not supported 2011-12-12 08:04:51 +01:00
Marek Olšák
1ded658ce0 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.
2011-12-12 08:04:51 +01:00
Michael Karcher
592323de1e i915g: fix debug dump on 64 bit systems 2011-12-11 13:24:10 -08:00
Fatih Aşıcı
13632e64a0 i915g: Fix wrong indices for LINE_LOOP case 2011-12-11 13:23:42 -08:00
Maarten Lankhorst
45bb4b79f6 vl: Add missing mpeg fields to pipe_mpeg12_picture_desc
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-11 01:06:15 -05:00
Tobias Droste
e809f4e54c g3dvl/xlib: fix build by changing include order
fixes the following build error since
c83fb4d45f:

/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>
2011-12-11 01:03:20 -05:00
Dave Airlie
72cb103cf5 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>
2011-12-10 17:30:37 +00:00
Dave Airlie
b1a8b7b019 Revert "st/mesa: only resolve is number of samples is > 1"
This reverts commit 8c713626db.

Didn't mean to push this at all
2011-12-10 09:04:51 +00:00
Dave Airlie
8c713626db 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>
2011-12-10 09:02:38 +00:00
Dave Airlie
f767e96131 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>
2011-12-10 09:02:17 +00:00
Marek Olšák
06f217d80f gallium: implement ARB_conservative_depth
This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.
2011-12-10 01:27:11 +01:00
José Fonseca
c83fb4d45f util: Add strings.h include on unices
Fixes -Wimplicit-function-declaration for ffs with GCC.  Spotted/tested
by Kai Wasserbäch.
2011-12-09 20:17:34 +00:00
José Fonseca
f188c0d0f4 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>
2011-12-09 18:34:40 +00:00
nobled
eefff37060 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>
2011-12-08 21:23:59 +00:00
nobled
4a2b9b5305 mesa: add _mesa_image_offset()
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 21:20:25 +00:00
nobled
f22421e9b9 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>
2011-12-08 21:20:25 +00:00
nobled
37fd22a091 mesa/image: delete dead store
The return value here is a) always zero, b) never used.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 21:20:25 +00:00
Bryan Cain
20b0daf82d 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.
2011-12-08 13:54:16 -06:00
José Fonseca
6cf7245f69 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>
2011-12-08 17:59:33 +00:00
José Fonseca
f32c7232a8 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>
2011-12-08 17:59:33 +00:00
Brian Paul
24e6484909 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>
2011-12-08 08:56:31 -07:00
Brian Paul
bf6aac24c1 mesa: use malloc instead of MAX_WIDTH array in glReadPixels()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:31 -07:00
Brian Paul
1614de4045 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>
2011-12-08 08:56:31 -07:00
Brian Paul
db247dd7b3 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>
2011-12-08 08:56:31 -07:00
Brian Paul
eb3e1d8888 mesa: simplify _mesa_remove_renderbuffer() 2011-12-08 08:56:31 -07:00
Brian Paul
e4bb884dfb 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>
2011-12-08 08:56:30 -07:00
Brian Paul
d0dc75c000 mesa/drivers: use new swrast renderbuffer functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
b85284f45e mesa: build new s_renderbuffer.c file
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
379e0a3ada 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>
2011-12-08 08:56:30 -07:00
Brian Paul
ff8e6420fb 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>
2011-12-08 08:56:30 -07:00
Brian Paul
6e8c1a92b3 mesa: remove unused functions in depthstencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
14721dfe99 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>
2011-12-08 08:56:30 -07:00
Brian Paul
bb887b72f7 swrast: remove dead accum buffer context fields 2011-12-08 08:56:30 -07:00
Brian Paul
e6e734f143 mesa: remove dead swrast and state tracker accum buffer code 2011-12-08 08:56:30 -07:00
Brian Paul
122c6768e3 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>
2011-12-08 08:56:30 -07:00
Brian Paul
aa6cb952c9 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.
2011-12-08 08:56:30 -07:00
Brian Paul
2f88139145 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>
2011-12-08 08:56:29 -07:00
Brian Paul
5acb291f31 mesa: remove TextureMemCpy driver hook
There's probably no reason to use a special version of memcpy() anymore.
2011-12-08 08:56:29 -07:00
Henri Verbeet
d958202663 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>
2011-12-08 12:54:14 +01:00
Thomas Hellstrom
340c0f6f9e 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>
2011-12-08 09:51:19 +01:00
Paul Berry
d4976158c7 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>
2011-12-07 16:38:01 -08:00
Paul Berry
2252e5e3f1 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>
2011-12-07 16:38:01 -08:00
Paul Berry
3f2283172b i965 gs: Clean up dodgy register re-use, at the cost of a few MOVs.
Prior to this patch, in the Gen4 and Gen5 GS, we used GRF 0 (called
"R0" in the code) as a staging area to prepare the message header for
the FF_SYNC and URB_WRITE messages.  This cleverly avoided an
unnecessary MOV operation (since the initial value of GRF 0 contains
data that needs to be included in the message header), but it made the
code confusing, since GRF 0 could no longer be relied upon to contain
its initial value once the GS started preparing its first message.
This patch avoids confusion by using a separate register ("header") as
the staging area, at the cost of one MOV instruction.

Worse yet, prior to this patch, the GS would completely overwrite the
contents of GRF 0 with the writeback data it received from a completed
FF_SYNC or URB_WRITE message.  It did this because DWORD 0 of the
writeback data contains the new URB handle, and that neds to be
included in DWORD 0 of the next URB_WRITE message header.  However,
that caused the rest of the message header to be corrupted either with
undefined data or zeros.  Astonishingly, this did not produce any
known failures (probably by dumb luck).  However, it seems really
dodgy--corrupting FFTID in particular seems likely to cause GPU hangs.
This patch avoids the corruption by storing the writeback data in a
temporary register and then copying just DWORD 0 to the header for the
next message.  This costs one extra MOV instruction per message sent,
except for the final message.

Also, this patch moves the logic for overriding DWORD 2 of the header
(which contains PrimType, PrimStart, PrimEnd, and some other data that
we don't care about yet).  This logic is now in the function
brw_gs_overwrite_header_dw2() rather than in brw_gs_emit_vue().  This
saves one MOV instruction in brw_gs_quads() and brw_gs_quad_strip(),
and paves the way for the Gen6 GS, which will need more complex logic
to override DWORD 2 of the header.

Finally, the function brw_gs_alloc_regs() contained a benign bug: it
neglected to increment the register counter when allocating space for
the "temp" register.  This turned out not to have any effect because
the temp register wasn't used on Gen4 and Gen5, the only hardware
models (so far) to require a GS program.  Now, all the registers
allocated by brw_gs_alloc_regs() are actually used, and properly
accounted for.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:01 -08:00
Paul Berry
43e39b58c7 i965 gen6: Allocate URB space for GS
When the GS is not in use, the entire URB space is available for the
VS.  When the GS is in use, we split the URB space 50/50.

The 50/50 split is probably not optimal--we'll probably want tune this
for performance in a future patch.  For example, in most situations,
it's probably worth allocating more than 50% of the space to the VS,
since VS space is used for vertex caching.  But for now this is good
enough.

Based on previous work by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:01 -08:00
Kenneth Graunke
7a63a311e5 i965: Set the maximum number of GS URB entries on Sandybridge.
We never filled this in before because we didn't care.

I'm skeptical these are correct; my sources indicate that both the VS
and GS # of entries are 256 on both GT1 and GT2.

I'm also loathe to change it and break stuff.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-07 16:38:00 -08:00
Paul Berry
dabe15da4f i965: Only convert if/else to conditional adds prior to Gen6.
Normally when outputting instructions in SPF (single program flow)
mode, we convert IF and ELSE instructions to conditional ADD
instructions applied to the IP register.  On platforms prior to Gen6,
flow control instructions cause an implied thread switch, so this is a
significant savings.

However, according to the SandyBridge PRM (Volume 4 part 2, p79):

   [Errata DevSNB{WA}] - When SPF is ON, IP may not be updated by
   non-flow control instructions.

So we have to disable this optimization on Gen6.

On later platforms, there is no significant benefit to converting flow
control instructions to ADDs, so for the sake of consistency, this
patch disables the optimization on later platforms too.

The reason we never noticed this problem before is that so far we
haven't needed to use SPF mode on Gen6.  However, later patches in
this series will introduce a Gen6 GS program which uses SPF mode.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:00 -08:00
Paul Berry
fcae281f06 i965 gs: Remove unnecessary mapping of key->primitive.
Previously, GS generation code contained a lookup table that mapped
primitive types POLYGON, TRISTRIP, and TRIFAN to TRILIST, mapped
LINESTRIP to LINELIST, and left all other primitives unchanged.  This
was silly, because we never generate a GS program for those primitive
types anyhow.

This patch removes the unnecessary lookup table.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:00 -08:00
Paul Berry
a98ceee0ee mesa: Track changes to transform feedback state.
This patch adds a new bit to the ctx->NewState bitfield,
_NEW_TRANSFORM_FEEDBACK, to track state changes that affect
ctx->TransformFeedback.  This bit can be used by driver back-ends to
avoid expensive recomputations when transform feedback state has not
been modified.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:00 -08:00
Aaron Plattner
63a6fd6603 glx: Fix indirect fallback when a non-Mesa GLX extension is present.
When driCreateScreen calls driConvertConfigs to try to convert the
configs for swrast, it fails and returns NULL.  Instead of checking,
it just clobbers psc->base.configs.  Then, when the application asks
for the FBconfigs, there aren't any.

Instead, make the caller responsible for freeing the old modes lists
if both calls to driConvertConfigs succeed.

Without the second fix, glxinfo fails unless you run it with
LIBGL_ALWAYS_INDIRECT:

    $ glxinfo
    name of display: :0.0
    Error: couldn't find RGB GLX visual or fbconfig

    $ LIBGL_ALWAYS_INDIRECT=1 glxinfo
    name of display: :0.0
    display: :0  screen: 0
    direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
    server glx vendor string: NVIDIA Corporation
    server glx version string: 1.4
    [...]

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-07 17:20:10 -07:00
Anuj Phogat
4558987818 glsl: Fix samplerCubeShadow support in shader compiler
This patch fixes the samplerCubeShadow support in GLSL shader compiler.
shader compiler was picking the 'r' texture coordinate for shadow comparison
when the expected behaviour is to use 'q' texture coordinate in case of cube
shadow maps.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-07 15:11:29 -08:00
Kenneth Graunke
4273943a07 i965: Set Ivybridge's is_array SURFACE_STATE bit.
Fixes piglit tests fbo-array, fbo-depth-array, fbo-generatemipmap-array,
and array-texture, as well as the array variants of my new textureSize
and texelFetch tests.

Not a candidate for 7.11 because EXT_texture_array wasn't supported.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 14:51:12 -08:00
Kenneth Graunke
d464a21e2d i965: Return BRW_DEPTHBUFFER_D32_FLOAT as the null-depthbuffer format.
Fixes many crashes on Ivybridge due to upload_sf_state calling
brw_depthbuffer_format without an actual depth buffer.  This was a
recent regression on master.

+3992 piglits on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 14:51:12 -08:00
Eric Anholt
5b27e44652 intel: Update comment about how depth/stencil miptrees are handled.
This evolved over several commits, and I also wanted to document some
new information about how we handle formats.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:54 -08:00
Eric Anholt
96159c37e3 intel: Rely on miptree mapping for all renderbuffer maps.
Now that all RBs have miptrees, and miptree mapping covered these last
two code paths, consistently use them.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:54 -08:00
Eric Anholt
5655ebf466 intel: Add support for LLC-cached reads of X-tiled miptrees using a blit.
This mimics the MapRenderbuffer code, and should improve the
performance of glGetTexImage().

v2: Fix broken error handling.
2011-12-07 13:38:53 -08:00
Eric Anholt
2d2bfd1f26 intel: Handle MapRenderbuffer of fake packed depth/stencil using miptree maps.
This gets the same performance win as the miptree maps did, and
removes a pile of code duplication.
2011-12-07 13:38:53 -08:00
Eric Anholt
e0d67a3a8b intel: Track miptrees for fake packed depth/stencil renderbuffers.
Right now the fake packed d/s RBs are creating two sub-renderbuffers
with their own storage, and the hardware setup and the mapping code
have been explicitly referencing them.  By setting miptrees on them,
we'll be able to make our renderbuffer code for fake packed
depth/stencil more consistent with all our other renderbuffers.

The interesting new behavior here is that there is now a mt with a
non-depthstencil format (X8Z24) that has a stencil_mt field
associated.  This looks like it should be safe, and we'll need to be
able to do this for floating point depth/stencil as well.
2011-12-07 13:38:51 -08:00
Eric Anholt
ed3aeb56ec intel: Make the fake packed depth/stencil mappings use a cached temporary.
Before, we had an uncached read of S8 to untile, then a RMW (so
uncached penalty) of the packed S8Z24 to store the value, then the
consumer would uncached read that once per pixel.  If data was written
to the map, we would then have to uncached read the written data back
out and do the scatter to the tiled S8 buffer (also uncached access
penalties, since WC couldn't actually combine).  So 3 or 5 uncached
accesses per pixel in the ROI (and we we were ignoring the ROI, so it
was the whole image).

Now we get an uncached read of S8 to untile, and an uncached read of
Z.  The consumer gets to do cached accesses.  Then if data was
written, we do streaming Z writes (WC success), and scattered S8
tiling writes (uncached penalty).  So 2 or 3 uncached accesses per
pixel in the ROI.

This should be a performance win, to the extent that anybody is doing
software accesses of packed depth/stencil buffers.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:08 -08:00
Eric Anholt
4cb1d6a25e intel: Make intel_region_map return void *.
We don't gripe about void * arithmetic for our driver, and this
prevents silly casting when assigning the result of mapping to
non-byte types.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
b48c3bca87 intel: Move separate-stencil s8 mapping logic to intel_miptree_map.
We're going to want to reuse this logic in mapping of fake packed
miptrees wrapping separate depth/stencil miptrees.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
baeaa062e9 intel: Move the gtt-particular texture mapping logic to a helper function.
This code will be incrementally moving to a model like intel_fbo.c's
renderbuffer mapping with helper functions, as I move that code here.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
221a36514b intel: Make mapping of texture slices track the region of interest.
This will be used for things like packed depth/stencil temporaries and
making LLC-cached temporary mappings using blits.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
b75291c61c intel: Move the teximage mapping logic to a miptree level/slice mapping.
This will let us share teximage mapping logic with renderbuffer
mapping, which has an intel_mipmap_tree but not a gl_texture_image.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
5c9a55665d intel: Only prefer separate stencil when we can do HiZ.
This required is_hiz_depth_format to start returning true on S8_Z24 as
well, since that's the format we have here.  The two previous callers
are only calling it on non-depthstencil formats.

This avoids us needing to have HiZ working on a new Z format
immediately upon exposing the format (particularly painful for
Z32_FLOAT_X24S8, which means all the fake packed depth/stencil paths).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Thomas Hellstrom
576161289d st/dri: Use depth instead of bpp when communicating formats with the X server v3
Some hardware can't reinterpret the format of hardware buffers and thus
the X server needs to know the format when the buffer is created.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Daenzer <michel@daenzer.net>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-07 20:05:24 +01:00
Kenneth Graunke
6781fd05e9 i965: Set SURFACE_STATE vertical alignment bit on Ivybridge.
See intel_vertical_texture_alignment_unit() in intel_tex_layout.c;
certain surface types require setting this to VALIGN_4.

Analogous to commit dd0e46c410 on Gen6.

Fixes piglit test fbo-generatemipmap-formats with the
GL_ARB_depth_texture and GL_EXT_packed_depth_stencil arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-06 15:14:56 -08:00
Patrice Mandin
9419894835 nouveau/nvfx: Add more unsupported PIPE_CAP values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2011-12-06 21:42:31 +01:00
Dave Airlie
2ee8704a8a radeon: add original r100 to the always tiled depth list.
According to Alex, he thinks r100 is also covered.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 16:10:43 +00:00
Fabio Pedretti
9ab43f7454 vega: remove unused vars
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-06 08:44:07 -07:00
Fabio Pedretti
0b34074bdb osmesa: remove unused bpc variable
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-06 08:42:54 -07:00
Dave Airlie
781a204bcf radeon/r200: add RV200 detiling + add an always tiled flag
passes readpix sanity on the M7.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 15:12:00 +00:00
Dave Airlie
1136da9c6b r200: add Z16 depth detiling.
This passes readPixSanity with z16 visuals.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 15:11:36 +00:00
Dave Airlie
61a40581d2 r200: handle Z24 depth buffers correctly
The same detiling pattern applies to X8_Z24 as well.

Signed-off-by: Dave Airlie <Airlied@redhat.com>
2011-12-06 15:11:36 +00:00
Vadim Girlin
e98521e0f3 r600g: check shaders presence in r600_draw_vbo
This patch should prevent the crashes when some shaders are absent,
see https://bugs.freedesktop.org/show_bug.cgi?id=43341

Note this is a candidate for the stable branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-06 09:53:35 -05:00
Dave Airlie
81a715605a r200: fix cb microtile setup
We shouldn't see this in buffers from the DDX but just in case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 10:34:16 +00:00
Dave Airlie
4d4cecd05b r200: enable tiling flags on blitter setup.
The r200 blitter also didn't set the correct tiling flags.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 10:34:16 +00:00
Anuj Phogat
c3aae7745a swrast: Add depth cube map support.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-05 17:02:13 -08:00
Anuj Phogat
29a7d7784d mesa: Allow glTexImage2D with a depth component cube map.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-05 17:02:05 -08:00
Kenneth Graunke
84d6201567 i965: Fix incorrect comment about single program flow on Ironlake.
The code forces single program flow to be enabled on Ironlake, or
equivalently, disables multiple program flow.  The comment was reversed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-05 17:00:07 -08:00
Jerome Glisse
e368eefc68 r600g: fix error path and use util_slab_free
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-05 18:42:38 -05:00
Jerome Glisse
bbc320a94d gallium/radeon: fix indentation
Indentation cleanup, to keep consistency.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-05 18:40:53 -05:00
Dave Airlie
a8bbbcae4a radeon/r200: drop old span depth/stencil code.
This is no longer used with the new renderbuffer code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 19:15:52 +00:00
Dave Airlie
7d91ecf7a3 radeon/r200: add draw/stencil buffer detiling
This moves the detiling to the fbo mapping, r200 depth is always tiled,
and we can't detile it with the blitter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 19:15:04 +00:00
Dave Airlie
c48763643e radeon: fix warnings 2011-12-05 16:51:03 +00:00
Dave Airlie
f24e106ead radeon: use mesa renderbuffer accessors for depth for now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 16:25:27 +00:00
Dave Airlie
5c666bdfdb radeon: add some tiling support for r100.
This sets up the tiling flags on the blitter.

Fixes some piglit tests with tiling enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 15:41:24 +00:00
Dave Airlie
b2596c36c8 radeon: texture/renderbuffer overhaul.
This could have been split up better, but the driver is just broken now,
so bisecting the brokenness is going to be painful no matter what.

This adds renderbuffer mapping/unmapping along with texture image allocation.
It drops all the old texture upload paths, some of which could possible be
reimplemented with the blitter later.

It also redoes the span code paths to use its own set of image mapping handlers,
along with removing the tiling decode paths for the color buffers, since
we now hope to use the blitter for this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 14:36:19 +00:00
Dave Airlie
fd7fcfcc2d radeon: set texture bits to always emit.
I think there is a missing state update or flush somewhere, and every
so often PP_CNTL goes to the kernel with a texture enabled but no texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie
4ed8a58584 radeon: update flush according to glXMakeCurrent man page
This also copies code from intel driver to do this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie
6d573c4dd7 radeon: drop border check
now that we strip borders off earlier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie
fbfa807034 radeon: add a bit more debugging to the blit debug code.
For debugging blits it helps if we printed out the offsets as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Eric Anholt
887c349d54 mesa: Reject glDrawPixels(integer format).
When folding GL_EXT_texture_integer into the core, a new (and very
sensible) restriction was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-04 14:54:16 -08:00
Brian Paul
1bb59b382a util: add casts in fprintf() calls to silence warnings
And wrap to 80 columns.
2011-12-03 09:31:45 -07:00
Mathias Fröhlich
b14c06e10d mesa: Use VERT_{ATTRIB,BIT}* for ARB input validation.
For validating ARB program inputs replace hard
coded bitfield and attribute number with the appropriate
VERT_{ATTRIB,BIT}* variant.

This should fix:

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

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-12-03 08:13:49 +01:00
Chia-I Wu
b7a69cbb71 egl_glx: fix eglDestroyContext
Wrong pointers are passed to glXDestroyContext.

Spotted by Brian Paul.
2011-12-03 11:10:16 +08:00
Stuart Abercrombie
aa010157a3 i965: Fix emit of a MOV with bad destination channel on gen6 math in FPs.
Previously a zero writemask would result in dst_chan == -1, meaning an
unnecessary MOV with the destination register dictated by undefined
memory contents would be emitted before returning.  This caused
intermittent GPU hangs, e.g. with glean/texCombine.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-02 15:28:44 -08:00
Eric Anholt
079bb3fff7 mesa: Fix assertions for block size handling in glCompressedTexSubImage2D.
Anything of less than (bw, bh) size is possible when you consider
rectangular textures, and this code is (now) safe for those.  Even for
power-of-two textures, width could be 4 for FXT1 while not being
aligned to block size.

Fixes piglit compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 15:28:44 -08:00
Eric Anholt
1e0b6a90d7 mesa: Fix glCompressedTexSubImage (and non-Sub) for height == 2 or 1.
Generally this code works with width and height aligned to compressed
blocks, but at the 2x2 and 1x1 levels of a square texture (or height <
bh in general), we were skipping uploading our single row of blocks.

Fixes piglit compressedteximage GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 15:28:44 -08:00
Eric Anholt
bda361e0d4 mesa: Fix glCompressedTexImage when dstRowStride != srcRowStride.
Since the MapTextureImage changes on Intel, nwn had corruption in the
scrollbar at the load game menu, and corrupted ground textures in the
starting zone.  Heroes of Newerth's intro screen was also thoroughly
garbled.  A new piglit test "compressedteximage" was created to
regression test this.

The issue was this code now seeing dstRowStride aligned to hardware
requirements instead of a temporary buffer that gets uploaded to
hardware later.  The existing code was just trying to memcpy
srcRowStride * height / bh, while the glCompressedTexSubImage2D()
storage code nearby did the correct walking by blockheight rows at a
time.  Just reuse the subimage upload instead of duplicating that
logic.

v2: Update comment at the top of the function (suggestion by Joel
Forsberg)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41451
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-12-02 15:28:44 -08:00
Marcin Slusarz
27e77cb902 nv50/nvc0: fix crash when channel allocation fails 2011-12-02 19:31:50 +01:00
Brian Paul
19b1025172 mesa: add casts to fix unpack_SIGNED_GR1616()
We were passing unsigned values to the macro before.
2011-12-02 07:22:40 -07:00
Brian Paul
bbbab8de63 mesa: remove unreachable code in _mesa_unpack_color_span_ubyte()
We checked if srcType == GL_UNSIGNED_BYTE earlier so there was no
way to reach this code.  This was left-over code from the GLchan
removal work.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:40 -07:00
Brian Paul
01cd9a7d92 vbo: remove unreachable _mesa_error() call
If mode is not GL_POINT/LINE/FILL we'll have already reported the
error earlier in the function and returned so we can never get here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:40 -07:00
Brian Paul
89efc1b839 mesa: move _mesa_error() call in compressedteximage()
We shouldn't call _mesa_error() if the target is a proxy texture.
Errors are handled later in the function.
Fixes a Coverity warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:39 -07:00
Brian Paul
9ec5050898 mesa: fix potential mem leak in generate_mipmap_compressed()
Fixes a coverity warning.

Reviewed-by: Vinson Lee <vlee@vmware.com>
2011-12-02 07:22:39 -07:00
Brian Paul
98ebe833fe glsl: return visit_stop in ir_validate::visit_enter() to silence warning 2011-12-02 07:22:39 -07:00
Brian Paul
06913497d6 mesa: fix some minor texstore comments
For the texsubimage commands, we're not mapping the whole image/region.
2011-12-02 07:22:39 -07:00
Brian Paul
b4aecc4e18 mesa: rename MESA_FORMAT_RG88_REV to MESA_FORMAT_RG88
R is in the high byte, G in the low byte.
2011-12-02 07:22:39 -07:00
Brian Paul
0a3c895f34 mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88
To better reflect the component ordering and be consistent with other
format names.
2011-12-02 07:22:39 -07:00
Brian Paul
0be753a143 mesa: fix unpacking of RG88_REV texels
R should be in the high byte and G in the low byte for this format.
2011-12-02 07:22:39 -07:00
Kenneth Graunke
e304aa3600 i965: Make gen6_resolve_implied_move a no-op for MRF sources.
Attempting to move an MRF to a MRF is not only pointless, it will fail
because MRFs are read-only, resulting in garbage in your register.

If we already set up a MRF source, there's nothing to resolve anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-02 02:49:23 -08:00
Mathias Fröhlich
ce45aecfda mesa: Renumber the tnl attributes to match VERT_ATTRIB*.
Also renumber the tnl modules vertex attributes to match
the renumbered VERT_ATTRIB_* values.

This should fix

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

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 07:04:49 +01:00
Mathias Fröhlich
a4f345e0d2 mesa: Extend BITSET64_*_RANGE to work on arbitrary ranges.
The BITSET64_{TEST,SET,CLEAR}_RANGE macros only work on ranges
wither in the lower 32 or in the upper 32 bits of the bitset.
This change extends these macros to work on arbitrary ranges
possibly crossing the bitset word boundary.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 07:04:49 +01:00
Stéphane Marchesin
52b75c6165 i915g: Implement GL_STREAM_* for textures by using untiled textures. 2011-12-01 18:12:56 -08:00
Stéphane Marchesin
d269ce0a39 i915g: Add unsupported PIPE_SHADER_CAP_OUTPUT_READ to silence warnings. 2011-12-01 18:09:18 -08:00
Chia-I Wu
912f7b6bfe docs: list GL_OES_compressed_ETC1_RGB8_texture in 7.12 release notes
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:47 +08:00
Chia-I Wu
cde6c91fd5 st/mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Have st/mesa recognize MESA_FORMAT_ETC1_RGB8 then we are good to advertise the
extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
5c31eb78e5 gallium: add PIPE_FORMAT_ETC1_RGB8
The format is defined by GL_OES_compressed_ETC1_RGB8_texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
d4a38e86d4 mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa.  There is no
driver support yet.

Unlike desktop GL compressed texture formats, GLES compressed texture formats
usually can only be used with glCompressedTexImage2D.  All other gl*Tex*Image*
functions are updated to check for that.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
51f4d27254 mesa: add ETC1 decoding routines
The format is defined by GL_OES_compressed_ETC1_RGB8_texture.  These routines
will be used in the following commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:45 +08:00
Chia-I Wu
4eae2b37a8 glapi: regenerate files for GL_OES_compressed_ETC1_RGB8_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:45 +08:00
Chia-I Wu
35b506148e glapi: add GL_OES_compressed_ETC1_RGB8_texture for GLES
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:44 +08:00
Mathias Fröhlich
a4c952f36f swrast: Fix signed/unsigned problems with negative strides.
In swrast_map_renderbuffer negative strides lead to
render buffer map pointers that are off by 2^32.
Make sure that intermediate negative values are not
converted to an unsigned.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-01 21:44:57 +01:00
Vinson Lee
de93347d48 u_vbuf: Silence uninitialized variable warnings.
Fixes these GCC warnings.
u_vbuf.c: In function ‘u_vbuf_draw_begin’:
u_vbuf.c:839:20: warning: ‘max_index’ may be used uninitialized in this function [-Wuninitialized]
u_vbuf.c:838:20: warning: ‘min_index’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-01 11:41:14 -08:00
Alex Deucher
5df2d18f70 r600g: add some new pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-01 11:06:49 -05:00
Brian Paul
e10942c8e9 mesa: fix unpack_ARGB1555_REV()
We weren't doing the necessary byte swap.

v2: use same arithmetic as unpack_ARGB1555() to be consistent.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-12-01 08:07:34 -07:00
Brian Paul
478f0d228b mesa: fix indentation in attrib.c 2011-11-30 20:35:02 -07:00
Eric Anholt
51e5a266c1 i965/fs: Fix regression in fbo-alphatest-nocolor.
In the refactor for handling user-defined out params, we failed to set
up the new color output tracking when there was no color drawbuffer in
place but alpha testing was on.  Just always set up at least one when
handling gl_FragColor, since we won't make use of its value unless we
need to.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42806
2011-11-30 11:23:26 -08:00
Eric Anholt
a3b8c5ed5b i965/fs: Make register file enum 0 be the undefined register file.
In 6d874d0ee1, I checked whether a
register that had been stored was BAD_FILE (as opposed to a legitimate
GRF), but actually the unset register was ARF NULL because it had been
memset to 0.  Finding BAD_FILE for unset values in debugging was my
intention with that file, so make it the case more often by
rearranging the enum.  There was only one place we relied on the magic
enum register_file to hardware register file correspondance anyway.
2011-11-30 11:23:26 -08:00
Eric Anholt
c6abde211f i965: Don't perform the precompile on fragment shaders by default.
It is useful to have this option for shader-db, and it was also good
at the time where we were rejecting shaders due to various internal
limits we hadn't supported yet.  However, at this point the precompile
step takes extra time (since not all NOS is known at link time) and
spews misleading debug in the common case of debugging a real app.

This is left in place for VS, where we still have a couple of codegen
failure paths that result in link failure through precompile.  Those
need to be fixed.

shader-db can still get at the debug info it wants using
"shader_precompile=true" driconf option.  Long term, we can probably
build a good-enough app for shader-db to trigger real codegen.
2011-11-30 11:22:53 -08:00
Kai Wasserbäch
0a22fb6a5d gallium/failover: Remove the deprecated module.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-30 17:26:40 +00:00
Brian Paul
15245cbad4 st/mesa: fix indentation 2011-11-30 07:09:46 -07:00
Brian Paul
efcf5aa13f mesa: use _mesa_is_bufferobj() in update_array() 2011-11-30 06:57:38 -07:00
Brian Paul
529fa77529 mesa: use Elements() macro in program printing code 2011-11-30 06:57:37 -07:00
Brian Paul
c67d9cfd9d mesa: fix signed/unsigned comparison warning 2011-11-30 06:57:37 -07:00
Brian Paul
c3a57841a3 mesa: fix MESA_FORMAT_RG88 format match test
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-30 06:57:37 -07:00
Brian Paul
76374e60cd mesa: fix printf format warning in _mesa_fprint_program_parameters() 2011-11-30 06:57:37 -07:00
Brian Paul
1ad5a1a246 tnl: s/INLINE/inline/ 2011-11-30 06:57:37 -07:00
Brian Paul
22ad02b3ff mesa: regenerated dispatch.h (s/INLINE/inline/) 2011-11-30 06:57:37 -07:00
Brian Paul
919c835835 glapi: s/INLINE/inline/ for dispatch.h file 2011-11-30 06:57:36 -07:00
Brian Paul
ea472ffe67 swrast: use STATIC_ASSERT to make sure texfetch table isn't missing entries
When new MESA_FORMAT_x enums are added we need to add a new entry in
the table of texture fetch functions.  In the past this has been
missed if swrast isn't actually tested.  Using a static assertion
should help with that.
2011-11-30 06:57:36 -07:00
Brian Paul
15be8b4bf0 mesa: add STATIC_ASSERT() macro for compile-time assertions
This can be used to check that tables have the right number of entries,
etc. at compile-time.  This will hopefully catch things that are missed
if particular drivers aren't tested, for example.

v2: Simplify the macro to omit the extra line number info (the compiler
already indicates the line number).  And wrap the macro for readability.
2011-11-30 06:57:36 -07:00
Brian Paul
25c8a112ab mesa: access pixels as GLushort in unpack_SL8()
Per the format comments and the texstore code, use a GLushort to access the
pixel.  The code was OK as-is on little endian machines.
2011-11-30 06:57:36 -07:00
Eric Anholt
2134d2f35b mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().
There was only one consumer of this API, meta.c, which was intending
to ask "is this format just stencil index (and nothing else)?".
Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type
formats, it would just try to draw the stencil parts.  Nothing good
came of this.

This function looks rather silly at this point, but I'm leaving it in
place to be the obvious parallel API to _mesa_is_depth_format().  Note
that if you want the old behavior, you should use it as
(_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is
commonly done for depth-related tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
ed945b0bc7 mesa: Fix the datatype of GL_DEPTH32F_STENCIL8's depth channel.
Asking for the datatype of MESA_FORMAT_Z32_FLOAT_X24S8 is a bit funny
-- there's a float depth channel, and a stencil channel that doesn't
have a particular GLenum associated with its type, so what's the
correct response?

Because there is no query for stencil, just make this format's
datatype be that of the depth channel.  It fixes the depth query (and
thus a failure in piglit gl-3.0-required-sized-formats), and none of
the other consumers of the _mesa_get_format_datatype() API care.

v2: Add a comment for why the DataType is this way for this format.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
d2235b0f46 i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.
We were already doing it through the shader (layered underneath
GL_EXT_texture_swizzle) in the shadow compare case.  This avoids
having per-format logic for switching out the surface format dependent
on the depth mode.

v2: Also do the swizzling for DEPTH_STENCIL.  oops.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
f98bfb5d68 i965: Fix EXT_texture_swizzle with a writemask in the FFFS/FP backend.
I tripped over this bug in the next commit, relying on our
EXT_texture_swizzle to do some shadow sampler-related swizzling.  If a
writemask was masking out a channel of the destination that was a live
channel of the texture swizzle, it would read undefined values.

Fixes piglit ARB_fragment_program_shadow/masked.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
d84a180417 i965: Base HW depth format setup based on MESA_FORMAT, not bpp.
This will make handling new formats (like actually exposing Z32F)
easier and more reliable.

v2: Remove the check for hiz buffer -- the MESA_FORMAT should really
    be giving us the value we want even for hiz.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Kai Wasserbäch
ccd4d4367f gallium/cell: Remove the driver.
Complicates Gallium3D development and doesn't seem to have active users.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-29 20:26:53 +00:00
Eric Anholt
09e67706e9 i965: Don't depth test the fake depthbuffer when one isn't present.
For the non-separate-stencil-only case, we've been using a NULL
surface for depth, so we didn't have to care.  However, to support
separate stencil with no depthbuffer, we have to make the depth
surface non-NULL or the stencil test always fails thanks to separate
stencil inheriting the surface type of depth.

Fixes hiz-depth-stencil-test-d0-s8.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-29 11:18:23 -08:00
Ian Romanick
e6c314f7d2 mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES
Page 77 (page 91 of the PDF) says about glGetActiveAttrib:

    "The returned attribute name can be the name of a generic
    attribute or a conventional attribute (which begin with the prefix
    "gl_", see the OpenGL Shading Language specification for a
    complete list)."

Page 261 (page 275 of the PDF) says about glGetProgramiv:

    "If pname is ACTIVE_ATTRIBUTES, the number of active attributes in
    program is returned."

It doesn't say anything about built-in vs. user-defined attributes.
From the language around glGetActiveAttrib and the lack of an
exclusion of built-in attributes, which exists other places (e.g.,
around glBindAttribLocation), we can infer that GL_ACTIVE_ATTRIBUTES
should include the active attribute count.  It should also be included
in the values returned by glGetActiveAttrib.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43138
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Yi Sun <yi.sun@intel.com>
2011-11-29 11:14:28 -08:00
Chad Versace
03bbcd447c swrast: Fix some static analysis warnings
To each switch statement in s_texfilter.c, add a break statement to the
default case.

Eliminates the Eclipse static analysis warning: No break at the end of
this case.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-29 10:36:15 -08:00
José Fonseca
10b07665be Remove windows kernel support code.
Not actively used.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 17:34:56 +00:00
José Fonseca
57f8e26ca8 gallium/auxiliary: Remove os_stream.
XP kernel mode was the only subsystem lacking stdio FILES.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 17:34:30 +00:00
Kai Wasserbäch
23a8a7fe8c docs: Removed i965 entry in the source tree listing.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-29 16:27:50 +00:00
Kai Wasserbäch
5383c9c7be docs: Added item to release notes for 7.12.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-29 16:27:48 +00:00
José Fonseca
c8db5a3d53 st/vega: Fix warnings about dllimport attributes on windows. 2011-11-29 15:55:40 +00:00
Kai Wasserbäch
2c27f204f1 i965g: Delete this driver.
Never completed, and no plans to do so.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-29 15:44:09 +00:00
Chia-I Wu
76ba431b97 mesa: distinct gl_client_array arrays are gone
Fix build errors since 762c9766c9.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
2011-11-29 17:13:01 +08:00
Mathias Fröhlich
762c9766c9 mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.
Replace the distinct struct gl_client_array members in gl_array_object by
an array of gl_client_arrays indexed by VERT_ATTRIB_*.
Renumber the vertex attributes slightly to keep the old semantics of the
distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
Update all occurances of the distinct struct members with the array
equivalents.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:37:19 +01:00
Mathias Fröhlich
dca6a28a14 mesa: Make gl_program::InputsRead 64 bits.
Make gl_program::InputsRead a 64 bits bitfield.
Adapt the intel and radeon driver to handle a 64 bits
InputsRead value.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
f364ac1da1 mesa: Make gl_array_object::_Enabled 64 bits.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
ed42c25807 vbo: Use The VERT_{ATTRIB,BIT} defines.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
104b81def4 mesa: Replace _NEW_ARRAY_* bits with VERT_BIT_*
Consolidate the two distinct set of flags to use VERT_BIT_*.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
b57101302d mesa: Introduce more symbolic VERT_{ATTRIB,BIT}* defines.
Introduce a set of defines for VERT_ATTRIB_* and VERT_BIT_*
that will be used in the followup patches.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Yuanhan Liu
a0a5bd4bb3 mesa: move ElementArrayBufferObj to gl_array_object
According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

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-29 09:48:50 +08:00
Brian Paul
4ff212aac3 mesa: update comments for _mesa_format_matches_format_and_type(), 80-column wrapping 2011-11-28 18:10:30 -07:00
Brian Paul
0cbdead62e mesa: add component comments for sRGB formats 2011-11-28 18:10:30 -07:00
Brian Paul
ae70caf7eb mesa: update texstore comments for R/G textures 2011-11-28 18:10:30 -07:00
Brian Paul
50b91aa305 mesa: fix comments for RG formats
The position of the red and green bits was misstated in the comments.
Arguably, the names of these formats should be changed to "GR" to reflect
the component ordering and to be consistent with other formats.
2011-11-28 18:10:30 -07:00
Brian Paul
6856472689 st/mesa: don't try to allocate zero-sized renderbuffers
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43047
and https://bugs.freedesktop.org/show_bug.cgi?id=43048

Note: This is a candidate for the 7.11 branch.

Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-28 18:10:30 -07:00
Daniel Vetter
8f15c31338 gallium/i965g: hide that utterly broken driver better
And warn loudly in case people want to use it. Too many tester report
gpu hangs on irc and we rootcause this ...

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-28 23:54:47 +01:00
Brian Paul
e32ada1b26 swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINT
As with the other integer-valued formats, use NULL until we support
integer textures.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316

Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-28 15:40:11 -07:00
Brian Paul
5c84e961e3 mesa: remove unused gl_texture_object::DriverData field 2011-11-28 10:07:19 -07:00
Brian Paul
c5012c1d56 mesa: handle MapTextureImage() failures in mipmap generation code
And handle potential malloc failures too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul
e984085299 mesa: handle MapTextureImage() failures in glGetTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul
1ad88fb42d mesa: handle MapTextureImage() failures in glTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul
e68994494b mesa: fix frag shader generation for alpha test with no color buffers
If alpha test is enabled and there's no color buffers we still need the
fragment shader to emit a color.

v2: add _NEW_COLOR flag in _mesa_update_state_locked()

Fixes piglit fbo-alphatest-nocolor-ff failures with Gallium drivers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net> (i965)
2011-11-28 08:13:04 -07:00
Brian Paul
56b870e441 mesa: check for null ptr in _mesa_is_bufferobj()
This simplifies a few callers.  And it adds a bit of robustness.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-11-28 08:07:32 -07:00
Brian Paul
37bf720da4 mesa: move _mesa_base_format_has_channel() into image.c
This is where other format-related functions live.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:32 -07:00
Brian Paul
d45c9b239f mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queries
Use the _mesa_base_format_has_channel() helper as we do for the
other texture format component queries.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:26 -07:00
Brian Paul
f0b6e9a729 mesa: use _mesa_base_format_has_channel() in fbobject.c queries
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:09 -07:00
Brian Paul
858d1f0b1c mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()
The source array elements are 8-bytes (float + uint) so we need
to multiply the src index by 2 to get the right array stride.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-28 08:04:48 -07:00
Dave Airlie
ee47e19738 mesa/docs: add ARB_texture_rgb10_a2ui to relnotes/gl3.txt
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00
Dave Airlie
9f9c8592e6 st/mesa: add ARB_texture_rgb10_a2ui support
Add support to the state tracker format and extension enablement code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00
Dave Airlie
f449be660e mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.
This format is used in the ARB_texture_rgb10_a2ui spec.

It adds core mesa support, texformat + texstore support, format_unpack
and fbobject.c (all patches from list merged + fixed up).

also fixes some whitespace issues.

Parts were:
Reviewed-by: Eric Anholt <eric@anholt.net>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00
Dave Airlie
47e2e36717 image/pack: fix missing GL_BGR(A)_INTEGER support.
These codepaths were missing the cases for BGR_INTEGER/BGRA_INTEGER.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 09:03:17 +00:00
Ian Romanick
537c687116 docs: Add 7.11.2 release notes and news 2011-11-27 14:17:40 -08:00
Dave Airlie
923f143335 image: fix legal types for packed integer formats.
After reading ARB_texture_rgb10_a2ui it appears the packed formats
for integer types are only specified via this extension, and not via
the original ones. So condition the checks on this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-27 20:44:01 +00:00
Dave Airlie
9608ef5dec r600g: add framebuffer support for 2/10/10/10 integer 2011-11-27 20:36:27 +00:00
Dave Airlie
d38768fe38 r600g: add int support for 2/10/10/10 format.
integer wasn't set properly for the non-uniform types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 19:32:05 +00:00
Dave Airlie
c33d2e6b08 docs/gl3: these two interfaces are complete now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 17:36:48 +00:00
Dave Airlie
b50e017ae1 pack: fix indentation (trivial)
just saw this while looking for other problems.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 17:36:22 +00:00
Dave Airlie
8c1037042f glapi: add ARB_texture_rgb10_a2ui support.
This just adds one enum.

regenerate enums.c.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 16:25:12 +00:00
Dave Airlie
ee7bc10391 gallium: add B10G10R10A2_UINT format
This format is used for ARB_texture_rgb10_a2ui extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 16:25:12 +00:00
Chia-I Wu
d4fcf67a3a mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REV
MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android.
Thanks to texture-from-pixmap, drivers may actually see texture images with
this format on Android.

MESA_FORMAT_RGBX8888 is added only for completeness.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format.  I
      accidentally moved them to the wrong place when preparing the patch.]
2011-11-27 12:43:24 +08:00
Beren Minor
6baa5f10c0 egl_glx: Try first a default lookup for glXGetProcAddress before loading dynamic lib.
GLX functions are sometimes directly available in the current binary. In such
cases, we do not need any alternate library loaded using dlopen. Otherwise,
dlopen may find the wrong libGL library and get functions that conflicts with
the current loaded ones.

For example, on Debian Sid with nvidia binary drivers, using mesa's libEGL with
GLX driver leads to wrong glXGetFBConfigs symbol loaded (or loaded twice?),
which leads to "GLX: failed to create any config" error message as the
glXGetFBConfigs symbol seems to return garbage. If the binary is linked with
nvidia's libGL, the GLX symbols are already available.
Without this patch, convert_fbconfig (src/egl/drivers/glx/egl_glx.c:233) fails
for every config found, after glXGetFBConfigAttrib(... GLX_RENDER_TYPE, ...)
call, as the value returned has GLX_COLOR_INDEX_BIT and not GLX_RGBA_BIT.

[olv: initialize handle, prepend egl_glx to the commit log]
2011-11-27 11:22:24 +08:00
Chia-I Wu
496f68bb9d android: bring in i915_dri and i965_dri automatically
Add i915_dri and i965_dri to libGLES_mesa's LOCAL_REQUIRED_MODULES when
enabled.
2011-11-26 11:42:08 +08:00
Chia-I Wu
d2cd621086 android: pass -std=c99 by default
Several modules expect a C99 compiler already.  It is also the default for
Makefile build.
2011-11-26 11:42:08 +08:00
Chia-I Wu
4d3d6f76ff android: move libGLES_mesa build rules to src/egl/main/.
Keep the top-level Android.mk away from building modules.
2011-11-26 11:42:08 +08:00
Chia-I Wu
169ef48c85 android: clean up libglapi bulid rules a bit
Make the output prettier.  Make the rules reusable if we ever want to add
other modules, such as libGLESv2_mesa.
2011-11-26 11:42:01 +08:00
Thomas Hellstrom
dbf00812b0 st/xa: Kill a couple of compilation warnings
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:38:44 +01:00
Thomas Hellstrom
32b1641a59 st/xa, xa/vmwgfx: Generate exported symbol list from the st/xa symbols.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:38:36 +01:00
Thomas Hellstrom
4d04367eca st/xa, xa/vmwgfx: Use XA_EXPORT attribute to indicate global visibility
Also fix up Makefiles to use the default mesa compilation flags.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrants <jakob@vmware.com>
2011-11-25 16:38:16 +01:00
Thomas Hellstrom
404d2f9c86 st/xa, xa/vmwgfx: Set the right version on library suffix
Also remove some unused variables in the st/xa makefile.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:36:29 +01:00
Chia-I Wu
75cc24c876 android: add support for ICS
With ICS (Android 4.0), several headers and structs are renamed.  Define
ANDROID_VERSION so that we can choose a different path depending on the
platform version.

I've tested only softpipe and llvmpipe.  r600g is also reported to work.
2011-11-25 12:34:33 +08:00
Chia-I Wu
42c2c371d6 vbo: fix !FEATURE_beginend build
Fix a build error in GLES-only build.
2011-11-25 11:18:50 +08:00
Chia-I Wu
d3d3c12a95 st/egl: fix a crash in Android backend
There is no buffer and android_surface_present should be a no-op when
eglSwapBuffers is called twice in a row.
2011-11-25 11:18:02 +08:00
Brian Paul
24d25b55bf softpipe: s/int/unsigned/ to be consistent in alpha test code 2011-11-23 15:04:01 -07:00
Brian Paul
173427841a softpipe: remove pointless break stmt 2011-11-23 15:02:05 -07:00
Chad Versace
f99d5af03b i965/gen6: Fix GPU hang when using stencil buffer without depth
Enable the bit 3DSTATE_DEPTH_BUFFER.Tiled_Surface.  From the Sandybridge
PRM, Volume 2, Part 1, Section 7.5.5.1.1 3DSTATE_DEPTH_BUFFER, Bit 1.27
Tiled Surface:
   [DevGT+]: This field must be set to TRUE.

Fixes GPU hangs on the following Piglit tests:
   hiz-stencil-test-fbo-d0-s8
   hiz-stencil-read-fbo-d0-s8

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-23 11:03:31 -08:00
Eric Anholt
8d15268a61 i915: Fix complete texturing regression since 27505a105a
I had notes to myself to test gen3 and gen4, and then I tested gen4
and called it good.  Turns out I forgot to actually call the new
function on gen3.
2011-11-23 09:45:17 -08:00
Eric Anholt
87f12bb2d9 i915: Fix build since hiz merge.
v2: Guard against rb->mt being NULL, since we may enter the draw
regions path before intel_prepare_render() has been called to set
them.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
2011-11-23 09:44:58 -08:00
Brian Paul
ca4e664f21 mesa: fix incorrect error message in format_unpack.c 2011-11-23 08:40:46 -07:00
Vasily Khoruzhick
8265bb7fb8 i915g: don't set alpha to 1 for RGBX and BGRX
This patch fixes regression introduced in
1f3c5eae5c

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-11-23 11:32:13 +01:00
Brian Paul
fc144728c7 mesa: update comment for clear_teximage_fields() 2011-11-22 17:16:50 -07:00
Brian Paul
12dd5dedf5 gallium: remove trailing comma and unneeded comments in p_defines.h 2011-11-22 17:08:36 -07:00
Marek Olšák
a7c107f3bc mesa: re-implement unpacking of DEPTH_COMPONENT32F
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43122

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-23 00:00:40 +01:00
Eric Anholt
27505a105a i915: Move the texture format setup for this driver out of shared code.
The i965 driver is now enabling all of these formats on its own from
the surface format table.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
899e6ea8d3 i965: Drop intel_context.c's texture format set up for this driver.
This is a no-op change on gen6, but should result in some
actually-unsupported formats on gen4 no longer being chosen (like
RGBA_FLOAT32 now being RGBA_FLOAT16).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
f8b13ba137 i965: Add support for ARGB2101010 rendering.
GL 3.0 specifies GL_RGB10_A2 as a required sized format for rendering
and texturing.

This introduces two piglit regressions: one due to fbo-mipmap-copypix
hitting swrast GetRow (we want to convert swrast to MapRenderbuffer),
and one due to fbo-blending-formats being too picky while leaving
dithering on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
b0a0f4bf14 i965: Add support for RGBA_16 unorm rendering.
GL 3.0 specifies GL_RGBA16 as a required sized format for rendering
and texturing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
1e42568bf3 i965: Add support for half-float formats.
Now that all the rest of the driver is driven off of the surface
formats table, all we really need to do is add the mapping from
MESA_FORMAT to BRW_SURFACEFORMAT.  However, we also add format
override for I16/L16 render targets at the same time, so that existing
users of I16 that were getting promoted to I32 and then getting the
I32->R32 override still get FBO support.

Fixes failures in piglit gl-3.0-required-sized-texture-formats, and
will prevent regressions in ARB_texture_float on gen4 when moving to
fully table-driven texture format setup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
f258c0dfa8 mesa: Fix unpack for MESA_FORMAT_INTENSITY_FLOAT16.
Fixes failures in i965 on fbo-blending-formats when the format is enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
6216a5b495 mesa: Fall back to float16 if float32 isn't supported in ChooseTexFormat.
Until GL 3.0, there isn't any requirement on the actual sizes of
channels chosen.  By falling back to 16 here, we can correctly support
ARB_texture_float on original i965 hardware, which can't correctly
filter 32-bit floats.
2011-11-22 13:58:38 -08:00
Eric Anholt
babe26b3ef mesa: Add fallback from RGB_FLOAT16 to RGBA_FLOAT16 before RGBA_FLOAT32.
Not all i965 hardware can do RGB float16, and this will at least save
half the memory and have expected behavior in terms of precision.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
2d159e6b36 i965: Reorganize MESA_FORMAT -> BRW_SURFACEFORMAT table.
This should be a no-op change.  The initializers are reordered to
match the ordering of the enum, since there isn't a clearly sensible
ordering, but "the order they were added to the driver, sort of" is
definitely not one.

Also, the unsupported formats are explicitly initialized to 0, so it's
more obvious what we aren't claiming to support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
1b4910b305 i965: Mark texture formats as supported using the surface formats table.
This is currently duplicated with intel_context.c's setup of the
formats table, and sets true for exactly the same set of formats on
gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
3d798abc81 intel: Improve debug output for begin/finish render texture.
I've never seen a use for the thread ID value, but knowing the format
being rendered is kind of a big deal.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
05ab8fc134 intel: Remove duplicate test for texture attachment completeness.
We are already testing this if appropriate in
intel_validate_framebuffer (FBO completeness), so no need to avoid
attaching the texture to the renderbuffer here.

This causes MESA_FORMAT_R11_G11_B10_FLOAT to now be renderable as a texture
attachment on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
925356c8c0 i965: Don't require spans (swrast) support to consider a format FBO complete.
We don't want to go writing GetRow/PutRow for every format required by
GL 3.0, when it's very hard to get those functions called, and in
every case we want to make swrast do direct mapping through
MapRenderbuffer anyway.

This causes MESA_FORMAT_R11_G11_B10_FLOAT to be considered complete on gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
ca10b2d449 i965: Use the surface format table to determine render target supportedness.
This moves any chipset-dependent logic we want for render target
format choices to init time as well.  There is still logic left at
state update for SRGB handling, where format choices change based on
GL state.

The brw_render_target_supported() function should now return correct
results, instead of relying on the limited results from
intel_span_supports_format() to avoid lying about FBO completeness.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
6661b7596f intel: Add the context to the render_target_supported() vtbl method.
We're going to want to provide different answers per chipset
generation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
e589ebdf23 i965: Add a table of the surface format information from the PRM.
This will be used to drive chosing formats and determining framebuffer
completeness, instead of the bunch of ad-hoc checks we have had until
now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 13:58:38 -08:00
Eric Anholt
755f0a0a02 mesa: Make formats.c "datatype" values match glGetTexLevelParameter return.
The formats.c code's "datatype" value is "what does this value mean",
i.e. unorm or snorm or float, and is the return value from the
GL_TEXTURE_RED_TYPE class of queries.  The depth formats were marked
as GL_UNSIGNED_INT, which is what we use for integer, and not what we
should be returning from the glGetTexLevelParameter.

In texstore, we were inappropriately using it as an argument to
_mesa_unpack_depth_span() that was expecting a value like
GL_UNSIGNED_INT or GL_UNSIGNED_SHORT.  Just hardcode
_mesa_unpack_depth_span()'s arguments for now, though it looks like
the consumers of that interface would be happier with using
MESA_FORMAT.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-22 13:58:37 -08:00
Eric Anholt
250a9c8e7e mesa: Don't report types for 0-sized components of textures.
The GL_TEXTURE_WHATEVER_SIZE entrypoints were checking if the
specified base type of the texture allowed that channel to be present
before reporting the size of the channel, so that GL_RGB didn't end up
with an alpha size if the hardware driver had to store it that way.

The GL_TEXTURE_WHATEVER_TYPE entrypoints weren't checking it, so you
would end up with strange responses from the GL involving 0-bit
floating-point alpha components in GL_RGB32F, even though it says
GL_NONE as expected for other 0-sized channels.

Make _TYPE check _BaseFormat the same as _SIZE, which results in
fixing most of the GL_RGB* testcases of gl-3.0-required-sized-formats
pass on i965.

v2: Add a default case with a warning (suggestion by Brian Paul)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2011-11-22 13:58:37 -08:00
Marek Olšák
034e63b9f8 r600g: handle all remaining CAPs 2011-11-22 20:56:51 +01:00
Marek Olšák
4ac250c9d5 r600g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
2011-11-22 20:56:51 +01:00
Marek Olšák
650f6a6815 r300g: re-order shaders CAPs 2011-11-22 20:56:51 +01:00
Marek Olšák
410c12352a r300g: handle SHADER_CAP_OUTPUT_READ 2011-11-22 20:56:51 +01:00
Marek Olšák
684d74e000 r300g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
2011-11-22 20:56:51 +01:00
Marek Olšák
fba685a099 u_vbuf_mgr: rename to u_vbuf 2011-11-22 20:56:51 +01:00
Marek Olšák
611a8b82e3 u_vbuf_mgr: better way to find a free VB slot + check errors early 2011-11-22 20:56:51 +01:00
Marek Olšák
1146441a2d u_vbuf_mgr: remove a useless variable 2011-11-22 20:56:51 +01:00
Marek Olšák
c4f51b225b u_vbuf_mgr: remove redundant memset 2011-11-22 20:56:51 +01:00
Marek Olšák
498e86e414 u_vbuf_mgr: don't reference non-native vertex buffers as native
also don't mark them as 'user', because they will be uploaded through
the translate fallback anyway.
2011-11-22 20:56:51 +01:00
Marek Olšák
1e53a26b9c u_vbuf_mgr: rename translate_vb_slot -> fallback_vb_slot 2011-11-22 20:56:51 +01:00
Marek Olšák
bb71f9249a gallium: separate out floating-point CAPs into its own enum
The motivation behind this is to add some self-documentation in the code
about how each CAP can be used.

The idea is:
- enum pipe_cap is only valid in get_param
- enum pipe_capf is only valid in get_paramf

Which CAPs are floating-point have been determined based on how everybody
except svga implemented the functions. svga have been modified to match all
the other drivers.

Besides that, the floating-point CAPs are now prefixed with PIPE_CAPF_.
2011-11-22 20:56:50 +01:00
Marek Olšák
2a0126932b gallium: remove PIPE_CAP_GLSL and enable GLSL unconditionally
Only i965g does not enable GLSL, but that driver has been unmaintained and
bitrotting for quite a while anyway.
2011-11-22 20:56:50 +01:00
Marek Olšák
a92ee4abfe glsl: convervative_depth is not allowed in the vertex shader
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 20:56:50 +01:00
Marek Olšák
6b43d6fdda glsl: finish up ARB_conservative_depth (v2)
v2: updated an error message

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 20:56:50 +01:00
Marek Olšák
bbcb648bc2 mesa: rename the AMD_conservative_depth extension flag to ARB
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 20:56:50 +01:00
Marek Olšák
e99df05cce st/mesa: quick fix of CopyPixels with GL_DEPTH_STENCIL
This fixes:
- depthstencil-default_fb-copypixels
- fbo-depthstencil-GL_DEPTH24_STENCIL8-copypixels

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-22 20:56:50 +01:00
Ian Romanick
151867b422 linker: Remove erroneous multiply by 4 in uniform usage calculation
The old count_uniform_size::num_shader_uniforms was actually
calculating the number of components used.  Multiplying by 4 when
setting gl_shader::num_uniform_components caused us to count 4x as
many uniform components as were actually used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42930
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42966
Acked-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Vinson Lee <vlee@vmware.com>
Tested-by: Pavel Ondračka <pavel.ondracka@email.cz>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 11:50:19 -08:00
Chad Versace
4ce635c871 Merge branch 'hiz' of ssh://people.freedesktop.org/~chadversary/mesa 2011-11-22 10:52:29 -08:00
Chad Versace
e5411d8fdc i965/gen6: Enable HiZ by default
Regresses one Piglit test: bugs/fdo10370.

I'm not enabling HiZ for gen7 yet because it causes a mysterious
performance regression.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Chad Versace
b18875d441 intel: Use separate stencil whenever possible
For depthstencil renderbuffers, we were using separate stencil only if the
hardware required it. Since the performance gains from HiZ is so high, we
should always use separate stencil if the hardware supports it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Kenneth Graunke
e7e81714f3 i965: Implement the actual tables for texture alignment units [v2]
I implemented functions for horizontal/vertical alignment units separately
because I find it easier to read that way...especially with all the
corner-cases.

[chad] Corrected the vertical alignment calculation by checking for
depthstencil formats.

v2:
   - Fix typos in intel_horizontal_texture_alignment_unit():
     s/height/width/ and s/VALIGN/HALIGN.
   - Remove special case for compressed formats in
     intel_get_texture_alignment unit(). Compressed formats are already
     handled in the halign and valign functions.
   - Replace check ``_mesa_is_depth_format(...) ||
     _mesa_is_depthstencil_format(...)`` with explcitit checks against
     GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Chad Versace
dd0e46c410 i965/gen6: Set vertical alignment in SURFACE_STATE batch
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Chad Versace
017c13d55b intel: Store miptree alignment units in the miptree
This allows us to replace all the calls to
intel_get_texture_alignment_unit() with a single call at miptree creation.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
293e9a7ccf intel: Enable HiZ for texture renderbuffers
When a depth texture is first attached to framebuffer, allocate a HiZ
miptree for it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
b264698d30 intel: Resolve buffers in intel_map_renderbuffer()
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
d2e35a5460 intel: Resolve buffers in intel_map_texture_image()
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
3d760664e6 intel: Mark needed resolves when first enabling HiZ on a miptree
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
1b2baf3b08 i965: Mark that depth buffer needs depth resolve after drawing
After brw_try_draw_prims() emits a batch, mark that the depth buffer needs
a depth resolve if the buffer was written to and if it has an accompanying
HiZ buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
622bae07a5 intel: Resolve buffers in intelSpanRenderStart
Resolve all buffers that will be mapped by intelSpanRenderStart. This
comprises resolving the depth buffer of each enabled texture and of the
read and draw buffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
1eede4aa87 intel: Refactor intelSpanRenderStart
Factor the mapping loops from intelSpanRenderStart() into
intel_span_map_buffers(). This in preparation for the next commit,
which resolves the buffers before mapping.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
3b0d295e12 i965: Resolve buffers before drawing [v2]
Before emitting primitives in brw_try_draw_prims(), resolve the depth
buffer's HiZ buffer and resolve the depth buffer of each enabled depth
texture.

v2: [anholt] The driver no longer validates drm bo's, so update a comment
    to reflect that.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
b95986729e i965: Prevent recursive calls to FLUSH_VERTICES [v2]
To do so, we must resolve all buffers on entering a glBegin/glEnd block.
For the detailed explanation, see the Doxygen comments in this patch.

v2:
   - Fix typo: s/enusure/ensure/.
   - In brwPrepareExecBegin(), do the same resolves as done by
     brw_predraw_resolve_buffers().

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
1249855346 i965/gen6: Manipulate state batches for HiZ meta-ops [v4]
A lot of the state manipulation is handled by the meta-op state setup.
However, some batches need manual intervention.

v2:
   Do not special-case the 3DSTATE_DEPTH_STENCIL.Depth_Test_Enable bit
   for HiZ in gen6_upload_depth_stencil(). The HiZ meta-op sets
   ctx->Depth.Test, just read the value from that.

v3:
   Add a new dirty flag, BRW_STATE_HIZ, for brw_tracked_state. Flag it
   immediately before and after executing the HiZ operation in
   gen6_resolve_slice(). Add the flag to the the dirty bits for the
   following state packets:
      gen6_clip_state
      gen6_depth_stencil_state
      gen6_sf_state
      gen6_wm_state

v4:
   - Add BRW_NEW_STATE_HIZ to the dirty bit table in brw_state_upload.c.
     This is needed for INTEL_DEBUG=state.
   - Align brw dirty bit for gen6_depth_stencil_state.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
d1f1d348d8 i965/gen6: Complete stubs for HiZ buffer resolves
Some state batches also need to be manipulated. That's done in the next
commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
77a18428ff i965: Add HiZ operation state to brw_context
brw_context::hiz contains state needed to perform HiZ meta-ops and
indicates if a HiZ operation is currently in progress.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
1383e56bd9 intel: Add resolve functions for renderbuffers
Add the following functions:
   intel_renderbuffer_resolve_hiz
   intel_renderbuffer_resolve_depth

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
2945abea33 intel: Add resolve functions for miptrees
Add functions that
   - set a miptree slice as needing a resolve
   - resolve a single slice of a miptree
   - resolve all slices of a miptree

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
cf5e08c8e4 intel: Add field intel_mipmap_tree::hiz_map
This is a map of miptree slices to needed resolves.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
8d3aa14e89 intel: Define struct intel_resolve_map [v2]
This is a map of miptree slices to needed resolves, implemented as
a linked list. A future commit will embed such a list in
intel_mipmap_tree.

If you think I'm crazy to put a list in a miptree, read the Doxygen in
this patch for intel_resolve_map.

v2: [anholt] Move Doxygen from functin prototypes to definitions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
f17b12278d intel: Change signature of HiZ resolve functions
Now that intel_renderbuffer::region has been replaced with a miptree, the
HiZ functions region parameter must be replaced with a miptree parameter.

Change the return type from bool to void.

Rename the 'depth' parameter to 'layer', because it will correspond to
irb->mt_layer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
c015183947 intel: Remove unused HiZ functions
Remove the following functions:
   i830_hiz_resolve_noop
   i915_hiz_resolve_noop
   brw_hiz_resolve_noop

My original strategy for how intel->vtbl.resolve_*buffer was used has
substantially changed. The above functions are no longer called in the
current strategy.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
a2e44b0813 intel: Replace intel_mipmap_tree::hiz_region with a miptree [v2]
This is required to correctly implement HiZ for mipmapped and
multi-layered textures.

v2: Accomodate refcount fixes in intel_process_dri2_buffer_*() that were
    introduced in v2 of commit
        intel: Replace intel_renderbuffer::region with a miptree [v2]

Reviewed-by: Eric Anholt <eric@anholt>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
3eb12dfaee intel: Replace intel_texture_image::stencil_irb with intel_mipmap_tree::stencil_mt [v3]
For depthstencil textures using separate stencil, we embedded a stencil
buffer in intel_texture_image. The intention was that the embedded stencil
buffer would be the golden copy of the texture's stencil bits. When
necessary, we scattered/gathered the stencil bits between the texture
miptree and the embedded stencil buffer.

This approach had a serious deficiency for mipmapped or multi-layer
textures. Any given moment the embedded stencil buffer was consistent with
exactly one miptree slice, the most recent one to be scattered. This
permitted tests of type A to pass, but broke tests of type B.

Test A:
    1. Create a depthstencil texture.
    2. Upload data into (level=x1,layer=y1).
    3. Read and test stencil data at (level=x1, layer=y1).
    4. Upload data into (level=x2,layer=y2).
    5. Read and test stencil data at (level=x2, layer=y2).

Test B:
    1. Create a depthstencil texture.
    2. Upload data into (level=x1,layer=y1).
    3. Upload data into (level=x2,layer=y2).
    4. Read and test stencil data at (level=x1, layer=y1).
    5. Read and test stencil data at (level=x2, layer=y2).

v2:
   Only allocate stencil miptree if intel->must_use_separate_stencil,
   because we don't make the conversion from must_use_separate_stencil to
   has_separate_stencil until commit
        intel: Use separate stencil whenever possible

v3:
   Don't call ChooseNewTexture in intel_renderbuffer_wrap_miptree() in
   order to determine the renderbuffer format. Instead, pass the format as
   a param to that function.

CC: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:41 -08:00
Chad Versace
c80b31fdee intel: Refactor intel_render_texture() [v2]
This is in preparation for properly implementing glFramebufferTexture*()
for mipmapped depthstencil textures. The FIXME comments deleted by this
patch give a rough explanation of what was broken.

This refactor does the following:
   - In intel_update_wrapper() and intel_wrap_texture(), change the
     parameters to prepare to remove functions' dependency on
     gl_texture_image.
   - Move the call to intel_renderbuffer_set_draw_offsets() from
     intel_render_texture() into intel_udpate_wrapper().

Each time I encounter those functions, I dislike their vague names.
(Update which wrapper? What is wrapped? What is the wrapper?). So, while
I was mucking around, I also renamed the functions.

v2:
   In addition to the ``GLenum internal_format`` parameter to
   intel_wrap_miptree(), add a ``gl_format format`` parameter. This
   removes the need to recalculate for the true format from
   internal_format with ChooseNewTextureFormat, which was just weird.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:31 -08:00
Chad Versace
73540690f7 intel: Define intel_miptree_check_level_layer()
This is a small helper function that asserts that a given level and layer
are valid for a miptree. I will be extensively using it in the future
miptree HiZ functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:42 -08:00
Chad Versace
3b38b33c16 intel: Remove unneeded params from intel_renderbuffer_set_draw_offset()
Since the renderbuffer tracks the miptree level and layer that it wraps,
the 'tex_image' and 'zoffset' params are no longer needed to calculate the draw
offsets.

Not only are they no longer needed, but their presence would prevent
calculating the renderbuffer draw offsets in situations where there were
no texture image. Such situations will occur during the HiZ meta-op and
during scatter/gather of separate stencil textures.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:42 -08:00
Chad Versace
24da7335b2 intel: Track the miptree layer wrapped by a renderbuffer [v2]
TODO: Make v2 for kwg.

Add two fields to intel_renderbuffer:
    mt_level
    mt_layer

Multiple renderbuffers may simultaneously wrap a single texture and each
provide a different view into that texture. [Consider
glFramebufferTextureLayer()].  The new fields indicate which slice of the
miptree is wrapped by the renderbuffer.

The buffer resolve operations, to be introduced in the future, require
these fields in order to resolve the correct slice in the miptree.

To add the fields, it was necessary to replace the type of some function
parameters from gl_texture_image to gl_renderbuffer_attachment.

v2: [kwg] Replace confusing condition `CubeMapFace > 0` with the more
    sensible `Target == GL_TEXTURE_CUBE_MAP`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:42 -08:00
Chad Versace
d7b33309fe intel: Kill intel_mipmap_level::nr_images [v4]
For all texture targets except GL_TEXTURE_CUBE_MAP, the 'nr_images' and
'depth' fields of intel_mipmap_level were identical.  In the exceptional
case, nr_images == 6 and depth == 1.

It is simple to determine if a texture is a cube or not, so the presence
of two fields here was not helpful. Worse, it was confusing. When we
eventually implement GL_ARB_texture_cube_map_array, this mess would have
become even more confusing.

This patch removes 'nr_images' and assigns to 'depth' a consistent
meaning: depth is the number of 2D slices at each miplevel.  The exact
semantics of depth varies according to the texture target:
   - For GL_TEXTURE_CUBE_MAP, depth is 6.
   - For GL_TEXTURE_2D_ARRAY, depth is the number of array slices. It is
     identical for all miplevels in the texture.
   - For GL_TEXTURE_3D, it is the texture's depth at each miplevel. Its
     value, like width and height, varies with miplevel.
   - For other texture types, depth is 1.

As a consequence, parameters were removed from the following function
signatures:
    intel_miptree_set_level_info
        Remove 'nr_images'.

    i945_miptree_layout
    brw_miptree_layout_texture
    brw_miptree_layout_texture_array
        Remove 'slices'.

v2:
   - Replace "It's" with "Its".
   - Remove all hunks in intel_fbo.c. The hunks were spurious and sneaked
     in during a rebase.
   - Remove unneeded hunk in intel_tex_map_image_for_swrast(). It was
     a little refactor of the for-loop's upper bound.

v4:
   In intel_miptree_get_image_offset(), document the conditions under
   which different if-branches are taken.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:32 -08:00
Vasily Khoruzhick
1f3c5eae5c i915g: implement RGBX and BGRX render targets
They're not supported by hw directly, but it's easy to emulate
them with a shader swizzling fixup.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
[danvet: The important thing is to write a 1 to the unused alpha
channel, the ddx is relying on this for render accel.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-11-22 17:08:13 +01:00
Brian Paul
c87d1a3c3d st/mesa: fix accum buffer allocation in st_renderbuffer_alloc_storage()
If the gallium driver doesn't support PIPE_FORMAT_R16G16B16A16_SNORM
the call to st_choose_renderbuffer_format() would fail and we'd generate
an GL_OUT_OF_MEMORY error.  We'd never get to the subsequent code that
handles software/malloc-based renderbuffers.

Add a special-case check for PIPE_FORMAT_R16G16B16A16_SNORM which is used
for software-based accum buffers.  This could be fixed in other ways but
it would be a much larger patch.  st_renderbuffer_alloc_storage() could
be reorganized in the future.

This fixes accum buffer allocation for the svga driver.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-22 06:39:41 -07:00
Chad Versace
278e77a119 intel: Refactor intel_miptree_copy_teximage()
Extract the body of the inner loop into a new function,
intel_miptree_copy_slice().

This is in preparation for adding support for separate stencil and HiZ to
intel_miptree_copy_teximage(). When copying a slice of a depthstencil
miptree that uses separate stencil, we will also need to copy the
corresponding slice of the stencil miptree. The easiest way to do this
will be to call intel_miptree_copy_slice() recursively. Analogous
reasoning applies to copying a slice of a depth miptree with HiZ.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:38 -08:00
Chad Versace
c2ddde70da intel: Refactor intel_mipmap_level offsets
Add a new field, intel_mipmap_level::slice, and move the offset fields
into it. Also add some much needed documentation for these fields.

Before this patch, a separate array was allocated for the
intel_mipmap_level::{x,y}_offsets.  This was just silly; it incurred an
extra call to malloc and diminished memory locality.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:36 -08:00
Chad Versace
da2816a45e intel: Replace intel_renderbuffer::region with a miptree [v3]
Essentially, this patch just globally substitutes `irb->region` with
`irb->mt->region` and then does some minor cleanups to avoid segfaults
and other problems.

This is in preparation for
  1. Fixing scatter/gather for mipmapped separate stencil textures.
  2. Supporting HiZ for mipmapped depth textures.

As a nice benefit, this lays down some preliminary groundwork for easily
texturing from any renderbuffer, even those of the window system.

A future commit will replace intel_mipmap_tree::hiz_region with a miptree.

v2:
   - Return early in intel_process_dri2_buffer_*() if region allocation
     fails.
   - Fix double semicolon.
   - Fix miptree reference leaks in the following functions:
       intel_process_dri2_buffer_with_separate_stencil()
       intel_image_target_renderbuffer_storage()

v3:
   - [anholt] Fix check for hiz allocation failure. Replace
     ``if (!irb->mt)` with ``if(!irb->mt->hiz_region)``.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:35 -08:00
Chad Versace
005149d586 intel: Define intel_miptree_create_for_renderbuffer()
This function creates a miptree that is suitable as storage for
a non-texture renderbuffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:34 -08:00
Chad Versace
c3c7cbd154 intel: Move inline functions from intel_fbo.h to .c
Move the following inline functions:
    intel_get_rb_region
    intel_framebuffer_has_hiz

A future commit will replace the renderbuffer's region with a miptree.
This small refactor will eliminate the need for intel_fbo.h to include
intel_mipmap_tree.h on that commit. I'd like to avoid the situation where
each header transitively includes every other header.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:33 -08:00
Chad Versace
19faa12bb7 intel: Kill intel_framebuffer_get_hiz_region()
The only user of intel_framebuffer_get_hiz_region() was
intel_framebuffer_has_hiz(). So I folded the body of the former into the
latter.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:32 -08:00
Chad Versace
7e9b3c098c intel: Temporarily disable HiZ for textures
A great refactor thrashing begins after this commit for HiZ and separate
stencil.  Removing code for texture HiZ will make that refactoring easier,
because then we don't have to maintain that code during the refactor.

To disable HiZ for textures, I've removed the hook in
intel_update_wrapper() that allocates a HiZ buffer when attaching a depth
texture to a framebuffer.

HiZ was broken for textures anyway, so there's no regression here.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:31 -08:00
Chad Versace
190aec75a4 intel: Always gather stencil buffer in intel_map_renderbuffer_separate_s8z24()
The function gathered the stencil buffer into the depth buffer only when
the map mode contained the read bit. But we must do the gather even if the
map mode is write-only. If we do not, then, when the depth buffer's stencil
bits are scattered into the stencil buffer by intel_unmap_renderbuffer(),
some of the scattered stencil bits would be invalid.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:29 -08:00
Chad Versace
af35a3523d intel: Fix swrast_render_start() for depthstencil buffers with separate stencil
1. Don't map the depthstencil buffer twice

   Place a guard in intel_renderbuffer_map() to prevent a renderbuffer
   from being mapped twice. This happened if a single buffer was attached to
   the framebuffer's depth and stencil attachment points.  (Interestingly,
   because intel_map_renderbuffer_gtt() is idempotent, the double mapping did
   not cause bugs for depthstencil buffers *without* separate stencil).

2. Stop overriding gl_framebuffer::_DepthBuffer,_StencilBuffer

   Normally, if a depthstencil buffer is attached to the framebuffer's
   depth attachment point, then _mesa_update_framebuffer() installs
   a wrapper depth renderbuffer at gl_framebuffer::_DepthBuffer. Ditto for
   the stencil attachment point and gl_framebuffer::_StencilBuffer

   A depthstencil intel_renderbuffer with separate stencil contains hidden
   depth and stencil renderbuffers, which are the *real* renderbuffers. In
   order to force swrast to work, we were installing, in
   brw_update_draw_buffer(), the hidden renderbuffers at
   gl_framebuffer::_DepthBuffer and _StencilBuffer, thus overriding the
   behavior of _mesa_update_framebuffer().  However, now that
   intel_renderbuffer_map() is implemented with MapRenderbuffer(),
   overriding _mesa_update_framebuffer's introduces bugs.  This patch
   removes the override code.

Fixes several Piglit tests on gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:28 -08:00
Chad Versace
3d2235e6c7 intel: Don't use special stencil span accessors
The special stencil span accessors, as set by intel_span_init_funcs.
perform software W detiling. Since intel_renderbuffer_map() now uses
MapRenderbuffer, rb->Data points to an *untiled* stencil buffer.

Fixes several Piglit tests on gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:24 -08:00
Vadim Girlin
0fe14178db r600g: handle PIPE_SHADER_CAP_OUTPUT_READ
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-21 17:38:38 -05:00
Vadim Girlin
915bcc29d4 st/mesa: use PIPE_SHADER_CAP_OUTPUT_READ
Don't replace outputs with temps when the driver supports reading outputs.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-21 17:38:38 -05:00
Vadim Girlin
40864b85aa gallium: add PIPE_SHADER_CAP_OUTPUT_READ
It's intended to indicate whether the driver/hardware supports reading
of the values written into shader outputs.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-21 17:38:37 -05:00
Yuanhan Liu
2e6402feb7 swrast: fix unmatched span->array->ChanType
texture_combine converts the result rgba to CHAN_TYPE from FLOAT. At the
same time, make sure the span->array->ChanType is changed, too.

v2: pick a nicer comment from Brian

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-21 16:32:39 +08:00
Yuanhan Liu
6ba8f0688a swrast: simplify the prototype of function texture_combine
Parameter n and rgbaChan are both from structure span, thus using span
as paramter to simplify the prototype. Function texture_combine is only
used by _swrast_texture_span, so I guess it's safe to do so.

This patch is mainly for the next patch.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-21 16:32:29 +08:00
Marek Olšák
94cd9d6be8 r300g: set max_index to 0xffffff if there are no per-vertex attribs 2011-11-20 19:29:19 +01:00
Marek Olšák
03df791c6f u_vbuf_mgr: correctly compute max vertex count from hw buffers
And update r300g.

This is different from util_draw_max_index in how it obtains vertex elements
and that it doesn't have to call util_format_description due to additional
precomputed data in vertex elements.
2011-11-20 16:24:12 +01:00
Marek Olšák
72e1117e48 u_vbuf_mgr: correctly obtain min/max_index for uploads and translate
This forks vbo_get_minmax_index. We need to know the index range when
translating non-native vertices into native ones. There is no other way
around it.
2011-11-20 16:24:12 +01:00
Marek Olšák
c95bd12bec r600g: use u_vbuf_mgr to set/get the index buffer 2011-11-20 16:24:12 +01:00
Marek Olšák
a18dad8055 r300g: use u_vbuf_mgr to set/get the index buffer 2011-11-20 16:24:12 +01:00
Marek Olšák
4cfc8c775c u_vbuf_mgr: add set_index_buffer function
It will use the index buffer soon.
2011-11-20 16:24:11 +01:00
Marek Olšák
b5b7cc19d8 u_vbuf_mgr: add comments 2011-11-20 16:24:11 +01:00
Marek Olšák
df49b0ce90 u_vbuf_mgr: don't upload user buffers which have been uploaded by translate 2011-11-20 16:24:11 +01:00
Marek Olšák
dd2227e3fd r600g: set MIN/MAX_VTX_INDX to 0 and ~0, respectively
The CS checker doesn't check the regs and the state-tracker-provided values
are not to be trusted.

This also removes the hack for non-zero index bias.
2011-11-20 16:24:11 +01:00
Marek Olšák
496a3dab5f r300g: always set VF_MIN_VTX_INDX to 0
It's not really useful to have non-zero there.
2011-11-20 16:24:11 +01:00
Kenneth Graunke
bdffb941d3 i965: Remove unused file brw_fallback.h. 2011-11-19 14:40:26 -08:00
Marek Olšák
b781fc88b0 gallium/docs: remove obsolete documentation 2011-11-19 20:58:37 +01:00
Marek Olšák
ec174a4244 mesa: set the gl_FragDepth layout in the GLSL linker
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-19 17:35:49 +01:00
Marek Olšák
90be99427a glsl: when cloning a variable, copy the depth layout too
This fixes AMD_conservative_depth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 16:46:59 +01:00
Brian Paul
038a7dfcaa mesa: handle MapRenderbuffer() failures in glReadPixels
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:08 -07:00
Brian Paul
72fb25cefb mesa: make slow_read_rgba_pixels() a void function
The boolean return value was ignored by the caller.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:07 -07:00
Brian Paul
2efa3d4f9f mesa: define, use _mesa_is_cube_face() in several places
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:07 -07:00
Ben Skeggs
16f2e7e0fb nvc0: add support for GF119 (NVD9)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-11-18 15:45:54 -08:00
Brian Paul
a43908fe62 st/mesa: rewrite the primitive restart fallback code
Previously we were mapping/unmapping the index buffer each time we
found the restart index in the buffer.  This is bad when the restart
index is frequently used.  Now just map the index buffer once, scan
it to produce a list of sub-primitives, unmap the buffer, then draw
the sub-primitives.

Also, clean up the logic of testing for indexed primitives and calling
handle_fallback_primitive_restart().  Don't call it for non-indexed
primitives.

v2: per Jose, only map the relevant part of the index buffer with
pipe_buffer_map_range()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-18 07:39:14 -07:00
Ian Romanick
08b288be8e docs: Add 7.11.1 release md5sums
(cherry picked from commit 228da884c9)
2011-11-17 12:15:10 -08:00
Ian Romanick
6306245fc6 docs: Add news items for 7.11 and 7.11.1 releases 2011-11-17 12:00:40 -08:00
Ian Romanick
92e512230b docs: Import 7.11 release notes from branch 2011-11-17 12:00:40 -08:00
Ian Romanick
b3aaafc74c docs: Import 7.11.1 release notes from branch 2011-11-17 12:00:40 -08:00
Eric Anholt
7e84a64dd0 i965/gen4: Fix sampling from integer textures.
On original gen4, the surface format didn't determine the return data
type from sampling like it does on g45 and later.

Fixes GL_EXT_texture_integer/texture_integer_glsl130

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-17 08:31:55 -08:00
Vadim Girlin
0cddea37b2 r600g: don't change the order of writes in merge_inst_group
Merge may produce incorrect order of operations for r600-eg:

	x: inst1 R0.x, ... ;  //from current group
	...
	t: inst0 R0.x, ... ;  //from previous group, same destination

Result of inst1 will be lost.

So compare destinations and don't allow this.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-17 09:10:37 -05:00
Michel Dänzer
4b1205d53b Revert "read_rgba_pixels: Don't force clamping if the renderbuffer is normalized."
This reverts commit b11c16752a.

Breaks at least luminance destination formats.
2011-11-17 15:04:40 +01:00
Michel Dänzer
b11c16752a read_rgba_pixels: Don't force clamping if the renderbuffer is normalized.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-17 10:46:44 +01:00
Ben Skeggs
4517153278 nvc0: add support for GF119 (NVD9)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-11-17 10:17:06 +10:00
Brian Paul
f4c03da327 mesa: initialize stencilMap, Stride if stencilRb==depthRb 2011-11-16 14:16:29 -07:00
Ian Romanick
010dc29283 mesa: Only update sampler uniforms that are used by the shader stage
Previously a vertex shader that used no samplers would get updated (by
calling the driver's ProgramStringNotify) when a sampler in the
fragment shader was updated.  This was discovered while investigating
some spurious code generation for shaders in Cogs.  The behavior in
Cogs is especially pessimal because it ping-pongs sampler uniform
settings:

    glUniform1i(sampler1, 0);
    glUniform1i(sampler2, 1);
    draw();
    glUniform1i(sampler1, 1);
    glUniform1i(sampler2, 0);
    draw();
    glUniform1i(sampler1, 0);
    glUniform1i(sampler2, 1);
    draw();
    // etc.

ProgramStringNotify is still too big of a hammer.  Applications like
Cogs will still defeat the shader cache.  A lighter-weight mechanism
that can work with the shader cache is needed.  However, this patch at
least restores the previous behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-16 08:37:44 -08:00
Brian Paul
f6a50c0b1f mesa: don't map depth+stencil buffer twice in glReadPixels()
In slow_read_depth_stencil_pixels_separate() we might have separate
depth and stencil buffers or a combined buffer.  In the later case,
don't map the buffer twice.  This function is used when the depth
scale/bias pixel transfer values are not the defaults.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=42963

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-16 08:49:22 -07:00
Kenneth Graunke
728a830fae i965: Fix inconsistent indentation in brw_gs_emit.c. 2011-11-16 00:57:35 -08:00
Kenneth Graunke
5e3e9a8e9c glsl: Add missing textureSize(samplerCubeShadow, int) variant.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-16 00:57:33 -08:00
Yuanhan Liu
4f677ca5f9 mesa: do not skip att and spot calculation for infinite light
glspec doesn't say that we should skip the attenuation and spot
calculation for infinite light(Ppli.w == 0). Instead, it gives a same
formula to do the light calculation for both finite light and infinite
light(see page 62 of glspec 2.1.pdf)

Also from the formula (2.4) at page 62 of glspec 2.1.pdf, we can skip
attenuation calculation if Ppli.w == 0.

This would fix all the intel oglc l_sed fail subcases and introduces no
intel oglc regressions.

v2: fix an wrong intendation(comments from Brian).

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
2011-11-16 11:31:04 +08:00
Yuanhan Liu
099c4e372d mesa: make sure all lighting tables are updated before the computation
Make sure all lighting tables are updated before using the table to
calculate something, say using _SpotExpTable to calculate
_VP_inf_spot_attenuation.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-16 11:20:49 +08:00
Eric Anholt
d4df6318a1 mesa: Fix a couple of missed conversion to arrays in format_unpack.
Fixes regression in piglit:
ARB_color_buffer_float/GL_RGBA16F-getteximage
ARB_color_buffer_float/GL_RGBA16F-readpixels
ARB_color_buffer_float/GL_RGBA32F-getteximage
ARB_color_buffer_float/GL_RGBA32F-readpixels

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-15 17:38:41 -08:00
Eric Anholt
2bf9aeaa19 mesa: Include R/RG integer textures in _mesa_is_integer_format.
Fixes some spurious GL errors in the upcoming
gl-3.0-required-sized-formats piglit test.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-15 16:23:56 -08:00
Chad Versace
79653c12d6 intel: Fix separate stencil in builtin DRI2 backend
intelAllocateBuffer() was oblivious to separate stencil buffers.  This
patch fixes it to allocate a non-tiled stencil buffer with special pitch,
just as the DDX does.

Without this, any app that attempted to create an EGL surface with stencil
bits would crash. Of course, this affected only environments that used the
builtin DRI2 backend, such as Android and Wayland.

Fixes GLBenchmark2.1 on Android on gen7.

Note: This is a candidate for the 7.11 branch.
Tested-by: Louie Tsaie <louie.tsai@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Chad Versace
50b3356078 intel: Fix region dimensions for stencil buffers received from DDX
I changed the dimensions of the stencil buffer's region, as allocated by
the DDX, at xf86-video-intel commit
   commit 3e55f3e88b40471706d5cd45c4df4010f8675c75
   dri: Do not tile stencil buffer
But I forgot to make the analogous update to the Intel DRI2 glue in Mesa.
This patch makes that update.

Surprisingly, the mismatch did not cause any bugs. But the mismatch, if
left unfixed, *would* create bugs in the next commit.

Note: This is a candidate for the 7.11 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Chad Versace
dc4c3a31c6 intel: Simplify stencil detiling arithmetic
When calculating the y offset needed for detiling window system stencil
buffers, replace the term
   region->height * 2 + region->height % 2 - 1
with
   rb->Height - 1 .

The two terms are incidentally equivalent due to some out-of-date,
incorrect code in the Intel DRI2 glue for DDX. (See
intel_process_dri2_buffer_with_separate_stencil(), line ``buffer_height /=
2;``).

Note: This is a candidate for the 7.11 branch (only the intel_span.c hunk).
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Brian Paul
1161facaf9 radeon: use _mesa_readpixels() instead of _swrast_ReadPixels() 2011-11-15 08:10:24 -07:00
Brian Paul
b31bc6b543 i965: use _mesa_readpixels() instead of _swrast_ReadPixels() 2011-11-15 08:07:22 -07:00
Brian Paul
caaefe1969 mesa: convert unpack functions to operate on an array of values
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
546f76d58f mesa: new BYTE/SHORT_TO_FLOATZ() macros
Rather than redefining the BYTE/SHORT_TO_FLOAT macros, just define new
ones with different names.  These macros preserve zero when converting.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
b098e1af1c mesa: move CEILING() macro into macros.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
bef4b42938 mesa: remove unused macros in macros.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
83863d468e mesa: consolidate cases in _mesa_components_in_format()
and _mesa_sizeof_packed_type()

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
6dbf2bac50 swrast: fix glReadPixels from texture attachment
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42635
2011-11-15 07:49:26 -07:00
Brian Paul
d0836eda5e st/mesa: check for missing VBO in setup_interleaved_attribs()
This fixes a crash with the piglit vbo-too-small test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-15 07:49:26 -07:00
Brian Paul
438d7ac146 util/draw: replace assertions with conditionals in util_draw_max_index()
Don't assert/die if a VBO is too small.  Return zero instead.  For
debug builds, emit a warning message since this is an unusual situation
that might indicate that there's a bug in the app.

Note that util_draw_max_index() now returns max_index+1 instead of
max_index.  This lets us return zero to indicate that one of the VBOs
is too small to draw anything.

Fixes a failure with the new piglit vbo-too-small test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-15 07:49:26 -07:00
Brian Paul
94780b5ee6 st/mesa: remove most of the ReadPixels code
We can use the core Mesa code for glReadPixels now.  We just have to
validate state and flush the bitmap cache before reading.
2011-11-15 07:49:26 -07:00
Brian Paul
3754ebb33d st/mesa: remove dependencies on code in st_cb_readpixels.c
st_cb_readpixels.c is going away next.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
77c85f014a mesa: remove _swrast_ReadPixels()
We use the code in main/readpix.c now.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
bd5ba36bf7 mesa: use _mesa_readpixels() as default driver hook
Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
d2a23d4ded mesa: move swrast ReadPixels code into core Mesa
The swrast ReadPixels code has no dependencies on swrast since moving
to Map/UnmapRenderbuffer().  We'll be able to remove s_readpix.c and
remove the state tracker's glReadPixels code next.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
e0e454943c st/mesa: check renderbuffer orientation in st_MapRenderbuffer()
We'll soon be able to use these for a core Mesa implementation of
glReadPixels.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
371b1648ab mesa: remove support for software alpha buffers
This was only used by the xlib driver to add an alpha channel to the
front/window color buffer.  This was no longer going to work well with
the move to direct mapping of renderbuffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
6c6803f28d xlib: remove xm_image.[ch] files
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
bc63b226bc xlib: remove a ton of old xlib driver cruft
The days of 1-bpp, 8-bpp and dithering are long behind us.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
c9bfad2921 xlib: use MESA_FORMAT_XRGB8888 for pixmap surfaces
We no longer have software-allocated alpha buffers so we can forget
about the alpha channel.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
dff2394e08 xlib: remove software alpha buffer support
Seldom used and this won't work when we move to using Map/UnmapRenderbuffer
everywhere.  This will let us remove a bunch of core Mesa code too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
6d68855df1 mesa: replace GLstencil with GLubyte 2011-11-15 07:49:25 -07:00
Chad Versace
cc502aa941 intel: Fix intel_map_renderbuffer() for depthstencil buffers with separate stencil
For a depthstencil buffer with separate stencil,
intel_renderbuffer::region is null. (The regions are kept in hidden depth
and stencil buffers). Since the region is null, intel_map_renderbuffer()
assumed there was no data and returned a null map pointer, which in turn
was dereferenced (!) by MapRenderbuffer's caller.

This patch fixes intel_map_renderbuffer() to map the hidden depth buffer
through the GTT and return that as the mapped pointer. Also, the stencil
bits are scattered and gathered when needed.

Fixes the following Piglit tests on gen7:
    fbo/fbo-readpixels-depth-formats
    hiz/hiz-depth-read-fbo-d24s8
    hiz/hiz-stencil-read-fbo-d24s8
    EXT_packed_depth_stencil/fbo-clear-formats
    EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-blit
    EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-drawpixels
    EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-readpixels
    EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8
    EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-FLOAT-and-USHORT
    EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:42:09 -08:00
Chad Versace
5365ba19db intel: Fix software detiling of system stencil buffers
If a window system stencil buffer had a region with odd height, then the
calculated y offset needed for software detiling was off by one.  The bug
existed in intel_{map,unmap}_renderbuffer_s8() and in the intel_span.c
accessors.

Fixes the following Piglit tests on gen7:
    general/depthstencil-default_fb-readpixels-24_8
    general/depthstencil-default_fb-readpixels-FLOAT-and-USHORT

Fixes SIGABRT in the following Piglit tests on gen7:
    general/depthstencil-default_fb-blit
    general/depthstencil-default_fb-copypixels
    general/depthstencil-default_fb-drawpixels-24_8
    general/depthstencil-default_fb-drawpixels-FLOAT-and-USHORT

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:42:05 -08:00
Chad Versace
87d6b35974 intel: Fix intel_unmap_renderbuffer_s8()
When gathering the temporary buffer's pixles into the gem buffer, we had
the two buffers juxtaposed. Oops.

Fixes the following Piglit tests on gen7:
   general/GL_SELECT - alpha-test enabled
   general/GL_SELECT - depth-test enabled
   general/GL_SELECT - no test function
   general/GL_SELECT - scissor-test enabled
   general/GL_SELECT - stencil-test enabled

Fixes SIGABRT in Piglit tests EXT_framebuffer_object/fbo-stencil-* on
gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:42:00 -08:00
Chad Versace
f911cac7a7 intel: Refactor intel_map_renderbuffer()
The function already implements 3 cases (map through GTT, blit to
a temporary, and detile stencil buffer to temporary), and a 4th will be
added soon: scatter/gather for depthstencil buffers using separate
stencil.  For sanity's sake, this factors each case out into its own
function.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:41:49 -08:00
Yuanhan Liu
9d4d9d34d8 ir_to_mesa: don't init unfirom if link failed
Don't call set_unfiform_initializers if link failed, or it would trigger
a GL_INVALID_OPERATION error. That's not an expected behavior of
glLinkProgram function.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-15 16:25:40 +08:00
Kenneth Graunke
f1a677cefb glsl: Always search for an exact function signature match.
Previously, we would fail to compile the following shader due to a bug
in lazy built-in importing:

    #version 130
    void main() {
        float f = abs(5.0);
        int i = abs(5);
    }

The first call, abs(5.0), would fail to find a local signature, look
through the built-ins, and import "float abs(float)".

The second call, abs(5), would find the newly imported float signature
in the local shader, and settle for that.  Unfortunately, it failed to
search the built-ins for the correct/exact signature, "int abs(int)".

Thus, abs(5) ended up being a float, causing a bizarre type error when
we tried to assign it to an int.

Fixes piglit test builtin-overload-matching.frag.

This is /not/ a candidate for stable branches, as it should only be
possible to trigger this bug using GLSL 1.30's built-in functions that
take integer arguments.  Plus, the changes are fairly invasive.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 17:18:12 -08:00
Kenneth Graunke
cdc9408266 glsl: Split code to generate an ir_call out from match_function_by_name.
match_function_by_name performs two fairly separate tasks:
1. Hunt down the appropriate ir_function_signature for the callee.
2. Generate the actual ir_call (assuming we found the callee).

Both of these are complicated.  The first has to handle exact/inexact
matches, lazy importing of built-in prototypes, different scoping rules
for 1.10, 1.20+, and ES.  Not to mention printing a user-friendly error
message with pretty-printed "maybe you meant this" candidate signatures.

The second has to deal with void/non-void functions, pre-call implicit
conversions for "in" parmeters, and post-call "out" call conversions.

Trying to do both in one function is just too unwieldy.  Time to split.

This patch purely moves the code to generate an ir_call into a separate
function and reindents it.  Otherwise, the code is identical.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-14 17:18:03 -08:00
Kenneth Graunke
861d0a5e12 glsl: Add a new matching_signature() variant that returns exact/inexact.
When matching function signatures across multiple linked shaders, we
often want to see if the current shader has _any_ match, but also know
whether or not it was exact.  (If not, we may want to keep looking.)

This could be done via the existing mechanisms:

   sig = f->exact_matching_signature(params);
   if (sig != NULL) {
      exact = true;
   } else {
      sig = f->matching_signature(params);
      exact = false;
   }

However, this requires walking the list of function signatures twice,
which also means walking each signature's formal parameter lists twice.
This could be rather expensive.

Since matching_signature already internally knows whether a match was
exact or not, we can just return it to get that information for free.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-14 17:17:39 -08:00
Marek Olšák
4f7c21899a r600g: fix the representation of control-flow instructions
We need something that looks like a compiler and not like some hacker
put some functions together. /rant

This is a band-aid for these two problems:
- The R600 and EG control-flow instructions appear in switch statements
  next to each other, causing conflicts when adding new instructions.
- The ALU control-flow instructions are bitshifted by 3 (from CF_INST 26:29
  to CF_INST 23:29, as is defined by r600 ISA) even for EG, where CF_INST
  is 22:29.

To fix this mess, the 'inst' field is bitshifted to the left either by 22, 23,
or 26 (directly in the definitions), such that it can be just or'd when making
bytecode without any shifting. All switch statements have been divided into
two, one for R600 and the other for EG.

Of course, there is a better way to do this, but that is left for future
work.

Tested on RV730 and REDWOOD with no regressions.

v2: minor cleanup as per Alex's comment.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-15 00:04:43 +01:00
Ian Romanick
fa704cc558 glsl: Remove resource count checks from ir_to_mesa and st_glsl_to_tgsi
These checks are now performed by the linker.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:53 -08:00
Ian Romanick
92f8159045 linker: Validate resource usage in the linker
This is also done in ir_to_mesa and st_glsl_to_tgsi, but that code
will be removed soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:51 -08:00
Ian Romanick
6ac895a664 linker: Count the number of uniform components used by a shader during linking
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:49 -08:00
Ian Romanick
812aa88393 linker: Count the number of samplers used by a shader during linking
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:28 -08:00
Eric Anholt
196c6d4adf meta: Fix restoring of fixed function texture enables.
If they were disabled on entry, and we enabled one (like for
BlitFramebuffer), we wouldn't disable it on the way out.  Retain the
attempted optimization here (don't keep calling to set each bit for
changes that won't matter) by just setting the bits directly with
appropriate flushing.

Fixes misrendering on the second draw of piglit fbo-blit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-14 09:26:53 -08:00
Eric Anholt
95a826bed3 meta: Don't forget to flag state when restoring texobjects.
It's unlikely that we changed the object but no other texture
parameter, but be correct anyway.  Noticed by inspection.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-14 09:26:53 -08:00
Christoph Bumiller
da1544b39e st/mesa: fix system value to semantic mapping
Broken by addition of SYSTEM_VALUE_VERTEX_ID in
919c53e87a.
2011-11-14 18:14:02 +01:00
Christoph Bumiller
e7ccd703a2 gallium: add TGSI_SEMANTIC_VERTEXID 2011-11-14 18:12:46 +01:00
Vadim Girlin
a2bcaba1cd r600g: mask write for fake VS export components 2011-11-14 11:11:54 -05:00
Vadim Girlin
dcdc062dda r600g: fix op3 & write in merge_inst_groups 2011-11-14 11:11:31 -05:00
Alex Deucher
ebecbbc2e6 r600g: set max max tex/vtx instructions count to 16 for cayman
Cayman is 16 as well.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 11:01:00 -05:00
Vadim Girlin
c32ca6d9c1 r600g: set max tex/vtx instructions count to 16 for evergreen
According to evergreen-isa doc 16 is max value for evergreen.
More than 16 doesn't work for me.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-14 10:59:53 -05:00
Fabio Pedretti
8f55f5b77b radeon: further cleanup of shared code
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 10:54:19 -05:00
Alex Deucher
494d005390 radeon: add some missing FireMV pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 09:57:05 -05:00
José Fonseca
8f9fc8b9d2 mesa/st: Flush stdout after pritingin the GLSL.
Otherwise it gets all garbled with stderr.
2011-11-14 14:43:25 +00:00
José Fonseca
b0cdeda4f2 glsl: Add missing ';' in action statement.
Addresses the warnings:

  warning: a `;' might be needed at the end of action code
  warning: future versions of Bison will not add the `;'
2011-11-14 14:14:45 +00:00
José Fonseca
ab3ace56c4 llvmpipe: Silent warnings about undeclared llvmpipe_check_render_cond. 2011-11-14 13:50:33 +00:00
José Fonseca
6246c217ec util: Avoid signed/unsigned comparison in u_trim_pipe_prim(). 2011-11-14 10:06:01 +00:00
José Fonseca
d7edd5db31 llvmpipe: Remove unused variables.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:01 +00:00
José Fonseca
c88f3e0374 llvmpipe: Make more resilient to out-of-memory situations.
Most of the code was alright, but we were missing a few paths.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:01 +00:00
José Fonseca
9e29cdbe95 draw: Handle failure to allocate aligned_constant_storage.
Also, actually update const_storage_size, therefore avoiding to
unnecessarily reallocate aligned_constant_storage every single time
draw_vs_set_constants() is called.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:00 +00:00
José Fonseca
e21c5157b6 gallivm: Remove duplicate statement.
ary_ge_arx_arz is already set earlier.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:00 +00:00
José Fonseca
34930facfe gallivm: Include stddef.h before the LLVM C++ headers.
Necessary with build against LLVM 2.6, with recent gcc, as LLVM headers
depend on ptrdiff_t but don't properly include stddef.h
2011-11-14 10:06:00 +00:00
Dave Airlie
b04d19da10 llvmpipe: fix unswizzle of packed float types.
I messed up adding the ubyte->float conversion.

This fixes getteximage-formats

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

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-14 09:35:17 +00:00
Alex Deucher
579c04e42e r600g: properly handle cayman in is_alu_vec_unit_inst()
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-13 17:46:01 -05:00
Vadim Girlin
3d441153a1 r600g: fix cb offset for flushed_depth_texture
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:27:16 -05:00
Vadim Girlin
d5e91a2364 r600g: fix stencil buffer ref counting on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:25:16 -05:00
Vadim Girlin
8e366dc365 r600g: lazy load for AR register
Emit MOVA* instruction only when AR is used.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:10:02 -05:00
Vadim Girlin
88a140cd19 r600g: include INTERP_[XY|ZW] in is_alu_vec_unit_inst
This will disallow moving them to the trans slot in merge_inst_groups

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:09:59 -05:00
Morgan Armand
54346d1f9b glcpp: Add GL_ARB_draw_instanced #define. 2011-11-12 12:39:51 -08:00
Kenneth Graunke
b618e78897 i965: Don't try to normalize cubemap coordinates for textureSize.
Although textureSize is represented as an ir_texture with op == ir_txs,
it doesn't have a coordinate, so normalizing it doesn't make sense.

Fixes crashes in oglconform glsl-bif-tex-size basic.samplerCube.* tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-12 00:56:20 -08:00
Chad Versace
bf8ad170c5 mesa: Fix glFramebufferTexture*() for depth and stencil attachments
This patch solves three bugs.

1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point,
Mesa attached the texture only to the depth attachment point
    gl_framebuffer::Attachment[BUFFER_DEPTH]
and failed to attach it to the stencil attachment point
    gl_framebuffer::Attachment[BUFFER_STENCIL]

2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then
later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two
separate renderbuffer wrappers. This caused a GL error in
glGetFramebufferAttachmentParameteriv().

3. Same as 2, but with depth and stencil juxtaposed.

Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL

Note: This is a candidate for the stable branches.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-11 12:28:22 -08:00
Eric Anholt
8727807f7e i965: Expose GLSL 1.30 on gen6+.
With the gl_VertexID support, everything required should now be
supported.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:28:12 -08:00
Eric Anholt
1c65abb211 i965: Add support for gl_VertexID and gl_InstanceID.
The compiler setup for these VF-uploaded attributes looks a little
cheesy with mixing system values and real VBO-sourced attributes.  It
would be nice if we could just compute the ATTR[] map to GRF index up
front and use it at visit time instead of using ir->location in the
ATTR file.  However, we don't know the reg_offset at
visit(ir_variable *) time, so we can't do the mapping that early.

Fixes piglit vertexid test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:59 -08:00
Eric Anholt
9472f66776 i965: Replace a should-never-happen fallback with asserts where it matters.
We only allow 16 vec4s of attributes in our GLSL/ARB_vp programs, and
1 more element will get used for gl_VertexID/gl_InstanceID.  So it
should never have been possible to hit this fallback, unless there was
another bug.  If you do hit this, you're probably using gl_VertexID
and falling back to swrast won't work for you anyway.

This also updates the limits for gen6+.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:54 -08:00
Eric Anholt
919c53e87a mesa: Make gl_VertexID be a system value like gl_InstanceID.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:51 -08:00
Eric Anholt
44fc3c6c1c glsl: Move builtin_variables.h into .cpp.
This used to be script-generated, but now it's just a bunch of static
variables in a .h file for no good reason.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:49 -08:00
Eric Anholt
ab5c2622b6 glsl: Move ir_variable.cpp to builtin_variables.cpp.
It's only about builtins, not variables in general.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:21:34 -08:00
Mathias Fröhlich
8ca76386f5 state_tracker: remove written but never used variable. 2011-11-11 17:00:00 +01:00
Dave Airlie
2f98ac473b radeon: fix build.
I had a later patch remove this code, but cherry-picked across it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-11 15:55:52 +00:00
Dave Airlie
88ec12539a radeon: drop unused constant_cliprect field 2011-11-11 15:04:53 +00:00
Dave Airlie
0dd6bdf632 radeon: disable texobj state for 3d texture
for 3d texture fallback, disable the texobj state.

Signed-off-by : Dave Airlie <airlied@redhat.com>
2011-11-11 15:04:53 +00:00
Dave Airlie
99109e9fe0 radeon: use meta bitmap
Now that the stride bug is fixed, enable Bitmap via meta mode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-11 15:04:52 +00:00
Dave Airlie
beb3e81b86 radeon: fix bug with wrong stride being used for rectangluar textures.
This broke the meta bitmap code when it was enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-11 15:04:52 +00:00
Brian Paul
ba3b9fad60 i965: remove #include of api_noop.h 2011-11-11 07:23:45 -07:00
Brian Paul
6e9b1d5d0d xlib: set alpha to 0xff when mapping RGB pixmaps
Fixes a bunch of conform regressions.
2011-11-11 07:13:00 -07:00
Brian Paul
16bff7e2ce swrast: avoid calling _mesa_get_srgb_format_linear() inside a loop 2011-11-11 07:12:59 -07:00
Brian Paul
0f3f6cf02b swrast: remove bogus assertion
It would fail for images that were never allocated (and wouldn't be
used during rendering).
2011-11-11 07:12:55 -07:00
Brian Paul
871dc64869 svga: don't crash/assert if we fail to allocate a vertex buffer
v2: check if pipe_buffer_map() returns NULL, and return NULL from
svga_vbuf_render_map_vertices().  Per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-11 07:10:56 -07:00
Brian Paul
aa66130682 draw: handle out of memory conditions
If the vbuf backend fails to allocate a vertex buffer, don't crash
or assert.
2011-11-11 07:10:56 -07:00
Brian Paul
7288bfb2a4 util: check for null vertex buffer object in blit code
Don't crash if we fail to allocate a vertex buffer.
2011-11-11 07:10:56 -07:00
Brian Paul
2551ff5900 st/mesa: fix OOM failure in bitmap code 2011-11-11 07:10:56 -07:00
Brian Paul
97dedfda5f vbo: better handling of VBO allocation failures
Previously, if we failed to allocate a VBO (either for display list
compilation or immediate mode rendering) we'd eventually segfault
when trying to map the non-existant buffer or in a glVertex/Color/etc
call when we hit a null pointer.

Now we don't try to map non-existant buffers and if we do fail to
allocate a VBO we plug in no-op functions for glVertex/Color/etc
so we don't segfault.
2011-11-11 07:10:56 -07:00
Brian Paul
e6c4159372 mesa: replace api_noop.[ch] with vbo_noop.[ch]
None of the code in api_noop.c was used anymore.  The new vbo_noop.c
functions are true no-ops.  They'll be used to no-op glBegin/End functions
when we run out of VBO memory.
2011-11-11 07:10:56 -07:00
Brian Paul
cd30c28e3b vbo: pull some code from api_noop.c into vbo module
Only a handful of functions from api_noop.c are actually used by
the VBO module.  Move them to the VBO module.  With this change,
none of the code in api_noop.c is actually used anymore.
2011-11-11 07:10:56 -07:00
Brian Paul
6ba0ba09b4 mesa: remove ancient, unused gl_free_control_points prototoype 2011-11-11 07:10:55 -07:00
Brian Paul
9c0d7828d2 docs: add another viewperf issue 2011-11-11 07:10:55 -07:00
Kenneth Graunke
9ae10e9cbd i965: Make Gen6+ renderbuffer surface updates not depend on NEW_COLOR.
NEW_COLOR is only needed on Gen4-5 as brw_update_renderbuffer_surfaces
only uses ctx->Color when intel->gen < 6.

This should reduce unnecessary state updates.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
d46dfed958 i965: Reorder state atom lists so all the surface state is together.
Not strictly necessary, but seems like a good idea.

Suggested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
a17a78a212 glsl: Handle constant expressions involving ir_binop_equal/nequal.
Constant expressions which called GLSL's equal() and notEqual()
built-ins on bvecs would hit an assertion failure; we simply forgot to
implement them for booleans.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
83d0514f1f glsl: Remove textureGradOffset built-ins taking samplerCube parameters.
These simply don't exist in the 1.30 specification---none of the Offset
variants allow samplerCube.  This must have been a cut and paste error
from textureGrad, which /does/ allow cubemaps.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
6a77f36ad9 glsl: Fix misnamed textureProjOffset prototypes in built-in profiles.
Due to a cut and paste error, these were accidentally misnamed
textureProj() rather than textureProjOffset().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
2eb43bbb77 glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.
From the GLSL 1.30 spec, section 8.7 "Texture Lookup Functions":
"In all functions below, the bias parameter is optional for fragment
 shaders.  The bias parameter is not accepted in a vertex shader."

This was a cut and paste mistake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
51b1d412ec i965: Put a proper sampler count in 3DSTATE_VS.
See similar code for 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
29fc0d8c8a i965: Upload SAMPLER_STATE pointers for the VS on Ivybridge.
See similar code in gen7_wm_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
32dfa6e5ef i965: Move and rename "wm sampler" fields to just "sampler".
brw_wm_samplers actually enables any active samplers regardless of what
pipeline stage is using them, so it doesn't make much sense for it to be
WM-specific.  So, rename it to "brw_samplers."

To properly generalize it, move sampler_count and sampler_offset from
brw_context::wm to a new brw_context::sampler that can be shared without
looking strange.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
91043c21f9 i965: Clean up code for VS pull constant surface creation.
Like for the WM pull constants, we can merge the former prepare/emit
stages into one tracked state atom.  Furthermore, the code that used to
handle the binding table was removed in the last commit, leaving some
rather silly looking short functions that can easily be folded in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
e7c29c5de8 i965: Use a single binding table for all pipeline stages.
Although the hardware supports separate binding tables for each pipeline
stage, we don't see much advantage over a single shared table.

Consider the contents of the binding table:
- Textures (16)
- Draw buffers (8)
- Pull constant buffers (1 for VS, 1 for WM)

OpenGL's texture bindings are global: the same set of textures is
available to all shader targets.  So our binding table entries for
textures would be exactly the same in every table.

There are only two pull constant buffers (not many), and although draw
buffers aren't interesting to the VS, it shouldn't hurt to have them in
the table.  The hardware supports up to 254 binding table entries, and
we currently only use 26.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
4a42bd3931 i965: Split brw_wm_surfaces state into renderbuffer and texture atoms.
First, the texturing setup code is relevant for all pipeline stages,
while renderbuffer surfaces are only used by the WM.

Secondly, renderbuffer and texture setup depends on a different set of
dirty bits.  There's no reason to walk the array of textures when
changing draw buffers, or vice-versa.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
a7d0fa209b i965: Combine the two WM pull constant tracked state atoms.
These were only split for historical reasons: brw_wm_constants used to
be the "prepare" step, while brw_wm_constant_surface was "emit".  Now
that both happen at emit time, it makes sense to combine them.

Call the newly combined state atom "brw_wm_pull_constants" to indicate
help distinguish it from the Gen6+ atoms that handle push constants.

Finally, remove the BRW_NEW_WM_CONSTBUF dirty bit entirely now that it's
never flagged nor used.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
f3e9ccb3bc i965: Rename gen6_*_constants tracked state atoms to "push_constants".
When reading the "brw_wm_constants" and "gen6_wm_constants" atoms
side-by-side, I initially failed to notice the crucial difference:
the Gen6 atoms are for Push Constants, while brw_wm_constants handles
Pull Constants.  (Gen4/5 Push Constants are handled by "brw_curbe.")

Renaming these should clarify the code and save me from constant
confusion over the fact that "gen6_wm_constants" isn't just a newer
version of "brw_wm_constants."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
e4b1c9b4be i965: Remove nr_surfaces computation from brw_update_wm_surfaces.
This code is fairly fragile, as it depends on the ordering of the
entries in the binding table, which will change soon.

Also, stop listening on the BRW_NEW_WM_CONSTBUF dirty bit as it's no
longer required.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
6ba9090ea0 i965: Use 0 for the number of binding table entries in 3DSTATE_(VS|WM).
These fields control how many entries the hardware prefetches into the
state cache, so they only impact performance, not correctness.  However,
it's not clear how to use this in a way that's beneficial.

According to the documentation, kernels "using a large number" of
entries may wish to program this to zero to avoid thrashing the cache;
it's unclear how many is too many.  Also, Ironlake's WM was missing this
feature entirely---the count had to be zero.

The dirty bit tracking to handle this complicates the surface state
and binding table setup; removing it should simplify things and make
future refactoring easier.  So just set 0 for the number of entries
rather than trying to compute and track it.

Appears to have no impact on Nexuiz and OpenArena on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
0983c6869b i965: Remove outdated comment about CACHE_NEW_SURF_BIND dirty bit.
The comment states that brw_update_vs_constant_surface produces a
CACHE_NEW_SURF_BIND dirty bit, but it doesn't.   In fact, that bit
no longer even exists.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
d1d86dc55c i965: Remove BRW_NEW_NR_VS_SURFACES dirty bit from brw_vs_surfaces.
brw_vs_surfaces _produces_ the BRW_NEW_NR_VS_SURFACES dirty bit, so it
makes no sense for it to subscribe to it.

Fixes an assertion failure in many piglit tests when INTEL_DEBUG is set:
  brw_state_upload.c:484: void brw_upload_state(struct brw_context *):
  Assertion `!check_state(&examined, &generated)' failed.

One such piglit test is vs-uniform-array-mat2-col-rd.shader_test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
7c057f2360 i965: Add missing CACHE_NEW_WM_PROG dirty bit to WM pull constants.
Comparing brw_upload_vs_pull_constants and brw_upload_wm_pull_constants,
it became evident that something was amiss: the VS code had both
CACHE_NEW_VS_PROG and BRW_NEW_VERTEX_PROGRAM, while the WM code was
missing the CACHE_NEW_WM_PROG flag.

Not observed to fix anything, but likely necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:18 -08:00
Kenneth Graunke
c3e3903a90 i965: Use new vtable entries for surface state updating functions.
Now that we have vtable entries in place, we should use them.  This
allows us to drop the cut and pasted Gen7 brw_tracked_state atoms as
they now do exactly the same thing as their brw_wm_surface_state
counterparts.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:18 -08:00
Kenneth Graunke
5d448b42b7 i965: Add new vtable entries for surface state updating functions.
Gen7+ SURFACE_STATE is different from Gen4-6, so we need separate
per-generation functions for creating and updating it.  However, the
usage is the same, and callers just want to utilize the appropriate
functions with minimal pain.  So, put them in the vtable.

Since these take a brw_context pointer and are only used on Gen4, just
add a forward declaration.  This is the simplest (if not cleanest)
solution.  It would be nicer to have a i965-specific vtable, but that's
a refactor for another day.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:18 -08:00
Marek Olšák
b8428e6335 r600g: don't set the query result to 0 after a call to get_query_result
get_query_result doesn't reset the result. Only begin_query does.
2011-11-11 00:08:01 +01:00
Marek Olšák
72c1658554 r600g: the type of OCCLUSION_PREDICATE result should be boolean 2011-11-11 00:03:52 +01:00
Brian Paul
3800fe800b mesa: silence uninitialized var warning 2011-11-10 16:00:46 -07:00
Brian Paul
3da5196263 radeon: silence initializer warnings 2011-11-10 16:00:46 -07:00
Brian Paul
1462114475 draw/llvm: silence uninitialized variable warnings 2011-11-10 16:00:46 -07:00
Brian Paul
fe5ba5da7e radeon: silence unused var warnings 2011-11-10 16:00:46 -07:00
Brian Paul
2e15f0c860 egl: silence unused var warning 2011-11-10 16:00:46 -07:00
Wayne E. Robertz
beef101eb3 mklib: fix static lib building by filtering out -L, -l options
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-10 16:00:46 -07:00
Marek Olšák
b999be8374 r600g: implement PIPE_QUERY_OCCLUSION_PREDICATE 2011-11-10 23:11:57 +01:00
Marek Olšák
083482d493 r300g: fix query result of GPU_FINISHED 2011-11-10 22:58:34 +01:00
Marek Olšák
c5ae81652d r300g: implement PIPE_QUERY_GPU_FINISHED 2011-11-10 22:53:54 +01:00
Marek Olšák
014b3aa07d r300g: implement PIPE_QUERY_OCCLUSION_PREDICATE 2011-11-10 22:53:54 +01:00
Dave Airlie
4fd485666a llvmpipe/u_format: add support for EXT_texture_shared_exponent + EXT_packed_float
These two are fairly unique types so add specific cases for decoding them.

Passes piglit fbo-clear-format and fbo-generatemipmap-format tests for these
two extensions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 20:37:55 +00:00
Dave Airlie
ab14915dce llvmpipe: add NV_conditional_render support.
This ports the softpipe NV_conditional_render support to llvmpipe.

This passes the nv_conditional_render-* piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 20:32:13 +00:00
Marek Olšák
dbd24b5df6 r600g: remove useless texture barrier 2011-11-10 18:49:26 +01:00
Marek Olšák
ec3d2c7f08 r600g: flush the whole context when CS is full, not just hw_context
Because we disable render condition in r600_flush, but not in r600_context_flush.
2011-11-10 18:48:23 +01:00
Marek Olšák
6a490149d9 r600g: turn some CS overflow checks into assertions
They're not really exhaustive and not so useful either.
2011-11-10 18:09:10 +01:00
Marek Olšák
5222e16e2b r600g: put the rest of CS overflow checks in r600_need_cs_space 2011-11-10 18:09:10 +01:00
Marek Olšák
30a570e450 r600g: flush caches regardless of render condition
What if somebody enables render condition just before we flush...
2011-11-10 18:09:10 +01:00
Marek Olšák
578b211be6 r600g: disable render condition at the end of CS, re-enable at the beginning 2011-11-10 18:09:10 +01:00
Marek Olšák
9564185b0a r600g: don't suspend queries if they have already been suspended by blitter
And add some assertions.
2011-11-10 18:09:10 +01:00
Marek Olšák
cb7c6c30d0 r600g: properly reserve CS space for queries_suspend 2011-11-10 18:09:10 +01:00
Marek Olšák
1d09831253 r600g: reserve CS space for a draw command in begin_query and render_condition
There's no point in emitting those if you can't emit a draw command too.
2011-11-10 18:09:10 +01:00
Marek Olšák
11bdd28796 r600g: consolidate checking whether CS is full
This adds a new function r600_need_cs_space. Currently, it's easy to overflow
the CS - queries are not counted in. I guess that's not the only case where
the driver may crap out.
2011-11-10 18:09:09 +01:00
Dave Airlie
216be4120d radeon: fix tex1d-border2d
Fixes pigit test with T wrap usage.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 15:49:40 +00:00
Dave Airlie
c8fb700f2b radeon: fix 3-coordinate swtcl emission
This fixes mipmap generation on swtcl rv100.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 15:49:40 +00:00
Eric Anholt
11a90af1ef swrast: Add support for glReadPixels() to integer types.
With this change, i965 passes
GL_EXT_texture_integer/fbo_integer_precision_clear

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
e34c9edcda mesa: Add support for unpacking 32-bit integer formats to int spans.
This is the inverse operation to _mesa_pack_rgba_span_int.  The 16-bit
code isn't done because of lack of testing and not being sure how sign
extension/clamping should be handled between, say, 16-bit int and
32-bit int or uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
84277cb7d3 meta: Add support for glClear() to integer color buffers.
This requires using a new fragment shader to get the integer color
output, and a new vertex shader because #version has to match between
the two.

v2: Clarify that there's no need for BindFragDataLocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-11-09 12:59:20 -08:00
Eric Anholt
42c5552b0e i965: Claim to support rendering to integer FBOs.
We're missing support for the software paths still, but basic
rendering is working.

v2: Override RGB_INT32/UINT32 to not be renderable, since the hardware
    can't do it but we do allow texturing from it now.  Drop the
    DataType override, since the _mesa_problem() isn't in that path
    any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-11-09 12:59:20 -08:00
Eric Anholt
6d874d0ee1 i965/fs: Add support for user-defined out variables.
Before, I was tracking the ir_variable * found for gl_FragColor or
gl_FragData[].  Instead, when visiting those variables, set up an
array of per-render-target fs_regs to copy the output data from.  This
cleans up the color emit path, while making handling of multiple
user-defined out variables easier.

v2: incorporate idr's feedback about ir->location (changes by Kenneth Graunke)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
e988d816e1 i965/fs: Preserve the source register type when doing color writes.
When rendering to integer color buffers, we need to be careful to use
MRFs of the correct type when emitting color writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
e19dfc75b6 i965: Make brw_type_for_base_type return the element type for arrays.
Previously, brw_type_for_base_type returned UD for array variables,
similar to structures.  For structures, each field may have a different
type, so every field access must explicitly override the register's type
with that field's type.  We chose to return UD in this case since it was
the least common, so errors would be more obvious.

For arrays, it makes far more sense to return the type corresponding to
an element of the array.  This allows normal array access to work
without the hassle of explicitly overriding the register's type.

This should obsolete a bunch of type overrides throughout the code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:19 -08:00
Eric Anholt
a00c5a71cd i965: Enable ChooseTexFormat for supported GL_EXT_texture_integer formats.
v2: s/GL_TRUE/true/, and re-enable RGB_INT32 based on discussion
    yesterday about required RB formats vs texture formats.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-11-09 12:59:19 -08:00
Eric Anholt
35be4ae77e i965: Add mapping from MESA_FORMAT to BRW_SURFACEFORMAT for integer.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:09 -08:00
Eric Anholt
704b7551e8 intel: Expose GL_EXT_texture_integer when GL 3.0 override is set.
This will let the feature be incrementally developed, hidden behind
the flag we're all using as we work on GL 3.0 support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:38:58 -08:00
Eric Anholt
6e610a0485 docs: Note EXT_texture_array on i965.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:38:30 -08:00
Eric Anholt
e56aecf249 i965: Add support for 16-bit unorm L, A, and I textures.
While not required by any particular spec version, mplayer was asking
for L16 and hoping for actual L16 without checking.  The 8 bits
allocated led to 10-bit planar video data stored in the lower 10 bits
giving only 2 bits of precision in video.  While it was an amusing
effect, give them what they actually wanted instead.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41461

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:04:39 -08:00
Eric Anholt
b5444a6ebd intel: Don't _mesa_problem when asked for an RB of a texturing-only type.
We want to be able to support some formats for texturing that we can't
render to, which means that some choices for RenderbufferStorage end
up being incomplete (for example, L8 currently).  For these, where we
don't render to them, we don't want to have to make up an rb->DataType
that's only used for GetRow()/PutRow().
2011-11-09 12:04:39 -08:00
Paul Berry
01ccddbed6 r200: remove dangling radeon.h symlink.
Commit 1401b96b (radeon: cleanup radeon shared code after r300 and
r600 classic drivers removal) removed the file
src/mesa/drivers/dri/radeon/server/radeon.h, but it left behind the
symlink which was used to share that file into the
src/mesa/drivers/dri/r200/server directory.

This patch removes the dangling symlink.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-11-09 11:26:27 -08:00
Paul Berry
871ddb919b glsl: Assign transform feedback varying slots in linker.
This patch modifies the GLSL linker to assign additional slots for
varying variables used by transform feedback, and record the varying
slots used by transform feedback for use by the driver back-end.

This required modifying assign_varying_locations() so that it assigns
a varying location if either (a) the varying is used by the next stage
of the GL pipeline, or (b) the varying is required by transform
feedback.  In order to avoid duplicating the code to assign a single
varying location, I moved it into its own function,
assign_varying_location().

In addition, to support transform feedback in the case where there is
no fragment shader, it is now possible to call
assign_varying_locations() with a consumer of NULL.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-11-09 11:12:47 -08:00
Ian Romanick
6f5c737970 glsl: Clamp vector indices when lowering to swizzles
This prevents other code from seeing a swizzle of the 16th component
of a vector, for example.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Christian Holler <choller@mozilla.com>
2011-11-09 10:50:35 -08:00
José Fonseca
1d1c0fa2f3 scons: Disable deprecated POSIX name MSVC warnings. 2011-11-09 10:33:21 +00:00
José Fonseca
63e7a4c6e5 mesa,glsl,mapi: Put extern "C" { ... } where appropriate.
Probably a several places missing, but enough to cover all headers
(in)directly included by uniform_query.cpp, and fix the MSVC build.
2011-11-09 10:24:37 +00:00
José Fonseca
f4b42aa5b7 scons: Don't list m_xform.c twice. 2011-11-09 10:24:37 +00:00
José Fonseca
9b8ee08248 glu: Fix deprecated conversion from string constant to ‘char*’ warning. 2011-11-09 10:24:37 +00:00
Marek Olšák
60302f83e2 r600g: clarify meaning of one variable in shader codegen
It's easier to read now.
2011-11-09 00:18:53 +01:00
Marek Olšák
1b375f8413 r600g: cosmetic changes in query code
Mainly updating comments and removing one use of a magic number.
2011-11-09 00:18:53 +01:00
Marek Olšák
8187ad0754 r600g: use modulo for computing index into query (ring) buffers 2011-11-09 00:18:53 +01:00
Marek Olšák
552e90bd6a r600g: make r600_query_result more generic
We'll soon start adding new query types, maybe even querying more than
one value per query.
2011-11-09 00:18:52 +01:00
José Fonseca
4eb3225b38 Remove tgsi_sse2.
tgsi_exec is simple. llvm is fast. tgsi_sse2 ends up being neither.
2011-11-08 22:57:34 +00:00
Brian Paul
207a016eca mesa: fix signed/unsigned integer comparison warnings
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-08 13:51:50 -07:00
Brian Paul
fab8882273 glsl: remove trailing comma to silence warning 2011-11-08 13:51:50 -07:00
Ian Romanick
59012c3133 mesa: Implement glGetFragDataLocation
Fixes piglit's getfragdatalocation test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-08 11:10:11 -08:00
Ian Romanick
b12b5d9ab5 linker: Use app-specified fragment data location during linking
Fixes piglit's bindfragdata-link-error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-08 11:10:11 -08:00
Ian Romanick
4464a4b27b mesa: Stub implementation of glBindFragDataLocation
This just validates the input parameters so far.

Fixes piglit's bindfragdata-invalid-parameters test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-08 11:10:07 -08:00
Morgan Armand
0a0d820f7b softpipe: don't clamp or do logical operations on floating-point buffers.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-08 08:36:39 -07:00
Vinson Lee
3210cad3f2 st/mesa: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 20:41:21 -08:00
Vinson Lee
f4515d106c st/dri: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 20:36:07 -08:00
Dan McCabe
5c02e2e2de glsl: Generate IR for switch statements
Up until now modifying the GLSL compiler has been pretty straightforward.
This is where things get interesting. But still pretty straightforward.

Switch statements can be thought of a series of if/then/else statements.
Case labels are compared with the value of a test expression and the case
statements are executed if the comparison is true.

There are a couple of aspects of switch statements that complicate this simple
view of the world. The primary one is that cases can fall through sequentially
to subsequent case, unless a break statement is encountered, in which case,
the switch statement exits completely.

But break handling is further complicated by the fact that a break statement
can impact the exit of a loop. Thus, we need to coordinate break processing
between switch statements and loop statements.

The code generated by a switch statement maintains three temporary state
variables:
    int test_value;
    bool is_fallthru;
    bool is_break;

test_value is initialized to the value of the test expression at the head of
the switch statement. This is the value that case labels are compared against.

is_fallthru is used to sequentially fall through to subsequent cases and is
initialized to false. When a case label matches the test expression, this
state variable is set to true. It will also be forced to false if a break
statement has been encountered. This forcing to false on break MUST be
after every case test. In practice, we defer that forcing to immediately after
the last case comparison prior to executing a case statement, but that is
an optimization.

is_break is used to indicate that a break statement has been executed and is
initialized to false. When a break statement is encountered, it is set to true.
This state variable is then used to conditionally force is_fallthru to to false
to prevent subsequent case statements from executing.

Code generation for break statements depends on whether the break statement is
inside a switch statement or inside a loop statement. If it inside a loop
statement is inside a break statement, the same code as before gets generated.
But if a switch statement is inside a loop statement, code is emitted to set
the is_break state to true.

Just as ASTs for loop statements are managed in a stack-like
manner to handle nesting, we also add a bool to capture the innermost switch
or loop condition. Note that we still need to maintain a loop AST stack to
properly handle for-loop code generation on a continue statement. Technically,
we don't (yet) need a switch AST stack, but I am using one for orthogonality
with loop statements, in anticipation of future use. Note that a simple
boolean stack would have sufficed.

We will illustrate a switch statement with its analogous conditional code that
a switch statement corresponds to by examining an example.

Consider the following switch statement:
	switch (42) {
	case 0:
	case 1:
		gl_FragColor = vec4(1.0, 2.0, 3.0, 4.0);
	case 2:
	case 3:
		gl_FragColor = vec4(4.0, 3.0, 2.0, 1.0);
		break;
	case 4:
	default:
		gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
	}

Note that case 0 and case 1 fall through to cases 2 and 3 if they occur.

Note that case 4 and the default case must be reached explicitly, since cases
2 and 3 break at the end of their case.

Finally, note that case 4 and the default case don't break but simply fall
through to the end of the switch.

For this code, the equivalent code can be expressed as:
	int test_val = 42; // capture value of test expression
	bool is_fallthru = false; // prevent initial fall through
	bool is_break = false; // capture the execution of a break stmt

	is_fallthru |= (test_val == 0); // enable fallthru on case 0
	is_fallthru |= (test_val == 1); // enable fallthru on case 1
	is_fallthru &= !is_break; // inhibit fallthru on previous break
	if (is_fallthru) {
		gl_FragColor = vec4(1.0, 2.0, 3.0, 4.0);
	}

	is_fallthru |= (test_val == 2); // enable fallthru on case 2
	is_fallthru |= (test_val == 3); // enable fallthru on case 3
	is_fallthru &= !is_break; // inhibit fallthru on previous break
	if (is_fallthru) {
		gl_FragColor = vec4(4.0, 3.0, 2.0, 1.0);
		is_break = true; // inhibit all subsequent fallthru for break
	}

	is_fallthru |= (test_val == 4); // enable fallthru on case 4
	is_fallthru = true; // enable fallthru for default case
	is_fallthru &= !is_break; // inhibit fallthru on previous break
	if (is_fallthru) {
		gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
	}

The code generate for |= and &= uses the conditional assignment capabilities
of the IR.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:22 -08:00
Dan McCabe
85beb39e14 glsl: Reference data structure ctors in grammar
We now tie the grammar to the ctors of the ASTs they reference.

This requires that we actually have definitions of the ctors.

In addition, we also need to define "print" and "hir" methods for the AST
classes. The Print methods are pretty simple to flesh out. However, at this
stage of the development, we simply stub out the "hir" methods and flesh
them out later.

Also, since actual class instances get returned by the productions in the
grammar, we also need to designate the type of the productions that
reference those instances.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:22 -08:00
Dan McCabe
a0afcc6719 glsl: Create AST structs corresponding to new productions in grammar
Previously we added productions for:
	switch_body
	case_label_list
	case_statement
	case_statement_list
Now add AST structs corresponding to those productions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:22 -08:00
Dan McCabe
80944599dc glsl: Add productions to GLSL grammar for switch statement
The grammar is modified to support switch statements. Rather than follow the
grammar in the appendix, which allows case labels to be placed ANYWHERE
as a regular statement, we follow the development of the grammar as
described in the body of the GLSL spec.

In this variation, the switch statement has a body which consists of a list
of case statements. A case statement is preceded by a list of case labels and
ends with a list of statements.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:21 -08:00
Dan McCabe
19daba5470 glsl: Create AST data structures for switch statement and case label
Data structures for switch statement and case label are created that parallel
the structure of other AST data.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:21 -08:00
Chia-I Wu
a69da5c0ce util: add log2f for Android
It is needed for nv50's new shader backend.  With this change, both u_math.h
and imports.h in core mesa define the same function.  I have to #undef log2f
here to avoid the conflict.  Not sure if there is a better way to deal with
the situation.

Acked-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 17:04:11 -07:00
Brian Paul
2051a11823 mesa: remove prog_uniform.c from SConscript 2011-11-07 16:35:38 -07:00
Ian Romanick
be4524aeed Delete code made dead by previous uniform related patches
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:17 -08:00
Ian Romanick
c42ca36d67 mesa: Add missing check for glUniform*v count > 1 on non-array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
719909698c mesa: Rewrite the way uniforms are tracked and handled
Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*,
glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the
gl_uniform_storage structures in the gl_shader_program.

A couple of notes:

 * Like most rewrite-the-world patches, this should be reviewed by
   applying the patch and examining the modified functions.

 * This leaves a lot of dead code around in linker.cpp and
   uniform_query.cpp.  This will be deleted in the next patches.

v2: Update the comment block (previously a FINISHME) in _mesa_uniform
about generating GL_INVALID_VALUE when an out-of-range sampler index
is specified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
143d20c16a i965: Move _mesa_ir_link_shader call before device-specific linking
_mesa_ir_link_shader needs to be called before cloning the IR tree so
that the var->location field for uniforms is set.

WARNING: This change breaks several integer division related piglit
tests.  The tests break because _mesa_ir_link_shader lowers integer
division to an RCP followed by a MUL.  The fix is to factor out more
of the code from ir_to_mesa so that _mesa_ir_link_shader does not need
to be called at all by the i965 driver.  This will be the subject of
several follow-on patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
cfab4327c3 mesa: Add log_uniform and log_program_parameters to dump data
These were both useful debugging aids while developing this code.
log_uniform will be used to keep the MESA_GLSL=uniform behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
d7a7e4fc99 ir_to_mesa: Add _mesa_associate_uniform_storage
Connects all of the gl_program_parameter structures with the correct
gl_uniform_storage structures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
70650d08fa mesa: Add _mesa_uniform_{attach,detach_all}_driver_storage functions
These functions are used to create and destroy the connections between
a uniform and the storage used by the driver to hold its value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
9516182e80 mesa: Add _mesa_propagate_uniforms_to_driver_storage
This function propagates the values from the backing storage of a
gl_uniform_storage structure to the driver supplied data locations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
07731ed169 linker: Track uniform locations to new tracking structures
This is just the infrastructure and the code.  It's not used yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
9a21d4670c mesa: Add structures for "new style" uniform tracking in shader programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
466d5ffee4 linker: Add helper class for parcelling out backing storage to uniforms
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
57f79de6d0 linker: Add helper class for determining uniform usage
v2: Remane class count_uniform_size based on feedback from Eric:

    "Maybe just "count_uniform_size"?  "usage" makes me think "way it's
    dereferenced" or something."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
2f45ed393a mesa: Move most of uniforms.c to uniform_query.cpp
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
65add4327d mesa: Refactor parameter validate for GetUniform, Uniform, and UniformMatrix
v2: Update a comment block about the different treatment of
location=-1 based on feedback from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
637a7eb9e9 mesa: Move {split,merge}_location_offset to uniforms.h
Prepend _mesa_uniform_ to the names and rework the calling
convention.  The calling convention was changed for a couple reasons.

1. Having a single variable named 'location' have completely different
meanings at different places in the function is confusing.  Before
calling split_location_offset the location is the encoded value
returned by glGetUniformLocation.  After calling split_location_offset
it's the index of the uniform in the gl_uniform_list::Uniforms array.

2. In a later commit the original value of 'location' is needed after
split_location_offset has been called.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
4ad460991c glsl: Add new structures for tracking uniforms in linked shaders
v2: Update some comments based on feedback from Eric Anholt.

v3: Remove gl_uniform_storage::dirty field.  Make
gl_uniform_storage::initialized be bool, and make
gl_uniform_storage::sampler be uint8_t.

v4: Include stdbool.h after Tom Stellard noticed a build failure that
was introduced by the changes in v2.  Oops.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
4ad41af616 mesa: Make get_uniform available outside compilation unit
Also rename to _mesa_get_uniform.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
fa7eccb8c0 mesa: Move the link check from _mesa_get_uniform_location to _mesa_GetUniformLocationARB
There are cases where we might want to internally query the location
of a uniform in a shader that failed linking.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
f6ee7bce65 linker: Make invalidate_variable_locations available outside the compilation unit
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
68db407b20 glsl: Allow glsl_types.h to be included in C sources
Some C code will want access to the glsl_base_type and
glsl_sampler_dim enums in the near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
017346f403 mesa: Add string_to_uint_map::clear method to clear the map
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
295e07ef51 mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL
The spec says "Only ClearBufferiv should be used to clear
stencil buffers." and "Only ClearBufferfv should be used to clear
depth buffers."  However, on the following page it also says:

    "The result of ClearBuffer is undefined if no conversion between
    the type of the specified value and the type of the buffer being
    cleared is defined (for example, if ClearBufferiv is called for a
    fixed- or floating-point buffer, or if ClearBufferfv is called
    for a signed or unsigned integer buffer). *This is not an error.*"

Emphasis mine.

Fixes problems with piglit's clearbuffer-invalid-drawbuffer test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-07 13:32:22 -08:00
Brian Paul
f4fb0be605 mesa: fix the selection of soft renderbuffer color formats
This fixes a regression from the recent glReadPixels changes found
with the piglit hiz tests.

Use either MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV for color
buffers depending on endian-ness.  Before, the gl_renderbuffer::Format
field was MESA_FORMAT_RGBA8888 but the data was really stored as
MESA_FORMAT_RGBA8888_REV when using a little endian machine.

Getting this right matters now that we can access renderbuffer data
without going through the span functions (namely glReadPixels() +
MapRenderbuffer()).
2011-11-07 14:25:48 -07:00
Brian Paul
0ef8c0ddc7 mesa: remove unneeded soft renderbuffer format-setting code
These vars will just get overwritten when we call _mesa_add_renderbuffer()
anyway.  We only need to set the InternalFormat field when we create the
software renderbuffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-07 14:25:48 -07:00
Brian Paul
87ac3ae50e mesa: fix comment typo in intel_renderbuffer 2011-11-07 14:25:48 -07:00
Brian Paul
46f5ef557f intel: update intel_texture_image comment 2011-11-07 14:25:48 -07:00
Brian Paul
24524784cf intel: wrap comment and fix typo 2011-11-07 14:25:48 -07:00
Brian Paul
377eb5c30c st/mesa: first implementation of Map/UnmapRenderbuffer()
Untested, but also unused at this point.
2011-11-07 14:25:48 -07:00
Brian Paul
32c3957991 xlib: implement renderbuffer mapping/unmapping
This fixes the glReadPixels() regression for reading from the front/back
color buffers.

Note, we only allow one mapping of an XImage/Pixmap renderbuffer
at any time.  That might need to be revisited in the future.
2011-11-07 14:25:47 -07:00
Brian Paul
68c3d21b68 mesa: check for immutable texture in _mesa_test_texobj_completeness()
One of the points of GL_ARB_texture_storage is to make it impossible
to have malformed mipmap stacks.  If we know the texture object is
immutable, we can skip a bunch of size checking.
2011-11-07 14:25:47 -07:00
Brian Paul
b64dc2a275 swrast: update program type assertion
Fixes bogus failed assertion when using NV_fragment_program, such
as with demos/fplight.c

Note: This is a candidate for the 7.11 branch.
2011-11-07 14:25:47 -07:00
Brian Paul
af734468fe st/mesa: clean-up st_translate_interp() 2011-11-07 14:25:47 -07:00
Brian Paul
0d05422c20 st/mesa: add some null pointer checking to better handle out of memory
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 13:25:46 -07:00
Morgan Armand
245edfb005 st/mesa: fix memory leaks
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-07 13:25:46 -07:00
Morgan Armand
33ca21fc3c st/mesa: fix indentation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-07 13:25:46 -07:00
Morgan Armand
89d6044b7b softpipe: fix memory leaks
This series of patches is a splitted version of my previous one, as suggested by Brian.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-07 13:25:46 -07:00
Kenneth Graunke
dceb202297 i965: Fix Sandybridge regression introduced by workaround-free math.
Commit a73c65c534 had a typo which
accidentally enabled the workaround-free Gen7 code on Gen6.

Fixes GPU hangs in anything using pow() or integer division/modulus.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 12:09:02 -08:00
Kenneth Graunke
a73c65c534 i965: Enable faster workaround-free math on Ivybridge.
According to the documentation, Ivybridge's math instruction works in
SIMD16 mode for the fragment shader, and no longer forbids align16 mode
for the vertex shader.

The documentation claims that SIMD16 mode isn't supported for INT DIV,
but empirical evidence shows that it works fine.  Presumably the note
is trying to warn us that the variant that returns both quotient and
remainder in (dst, dst + 1) doesn't work in SIMD16 mode since dst + 1
would be sechalf(dst), trashing half your results.  Since we don't use
that variant, we don't care and can just enable SIMD16 everywhere.

The documentation also still claims that source modifiers and
conditional modifiers aren't supported, but empirical evidence and
study of the simulator both show that they work just fine.

Goodbye workarounds.  Math just works now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-07 11:03:22 -08:00
Marek Olšák
97534d92e2 mesa: add missing checks to compute_version
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 13:19:58 +01:00
Fabio Pedretti
1401b96bb9 radeon: cleanup radeon shared code after r300 and r600 classic drivers removal
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-07 09:21:38 +00:00
Kenneth Graunke
4abba27ae0 i965: Fix struct vs class warnings in brw_fs_vector_splitting.cpp.
Makes clang happier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-06 23:02:27 -08:00
Dave Airlie
0d8deb5bc9 llvmpipe: fix typo in the depth sampling aos code.
Just found by reading llvmpipe code for no great reason.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 22:32:04 +00:00
Dave Airlie
73c6657596 llvmpipe: enable RGTC after u_format fix.
The two piglit tests pass + render correctly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 22:32:04 +00:00
Dave Airlie
f0d1b5f41a u_format: fix RGTC support in fits 8unorm.
Signed RGTC won't fit in a unorm, so don't allow them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 22:32:04 +00:00
Chia-I Wu
8b64b86a65 scons: add CPP_SOURCES for nv50/nvc0 2011-11-06 14:38:23 -07:00
Chia-I Wu
ad156efe39 android: add CPP_SOURCES for nv50/nvc0 2011-11-06 14:38:23 -07:00
Chia-I Wu
917b8e3814 android: reorder nouveau pipe drivers
To match targerts/dri-nouveau, and to fix a potential

  "undefined reference to `nv50_ir::getTargetNVC0(unsigned int)'"

error.
2011-11-06 14:38:23 -07:00
Dave Airlie
2318443ebd gl3.txt: update for ARB_texture_storage.
As per Brian's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 19:39:36 +00:00
Dave Airlie
391e33ffbf r600g: add initial linestipple support.
It seems line loop stipple in hardware needs something I don't know, it might
need a proper geometry shader who knows.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 12:54:27 +00:00
Christian Inci
3031708e64 gallivm: change sys::getHostTriple to sys::getDefaultTargetTriple for LLVM >= 0x0301
LLVM change r143502

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2011-11-06 07:41:10 +00:00
Vinson Lee
adb7f1351e g3dvl: Fix memory leaks on error paths.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-05 22:09:03 -07:00
Vinson Lee
9288253051 pp: Reorder calloc to avoid memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-05 22:06:35 -07:00
Vadim Girlin
e532c710c6 r600g: move SPI setup to PS setup
SPI semantic indices for PS/VS are now static, so we don't
need to update spi config for every shaders combination. We can move
the functionality of r600_spi_update to r600(evergreen)_pipe_shader_ps.

Flatshade state is now controlled by the global FLAT_SHADE_ENA flag
instead of updating FLAT_SHADE for all inputs.

Sprite coord still requires the update of spi setup when
sprite_coord_enable is first changed from zero (enabled), and then
only when it's changed to other non-zero value (enabled for other input).
Change to zero (disabling) and back to the same value is handled via
global SPRITE_COORD_ENA.

New field "sprite_coord_enable" added to "struct r600_pipe_shader"
to track current state for the pixel shader. It's checked in the
r600_update_derived_state.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-05 17:23:29 -04:00
Vadim Girlin
5b27b63de6 r600g: precalculate semantic indices for SPI setup
There is no need to duplicate semantic mapping which is done in hw, so get
rid of r600_find_vs_semantic_index.

TGSI name/sid pair is mapped to the 8-bit semantic index for SPI.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-05 17:23:22 -04:00
Matt Turner
9f52b876f4 docs: fix grammar and punctuation in llvmpipe docs. 2011-11-05 17:11:59 -04:00
Dave Airlie
7494c814ef gl3.txt: add not of ARB_texture_storage work started. 2011-11-05 17:18:57 +00:00
José Fonseca
65d0c840b0 docs: Update llvmpipe docs.
Recommend LLVM 2.9, it has been working quite well, and unlike earlier
versions, it works out-of-the-box without patches.

Update Windows instructions.
2011-11-05 11:00:06 +00:00
Chia-I Wu
95ef069e1c configure.ac: gbm_gallium requires DRI_LIB_DEPS to link
gbm_gallium does not depend on DRI, but its build rules depend on DRI_LIB_DEPS
being set.  Output an error when the user enables gbm_gallium but disables
DRI.  This is just a workaround.
2011-11-05 15:15:21 +08:00
Chia-I Wu
0c771e260b shared-glapi: fix a linking error for SELinux
Link with -lselinux when SELinux is enabled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41571
2011-11-05 14:42:05 +08:00
Alex Deucher
df121b868a Revert "r600g: precalculate semantic indices for SPI setup"
This reverts commit c15f8569fd.

This breaks r6xx.
2011-11-04 18:33:31 -04:00
Alex Deucher
9212637f34 Revert "r600g: move SPI setup to PS setup"
This reverts commit 9804cf3118.

This breaks r6xx.
2011-11-04 18:32:42 -04:00
Brian Paul
1ca48b3161 svga: fix varying var remapping for unused FS outputs
If the VS has outputs that aren't consumed by the FS we were mapping
them all to one unused VS output index, but that's illegal.  Instead,
map unused VS outputs to unique indexes.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-04 16:05:33 -06:00
Brian Paul
0bc15650c1 svga: add comments and reformat code in svga_tgsi_decl_sm30.c 2011-11-04 16:05:33 -06:00
Marek Olšák
d2633af696 st/mesa: set geometry shader to NULL when doing internal drawing
The code expects the geometry shader to be NULL.
We don't have geometry shaders now, but it's good to be prepared.

v2: check for support in the cso context
2011-11-04 23:01:47 +01:00
José Fonseca
794c5158b0 mesa/st: Be nice with the stack -- use malloc for large structures/arrays.
st_translate_program's data was taking 51K off the stack, causing stack
overflow on Windows.
2011-11-04 22:01:17 +00:00
George Sapountzis
cd86a5d2f8 dri: cosmetic
To smooth minor diff between dri_util & drisw_util
2011-11-04 23:33:06 +02:00
George Sapountzis
2fbba6bb90 dri_util: move drawable functions 2011-11-04 23:33:06 +02:00
George Sapountzis
2314021d60 dri_util: move context functions 2011-11-04 23:33:06 +02:00
George Sapountzis
9292ab7190 dri_util: move context functions 2011-11-04 23:33:05 +02:00
George Sapountzis
c98d15c9f5 dri_util: move screen functions
This is to reorder as screen/context/drawable similar to drisw_util
2011-11-04 23:33:05 +02:00
George Sapountzis
3e80a34315 dri: drop stray includes and typedef 2011-11-04 23:33:05 +02:00
George Sapountzis
ceda4da857 dri: move __driUtilMessage to xmlconfig.c
__driUtilMessage seems to have fallen out of favor and is only used by xmlconfig.c now
2011-11-04 23:33:05 +02:00
George Sapountzis
78c076e654 dri: drop drisw_util.h 2011-11-04 23:33:04 +02:00
George Sapountzis
96bd41b315 dri: reorder as driver,screen,context,drawable 2011-11-04 23:33:04 +02:00
George Sapountzis
e438a36d83 dri: unify __DRIcontextRec, __DRIdrawableRec 2011-11-04 23:33:04 +02:00
George Sapountzis
875a757ddd dri: unify __DRIscreenRec
Also drop DriverAPI field, this is a static symbol and I don't see why it
should be accessed through __DRIscreenRec
2011-11-04 23:33:04 +02:00
George Sapountzis
7192c37294 dri: unify __DriverAPIRec
I dropped the comments because they don't add much.
2011-11-04 23:33:04 +02:00
George Sapountzis
fc9e80fab9 dri: drop drmLock remnants 2011-11-04 23:33:03 +02:00
George Sapountzis
721669d078 dri: drop DRI_VALIDATE macros 2011-11-04 23:33:03 +02:00
Marek Olšák
c5e48025ed gallium/cso_cache: remove one call to pipe_sampler_view_reference 2011-11-04 21:56:56 +01:00
Vadim Girlin
9804cf3118 r600g: move SPI setup to PS setup
SPI semantic indices for PS/VS are now static, so we don't
need to update spi config for every shaders combination. We can move
the functionality of r600_spi_update to r600(evergreen)_pipe_shader_ps.

Flatshade state is now controlled by the global FLAT_SHADE_ENA flag
instead of updating FLAT_SHADE for all inputs.

Sprite coord still requires the update of spi setup when
sprite_coord_enable is first changed from zero (enabled), and then
only when it's changed to other non-zero value (enabled for other input).
Change to zero (disabling) and back to the same value is handled via
global SPRITE_COORD_ENA.

New field "sprite_coord_enable" added to "struct r600_pipe_shader"
to track current state for the pixel shader. It's checked in the
r600_update_derived_state.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-04 16:23:24 -04:00
Vadim Girlin
c15f8569fd r600g: precalculate semantic indices for SPI setup
There is no need to duplicate semantic mapping which is done in hw, so get
rid of r600_find_vs_semantic_index.

TGSI name/sid pair is mapped to the 8-bit semantic index for SPI.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-04 16:23:19 -04:00
José Fonseca
2df15d07c0 svga: Tighten the register file assertions.
Untested. But should fix fdo 42576.
2011-11-04 20:10:01 +00:00
Dave Airlie
26ebf9c5e1 radeon/r200: strip texture borders.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-04 17:17:17 +00:00
Dave Airlie
71f1d468b4 radeon/r200: fix r100/r200 blit to use the offsets.
This is needed to do proper renderbuffer operation on mipmaps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-04 17:17:17 +00:00
Dave Airlie
2431c992cb radeon: drop mtface/mtlevel, use ones in base class.
This just uses the base class copies.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-04 17:17:17 +00:00
Marek Olšák
85c151f3d9 u_vbuf_mgr: avoid one call to pipe_resource_reference in most cases 2011-11-04 18:11:01 +01:00
José Fonseca
f800a29ee2 swrast: Avoid void * arithmetic.
An error with MSVC.
2011-11-04 08:54:55 +00:00
Eric Anholt
eab201bad4 i965/gen6: Improve glReadPixels() performance by blitting to a linear temp.
The readpixels microbenchmark in mesa-demos goes from 47Mpix/sec at
1000x1000 to 450Mpix/sec.  The 10x10 sizes stay about the same.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:48:07 -07:00
Eric Anholt
a1488eec38 intel: Add safety asserts for the blit engine's pitch alignment requirements.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
ac6a376f52 intel: Don't force a batchbuffer flush in readpixels.
Renderbuffer mapping handles flushing the batchbuffer if required, so
all we need to do is make sure any pending rendering has reached the
batchbuffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
e7349a55f7 radeon: Remove early dereference of src/dst width in glCopyTexSubImage.
There doesn't appear to be any particular reason for this -- it's not
like the width is changing between the deref and the use.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
d9f2add181 swrast: Drop the global mapping of buffers across glReadPixels().
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
5b1ad74824 swrast: Drop the remaining GetRow-based glReadPixels() fast-path.
In all of piglit, only two tests hit it (reading to RGBA float, where
GetRow would drop floats into place from R, RG, or RGB).  Mostly this
is because _ColorReadClamp has been causing transferOps to always be
set, skipping any fast-paths anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
91b2ce85d1 swrast: Remove dead _swrast_read_depth_span_uint().
All the code using it is converted to MapRenderbuffer and the core
unpack functions.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
345fc41619 swrast: Convert color glReadPixels slow path to using MapRenderbuffer.
This may be a bit slower than before because we're switching from
per-format compiled loops in GetRow to
_mesa_unpack_rgba_block_unpack's loop around a callback to unpack a
pixel.  The solution there would be to make _mesa_unpack_rgba_block
fold the span loop into the format handlers.

(On the other hand, function call overhead will hardly matter if
MapRenderbuffer means the driver gets the data into cacheable memory
instead of uncached).

The adjust_colors code should no longer be required, since the unpack
function does the 565 to float conversion in a single pass instead of
converting it (poorly) through 8888 as apparently happened in the
past.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
3e51ef0990 swrast: Skip _swrast_validate_derived in _swrast_ReadPixels().
None of the callgraph below this uses derived state (almost nothing
even dereferences the swrast context).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
2e82daa31b swrast: Add a readpixels fast-path based on memcpy and MapRenderbuffer.
v2: Move _mesa_get_format_bytes out of the loop.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
5f140bceda mesa: Add a function for comparing gl_format to format/type.
This should be useful in making more generic fast paths in the pixel
paths.

v2: Add note about PACK_SWAP_BYTES, and fix up for endianness by
    synchronizing with memcpy_texture paths in texstore.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
e887df9bf5 swrast: Switch the remaining depth readpixels to MapRenderbuffer.
This avoids the wrapper, which should improve performance on packed
depth/stencil drivers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
d072a5f545 swrast: Switch the remaining depth/stencil readpixels path to MapRenderbuffer.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
f53680857a swrast: MapRenderbuffer in separate depth/stencil readpixels fastpath
This introduces two new span helper functions we'll want to use in
several places as we move to MapRenderbuffer, which pull out integer
depth and stencil values from a renderbuffer mapping based on the
renderbuffer format.

v2: Use format_unpack helper for stencil read.
v3: Clean up comment after conversion to format_unpack.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
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
Paul Berry
29e2bc8b13 i965: Add support for integral vertex attributes.
When a vertex shader input attribute is declared with an integral type
(e.g. ivec4), we need to ensure that the generated vertex shader code
addresses the vertex attribute register using the proper register
type.  (Previously, we assumed all vertex shader input attributes were
floating-point).

In addition, when uploading vertex data that was specified with
VertexAttribIPointer, we need to instruct the vertex fetch unit to
convert the data to signed or unsigned int, rather than float.  And
when filling in the implied w=1 on a vector with less than 4
components, we need to fill it in with the integer representation of 1
rather than the floating-point representation of 1.

Fixes piglit tests vs-attrib-{ivec4,uvec4}-precision.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-02 09:29:35 -07:00
Paul Berry
8f84c237b3 mesa: Set the "Integer" field of gl_client_array properly.
This patch ensures that gl_client_array::Integer is properly set to
GL_TRUE for vertex attributes specified using glVertexAttribIPointer,
and to GL_FALSE for vertex attributes specified using
glVertexAttribPointer, so that the vertex attributes can be
interpreted properly by driver back-ends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-02 09:29:35 -07:00
Paul Berry
9abda92b27 glsl: Fix type mismatch when incrementing or decrementing uint.
When converting an expression like "++x" to GLSL IR we were failing to
account for the possibility that x might be an unsigned integral type.
As a result the user would receive a bogus error message "Could not
implicitly convert operands to arithmetic operator".

Fixes piglit tests {vs,fs}-{increment,decrement}-uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-02 09:28:54 -07:00
José Fonseca
a0d8e5d12a gallium/dri: Remove references to vblank. 2011-11-02 16:16:50 +00:00
Kristian Høgsberg
d14a107158 Fix gallium dri compile and a merge conflict 2011-11-02 12:01:46 -04:00
Jakob Bornecrantz
292c21bfdc svga: Tag cursors with the scanout hint
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-11-02 16:22:57 +01:00
Kristian Høgsberg
8b65c33eb8 dri: Remove unused memops.h 2011-11-02 11:16:04 -04:00
Kristian Høgsberg
6c26d998ef dri: Remove a few unused dri helper functions 2011-11-02 11:16:03 -04:00
Kristian Høgsberg
2e53f3018f dri: Remove unused dri texmem.c 2011-11-02 11:16:03 -04:00
Kristian Høgsberg
c2711cdfb6 dri: Move _dri_texformat_* to radeon_texture.c
They are only used by the r200 driver now.
2011-11-02 11:16:03 -04:00
Kristian Høgsberg
1ca2e84921 r200: Don't use driIsTextureResident helper
With DRI2, textures are always resident and using the DRI texmem helper
here is broken anyway, since nothing else uses it.
2011-11-02 11:16:03 -04:00
Kristian Høgsberg
a14bb89d3f dri: Drop unused dri renderbuffer helper functions 2011-11-02 11:16:03 -04:00
Kristian Høgsberg
c467db4cc7 dri: Move driUpdateFramebufferSize to dri_util.c
drirenderbuffer.[ch] is going bye-bye.
2011-11-02 11:16:03 -04:00
Kristian Høgsberg
90de3b9d96 dri: Remove unnecessary #defines and #includes 2011-11-02 11:16:02 -04:00
Kristian Høgsberg
e9beaf65fd dri: Remove unnecessary timestamp pointer indirection 2011-11-02 11:16:02 -04:00
Kristian Høgsberg
e8ed01f693 dri: Remove unused fields from __DriverAPIRec 2011-11-02 11:16:02 -04:00
Kristian Høgsberg
03855bc2ac dri: Remove dri2.enabled flag
DRI2 is always enabled now.
2011-11-02 11:16:01 -04:00
Kristian Høgsberg
a2ea34d705 dri: Remove DRI1 fields from DRI structs 2011-11-02 11:16:01 -04:00
Kristian Høgsberg
1837fb8e7c dri: Remove remaining DRI1 vblank code 2011-11-02 11:16:01 -04:00
Kristian Høgsberg
d24b81e0e0 dri: Remove cliprect information from __DRIdrawable 2011-11-02 11:16:00 -04:00
Kristian Høgsberg
24002daf01 dri: Drop unused driCalculateSwapUsage 2011-11-02 11:16:00 -04:00
Kristian Høgsberg
8e6c22136f dri: Remove unused driIntersectArea 2011-11-02 11:15:59 -04:00
Kristian Høgsberg
bfb6f9e690 dri: Drop __driUtilUpdateDrawableInfo and helper macros 2011-11-02 11:15:59 -04:00
Kristian Høgsberg
6260618b29 dri: Remove unused driSwapBuffers 2011-11-02 11:15:59 -04:00
Kristian Høgsberg
e78f7b8b44 dri: Drop unused driCreateNewContext 2011-11-02 11:15:58 -04:00
Kristian Høgsberg
f5ba7662bd dri: Fold driCreateNewDrawable into dri2CreateNewDrawable 2011-11-02 11:15:58 -04:00
Kristian Høgsberg
c786debe98 dri: Remove unsused driCreateNewScreen 2011-11-02 11:15:58 -04:00
Kristian Høgsberg
d02bd705fb dri: Remove unused __DRIswapInfoRec 2011-11-02 11:15:57 -04:00
Kristian Høgsberg
73ec71cb16 dri: Remove driMediaStreamCounterExtension
Also DRI1-only.
2011-11-02 11:15:57 -04:00
Kristian Høgsberg
759cbb751b dri: Remove driSwapControlExtension
DRI1-only as well.
2011-11-02 11:15:57 -04:00
Kristian Høgsberg
8e898e83c6 dri: Drop driCopySubBufferExtension
Another DRI1-only extension.
2011-11-02 11:15:56 -04:00
Kristian Høgsberg
ad32215871 dri: Drop driReadDrawableExtension
All DRI2 drivers support setting a separate read drawable.
2011-11-02 11:15:56 -04:00
Kristian Høgsberg
3203912600 dri: Drop driLegacyExtension
There are no DRI1 drivers left.
2011-11-02 11:15:56 -04:00
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
Brian Paul
2ace9ffc8e mesa: plug in dispatch functions for GL_ARB_texture_storage 2011-10-31 10:52:57 -06:00
Brian Paul
29eb2e8944 mesa: compile new texstore.c file 2011-10-31 10:52:56 -06:00
Brian Paul
a7d9e449f0 mesa: init extension entry for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
7d577d703d mesa: display list dispatch for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
a0d736b3b7 mesa: new glTexImage error checks for GL_ARB_texture_storage
If the texture memory was allocated with glTexStorage1/2/3D() we can
only change the image data with glTexSubImage calls.
2011-10-31 10:52:56 -06:00
Brian Paul
fbc419314e mesa: glGetTexParameter support for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
a8fcb7927b mesa: implement new functions for GL_ARB_texture_storage
This is the glTexStorage1D/2D/3D() functions.  Basically do error
checking then call the driver hook to actually allocate memory.
2011-10-31 10:52:56 -06:00
Brian Paul
ae9bef240d glapi: regenerated API files for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
af95504dad glapi: new API specs for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
2e322bb8d1 mesa: add new driver hook for AllocTextureStorage() 2011-10-31 10:52:56 -06:00
Brian Paul
b296315881 mesa: add new fields for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
José Fonseca
1e9d8934a1 svga: Flush the hwtnl primitives before writing to buffers.
svga keeps a small queue of similar primitive draws in order to coalesce
them into a single draw primitive command.

But the buffers referred in primitives not yet emitted were being ignored
in the considerations to flush or not the context.

This fixes piglit vbo-map-remap, vbo-subdata-sync, vbo-subdata-zero, and
Seeker.

Based on investigation and patch from Brian Paul.

Reviewed-By: Brian Paul <brianp@vmware.com>
2011-10-31 15:22:09 +00:00
Thomas Hellstrom
c04b9d1d56 st/xa: Plug a pipe context leak.
Forgot to destroy the pipe context on xa context destroy.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-31 14:35:23 +01:00
Thomas Hellstrom
037e7a68f5 pipebuffer/debug: Fix a recursive mutex lock
pb_debug_manager_dump was trying to take a lock already
held by all callers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jos Fonseca <jfonseca@vmware.com>
2011-10-31 13:25:39 +01:00
Dave Airlie
56d30bb00d radeon/r200: drop remains of r300/r600 support along with old drm 1.x kernel
This drops all the old drmSupports* checks since KMS does them all, and it
also drop R300_CLASS and R600_CLASS.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-30 16:40:56 +00:00
Chia-I Wu
e252af3406 llvmpipe: fix a crash in non-SSE path
It is a typo went unnoticed.
2011-10-30 20:05:05 +08:00
Chia-I Wu
d1d456a774 intel: enable GL_OES_draw_texture 2011-10-30 20:00:07 +08:00
Chia-I Wu
b4dc35d9bc meta: add _mesa_meta_DrawTex()
It is set to dd->DrawTex.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: set dd->DrawTex in _mesa_init_driver_functions]
2011-10-30 20:00:03 +08:00
Marek Olšák
9eac0fce83 r600g: reset the render condition to NULL when rendering unconditionally 2011-10-30 02:25:51 +02:00
Marek Olšák
b40edc63d7 r600g: shortcut ctx->screen->ws to ctx->ws 2011-10-30 02:25:51 +02:00
Eric Anholt
44c65d0e4e i965: Remove the prepare() hook from state atoms.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:26 -07:00
Eric Anholt
2649ff4d90 i965: Remove the memcpy()ed atoms array now that everything is emit()-based.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:23 -07:00
Eric Anholt
35c7e8cebe i965: Merge brw_validate_state() and brw_upload_state() together.
They were called back-to-back at this point.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:21 -07:00
Eric Anholt
68c813e8ea i965: Remove state upload code for calling prepare() now that there are none.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:17 -07:00
Eric Anholt
26cfca825d i965: Remove some old texturing debug code.
It caught one possible bug I recall in my time working on the driver,
and we haven't been setting it for non-fixed-function since the new FS
backend came along.  The bug it caught was likely a confusion about
sampler mappings, which we have tests for these days.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:15 -07:00
Eric Anholt
bd27c25ff9 i965: Finally, move the global fallbacks check to emit() time.
This was the last prepare() function, and it's the first state atom,
so it must be ready to move.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:13 -07:00
Eric Anholt
c83bfeabc6 i965: Move index buffer upload to emit() time.
It's consumed by the brw_emit_index_buffer() code at emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:11 -07:00
Eric Anholt
78a010127f i965: Do a hack job of merging VB prepare()/emit() together.
I don't really want to touch this impenetrable code in this series, so
just call the one function from the other, since no other atom cares
about them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:09 -07:00
Eric Anholt
bf11c9e4c1 i965: Move the WM input sizes calculation to emit() time.
It's used for program compile.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:07 -07:00
Eric Anholt
dc9a753f66 i965: Move program compile to emit() time.
Only 4 other prepare() functions are left, which don't rely on this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:03 -07:00
Eric Anholt
0969568fce i965/gen4: Move CURBE offset calculation to emit() time.
This is consumed by the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:01 -07:00
Eric Anholt
47c4d950cb i965/gen4: Fold push constant prepare()/emit() together.
While other units need to know about our constant buffer offsets,
nothing else cared about which particular BO other than the emit() half.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:59 -07:00
Eric Anholt
752cad8f33 i965/gen6: Move viewport state setup to emit() time.
Only the emit() for the pointers into the batch later in this file
cares.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:56 -07:00
Eric Anholt
8f0a54e6ff i965/gen4: Move URB fence recalculate to emit() time.
This is used by the unit state, which is at emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:54 -07:00
Eric Anholt
ab8637b03f i965: Fold the gen6/7 URB state prepare()/emit() together.
No other unit cares about the prepare state, unlike gen4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:49 -07:00
Eric Anholt
395a8605fa i965: Move VS pull constant upload to emit() time.
Only needed by the emit() for VS surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:45 -07:00
Eric Anholt
c933b33dc8 i965: Fold prepare() and emit() of VS surface state setup together.
This rearranges the code a bit, and makes the upload of the binding
table take only as many surfaces as there are in use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:42 -07:00
Eric Anholt
2b730c1f19 i965: Move WM pull constant setup to emit() time.
It's needed by the WM surface state setup, which is now emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:39 -07:00
Eric Anholt
4de2cfc3a0 i965/gen7: Fold WM surface state prepare()/emit() together.
These produce BRW_NEW_SURFACES (used by binding table emit()) and
BRW_NEW_NR_WM_SURFACES (used by WM unit emit()).  Fixes a bug where
with no texturing and no color buffer, we wouldn't consider the null
renderbuffer in nr_surfaces.  This was harmless because nr_surfaces is
only used for the prefetch info in the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:36 -07:00
Eric Anholt
93cabff7d6 i965/gen4: Fold WM surface state prepare()/emit() together.
These produce BRW_NEW_SURFACES (used by binding table emit()) and
BRW_NEW_NR_WM_SURFACES (used by WM unit emit()).  Fixes a bug where
with no texturing and no color buffer, we wouldn't consider the null
renderbuffer in nr_surfaces.  This was harmless because nr_surfaces is
only used for the prefetch info in the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:32 -07:00
Eric Anholt
9a5f8a98ed i965: Move sampler state to emit() time.
This is consumed by the WM unit, which is already at emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:30 -07:00
Eric Anholt
c4aaf85285 i965/gen4: Move unit state setup to emit() time.
It is only needed in time for brw_psp_urb_cbs(), which is also an emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:27 -07:00
Eric Anholt
c0574d5a90 i965/gen7: Fold prepare() and emit() of SF CLIP/VP state together.
The prepare() only made state for its emit(), not anybody else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:24 -07:00
Eric Anholt
7a874d04a8 i965/gen4: Move CC VP to emit() time, since it's only needed by CC's emit().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:20 -07:00
Eric Anholt
9015969e6e i965: Move push constants setup to emit() time.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:18 -07:00
Eric Anholt
f84f3322b4 i965/gen6: Move setup of CC state batches to emit time.
This is part of a series trying to eliminate the separate prepare()
hook in state upload.  The prepare() hook existed to support the
check_aperture in between calculating state updates and setting up the
batch, but there should be no reason for that any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:15 -07:00
Eric Anholt
78188bc537 i965: Check Fallback again after upload.
As we move state to emit() time from prepare() time, a couple of the
places that flag fallbacks will move here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:12 -07:00
Eric Anholt
eaf4d3e6e2 i965: Remove the validated BO list, now that it's unused.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:09 -07:00
Eric Anholt
3d851ae488 i965: Use the batch save/reset code to avoid needing the BO validate step.
We were doing the BO validate step in prepare() (brw_validate_state())
hooks of atoms so that we could check_aperture before emitting the
relocation trees during brw_upload_state() that would actually make
the batchbuffer reference too much memory to be executed.  Now that
all relocations occur in the batchbuffer, we can instead
check_aperture after emitting our state into the batchbuffer, and
easily roll back, flush, and retry if we happened to go over the
limits.

This will let us remove the whole prepare() vs emit() split in our
state atoms, which is a source of tricky dependencies and duplicated
code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:05 -07:00
Eric Anholt
da8f052560 intel: Return error value from intel_batchbuffer_flush().
This will let the caller do something sensible on error, if it cares.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:02 -07:00
Eric Anholt
fff693828e i965: Add a note about an unsafe-looking state check.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:15:59 -07:00
Eric Anholt
3faf56ffbd intel: Add an interface for saving/restoring the batchbuffer state.
This will be used to avoid the prepare() step in the i965 driver's
state setup.  Instead, we can just speculatively emit the primitive
into the batchbuffer, then check if the batch is too big, rollback and
flush, and replay the primitive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:15:56 -07:00
Eric Anholt
db364a8af0 i915: Move the always_flush_cache code to triangle emit.
This could have broken always_flush_cache on i965, since
reserved_space doesn't reflect the size of the workaround flushes, and
we might run out of space.  This should make always_flush_cache more
useful on pre-i965, anyway (since the point is to flush around each
draw call, even within a batchbuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:15:33 -07:00
Morgan Armand
439d67f502 glsl: Fix compilation of glsl_lexer.ll with MSVC.
strtoull is not supported on msvc (as there is no C99 support).
2011-10-29 10:37:58 -07:00
Mathias Fröhlich
e8139ebf58 r600g: Replace needless flush in texture upload.
Replace pipe->flush() with pipe->texture_barrier() in
the texture upload path for the staging texture.
This should be enough to get data out of the gpu
caches ready to be read for texture fetch.
2011-10-29 18:36:42 +02:00
Marek Olšák
7684808f9c r600g: remove one pointless flush
It's not useful for anything.
The rest of the patch is just a cleanup resulting
from some of the variables being no longer used.

There are no piglit regressions.
2011-10-29 13:48:39 +02:00
Dave Airlie
09a92e376b radeon/r200: forgot one somehow
drops last usage.
2011-10-29 08:15:27 +01:00
Dave Airlie
b490fa0172 radeon/r200: drop remains of non-libdrm_radeon build
These wrappers and associated symlinks were from the non-libdrm_radeon build.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-29 08:13:47 +01:00
Dave Airlie
4dfee0011a mesa/st: get interpolation mode from the fragment shader.
With the recent changes to interpolation stuff, we can now get the value
direct from the program instead of just being fail.

fixes some of the glsl-1.30 interpolation tests with softpipe

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-29 07:41:46 +01:00
Adam Jackson
25620eb1d2 glx: Don't enable INTEL_swap_event unconditionally
DRI2 supports this now - and already enables it explicitly - but drisw
does not and should not.  Otherwise toolkits like clutter will only ever
SwapBuffers once and wait forever for an event that's not coming.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-10-28 20:38:32 -04:00
Morgan Armand
0c6a2c78fd implement WGL_ARB_create_context
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-10-28 21:58:36 +01:00
Marek Olšák
bbad5103e6 r600g: get backend mask after the context is fully set up 2011-10-28 22:55:01 +02:00
Ian Romanick
276000472a ir_to_mesa: Let check_resources halt compilation
Previously check_resources could fail, but we'd still try to optimize
the shader, do device-specific code generation, etc.  In some cases,
this could explode (especially in the device-specific code
generation).  I haven't found that I could trigger this with the
current code.  When too many samplers were used with the new uniform
handling code, I observed several crashes deep down in the driver.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41609
Cc: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:55 -07:00
Ian Romanick
6da9b21f71 i965: Use glsl_type::column_type instead of open-coding it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:55 -07:00
Ian Romanick
f5ba4d055e glsl: Clean-up spurious error message on bad structure definitions
Previously a shader like

int X;
struct X { int i; };

void main() { gl_Position = vec4(0.0); }

would generate two error message:

0:2(19): error: struct `X' previously defined
0:2(20): error: incomplete declaration

The first one is the real error, and the second is spurious.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:55 -07:00
Ian Romanick
a04211ecb8 glsl: Generate an error for array-of-array declarations
Other parts of the code already caught things like 'float x[4][2]'.
However, nothing caught 'float [4] x[2]'.

Fixes piglit test array-multidimensional-new-syntax.vert.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:36 -07:00
Marek Olšák
e79aaf000b r300c/compiler: remove the compiler too
Gallium has a fork of this.
2011-10-28 21:28:31 +02:00
Kenneth Graunke
512431b357 i965/fs: Use the actual hardware g0 register for texel offset setup.
The idea here is to set up the message header with the Sampler State
pointer which the hardware provides as part of the PS Thread Payload in
register g0.

Unfortunately, the existing code

   fs_reg(GRF, 0, BRW_REGISTER_TYPE_UD))

actually references "virtual GRF 0" rather than the hardware g0.  This
is just some arbitrary GRF temporary which will get register allocated.

So, we ended up setting up the header with garbage.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-28 12:11:52 -07:00
Eric Anholt
058e712415 u_format: Fix -NaN handling for packing of 10F_11F_11F_REV to match GL specs.
Fixes the remainder of piglit GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
00d3716f4a u_format: Fix clamping of overflow in 10F_11F_11F_REV to match GL specs.
Fixes the 1000000.0 overflow cases of piglit
GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
b4d988bc9f mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.
From the GL_EXT_packed_float spec:

    For an RGBA color, if <type> is not one of FLOAT,
    UNSIGNED_INT_5_9_9_9_REV_EXT, or UNSIGNED_INT_10F_11F_11F_REV_EXT,
    or if the CLAMP_READ_COLOR_ARB is TRUE, or CLAMP_READ_COLOR_ARB
    is FIXED_ONLY_ARB and the selected color (or texture) buffer is
    a fixed-point buffer, each component is first clamped to [0,1].
    Then the appropriate conversion formula from table 4.7 is applied
    the component."

(but we previously resolved that the CLAMP_READ_COLOR bit is not
relevant to glGetTexImage())

This fixes most of the cases in piglit GL_EXT_packed_float/pack.

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
3d7477206d u_format: Fix bitshifting for unpacking from 10F.
This code was copy and pasted from the 11F unpacking, but not updated
for actually being 10 bits instead of 11.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41206
Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
028ce1cd0f u_format: Fix bit definition of UF10_MANTISSA_BITS.
This is only used in the code for packing to INF, and resulted in an
extra bit set that was set anyway, so it was harmless except for the
confusion caused.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:09:47 -07:00
Eric Anholt
687e4446bf glsl: Implement GLSL 1.30's literal integer range restrictions.
From page 22 (28 of PDF) of GLSL 1.30 spec:
    It is an error to provide a literal integer whose magnitude is too
    large to store in a variable of matching signed or unsigned type.

    Unsigned integers have exactly 32 bits of precision.  Signed integers
    use 32 bits, including a sign bit, in two's complement form.

Fixes piglit int-literal-too-large-0[123].frag.

v2: Take care with INT_MIN, use stroull, and make it a function.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:03:03 -07:00
Eric Anholt
974c66875e radeon: Remove the non-libdrm kernel memory manager support.
We should have never been building this at this point.
2011-10-28 11:32:10 -07:00
Eric Anholt
830e546f94 radeon: Insist on libdrm being present to build.
There's no sense in building a broken driver.  Previously, there was
the potential of building a DRI1-only driver that would work for DRI1
and fail on DRI2 because the newer libdrm code wasn't present.  Now
the radeon build system should be matching intel and nouveau.
2011-10-28 11:32:00 -07:00
Eric Anholt
48c9925367 configure.ac: Fix equality checks in gallium st setup. 2011-10-28 11:31:11 -07:00
Eric Anholt
bd51e8e4f4 dri: Remove driver GenerateMipmap hooks.
Mesa sets up _mesa_meta_GenerateMipmap as the default hook, which does
this check for fallback and call the fallback itself.
2011-10-28 11:31:11 -07:00
Eric Anholt
eb135fe8c1 radeon: Drop some remaining DRI1 vblank support code. 2011-10-28 11:31:11 -07:00
Eric Anholt
a9f7515890 intel: remove dead prototype for old DRI1 code.
Noticed while grepping for radeon code.
2011-10-28 11:31:11 -07:00
Eric Anholt
339c1731c3 radeon: Simplify cliprects computation now that there's just 1.
This can probably be reduced even further by moving this logic to the
scissor state update or just removing the logic entirely, but I don't
trust myself in radeon quite that much.
2011-10-28 11:31:11 -07:00
Eric Anholt
cab4578024 radeon: Drop the clipping in spans, now that we always have (0,0) -> (w,h). 2011-10-28 11:31:11 -07:00
Eric Anholt
8c11f0a883 radeon: Drop the legacy BO manager code. 2011-10-28 11:27:56 -07:00
Eric Anholt
976d4f58fa radeon: Drop the DRI1 zero-copy TFP code. 2011-10-28 11:27:42 -07:00
Eric Anholt
1553723712 radeon: Drop the radeon_cs_legacy code now that we rely on kernel mm. 2011-10-28 11:23:43 -07:00
Eric Anholt
53b382637c radeon: Drop dri2 checks now that it's always true.
This makes LOCK_HARDWARE empty, so it goes away.
2011-10-28 11:23:33 -07:00
Eric Anholt
fb52b4303d radeon: Drop the DRI1 swapbuffers implementation. 2011-10-28 11:23:09 -07:00
Eric Anholt
0973a1ec78 radeon: Drop the non-kernel-memory-manager support, and thus DRI1.
It's past time, and it was going to get in the way of the renderbuffer
mapping refactor.  We dropped all the other DRI1 drivers for this
release, and I can't imagine anybody supporting DRI1 radeon classic in
a new release of Mesa.

Diff produced by treating kernel_mm as true, deleting the DRI1 paths
that produce kernel_mm false, and deleting code.
2011-10-28 11:23:09 -07:00
Eric Anholt
4a2f00889b r200: Drop the non-kernel-memory-manager and DRI1 code. 2011-10-28 11:22:26 -07:00
Eric Anholt
3996ed555e radeon: Unifdef RADEON_R300 and RADEON_R600. 2011-10-28 11:21:38 -07:00
Eric Anholt
b300d62617 docs: Update to note that r300 and r600 have been replaced. 2011-10-28 11:20:30 -07:00
Eric Anholt
de22b9018f r300c, r600c: Remove these DRI drivers.
They have been superseded by the gallium equivalents.

Acked-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Acked-by: Corbin Simpson <mostawesomedude@gmail.com>
2011-10-28 11:20:30 -07:00
Eric Anholt
2f4c7ebea6 mesa: Remove build infrastructure for r300c and r600c.
These drivers have been superseded by the gallium equivalents.
2011-10-28 11:19:56 -07:00
Eric Anholt
9171bfe5f6 radeon: Delete DRI1 screen init code and thus support for !kernel_mm.
It's past time, and it was going to get in the way of the renderbuffer
mapping refactor.  We dropped all the other DRI1 drivers for this
release, and I can't imagine anybody supporting DRI1 radeon classic in
a new release of Mesa.

Cleanup of the resulting dead code to follow.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
2011-10-28 11:19:14 -07:00
Eric Anholt
a34c28f1aa dri: Drop _dri_texformats that just obfuscate MESA_FORMAT names.
The remaining _dri_texformats are the ones that are variable depending
on the endianness of the system.
2011-10-28 11:19:14 -07:00
Eric Anholt
8d9c5167ac radeon: Use _mesa_get_format_base_format for winsys renderbuffer setup. 2011-10-28 11:19:14 -07:00
Eric Anholt
964c5195a2 radeon: Remove dead swrast renderbuffer setup code.
This was from the stub code in the initial commit of this file.
2011-10-28 11:19:14 -07:00
Kenneth Graunke
3b4d2eac60 glsl: Remove pointless uses of glsl_type::get_base_type().
These are effectively doing type->get_base_type()->base_type, which is
equivalent to type->base_type.  Just use that, as it's simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 11:12:33 -07:00
Marek Olšák
1e1a7011ee r600g: don't flush before reading query results
Taken care of by the winsys.
2011-10-28 19:29:05 +02:00
Marek Olšák
e9b6f21a50 r600g: only maintain the list of active queries
And not all existing queries. The only reason we have that list is to be able
to suspend and resume the active ones.

This reduces looping over queries when suspending and resuming.
The queries no longer have to track some of their states.
2011-10-28 19:29:05 +02:00
Marek Olšák
b70a51318a r600g: cleanup r600_query_result 2011-10-28 19:29:05 +02:00
Marek Olšák
1de02d7364 r600g: don't flush in r600_get_backend_mask
The winsys does the flush in buffer_map.
2011-10-28 19:29:05 +02:00
Marek Olšák
6e79127e79 r600g: remove redundant variable r600_query::buffer_size 2011-10-28 19:29:05 +02:00
Marek Olšák
671af44b19 r300g: remove useless code 2011-10-28 19:29:04 +02:00
Alan Coopersmith
68657183b0 gallium/auxiliary/util: Solaris also has standard Unix sockets
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-27 22:43:02 -07:00
Tom Stellard
17a1c0cb0d r300/compiler: Fix scheduler bug causing texture corruption
We weren't setting TEX_SEM_WAIT on instructions that read the value of a
TEX instruction and also wrote the same register as the TEX instruction.

This is the sequence we were miscompiling:

1: TEX temp[0], input[2].xy__, 2D[0]
...
16: src0.xyz = temp[22], src1.xyz = temp[0], src2.xyz = temp[19]
      MAD temp[0].xyz, src0.xxx, src1.xyz, src2.xxx

https://bugs.freedesktop.org/show_bug.cgi?id=42090
2011-10-27 20:35:31 -04:00
Paul Berry
5aa96286e7 i965/gen6+: Add support for noperspective interpolation.
This required the following changes:

- WM setup now makes the appropriate set of barycentric coordinates
  (perspective vs. noperspective) available to the fragment shader,
  based on whether the shader requires perspective interpolation,
  noperspective interpolation, both, or neither.

- The fragment shader backend now uses the appropriate set of
  barycentric coordiantes when interpolating, based on the
  interpolation mode returned by
  ir_variable::determine_interpolation_mode().

- SF setup now uses gl_fragment_program::InterpQualifier to determine
  which attributes are to be flat shaded (as opposed to the old logic,
  which only flat shaded colors).

- CLIP setup now ensures that the clipper outputs non-perspective
  barycentric coordinates when they are needed by the fragment shader.

Fixes the remaining piglit tests of interpolation qualifiers that were
failing:
- interpolation-flat-*-smooth-none
- interpolation-flat-other-flat-none
- interpolation-noperspective-*
- interpolation-smooth-gl_*Color-flat-*

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:20 -07:00
Paul Berry
4d563ec1cc i965/gen6+: Rename GEN6_CLIP_BARYCENTRIC_ENABLE.
The name was misleading.  The actual effect of the bit is to cause
the clipper to emit *non-perspective* barycentric coordinate
information (which is only needed when doing noperspective
interpolation).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:08 -07:00
Paul Berry
f8386a29f0 i965/fs: use determine_interpolation_mode().
This patch changes how fs_visitor::emit_general_interpolation()
decides what kind of interpolation to do.  Previously, it used the
shade model to determine how to interpolate colors, and used smooth
interpolation on everything else.  Now it uses
ir_variable::determine_interpolation_mode(), so that it respects GLSL
1.30 interpolation qualifiers.

Fixes piglit tests interpolation-flat-*-smooth-{distance,fixed,vertex}
and interpolation-flat-other-flat-{distance,fixed,vertex}.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:00 -07:00
Paul Berry
e04bdeae82 i965/gen6+: Parameterize barycentric interpolation modes.
This patch modifies the fragment shader back-end so that instead of
using a single delta_x/delta_y register pair to store barycentric
coordinates, it uses an array of such register pairs, one for each
possible intepolation mode.

When setting up the WM, we intstruct it to only provide the
barycentric coordinates that are actually needed by the fragment
shader--that is computed by brw_compute_barycentric_interp_modes().
Currently this function returns just
BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC, because this is the only
interpolation mode we support.  However, that will change in a later
patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:53 -07:00
Paul Berry
102bdd26e1 i965/fs: Fix split_virtual_grfs() when delta_xy not in a virtual register.
This patch modifies the special case in
fs_visitor::split_virtual_grfs() that prevents splitting from being
applied to the delta_x/delta_y register pair (this register pair needs
to remain contiguous so that it can be used by the PLN instruction).

When gen>=6, this register pair is in a fixed location, not a virtual
register, so it was in no danger of being split.  And
split_virtual_grfs' attempt not to split it was preventing some other
unrelated register from being split.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:47 -07:00
Paul Berry
baf7f99fd7 glsl: add ir_variable::determine_interpolation_mode() function.
This function determines how a variable should be interpolated based
both on interpolation qualifiers and the current shade model.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:32 -07:00
Paul Berry
c488150dea glsl: Distinguish between no interpolation qualifier and 'smooth'
Previously, we treated the 'smooth' qualifier as equivalent to no
qualifier at all.  However, this is incorrect for the built-in color
variables (gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and
gl_BackSecondaryColor).  For those variables, if there is no qualifier
at all, interpolation should be flat if the shade model is GL_FLAT,
and smooth if the shade model is GL_SMOOTH.

To make this possible, I added a new value to the
glsl_interp_qualifier enum, INTERP_QUALIFIER_NONE.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:20 -07:00
Paul Berry
cf45949d6a mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.
This patch makes GLSL interpolation qualifiers visible to drivers via
the array InterpQualifier[] in gl_fragment_program, so that they can
easily be used by driver back-ends to select the correct interpolation
mode.

Previous to this patch, the GLSL compiler was using the enum
ir_variable_interpolation to represent interpolation types.  Rather
than make a duplicate enum in core mesa to represent the same thing, I
moved the enum into mtypes.h and renamed it to be more consistent with
the other enums defined there.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:30:58 -07:00
Marek Olšák
0fbc8d301b docs: update GL3 status
EXT_texture_array has been completed for quite a while.

Removing BindBufferBase+Range, because they're part of EXT_transform_feedback.
2011-10-27 15:57:08 +02:00
Marek Olšák
a19e6a8f28 r600g: remove redundant variable r600_pipe_context::blit 2011-10-27 12:27:34 +02:00
Marek Olšák
48dcdcffd6 mesa: initialize ARB_transform_feedback2 dispatch
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 11:26:19 +02:00
Marek Olšák
dc93a81a3d mesa: improve EXT_transform_feedback display list support
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 11:26:19 +02:00
Marek Olšák
f77aa278d3 mesa: fix GL error checking in TransformFeedbackVaryings
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 11:26:19 +02:00
Brian Paul
27de26073b st/glx: fix mixed declarations and code, remove unused var 2011-10-26 16:45:04 -06:00
Brian Paul
2997b45896 st/mesa: tell VBO module to always unmap buffers before drawing
Without this it's possible to wind up in a draw call with the
glBegin/End VBO still in a mapped state.  This is a problem for
the SVGA3D driver and probably not good for other HW drivers.
2011-10-26 16:45:03 -06:00
Eric Anholt
4fc9a98a0e glsl: Rename remaining internal builtins from gl_MESA* to gl_*MESA.
This matches the usual convention for extension builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-26 12:52:11 -07:00
Eric Anholt
4ad8a0adec intel: Drop texture border support code.
Now that texture borders are gone, we never need to allocate our
textures through non-miptrees, which simplifies some irritating paths.

v2: Remove the !mt support case from intel_map_texture_image()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:28 -07:00
Eric Anholt
96db07e28c intel: Enable stripping of texture borders.
This replaces software rendering of textures with the deprecated
1-pixel border (which is always bad, since mipmapping is rather broken
in swrast, and GLSL 1.30 is unsupported) with hardware rendering that
just pretends there was never a border (so you have potential seams on
apps that actually intentionally used the 1-pixel borders, but correct
rendering otherwise).

This doesn't regress any piglit tests on gen6 (since the texwrap
border/bordercolor cases already failed due to broken border color
handling), but regresses texwrap border cases on original gen4 since
those end up sampling the border color instead of the border pixels.
It's a small price to pay for not thinking about texture borders any
more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:23 -07:00
Eric Anholt
638b657f83 mesa: Apply StripTextureBorder to CopyTexImage as well.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:20 -07:00
Eric Anholt
9c4b025287 mesa: Fold gallium's texture border stripping into a core Mesa option.
We wanted to reuse this in the Intel driver.

v2: Move the flag to ctx->Const

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:17 -07:00
Eric Anholt
b31104e318 mesa: Skip texstore for 0-sized texture data.
The intel driver (and gallium, it looks like, though it doesn't use
these texstore functions at this point) doesn't bother making storage
for textures with 0 width, height, or depth.  This avoids them having
to deal with returning a mapping for that nonexistent data.

Fixes assertion failures with an upcoming intel driver change.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:13 -07:00
Marek Olšák
69e48e7220 r600g: remove redundant assignment of pipe_draw_info in draw_vbo 2011-10-26 15:54:30 +02:00
Dave Airlie
d404f60693 llvmpipe: llvmpipe doesn't support pure integers yet.
Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=42240

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-26 15:51:31 +02:00
Marek Olšák
344039d81d r600g: cleanup draw_vbo and add comments 2011-10-26 15:15:57 +02:00
Vinson Lee
20a20c781a ralloc: Move declaration before code.
Fixes build error with MSVC.
2011-10-25 20:31:14 -07:00
Vinson Lee
a936b206a0 scons: Add link_uniforms.cpp to SConscript. 2011-10-25 20:19:07 -07:00
Ian Romanick
6437a71d41 ir_to_mesa: Use uniform_field_visitor to add all struct fields to parameter list
Previously the uniform was passed as single, whole structure to
_mesa_add_parameter.  This was completely bogus and resulted in a
DataType of 0 (instead of a valid GLSL type enum).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-25 17:51:57 -07:00
Ian Romanick
747e59c759 linker: Add uniform_field_visitor class to process leaf fields of a uniform
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-25 17:51:57 -07:00
Kenneth Graunke
ca95593d49 ralloc: Add new [v]asprintf_rewrite_tail functions.
This can be useful if you want to create a bunch of temporary strings
with a common prefix.  For example, when iterating over uniform
structure fields, one might want to create temporary strings like
"pallete.primary", "palette.outline", and "pallette.shadow".

This could be done by overwriting the '.' with a null-byte and calling
ralloc_asprintf_append, but that incurs the cost of strlen("pallete")
every time...when this is already known.

These new functions allow you rewrite the tail of the string, given a
starting index.  If the starting index is the length of the string, this
is equivalent to appending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-25 17:51:43 -07:00
Ian Romanick
960d722bf7 linker: Eliminate more dead code after demoting shader inputs and outputs
Consider the following vertex shader and fragment shader:

// vertex shader
varying vec4 v;
uniform vec4 u;

void main() { gl_Position = vec4(0.0); v = u; }

// fragment shader
void main() { gl_FragColor = vec4(0.0); }

Since the fragment shader does not use 'v', it is demoted from a
varying to a simple global variable.  Once that happens, the
assignment to 'v' is useless, and it should be removed.  In addition,
'u' is no longer active, and it should also be removed.

Performing extra dead code elimination after demoting shader inputs
and outputs takes care of this.  This elimination must occur before
assigning uniform locations, or the declaration of 'u' cannot be
removed.

This change *breaks* the piglit test getuniform-01, but that test is
already incorrect.  The test uses a vertex shader that assigns to a
user-defined varying, but it has no fragment shader.  Since Mesa does
not support ARB_separate_shader_objects (we only support the EXT
version), the linker correctly eliminates the user-defined varying.
The cascading effect is that the uniform queried by the C code of the
test is also (correctly) eliminated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-10-25 17:51:43 -07:00
Ian Romanick
1d5d67f8ad glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass
Setting this flag prevents declarations of uniforms from being removed
from the IR.  Since the IR is directly used by several API functions
that query uniforms in shaders, uniform declarations cannot be removed
after the locations have been set.  However, it should still be safe
to reorder the declarations (this is not tested).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-10-25 17:51:43 -07:00
Kenneth Graunke
384ad987a1 i965: Add more #defines for Gen6+ 3DSTATE_GS fields.
These should be useful for doing transform feedback on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:35 -07:00
Kenneth Graunke
f1694eabdd i965: Add new brw_context::max_gs_threads constant.
These are correct to the best of my knowledge, gleaned from a variety of
internal sources.  Sadly, the Sandybridge PRM has incorrect limits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:32 -07:00
Kenneth Graunke
db6dd6d88f i965: Rename (vs|wm)_max_threads to max_(vs|wm)_threads for consistency.
The inconsistency between vs_max_threads and max_vs_entries was rather
annoying.  I could never seem to remember which one was reversed, which
made it harder to find quickly.  "Max __ Threads" seems more natural.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:30 -07:00
Kenneth Graunke
47f1d9deff i965: Remove "single threaded" INTEL_DEBUG mode.
According to the docs for 3DSTATE_PS (Gen7+) and 3DSTATE_WM (Gen6),
there is a platform dependent value for the minimum number of pixel
shader threads.  It may also vary based on whether WIZ Hashing is on.

For example, Ivybridge requires at least 4 threads if WIZ hashing is
disabled, and 8 if it's enabled.  Programming it to use less threads is
illegal.  Sandybridge appears to have similar restrictions.

So on newer platforms, INTEL_DEBUG=sing will probably just hang the GPU.
Rather than try to patch it up for newer platforms and extend it to
support geometry shaders, just remove it as it isn't that useful anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:21 -07:00
Kenneth Graunke
7a86bf816c mesa: Remove unnecessary and incorrect TexEnv parameter validation.
For GL_RGB_SCALE and GL_ALPHA_SCALE targets, the API wrapper code
attempts to ensure the parameter is 1.0, 2.0, or 4.0.

This is unnecessary: set_combiner_scale in texenv.c (called by
_mesa_TexEnvfv) already checks this and raises an appropriate error.

It's also incorrect: For glTexEnvx, the API validation code directly
compares the GLfixed input parameter with a floating point constant,
prior to converting fixed-point to floating point.

Fixes an issue in the OpenGL ES 1.1 conformance suite.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-25 16:25:39 -07:00
Stéphane Marchesin
00ddc7ea47 st/glx: Implement texture_from_pixmap without DRI.
Makes texture_from_pixmap work with non-DRI llvmpipe.
2011-10-25 14:35:46 -07:00
Stéphane Marchesin
b1d93d2aa8 i915g: Cleanup the vertex sampler interface a bit. 2011-10-25 14:30:08 -07:00
Stéphane Marchesin
2b4ab1435f i915g: Flesh out TODO idea. 2011-10-25 14:30:07 -07:00
Chad Versace
882c83377d intel: Kill dead code in intel_miptree_copy_teximage()
Kill the code paths taken when src_mt is null. It is never null, otherwise
there would be a segfault on line 4 of this function:
    GLuint width = src_mt->level[level].width;

(Some interleaved lines in the diff make the real diff non-obvious. All
I did was delete some code and then left-shifted what remained to correct
the indentation.)

Reviewed-by: Eric Anholt <eric@aholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-25 11:28:32 -07:00
Vinson Lee
265f55e627 tgsi: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-25 11:12:51 -07:00
Vinson Lee
c81b441ba2 swrast: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-25 11:09:45 -07:00
Brian Paul
e8d0d7893a swrast: use _mesa_ffs() instead of ffs()
Fixes MSVC build.
2011-10-25 11:26:26 -06:00
Marek Olšák
765503bb5d r600g: move some code out of draw_vbo into new r600_update_derived_state 2011-10-25 19:21:49 +02:00
Marek Olšák
3d79347609 r600g: cleanup some magic numbers 2011-10-25 19:12:33 +02:00
Marek Olšák
dc651aff0c r600g: don't render if pipe_draw_info::count is 0
Also call r600_conv_pipe_prim earlier.
2011-10-25 19:12:33 +02:00
Brian Paul
05720e14ba mesa: fix comment language 2011-10-25 08:45:58 -06:00
Vinson Lee
ca1b60057a pp: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-25 07:38:53 -07:00
Marek Olšák
faa16dc456 r600g: set correct tiling flags in depth info
The kernel currently overwrites the flags, but if we stopped doing that,
this would break badly.
2011-10-25 01:47:03 +02:00
Jeremy Huddleston
5c44c1348e apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24 16:21:28 -07:00
Brian Paul
9dc7df1fea util: handle failed mapping in u_upload_alloc()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-24 16:39:58 -06:00
Brian Paul
19961da4cb util: handle failed mapping in u_upload_alloc_buffer()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-24 16:39:58 -06:00
Vinson Lee
4e6a0b40c5 mesa: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-24 14:13:01 -07:00
Eric Anholt
cc4ddc3a1e glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.
A driver trying to set up builtin uniforms is faced with a problem:
How do I walk the ir_variable structure (representing an array of
structs, or array of matrices, or struct, or whatever), and set up
driver structures so that dereference of that uniform gets the
corresponding ParameterValues[] entry.  The rule in general is that
each corresponding vector-sized field of an array of structs is one
builtin uniform state slot.  i965 relied on another invariant: each
state slot has a number of unique channel swizzles corresponding to
the number of elements in the field's vector, to avoid needing to walk
the glsl_type in parallel to get at vector_elements.

All of the builtin uniforms followed this behavior, except for
gl_NormalMatrix.  That's a mat3 (so 3 vec3s), but it was swizzled as 3
vec4s.

Fixes piglit glsl-fs-normalmatrix.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-10-24 13:43:02 -07:00
Eric Anholt
2ecfa88548 glsl: Add gl_MaxVaryingComponents in GLSL 1.30.
This is the new name for gl_MaxVaryingFloats now that non-float
varyings exist.  Fixes piglit
glsl-1.30/execution/maximums/gl_MaxVaryingFloats

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-24 13:43:02 -07:00
Kenneth Graunke
3cc0a7be23 i965: Apply post-sync non-zero workaround to homebrew workaround.
In commit 3e5d3626, Eric added a homebrew workaround to fix GPU hangs in
the Mesa "engine" demo and oglc's api-texcoord test.

Unfortunately, his PIPE_CONTROL contains a Depth Stall, which
necessitates the post-sync non-zero workaround,

Fixes GPU hangs in Civilization 4, PlaneShift, and 3DMMES.
Hopefully Heroes of Newerth as well, though I haven't tested that.

NOTE: This is candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41096
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Eric Anholt <eric@anholt.net>
2011-10-24 13:32:33 -07:00
Marek Olšák
56ac7ccae6 docs: update relnotes-7.12 2011-10-24 21:08:13 +02:00
Marek Olšák
cdaf9b89e4 r300g: expose ARB_ES2_compatibility by claiming FIXED format support 2011-10-24 21:05:38 +02:00
Adel Gadllah
fc8196f7a6 nv50: fix max texture levels
MAX_TEXTURE_2D_LEVELS and MAX_TEXTURE_CUBE_LEVELS are supposed to be
14 not 13, while MAX_TEXTURE_3D_LEVELS should be 12 not 10.
2011-10-24 20:07:22 +02:00
Marek Olšák
ef64da8f01 winsys/radeon: don't use the new GEM_WAIT ioctl for now 2011-10-24 20:01:14 +02:00
Tom Fogal
cbb2b4149b Only use gcc visibility support with gcc4+.
I had a colleague hitting issues compiling with an old gcc3.2
system.  These patches got them through.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-24 10:22:52 -06:00
Mathias Fröhlich
2717b8f034 winsys/radeon: restore the old r600g winsys memory characteristics.
Use VRAM for static and immutable buffers. This restores the
recently removed r600g winsys behaviour for memory locations.
This also improoves rendering times on the gpu for some
OpenSceneGraph based test cases by about 15%.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-10-24 18:20:07 +02:00
Brian Paul
50b0069fc1 util: remove gotos in u_upload_mgr.c
We can trivially remove the gotos in two places in this code and make
it a bit more readable.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-24 09:31:01 -06:00
Mathias Fröhlich
9ed88983b0 mesa: Avoid ABA problem on buffer object bind.
Make sure we do not run into the classic ABA problem on buffer object bind,
reusing this name and may be never rebind since we get an new name
that was just deleted and never rebound in between.
The explicit rebinding to the debault object in the current context
prevents the above in the current context, but another context
sharing the same objects might suffer from this problem.

Minor var renaming and comments edited by Brian.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-24 08:37:19 -06:00
Brian Paul
c9bb1bdc48 swrast: fix comment typo (s/texure/texture/) 2011-10-23 20:21:18 -06:00
Brian Paul
b487fc50b0 mesa: remove dead code from teximage.c 2011-10-23 20:17:53 -06:00
Mathias Fröhlich
597df3efda mesa: Fix multithreaded buffer object refcounting.
Buffer objects may be shared across contexts.
Rework the array attrib push/pop implementation
to be thread safe. Make use of more library functions
for this purpose.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-23 21:35:05 +02:00
Marek Olšák
21e3c585f7 r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo
This was dead code anyway.
2011-10-23 20:29:06 +02:00
Marek Olšák
89ce12a2d2 u_blitter: accept overriden width0 and height0
We'll use this soon.
2011-10-23 20:27:07 +02:00
Marek Olšák
37b62cc354 u_blitter: add a copy_texture function which uses views and not resources
The views (sampler views and surfaces) are great tools for changing resource
properties without having to change pipe_resource.
2011-10-23 20:27:06 +02:00
Brian Paul
cf81f2349c intel: remove duplicated #include of texstore.h 2011-10-23 11:22:33 -06:00
Brian Paul
37fdfbfb0e radeon: remove unnecessary #includes of texstore.h 2011-10-23 11:22:23 -06:00
Brian Paul
39503c1419 configs: add vmgfx-related dirs to configs/linux-dri 2011-10-23 11:10:06 -06:00
Brian Paul
b7f670655d swrast: update renderbuffer format assertion
Failed when exercising i965 swrast fallback rendering.
2011-10-23 10:44:47 -06:00
Brian Paul
68da4b50e9 mesa: add swrast_texture_image::Buffer
In the past, swrast_texture_image::Data has been overloaded.  It could
either point to malloc'd memory storing texture data, or it could point
to a current mapping of GPU memory.

Now, Buffer always points to malloc'd memory (if we're not using GPU
memory) and Data always points to mapped memory.  The next step would
be to rename Data -> Map.

This change also involves adding swrast functions for mapping textures
and renderbuffers prior to rendering to setup the Data pointer.  Plus,
corresponding functions to unmap texures and renderbuffers.  This is
very much like similar code in the dri drivers.
2011-10-23 10:44:47 -06:00
Brian Paul
66681b4c8c mesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory()
Core Mesa no longer does any texture memory allocation.
2011-10-23 10:44:47 -06:00
Brian Paul
6e0f9001fe mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast
Only swrast and the drivers that fall back to swrast need these fields now.
This removes the last of the fields related to software rendering from
gl_texture_image.
2011-10-23 10:44:47 -06:00
Brian Paul
33abbd4fbd llvmpipe: point out that there's two stencil writemasks
In lp_build_stencil_op() the incoming 'stencil' var is a 2-element array.
There's a front-face writemask and a back-face writemask but we're ignoring
the later.  This patch doesn't fix anything but at least points out the
problem.
2011-10-23 10:09:34 -06:00
Brian Paul
c7aa8da957 llvmpipe: compare front_facing to NULL to improve readability
Compare 'front_facing' to NULL to make it more obvious that front_facing
is a pointer and not a simple boolean value.
2011-10-23 10:09:34 -06:00
Brian Paul
903a14ed91 gallivm: added lp_build_print_ivec4() function 2011-10-23 10:09:33 -06:00
Brian Paul
08b2cc018d mesa: improve the warning message in _mesa_choose_tex_format()
Bug 42128 hits this _mesa_warning() call.
2011-10-23 10:00:04 -06:00
Eric Anholt
dc637b66b2 glsl: Add support for constant expression evaluation on round(), roundEven().
v2: Avoid the C99 rounding functions, because I don't trust
get/setting the C99 rounding mode from inside our library not having
other side effects.  Instead, open-code roundEven() behavior around
Mesa's IROUND, which we're already testing for C99 rounding mode
safety.

Fixes glsl-1.30/compiler/built-in-functions/round*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-23 00:37:14 -07:00
Mathias Fröhlich
b27a67af89 dri-r600: Hook up a drm_descriptor configuration function
Returns a configuration that makes the dri state-tracker-manager
throttle.
2011-10-23 09:08:18 +02:00
Mathias Fröhlich
d5bfcf73fd r600g: make r[67]00 not bail out on PRED_SETNE_INT. 2011-10-23 08:57:43 +02:00
Dave Airlie
8b36958ceb r600g: make if's use PRED_SETNE_INT no matter what.
This is more correct for TGSI if, and with native ints enabled
it fixes 25 piglit fails.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:58 +01:00
Dave Airlie
d54407040b r600g: print inst in hex in dumps
since we have them as hex in the headers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:57 +01:00
Dave Airlie
608a7009d9 r600g: drop specific i2f it should be a trans only op2.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:57 +01:00
Mathias Froehlich
409748ac0b vbo: Clean up unused variables in the vbo module.
Remove some unused or unused but set variables
from the vbo module.
2011-10-22 13:02:35 +02:00
Alan Coopersmith
7986e4c5a9 Convert additional GNUC_MINOR checks to multiplied version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-21 18:40:36 -07:00
Alan Coopersmith
8c509e1181 Fix gcc version checks for _mesa_bitcount
- Fix _GNUC__ typo in both checks
- Fix logic error in check for gcc < 3.4 that breaks for gcc 2.x & older

Without this fix, builds with gcc 3.4.x end up depending on undefined
_mesa_bitcount instead of gcc's __builtin_popcount.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-21 18:39:50 -07:00
Maarten Lankhorst
df8f864bf6 gallium/targets: Add vdpau target for nouveau
Should fall back to shader based decoding (g3dvl) for now.

This is probably broken on systems that support xvmc, because
nouveau_video_buffer_create has no way to know for what api
the buffer is created, so I think this call might need a
separate argument as workaround.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-10-21 23:39:01 +02:00
Christoph Bumiller
27b0c9d513 d3d1x: set primitive restart in the correct draw calls 2011-10-21 23:00:40 +02:00
Christoph Bumiller
bb0482a55b nv50/ir: import SM4 converter 2011-10-21 23:00:40 +02:00
Christoph Bumiller
d988361ead nouveau,nvc0: fix/improve handling of multiple constant buffers 2011-10-21 23:00:40 +02:00
Christoph Bumiller
28271fd00d nvc0: add support for linear and buffer textures and RTs 2011-10-21 23:00:40 +02:00
Christoph Bumiller
73ea0e7fd4 nvc0: add support for clip distance shader outputs 2011-10-21 23:00:40 +02:00
Christoph Bumiller
b4ecef4b1b nvc0: handle more query types 2011-10-21 23:00:40 +02:00
Christoph Bumiller
3cc1dd5b80 nvc0: fix location of the PrimitiveID output 2011-10-21 23:00:39 +02:00
Christoph Bumiller
3637537a1f nvc0: prevent VERTEXID/INSTANCEID from consuming input slots 2011-10-21 23:00:39 +02:00
Christoph Bumiller
44c23e9052 nvc0: fixes for program tessellation parameters 2011-10-21 23:00:39 +02:00
Christoph Bumiller
8bc3a87f40 nv50,nvc0: reset per-instance state for inactive vertex elements 2011-10-21 23:00:39 +02:00
Christoph Bumiller
6994b57a50 nv50,nvc0: reset base element in draw_arrays
It affects VERTEX_BUFFER_FIRST,COUNT submission, too.
2011-10-21 23:00:39 +02:00
Christoph Bumiller
8828004e67 nvc0: apply first_layer offset to all resources with array_size
Makes CUBE arrays work with d3d1x.
2011-10-21 23:00:39 +02:00
Christoph Bumiller
840bc04b43 nvc0: emit state to allow GP to select the RT layer 2011-10-21 23:00:39 +02:00
Christoph Bumiller
6db14200eb nvc0: validate GP samplers, textures 2011-10-21 23:00:39 +02:00
Christoph Bumiller
e104bb9f92 nvc0: fix clear_render_target/depth_stencil region
In all 3 dimensions (now clearing all layers too).
2011-10-21 23:00:39 +02:00
Christoph Bumiller
ff583a47ee nvc0: fix assertion that immediate array buffer fits 2011-10-21 23:00:39 +02:00
Christoph Bumiller
52c8c52b22 nv50/ir: use RDSV to fetch FrontFacing before lowering 2011-10-21 23:00:39 +02:00
Christoph Bumiller
9c930639d9 nv50/ir: fix textureGrad with offsets and in non-FPs 2011-10-21 23:00:39 +02:00
Christoph Bumiller
0e4e0ca6df nv50/ir: add wrap mode for shift operations
D3D1x specifies that only the low 5 bit of the shift are used.
2011-10-21 23:00:39 +02:00
Christoph Bumiller
974102c7c2 nv50/ir: initialize RelocInfo to 0 2011-10-21 23:00:38 +02:00
Christoph Bumiller
7920c3c192 nvc0/ir: fix emission of cvt when register and type size differ 2011-10-21 23:00:38 +02:00
Christoph Bumiller
37a08ddce5 nv50/ir: fix argument count for CUBE_ARRAY texture target 2011-10-21 23:00:38 +02:00
Christoph Bumiller
2ec5c8feb3 nvc0/ir: GP emit address must end up in $r0 2011-10-21 23:00:38 +02:00
Christoph Bumiller
30cb66cd74 nvc0/ir: TXQ requires different lowering from normal TEX 2011-10-21 23:00:38 +02:00
Christoph Bumiller
6b27f14680 nv50/ir: initialize default prog_info values for GP,TP 2011-10-21 23:00:38 +02:00
Christoph Bumiller
63ca1abcc4 nv50/ir: fix memory value equality check 2011-10-21 23:00:38 +02:00
Christoph Bumiller
e3a3844e8d nv50/ir: fix leak in removal of graph root 2011-10-21 23:00:38 +02:00
Christoph Bumiller
d5cfab703b d3d1x: fix/improve OMSetRenderTargets
Don't count trailing NULL RTVs.
Don't skip update if only DSV has changed.
2011-10-21 23:00:38 +02:00
Christoph Bumiller
3dff43d897 d3d1x: avoid translating invalid blend, depth or stencil state 2011-10-21 23:00:38 +02:00
Christoph Bumiller
74ff845e33 d3d1x: add support for buffer views 2011-10-21 23:00:38 +02:00
Christoph Bumiller
1fc5aee8ff d3d1x: improve CreateInputLayout 2011-10-21 23:00:38 +02:00
Christoph Bumiller
856f3336dc d3d1x/context: fix IASetVertexBuffers stride comparison 2011-10-21 23:00:38 +02:00
Christoph Bumiller
5b6f3a2e3c d3d1x: use ZS formats for TYPELESS resources with DS binding 2011-10-21 23:00:38 +02:00
Christoph Bumiller
845808f105 d3d1x: use resource format if view format is UNKNOWN 2011-10-21 23:00:37 +02:00
Christoph Bumiller
5081ebf238 d3d1x: fix shadow comparison to gallium enum off by one 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c0e03c7694 d3d1x: improve CheckFormatSupport 2011-10-21 23:00:37 +02:00
Christoph Bumiller
77574bf0f4 d3d1x: update format mapping table
Use the proper integer formats.
Fix mapping of some PIPE depth formats to DXGI.
2011-10-21 23:00:37 +02:00
Christoph Bumiller
6ab6c43079 d3d1x: fix translation of subresource to layer 2011-10-21 23:00:37 +02:00
Christoph Bumiller
4b7851623e d3d1x: fix initial data upload for 3D textures 2011-10-21 23:00:37 +02:00
Christoph Bumiller
dac5baf2e4 d3d1x: MipLevels -1 in resource view desc means all 2011-10-21 23:00:37 +02:00
Christoph Bumiller
5d70b5d10b d3d1x/dxgi: fix initialization of pipe_box for Present copy 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c463dfe4e4 d3d1x: implement array textures 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c43b2f6a30 nvc0/ir: handle levelZero modifier in TEX emission 2011-10-21 23:00:37 +02:00
Christoph Bumiller
b5f2c0505f nvc0/ir: fix lowering of DIV F32 2011-10-21 23:00:37 +02:00
Christoph Bumiller
cb88426293 d3d1x: fix refcounting of GalliumD3D11DeviceChild objects
An external Release would have lowered the device reference count,
but an internal reference in the context does not raise it (by
design).
2011-10-21 23:00:37 +02:00
Christoph Bumiller
3fc2818f2b nvc0/ir: fix xy confusion typo in readTessCoord 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c8ae342bf3 d3d1x/sm4: save CUSTOMDATA
This is the data for the immediate constant buffer.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
903e3257d0 d3d1x: add FORK/JOIN phase opcodes to declarations
The phase instance counts are not necessarily redeclared so with
the separation of declarations and instructions we wouldn't know
which instance count applies to which phase.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
d2cc8aedb5 d3d1x: add shader signature to sm4_program
Correct linkage requires examining the signature itself, it cannot
be reconstructed from declarations only since unused registers may
have been omitted from them.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
47eb8a23eb d3d1x: attempt to detect D3D10 feature level
Virtually all applications refuse to use the D3D10 backend if this
level is not supported, which makes testing annoying.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
65303c49d1 d3d1x: switch to TGSI SAMPLE opcodes
We don't want to clutter the code or handicap new hardware for
the sake of ancient GPUs on which d3d1x won't ever be used,
much less be fully compliant, anyway.
2011-10-21 23:00:36 +02:00
Brian Paul
6b72eded19 st/mesa: fix a bug in and re-org setup_interleaved_attribs()
We were mis-computing the size of the user-space vertex buffer in
some circumstances.  This led to a failed assertion at u_inlines.h:222
when using the VMware svga driver.

For example, if we had arrays such as:

array[0]: element_offset = 12, stride = 24
array[1]: element_offset = 0, stride = 24

We'd mistakenly compute 'bytes' to be 12 bytes too small.

I've reorganized the function too.  By time it's called, we know that
we've got interleaved arrays either all in one VBO or all in user memory
and the stride is equal for all arrays.

Move the code that lived inside the attr==0 test after the loop.

In the loop we compute the true vertex size.  That size factors into the
pipe->redefine_user_buffer() call later.  Using the vertex size instead
of array[0]'s element_offset fixes the failed assertion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-21 10:09:48 -06:00
Kenneth Graunke
1595c79d9c glsl: Short-circuit lower_if_to_cond_assign when MaxIfDepth is UINT_MAX.
Setting MaxIfDepth to UINT_MAX effectively means "don't lower anything."

Explicitly checking for this common case allows us to avoid walking the
IR, computing nesting levels, and so on.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-10-21 01:11:20 -07:00
Kenneth Graunke
01f9fdc4ac i965: Set MaxIfDepth to UINT_MAX on Gen6+ and 16 on prior generations.
Commit 488fe51cf8 converted the EmitNoIfs
flag to MaxIfDepth, an unsigned integer saying "flatten if-statements
nested beyond this depth."

Unfortunately, i965 left this initialized to 0, which made ir_to_mesa
attempt to flatten all if-statements.  We didn't notice right away
because we usually throw away ir_to_mesa's code in favor of the native
VS and FS backends...but this still creates a lot of unnecessary work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-21 01:11:17 -07:00
Jeremy Huddleston
9f2abbee62 apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-21 00:34:06 -07:00
Jeremy Huddleston
098ecfad83 apple: Silence some debug spew
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-21 00:34:06 -07:00
Marek Olšák
7a3bbd3d5d r600g: cleanup r600_reset_blittable_to_compressed 2011-10-21 03:34:54 +02:00
Vinson Lee
f664d6a2f3 st/mesa: Initialize variable.
ptr is uninitialized if ib is NULL.

Fixes Coverity uninitialized pointer read defect.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-20 17:12:37 -07:00
Alan Coopersmith
b27298055e Add solaris detection for PIPE_ARCH_LITTLE_ENDIAN/PIPE_ARCH_BIG_ENDIAN
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-20 17:02:12 -07:00
Kenneth Graunke
6e160d01f2 i965: Remove copy and pasted gen7_wm_constants state atom.
Now that this is identical to gen6_wm_constants, just use that instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-20 15:25:37 -07:00
Kenneth Graunke
b293b3cbb1 i965: Use AUB_TRACE_WM_CONSTANTS in gen7_prepare_wm_push_constants.
This makes it match gen6_prepare_wm_push_constants.  For some reason, it
had been using AUB_TRACE_NO_TYPE.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-20 15:25:34 -07:00
Kenneth Graunke
61d7f4b9d4 i965: Fix incorrect dirty bit in gen6_prepare_wm_push_constants.
We definitely want CACHE_NEW_WM_PROG, not CACHE_NEW_VS_PROG.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-20 15:25:26 -07:00
Marek Olšák
a04f8c3612 r300g: don't return NULL in resource_from_handle if the resource is too small
The DDX may allocate a buffer with a too small size.
Instead of failing, let's pretend everything's alright.

Such bugs should be fixed in the DDX, of course.

NOTE: This is a candidate for the stable branches.
2011-10-20 23:37:22 +02:00
Brian Paul
c60eb632b7 docs: document known issues with Viewperf 11 2011-10-20 15:13:17 -06:00
Eric Anholt
31874f074c i965/vs: Fix comparisons with uint negation.
The condmod instruction ends up generating garbage condition codes,
because apparently the comparison happens on the accumulator value (33
bits for UD), not the truncated value that would be written.

Fixes vs-op-neg-*

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-20 09:51:58 -07:00
Eric Anholt
73b0a28ba8 i965/fs: Fix comparisions with uint negation.
The condmod instruction ends up generating garbage condition codes,
because apparently the comparison happens on the accumulator value (33
bits for UD), not the truncated value that would be written.

Fixes fs-op-neg-*

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-20 09:50:49 -07:00
Christoph Bumiller
55c5ad8dfa d3d1x: make use of new query types 2011-10-20 18:03:54 +02:00
Christoph Bumiller
1f4f0c41db softpipe: implement/fix TIMESTAMP queries 2011-10-20 18:03:49 +02:00
Christoph Bumiller
10f67c070b gallium: add new query types and missing documentation 2011-10-20 18:03:23 +02:00
Eric Anholt
c0cd947117 mesa: Fix detection of whether an ARB_vp is enabled for two sided lighting.
When there is no ARB_vertex_program program enabled, the Current
pointer points at a default program, so we were always using
VERTEX_PROGRAM_TWO_SIDE, even for fixed function lighting.

Fixes piglit two-sided-lighting*

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-20 08:45:20 -07:00
Eric Anholt
f80e1e7d1d mesa: Round the argument to PixelStoref instead of truncating.
From the GL 2.1 specification, page 114 (page 128 of the PDF):

    "The version of PixelStore that takes a floating-point value
     may be used to set any type of parameter; if the parameter is
     boolean, then it is set to FALSE if the passed value is 0.0
     and TRUE otherwise, while if the parameter is an integer, then
     the passed value is rounded to the nearest integer."

Fixes piglit roundmode-pixelstore.
Note: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-20 08:45:07 -07:00
Yuanhan Liu
46d5fb576a mesa: handle PBO access error in display list mode
Simply generate GL_INVALID_OPERATION error at display list mode. As
explained by Brian, we are going to access PBO data at compile time.
No need to defer the error at execution time.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-20 11:42:54 +08:00
Brian Paul
3560027977 i965: silence signed/unsigned comparison warning
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-10-19 13:54:42 -06:00
Brian Paul
d89c6689df st/mesa: remove primitive restart assertion
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 10:24:52 -06:00
Jakob Bornecrantz
07c3e752f8 st/mesa: Don't have indices buffers map when calling draw 2011-10-19 10:12:38 -06:00
Jakob Bornecrantz
72bd2b603b st/mesa: Implement primitive restart in software 2011-10-19 10:10:12 -06:00
Brian Paul
d3561bd0bc swrast: fix float->uint conversion of gl_FragDepth
Using IROUND() to convert a float depth value to a 32-bit uint Z value.
didn't work (it returns a signed value).  Just use a cast instead

Fixes piglit fbo-depth-array failure with swrast.

Note: this is a candidate for the 7.11 branch.
2011-10-19 09:32:30 -06:00
Brian Paul
ab9136ef75 mesa: better debug messages in _mesa_test_texobj_completeness()
And use a gl_texture_image var to simplify the code a bit.
2011-10-19 09:32:02 -06:00
José Fonseca
35ffe94a34 mesa/st: Backport WPOS adjustment fixes from st_mesa_to_tgsi.c to st_glsl_to_tgsi.cpp.
This is a trivial verbatim copy of the code from Christoph Bumiller's commit
f986a6560f.

Fixes fdo 39939 and 39942.
2011-10-19 16:59:47 +02:00
Thomas Hellstrom
60f67cd1f1 winsys/svga: Remove some unneeded debug code
This code isn't really relevant since the kernel takes care not
to destroy busy GMR buffers.

Also with the advent of fence objects, the code was incorrect since
it didn't refcount fence handles.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 15:33:26 +02:00
Vinson Lee
116b7bb5ea scons: Add uniform_query.cpp to SConscript. 2011-10-18 18:39:11 -07:00
Yuanhan Liu
02b801c1ed mesa: handle the pbo case for save_Bitmap
Wrap _mesa_unpack_bitmap to handle the case that data is stored in pixel
buffer object.

This would make calling Bitmap with data stored in PBO by display list work.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-19 09:29:44 +08:00
Yuanhan Liu
403cf7c56f mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARB
It seems like a typo.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-19 09:28:51 +08:00
Yuanhan Liu
9024d8af0a mesa: generate error if pbo offset is not aligned with the size of specified type
v2: quote the spec; explicitly exclude the GL_BITMAP case to make code
    more readable. (comments from Ian)

v3: Cast the offset by GLintptr to remove the compile warning(comments
    from Brian).

    I also found that I should use _mesa_sizeof_packed_type() instead,
    as it includes packed pixel type, like GL_UNSIGNED_SHORT_5_6_5.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-19 09:25:30 +08:00
Yuanhan Liu
76669381c0 i965: setup address rounding enable bits
The patch(based on the reading of the emulator) came from while I was
trying to fix the oglc pbo texImage.1PBODefaults fail. This case
generates a texture with the width and height equal to window's width
and height respectively, then try to texture it on the whole window.
So, it's exactly one texel for one pixel.  And, the min filter and mag
filter are GL_LINEAR. It runs with swrast OK, as expected. But it failed
with i965 driver.

Well, you can't tell the difference from the screen, as the error is
quite tiny. From my digging, it seems that there are some tiny error
happened while getting tex address. This will break the one texel for
one pixel rule in this case. Thus the linear result is taken, with tiny
error.

This patch would fix all oglc pbo subcase fail with the same issue on
both ILK, SNB and IVB.

v2: comments from Ian, make the address_round filed assignment consistent.
    (the sampler is alread memset to 0 by the xxx_update_samper_state
     caller, so need to assign 0 first)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-10-19 09:24:54 +08:00
Brian Paul
483ea0a76f i915: make i830/i915_hiz_resolve_noop() static 2011-10-18 19:12:27 -06:00
Brian Paul
5485192fc8 mesa: use format string in _mesa_error() call to silence warning 2011-10-18 19:00:07 -06:00
Brian Paul
973b4ddd0e i965: remove unused vars in brw_set_ff_sync_message() 2011-10-18 19:00:07 -06:00
Ian Romanick
58a7461e16 glsl_to_tgsi: Use _mesa_generate_parameters_list_for_uniforms
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-10-18 17:26:38 -07:00
Ian Romanick
b2572928a5 ir_to_mesa: Generate gl_program_parameter list by walking the GLSL IR.
Generate the program parameters list by walking the IR instead of by
walking the list of linked uniforms.  This simplifies the code quite a
bit, and is probably a bit more correct.  The list of linked uniforms
should really only be used by the GL API to interact with the
application.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
2011-10-18 17:26:38 -07:00
Ian Romanick
bbbb8345ab ir_to_mesa: Move some things outside the 'extern "C"' blocks
Having a few of these includes or forward declarations inside the
'extern "C"' block can cause problems later.  Specifically, it
prevents C++ linkage functions from being added to ir_to_mesa.h and
makes G++ angry if 'struct foo' is seen both inside and outside an
'extern "C"'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:38 -07:00
Ian Romanick
1375d67984 mesa: Use glsl_type::gl_type in glGetActiveUniform
This has the same value has gl_program_parameter::DataType field.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:38 -07:00
Ian Romanick
a541ff3fb9 mesa: Move _mesa_GetActiveUniformARB to uniform_query.cpp
Fold _mesa_get_active_uniform into its only caller in the process.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:37 -07:00
Ian Romanick
118fd08b58 mesa: Simplify uniform debug logging logic
This simplificiation was enabled by the earlier refactors that
eliminated the references to the assembly shaders stored in the
gl_shader_program structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:37 -07:00
Kenneth Graunke
188f074255 i965: Disassemble Ivybridge Data Port/Data Cache messages.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:56 -07:00
Kenneth Graunke
dcf03e7c09 i965: Document most of the brw_instruction message structs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
53798f90e8 i965: Rename pixel_scoreboard_clear to last_render_target for clarity.
Finding this bit in the documentation proved challenging.  It wasn't in
the SEND instruction's message descriptor section, nor the data port
message descriptor section.  It turns out to be part of the Render
Target Write message's control bits, and in the documentation is named
"Last Render Target Select".

Shaders that use Multiple Render Targets should set this bit on the last
RT write, but not on any prior ones.

The GPU does update the Pixel Scoreboard appropriately, but doesn't
document this bit as directly causing a scoreboard clear.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
feaff3aeeb i965: Remove duplicate copies of mlen & rlen from instruction decode.
After printing the details of a specific message, we always print out
the message length and response length with nice "mlen" and "rlen"
labels.

For Gen5+ URB writes, we were dumping mlen and rlen a second time:
urb 0 urb_write interleave used complete mlen 5, rlen 0 mlen 5 rlen 0

Also, for Gen6 data port messages, we were including mlen and rlen in
the tuple of undecipherable integers.

Both of these are completely redundant.  So, remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
fa0aa3796d i965: Factor out code for setting Message Descriptors.
Every brw_set_???_message function had duplicated code, per-generation,
to set the Message Descriptor and Extended Message Descriptor bits
(SFID, message length, response length, header present, end of thread).

However, these fields are actually specified as part of the SEND
instruction itself; individual types of messages don't even specify
them (except for header present, but that's in the same bit location).

Since these are exactly the same regardless of the message type, just
create a function to set them, using the generic message structs.  This
not only shortens the code, but hides a lot of the per-generation
complexity (like the SFID being in destreg__conditionalmod) in one spot.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
43ccd3200c i965: Remove EOT parameter from brw_SAMPLE and brw_set_sampler_message.
The existing code asserted that eot == 0, as it doesn't make sense for
a thread to sample a texture as the last thing it does.

It doesn't make much sense to pass around a dead parameter either.
Especially for a function which already has a long parameter list.

So, remove the parameter and just set EOT to 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
0ec04c5a33 i965: Document the brw_instruction Message Descriptor structures.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
2e124388a4 i965: Rename BRW_MESSAGE_TARGET_* to BRW_SFID_* and document them.
When reading the data port code, it was not clear to me what these
values meant, nor where I could find them in the documentation.
Especially since the latest BSpec and older PRMs document them in
radically different places...neither of which are near the descriptions
of individual messages.

Cite the documentation, and rename them to SFID to signify that these
are Shared Function IDs that one can read about in the GPU overview,
rather than arbitrary bitfields.  While we're add it, make them an enum.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
bbea5c5a5a i965: Clarify check for which cache to use on Gen6 data port reads.
Currently, we use the Render Cache for scratch access (read/write data)
and the Sampler Cache for all read only data (pull constants).

Reversing the condition here is clearer: if the caller requested the
Render Cache, use that.  Otherwise, they requested the Data Cache
(which does not exist on Gen6) or Sampler Cache, so use the Sampler
Cache.

This should not change behavior in any way.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
0d4a9ba9b2 i965: Use Ivybridge's "Legacy Data Port" for reads/writes.
Using the constant cache for reads isn't going to work for scratch
reads (variably-indexed arrays or register spills), as these aren't
constant at all.

Also, in the new VS backend, use the proper message number for OWord
Dual Block Write messages.  It's now 10, instead of 9.

+205 piglits.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:47 -07:00
Brian Paul
9a8791c889 softpipe: remove unused vars in softpipe_clear() 2011-10-18 15:43:22 -06:00
Kenneth Graunke
3c22e35165 glsl: Stop tree grafting if a variable is overwritten as an 'out' param.
While reviewing some compiler cleanups I'd sent out, Paul noticed that
tree grafting wasn't taking "out" parameters into account.

Further investigation revealed that it isn't strictly necessary: ir_call
ends basic blocks, and tree grafting currently only operates on basic
blocks.  So calls already kill grafts.

However, just to be safe, this patch makes "out" parameters explicitly
kill grafts.  Paul and I both prefer this.  It's a bit clearer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-10-18 12:24:48 -07:00
Chad Versace
f8377b411d intel: Add 'mode' param to intel_region_map
The 'mode' param is a bitset of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT.

A future commit will perform buffer resolves in intel_region_map().  So,
even though the access mode is irrelevant to the GTT, the extra
information allows us to intelligently avoid unneccessary buffer resolves.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
7b0f748efa intel: Add HiZ operations to intel_context::vtbl for all drivers
Add the following to the vtbl:
    hiz_resolve_depthbuffer
    hiz_resolve_hizbuffer

For all drivers for which HiZ is not enabled, the methods are set to be
no-ops. If HiZ is enabled, the methods are currently to set to empty
stubs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
b393fa9167 i965: Initialize intel_context::vtbl after calling intelInitContext()
intel_context::gen field is set by intelInitContext(). So, by calling
intelInitContext() before initializing the vtable, we can can construct
different vtables for different gens.

Specifically, this allows us to set the HiZ operations to be no-ops for
contexts for which HiZ is not enabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
ef6de0141c intel: Fix scatter/gather for depthstencil textures
During anholt's MapTextureImage refactoring, the call to
intel_tex_image_s8z24_create_renderbuffers was missplaced. It needs to
occur *after* the miptree is allocated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
b48e02383e i965/gen6: Fix segfault in prepare_blend_state()
Don't dereference the color buffer if one isn't attached.

This fixes the following Piglit tests in my experimental HiZ branch:
    glean/logicOp
    glean/paths

Note: This is a candidate for the stable branches.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
8c7c589c4e vbo: Redeclare bind_array() as non-static vbo_bind_array()
This is necessary because i965 will need to call vbo_bind_array() when
cleaning up after a buffer resolve meta-op.

Detailed Explanation
--------------------
The vbo module tracks vertex attributes separately from the gl_context.
Specifically, the vbo module maintins vertex attributes in
vbo_exec_context::array::inputs, which is synchronized with
gl_context::Array::ArrayObj::VertexAttrib by vbo_bind_array().
vbo_draw_arrays() calls vbo_bind_array() to perform the synchronization
before calling the real draw call, vbo_context::draw_arrays.

Intel hardware accomplishes buffer resolves with a meta-op. Frequently,
that meta-op must be performed within glDraw* in the moment immediately
before the draw occurs (The hardware designers hate us...). After
performing the meta-op, but before calling vbo_bind_array(), the
gl_context's vertex attributes will have been restored to their original
state (that is, their state before the meta-op began), but the vbo
module's vertex attribute are those used in the last meta-op. Therefore we
must manually synchronize the two with vbo_bind_array() before continuing
with the original draw command (that is, the one requested with glDraw*).

See brw_predraw_resolve_buffers(), which will be added in a future commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
fd7c46f53f mesa: Add dd_function_table::PrepareExecBegin
This hook allows the driver to prepare for a glBegin/glEnd.

i965 will use the hook to avoid avoid recursive calls to FLUSH_VERTICES
during a buffer resolve meta-op.

Detailed Justification
----------------------
When vertices are queued during a glBegin/glEnd block, those vertices must
of course be drawn before any rendering state changes. To enusure this,
Mesa calls FLUSH_VERTICES as a prehook to such state changes. Therefore,
FLUSH_VERTICES itself cannot change rendering state without falling into
a recursive trap.

This precludes meta-ops, namely i965 buffer resolves, from occuring while
any vertices are queued. To avoid that situation, i965 must satisfy the
following condition: that it queues no vertex if a buffer needs resolving.
To satisfy this, i965 will use the PrepareExecBegin hook to resolve all
buffers on entering a glBegin/glEnd block.

--------
v2: Don't add dd_function_table::CleanupExecEnd. Anholt and I discovered
    that hook to be unnecessary.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
4b6311978f swrast: Fix fastpaths for glRead/WritePixels(GL_DEPTH_STENCIL)
In some cases, Intel hardware requires that depth and stencil buffers be
separate. To accommodate swrast, i965 resorts to hackery that causes
a segfault in the fastpaths of draw_depth_stencil_pixels() and
read_depth_stencil_pixels().

The hack is that i965 sets framebuffer->Attachment[BUFFER_DEPTH].Renderbuffer
and framebuffer->Attachment[BUFFER_STENCIL].Renderbuffer to a dummy
renderbuffer for which the GetRow accessors and friends are null. The real
buffers are located at framebuffer->_DepthBuffer and framebuffer->_Stencilbuffer.

To fix the segault, this patch skips the fastpath if
framebuffer->Attachment[BUFFER_DEPTH].Renderbuffer->GetRow is null.

Note: This is a candidate for the 7.11 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
aa97ababfc meta: Bump MAX_META_OPS_DEPTH from 2 to 8
When i965 uses (in the near future) meta-ops to perform buffer resolves,
the meta-op stack exceeds depth 2. I bumped it to 8 because... 8 is bigger
than 2, but not too big.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
c5f4024a79 meta: Add flag MESA_META_SELECT_FEEDBACK
If this flag is set, then _mesa_meta_begin/end will save/restore the state of
GL_SELECT and GL_FEEDBACK render modes.

Intel's future buffer resolve meta-ops will require this, since buffer resolves
may occur when the GL_RENDER_MODE is GL_SELECT.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
c56d0a61b9 mesa: Declare _mesa_RenderMode as non-static
This is required in order for meta-ops to save/restore the GL_RENDER_MODE
state.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Kenneth Graunke
2e5a1a254e intel: Convert from GLboolean to 'bool' from stdbool.h.
I initially produced the patch using this bash command:
for file in {intel,i915,i965}/*.{c,cpp,h}; do [ ! -h $file ] && sed -i
's/GLboolean/bool/g' $file && sed -i 's/GL_TRUE/true/g' $file && sed -i
's/GL_FALSE/false/g' $file; done

Then I manually added #include <stdbool.h> to fix compilation errors,
and converted a few functions back to GLboolean that were used in core
Mesa's function pointer table to avoid "incompatible pointer" warnings.

Finally, I cleaned up some whitespace issues introduced by the change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chad Versace <chad@chad-versace.us>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-18 11:38:39 -07:00
Eric Anholt
1b45d68c11 mesa: Make the program texel offsets limits available with GLSL 1.30.
It was previously under gpu_shader4, but I'm pretty sure everyone's
going to be doing GLSL 1.30 first (since gpu_shader4 is basically 1.30
plus a bunch of extra stuff).

Fixes piglit glsl-1.30/texel-offset-limits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 11:14:23 -07:00
Neil Roberts
5625f78cd7 meta: Fix saving the active program
When saving the active program in _mesa_meta_begin, it was actually
saving the fragment program instead. This means that if the
application binds a program that only has a vertex shader then when
the meta saved state is restored it will forget the bound program.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41969
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:12:58 -07:00
Eric Anholt
7ec2b0d0d6 mesa: Convert fixed function fragment program generator to GLSL IR.
This is a step towards providing a direct route for drivers accepting
GLSL IR for codegen.  Perhaps more importantly, it runs the fixed
function fragment program through the GLSL IR optimization.  Having
seen how easy it is to make ugly fixed function texenv code that can
do unnecessary work, this may improve real applicatinos.
2011-10-18 10:54:32 -07:00
Eric Anholt
57f7978b1d mesa: Add a flag for shader programs to allow SSO linkage in GLES2.
On converting fixed function programs to generate GLSL, the linker
became cranky that we were trying to make something that wasn't a
linked vertex+fragment program.  Given that the Mesa GLES2 drivers
also support desktop GL with EXT_sso, just telling the linker to shut
up seems like the easiest solution.
2011-10-18 10:54:32 -07:00
Eric Anholt
f868cb0963 glsl: Add gl_CurrentAttrib{Vert,Frag}MESA internal builtin uniforms.
These will be used by the FF VS/FS to represent the current attributes
when they don't have an active vertex array.
2011-10-18 10:54:32 -07:00
Eric Anholt
b64ecf7db8 ff_fragment_shader: Use FRAG_RESULT_COLOR to write all our colors at once.
This is a slight simplification on the way to actually generating GLSL
fragment shaders.
2011-10-18 10:54:31 -07:00
Thomas Hellstrom
6235846cb7 svga: Plug a fence leak
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-18 10:37:12 +02:00
Stéphane Marchesin
0b3842edb1 i915g: Use the right shader limits. 2011-10-17 21:43:46 -07:00
Stéphane Marchesin
3637b5f0dd i915g: Add TODO. 2011-10-17 21:43:46 -07:00
Mathias Fröhlich
e556983fc8 r600g: Use the bitfield define matching the register it is used for.
Fix a typo that should result in the same code.
2011-10-18 06:35:21 +02:00
Marcin Slusarz
638d5a10f3 st/xorg: fix build when /lib/gallium directory does not exist yet
TARGET was not defined, so make checked directory instead of file
2011-10-17 22:57:27 +02:00
Marcin Slusarz
106c99fee5 targets/va/vdpau/xvmc: don't rebuild target lib every time
Dependency on target directory caused unnecessary relink. Remove them.
2011-10-17 22:57:27 +02:00
Marcin Slusarz
adbab41e67 st/xorg: remove target library on make clean 2011-10-17 22:57:27 +02:00
Marcin Slusarz
757390491c gallium/targets: use c++ compiler for linking
As pointed out by Michel Dänzer, gcc -lstdc++ doesn't work on all systems,
because it may require other libraries which are only pulled in implicitly
by g++. And libstdc++ is available only with GNU compiler.

Use c++ compiler for linking and remove redundant LDFLAGS += -lstdc++
all over the tree.
2011-10-17 22:57:27 +02:00
Tom Fogal
c0573fb29d Add an autoconf option for mangling Mesa.
In addition to setting up the flags correctly, this renames the
generated libraries to ensure they get 'Mangled' in the name.
This is very useful for distros and the like, where mangled Mesa
and non-mangled GL libraries typically need to be installed
side-by-side.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-17 10:14:26 -06:00
Tom Stellard
53d32600cc r300/compiler: Try to eliminate REPL_ALPHA instructions
Scalar instruction that need to write to the xyz components of a
register must reserve the RGB instruction slot for a REPL_ALPHA
instruction.  With this commit, the scheduler will attempt to free
the RGB slot by moving the write to the w component of a register.
2011-10-16 19:54:48 -07:00
Tom Stellard
8327fd18c9 r300/compiler: More agressive RGB to Alpha conversions 2011-10-16 19:54:48 -07:00
Tom Stellard
653c7af3d6 r300/compiler: Only convert RGB->Alpha when optimizations are enabled 2011-10-16 19:54:48 -07:00
Yuanhan Liu
e9edcf8b1d mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image
Introuduce a simple function called copy_data to do the image data copy
stuff for all the save_CompressedTex*Image function. The function check
the NULL data case to avoid some potential segfault. This also would
make the code a bit simpler and less redundance.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-17 09:41:58 +08:00
José Fonseca
1448bdf1c0 configure: Use -fno-builtin-memcmp.
Issue spotted by Adam Jackson <ajax at redhat.com>.

http://lists.freedesktop.org/archives/mesa-dev/2011-June/009077.html
2011-10-16 16:11:46 +01:00
José Fonseca
e1e03ce492 gallivm: Eliminate tgsi_util_get_full_src_register_sign_mode call.
It complicates more than it simplifies, now that there's only one negate
bit on TGSI registers.
2011-10-16 14:18:42 +01:00
José Fonseca
e9c1d87ce7 llvmpipe: Use lp_build_ifloor_fract for exp2 calculation.
Instead of separate ifloor / fract calls.

No change for SSE4.1 code, but less FP<->SI conversions on non SSE4.1
systems.
2011-10-16 14:18:41 +01:00
Marek Olšák
1350882e49 Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"
This reverts commit 5506f6ef96.

It breaks more things than it fixes.
2011-10-16 03:19:11 +02:00
Chad Versace
4bcda85698 swrast: Remove redundant term in logic expression
Fix is in {read,draw}_depth_stencil_pixels().  If depthRb == stencilRb,
then it is redundant to check depthRb->x *and* stencilRb->x.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-15 15:49:03 -07:00
Chad Versace
244a02c47d swrast: Fix fastpaths in glRead/WritePixels(GL_DEPTH_STENCIL)
For glReadPixels, the user supplied pixels have format
GL_UNSIGNED_INT_24_8.  But, when the depthstencil buffer's format was
MESA_FORMAT_S8_Z24, the fastpath read from the buffer without reordering
the depth and stencil bits. To fix this, this patch just skips the
fastpath when the format is not MESA_FORMAT_Z24_S8.

The problem and fix for glWritePixels is analagous.

Fixes the Piglit tests below on i965/gen6 and causes no regressions.
   general/depthstencil-default_fb-drawpixels-24_8
   general/depthstencil-default_fb-readpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-15 15:45:07 -07:00
Christoph Bumiller
9934bfe28d nv50,nvc0: extend formats table for integer formats 2011-10-15 14:12:31 +02:00
Christoph Bumiller
a4f26f2bea gallium: add PIPE_BIND_BLENDABLE flag
This is required for an accurate implementation of d3d1x's
CheckFormatSupport query.

It also seems generally useful for state trackers, which could
choose alternative rendering paths or formats if blending would
come at a significant performance loss.
2011-10-15 14:12:31 +02:00
Tom Stellard
0dc97e7fd4 r300/compiler: Enable reg rename pass on r500 and run it before optimizations
The scheduler and the register allocator are now smart enough to handle
it.
2011-10-14 18:30:14 -07:00
Tom Stellard
163629fd05 r300/compiler: Implement the texture semaphore
The texture semaphore allows for prefetching of texture data.  On my
RV515, this increases the FPS of Lightsmark by 33% (This is with the
reg_rename pass enabled, which is enabled in the next commit).

There is a new env variable now called RADEON_TEX_GROUP, which allows
you to specify the maximum number of texture lookups to do at once.
The default is 8, but different values could produce better results
for various application / card combinations.
2011-10-14 18:30:14 -07:00
Tom Stellard
51fe9994bd r300/compiler: Don't pair output writes with GPR writes in the scheduler 2011-10-14 18:30:14 -07:00
Tom Stellard
6fafb6beb7 r300/compiler: Prevent regalloc from creating non-native swizzles 2011-10-14 18:30:14 -07:00
Tom Stellard
47c7512846 r300/compiler: Allow merged instructions to be scheduled on demand
We no longer emit full instructions immediately after they have been
merged.  Instead merged instructions are added to the ready list and
the scheduler can commit them whenever it wants.
2011-10-14 18:30:14 -07:00
Ian Romanick
c19f8ab279 mesa/vbo: Treat attribute 0 and vertex as the same
This is supported by the pseudo-code on pages 27 and 28 (pages 41 and
42 of the PDF) of the OpenGL 2.1 spec.  The last part of the
implementation of ArrayElement is:

    if (generic attribute array 0 enabled) {
      if (generic vertex attribute 0 array normalization flag is set, and
	  type is not FLOAT or DOUBLE)
	VertexAttrib[size]N[type]v(0, generic vertex attribute 0 array element i);
      else
	VertexAttrib[size][type]v(0, generic vertex attribute 0 array element i);
    } else if (vertex array enabled) {
      Vertex[size][type]v(vertex array element i);
    }

Page 23 (page 37 of the PDF) of the same spec says:

    "Setting generic vertex attribute zero specifies a vertex; the
    four vertex coordinates are taken from the values of attribute
    zero. A Vertex2, Vertex3, or Vertex4 command is completely
    equivalent to the corresponding VertexAttrib* command with an
    index of zero."

Fixes piglit test attribute0.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-14 09:40:31 -07:00
Marek Olšák
ae272a92a1 r300g: set max vertex samplers to 0 on swtcl chipsets
This should fix a bug added by f5bfe54a.

Might also fix:
https://bugs.freedesktop.org/show_bug.cgi?id=41715
2011-10-14 15:06:01 +02:00
Thomas Hellstrom
5dddeb7776 winsys/svga: Rework buffer allocation to make it more robust v2.
Don't allow any "CPU" buffers to be allocated by the pb_fenced
buffer manager, since we can't protect against failures during
buffer validation.
Also, add an extra slab buffer manager to allocate buffers from
the kernel if there is a failure to allocate from our big buffer pool.
The reason we use a slab manager for this, is to avoid allocating
many very small buffers from the kernel.

v2: Increased VMW_MAX_BUFFER_SIZE and fixed some comments.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:19 +02:00
Thomas Hellstrom
83d57635bc dri-vmwgfx: Hook up a drm_descriptor configuration function
Returns a configuration that makes the dri state-tracker-manager
throttle.
Also disable kernel-based throttling.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:15 +02:00
Thomas Hellstrom
bde2fc5a71 st/dri: Hook up throttling based on the drm driver_descriptor configuration
Hooks up throttling if there is a configuration function present and
it indicates that throttling is desired.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:11 +02:00
Thomas Hellstrom
ec7d5b8c02 drm_driver: Add a configuration function to the driver descriptor.
Adds a possibility for the state tracker manager to query the
target for a specific configuration.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:05 +02:00
Thomas Hellstrom
5a6ca7e9f2 svga/winsys: Make sure a flush always inserts and returns a fence if requested
Needed for throttling.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrant <jakob@vmware.com>
2011-10-14 09:53:01 +02:00
Thomas Hellstrom
23c41233ce st/dri: Implement the new dri2 throttling extension
But don't hook it up just yet until we figure out a good way to do that.
Also, we should, in the future, add driconf options to control what
throttling reasons should be honored, and the number of outstanding
swaps allowed.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:52:57 +02:00
Thomas Hellstrom
511dc295f8 dri2: Implement a throttle dri extension.
The X server has limited throttle support on the server side,
but doing this in the client has some benefits:

1) X server throttling is per client. Client side throttling can be done
per drawable.

2) It's easier to control the throttling based on what client is run,
for example using "driconf".

3) X server throttling requires drm swap complete events.

So implement a dri2 throttling extension intended to be used by direct
rendering clients.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-10-14 09:52:53 +02:00
Brian Paul
718cbe4ba9 swrast: be a bit smarter in clip_span()
If no pixels pass the clip test, return false.
2011-10-13 17:16:19 -06:00
Brian Paul
bc4ef33108 mesa: remove unused gl_sampler_object::_CompleteTexture field 2011-10-13 17:14:24 -06:00
Brian Paul
6fc6d5a09e meta: fix redBits size test in get_temp_image_type()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41768
2011-10-13 17:12:44 -06:00
Mathias Froehlich
7b09a94282 st/wgl: Release stw_framebuffer::mutex after pbuffer creation.
This change releases the stw_framebuffer::mutex past creation of
the pbuffer stw_framebuffer. Without this change the pbuffers
lock is never released. Since on win32 mutexes are recursive, this
does not hurt as long as all actions on a context are done from
the same thread. But if, for example, context creation happens in
a different thread than usage, every access to the context will
block for ever.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-10-13 19:53:13 +01:00
Marcin Slusarz
349e4db99e st/xorg: fix build without LLVM 2011-10-13 19:02:20 +02:00
Paul Berry
7a4fee71aa i965 Gen6+: De-compact clip plane constants for old VS backend.
In commit 018ea68d87, when I
de-compacted clip planes on Gen6+, I updated both the old and new VS
back-ends to reflect the change in how clip planes are stored, but I
failed to change the code in gen6_vs_state.c that uploads clip plane
constants when using the old VS back-end.

As a result, if the set of enabled clip planes wasn't contiguous
starting with 0, then clipping would not occur properly.  This patch
corrects gen6_vs_state.c to upload clip plane constants in the new
de-compacted form.

This only affects the old VS back-end (which is used for
fixed-function and ARB vertex programs, not for GLSL vertex shaders).

Fixes Piglit test fixed-clip-enables.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41603

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 08:41:16 -07:00
Brian Paul
a9e5528f09 st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()
This fixes a bug where we'd wind up emitting an invalid instruction like
MOVE R[0]., R[1];  - note the empty/zero writemask.  If we don't write to
any dest register channels, cull the instruction.

v2: simply change/fix the existing test for instruction culling.
2011-10-13 08:35:19 -06:00
Brian Paul
e06277bd88 s/format/baseFormat/ to be more explicit
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:28 -06:00
Brian Paul
241b3e4bbe mesa: remove redundant buffer checks in copytexsubimage_error_check2()
Again, there was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:24 -06:00
Brian Paul
63aa53bf34 mesa: remove redundant buffer checks in copytexture_error_check()
There was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:03 -06:00
Brian Paul
504d0add12 mesa: check attachment Type field in renderbuffer_exists()
Instead of the renderbuffer pointer.  In the future, attaching a texture
may not mean the renderbuffer pointer gets set too.
Plus, remove some commented-out assertions.
2011-10-13 07:37:43 -06:00
Brian Paul
e5fef34c21 mesa: consolidate _mesa_source/dest_buffer_exists()
v2: add a 'reading' parameter to distinguish between reading and writing
to the renderbuffer (we don't want to check if _ColorReadBuffer is null
when we're about to draw).  Eric found this mistake.
2011-10-13 07:37:43 -06:00
Christoph Bumiller
f1f7645f23 d3d1x: fix check for PIPE_CAP_CONDITIONAL_RENDER 2011-10-13 11:04:08 +02:00
José Fonseca
983fa4ad52 scons: Use -fno-builtin-memcmp.
ipers framerate on llmvpipe improves 60%.

Issue spotted by Adam Jackson <ajax at redhat.com>.

http://lists.freedesktop.org/archives/mesa-dev/2011-June/009077.html
2011-10-12 20:43:01 +01:00
Dave Airlie
ae1153c4ac softpipe: fix regression with tex tile cache since integer support.
Don't use the uint/int paths for ZS formats for tex tile cache.

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

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-12 08:25:28 +01:00
Brian Paul
7aab0fbaa6 mesa: make _mesa_update_depth/stencil_buffer() static
These functions were only called in framebuffer.c where they were defined.
Remove the unneeded attIndex parameter too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-11 18:43:36 -06:00
Chad Versace
e9adfa2ba1 intel: Assert that no batch is emitted if a region is mapped
What I would prefer to assert is that, for each region that is currently
mapped, no batch is emitted that uses that region's bo. However, it's much
easier to implement this big hammer.

Observe that this requires that the batch flush in intel_region_map() be
moved to within the map_refcount guard.

v2: Add comments (borrowed from anholt's reply) explaining why the
assertion is a good idea.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-11 17:16:31 -07:00
Paul Berry
d06cc42c3c i965: Fix computation of abs(-x) in FS
When updating a register reference to reflect the fact that we were
taking its absolute value, the fragment shader back-end failed to
clear the negate flag, resulting in abs(-x) getting computed as
-abs(x).

I also found (and fixed) a similar problem in brw_eu.h, but I'm not
aware of an actual manifestation of that problem.

Fixes piglit test glsl-fs-abs-neg-with-intermediate.
2011-10-11 11:08:13 -07:00
Marcin Slusarz
7f3de70c3c nv50: don't crash on TXD opcode
It doesn't implement full TXD, but at least it does not crash.
Fixes arb_shader_texture_lod-texgrad and glsl-fs-shadow2DGradARB-*
piglit tests.
2011-10-11 19:35:04 +02:00
Kenneth Graunke
3f5e938a9d i965: Replace incorrect use of GLboolean with enum brw_compression.
brw_set_compression_control took a GLboolean as an argument, then
promptly used a switch statement to compare it with various enumeration
values.  Clearly it's not actually a boolean.

Introduce a new enumeration type, enum brw_compression, and use that.

Found by converting GLboolean to bool; clang then gave warnings about
switching on a boolean and ultimately duplicated case errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-11 10:26:52 -07:00
Ian Romanick
da2e41cd88 mesa: Only allow queries of window system FBO on desktop GL w/ARB_fbo
Neither OES_framebuffer_object nor EXT_framebuffer_object allow
querying the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:01:09 -07:00
Ian Romanick
a8328cc132 mesa: Accept GL_DEPTH and GL_STENCIL for window system FBO only
Previously GL_DEPTH_BUFFER and GL_STENCIL_BUFFER were (incorrectly)
allowed for both.  Those enums don't even really exist!  Now GL_DEPTH
and GL_STENCIL are only allowed for the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:00:54 -07:00
Brian Paul
b875838ec3 svga: remove old, unused sincos code for SM2.0 2011-10-11 09:55:48 -06:00
Brian Paul
94b219b9e2 svga: remove support for shader model 2.0
We've been requiring SM 3.0 all along so this just removes unused code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:30:09 -06:00
Dave Airlie
396ac41fc2 softpipe: add integer support
This adds support to the clear and tile caches for integer storage
and clearing, avoiding any floating paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Dave Airlie
866f9b18c6 gallium: rename ZS stencil type to UINT (v2)
these are never USCALED, always UINT in reality.

taken from some work by Christoph Bumiller

v2: fixup formatting of table + tabs

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Brian Paul
6b3e75de7c llvmpipe: don't support rendering to sRGB surfaces
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34199
2011-10-11 07:47:25 -06:00
Brian Paul
11938c87a3 draw/llvm: set draw->pt.user.planes field in draw_set_clip_state()
Previously it was getting set in draw_set_mapped_constant_buffer() but
if there were no shader constants, that function wasn't called.  So the
pt.user.planes field was null and we died when we tried to access the
clip planes in the LLVM-generated code.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41663

Note: This is a candidate for the 7.11 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-11 07:41:36 -06:00
Brian Paul
e6c237cfd6 draw/llvm: fix hard-coded number of total clip planes
Instead of 12 use DRAW_TOTAL_CLIP_PLANES.  The max number of user-defined
clip planes was increased to 8 so the total number of planes is 14.
This doesn't fix any specific bug, but clearly the old code was wrong.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-11 07:41:22 -06:00
Brian Paul
f0c036536f i915g: fix warning about void pointer arithmetic 2011-10-11 07:40:11 -06:00
Stéphane Marchesin
a13eed4b82 i915g: Remove duplicated comment. 2011-10-10 18:18:37 -07:00
Stéphane Marchesin
4855522678 i915g: Update TODO once more. 2011-10-10 16:56:49 -07:00
Chad Versace
f378e8fea0 i965: Change type of brw_context.primitive from GLenum to hardware primitive
For example, GL_TRIANLGES is converted to _3DPRIM_TRILIST.

The conversion is necessary because HiZ and MSAA resolve operations emit
a 3DPRIM_RECTLIST, which cannot be conveyed by GLenum.

As a consequence, brw_gs_prog_key.primitive is also converted.

v2
----
- [anholt] Split brw_set_prim into brw/gen6 variants in previous commit,
  since not much code is really shared between the two.
- [anholt] Replace switch statements with table lookups, since this is
  a hot path.

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:24:11 -07:00
Chad Versace
9559ca600d i965: Split brw_set_prim into brw/gen6 variants
The "slight optimization to avoid the GS program" in brw_set_prim() is not
used by Gen 6, since Gen 6 doesn't use a GS program. Also, Gen 6 doesn't use
reduced primitives.

Also, document that intel_context.reduced_primitive is only used for Gen < 6

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:23:41 -07:00
Dave Airlie
95fd5e5aba r600g: drop force int type workaround
now that we have integer texture types I can drop this workaround so that
copies of values is done properly (as floats would fail on some corner cases).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:53:26 +01:00
Dave Airlie
8d3e505ed6 r600g: add integer texture/render integer formats for r600/700.
with these I can drop the force int type hack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:52:35 +01:00
Eric Anholt
d950a778b7 mesa: Prevent repeated glDeleteProgram() from blowing away our refcounts.
glDeleteProgram should only be able to remove the one refcount for the
user's reference to the program from the hash table (even though that
ref does live on in the hash table until the last other ref is
removed).

Fixes piglit ARB_shader_objects/delete-repeat.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 11:38:52 -07:00
Zou Nan hai
7457da5edd i965: Fix timer query on gen6+
PIPE_CONTROL reported time stamp are 64 bits value incrementing every
80 ns, and only the low 32 bits are active (high 32 are always 0).

v2: Cleaned up whitespace, function arguments (anholt).

Fixes piglit EXT_timer_query/time-elapsed

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2011-10-10 11:38:52 -07:00
Ian Romanick
9f0e98d1df linker: Fix a slightly incorrect comment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:23:53 -07:00
Ian Romanick
f3650b05cf hash_table: Make string_to_uint_map make a copy of the name
The hash table needs a copy of the key that it can keep for
comparisons during searches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41499
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
Tested-by: Luzipher <luziphermcleod@yahoo.ie>
Tested-by: Michał Lipski <tallica@o2.pl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:21:20 -07:00
Dave Airlie
9e66b25880 u_blitter: clean up velem setup
as per Brian's suggestion, drop the pointless loops.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 17:22:17 +01:00
Stéphane Marchesin
6bf8c7c010 i915g: Update the TODO with another idea. 2011-10-10 00:15:06 -07:00
Stéphane Marchesin
9977fb42ac i915g: Enable instanced drawing. 2011-10-10 00:15:05 -07:00
Stéphane Marchesin
ddba509c16 mesa/st: Check for a NULL _LinkedShader[i] before using it.
The rest of the linker/glsl translation code checks for NULL, so I suppose we should check here too. Fixes crash on exit with i915g instanced drawing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 00:15:05 -07:00
Marek Olšák
0f55f133f1 u_blitter: query vertex shader caps instead of geometry for int vertices 2011-10-09 18:19:58 +02:00
Dave Airlie
9b34cea7e9 r600g: uarl fixes.
Not 100% sure these are correct yet
2011-10-09 16:48:45 +01:00
Dave Airlie
ddcdd6137b r600g: enable integer shader cap for evergreen.
Will get to adding r600/r700/cayman support, have it mostly written on
another PC.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:48:45 +01:00
Dave Airlie
dd20256a1c u_blitter: don't create integer vertex elements unless shader supports them
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=41613

We don't want to create these vertex elements unless the pipe driver
vertex stage can handle integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:36:41 +01:00
José Fonseca
ee1487953b st/glx/xlib: Advertise GLX_ARB_create_context(_profile)
They were already implemented, but not advertised.
2011-10-09 16:11:26 +01:00
Marcin Slusarz
90dcd6c89a nouveau: hide some debugging messages behind environment variable
They spam console, but are not very useful - hide them behind
NOUVEAU_MESA_DEBUG environment variable.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
f03810fbdd nv50,nvc0: avoid unnecessary flushes
Relocations don't consume pushbuffer space, so there is no need to
ensure there is any space in pushbuffer.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
9849f366cb nouveau: fix fence hang
If there is not enough space in pushbuffer for fence emission
(nouveau_fence_emit -> nv50_screen_fence_emit -> MARK_RING),
the pushbuffer is flushed, which through flush_notify ->
nv50_default_flush_notify -> nouveau_fence_update marks currently
emitting fence as flushed. But actual emission is done after this mark.
So later when there is a need to wait on this fence and pushbuffer
was not flushed in between, fence wait will never finish causing
application to hang.

To fix this, introduce new fence state between AVAILABLE and EMITTED,
set it before emission and handle it everywhere.

Additionally obtain fence sequence numbers after possible flush in
MARK_RING, because we want to emit fences in correct order.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>

Note: This is a candidate for the 7.11 branch.
2011-10-09 14:49:30 +02:00
Dave Airlie
0110aa09e5 r600g/eg: add integer types support
adds handling for int texture/vertices to evergreen.

TODO r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:06:18 +01:00
Dave Airlie
4e28e6f6c7 u_blitter: add integer clear support
We need add a new set of fragment shader variants, along with new vertex
elements for signed and unsigned clears.

The new fragment shader variants are due to the integers values requiring
CONSTANT interpolation. The new vertex element descriptions are for passing
the clear color as an unsigned or signed integer value.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:01:08 +01:00
Stéphane Marchesin
06415d3fab i915g: Remove another TODO item which was done a while ago. 2011-10-08 23:58:46 -07:00
Stéphane Marchesin
5dfeab71cf i915g: Remove a TODO item. 2011-10-08 23:58:06 -07:00
Stéphane Marchesin
03cd54dc60 i915g: Fix comment. 2011-10-08 23:57:27 -07:00
Stéphane Marchesin
8a22064d31 i915g: Implement vertex textures. 2011-10-08 23:54:53 -07:00
Stéphane Marchesin
e125786be8 i915g: Silence warning. 2011-10-08 20:19:53 -07:00
Stéphane Marchesin
49fea2e039 i915g: Remove old heuristic flusing remains. 2011-10-08 17:42:18 -07:00
Stéphane Marchesin
cd41960e8f i915g: Cleanup caps code a bit. 2011-10-08 17:12:37 -07:00
Marek Olšák
39d7de69b1 pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches.
2011-10-08 18:54:28 +02:00
Dave Airlie
a66a2359d7 st/mesa: add readpixel integer support
This adds support for readpixels integer paths, it deals with the signed/unsigned crossovers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:46:38 +01:00
Dave Airlie
3213d55d99 st/mesa: add support for int type conversion
This adds the various mesa->gallium and gallium->mesa format conversions
along with the GL->gallium texture choosers for integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:46:03 +01:00
Dave Airlie
a441feb757 gallium: add initial pure integer support (v2)
This add support for unsigned/signed integer types via adding a 'pure' bit
in the format description table. It adds 4 new u_format get/put hooks,
for get/put uint and get/put sint so that accessors can get native access
to the integer bits. This is used to avoid precision loss via float converting
paths.

It doesn't add any float fetchers for these types at the moment, GL doesn't
require float fetching from these types and I expect we'll introduce a lot
of hidden bugs if we start allowing such conversions without an API mandating
it.

It adds all formats from EXT_texture_integer and EXT_texture_rg.

0 regressions on llvmpipe here with this.

(there is some more follow on code in my gallium-int-work branch, bringing
 softpipe and mesa to a pretty integer clean state)

v2: fixup python generator to get signed->unsigned and unsigned->signed
fetches working.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:59 +01:00
Dave Airlie
c2060c0af7 mesa/texformat: add integer fallbacks to other formats
This fixes up the integer format choosing to pick the closest mesa format
then the most likely fallback.

(the formatting in this file needs cleaning in another patch).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:59 +01:00
Dave Airlie
8f9edbad6f mesa: add packing for int/uint
This just adds a simple packing for GL_UNSIGNED_INT/GL_INT destination formats.
This is enough for at least the gallium drivers to pack both unsigned and signed types for read pixels.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:58 +01:00
Dave Airlie
61285c6cfa u_format: add inline helper to find first non void channel
This is used in a few places in drivers as well, also the integer support
can use it as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:58 +01:00
Kenneth Graunke
b861479f83 i965: Fix inconsistent indentation in brw_eu_emit.c.
Most of these functions used three spaces for the first level of
indentation, but four spaces for the next level.  One used tabs and then
three spaces.  Some used 3/4 in a then block but 3/3 in the else block.

Normally I try to avoid field days like this, but since the functions
were so inconsistent, even internally, it was making it difficult to
edit without introducing spurious whitespace changes.

So, just get it over with.  git diff -b shows 0 lines changed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 20:23:47 -07:00
Marek Olšák
20788a908b r300g: remove unused r300_resource::tex_offset 2011-10-08 02:21:24 +02:00
Ian Romanick
93c26d8baf glsl: Remove unused method ir_variable::component_slots
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
0c76729f39 mesa: Silence several 'warning: unused parameter' in _mesa_GetnUniformdvARB
This function isn't implemented yet, so none of its parameters are
used yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
97a0fe8e93 mesa: Remove unused function _mesa_append_uniform
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
e2bdef5380 mesa: Simplify calling Driver.ProgramStringNotify after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-10-07 16:39:51 -07:00
Ian Romanick
77d67a44cc mesa: Simplify destroy_shader_program_variants_cb after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
5a4279f80d mesa: Simplify validate_shader_program after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
de772c4022 mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Ian Romanick
39348bf79f mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Ian Romanick
010cc547ca mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Chad Versace
2fae55666e mesa: Close Doxygen group
In dd_function_table, close the Doxygen group beginning with
   \name Support for multiple T&L engines
2011-10-07 15:51:54 -07:00
Marek Olšák
4c417697b6 u_blitter: bind a NULL geometry shader 2011-10-08 00:49:34 +02:00
Marek Olšák
c12c05c198 u_blitter: cleanup checking for and restoring saved states 2011-10-08 00:49:34 +02:00
Marek Olšák
5baa33a738 r300g: disable stream output on SWTCL chipsets
Unimplemented and not so useful for this driver.
2011-10-08 00:49:34 +02:00
Stéphane Marchesin
b7cd18bc49 i915g: Add two new unsupported PIPE_CAPs. 2011-10-07 15:14:39 -07:00
Chad Versace
53f8586373 i915,i830: Remove dead HiZ assertions in *update_draw_buffer()
i915 and i830 hardware doesn't have HiZ, so remove all HiZ related
assertions from *update_draw_buffer().

I've removed the dead format checks completely rather than replace them
with more appropriate checks. This doesn't reduce "assertion coverage",
however, because when I added these HiZ related assertions in c8fdf66
there were no pre-existing checks there.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:33:51 -07:00
Brian Paul
793d29d6d3 tnl: fix result vector allocation regression
We need to allocate all the output vectors.
Fixes a regression from commit f7f678331d
Fixes fd.o bugs 41441 and 41492.
2011-10-07 10:58:53 -06:00
Brian Paul
cea946307f i965: make swizzle_for_size() return unsigned
Silences a warning about comparing to an unsigned variable.  It looks like
the result of swizzle_for_size() is always assigned to unsigned vars.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
e967c5b38f i965: make size_swizzles[] static const
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
4170227407 i965: silence unused var warnings in non-debug builds
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
13b776ed51 intel: silence uninitialized var warning
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
23c6eb035b mesa: fix software mipmap generation code for packed Z/stencil formats
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=32458

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 09:52:04 -06:00
Brian Paul
9938912ccb r300: fix incompatible pointer type warnings 2011-10-07 08:23:24 -06:00
Brian Paul
8c3b5cf943 mesa: update gl_texture_image comments 2011-10-07 08:23:24 -06:00
Brian Paul
5ac96033c5 swrast: s/FetchTexelf/FetchTexel/ 2011-10-07 08:23:24 -06:00
Brian Paul
26b8dfc8ca swrast: silence unused var warnings in non-debug builds 2011-10-07 08:23:24 -06:00
Brian Paul
ba69c4a002 swrast: remove unused swrast_texture_image::FetchTexelc method
We only use the float-valued function now.
2011-10-07 08:23:24 -06:00
Brian Paul
d7477ad0a3 mesa: fix image unpacking when storing compressed textures
This fixes failures found with the new piglit texsubimage test.

Two things were broken:
1. The dxt code doesn't handle sources images where width != row stride.
   Check for that and take the _mesa_make_temp_ubyte_image() path to get
   an image where width = rowstride.
2. If we don't take the _mesa_make_temp_ubyte_image() path we need to
   take the source image unpacking parameters into account in order to
   get the proper starting memory address of the source texels.

Note: This is a candidate for the 7.11 branch.
2011-10-07 08:14:46 -06:00
Daniel Vetter
530728fb60 i915g: handle seperate stencil clear
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
ce775dc1b6 i915g: actually try to clear 16bit depth bufs
... with the right value.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
661b7ef9a8 i915g: hw can't fastclear both depth and color when bbp doesn't match
Do it in two passes in that case.

v2: Don't forget to handle stencil clears.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
0a6131b15c i915g: disable scissor in fast clear
Docs say this is obeyed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
b8f3381f2c i915g: add some obscure sampler formats
4bit palette ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
8dd523b2df i915g: fixup clear params emission
Docs say that default shader input color input need to be spec
as ARGB8888. And a clear rect prim essentially uses this value
instead of default diffuse. Depth on the other hands is an ieee
32 bit float. Clear stencil is U8.

Completely different are the clear values for zone init prims.
These are speced in the actual output pixel layout (and need
to be repeated for 16 bit formats).

Clear up the confusion by adding some comments.

v2: Retain the target swizzling support added by Stephan Marchesin.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:16 +02:00
Daniel Vetter
305bcda4b5 i915g: make fixup swizzle into a real hw state
This way it can be reused in the fastclear path.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:16 +02:00
Jason Wood
c475a54578 glsl: Remove version check when looking for identifiers containing "__".
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-06 22:39:08 -07:00
Stéphane Marchesin
c2244cfa19 i915g: Announce GL 2.0.
We leave the debug code in place to troubleshoot issues while we complete the transition. That code might be removed after that.
2011-10-06 20:40:49 -07:00
Paul Berry
018ea68d87 i965 Gen6+: De-compact clip planes.
Previously, if the user enabled a non-consecutive set of clip planes
(e.g. 0, 1, and 3), the driver would compact them down to a
consecutive set starting at 0.  This optimization was of dubious
value, and complicated the implementation of gl_ClipDistance.

This patch changes the driver so that with Gen6 and later chipsets, we
no longer compact the clip planes.  However, we still discard any clip
planes beyond the highest number that is in use, so performance should
not be affected for applications that use clip planes consecutively
from 0.

With chipsets previous to Gen6, we still compact the clip planes,
since the pre-Gen6 clipper thread relies on this behavior.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:14 -07:00
Paul Berry
f4f686e825 i965 VS: Change nr_userclip to nr_userclip_planes.
The only remaining uses of brw_vs_prog_key::nr_userclip only occurred
when using clip planes (as opposed to gl_ClipDistance).  This patch
renames the value to nr_userclip_planes and sets it to zero when
gl_ClipDistance is in use.  This avoids unnecessary VS recompiles.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:10 -07:00
Paul Berry
18e2e19b07 i965: Make brw_compute_vue_map's userclip dependency a boolean.
Previously, brw_compute_vue_map required an argument indicating the
number of clip planes in use, but all it did with it was check if it
was nonzero.

This patch changes brw_compute_vue_map to take a boolean instead.
This allows us to avoid some unnecessary recompilation of the Gen4/5
GS and SF threads.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:07 -07:00
Paul Berry
8f6920a7b6 i965: Move ClipPlanesEnabled state to VS cache key.
Previous to this patch, setup_uniform_clipplane_values() was setting
up clip plane uniforms based on ctx->Transform.ClipPlanesEnabled, a
piece of state not stored in the vertex shader cache key.  As a
result, a change to this piece of state might not trigger a necessary
vertex shader recompile.

The patch adds a field to the vertex shader cache key,
userclip_planes_enabled, to store the current value of
ctx->Transform.ClipPlanesEnabled.  Also, it changes
setup_uniform_clipplane_values() to read from this new field, so that
it's manifestly clear that the vertex shader isn't depending on state
not stored in the cache key.

Note: when the vertex shader uses gl_ClipDistance, the VS backend
doesn't need to know which clip planes are in use, so we leave the
field as zero in that case to avoid unnecessary recompiles.

Fixes Piglit test vs-clip-vertex-enables.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:02 -07:00
Paul Berry
a1b37ebe75 i965: Rearrange VS cache key struct.
No functional change.  This patch rearranges the struct
brw_vs_prog_key so that the two fields related to clipping are
together, and documents those fields.  This should make the patches
that follow easier to comprehend, since they add additional
clipping-related fields to this structure.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:28:55 -07:00
Paul Berry
c163072197 mesa: Create _mesa_bitcount_64() to replace i965's brw_count_bits()
The i965 driver already had a function to count bits in a 64-bit uint
(brw_count_bits()), but it was buggy (it only counted the bottom 32
bits) and it was clumsy (it had a strange and broken fallback for
non-GCC-like compilers, which fortunately was never used).  Since Mesa
already has a _mesa_bitcount() function, it seems better to just
create a _mesa_bitcount_64() function rather than special-case this in
the i965 driver.

This patch creates the new _mesa_bitcount_64() function and rewrites
all of the old brw_count_bits() calls to refer to it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:27:33 -07:00
Kenneth Graunke
09fcd01301 mesa/es: Allow GL_CLIP_PLANE0+6 and GL_CLIP_PLANE0+7.
Fixes the ES1 conformance 'userclip' test, which broke when we increased
MAX_CLIP_PLANES to 8.  Core Mesa already validates incoming values
against MAX_CLIP_PLANES; we just need the ES wrapper to pass everything
through.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-06 11:24:11 -07:00
Kenneth Graunke
5785cd2bf5 mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.
It's required for ES 1.0 and 1.1, and isn't specified for ES 2.

While the comment says Mesa depends on it internally, removing it from
ES2 doesn't seem to regress any Piglit or ES2 conformance tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-06 11:24:10 -07:00
Kenneth Graunke
300a4cd9f2 meta: Don't enable TEXTURE_RECTANGLE when it's unsupported.
In particular, drivers don't enable this in ES 1.1 contexts.

Prior to this, none of the OpenGL ES 1.1 conformance tests passed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-06 11:24:10 -07:00
Stéphane Marchesin
9f2c56fbd6 i915g: Silence warning.
We still need to investigate LIS7 though.
2011-10-06 01:02:23 -07:00
Stéphane Marchesin
527235223a i915g: Fix comment. 2011-10-05 22:53:48 -07:00
Brian Paul
0214712c30 mesa: remove some unneeded forward struct declarations 2011-10-05 21:43:43 -06:00
Brian Paul
068fcc029d st/mesa: fix comment 2011-10-05 21:43:21 -06:00
Brian Paul
c80aaad77e mesa: remove unused _mesa_rescale_teximage2d() function
It was only used by the old tdfx driver, IIRC.
2011-10-05 21:14:37 -06:00
Brian Paul
2c5bb57b50 mesa: remove unused gl_texture_image::DriverData field
Was only used by some older/removed DRI drivers.
2011-10-05 21:14:37 -06:00
Brian Paul
cf2439e246 st/mesa: don't use gl_texture_image::RowStride
It's always the same as the texture width.
2011-10-05 21:14:37 -06:00
Brian Paul
aff65241c8 st/mesa: completely stop using gl_texture_image::Data
Instead, use the new st_texture_image::TexData field to hold texture
images that don't fit the parent object's mipmap buffer.
2011-10-05 21:06:48 -06:00
Brian Paul
85f5aa1565 st/mesa: stop using gl_texture_image::Data when mapping/unmapping textures
Since core Mesa no longer depends on gl_texture_image::Data pointing to
mapped texture buffers we don't have to mess with it all over the place
in the state tracker.  Now Data is only used to point to malloc'd memory
that holds images which don't fit in the texture object's mipmap buffer.
2011-10-05 21:06:48 -06:00
Brian Paul
5253cf9805 mesa: get rid of imageOffsets arrays in texstore code
These were used to find the start of a 3D image slice (or 2D array texture
slice) given a base address.  Instead, use a simple array of address of
image slices instead.

This is a step toward getting rid of the gl_texture_image::ImageOffsets
field.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-05 21:06:47 -06:00
Stéphane Marchesin
c3ef232315 st/glx: remove the duplicated Drawable member.
If you want to access it, you should use the Drawable in xlib_drawable instead.
2011-10-05 17:36:32 -07:00
Eric Anholt
684b701c12 glsl: Consider "__" in identifers as reserved.
Fixes double-underscore-*.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-05 12:49:17 -07:00
Brian Paul
bf059ebd33 swrast: update texfetch_funcs table for new int/uint formats
This only adds dummy entries to the table to fix failed assertions.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41491
2011-10-05 13:35:35 -06:00
Paul Berry
d912669034 i965 Gen6: Implement gl_ClipVertex.
This patch implements proper support for gl_ClipVertex by causing the
new VS backend to populate the clip distance VUE slots using
VERT_RESULT_CLIP_VERTEX when appropriate, and by using the
untransformed clip planes in ctx->Transform.EyeUserPlane rather than
the transformed clip planes in ctx->Transform._ClipUserPlane when a
GLSL-based vertex shader is in use.

When not using a GLSL-based vertex shader, we use
ctx->Transform._ClipUserPlane (which is what we used prior to this
patch).  This ensures that clipping is still performed correctly for
fixed function and ARB vertex programs.  A new function,
brw_select_clip_planes() is used to determine whether to use
_ClipUserPlane or EyeUserPlane, so that the logic for making this
decision is shared between the new and old vertex shaders.

Fixes the following Piglit tests on i965 Gen6:
- vs-clip-vertex-const-accept
- vs-clip-vertex-const-reject
- vs-clip-vertex-different-from-position
- vs-clip-vertex-equal-to-position
- vs-clip-vertex-homogeneity
- vs-clip-based-on-position
- vs-clip-based-on-position-homogeneity
- clip-plane-transformation clipvert_pos
- clip-plane-transformation pos_clipvert
- clip-plane-transformation pos

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-05 11:51:00 -07:00
Paul Berry
7d68c639dd mesa: Add a gl_vert_result for gl_ClipVertex.
Before this patch, clip planes didn't work properly in Mesa when using
vertex shaders, because Mesa assigned both gl_ClipVertex and
gl_Position to the same gl_vert_result (VERT_RESULT_HPOS).  As a
result, backends couldn't distinguish between the two variables, so
any shader that wrote different values to them would fail to work
properly.

This patch paves the way for proper support of gl_ClipVertex by
creating a new enumerated value in gl_vert_result for it
(VERT_RESULT_CLIP_VERTEX).  After this patch, a back-end may add
support for gl_ClipVertex using the following algorithm:

- If using a user-supplied GLSL vertex shader:
  - If the bit corresponding to VERT_RESULT_CLIP_VERTEX is set in
    gl_program::OutputsWritten:
    - Clip using the vertex shader output VERT_RESULT_CLIP_VERTEX and
      the clip planes defined in gl_context::Transform.EyeUserPlane.
  - Else:
    - Clip using the vertex shader output VERT_RESULT_HPOS and the
      clip planes defined in gl_context::Transform.EyeUserPlane.
- Else (either using fixed function or an ARB vertex program):
  - Clip using the vertex shader output VERT_RESULT_HPOS and the clip
    planes defined in gl_context::Transform._ClipUserPlane (*)

where (*) represents the normal Mesa behavior before this patch.

An example of implementing the above algorithm can be found in the
patch that follows this one, which implements gl_ClipVertex in i965
Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-05 11:50:21 -07:00
José Fonseca
e2072a1046 llvmpipe: Fix the 4 planes (lines) case properly.
The previous change was not effective for lines, because there is no
4 planes 4x4 block rasterization path: it is handled by the 16x16 block
case too, and the 16x16 block was not being budged as it should.

This fixes assertion failures on line rasterization.
2011-10-05 18:07:05 +01:00
José Fonseca
c620087432 llvmpipe: Ensure the 16x16 special rasterization path does not touch outside the tile.
llvmpipe has a few special rasterization paths for triangles contained in
16x16 blocks, but it allows the 16x16 block to be aligned only to a 4x4
grid.

Some 16x16 blocks could actually intersect the tile
if the triangle is 16 pixels in one dimension but 4 in the other, causing
a buffer overflow.

The fix consists of budging the 16x16 blocks back inside the tile.
2011-10-05 18:07:05 +01:00
Dave Airlie
9c697a9d00 mesa: update fbo format tablet for integer types.
This updates the fbo format table for the integer types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:44:39 +01:00
Dave Airlie
38db7ae7fa mesa/texstore: add texstore paths for all the integer types.
This just adds the entries to the table and fixes the asserts up.

The int32 one is definitely wrong, since it uses a float temp
which will lose precision, but its no worse than now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:44:36 +01:00
Dave Airlie
56a7111893 mesa/texformat: update choose_tex_format for integer types.
This adds the integer types to the tex format chooser.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:44:25 +01:00
Dave Airlie
7a41291c3a mesa/formats: add rest of integer formats.
This is taken from reading EXT_texture_integer + EXT_texture_rg in combination,

Comments on necessity of each format, naming of formats and bugs in the
formats tables please.

Is there any formats I've missed?

Eric looked over this to make sure its consistent at least.

As I've changed the ordering of things in the format table, the follow
patches are required to avoid regression.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:43:40 +01:00
Dave Airlie
6e1681a2c9 texstore: create texstore table on first access.
As per Brian's suggestion we can generate this table at first start
to make sure its correct. This is a sad workaround for compilers which
don't support named initialiser. (its 2011).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:18:17 +01:00
Stéphane Marchesin
af962e1183 glsl: Remove unneeded headers. 2011-10-04 18:03:22 -07:00
Brian Paul
041ff4c731 egl: restore missing \ in Makefile 2011-10-04 16:54:08 -06:00
Paul Berry
56a90f5ce1 r200/r300/r600: remove dangling radeon_tex_getimage.c symlinks.
Commit d1fda903 (radeon: Drop mapping we were doing around
glGetTexImage()) removed the common Radeon source file
radeon_tex_getimage.c, and pulled it out of the r200, r300, r600, and
radeon makefiles.  But it left behind the symlinks that were being
used to share that file among the four directories.

This patch removes the dangling symlinks.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 15:28:56 -07:00
Kenneth Graunke
d38839a498 glapi: Enclose glapi.h in an extern "C" block when included by C++.
Fixes a build failure introduced in commit
b7fa0d0727.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Paul Berry <stereotype441@gmail.com>
2011-10-04 15:11:42 -07:00
Brian Paul
6399b7d638 scons: add new files to src/mesa/SConscript 2011-10-04 15:59:09 -06:00
Brian Paul
a5f2010735 softpipe: fix Z interpolation invariance bug
We want quad/pixel Z values to be interpolated exactly the same for
multi-pass algorithms.  Because of how the optimized Z-test code is
written, we can't cull the first quad in a run even if it's totally
killed.  See the comment for more info.

NOTE: This is a candidate for the 7.11 branch.
2011-10-04 15:04:42 -06:00
Brian Paul
334a9dd3e6 softpipe: add check for DO_PSTIPPLE_IN_HELPER_MODULE
We only want to generate the fragment shader variant that does
stippling if DO_PSTIPPLE_IN_HELPER_MODULE is being used.
2011-10-04 15:04:41 -06:00
Ian Romanick
35613afee3 mesa: Remove unused gl_program::Attributes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:48 -07:00
Ian Romanick
24409ba196 mesa: Determine GL_ACTIVE_ATTRIBUTE_MAX_LENGTH by walking the GLSL IR.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:48 -07:00
Ian Romanick
c097c63aa8 mesa: Determine GL_ACTIVE_ATTRIBUTES by walking the GLSL IR.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:47 -07:00
Ian Romanick
a339ee8d85 mesa: Remove unused gl_shader_program::Attributes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:47 -07:00
Ian Romanick
84d71a07bb mesa: Make _mesa_GetActiveAttribARB use the attributes in the shader IR
Instead of relying on the mirror in the Mesa IR assembly shader, just
use the variables actually stored in the GLSL IR.  This will be a bit
slower, but nobody cares about the performance of glGetActiveAttrib.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:47 -07:00
Ian Romanick
7a80c1bbc5 mesa: Move _mesa_GetActiveAttribARB to shader_query.cpp
This just folds get_active_attrib into _mesa_GetActiveAttribARB
and moves the resulting function function to the other source file.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
523b611646 linker: Use gl_shader_program::AttributeBindings for attrib locations
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
015d4f61ef mesa: Add gl_shader_program::AttributeBindings
This currently mirrors the state tracking
gl_shader_program::Attributes, but I'm working towards eliminating
that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
2fd80534f0 mesa: Move _mesa_BindAttribLocationARB to shader_query.cpp
This just folds bind_attrib_location into _mesa_BindAttribLocationARB
and moves the resulting function function to the other source file.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
3ea297bdc4 mesa: Add string_to_uint_map facade class
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-10-04 13:17:09 -07:00
Ian Romanick
acd834fde2 mesa: Add hash_table_replace
hash_table_replace doesn't use get_node to avoid having to hash the key twice.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 12:33:28 -07:00
Ian Romanick
b7fa0d0727 mesa: Move _mesa_GetAttribLocationARB to shader_query.cpp
This allows querying the linked shader itself rather than the Mesa IR.
This is the first step towards removing gl_program::Attributes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 12:33:28 -07:00
Ian Romanick
7bbcc0b832 glsl: Delete symbol table in post-link shaders
The symbol table in the linked shaders may contain references to
variables that were removed (e.g., unused uniforms).  Since it may
contain junk, there is no possible valid use.  Delete it and set the
pointer to NULL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 12:33:28 -07:00
Ian Romanick
efd027a8b5 glapi: regen API files for new extension
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-04 12:25:58 -07:00
Ian Romanick
763b00f2c5 mesa: Remove ARB_draw_buffers extension enable flag
All drivers in Mesa have supported this extension for eons.  This
extension is an optional features in desktop OpenGL (via
GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers).

The extension is not usable in OpenGL ES 1.x.  There is no
glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v
generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:58 -07:00
Ian Romanick
a92f02d04a mesa: Advertise NV_fbo_color_attachments on OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
cb016bbb1d mesa: Advertise NV_draw_buffers in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
f708166aad mesa/es: Allow querying GL_DRAW_BUFFERi in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
e0d5cb0f4f mesa/es: Allow querying GL_MAX_COLOR_ATTACHMENTS in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
2e3a4ab818 mesa/es: Allow other color attachments in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
43251b970d mesa/es: Make glDrawBuffersNV available in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
188123ca06 glapi: Add entry point for NV_draw_buffers
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
b2f23438a2 glapi: Move ARB_draw_buffers extension to a separate file
This also moves ATI_draw_buffers.  This is to facilitate enabling
NV_draw_buffers in OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Ian Romanick
accf293a33 mesa/es: Remove redundant renderbuffer target validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Ian Romanick
6dd8e76869 mesa/es: Validate FBO target enum in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Ian Romanick
7e4cb32d05 mesa/es: Validate FBO attachment enum in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Stéphane Marchesin
3db309aece configure: replace pkg-config calls with $(PKG_CONFIG) in the makefiles.
Us poor souls who cross compile mesa want to be able to specify which pkg-config to pick, or at least just change one place.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2011-10-04 11:19:48 -07:00
Stephen White
cd9627777c st/glx: Set the drawable attribute on xmesa_buffer creation.
Otherwise we'll be unable to use our pbuffers.
2011-10-04 11:19:45 -07:00
Marek Olšák
5506f6ef96 r300g: fix rendering with a non-zero index bias in draw_elements_immediate
NOTE: This is a candidate for the stable branches.
2011-10-04 17:45:53 +02:00
Guillem Jover
8fd39be383 docs: Update references to README files
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-04 07:49:04 -06:00
Guillem Jover
963727aec7 Remove remnants of legacy glide support
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-04 07:48:50 -06:00
Guillem Jover
0060551856 Ignore all shared objects
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-04 07:48:45 -06:00
Marek Olšák
024ac93e60 r600g: fix parsing TGSI declarations
It was a lucky coincidence that it worked.
2011-10-04 04:22:22 +02:00
Brian Paul
5f4f07f4ea nouveau: remove unused code, unused var 2011-10-03 18:20:59 -06:00
Brian Paul
c8e6565280 i915: don't include texstore.h 2011-10-03 18:20:59 -06:00
Brian Paul
d646d06929 i965: remove unneeded includes of texstore.h 2011-10-03 18:20:59 -06:00
Brian Paul
9119269ca1 swrast: fix delayed texel buffer allocation regression
Commit 617cdcd4c7 delayed the texel
buffer allocation until texture_combine() is called.  But the
texel buffer is needed sooner in _swrast_texture_span() at line 649.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41433
2011-10-03 17:51:06 -06:00
Brian Paul
6a04fa9cd4 mesa: fix warning (MSVC error) about void pointer arithmetic 2011-10-03 17:37:04 -06:00
Eric Anholt
669f1822d2 i965: Add support for GL_EXT_texture_array and GL_MESA_texture_array. 2011-10-03 13:29:38 -07:00
Eric Anholt
82691574b6 intel: Add a safety check for mapping 1D texture arrays.
So easy to screw up with the crazy way GL manages them.
2011-10-03 13:29:38 -07:00
Eric Anholt
cb86560ddb intel: Add debug output to intel_map_texture_image. 2011-10-03 13:29:38 -07:00
Eric Anholt
fd99cd0e10 intel: Add a helper function for getting miptree size from a texture image.
With 1D array textures, we no longer agree between the GL information
about width/height/depth of a texture and how we lay out a miptree.
2011-10-03 13:29:38 -07:00
Eric Anholt
2e0aefc1b9 i965: Refactor out the cube map setup for general texture array setup.
This is just moving the code out with s/6/slices/.
2011-10-03 13:29:38 -07:00
Eric Anholt
372cf26698 mesa: Reuse existing make_2d_mipmap for 2D array generation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
6fc576fd8a mesa: Make the uncompressed sw mipmap gen path do a Map per 1D array slice.
This also fixes what was probably a bug in 1D arrays with border.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
229ebf511d mesa: When storing texture data for a 1D array, map each slice separately.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
5324f9c48d swrast: When asked to map a slice of a 1D array, give back that slice.
Until now, we've been treating 1D arrays as a single slice, and each
array slice is actually just a row of the 2D texture.  While swrast
still stores them this way, hardware drivers think that 1D arrays have
actual separate slices not stored as contiguous rows.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
b07c78bfe9 intel: Consolidate texture validation copy code, and reuse it correctly.
The path for ->Data was failing to be called for the FBO draw offset
fallback, and also had mismatched compressed texture support code.

This drops the intel_prepare_render() in the blit path.  We aren't
copying to/from a GL_FRONT buffer, so it doesn't matter.
2011-10-03 13:29:38 -07:00
Eric Anholt
055995abc4 intel: Clean up the function chain for mapping texture images for swrast.
Too many separate functions each called from one location (in
different files).  This code should all die soon when swrast starts
using MapTextureImage.
2011-10-03 13:29:38 -07:00
Eric Anholt
9aff2944a4 intel: Make PBO TexImage use AllocTextureImageBuffer like non-PBO does.
Now that whole block that also lives in AllocTextureImageBuffer can go
away.
2011-10-03 13:29:37 -07:00
Eric Anholt
18198e299b intel: Rely on Mesa core for glTexImage storage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:37 -07:00
Eric Anholt
a73d56dce3 intel: Allocate s8z24 separate renderbuffers from AllocTextureImageBuffer().
Before, we were only allocating these from our TexImage, so if the
texture image was set up in any other way (non-accelerated
glGenerateMipmaps()), they'd be missing or wrong.
2011-10-03 13:29:37 -07:00
Eric Anholt
e928c34d3e intel: Add an AllocTextureImageBuffer() implementation using miptrees.
Now we can rely on Mesa core for uploads of data without introducing
an extra copy at validate time.
2011-10-03 13:29:37 -07:00
Brian Paul
e0304180c3 mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.
Now that we can zero-copy generate the mipmaps into brand new
glTexImage()-generated storage using MapTextureImage(), we no longer
need to allocate image->Data in mipmap generate.  This requires
deleting the drivers' old overrides of the miptree tracking after
calling _mesa_generate_mipmap at the same time, or the drivers
promptly lose our newly-generated data.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-03 13:29:30 -07:00
Kenneth Graunke
1165b64f56 i965: Stop lowering integer division to multiply and reciprocal.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:21 -07:00
Kenneth Graunke
b9af592dfa i965: Reverse the operands for INT DIV prior to Gen6.
Apparently on Gen4 and 5, the denominator comes first.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:12 -07:00
Kenneth Graunke
1d4f3ca8f0 i965/vs: Implement integer quotient and remainder math operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:11 -07:00
Kenneth Graunke
ff8f272b0d i965/fs: Implement integer quotient and remainder math operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:09 -07:00
Kenneth Graunke
6960f786c8 i965: Set the signed/unsigned type bit in Gen4/5 math messages.
It never mattered before since we only did floating point math.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:07 -07:00
Kenneth Graunke
6b10aab2bb i965: Fix message and response length calculations for INT DIV.
Both POW and INT DIV need a message length of 2; previously, we only
checked for POW.

Also, BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER has a response
length of 2; previously, we only checked for SINCOS.  We don't use this
message, but in case we ever decide to, we may as well fix it now.

While we're at it, just move these computations into
brw_set_math_message, since they're entirely based on the function.
This fixes it for both brw_math and the old backend's brw_math_16.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:04 -07:00
Kenneth Graunke
ee2bf3a4b6 i965: Fix assertions about register types for INT DIV in brw_math.
BRW_MATH_FUNCTION_REMAINDER was missing.  Also, it seems worthwhile to
assert that INT DIV's arguments are signed/unsigned integers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:02 -07:00
Kenneth Graunke
e66fc1cb03 ir_to_mesa: Don't assertion fail on integer modulus.
Drivers implementing GLSL 1.30 want to do integer modulus, and until we
can stop generating code via ir_to_mesa, it's easier to make it silently
generate rubbish code.  Multiply will do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:00:00 -07:00
Tom Stellard
d64c6d2ffc r300/compiler: Fix error in OMOD optimization
Classic compiler mistake.  In the example below, the OMOD optimization
was combining instructions 4 and 10, but since there was an instruction
(#8) in between them that wrote to the same registers as instruction 10,
instruction 11 was reading the wrong value.

Example of the mistake:

Before OMOD:
4: MAD temp[0].y, temp[3]._y__, const[0]._x__, const[0]._y__;
...
8: ADD temp[2].x, temp[1].x___, -temp[4].x___;
...
10: MUL temp[2].x, const[1].y___, temp[0].y___;
11: FRC temp[5].x, temp[2].x___;

After OMOD:
4: MAD temp[2].x / 8, temp[3]._y__, const[0]._x__, const[0]._y__;
...
8: ADD temp[2].x, temp[1].x___, -temp[4].x___;
...
11: FRC temp[5].x, temp[2].x___;

https://bugs.freedesktop.org/show_bug.cgi?id=41367
2011-10-02 15:21:15 -07:00
Tom Stellard
13814b0103 r300/compiler: Rewrite source swizzles when using OMOD 2011-10-02 15:21:15 -07:00
Tom Stellard
8b0418e478 r300/compiler: Fix rc_normal_rewrite_writemask()
This function had not been updated to use conversion swizzles.
2011-10-02 15:21:15 -07:00
Tom Stellard
b5ecf5ba46 r300/compiler: Use consistent src swizzles for transcendent instructions
Source swizzles for transcendent instructions were being stored in the X
channel regardless of what channel the instruction was writing.
This was causing problems for some helper functions that were expecting
source swizzles to occupy channels corresponding to the instruction's
writemask.  This commit makes transcendent instructions follow the same
convention as normal instructions for representing source swizzles.

Previous behavior:
LG2 temp[0].y, input[0].x___;

Current behavior:
LG2 temp[0].y, input[0]._x__;
2011-10-02 15:21:15 -07:00
Eric Anholt
e7c2b711a3 mesa: Respect GL_RASTERIZER_DISCARD for various meta-type operations.
From the EXT_transform_feedback spec:

    Primitives can be optionally discarded before rasterization by calling
    Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, primitives
    are discared right before the rasterization stage, but after the optional
    transform feedback stage. When disabled, primitives are passed through to
    the rasterization stage to be processed normally. RASTERIZER_DISCARD_EXT
    applies to the DrawPixels, CopyPixels, Bitmap, Clear and Accum commands as
    well.

And the GL 3.2 spec says it applies to ClearBuffer* as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-01 22:16:07 -07:00
Eric Anholt
3a1ba094f4 mesa: Add missing glGetIntegerv() support for ARB_color_buffer_float tokens.
Fixes piglit ARB_color_buffer_float/api-get

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 22:16:07 -07:00
Eric Anholt
42769c2da5 Revert "vbo: Don't discount stride == 0 for testing all varyings in VBOs."
This reverts commit d631c19db4.

The commit was broken, and ended up returning false all the time
because nobody in the world binds every single possible vertex array.
On further reflection, we don't want to discount stride == 0: This
function is just used for deciding to calculate whether to compute the
bonuds on the index, and there's no sense in computing index bounds
when stride == 0.

For the separate question of "how much data do I upload for this
vertex element?", the i965 driver was fixed to upload the data.

Fixes a regression of about 2x in 3DMMES, and most importantly, makes
Hammerfight playable.
2011-10-01 22:16:07 -07:00
Eric Anholt
ddc348d83e i965: Make sure to upload the data for a collection of Stride == 0 arrays.
Commit d631c19db4 avoided this problem
by forcing the driver to get the min/max index, but that commit was
broken, so just fix the driver problem (confusion between "do I need
to upload any data?" and "do I need the index bounds in order to
upload any data?").
2011-10-01 22:16:07 -07:00
Eric Anholt
617cdcd4c7 mesa: Delay s_texcombine.c memory allocation until it's used.
Generally we're using fragment programs in all our drivers, so wasting
4MB for code that's never called is pretty lame.  Reduces i965 memory
allocation for a short shader program from 21,932,128B to 17,737,816B.
2011-10-01 22:16:06 -07:00
Eric Anholt
f7f678331d tnl: Delay results allocation until we actually need them.
Decreases i965 peak memory allocation for a trivial shader program
from 23,483,048B to 21,932,128B, since we never actually use tnl for
rendering.
2011-10-01 22:16:06 -07:00
Ian Romanick
fe006a74f6 i965/vs: Fix swizzle related assertion
As innocuous as it seemed, ebca47a basically broke the world (e.g.,
>200 piglit regressions).  In vec4_visitor::emit_block_move,
src->swizzle was expected to be BRW_SWIZZLE_NOOP before setting it to
a swizzle that would replicate the existing channels of the source
type to a vec4 (e.g., .xyyy for a vec2).

The original assertion seems to have been a little bogus.  In addition
to being BRW_SWIZZLE_NOOP, src->swizzle might already be a swizzle
that would replicate the existing channels of the source type to a
vec4.  In other words, it might already have the value that we're
about to assign to it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-01 22:16:06 -07:00
Brian Paul
dd9574d7a5 mesa: number of combiner terms to pop depends on GL_NV_texture_env_combine4
If GL_NV_texture_env_combine4 is not supported, setting the fourth
combiner term would generate a GL error.
Of course, I noticed this right after committing the previous patch
to use a loop in the first place.  <sigh>

Note that GL_EXT_texture_env_combine is always supported so the first
three combiner terms are always accepted.
2011-10-01 08:29:34 -06:00
Brian Paul
9520f483b8 mesa: s/INLINE/inline/
INLINE is still seen in some files (some generated files, etc) but this
is a good start.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:16:36 -06:00
Brian Paul
c707ffa587 r600: include version.h for _mesa_override_glsl_version() prototype
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:16:00 -06:00
Brian Paul
b15ab1d228 mesa: use !! to simplify some _mesa_set_enable() calls in attrib.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:15:47 -06:00
Brian Paul
986a9bb180 mesa: use loop in pop_texture_group() to restore 4 combiner terms
There's four combiner terms (not 3) with GL_NV_texture_env_combine4.
Use a loop to make the code a little more compact.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:15:28 -06:00
Ian Romanick
1f8f8aef7f mesa: Refactor hash_table_{find,remove} to share some code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Ian Romanick
16f7bdf555 mesa: Document an odd side-effect of hash_table_insert
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Ian Romanick
cd76f114e6 mesa: Remove unused field gl_program::Varying
Lots of things set and copy this field around, but nothing uses it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Ian Romanick
a9f25160af mesa: Use Add linker_error instead of fail_link
See also 8aadd89.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Marek Olšák
aae342cff0 r600g: fix a compiler warning 2011-09-30 23:20:27 +02:00
Marek Olšák
74d6f929b4 gallium/docs: update the documentation of capabilities
Still like 13 caps are undocumented.
2011-09-30 23:20:21 +02:00
Marek Olšák
bf0baa7717 r600g: move all files from winsys/r600 into drivers/r600
Be sure to reconfigure after this commit.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
363ff84475 winsys/radeon: move GEM domains out of the drivers into winsys
The drivers don't need to care about the domains. All they need to set
are the bind and usage flags. This simplifies the winsys too.

This also fixes on r600g:
- fbo-depth-GL_DEPTH_COMPONENT32F-copypixels
- fbo-depth-GL_DEPTH_COMPONENT16-copypixels
- fbo-depth-GL_DEPTH_COMPONENT24-copypixels
- fbo-depth-GL_DEPTH_COMPONENT32-copypixels
- fbo-depth-GL_DEPTH24_STENCIL8-copypixels
I can't explain it.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
af8eb5c851 winsys/radeon: remove a redundant parameter 'size' from buffer_from_handle
It's part of pb_buffer already.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
90ce3cdde9 r600g: remove struct radeon (or what's left of it)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
518557d74a r600g: move family and chip_class from struct radeon to r600_screen
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
6101b6d442 r600g: merge r600_bo with r600_resource
I have moved 'last_flush' and 'binding' from r600_bo to winsys/radeon.
The other members are now part of r600_resource.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
ba89086e79 gallium: add PIPE_CAP_TEXTURE_BARRIER
Same issue as with conditional_render.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
3d13b081c7 gallium: add PIPE_CAP_CONDITIONAL_RENDER
We were checking whether render_condition is set. That was not reliable,
because it's always set with trace and noop regardless of driver support.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
f5bfe54a34 gallium: add and use PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS
This removes:
- PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS
- PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS
in favor of the that new per-shader cap.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
557c3febdf gallium: remove PIPE_CAP_TEXTURE_MIRROR_REPEAT
All drivers support it (well, except Cell). The boolean option is going away
from core Mesa too.

This is a follow-up to Ian Romanick's patch
"mesa: Remove ARB_texture_mirrored_repeat extension enable flag".

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Chris Wilson
67582e6eef i915: out-of-bounds write in calc_live_regs()
From a Coverity defect report.

src/mesa/drivers/dri/i915/i915_fragprog.c
   301  /*
   302   * TODO: consider moving this into core
   303   */
   304  static bool calc_live_regs( struct i915_fragment_program *p )
   305  {
   306      const struct gl_fragment_program *program = &p->FragProg;
   307      GLuint regsUsed = 0xffff0000;
-> 308      uint8_t live_components[16] = { 0, };
   309      GLint i;
   310
   311      for (i = program->Base.NumInstructions - 1; i >= 0; i--) {
   312          struct prog_instruction *inst =
&program->Base.Instructions[i];
   313          int opArgs = _mesa_num_inst_src_regs(inst->Opcode);
   314          int a;
   315
   316          /* Register is written to: unmark as live for this and
preceeding ops */
   317          if (inst->DstReg.File == PROGRAM_TEMPORARY) {
-> 318              if (inst->DstReg.Index > 16)
   319                 return false;
   320
-> 321              live_components[inst->DstReg.Index] &= ~inst->DstReg.WriteMask;
   322              if (live_components[inst->DstReg.Index] == 0)
   323                  regsUsed &= ~(1 << inst->DstReg.Index);
   324          }
   325
   326          for (a = 0; a < opArgs; a++) {
   327              /* Register is read from: mark as live for this and preceeding ops */
   328              if (inst->SrcReg[a].File == PROGRAM_TEMPORARY) {
   329                  unsigned c;
   330
   331                  if (inst->SrcReg[a].Index > 16)
   332                     return false;
   333
   334                  regsUsed |= 1 << inst->SrcReg[a].Index;
   335
   336                  for (c = 0; c < 4; c++) {
   337                      const unsigned field = GET_SWZ(inst->SrcReg[a].Swizzle, c);
   338
   339                      if (field <= SWIZZLE_W)
   340                          live_components[inst->SrcReg[a].Index] |= (1U << field);
   341                  }
   342              }
   343          }
   344
   345          p->usedRegs[i] = regsUsed;
   346      }

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40022
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 22:12:45 +01:00
Chris Wilson
ebca47af85 i965: Assign instead of compare inside assert
This is from a Coverity defect report.

src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
  1314  void
  1315  vec4_visitor::emit_block_move(dst_reg *dst, src_reg *src,
  1316                                const struct glsl_type *type, bool
predicated)
...
  1351     /* Do we need to worry about swizzling a swizzle? */
->1352     assert(src->swizzle = BRW_SWIZZLE_NOOP);
  1353     src->swizzle = swizzle_for_size(type->vector_elements);

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40158
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 22:00:05 +01:00
Chris Wilson
8ccbcda5c6 i965/gen6: Fix assign instead of compare in assert
This is from a Coverity defect report.

src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
   268  static void
   269  check_gen6_math_src_arg(struct brw_reg src)
   270  {
   271     /* Source swizzles are ignored. */
   272     assert(!src.abs);
   273     assert(!src.negate);
-> 274     assert(src.dw1.bits.swizzle = BRW_SWIZZLE_XYZW);
   275  }

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40214
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 21:49:29 +01:00
Carl Worth
201485bae0 glcpp: Add a test for #elif with an undefined macro.
As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to "defined"). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:

	#ifndef MAYBE_UNDEFINED
	#elif MAYBE_UNDEFINED < 5
	...
	#endif

So this test case is working as expected already. We add it here just
to improve test coverage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:21 -07:00
Carl Worth
c4aaf7943c glcpp: Raise error if defining any macro containing two consecutive underscores
The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.

Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.

This also fixes the following two piglit tests:

	spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
	spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:16 -07:00
Carl Worth
28842c2331 glcpp: Implement token pasting for non-function-like macros
This is as simple as abstracting one existing block of code into a
function call and then adding a single call to that function for the
case of a non-function-like macro.

This fixes the recently-added 097-paste-with-non-function-macro test
as well as the following piglit tests:

	spec/glsl-1.30/preprocessor/concat/concat-01.frag
	spec/glsl-1.30/preprocessor/concat/concat-02.frag

Also, the concat-04.frag test now passes for the right reason. The
test is intended to fail the compilation, but before this commit it
was failing compilation (and hence passing the test) for the wrong
reason.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:10 -07:00
Carl Worth
7bb3403e01 glcpp: Test a non-function-like macro using the token paste operator
Apparently we never implemented this, (but we've got a GLSL 1.30 test
in piglit that is exercising this case).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:04 -07:00
Carl Worth
3c01a58944 glcpp: Fix two (or more) successive applications of token pasting
There was already a loop here to look for multiple token pastes, but
it was mistakenly incrementing the iterator counter after performing
one paste.

Instead, leave the loop iterator in place to coalesce as many tokens
as necessary into one.

This fixes the recently add 096-paste-twice test as well as the
following piglit test:

	spec/glsl-1.30/preprocessor/concat/concat-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:43:59 -07:00
Carl Worth
8e6b99e7b1 glcpp: Add a test for a macro that implements token pasting twice.
This is something that piglit is exercising that currently fails.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:43:40 -07:00
Chad Versace
9c72b729f3 mesa: Remove unused tnl items from dd_functions
Remove NeedValidate and ValidateTnlModule.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-30 11:15:46 -07:00
Brian Paul
a8ca786ba6 meta: fix GetTexImage() for luminance, l/a, intensity formats
The GL spec says that luminance values are returned as (l, 0, 0, 1),
L/A values as (l, 0, 0, a) and intensity values as (i, 0, 0, 1).
Use the pixel transfer scale controls to implement that.
This fixes a few failures in the new piglit getteximage-formats
test when getting a compressed L or L/A image.
2011-09-30 08:16:34 -06:00
Brian Paul
57169c4694 mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()
If color material mode is enabled, constant buffer entries related
to the material coefficients will depend on glColor.  So add
_NEW_CURRENT_ATTRIB to the bitset returned for material-related
constants in _mesa_program_state_flags().

This fixes a bug exercised by the new piglit draw-arrays-colormaterial
test.

Note: This is a candidate for the 7.11 branch.
2011-09-30 08:16:21 -06:00
Brian Paul
4e6bb0774f st/mesa: implement AllocTextureImageBuffer() driver hook
This hasn't been needed so far since none of the core Mesa code paths
that call ctx->Driver.AllocTextureImageBuffer() are used with the
state tracker.  That will change in upcoming patches.
Note that this function duplicates some code seen in the st_TexImage()
function.  That can be cleaned up later.
2011-09-30 08:15:30 -06:00
Brian Paul
4368a65767 mesa: simplify parameters to GetTexImage() driver hook
The target, level and texObj can be obtained through the texImage
parameter.  We could make similar changes for the TexImage() hooks too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-30 08:15:30 -06:00
Thomas Hellstrom
d742a64909 xorg/vmwgfx: Kill this target. It's not used anymore.
This fixes a build error introduced with commit
"winsys/svga: Update to vmwgfx kernel module 2.1"
if both the svga driver and the xorg state tracker was enabled
at the same time.

If needed we can re-add a minimal target for basic functionality.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-30 09:30:59 +02:00
Brian Paul
e4394fb19f intel: include version.h to get _mesa_override_glsl_version() prototype 2011-09-29 16:29:30 -06:00
Simon Farnsworth
c6f9d80ad2 gallium: Set renderbuffer's InternalFormat when rendering to texture
When an FBO is rendering to a texture (rather than a renderbuffer),
Gallium sets up an internal renderbuffer to handle the rendering, and
copies over enough texture state to make this work.

InternalFormat was missed out, causing glTexCopyImage to take a slow
path unnecessarily.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41263

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-29 13:46:48 -06:00
Thomas Hellstrom
e7843273fa winsys/svga: Update to vmwgfx kernel module 2.1
Introduces fence objecs and a size limit on query buffers.
The possibility to map the fifo from user-space is gone, and
replaced by an ioctl that reads the 3D capabilities.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecranz <jakob@vmware.com>
2011-09-29 20:24:57 +02:00
Thomas Hellstrom
e63f2787b6 st/xa: Don't call fence_reference with an unitialized fence handle as dst
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-29 20:24:57 +02:00
Thomas Hellstrom
5ec01ba7e8 st/xa: surfaces and sampler views are per context
Don't store references to these on the surface but on the context.
References to transfers are still stored on the surface since we allow
only a single map of a surface at a time.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-29 20:24:57 +02:00
Ian Romanick
ed48df8424 mesa: Remove ARB_texture_mirrored_repeat extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on mach64, mga, and savage
(Savage3D and other pre-Savage4).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:41:04 -07:00
Ian Romanick
b0824bd860 mesa: Remove EXT_blend_subtract extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on i810, mach64, mga,
savage, sis, and tdfx (Voodoo Banshee and Voodoo3).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:41:01 -07:00
Ian Romanick
1d5e49bf05 mesa: Remove EXT_stencil_wrap extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on mach64.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:58 -07:00
Ian Romanick
f9a2352c95 mesa: Remove EXT_texture_lod_bias extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on mach64, mga, or r128.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:55 -07:00
Ian Romanick
bde8bd99b6 mesa: Remove EXT_texture_env_combine extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.  The existing support is already partially
broken in Mesa (e.g., querying GL_TEXTURE_ENV_MODE in OpenGL ES 2.x).
This patch does not change the situation in any way.

It looks like the only hardware supported by Mesa that cannot do
ARB_texture_env_combine is pre-NV10 NVIDA chips.  It appears that
these chips cannot do the GL_SUBTRACT mode.  Based on looking at older
copies of nvOpenGLspecs.pdf found on the net, NVIDIA never supported
ARB_texture_env_combine on those chips either.

This extension was previously not supported on mach64, mga (G200),
r128, savage, sis, and tdfx (Voodoo Banshee and Voodoo3).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:51 -07:00
Ian Romanick
5c4f914f9a mesa: Remove EXT_texture_env_add extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.  The existing support is already partially
broken in Mesa (e.g., querying GL_TEXTURE_ENV_MODE in OpenGL ES 2.x).
This patch does not change the situation in any way.

This extension was previously not supported on mach64, mga (G200),
savage (Savage3D and other pre-Savage4), sis, and tdfx (Voodoo
Banshee).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:47 -07:00
Ian Romanick
677743f7d5 mesa: Remove ARB_multitexture extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.  The existing support is already partially
broken in Mesa (e.g., querying GL_CLIENT_ACTIVE_TEXTURE in OpenGL ES
2.x).  This patch does not change the situation in any way.

This extension was previously not supported on i810, mga (G200), or
tdfx (Voodoo Banshee).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:39 -07:00
José Fonseca
1da1044344 llvmpipe: Convert some of the null checks back to asserts.
This turns some of the null check warnings in commit
023ca40d80 back to asserts, as
the underlying cause of fdo bug 40591 should be fixed now.
2011-09-29 17:44:06 +01:00
José Fonseca
8d647247e2 llvmpipe: Also reset the state in lp_scene_bin_reset
Prevents segfaults when a opaque tile is found without state change.
2011-09-29 17:43:39 +01:00
José Fonseca
b8d1242c0b llvmpipe: Prevent segfault during fs variant cache shrinking. 2011-09-29 17:43:38 +01:00
José Fonseca
47ff3f7cc5 tools/trace: Dump NULL literally.
Instead of None.
2011-09-29 17:43:36 +01:00
Brian Paul
1a867385d5 st/mesa: remove some old GetTexImage() code
We can use the core Mesa code for glGetTexImage() since it handles the
image mapping/unmapping now.  We'll keep the decompress_with_blit() path
in the hope that it's faster than core Mesa's software decompression code.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41312
2011-09-29 09:18:24 -06:00
Marek Olšák
a3cd2c6c9b winsys/radeon: remove redundant member radeon_bo::size
It's part of pb_buffer already.
2011-09-29 01:10:18 +02:00
Marek Olšák
798ebc91eb winsys/radeon: simplify updating GEM domains for relocations 2011-09-29 01:10:12 +02:00
Marek Olšák
bfa51dfeac winsys/radeon: simplify passing GEM domains through to GEM_CREATE 2011-09-29 01:10:07 +02:00
Marek Olšák
7b42ed6eb5 r300g: remove useless variables in some structures 2011-09-29 01:09:58 +02:00
Marek Olšák
b2e6ca8ec7 r300g: simplify the immd_is_good_idea function 2011-09-29 01:09:53 +02:00
Marek Olšák
3c79962378 configure.ac: unduplicate gallium directories
It may happen when two drivers share one winsys.
2011-09-29 01:09:35 +02:00
Marek Olšák
4b1e7cf5d9 r600g: convert if (query->type) into switch statements 2011-09-29 01:07:30 +02:00
Marek Olšák
f9ed713158 gallium/docs: update d3d11ddi.txt 2011-09-29 01:06:43 +02:00
Marek Olšák
163761f128 st/mesa: don't compute index buffer bounds for per-instance data 2011-09-29 01:03:36 +02:00
Paul Berry
9c75527299 glsl 1.30: Fix numerical instabilities in asinh
The formula we were previously using for asinh:

    asinh x = ln(x + sqrt(x * x + 1))

is numerically unstable: when x is a large negative value, the quantity

    x + sqrt(x * x + 1)

is a small positive value (on the order of 1/(2|x|)).  Since the
logarithm function is very sensitive in this range, any error in the
computation of the square root manifests as a large error in the
result.

This patch changes to the equivalent formula:

    asinh x = sign(x) * ln(abs(x) + sqrt(x * x + 1))

which is only slightly more expensive to compute, and is numerically
stable for all x.

Fixes piglit tests
spec/glsl-1.30/execution/built-in-functions/[fv]s-asinh-*.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 12:20:25 -07:00
Brian Paul
b79782cbed mesa: fix signed/unsigned sscanf() warning in _mesa_override_glsl_version() 2011-09-28 13:17:11 -06:00
Brian Paul
3bb41e7b2d st/mesa: include version.h and fix _mesa_override_glsl_version() call 2011-09-28 13:17:11 -06:00
Eric Anholt
9f220bd135 glsl: Add support for constant expression evaluation on trunc().
Fixes the glsl-1.30/compiler/built-in-functions/trunc-* tests under 1.30.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
158a585450 i965/vs: Add support for bit-shift operations.
Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
0045a67418 mesa: Add missing _mesa_sizeof_glsl_type() for UNSIGNED_INT.
Somehow we managed to get the unsigned int vectors, but not scalar.
Fixes _mesa_problem complaints in piglit's uint tests.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
7de6e749df i965/fs: Add support for bit-shift operations.
Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
344f94bb00 glsl: Fix assertion checking types of constant bitshift expressions.
Bitshifts are one of the rare places that GLSL allows mixed base types
without an implicit conversion occurring.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
1d59de1456 ir_to_mesa: Don't assertion fail on remaining GLSL 1.30 ops.
For hardware drivers, we only have ir_to_mesa called for the purposes
of potential swrast fallbacks (basically never on a 1.30 driver),
which we don't really care about.  This will allow 1.30 to be
implemented without rewriting swrast for it.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Paul Berry
f02ed012c9 i965: don't intepolate clip distances on pre-GEN6.
On pre-GEN6 chips, the VUE slots set aside for clip distance aren't
actually used, so there is no reason for the clipper to waste time
interpolating them.

When commit 62bad54727 changed the enum
value used to represent these VUE slots, that caused the clipper to
start interpolating them as an accidental side effect.  This patch
reverts to the old clipper behavior.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:04 -07:00
Paul Berry
64ce64a3f8 i965 new VS: Fix bugs in pre-GEN6 psiz/flags computation
This patch corrects two errors in the computation of the psiz/flags
VUE slot on pre-GEN5 when using the new VS backend:

- The clip flags (which should be stored in the w component of the
  first VUE slot) were being accidentally duplicated in all other
  components of that VUE slot, causing partially clipped triangles to
  sometimes disappear completely.

- The OR instruction wasn't being stored in "inst", causing the
  BRW_PREDICATE_NORMAL flag to be applied to the wrong instruction.

This patch fixes regressions in clipping behavior when using shaders
on GEN4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:04 -07:00
Paul Berry
cc3a699e32 i965 new VS: Fix src_reg(uint32_t) constructor.
This constructor was storing its argument in the wrong field of the
"imm" enum, resulting in it being converted to a float when it should
have remained an unsigned integer.  This was preventing clipping from
working properly on pre-GEN6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:04 -07:00
Paul Berry
e7da40afe8 i965 new VS: don't share clip plane constants in pre-GEN6
In pre-GEN6, when using clip planes, both the vertex shader and the
clipper need access to the client-supplied clip planes, since the
vertex shader needs them to set the clip flags, and the clipper needs
them to determine where to insert new vertices.

With the old VS backend, we used a clever optimization to avoid
placing duplicate copies of these planes in the CURBE: we used the
same block of memory for both the clipper and vertex shader constants,
with the clip planes at the front of it, and then we instructed the
clipper to read just the initial part of this block containing the
clip planes.

This optimization was tricky, of dubious value, and not completely
working in the new VS backend, so I've removed it.  Now, when using
the new VS backend, separate parts of the CURBE are used for the
clipper and the vertex shader.  Note that this doesn't affect the
number of push constants available to the vertex shader, it simply
causes the CURBE to occupy a few more bytes of URB memory.

The old VS backend is unaffected.  GEN6+, which does clipping entirely
in hardware, is also unaffected.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Paul Berry
7e2b23ba85 i965: Fix a hardcoded user clip plane count.
Now that i965 supports 8 clip planes instead of 6, the size of the
brw_vs_compile::userplane array needs to be increased to 8.  Changed
the array size to MAX_CLIP_PLANES so that if the number changes again
in the future, this array size won't be missed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Paul Berry
a864b82a04 i965: allow for nonconsecutive elements of gl_ClipDistance to be enabled.
When using user-defined clipping planes, the i965 driver compacts the
array of clipping planes so that disabled clipping planes do not
appear in it--this saves precious push constant space and makes it
easier to generate the pre-GEN6 clip program.  As a result, when
enabling clipping planes in GEN6+ hardware, we always enable clipping
planes 0 through n-1 (where n is the number of clipping planes
enabled), regardless of which clipping planes the user actually
requested.

However, we can't do this when using gl_ClipDistance, because it would
be prohibitively complex to compact the gl_ClipDistance array inside
the user-supplied vertex shader.  So, when enabling clipping planes in
GEN6+ hardware, if gl_ClipDistance is in use, we need to pass the
user-supplied enable flags directly through to the hardware rather
than just enabling the first n planes.

Fixes Piglit test vs-clip-distance-enables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Paul Berry
e6c8027ccb i965: Use 4 bits to store nr_userclip in brw_clip.h.
Since the i965 driver supports 8 clipping planes now, we need 4 bits
to store the number of user clipping planes, not 3.

In theory this isn't strictly necessary, since brw_clip.h is only used
on pre-GEN6, and pre-GEN6 only advertises support for 6 clipping
planes, but it seems wise to err on the safe side.

In the process I removed the pad0 element of struct
brw_clip_prog_key--it doesn't seem necessary because the compiler
automatically inserts padding if needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Chad Versace
bb3e75d9a5 intel: Remove unused function get_glsl_version()
It was replaced by _mesa_override_glsl_version().

Reviewed-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-28 11:29:53 -07:00
Chad Versace
a1eff5570f mesa: Allow overriding GLSL version with environment variable
Override the context's GLSL version if the environment variable
MESA_GLSL_VERSION_OVERRIDE is set. Valid values for
MESA_GLSL_VERSION_OVERRIDE are integers, such as "130".

MESA_GLSL_VERSION_OVERRIDE has the same behavior as INTEL_GLSL_VERSION,
except that it applies to all drivers, not just Intel's. Since the former
supercedes the latter, this patch disables the latter.

Reviewed-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-28 11:29:52 -07:00
Brian Paul
124fc96ddf st/mesa: substitute argument to guess_base_level_size() call
stObj->base.BaseLevel and firstImage->base.Level have the same value
but the later looks more consistent in the function call.
2011-09-28 10:39:10 -06:00
Brian Paul
d1e567fb00 mesa: fix signed/unsigned warning in sscanf() 2011-09-28 10:39:10 -06:00
Brian Paul
d487cc23a1 scons: insert 'git-' into MESA_GIT_SHA1 string
To match makefile build.
2011-09-28 09:51:45 -06:00
Brian Paul
e112287474 scons: fix write_git_sha1_h_file() issue on Windows
Unlike on Unix, os.rename(src, dst) will fail on Windows if the dst file
already exists.  Remove it first.
2011-09-28 09:05:58 -06:00
Christoph Bumiller
ddb5cd0a7b d3d1x: propagate DepthBiasClamp to rasterizer cso 2011-09-28 16:28:58 +02:00
Christoph Bumiller
5def3b7be1 d3d1x: fix uninitialized const color union black
Broken by 6dd284f7c8.
2011-09-28 16:28:58 +02:00
Christoph Bumiller
b3fa0d311e nv50,nvc0: support polygon offset clamp state 2011-09-28 16:28:58 +02:00
Christoph Bumiller
e92348b7f5 r600: support polygon offset clamp state 2011-09-28 16:28:17 +02:00
Christoph Bumiller
16f8308c3d gallium: add polygon offset clamp state
This is required for D3D1x and supported by hardware.
2011-09-28 16:28:17 +02:00
Brian Paul
f83af361a4 scons: generate git_sha1.h file as with Makefile build
So that GL_VERSION includes the git head hash id when building with scons.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-28 08:15:22 -06:00
Kenneth Graunke
83df7fbe62 i965: Allow SIMD16 color writes on Ivybridge.
Again, the check was needlessly specific: this works fine on Gen7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 00:52:43 -07:00
Kenneth Graunke
79cba4c2b1 i965/fs: Allow SIMD16 with control flow on Ivybridge.
The check was designed to forbid it on old generations (Gen5/Ironlake),
not on new ones.  It just works on Gen7/Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 00:52:36 -07:00
Eric Anholt
b095b683f8 intel: Fix compiler warnings from the depth stall flush commit. 2011-09-27 15:17:50 -07:00
Eric Anholt
d1fda903ec radeon: Drop mapping we were doing around glGetTexImage().
It's handled by MapTextureImage() now.
2011-09-27 12:12:07 -07:00
Eric Anholt
6731c6cfb1 nouveau: Drop mapping we were doing around glGetTexImage().
It's handled by MapTextureImage() now.
2011-09-27 12:12:07 -07:00
Eric Anholt
019c9ee220 intel: Drop our custom glGetTexImage() code.
The mesa core code uses MapTextureImage() like we need now.

v2: Drop mapping around _mesa_generate_mipmap for compressed, since
    the whole path ends up going through MapTextureImage(), and the
    meta decompression code ended up causing us to lose track of the
    region that was originally mapped and assertion fail.
2011-09-27 12:12:07 -07:00
Brian Paul
ce62473408 mesa: Finally, convert RGBA glGetTexImage() to using MapTextureImage().
v2: Changes by Brian to MapTexImage in the decompression path.
v3: Changes by anholt to fix srcRowStride for decompression of NPOT.

Tested-by: Brian Paul <brianp@vmware.com> (v2)
2011-09-27 12:12:07 -07:00
Brian Paul
429b45e7c0 mesa: Convert depth glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
59348722b7 mesa: Convert depth/stencil glGetTexImage() to using MapTextureImage().
Note that the implementation before and after appears to be broken in
its handling of Z24_S8 vs S8_Z24.

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
0c513a9c1b mesa: Switch ycbcr glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
440dfb4583 mesa: Switch memcpy fast-path of glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
177110ae32 mesa: Update comments/assertions about buffer mapping for glGetTexImage().
This code is about to stop needing ->Data and using MapTextureImage().

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
8df7ca7112 mesa: Convert GetCompressedTexImage to using MapTextureImage().
This changes drivers to not map the texture on their own before
calling _mesa_get_compressed_teximage().

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Dave Airlie
9f61e43b49 gallium: move border color to be a color union
EXT_texture_integer also specifies border color should be a color
union, the values are used according to the texture sampler format.

(update docs)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-27 20:02:02 +01:00
Chad Versace
0527c11d7a mesa: Allow override of GL version with environment variable
It is necessary to manually set the GL version to 3.0 in order to run
Piglit tests that use glGetUniform*().

This patch allows one to override the version of the OpenGL context by
setting the environment variable MESA_GL_VERSION_OVERRIDE.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-27 11:23:17 -07:00
Paul Berry
b565e62a44 mesa: Make enable.c and get.c properly range check clip flags.
This is a follow-up to commit
2d686fe911, which added decoding of
GL_CLIP_DISTANCE[67] to the _mesa_set_enable() function.  This patch
makes the following additional fixes:

- Uses GL_CLIP_DISTANCEi enums consistently within enable.c rather
  than the deprecated GL_CLIP_PLANEi enums.

- Generates an error if the user tries to access a clip flag that is
  unsupported by the hardware.

- Applies the same change to _mesa_IsEnabled(), so that querying clip
  flags using glIsEnabled() works properly.

- Applies corresponding changes to get.c, so that querying clip flags
  using glGet*() works properly.

Fixes piglit test clip-flag-behavior.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-27 10:36:38 -07:00
Brian Paul
4c84fbea9d mesa: fix indentation in mipmap.c (3 spaces) 2011-09-26 20:44:09 -06:00
Eric Anholt
39790b6450 i965/vs: Fix access beyond array bounds for non-GRF operands.
Caught by valgrind.  I never saw a segfault from it (probably because
it's hard to have much more of any other file than GRF).
2011-09-26 15:33:42 -07:00
Eric Anholt
8004a1cb95 intel: Rename region->buffer to region->bo, and remove accessor function.
We call all the other drm_intel_bo pointers in intel/*.h "bo", so this
one was rather out of place.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
b4721bf711 intel: Drop stale comment about CopyTexSubImage.
We get called for TexImage higher up, and in a relatively normal way
(pixels == NULL is common for FBO setup).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
2ef77d1c74 intel: Rely on AllocTextureImageBuffer for our teximage fallbacks.
It will do a more reliable job at getting the image size for
_mesa_texstore right than us.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
d6b5e32f5f intel: Rely on mesa core for compressed texture image uploading.
There's nothing in our normal texture path we need for this.  We don't
PBO upload blit it.  We don't need to worry about flushing because
MapTextureImage handles it.  hiz scattergather doesn't apply, but MTI
handles it too.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
32fe506ae1 intel: Allow src == NULL and *dst != NULL in intel_miptree_reference().
This makes this API consistent with intel_region_reference, and the
consumers wanted it this way.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
db3ada6055 intel: Drop the "intel" argument to intel_miptree_release().
We don't have it in the other refcounting functions, and it was
totally unused.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
abaebcee78 intel: Drop the immediate validation of the texture object in TFP.
It's totally gratuitous -- the image's miptree will be checked for
binding to the object later, anyway, with zero-copy or blitting as
appropriate.

Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
d430e81c32 intel: Fix improper freeing of texture data in TFP.
If there happened to be ->Data present, we assertion failed instead of
handling it correctly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35234
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
fdd4961443 intel: Refactor texture_from_pixmap and EGL_image region binding.
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
19cfe1e035 intel: Drop some extra equality checks on reference/release functions.
_mesa_reference_renderbuffer already short-circuits equality, and
intel_miptree_release does nothing on NULL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
14ae70f793 i965: Set the pre/post-blend color clamp flags.
No change in piglit results on gen6, but the spec demands it so let's
do it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Kenneth Graunke
74e927bcaf i965/fs: Split generate_math into gen4/gen6 and 1/2 operand variants.
This mirrors the structure Eric used in the new VS backend, and seems
simpler.  In particular, the math1/math2 split will avoid having to
figure out how many operands there are, as this is already known by the
caller.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 16:30:07 -07:00
Brian Paul
c5943d6c1c swrast: always call _swrast_choose_texture_sample_func()
_swrast_choose_texture_sample_func() handles null texture object pointers
and will return the "null" sampler function which returns (0,0,0,1).  This
fixes a minor regression from ce82914f5a
2011-09-26 14:43:56 -06:00
Ian Romanick
e0553f6d4b mesa: Remove EXT_abgr extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is required in desktop OpenGL.  The existing support is already partially
broken in Mesa (e.g., using format=GL_ABGR for glTexImage2D in OpenGL ES 2.x).
This patch does not change the situation in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:14 -07:00
Ian Romanick
29386d1f2d mesa: Remove EXT_bgra and EXT_texture_format_BGRA8888 extension enable flags
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

EXT_texture_format_BGRA8888 is mostly a subset of EXT_bgra.  The only
difference seems to be that EXT_texture_format_BGRA8888 allows GL_BGRA
as an internal format to glTexImage2D and friends.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:14 -07:00
Ian Romanick
425284e882 mesa: Remove OES_read_format extension enable flag
This extension is always enabled, and drivers do not have
to option to disable it.

I kept this one separate from the others because I was a little
uncertain about the changes to get.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-09-26 12:14:13 -07:00
Ian Romanick
e5301b82ff mesa: Remove all mention of EXT_vertex_array_set
Mesa has never any portion of this extension, and neither has any
other vendor.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
740a9a4952 mesa: Fix extension year for EXT_texture_env_combine
The year 2006 apparently came from the "Last Modified Date" in the
spec header.  however, the revision history at the bottom say "2/22/00
mjk - added NVIDIA Implementation Details."  From that we can safely
infer that the spec is from at least 2000, and it may even be older.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
34eae1c72a mesa: Remove many extension enable flags
The following extensions are always enabled, and drivers do not have
to option to disable them:

    GL_ARB_multisample
    GL_ARB_texture_compression
    GL_ARB_vertex_buffer_object / GL_OES_mapbuffer
    GL_EXT_copy_texture
    GL_EXT_multi_draw_arrays / GL_SUN_multi_draw_arrays
    GL_EXT_polygon_offset
    GL_EXT_subtexture
    GL_EXT_texture_edge_clamp / GL_SGIS_texture_edge_clamp
    GL_EXT_vertex_array
    GL_SGIS_generate_mipmap

This set was picked because the are all either required or optional
features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x.  The
existing support for some is already partially broken in Mesa (e.g.,
proxy texture targets in OpenGL ES).  This patch does not change the
situation in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
2bf30b1ccc intel: Remove redundant GL_ARB_window_pos enable
This extension is enabled by default in _mesa_init_extensions, so
drivers don't need to enable it again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
5e4f42b017 dri: Remove redundant GL_SGIS_texture_edge_clamp enables
This extension is enabled by default in _mesa_init_extensions, so
drivers don't need to enable it again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:12 -07:00
Kenneth Graunke
8bd27a5b08 i965: Emit depth stalls and flushes before changing depth state on Gen6+.
Fixes OpenArena on Gen7.  Technically, adding only the first depth stall
fixes it, but the documentation says to do all three, and the Windows
driver seems to do it.

Not observed to fix anything on Gen6 yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:54:03 -07:00
Kenneth Graunke
490e6470a0 intel: Introduce a new intel_context::gt field to go along with gen.
It seems that GT1/GT2 sorts of variations are here to stay, and more
special cases will likely be required in the future.  Checking by PCI ID
via the IS_xxx_GTx macros is cumbersome; introducing a new 'gt' field
analogous to intel->gen will make this easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:50:31 -07:00
Kenneth Graunke
3f9f1b3659 intel: Remove intel_context::has_xrgb_textures/has_luminance_srgb.
Seeing as they were only used once (in the same function they were
defined), having them as context members seemed rather pointless.

Remove them entirely (rather than using local variables) since the
chipset generation checks are actually just as straightforward.

While we're at it, clean up the remainder of the if-tree that set them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:50:31 -07:00
Kenneth Graunke
01dda0758e i965: Fix incorrect maximum PS thread count shift on Ivybridge.
At one point, the documentation said that max thread count in 3DSTATE_PS
was at bit offset 23, but it's actually 24 on Ivybridge.  Not only did
this halve our thread count, it caused us to write 1 into a bit 23, which
is marked as MBZ (must be zero).  Furthermore, it made us write an even
number into this field, which is apparently not allowed.  Apparently we
were just lucky it worked.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:48:27 -07:00
Marek Olšák
44afac04ea r600g: add index_bias to index buffer bounds
This fixes ARB_draw_elements_base_vertex with max_index != ~0.

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
60a77cf316 u_vbuf_mgr: fix uploading with a non-zero index bias
Also don't rely on pipe_draw_info being set correctly.

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
21f71b6c05 u_vbuf_mgr: dereference some pointers only once etc. 2011-09-26 15:25:05 +02:00
Marek Olšák
cd9bbb3935 u_vbuf_mgr: rework user buffer uploads
- first determine the buffer range to upload for each buffer by walking over
  vertex elements
- take buffer_offset into account
- take src_offset into account
- take src_format into account in more places
- don't just blindly upload (stride*count) bytes

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
315300e444 u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED 2011-09-26 15:25:04 +02:00
Marek Olšák
28fb798911 u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_ 2011-09-26 15:25:04 +02:00
Marek Olšák
f214e1c999 u_vbuf_mgr: fix max_index computation for large src_offset
NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:04 +02:00
Marek Olšák
4b5bf5a2a2 u_vbuf_mgr: don't take per-instance attribs into acc. when computing max index
NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:04 +02:00
Marek Olšák
0b3270b9b7 u_vbuf_mgr: cleanup original vs real vertex buffer arrays
It can now override both buffer offsets and strides in additions to resources.
Overriding buffer offsets was kinda hackish and could cause issues with
non-native vertex formats.
2011-09-26 15:25:04 +02:00
Yuanhan Liu
455a19b1b3 intel: fix potential segfault error at intel_(un)map_texture_image
intel_image->mt might be NULL, say with border width set. It then would
trigger a segfault at intel_map/unmap_texture_image function.

This would fix the oglc misctest(basic.textureBorderIgnore) fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-26 09:23:06 +08:00
Marcin Slusarz
65b8eea064 nouveau: fix crash during fence emission
Fence emission can flush the push buffer, which through flush_notify
unreferences recently emitted fence. If ref count is increased after
fence emission, unreference deletes the fence, which causes SIGSEGV.

Backtrace:
nouveau_fence_del
nouveau_fence_ref
nouveau_fence_next
nouveau_pushbuf_flush
MARK_RING
nv50_screen_fence_emit
nouveau_fence_emit
nv50_flush

This bug manifested as an assertion failure in nouveau_fence.c, because
SIGSEGV handler tried to shutdown the application and used messed up
fence.

This issue was reported by Maxim Levitsky.

Note: This is a candidate for the 7.11 branch.
2011-09-25 19:18:45 +02:00
Henri Verbeet
a4d72189b2 mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().
Without this we'd miss the last update in a sequence like {COLOR0, COLOR1},
{COLOR0}, {COLOR0, COLOR1}. I originally had a patch for this that called
updated_drawbuffers() when the buffer count changed, but later realized that
was wrong. The ARB_draw_buffers spec explicitly says "The draw buffer for
output colors beyond <n> is set to NONE.", and this is queryable state.
This fixes piglit arb_draw_buffers-state_change.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-25 15:00:21 +02:00
José Fonseca
4703f50e96 postprocess: Portability fixes. 2011-09-25 12:18:55 +01:00
José Fonseca
785b9e7c78 noop: Always use memory allocation macros. 2011-09-25 12:18:55 +01:00
José Fonseca
6921d4cd57 llvmpipe: Always use memory allocation macros. 2011-09-25 12:18:55 +01:00
José Fonseca
f32c9c2108 softpipe: Use memory allocation macros.
Fixes segfault with memory debugging on.
2011-09-25 12:18:55 +01:00
Emeric Grange
1f23ac8082 st/vdpau: Link vdpau targets with librt to avoid unresolved symbols error related to the use of the clock_gettime() function
This patch fix a "Unresolved Symbols" run time error when using G3DVL
through the VDPAU state tracker, by linking the vdpau targets with librt.
Reported by Arkadiusz Miśkiewicz.

Caused by this commit :
commit e911dbb563
Author: Emeric Grange <emeric.grange@gmail.com>
Date:   Mon Sep 12 23:39:33 2011 +0200

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-25 12:50:12 +02:00
Christian König
86f97f7dc0 g3dvl: Don't use SCALED types for iDCT
This should bring g3dvl back to work until we figured out
how SCALED types should really work.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-25 12:49:06 +02:00
José Fonseca
102bf6e2a7 draw: Never allocate duplicate extra vertex attribs.
Prevents mismatches when the VS outputs generic attributes not used by
the FS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-25 11:04:31 +01:00
José Fonseca
fc31f9a3f2 draw: Make copy of the TGSI tokens.
There is no guarantee that the tokens TGSI will persist beyond the
create_fs_state. The pipe driver (and therefore the draw module) is
responsible for making copies of the TGSI tokens when it needs them.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-25 11:04:29 +01:00
Chad Versace
06ae4a62b1 glsl: Fix Android build
Add lower_clip_distance.cpp to list of source files.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-24 19:37:13 -07:00
Kenneth Graunke
d7cdbc3c54 intel: Remove pointless boolean return value from *_miptree_layout.
i915_miptree_layout, i945_miptree_layout, and brw_miptree_layout always
just return GL_TRUE, so there's really no point to it.  Change them to
void functions and remove the (dead) error checking code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-23 22:42:18 -07:00
Kenneth Graunke
0d949a51bb glsl: Free all S-Expressions immediately after reading IR.
For some reason I thought subexpressions were chained off the top-level
one.  This isn't the case, so just create a temporary context and free
it.  All of this memory would be eventually freed, but now is freed
much sooner.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 17:12:47 -07:00
Kenneth Graunke
0fabf8e8dc glsl: Defer initialization of built-in functions until they're needed.
Very simple shaders don't actually use GLSL built-ins.  For example:
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_FragColor = vec4(0.0);
Both of the shaders used by _mesa_meta_glsl_Clear() also qualify.

By waiting to initialize the built-ins until the first time we need to
look for a signature, we can avoid the overhead entirely in these cases.

Makes piglit run roughly 18% faster (255 vs. 312 seconds).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 17:12:47 -07:00
Paul Berry
604173fb1c i965: Increase MaxClipPlanes to 8 for gen6+.
This is necessary for GLSL 1.30 compliance.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:46 -07:00
Paul Berry
2a6d432040 i965: Allow clip distances to be read back in fragment shaders.
Previously, we conditionally set up the SF pipline stage with a
urb_entry_read_offset of 2 when clipping was in use, and 1 otherwise,
causing the clip distance VUE slots to be skipped if present.  This
was an extremely minor savings (it saved the SF unit from reading 2
vec4s out of the URB, but it didn't affect any computation, since we
only instruct the SF unit to perform interpolation on VUE slots that
are actually used by the fragment shader).

GLSL 1.30 requires an interpolated version of gl_ClipDistance to be
available for reading in the fragment shader, so we need the SF's
urb_entry_read_offset to be 1 when the fragment shader reads from
gl_ClipDistance.

This patch just unconditionally sets the urb_entry_read_offset to 1 in
all cases; this is sufficient to make gl_ClipDistance available to the
fragment shader when it is needed, and the performance loss should be
negligible when it isn't.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:42 -07:00
Paul Berry
62bad54727 i965: Set up clip distance VUE slots appropriately for gl_ClipDistance.
When gl_ClipDistance is in use, the contents of the gl_ClipDistance
array just need to be copied directly into the clip distance VUE
slots, so we re-use the code that copies all other generic VUE slots
(this has been extracted to its own method).  When gl_ClipDistance is
not in use, the vertex shader needs to calculate the clip distances
based on user-specified clipping planes.

This patch also removes the i965-specific enum values
BRW_VERT_RESULT_CLIP[01], since we now have generic Mesa enums that
serve the same purpose (VERT_RESULT_CLIP_DIST[01]).

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:39 -07:00
Paul Berry
d9cb683f81 i965: Don't upload clip planes when gl_ClipDistance is in use.
When the vertex shader writes to gl_ClipDistance, we do clipping based
on clip distances rather than user clip planes, so don't waste push
constant space storing user clip planes that won't be used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:37 -07:00
Paul Berry
b9ef2b85b4 i965: Enable lower_clip_distance.
i965 requires gl_ClipDistance to be formatted as an array of 2 vec4's
(as opposed to an array of 8 floats), so enable the lowering pass that
performs this conversion.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:33 -07:00
Paul Berry
2d686fe911 mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().
In order to support 8 clip distances, we need to properly decode when
the user sets the GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7 enable
flags.

For clarity, this patch changes the names GL_CLIP_PLANE[0-5] in the
switch statement to the equivalent names GL_CLIP_DISTANCE[0-5], since
the GL_CLIP_PLANE names are deprecated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:30:08 -07:00
Paul Berry
3d7c5a4f6f mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.
This patch assigns enumerated values for gl_ClipDistance in the
gl_vert_result and gl_frag_attrib enums, so that driver back-ends can
assign gl_ClipDistance to the appropriate hardware registers.  It also
adjusts the functions _mesa_vert_result_to_frag_attrib() and
_mesa_frag_attrib_to_vert_result() (which translate between the two
enums) to correctly translate the new enumerated values.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:30:03 -07:00
Paul Berry
1ad54ae0b1 mesa: Add a flag to indicate whether a program uses gl_ClipDistance.
GLSL 1.30 requires us to use gl_ClipDistance for clipping if the
vertex shader contains a static write to it, and otherwise use
user-defined clipping planes.  Since the driver needs to behave
differently in these two cases, we need a flag to record whether the
shader has written to gl_ClipDistance.

The new flag is called UsesClipDistance.  We initially store it in
gl_shader_program (since that is the data structure that is available
when we check to see whethe gl_ClipDistance was written to), and we
later copy it to a flag with the same name in gl_vertex_program, since
that is a more convenient place for the driver to access it (in i965,
at least).

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:28:51 -07:00
Paul Berry
c06e325967 glsl: Implement a lowering pass for gl_ClipDistance.
In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance
needs to be laid out as a pair of vec4's (the first containing clip
distances 0-3, and the second containing clip distances 4-7).
However, it is declared in GLSL as an array of 8 floats.

This lowering pass acts at the GLSL level, modifying the declaration
of gl_ClipDistance so that it is an array of vec4's rather than an
array of floats, and renaming it to gl_ClipDistanceMESA.  In addition,
it modifies all accesses to the array so that they access the
appropiate component of one of the vec4's.

Since some hardware may not internally represent gl_ClipDistance as a
pair of vec4's, this lowering pass is optional.  To enable it, set the
LowerClipDistance flag in gl_shader_compiler_options to true.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 13:28:43 -07:00
Paul Berry
cc81eb09b9 glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.
This patch fixes a bug in ir_hirearchical_visitor: when traversing an
exec_list representing the formal or actual parameters of a function,
it modified base_ir to point to each parameter in turn, rather than
leaving it as a pointer to the enclosing statement.  This was a
problem, since base_ir is used by visitor classes to locate the
statement containing the node being visited (usually so that
additional statements can be inserted before or after it).  Without
this fix, visitors might attempt to insert statements into parameter
lists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 13:28:00 -07:00
Chad Versace
deff7fff49 mesa: Add missing includes to meta.h
Include mtypes.h.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-23 10:54:25 -07:00
Brian Paul
be928ecd8d docs: mention VMware svga driver updates in 7.12 release notes 2011-09-23 08:05:36 -06:00
Brian Paul
ea0cedce6a svga: indentation/formatting fixes 2011-09-23 07:59:21 -06:00
Brian Paul
2c308c66e2 svga: remove emit_consts() offset parameter
It was always zero.
2011-09-23 07:59:00 -06:00
Brian Paul
7c6a5134ba svga: s/int/unsigned/ in svga_state_constants.c
Be consistent with other functions in the file.  And add some comments.
2011-09-23 07:59:00 -06:00
Brian Paul
c27f24f6f0 svga: s/unit/shader/ and related clean-ups
'shader' is more intuitive.  Also s/int/unsigned/ and add assertions.
2011-09-23 07:59:00 -06:00
Brian Paul
5f053bf4ae svga: clean up return values and error codes
Previously we were using a hodge podge of int vs. pipe_enum and
0 vs. PIPE_OK.  Some functions that always returned PIPE_OK were
made void.
2011-09-23 07:59:00 -06:00
Brian Paul
681f92140c svga: add format translation for DXT/sRGB formats
Without this, apps/tests that tried to use a DXT/sRGB format would die on
a failed assertion (st_texture.c:80).
2011-09-23 07:58:48 -06:00
Brian Paul
2b2a69e088 svga: test register W component in emit_kil()
Only the XYZ components are checked to be negative by SVGA3DOP_TEXKILL.
GL_ARB_fp requires all four components be checked.  Emit a second texkill
for W if needed.
2011-09-23 07:58:48 -06:00
Brian Paul
7d09df0cbc svga: fix depth/shadow compare for non-projected texcoords
We only need to do the divide by Q step for TXP instructions.
This fixes the incorrectly rendered soft shadow test in Lightsmark.
Along with the previous texture swizzle commit, this also fixes all
the piglit glsl-fs-shadow2d-XX.shader_test failures.
2011-09-23 07:58:48 -06:00
Brian Paul
9bd15aef86 svga: implement texture swizzling
This exposes the GL_EXT_texture_swizzle extension and allows the various
depth texture modes to be implemented properly.  This, plus a follow-on
texture/shadow change fixes quite a few piglit GLSL shadow sampler test
failures.
2011-09-23 07:58:48 -06:00
Brian Paul
49a6f5e68e svga: check that we don't exceed input/ouput register limits 2011-09-23 07:58:47 -06:00
Brian Paul
2f40e4aac7 svga: implement point sprite suppport
Emit the SVGA3D_RS_POINTSPRITEENABLE render state.
When sprite_coord_mode=PIPE_SPRITE_COORD_LOWER_LEFT emit extra frag
shader code to invert the Y coordinate of the incoming texcoord.
2011-09-23 07:58:47 -06:00
Brian Paul
9a41ecaddd svga: add translation for float formats 2011-09-23 07:58:47 -06:00
Brian Paul
73e840ab7d svga: check to avoid writing beyond end of constant buffer
See bug 688394
2011-09-23 07:58:47 -06:00
José Fonseca
974b6413f4 svga: Cleanup format capability checking.
Accurately describe what operations are supported when a format caps
entry is not advertised by the host, and which formats are never
supported, instead of making ad-hoc and often incorrect assumptions.
2011-09-23 07:58:47 -06:00
José Fonseca
ffeed5da6e svga: Don't use the new depth formats for surfaces that will never be sampled from.
Mitigates issues with hosts where support for these new depth formats is
flaky.
2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
8bf3fb4eca svga: Share one texcoord between depth and fog 2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
4f17830b3d svga: Only emit Z depth work if it is actually read 2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
3b32e51cb1 svga: Fix vPos usage 2011-09-23 07:58:45 -06:00
Jakob Bornecrantz
166e9421c8 svga: Wip for passing depth in a texcoord
TODO: Can we pass this as the same texcoord as fog?
2011-09-23 07:58:45 -06:00
José Fonseca
6759ad53e2 svga: Add a comment about depth format selection. 2011-09-23 07:58:45 -06:00
José Fonseca
846a21d352 svga: Consider the new depth formats in svga_texture_from_handle(). 2011-09-23 07:58:45 -06:00
José Fonseca
f74c04c22c svgadump: Dump the new depth format names. 2011-09-23 07:58:45 -06:00
Jakob Bornecrantz
4e0ae3e34f svga: Expose the new depth formats 2011-09-23 07:58:45 -06:00
José Fonseca
fd69fc8744 svga: Coalesce multiple shader constants in a single command.
HWv8 feature.

Tested with GoogleEarth, Mesa demos.
2011-09-23 07:58:44 -06:00
José Fonseca
157309348e svgadump: Update for svga3d_reg.h header changes. 2011-09-23 07:58:44 -06:00
Brian Paul
2b74fb139c svga: updated svga3d_reg.h to latest public version 2011-09-23 07:58:44 -06:00
Alex Corscadden
2883e3c0b5 Allow RBUG to start blocked
It is sometimes useful to examine the first frame or and early frame of a
quickly executing and non-repeating application, this chain introduces a new
environment variable that is checked when creating contexts.  If
GALLIUM_RBUG_START_BLOCKED is set, then each context that is created is started
in a blocked state.  This allows time to connect rbug before anything is
rendered in the context.
2011-09-23 07:58:44 -06:00
Brian Paul
ddfdea88d8 draw/llvm: add additional null pointer checkin draw_pt_fetch_pipeline_or_emit_llvm() 2011-09-23 07:58:44 -06:00
Yuanhan Liu
1a662e7c18 intel: fix the wrong code to detect null texture.
There is already comments show how to detect a null texture. Fix the
code to match the comments.

This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 13:34:26 +08:00
Yuanhan Liu
cd6b8421ca i965: fix the constant interp bitmask for flat mode
Fix the constant interpolation enable bit mask for flat light mode.
FRAG_BIT_COL0 attribute bit might be 0, in which case we need to
shift one more bit right.

This would fix the oglc specularColor test fail on both Sandybridge and
Ivybridge.

v2: move the constant interp bitmask setup code into for(; attr <
FRAG_ATTRIB_MAX; attr++) loop suggested by Eric.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-09-23 10:49:42 +08:00
Stéphane Marchesin
e3c94fac4e i915g: Don't generate useless swizzles before texture accesses.
That helps reduce the number of texture indirections, which are very limited on i915.
2011-09-22 19:26:33 -07:00
Stéphane Marchesin
79a0499369 i915g: Fix whitespace. 2011-09-22 19:26:32 -07:00
Marek Olšák
661b853f11 docs: update relnotes-7.12 with r600g changes 2011-09-23 03:03:45 +02:00
Brian Paul
7276ab2c36 st/mesa: remove unnecessary st_texture_match_image() parameters
We didn't use the face parameter and the level parameter can be found
in the gl_texture_image.
2011-09-22 16:43:45 -06:00
Stéphane Marchesin
687e62a5d7 i915g: Fix peephole optimization for MOVs. 2011-09-22 12:43:24 -07:00
Stéphane Marchesin
7cba40306e i915g: Add unsupported PIPE_CAP_MIN_TEXEL_OFFSET/PIPE_CAP_MAX_TEXEL_OFFSET. 2011-09-22 12:01:19 -07:00
Eric Anholt
86939e05d2 intel: Unindent the blit call in PBO blit uploads.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 11:03:26 -07:00
Eric Anholt
275ce9631b intel: Drop gratuitous flush in PBO blit upload.
Since the blit gets sequenced after other batchbuffer rendering like
normal, there's no need to push things out early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:24 -07:00
Eric Anholt
3bb536e4c7 intel: Clean up check_pbo_format to ignore internalFormat.
All that matters here is the format of the texture, not the
internalformat (which might mean various different pixel formats).  In
one case, the pbo upload for MESA_FORMAT_YCBCR would have swapped the
channels for MESA_FORMAT_YCBCR_REV.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:22 -07:00
Eric Anholt
0ba2390947 intel: Move more of the PBO blit upload logic into that function.
This also improves the debugging output in the failure paths so you
get more than just "failed", and don't get spammed with "failed" when
you didn't even have a PBO to try.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:20 -07:00
Eric Anholt
d58a3182b1 intel: Remove stale comment about non-intel gl_buffer_objects.
This hasn't been true since dd26899ca3
in 2009.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:17 -07:00
Eric Anholt
bc0335fc0e intel: Remove the pbo zero-copy code.
There were notes about the possibility of slowdowns due to zcopy from
a PBO due to thrashing around of the region.  Slowdowns are even more
likely now that textures are generally tiled, which a zcopy wouldn't
get.  Additionally, there were no checks on the buffer size to ensure
that the hardware-required rounding was present, which could result in
GPU hangs on large zcopy PBOs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:13 -07:00
Eric Anholt
57024e084a intel: Remove extra FreeTextureImageBuffer() from glTexImage*.
The core code does this before calling in to us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:10 -07:00
Eric Anholt
03e623a27b i965: Add support for GL_EXT_packed_float.
This doesn't cover support for this format as a renderbuffer yet.  The
spec allows implementations to not support it, though it is something
we do want to support.

Only one failure in piglit on gen6, which is texwrap with bordercolor
(as usual).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 10:58:34 -07:00
Eric Anholt
2fd8c4e3ed i965: Add support for GL_EXT_texture_shared_exponent.
Only one failure in piglit on gen6, which is texwrap with bordercolor
(as usual).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 10:58:34 -07:00
Brian Paul
9e9a76eea1 mesa: remove support for GL_APPLE_client_storage extension
AFAIK, there are few users of this extension and I can see a couple
reasons why this is probably broken in Mesa anyway.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 10:45:09 -06:00
Brian Paul
980f6f1b37 mesa: move gl_texture_image::Width/Height/DepthScale fields to swrast
These fields were only used for swrast so move them into
swrast_texture_image.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 10:44:57 -06:00
Brian Paul
eaf376ba35 mesa: move gl_texture_image::_IsPowerOfTwo into swrast
It's only used by swrast.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 10:44:36 -06:00
Michel Dänzer
de414f4915 st/mesa: Finalize texture on render-to-texture.
This makes sure that stObj->pt exists and is up to date.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 and piglit
fbo-incomplete-texture-03.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

NOTE: This is a candidate for the 7.11 branch.
2011-09-22 17:01:18 +02:00
Brian Paul
4beb8f9e9d st/mesa: Convert size assertions to conditionals in st_texture_image_copy.
Prevents potential assertion failures in piglit fbo-incomplete-texture-03 test.

NOTE: This is a candidate for the 7.11 branch.
2011-09-22 17:01:18 +02:00
Christoph Bumiller
0cf1a55568 d3d1x: setup draw info primitive restart parameters 2011-09-22 16:53:54 +02:00
Brian Paul
4465efc3bf draw: add support for guard-band clipping 2011-09-22 08:26:40 -06:00
José Fonseca
a5c0fb51c6 draw: Reduce the number of vertex shader variants per context to 128. 2011-09-22 08:26:40 -06:00
Kurt Daverman
3c56280d33 draw: Respect max_indices from the renderer. 2011-09-22 08:26:40 -06:00
Brian Paul
37ef7c22ab translate: check for PIPE_SUBSYSTEM_EMBEDDED 2011-09-22 08:26:36 -06:00
Jakob Bornecrantz
c8c2fc9a7a tgsi: Check in scan for fs position and depth reads 2011-09-22 08:26:36 -06:00
Brian Paul
379353e16b svga: skip assertion when index_bias < 0
See bug 688383
2011-09-22 08:26:36 -06:00
Brian Paul
1a35fde7c8 svga: fix the test for sRGB texture formats
The pipe_sampler_view::format field should be prefered over the resource/
texture format.  The former is used to override the texture format for
sRGB decode enable/disable, etc.

Also, use new util_format_is_srgb() helper to catch all sRGB formats.

This fixes the piglit tex-srgb test for GL_EXT_texture_sRGB_decode.
2011-09-22 08:26:36 -06:00
Brian Paul
ff6cf60cb8 gallium/util: add util_format_is_srgb() helper 2011-09-22 08:26:36 -06:00
Keith Whitwell
553930424d util: add u_bit_scan helper 2011-09-22 08:26:36 -06:00
José Fonseca
ffb1996f61 util: Allow to make the depth/stencil format queries without repeatedly looking up the format description.
All functions here should take struct util_format_description * IMO, to
incentive efficient code.
2011-09-22 08:26:36 -06:00
Keith Whitwell
c40c1599bb util: single call to util_format_description in fill_rect 2011-09-22 08:26:35 -06:00
José Fonseca
f2a2ba9c6c util: Handle conversion between depth stencil formats. 2011-09-22 08:26:35 -06:00
Stéphane Marchesin
51f641291d i915g: Add an optimization to get rid of useless movs, in particular at the end of some shaders. 2011-09-21 18:01:43 -07:00
Stéphane Marchesin
fc1fbb2dc1 i915g: Fix some whitespace problems. 2011-09-21 18:01:41 -07:00
Stéphane Marchesin
bfe507bcff i915g: Blend equation separate seems to work. 2011-09-21 18:01:41 -07:00
Stéphane Marchesin
ef1fa4467f i915g: Add ifdef'd out code to dump compiled shaders. 2011-09-21 18:01:40 -07:00
Stéphane Marchesin
9a15b1eb95 i915g: Fix bug in shader optimizer. 2011-09-21 18:01:39 -07:00
Stéphane Marchesin
ca8492c284 i915g: Remove stale function prototype. 2011-09-21 18:01:38 -07:00
Brian Paul
559a0cd1fc svga: call u_default_redefine_user_buffer() to fix failed assertion
This fixes a regression from a8cf4b6acf

The problem occured when two successive glDrawArrays calls accessed
subsequent elements in user-space arrays.  The user-space array
from the first call wasn't being grown to accomodate the second
draw call's elements.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-21 16:32:00 -06:00
Eric Anholt
a140c3e783 meta: Don't hang on to program refcounts after metaops are done.
Fixes piglit ARB_shader_objects/clear-with-deleted.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39577
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-21 10:17:54 -07:00
Eric Anholt
d4444b8e5b i965/vs: Return a dummy value when visiting ir_texture.
While the program won't successfully link in the end, this avoids
possible assertion failure in the driver during linking if
this->result isn't initialized with something already.
2011-09-21 09:46:39 -07:00
Eric Anholt
d158f6e73b i965/gen6+: When only BFC is written, use BFC as the color.
Fixes piglit vertex-program-two-side enabled back back2
2011-09-21 09:46:39 -07:00
Eric Anholt
447c488d77 i965/gen6+: Respect the VERTEX_PROGRAM_TWO_SIDE flag for shaders.
Fixes piglit:
vertex-program-two-side enabled front back front2 back2
vertex-program-two-side enabled front back
vertex-program-two-side enabled front2 back2
2011-09-21 09:46:39 -07:00
Eric Anholt
b68e3422ed mesa: Add a context flag indicating whether two-sided lighting should happen.
The 965 driver was ignoring the VERTEX_PROGRAM_TWO_SIDE flag and only
looking at fixed-function state.
2011-09-21 09:46:38 -07:00
Brian Paul
169f57255a util: remove stray debug code 2011-09-21 08:26:29 -06:00
Brian Paul
0e6646db32 mesa: check glBegin()/glDrawArrays()/etc mode with _mesa_valid_prim_mode()
We now raise an GL_INVALID_ENUM in glBegin() if mode is illegal, as was
done in Yuanhan Liu's original patch.

Take geometry shaders support into account too.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-21 08:22:07 -06:00
Brian Paul
51002968c9 gallivm: fix build with llvm 3.0svn
https://bugs.freedesktop.org/show_bug.cgi?id=41065
2011-09-21 07:24:03 -06:00
Brian Paul
4ef82cee6d tnl: include swrast/s_chan.h to fix sse build 2011-09-21 06:49:33 -06:00
Chia-I Wu
4a96a02de7 st/vega: fix drawing images with alpha channel
Checking if the paints are opaque in renderer_validate_blend() does not
work.  We could be drawing images.  Remove the check from
renderer_validate_blend() and take image drawing into consideration in
blend_use_shader().

The bug was introduced by 3f0a966807,
which affects the lookup demo.
2011-09-21 12:01:21 +08:00
Chia-I Wu
ceb6d34906 st/vega: fix vg_context_is_object_valid()
vg_context_is_object_valid() checks if a handle is valid by checking if
the handle is a valid key of the object hash table.  However, the keys
of the object hash table were object pointers.

Fix vg_context_add_object() to use the handles as the keys so that
vg_context_is_object_valid() works.  This bug was introduced by
99c67f27d3.
2011-09-21 12:01:03 +08:00
Brian Paul
bdddf1cc26 swrast: s/GLubyte/GLchan/ in a cast 2011-09-20 21:06:19 -06:00
Brian Paul
72648c25e6 llvmpipe: silence a pointer type warning 2011-09-20 20:33:45 -06:00
Brian Paul
de740d7b0a meta: use _mesa_set_enable() in more places
Avoids an extra context lookup.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-20 20:17:42 -06:00
Brian Paul
9e414865a6 meta: use _mesa_set_enable(), fix decompress_texture_image()
Use _mesa_set_enable() to avoid a redudant context lookup.
Need to disable the texture target in decompress_texture_image() so the
unit isn't still enabled after glGetTexImage() returns.  Arguably, the
meta restore code should do this, but it doesn't.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-20 20:17:42 -06:00
Brian Paul
20b92c9d1e st/mesa: specify source mipmap level in decompress_with_blit()
This, along with the previous patch, fixes glGetTexImage() of compressed
textures for level > 0.
2011-09-20 20:17:42 -06:00
Brian Paul
f63dbc600f gallium/util: observe sampler view's first_level in util_blit_pixels_tex()
This lets us blit from a non-zero source level.
2011-09-20 20:17:42 -06:00
Brian Paul
1e939f5374 meta: fix broken sRGB mipmap generation
If we're generating a mipmap for an sRGB texture we need to bypass
sRGB->linear conversion.  Otherwise the destination mipmap level
(drawn with a textured quad) will have the wrong colors.
If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode)
we need to use the software fallback for mipmap generation.

Note: This is a candidate for the 7.11 branch.
2011-09-20 20:17:42 -06:00
Brian Paul
4731a598f0 mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros
The 1-bit alpha channel was incorrectly encoded.  Previously, any non-zero
alpha value for the ubyte alpha value would set A=1.  Instead, use the
most significant bit of the ubyte alpha to determine the A bit.  This is
consistent with the other channels and other OpenGL implementations.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-09-20 20:17:42 -06:00
Brian Paul
4d53fb525d mesa: move last bits of GLchan stuff into swrast
This removes the last remnants of the GLchan datatype and associated
macros out of core Mesa and into swrast.
2011-09-20 20:17:42 -06:00
Brian Paul
ef275f907c mesa: remove CHAN_TYPE cruft from debug.c 2011-09-20 20:17:41 -06:00
Brian Paul
59e858f462 mesa: remove unused interp/stride chan macros 2011-09-20 20:17:41 -06:00
Brian Paul
460863ace9 mesa: remove unused UNCLAMPED_FLOAT_TO_RGB_CHAN() macro 2011-09-20 20:17:41 -06:00
Brian Paul
499f0685e8 radeon: use _mesa_unclamped_float_rgba_to_ubyte() 2011-09-20 20:17:41 -06:00
Brian Paul
8530d72c4e r200: use _mesa_unclamped_float_rgba_to_ubyte() 2011-09-20 20:17:41 -06:00
Brian Paul
d71c03836e mesa: remove unused <type>_TO_CHAN() macros 2011-09-20 20:17:41 -06:00
Brian Paul
e1d703bec5 mesa: convert _mesa_unpack_color_span_chan() to ubyte 2011-09-20 20:17:41 -06:00
Brian Paul
ae670b58d4 mesa: replace GLchan with GLubyte in texcompress_s3tc.c 2011-09-20 20:17:41 -06:00
Brian Paul
b4e6afbf77 mesa/gallium: remove GLchan from latc, rgtc code 2011-09-20 20:17:41 -06:00
Brian Paul
960694fd2d mesa: remove GLchan in texcompress_fxt1.c 2011-09-20 20:17:41 -06:00
Brian Paul
663f61a3e1 mesa: s/_mesa_make_temp_chan_image()/_mesa_make_temp_ubyte_image()
Another step toward eliminating the GLchan type.
2011-09-20 20:17:41 -06:00
Brian Paul
ece8d6f25c mesa: move _mesa_upscale_teximage2d() to texcompress_fxt1.c
Was used by no other code.
2011-09-20 20:17:41 -06:00
Brian Paul
529b9360f3 mesa: s/GLchan/GLubyte/ in mipmap generation code 2011-09-20 20:17:41 -06:00
Kenneth Graunke
dbae496083 make: Don't use builtin_stubs.cpp for standalone GLSL compiler.
builtin_stubs.cpp is only supposed to be used for builtin_compiler.  It
contains a stub version of _mesa_glsl_initialize_functions() that does
nothing.

libglsl.a already contains builtin_function.cpp, the generated file that
contains a version of _mesa_glsl_initialize_functions() that actually
initializes all the built-in functions.

By mistakenly linking to builtin_stubs, glsl_compiler and glsl_test are
unable to compile any shaders that use built-in functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-09-20 18:21:45 -07:00
Ian Romanick
b152a239b1 GLES2/gl2ext: upgrade to gl2ext.h version 15049 2011-09-20 15:54:52 -07:00
Ian Romanick
011e946cb0 mesa: Don't expose compressed paletted formats via GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS
Fixes a bug introduced by commit faf5d65.  These formats should only
be exposed in OpenGL ES 1.x.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: Xun Fang <xunx.fang@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40860
2011-09-20 15:42:05 -07:00
Brian Paul
977e269c3e gallium: remove trailing comma to silence warning 2011-09-20 16:36:21 -06:00
Paul Berry
8b06b0d19d Gallium: Increase PIPE_MAX_CLIP_PLANES to 8.
Since Mesa is now capable of supporting up to 8 clipping planes
instead of 6, this patch updates Gallium internals to support 8
clipping planes as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-20 14:51:16 -07:00
Paul Berry
bc00370832 Gallium: remove unnecessary ifdef for MAX_CLIPPED_VERTICES.
draw_pipe_clip.c contained an ifdef to ensure that its local
definition of MAX_CLIPPED_VERTICES would not take effect if the global
MAX_CLIPPED_VERTICES (defined in src/mesa/main/config.h) was already
defined.  This was unnecessary because draw_pipe_clip.c doesn't
directly or indirectly include src/mesa/main/config.h.  Removed the
ifdef to reduce confusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-20 14:51:16 -07:00
Paul Berry
61b2d01101 Increase MAX_CLIP_PLANES to 8
This will allow drivers to increase ctx->Const.MaxClipPlanes to 8,
which is required for GLSL-1.30 compliance.

No driver behavior should be affected.  However, many data structures
use MAX_CLIP_PLANES as an array size, so these arrays will get
slightly larger.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:13 -07:00
Paul Berry
2dfa33a5e9 Hardcode the default value of ctx->Const.MaxClipPlanes to 6.
Previously this value was set to MAX_CLIP_PLANES, which is defined to
be 6.  But MAX_CLIP_PLANES needs to be increased to 8 to support
GLSL-1.30-compliant drivers.  This patch hard-codes the default value
of ctx->Const.MaxClipPlanes to 6, so that when MAX_CLIP_PLANES is
increased, it won't affect drivers that do not support 8 clip planes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:10 -07:00
Paul Berry
8be653164d i965: Remove bogus assertion on MAX_CLIP_PLANES.
This patch removes the assertion "MAX_CLIP_PLANES == 6" from the i965
driver.  This assertion is unnecessary; nothing in the driver requires
MAX_CLIP_PLANES to be 6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:07 -07:00
Paul Berry
27bdc76eb9 mesa: Update clipping code to use ctx->Const.MaxClipPlanes.
To support GLSL 1.30, we will need to increase MAX_CLIP_PLANES to 8.
To avoid breaking drivers that do not yet support 8 clip planes, this
patch modifies the Mesa core code that pertains to clipping to use
ctx->Const.MaxClipPlanes rather than MAX_CLIP_PLANES, since
ctx->Const.MaxClipPlanes will remain 6 for drivers that only support 6
clip planes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:03 -07:00
José Fonseca
c773de133a scons: Unbreak mingw build. 2011-09-20 20:50:48 +01:00
José Fonseca
f8aeb1c990 scons: MacOSX build fixes. 2011-09-20 20:41:57 +01:00
Bryan Cain
6da8c21124 glsl_to_tgsi: implement ir_binop_all_equal and ir_binop_any_nequal for native integers 2011-09-20 14:39:30 -05:00
Eric Anholt
c662764f4f i965/vs: Add support for compute-to-MRF.
Removes 1.8% of the instructions from 97% of the vertex shaders in
shader-db.
2011-09-20 11:28:56 -07:00
Eric Anholt
0502db1eab i965/vs: Do VUE writes using the MRF file instead of hardware register.
We'll only do compute-to-MRF on accesses to this file.
2011-09-20 11:28:56 -07:00
Eric Anholt
65d46c96c2 i965/vs: Handle destinations in the MRF file.
We've been referencing MRFs through the HW_REG file so far, but that
makes it harder to handle compute-to-MRF and similar optimizations.
2011-09-20 11:28:56 -07:00
Eric Anholt
160848d8ef i965/vs: Add a function for how many MRFs get written as part of a SEND.
This will be used for compute-to-mrf, which needs to know when MRFs
get overwritten.
2011-09-20 11:28:56 -07:00
Eric Anholt
63bc443f8a i965/vs: Remove dead fields of src_reg.
These were copy and pasted from the FS, and are never used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-20 11:28:56 -07:00
Eric Anholt
f0c04e6c22 i965/vs: Add support for simple algebraic optimizations.
We generate silly code for array access, and it's easier to generally
support the cleanup than to specifically avoid the bad code in each
place we might generate it.

Removes 4.6% of instructions from 41.6% of shaders in shader-db,
particularly savage2/hon and unigine.

v2: Fixes by Ken: Make is_zero/one member functions, and fix a
    progress flag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-20 11:28:56 -07:00
Eric Anholt
7288d010e0 i965: Fix polygon stipple offset state flagging.
_NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing
_NEW_BUFFERS to update the stipple offset when FBO binding or window
size changed, and _NEW_POLYGON to update when stippling gets enabled.

Fixes oglconform's tristrip test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-20 10:20:06 -07:00
Eric Anholt
4c9b09d3c2 i965: Add missing _NEW_POLYGON flag to polygon stipple upload.
Because we skip the pattern upload when stippling is disabled, we need
to check again when it might have been turned on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-20 10:20:06 -07:00
Eric Anholt
c310c35a75 i965: Fix compiler warnings. 2011-09-20 10:20:06 -07:00
Yuanhan Liu
a11b4c1e7a mesa: fix error handling for glMaterial*
Trigger GL_INVALID_ENUM error if the face paramter is not a valid value.

Trigger GL_INVALID_VALUE error if the GL_SHININESS value is out side
[0, ctx->Constant.MaxShiniess].

v2: fix the max shininess value.

v3: suggested by Brian, move the face check into glMaterialfv function
    to reduce code duplicate. Also, refactor the error message.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-20 08:05:34 -06:00
Chia-I Wu
a5f8d37be1 st/egl: add support for null platform
The backend calls null_sw_create() to create sw_winsys.  And that is
pretty much it...
2011-09-20 17:44:20 +08:00
Chia-I Wu
5eca41665b egl: add null platform
The null platform has no window or pixmap surface (but pbuffer surface).
And the only valid display is EGL_DEFAULT_DISPLAY.  It is useful for
offscreen rendering.  It works everywhere becase no window system is
required.
2011-09-20 17:44:15 +08:00
Dave Airlie
fb4ceb9638 configs: remove rest of APP_LIB_DEPS lines
pointed out by GArik_ on #radeon.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-20 08:25:25 +01:00
Kenneth Graunke
47b556fbca i965/fs: Implement texelFetch() on Gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Kenneth Graunke
0edf5d63d6 i965/fs: Implement texelFetch() on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Kenneth Graunke
30be2cc6c7 i965/fs: Implement texelFetch() on Ironlake and Sandybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Ian Romanick
051c901559 glapi: Update generated file modified by previous commit 2011-09-19 12:02:21 -07:00
Ian Romanick
c78baae796 glapi: Don't emit remap data for individual extensions
All of the extensions actually supported by Mesa have been remapped by
remap.c for a long time.  Emitting all of these data structures is
just clutter.

Drivers that need additional functions remapped, should add
'offset="assign"' to the function definition in the .xml file.

The changes to remap_helper.h are in a follow-on ~8700 line patch that
would surely be rejected by the mailing list.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-09-19 12:02:21 -07:00
Ian Romanick
76e5020e90 mesa: Delete stale comment about MESAX extensions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:21 -07:00
Ian Romanick
2e1cc883b3 mesa: Replace _mesa_rgba_logicop_enabled(ctx) with ctx->Color.ColorLogicOpEnabled
Since GL_EXT_blend_logic_op is removed, _mesa_rgba_logicop_enabled(ctx)
just returns ctx->Color.ColorLogicOpEnabled.  That seems kind of silly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:21 -07:00
Ian Romanick
2836aab203 mesa: Use ColorLogicOpEnabled instead of _LogicOpEnabled
Since GL_EXT_blend_logic_op is removed, _LogicOpEnabled and
ColorLogicOpEnabled always have the same value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:20 -07:00
Ian Romanick
113e8167de mesa: Remove support for GL_EXT_blend_logic_op
Support is removed for four reasons:

1. The implementation was broken with respect to separate blend
equations.  The GL_EXT_blend_equation_separate spec says:

    "If EXT_blend_logic_op and EXT_blend_equation_separate are both
    supported, the logic op blend equation should be supported separately
    for RGB and alpha as with the other blend equation modes."

But Mesa's implementation of GL_LOGIC_OP specifically forbids this.

2. No hardware supported by Mesa can support separate blend equations
involving GL_LOGIC_OP.

3. No applications could be found that use this extension.

4. No other Linux OpenGL drivers support this extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Cc: Brian Paul <brianp@vmware.com>
2011-09-19 12:02:20 -07:00
Ian Romanick
3538bffa72 st/mesa: Remove support for GL_EXT_blend_logic_op
It was broken, and it isn't really useful anyway.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Cc: Brian Paul <brianp@vmware.com>
2011-09-19 12:02:20 -07:00
Ian Romanick
636dd62131 mesa: Remove unused _mesa_enable_imaging_extensions function
The last user of this function was driInitExtensions, and that function
was removed in a previous commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:20 -07:00
Colin Walters
4d515c2146 autogen.sh: Honor NOCONFIGURE environment variable
See http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-19 19:53:49 +01:00
Eric Anholt
fd17de2123 mesa: Throw an error when starting conditional render on an active query.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-while-active.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-19 11:51:53 -07:00
Eric Anholt
7371224c06 mesa: Throw an error instead of asserting for condrender with query == 0.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-19 11:51:53 -07:00
Eric Anholt
8899f6e93c mesa: Add support for Begin/EndConditionalRender in display lists.
Fixes piglit nv_conditional_render-dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-19 11:51:53 -07:00
Marek Olšák
da90c8fc27 mesa: fix an autoconf build-system bug related to glsl_to_tgsi
st_glsl_to_tgsi.cpp was completely ignored by makedepend because it was
not included in ALL_SOURCES, which caused that the file was not recompiled
when certain header files were changed (like glsl/ir.h).

The first part of this commit is just a consolidation.
The second part is the fix.
2011-09-19 20:27:54 +02:00
Brian Paul
2ce8c3553b mesa: fix format/type check in unpack_image() for bitmaps
Passing type == GL_BITMAP returns 0 while error values return -1.
This fixes glPolygonStipple being compiled into display lists.
2011-09-19 11:39:30 -06:00
Paul Berry
20da49b267 i965 new VS: Fix copy propagation of double negatives.
When copy propagating a value into an instruction that negates its
argument, we need to invert the sense of the value's "negate" flag, so
that -(+x) becomes -x and -(-x) becomes +x.

Previously, we were always setting the value's "negate" flag to true
in this circumstance, so that both -(+x) and -(-x) turned into -x.

Fixes Piglit test vs-double-negative.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-19 10:24:08 -07:00
Ian Romanick
24a113093b mesa: Advertise GL_OES_compressed_paletted_texture in OpenGL ES1.x
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
13757f7080 mesa: Remove redundant compressed paletted texture error checks
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
3ebbfc8372 mesa: Refactor compressed texture error checks to work with paletted textures
This code was really broken before.  A lot of the error checks were
done much later (too late), and some of the error checks would fail.
The underlying problem is that Mesa doesn't ever keep compressed paletted
textures in their original format.  The textures are immediately
converted to some RGB or RGBA format.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39991
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
b433e7ba07 mesa: Add _mesa_cpal_compressed_format_type
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
a2cab751be mesa: Refactor expected texture size check in cpal_get_info
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
fc0fa16be3 mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:46 -07:00
Ian Romanick
a454c835fa mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_is_compressed_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:46 -07:00
Nicholas Miell
4e7079ed54 Update llvmpipe's gitignore
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 10:50:17 -06:00
Yuanhan Liu
099af9e9df mesa: fix error handling for glMapBufferRange
Accroding the man page, GL_INVALID_VALUE would generated if access has any
bits set other than those valid defined bits.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:22:18 -06:00
Brian Paul
386ec5e80e mesa: generate GL_INVALID_OPERATION in glIsEnabledIndex() between Begin/End 2011-09-19 08:13:47 -06:00
Yuanhan Liu
57b8f13aa4 mesa: fix error handling for glSelectBuffer
According the man page, trigger a GL_INVALID_VALUE if size < 0.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:52 -06:00
Yuanhan Liu
7a9a8bbabd mesa: fix error handling for glPixelZoom
According the man page, GL_INVALID_OPERATION should generated if
glPixelZoom is executed between the execution of glBegin and the
corresponding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:52 -06:00
Yuanhan Liu
6a98802243 mesa: fix error handling for glIsEnabled
According the man page, GL_INVALID_OPERATION should be generated if
glIsEnabled is executed betwwen the execution of glBegin and the
correspoding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:52 -06:00
Yuanhan Liu
b020b111a8 mesa: fix error handling for glTexEnv
Fix error handling while calling glTexEnv with invalid texture
environment parameters.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:51 -06:00
Yuanhan Liu
f1ddde5c16 mesa: fix error handling for some glGet* functions
According to the man page, it should trigger a GL_INVALID_OPERATION
while calling some glGet* functions inside glBegin and glEnd.

This patch dose handle the following functions:
 glGetBooleanv
 glGetFloatv
 glGetIntegerv
 glGetInteger64v
 glGetDoublev

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:51 -06:00
Yuanhan Liu
21b2895bd0 mesa: fix error handling for glEvalMesh1/2D
According man page, trigger error when calling glEvalMesh1/2D inside
glBegin/glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:51 -06:00
Matt Turner
f534c13413 Remove unused APP_LIB_DEPS variable
Unused since removal of demos from the repository?

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 07:39:19 -06:00
Matt Turner
75eb92fb28 egl_glx.c: use unsigned instead of uint
We've had a hack to fix this in Gentoo on Solaris for a while.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 07:39:04 -06:00
Matt Turner
116e896aaf Remove unneeded xdamages header from dri2_glx.c.
It's needed for dri1 but not dri2.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 07:34:46 -06:00
Dave Airlie
f8c190b0ab graw: fix tests to build on msvc again.
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=40997

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-19 10:20:10 +01:00
Tom Stellard
2d1004d9aa r300/compiler: Fix regalloc for values with multiple writers
https://bugs.freedesktop.org/show_bug.cgi?id=40062
https://bugs.freedesktop.org/show_bug.cgi?id=36939

Note: This is a candidate for the 7.11 branch.
2011-09-18 18:00:14 -07:00
Brian Paul
63b5902756 swrast: fix more store_texel() bugs
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412 on swrast.
2011-09-18 11:24:04 -06:00
Dave Airlie
6dd284f7c8 gallium: move clear paths from rgba to a pointer to a color union (v2)
This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values.

Notes:
1. the value is opaque.
2. only when the value is used should it be interpretered according to
the surface format it is going to be used with.
3. float clears on integer buffers and vice-versa are undefined.

v2: fixed up vega and graw, dropped hunks that shouldn't have been in
patch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-18 15:12:47 +01:00
Brian Paul
78026b8ace mesa: use ctx->Driver.AllocTextureImageBuffer() to alloc texture memory 2011-09-17 14:57:41 -06:00
Brian Paul
e6cf338d01 mesa: plug in swrast texture image alloc/free functions
Use the swrast allocation/free functions instead of core Mesa.
2011-09-17 14:57:40 -06:00
Brian Paul
efc93219a9 swrast: add Alloc/FreeTextureImageBuffer() driver functions
Not called yet.  These will replace the core Mesa functions for allocating
and freeing malloc'd texture memory.
2011-09-17 14:57:40 -06:00
Brian Paul
d1da1c0ca8 mesa: add AllocTextureImageBuffer() driver hook 2011-09-17 14:57:40 -06:00
Brian Paul
a1661dc895 mesa: move gl_texture_image::FetchTexel fields to swrast
This also involves passing swrast_texture_image instead of gl_texture_image
into all the fetch functions.
2011-09-17 14:57:40 -06:00
Brian Paul
20177a620e swrast: plug in _swrast_new/delete_texture_image() functions 2011-09-17 14:57:40 -06:00
Brian Paul
abdfa0b4f1 radeon: make radeon_texture_image a subclass of swrast_texture_image 2011-09-17 14:57:40 -06:00
Brian Paul
fa2c886863 intel: make intel_texture_image a subclass of swrast_texture_image
We need to subclass swrast_texture_image because if we use swrast for
fallback rendering, we'll need to have swrast_texture_image objects.
2011-09-17 14:57:40 -06:00
Brian Paul
1da896803c swrast: introduce new swrast_texture_image struct
No subclass fields yet.  Subsequent patches will add the fields related
to software rendering that are currently in gl_texture_image.
2011-09-17 14:57:40 -06:00
Brian Paul
146f536b33 mesa: add new DeleteTextureImage() driver hook
Matches the NewTextureImage() hook.  With new subclasses of
gl_texture_image coming we need a new hook to properly delete objects of
those subclasses.
2011-09-17 14:57:40 -06:00
Brian Paul
baeefef2c0 mesa: move software texel fetch code into swrast
It's only used by swrast now so move it out of core Mesa.
2011-09-17 14:57:40 -06:00
Brian Paul
ce82914f5a mesa: move _mesa_update_fetch_functions() calls into swrast
Do it during swrast state validation since the FetchTexel() functions
are only called from swrast now and not core Mesa.
Remove assertions in mipmap.c since they're no longer appropriate.
2011-09-17 14:57:40 -06:00
Brian Paul
f0f28548c2 mesa: implement unpack_SIGNED_GR1616 in format_unpack.c 2011-09-17 13:36:58 -06:00
Brian Paul
6e423253e7 meta: fix/add checks for GL_EXT_framebuffer_sRGB
This fixes spurious GL errors when the GL_EXT_framebuffer_sRGB extension
is not supported.

Note: This is a candidate for the 7.11 branch
2011-09-17 11:14:21 -06:00
Brian Paul
3b29631c33 mesa: s/short/ushort/ in unpack_SIGNED_RGBA_16() 2011-09-17 10:50:42 -06:00
Christoph Bumiller
ee09c1e1c3 d3d1x: fix parsing of SM4 relative addressing register op 2011-09-17 12:11:44 +02:00
Christoph Bumiller
4a06248281 d3d1x: set flatshade_first in rasterizer state
D3D10 specifies the first vertex as the leading/provoking one.
2011-09-17 12:09:03 +02:00
Christoph Bumiller
e27d72d6c3 d3d1x: initialize point size and line width to 1
Otherwise lines would never be visible since the width cannot be
specified in D3D10.
Wireframe mode is also affected by line width.
2011-09-17 12:07:42 +02:00
Tom Stellard
e945fb04d0 r300/compiler: Add support for the output modifier (OMOD) 2011-09-16 17:35:46 -07:00
Tom Stellard
1e5aaaa138 r300/compiler: Move some helper functions to radeon_compiler_util.c 2011-09-16 17:19:56 -07:00
Tom Stellard
96620d2275 r300/compiler: Don't unroll loops that conditionally increment the counter 2011-09-16 17:19:56 -07:00
Vinson Lee
79b162ba45 nouveau: Fix typos of ParseSourceList in SConscript files.
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-09-16 14:07:20 -07:00
Brian Paul
88625e6e65 scons: fix incorrect test for embedded build
This was missed back in commit 4175010749.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-16 10:13:14 -06:00
Marek Olšák
34f4bd8190 winsys/radeon: use the cache bufmgr for buffers with PIPE_BIND_CUSTOM
so that we don't abuse PIPE_BIND_VERTEX_BUFFER all the time.
2011-09-16 17:25:12 +02:00
Brian Paul
81c688babe softpipe: use pipe_get_tile_rgba_format()
Pass an explicit surface format as we do with pipe_put_tile_rgba_format().
This fixes the piglit fbo-srgb-blit test.  With GL_EXT_framebuffer_sRGB we
override the resource's format with an explicit format (linear vs. sRGB).
We need to do so both when getting and putting tiles.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40402

Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-16 07:38:53 -06:00
Brian Paul
89999204ec softpipe: use util_format_is_depth_or_stencil()
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-16 07:38:53 -06:00
Dave Airlie
2b47d2bce1 r600g: fixup missing scaled r600 types.
I was still missing a couple of types on r600/r700 codepaths.

Fixes these up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 14:09:16 +01:00
Dave Airlie
f2bae9456f r600g: interpret integer texture types as ints.
For signed/unsigned with no normalisation or srgb, assume its an INT
type texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:26:57 +01:00
Dave Airlie
2dfabdd0a4 r600g: take constantly interpolated values into a/c
We could constant interpolated values now and set have_perspective
if nothing else is set to avoid a GPU hang.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:26:57 +01:00
Dave Airlie
21c5607e64 r600g: add flat non-interpolation support.
TGSI CONSTANT interpolation is just flat, and we just read the values
direct from the LDS into the GPR without doing any interpolation on them.

This is needed to pass integer types into the fragment shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:25:48 +01:00
Dave Airlie
de3218664a r600g: set number type correctly for color buffers.
If we get a scaled type assume its a real integer type (as textures are).

Also fixup the blend bypass and blend clamp flags on evergreen as per the
docs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:25:48 +01:00
Dave Airlie
b205f53c7f r600g: add missing formats to color buffer setup.
just playing with EXT_texture_integer, and this was first bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:25:48 +01:00
Brian Paul
3edbce32fb softpipe: use consistent indentation in sp_quad_blend.c 2011-09-15 16:18:14 -06:00
Tobias Droste
1795372fee gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn added SubtargetInfo as additional parameter to
createMCDisassembler() and createMCInstPrinter().
See revision 139237 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-15 15:53:04 -06:00
Eugeni Dodonov
72e0a9226d Change strerror(ret) to strerror(-ret). 2011-09-15 15:12:02 -03:00
Brian Paul
a7109a3199 softpipe: fix blending for luminance/intensity surfaces
If we're drawing to a luminance, luminance/alpha or intensity surface
we have to adjust (rebase) the fragment/quad colors before writing them
to the tile cache.  The tile cache always stores RGBA colors but if
we're caching a L/A surface (for example) we need to be sure that R=G=B
so that subsequent reads from the surface cache appear to return L/A

We previously had a special case for RGB (no alpha) surfaces.  This
change generalizes that for the other base formats.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40408, but sRGB
formats are still failing.  That'll be addressed in a later patch.
2011-09-15 11:31:55 -06:00
Brian Paul
ba6f1f2c29 util: add util_format_is_luminance/intensity/rgb(), etc
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-15 11:31:55 -06:00
Jørgen Lind
0763b978ee wayland: Flush before blocking in swapbuffers.
Make sure that we've sent the frame request that we're going to block on.
2011-09-15 11:53:39 -04:00
Brian Paul
6fd6efa7bf mesa: fix error handling for dlist image unpacking
When compiling glDrawPixels, glTexImage(), etc. and we're copying
the user's image we need to be careful about GL error checking.
Previously, we were incorrectly generating GL_OUT_OF_MEMORY in
unpack_image() if width <= 0 or height <= 0 or for invalid format/type
values.  We now check those arguments in unpack_image() and return NULL
if there's a bad value.  The command will get compiled with the
arguments as-is and image=NULL.  Later, when the command is executed the
correct errors will be generated.

This issue was reported by Yuanhan Liu <yuanhan.liu@linux.intel.com>

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-15 09:39:13 -06:00
Brian Paul
b0524e49fc st/mesa: rewrap a long line 2011-09-15 09:05:15 -06:00
Brian Paul
4e58e56f6f mesa: add missing ')' in error message 2011-09-15 08:02:57 -06:00
Dave Airlie
41f3773c1d uniforms: accept all int/unsigned int sampler types in uniform checks.
I'm not 100% sure about this, it may need a version check or it might
be completely wrong.

added multisample ones as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-15 09:33:45 +01:00
Paul Berry
00792e3586 glsl: Remove field array_lvalue from ir_variable.
The array_lvalue field was attempting to enforce the restriction that
whole arrays can't be used on the left-hand side of an assignment in
GLSL 1.10 or GLSL ES, and can't be used as out or inout parameters in
GLSL 1.10.

However, it was buggy (it didn't work properly for built-in arrays),
and it was clumsy (it unnecessarily kept track on a
variable-by-variable basis, and it didn't cover the GLSL ES case).

This patch removes the array_lvalue field completely in favor of
explicit checks in ast_parameter_declarator::hir() (this check is
added) and in do_assignment (this check was already present).

This causes a benign behavioral change: when the user attempts to pass
an array as an out or inout parameter of a function in GLSL 1.10, the
error is now flagged at the time the function definition is
encountered, rather than at the time of invocation.  Previously we
allowed such functions to be defined, and only flagged the error if
they were invoked.

Fixes Piglit tests
spec/glsl-1.10/compiler/qualifiers/fn-{out,inout}-array-prohibited*
and
spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-14 10:58:56 -07:00
Michel Dänzer
373234ce17 r600g: Initialize multi VGT related register on Cayman.
Prevents lockups with piglit tests draw-elements and draw-vertices using large
numbers of vertices.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alex.deucher@amd.com>
2011-09-14 18:40:16 +02:00
Michel Dänzer
d8c443ddde glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
As already done in dri2CopySubBuffer().

Should fix:

https://bugs.freedesktop.org/show_bug.cgi?id=36371
https://bugs.freedesktop.org/show_bug.cgi?id=40533

Might fix:

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

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-09-14 18:40:16 +02:00
Andrew Deason
48510d6856 DRI: Log something if we don't support legacy DRI
If we are called via the legacy DRI interface, and we don't support
legacy DRI (InitScreen is NULL), print a debug message, so it is easy
to see why the driver fails to initialize.

See https://bugs.freedesktop.org/show_bug.cgi?id=40437
2011-09-14 18:39:45 +02:00
Andrew Deason
45e0a7a51d GLX: Say something if we cannot connect via DRI2
See https://bugs.freedesktop.org/show_bug.cgi?id=40437
2011-09-14 18:37:48 +02:00
Christoph Bumiller
7744e867b7 nvc0: implement resource_resolve 2011-09-14 18:30:53 +02:00
José Fonseca
9cae933f4a llvmpipe: Remove dead lp_tile_shuffle_mask.py script.
Broken, and we now shuffle tiles with pack/unpack instructions, instead
of shuffle masks.
2011-09-14 16:48:17 +01:00
José Fonseca
f87be0bae9 scons: Remove dead MSVC SDK/DDK/WINCE tools.
Not really used anymore.
2011-09-14 16:45:44 +01:00
Christoph Bumiller
d2d19ea51f nv50/ir: add missing license headers 2011-09-14 16:50:23 +02:00
Brian Paul
ec4b823f67 st/mesa: fix/update comment on st_translate_color() 2011-09-14 08:32:30 -06:00
Christoph Bumiller
c57c7a86ae nvc0: emit tessellation mode and patch size in TCP/TEP validation 2011-09-14 16:19:52 +02:00
Christoph Bumiller
d53c49bcd4 nv50,nvc0: handle PIPE_CAP_MIN/MAX_TEXEL_OFFSET 2011-09-14 16:19:52 +02:00
Christoph Bumiller
2dc6f74077 nvc0: remove old shader backend files 2011-09-14 16:19:52 +02:00
Christoph Bumiller
3afabfb929 nvc0: hook up to new shader code generator
Also includes loading of shared shader library code (used for f64
and integer division) and setting up the immediate array buffer
which is appended to the code.
2011-09-14 16:19:52 +02:00
Christoph Bumiller
57594065c3 nv50/ir: import new shader backend code 2011-09-14 16:19:52 +02:00
Christoph Bumiller
a42eca84c5 nvc0: prevent interruption of m2mf push
M2MF will trap if the data stream is interrupted by a QUERY fence
and report too much or not enough data.
2011-09-14 16:19:52 +02:00
Christoph Bumiller
150bb0fb34 nouveau: make data argument of nouveau_context::push_data const 2011-09-14 16:19:51 +02:00
Brian Paul
ec22b75be1 softpipe: implement blend color clamping
Per the GL spec, clamp incoming colors prior to blending depending on
whether the destination buffer stores normalized (non-float) values.
Note that the constant blend color needs to be clamped too (we always
get the unclamped color from Mesa).

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412
2011-09-14 08:15:59 -06:00
Brian Paul
4fc50d4570 mesa: minor clean-up on _mesa_unclamped_float_rgba_to_ubyte()
Add a comment and reformat to be under 80 columns.
2011-09-14 08:15:59 -06:00
Brian Paul
4d21ecde77 mesa: white space, comment fixes in mtypes.h
"vale" was a typo.  Fix that and do some other minor clean-ups.
2011-09-14 08:15:59 -06:00
Emeric Grange
e911dbb563 st/vdpau: Preliminary support for timestamped output surface into the presentation queue
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:29 +02:00
Emeric Grange
6cf0581159 st/vdpau: Output surfaces that are too large to fit into the display target will be clipped
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
85534e6f48 st/vdpau: Add get_clear_color capability
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
fa2a8316ce st/vdpau: Add documentation from the VDPAU API and update some traces
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
c24bc6f868 st/vdpau: Various whitespace cleanups found while reading some code
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
87e84a2dbf nouveau: Add max_references parameter to vl_create_decoder()
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-14 15:49:16 +02:00
Emeric Grange
82e8bf36d8 g3dvl: Add max_references parameter to vl_create_decoder()
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-14 15:49:15 +02:00
Emeric Grange
42fddacaba g3dvl: Add get_clear_color capability
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:15 +02:00
Emeric Grange
02e191cb6a g3dvl: Various whitespace cleanups found while reading some code
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-14 15:49:15 +02:00
Dave Airlie
81a86aea4f mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.
This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as
suggested by Brian. It uses it in a few places I noticed from previous
color changes, and also some core mesa places. I haven't updated other places
yet.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-14 11:18:08 +01:00
Dave Airlie
093dc9e548 mesa: introduce a clear color union to be used for int/unsigned buffers
This introduces a new gl_color_union union and moves the current
ClearColorUnclamped to use it, it removes current ClearColor completely and
renames CCU to CC, then all drivers are modified to expected unclamped floats instead.

also fixes st to use translated color in one place it wasn't.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-14 11:18:07 +01:00
Brian Paul
b06613c6cc st/mesa: fix incorrect debug output
format and type are not GL enums here.
2011-09-13 09:30:33 -06:00
Brian Paul
0ebf83b731 gallivm: remove unused vars 2011-09-13 08:16:01 -06:00
Brian Paul
52b9ec727b gallium: minor comments for util_format_channel_description fields 2011-09-13 08:14:31 -06:00
Marcin Slusarz
f626d99edf nv50/nvc0: add support for R4A4_UNORM and A4R4_UNORM formats
R4A4 is needed by OSD in mplayer's xvmc output
2011-09-13 15:28:00 +02:00
Marek Olšák
8dbf9d70d3 r600g: fix typo in "r600g: simplify deducing chip family" 2011-09-13 13:09:17 +02:00
Dave Airlie
1ab4e221fd mesa/pack: don't apply transfer operations to integer format buffers. (v3)
The EXT_texture_integer issues says:

Should pixel transfer operations be defined for the integer pixel
path?

RESOLVED: No.  Fragment shaders can achieve similar results
with more flexibility.  There is no need to aggrandize this
legacy mechanism.

v2: fix comments, fix unpack paths, use same comment/code
v3: fix last comment

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-13 09:43:23 +01:00
Marek Olšák
f97acf4015 r600g: remove unused function r600_buffer_from_handle 2011-09-12 22:03:03 +02:00
Marek Olšák
12325b7962 r600g: remove an irrelevant XXX comment 2011-09-12 22:03:03 +02:00
Marek Olšák
9f0dc855b2 r600g: remove r600_resource_buffer struct
This subclass of r600_resource doesn't contain any useful members,
so let's just use r600_resource.
2011-09-12 22:03:03 +02:00
Marek Olšák
ac028b20e5 r600g: set the return type of radeon_destroy to void 2011-09-12 22:03:03 +02:00
Marek Olšák
b87bc2eb44 r600g: remove r600_drm_public.h 2011-09-12 22:03:03 +02:00
Marek Olšák
1a532ca79a r600g: inline some of the winsys r600_get functions 2011-09-12 22:03:03 +02:00
Marek Olšák
915227b0aa r600g: simplify deducing chip family 2011-09-12 22:03:03 +02:00
Marek Olšák
3603d15788 r600g: compute tiling info in the pipe, not in the winsys
The winsys doesn't need it.
2011-09-12 22:03:02 +02:00
Marek Olšák
a94e33a8ef r600g: remove unused ioctl definitions 2011-09-12 22:03:02 +02:00
Marek Olšák
d26b49f87f r600g: do not loop in radeon_family_from_device
Also move that function to r600_drm.c
2011-09-12 22:03:02 +02:00
Marek Olšák
85f5d7ceee r600g: cleanup build include dirs and dependencies
The scons build still depended on libdrm_radeon.
2011-09-12 22:03:02 +02:00
José Fonseca
fb5995cf53 scons: Don't use gstabs on mingw-64. 2011-09-12 17:23:47 +01:00
Marek Olšák
f37a5081b2 st/mesa: clamp Max program param limits
Setting just MAX_PROGRAM_ENV_PARAMS to 4096 breaks everything,
so let's do this instead.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-12 16:55:21 +02:00
Marek Olšák
4682e70601 pb_buffer: inline 'base' sub-struct 2011-09-11 18:29:27 +02:00
Marek Olšák
2154c672b3 r300g: handle the new CAPs 2011-09-11 15:47:23 +02:00
Emil Velikov
f0bfc0daa8 tgsi: fix typo in commit 324ac982d8
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-09-10 14:09:29 -05:00
Maarten Lankhorst
1465dc26a5 nouveau: Add support for XvMC acceleration
Try to use the PMPEG where available

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-09-10 14:22:11 -04:00
Bryan Cain
10dbd02927 glsl_to_tgsi: use UARL instead of I2F and ARL
Since TGSI now has a UARL opcode that takes an integer as the source, it is
no longer necessary to hack around the lack of an integer ARL opcode using I2F.
UARL is only emitted when native integers are enabled; ARL is still used
otherwise.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-10 12:46:47 -05:00
Bryan Cain
324ac982d8 gallium: add TGSI opcodes UARL and UCMP
They are needed by glsl_to_tgsi for an efficient implementation using native
integers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-10 12:46:41 -05:00
Marek Olšák
9222c497f9 mesa: fix more valgrind warnings
==27540== Invalid read of size 4
==27540==    at 0x96277B7: _mesa_make_extension_string (string3.h:144)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???
==27540==  Address 0xad35b30 is 3,688 bytes inside a block of size 3,691 alloc'd
==27540==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==27540==    by 0x9627641: _mesa_make_extension_string (extensions.c:910)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???

And:

==28351== Invalid write of size 2
==28351==    at 0x4C087CC: _mesa_make_extension_string (string3.h:144)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f3 is 19 bytes inside a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==
==28351== Invalid read of size 4
==28351==    at 0x4C087EC: _mesa_make_extension_string (extensions.c:806)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f4 is 0 bytes after a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)

The first part adds 2, because ' ' and '\0' may be written at the end
of the buffer.
2011-09-10 19:40:36 +02:00
Brian Paul
aa77df1355 draw/llvm: combine draw_llvm_generate() and draw_llvm_generate_elts()
These two functions were nearly the same with lots of duplicated code.
Now pass in a boolean 'elts' flag and use a few conditionals to implement
the linear vs. indexed cases.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-10 10:34:44 -06:00
Tom Stellard
3d32e58987 r300/compiler: Implement ROUND
According to the GLSL spec, the implementor can decide which way to round
when the fraction is .5.  The r300 compiler will round down.
2011-09-10 06:36:53 -07:00
Marek Olšák
2a5cbc5306 mesa: fix a valgrind warning
==5715== Invalid read of size 4
==5715==    at 0x4AA590B: _mesa_make_extension_string (extensions.c:908)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
==5715==  Address 0x4795730 is 0 bytes inside a block of size 1 alloc'd
==5715==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==5715==    by 0x4AA5B4C: _mesa_make_extension_string (extensions.c:772)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
2011-09-10 15:12:54 +02:00
Marek Olšák
7e30216879 st/dri: remove the call to driInitExtensions
The function no longer exists. This fixes Gallium build.
2011-09-10 12:33:02 +02:00
Marek Olšák
6b9a36cc3f r600g: fix shadow rect samplers 2011-09-10 08:53:29 +02:00
Marek Olšák
c8b0b13d40 r600g: use SAMPLE_LB for OPCODE_TXB 2011-09-10 08:53:29 +02:00
Marek Olšák
b37931f69b r600g: enable texture arrays 2011-09-10 08:53:29 +02:00
Marek Olšák
929ad43b11 r600g: add support for shadow array samplers
I had to guess & verify how some of the SAMPLE instructions work.
2011-09-10 08:53:29 +02:00
Marek Olšák
23b4ad4626 r600g: implement texture arrays for evergreen 2011-09-10 08:53:29 +02:00
Marek Olšák
840ad139af r600g: always decompress all mipmaps and layers, slices, or faces of zbuffers
This fixes piglit/fbo-depth-array.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Marek Olšák
c4519c3aec r600g: fix texture array filtering
This fixes piglit/fbo-generatemipmap-array.

It looks like SQ_TEX_SAMPLER_WORD0_0.TEX_ARRAY_OVERRIDE should be set
for array textures in order to disable filtering between slices,
which adds a dependency between sampler views and sampler states.

This patch reworks sampler state updates such that they are postponed until
draw time. TEX_ARRAY_OVERRIDE is updated according to bound sampler views.

This also consolidates setting the texture state between vertex and
pixel shaders.
2011-09-10 08:53:29 +02:00
Marek Olšák
9edd0b5ddf glsl_to_tgsi: fix shadow2DArray comparison
v2: adjust the assertion, add a comment
2011-09-10 08:53:29 +02:00
Marek Olšák
da7233840f ir_to_mesa: fix shadow2DArray comparison
The depth should be in W.

v2: adjust the assertion, add a comment
2011-09-10 08:53:29 +02:00
Marek Olšák
274768856d u_blitter: add texture array support
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Marek Olšák
19ff7666f3 st/mesa: convert shadow array samplers to TGSI 2011-09-10 08:53:29 +02:00
Marek Olšák
d8452a0be8 gallium: add shadow 1D and 2D array samplers to TGSI
And filling in all the switch statements in auxiliary. Mostly untested.
2011-09-10 08:53:29 +02:00
Marek Olšák
3794291372 gallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
v2: remove PIPE_CAP_ARRAY_TEXTURES in favor of the new CAP.
2011-09-10 08:53:29 +02:00
Ian Romanick
5a175127f3 dri: Remove all extension enabling utility functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:20 -07:00
Ian Romanick
67d9063492 swrast-dri: Remove call to driInitExtensions
The only purpose this call served in the DRI swrast driver was to
initialize the remap table.  Core Mesa already does the dispatch
offset remapping for every function that could possibly ever be
supported.  There's no need to continue using that cruft in the
driver.
2011-09-09 14:02:20 -07:00
Ian Romanick
6fb32b4a5f radeon: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_logic_op,
and EXT_blend_minmax are no longer advertised.  These all resulted in
software fallbacks, so their loss will not be mourned.
EXT_blend_subtract is, however, explicitly added to the list.
GL_FUNC_SUBTRACT is fully accelerated, but GL_FUNC_REVERSE_SUBTRACT
(still) results in a software fallback.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
4b43eea1b3 r600: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
2b7848b79f r300: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
bd67f8617d r200: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added
with a dependency on the drmSupportsBlendColor flag.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
8a99ec8e05 nouveau: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_minmax, and
EXT_blend_subtract are explicitly added to the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: Viktor Novotný <noviktor@seznam.cz>
2011-09-09 14:02:20 -07:00
Ian Romanick
0a5478c1d9 intel: Move S3TC extension enable bits to intel_extensions.c
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:20 -07:00
Ian Romanick
71ceccad7e intel: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:19 -07:00
Brian Paul
023ca40d80 llvmpipe: add some null pointer checks
It's not clear if these are acceptable cases so issue a one-time warning
in debug builds when we hit them.

Fixes segfault in piglit fbo-mipmap-copypix test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-09 14:00:55 -06:00
Ian Romanick
e12b4752ef nvprogram: Silence "warning: unused parameter ‘ctx’" 2011-09-09 12:01:52 -07:00
Ian Romanick
8b3096cfa4 swrast: Silence many "warning: unused parameter ‘ctx’"
Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
2011-09-09 12:01:52 -07:00
Ian Romanick
076d609aa3 tnl_dd: Silence "tnl_dd/t_dd_tritmp.h:292:3: warning: suggest braces around empty body in an ‘if’ statement" 2011-09-09 12:01:52 -07:00
Ian Romanick
0075510400 spantmp2: Silence many "warning: unused parameter ‘ctx’"
Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
2011-09-09 12:01:51 -07:00
Ian Romanick
aaa305215c mesa: Silence "main/teximage.h:148:72: warning: unused parameter ‘texObj’" 2011-09-09 12:01:51 -07:00
Ian Romanick
2d4b8e296f swrast-dri: Silence several "warning: unused parameter" 2011-09-09 12:01:51 -07:00
Ian Romanick
559ed1a41d dri: Silence several "warning: unused parameter" 2011-09-09 12:01:51 -07:00
Ian Romanick
17d898d5b9 dri_util: Silence several "warning: unused parameter"
The parameters can't be removed because they are part of the DRI ABI.
2011-09-09 12:01:51 -07:00
Ian Romanick
1a8111aea4 intel: Silence "intel/intel_fbo.h:105:4: warning: comparison of unsigned expression < 0 is always false"
The test was of an enum, attIndex, which should be unsigned.  The
explicit check for < 0 was replaced with a cast to unsigned in an
assertion that attIndex is less than the size of the array it will be
used to index.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
ed3040f3ba intel: Silence several "warning: unused parameter"
Trivially silence the compiler by adding '(void) foo;' for each unused
parameter.  These parameters could not be removed.  They are part of
interface used elsewhere in Mesa, and some of the other customers
actually use these parameters.
2011-09-09 12:01:51 -07:00
Ian Romanick
4d5c820b4f intel: Silence several "warning: unused parameter"
The internalFormat, format, and type parameters were not used by
either try_pbo_upload or try_pbo_zcopy, so remove them.  The width
parameter was also not used by try_pbo_zcopy (because it doesn't
actually copy anything), so remove it too.

Eric Anholt notes:

    The current structure of this code is so hateful I can't bring
    myself to say anything about whether changing the current code is
    good or bad.

    I have a dream that one call would try to make a surface
    (miptree/region) out of the PBO, then we'd see about whether it
    matches up nicely and zero-copy/blit using that.  That would be
    reusable for texsubimage, which is currently awful in this
    respect.

At some point we should revisit this code with pitchforks and torches.
2011-09-09 12:01:51 -07:00
Ian Romanick
6f23d9b637 intel: Silence "warning: unused parameter ‘depth0’"
The depth0 parameter was not used in intel_miptree_create_for_region,
so remove it.  All of the places that call this function, pass 1 for
that parameter, and the place where it looks like it should have been
used (the call to intel_miptree_create_internal) also had 1 hard
coded.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
bd817215c8 intel: Silence "warning: unused parameter ‘target’"
The GLenum target parameter was not used in intel_copy_texsubimage, so
remove it.  Also remove the GLenum internalFormat parameter.  Each
caller just copied this out of the intel_texture_image that is already
passed to intel_copy_texsubimage.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
36a91e45f7 intel: Silence several "warning: unused parameter"
The intel_context and tiling parameters were not used by any if the
i9[14]5_miptree_layout or the functions they call, and the tiling parameter was
not used by brw_miptree_layout.  Remove the unnecessary parameters.
2011-09-09 12:01:51 -07:00
Ian Romanick
17fa6772d7 intel: Silence "warning: unused parameter ‘fb’"
The gl_framebuffer was not used in intel_draw_buffer, so remove it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
5b6264b42e intel: Silence "warning: unused parameter ‘intel’"
The intel_context was not used in any of these functions, so remove it.
2011-09-09 12:01:50 -07:00
Ian Romanick
fccbcb5ceb intel: Silence several "warning: unused parameter"
Also clean-up some of the naming, etc. in
intel_buffer_object_purgeable.  'intel' is usually used as the name of
an intel_context pointer, and intel_obj is usually used as the name of
an intel_*_obj pointer.  These changes were suggested by Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
2a6a1c4bc2 intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"
v2: Remove the assertion in intel_batchbuffer_space:

   assert((intel->batch.state_batch_offset - intel->batch.reserved_space)
	  >= intel->batch.used*4);

After reviewing all the places where this is called, I'm (fairly)
comfortable that this assertion was redundant.  Having the assertion
adds ~20KiB to a driver build:

   text	   data	    bss	    dec	    hex	filename
 903173	  26392	   1552	 931117	  e352d	i965_dri.so
 924093	  26392	   1552	 952037	  e86e5	i965_dri.so

Based on feedback from Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
f0dd21ac88 glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"
ast_type_qualifier::location should have been a signed integer from
the beginning, and the giant comment in
apply_type_qualifier_to_variable explains why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 12:01:50 -07:00
Ian Romanick
9a3bd5e045 glsl: Silence several "warning: unused parameter" 2011-09-09 12:01:50 -07:00
Brian Paul
681d432f81 nouveau: remove target parameter from nouveau_bufferobj_map_range()
This was missed back when the target parameter was removed from all
the buffer-related driver hooks.
2011-09-09 12:19:11 -06:00
Brian Paul
b94a926f39 st/mesa: init program MaxLocalParams, MaxEnvParams limits
Use the same limit for all parameter classes.
2011-09-09 08:10:50 -06:00
Chia-I Wu
8adaed9347 d3d1x: fix a build error
Fix for the st/egl interface change since
08e1076fd2.
2011-09-09 15:48:10 +08:00
Eric Anholt
29361e14df i965/vs: Allow copy propagation on GRFs.
Further reduces instruction count by 4.0% in 40.7% of the vertex
shaders.
2011-09-08 21:40:39 -07:00
Eric Anholt
6d0c018776 i965/vs: Clear tracked copy propagation values whose source gets overwritten.
This only occurs for GRFs, and hasn't mattered until now because we
only copy propagated non-GRFs.
2011-09-08 21:40:39 -07:00
Eric Anholt
cc9eb936c2 i965/vs: Add support for copy propagation of the UNIFORM and ATTR files.
Removes 2.0% of the instructions from 35.7% of vertex shaders in shader-db.
2011-09-08 21:40:39 -07:00
Eric Anholt
42ce13195b i965/vs: Add constant propagation to a few opcodes.
This differs from the FS in that we track constants in each
destination channel, and we we have to look at all the swizzled source
channels.  Also, the instruction stream walk is done in an O(n) manner
instead of O(n^2).

Across shader-db, this reduces 8.0% of the instructions from 60.0% of
the vertex shaders, leaving us now behind the old backend by 11.1%
overall.
2011-09-08 21:40:39 -07:00
Eric Anholt
87b51fc4a8 i965/vs: Keep track of indices into a per-register array for virtual GRFs.
Tracking virtual GRFs has tension between using a packed array per
virtual GRF (which is good for register allocation), and sparse arrays
where there's an element per actual register (so the first and second
column of a mat2 can be distinguished inside of an optimization pass).

The FS mostly avoided the need for this second sparse array by doing
virtual GRF splitting, but that meant that instances where virtual GRF
splitting didn't work, instructions using those registers got much
less optimized.
2011-09-08 21:40:39 -07:00
Eric Anholt
d7c6c8428c i965/vs: Switch to the new VS backend by default.
Now instead of env INTEL_NEW_VS=1 to get it, you need INTEL_OLD_VS=1
to not get it.  While it's not quite to the same codegen efficiency as
the old backend, it is not regressing piglit on G965 and G45, and
actually fixing bugs on gen6, and the remaining codegen quality
regressions all appear tractable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
df35d69180 i965/vs: Add support for overflowing the number of available push constants.
Fixes glsl-vs-uniform-array-4.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33742

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
f3ed973f53 i965/vs: Pack uniform registers before optimization
We don't expect uniform accesses to generally go away from being dead
code at this point, and we will want to have uniforms packed before
spilling them out to pull constants when we are forced to do that.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
1408169513 i965/vs: When failing due to lack of spilling, don't continue on.
Fixes assertion failure from double-free in oglc
glsl-arrayobject constructor.declaration.structure

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
27c03cb86a i965/vs: Fix variable indexed array access with more than one array.
The offset to the arrays after the first was mis-scaled, so we'd go
access off the end of the surface and read 0s.  Fixes
glsl-vs-uniform-array-3.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
6af968b673 i965/vs: Add annotation to more of the URB write.
While we had nice debug output for most of the instruction stream, it
was terminated by a series of anonymous MOVs and a send.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Chia-I Wu
48eb1fe6f9 egl_dri2: add support for RGBA_8888 android native buffer
HAL_PIXEL_FORMAT_RGBA_8888 maps to __DRI_IMAGE_FORMAT_ABGR8888.
2011-09-09 12:06:17 +08:00
Chia-I Wu
4f341ee65a st/dri: add support for __DRI_IMAGE_FORMAT_ABGR8888
It maps to PIPE_FORMAT_R8G8B8A8_UNORM.
2011-09-09 12:06:17 +08:00
Chia-I Wu
9fe197c626 intel: add support for __DRI_IMAGE_FORMAT_ABGR8888
It maps to MESA_FORMAT_RGBA8888_REV.  Surfaces of the format can only be
sampled from but not render to.

Only i915 is tested.

Reviewed-by: Eric Anholt <eric@anholt.net>

[olv: add a check in intel_image_target_renderbuffer_storage]
2011-09-09 12:06:17 +08:00
Chia-I Wu
e3cf7b69f2 dri2: add __DRI_IMAGE_FORMAT_ABGR8888 to __DRI_IMAGE
Add a new format token, __DRI_IMAGE_FORMAT_ABGR8888, to __DRI_IMAGE.  It
maps to MESA_FORMAT_RGBA8888_REV in core mesa or
PIPE_FORMAT_R8G8B8A8_UNORM in gallium.  The format is used by
translucent surfaces on Android.
2011-09-09 12:06:16 +08:00
Eric Anholt
60df737ad5 glsl: Don't do structure splitting until link time.
We were splitting on each side of an unlinked program, and the two
sides lost track of which variables they referenced, resulting in
assertion failure during validation.  Fixes piglit
link-struct-uniform-usage.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
525cec98a5 glsl: Clarify error message about whole-array assignment in GLSL 1.10.
Previously, it would produce:

    Failed to compile FS: 0:6(7): error: non-lvalue in assignment

and now it produces:

    Failed to compile FS: 0:5(7): error: whole array assignment is not
    allowed in GLSL 1.10 or GLSL ES 1.00.

Also, add spec quotation to the two places we have code for array
lvalues in GLSL 1.10.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
407a1001ae glsl: When assiging from a whole array, mark it as used.
Fixes piglit link-uniform-array-size.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
d00deae3ef glsl: Fix setting of OutputsWritten for whole array dereference.
We just want to mark the whole thing used, not mark from each element
the whole size in use.  Fixes undefined URB entry writes on i965,
which blew up with debugging enabled.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Brian Paul
ce64b6d612 mesa: remove unneeded #include of texfetch.h 2011-09-08 20:54:58 -06:00
Brian Paul
c6ca3ca552 mesa: use _mesa_unpack_float_z_row in get_tex_depth()
Removes another use of the gl_texture_image::FetchTexelf() function.
2011-09-08 20:16:18 -06:00
Brian Paul
0386d9ac77 mesa: use ctx->Driver.GetTexImage() to decompress base texture image
This is a simple way to do the job and it removes one more use of
the soon-to-be-removed gl_texture_image::FetchTexelc() function.
2011-09-08 20:16:18 -06:00
Brian Paul
c1b3faefc0 mesa: handle compressed images in get_tex_rgba()
Uses the new _mesa_decompress_image() function.  Unlike the meta path
that uses textured quad rendering to do decompression, this works with
signed formats as well.
2011-09-08 20:16:18 -06:00
Brian Paul
3370ba802f mesa: new _mesa_decompress_image() function
Use the old texture fetch functions to decompress a whole image.
To be used by glGetTexImage().
2011-09-08 20:16:18 -06:00
Brian Paul
9a5b2899e0 mesa: added _mesa_get_uncompressed_format(), _mesa_format_num_components() 2011-09-08 20:16:18 -06:00
Brian Paul
730952aa12 mesa: add new pixel format unpacking code
This will be used instead of the texel fetch code to unpack images
in various formats.
2011-09-08 20:16:18 -06:00
Brian Paul
e3dc78e57a meta: added _mesa_meta_GetTexImage()
If the texture is compressed, call the meta decompress_texture_image()
function.  Otherwise, call the core _mesa_get_teximage() function.
2011-09-08 20:16:18 -06:00
Brian Paul
8e9485870b meta: move texcoord setup into setup_texture_coords() 2011-09-08 20:16:18 -06:00
Marcin Slusarz
96054375b1 nouveau: fix nouveau_fence leak
Note: This is a candidate for the 7.11 branch.
2011-09-08 23:00:31 +02:00
Marcin Slusarz
d8035fe173 nv50: fix screen->blitctx memory leak 2011-09-08 23:00:31 +02:00
Adam Jackson
faf5d6584b gles: Fix glGet(GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS_ARB)
We'd still accept the GL_PALETTE[48]_* formats in glCompressedTexImage2D,
but they wouldn't be listed if you queried whether they were supported.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-08 13:40:06 -04:00
Paul Berry
b453ba2c9f glsl: Make sure gl_ClipDistance and gl_ClipVertex are not both written.
From section 7.1 (Vertex Shader Special Variables) of the GLSL 1.30
spec:

  "It is an error for a shader to statically write both
  gl_ClipVertex and gl_ClipDistance."

Fixes piglit test mixing-clip-distance-and-clip-vertex-disallowed.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:38:03 -07:00
Paul Berry
37bb1c4de2 glsl: Check that gl_ClipDistance[] is not sized too large.
Fixes piglit tests
clip-distance-explicit-too-large-with-access.{frag,vert} and
clip-distance-explicit-too-large.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:45 -07:00
Paul Berry
93b9758d01 glsl: Rework oversize array check for gl_TexCoord.
The check now applies both when explicitly declaring the size of
gl_TexCoord and when implicitly setting the size of gl_TexCoord by
accessing it using integral constant expressions.

This is prep work for adding similar size checks to gl_ClipDistance.

Fixes piglit tests texcoord/implicit-access-max.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:24 -07:00
Paul Berry
36c4b1a3da glsl: Add constant gl_MaxClipDistances.
Fixes piglit tests {vs,fs}-clip-distance-sizeable-to-max.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:12 -07:00
Paul Berry
af243b55ac glsl: Make gl_ClipDistance[] implicitly sized.
From the GLSL 1.30 spec, section 7.1 (Vertex Shader Special Variables):

  The gl_ClipDistance array is predeclared as unsized and must be
  sized by the shader either redeclaring it with a size or indexing it
  only with integral constant expressions.

Fixes piglit tests clip-distance-implicit-length.vert,
clip-distance-implicit-nonconst-access.vert, and
{vs,fs}-clip-distance-explicitly-sized.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:36:13 -07:00
José Fonseca
2864f723d1 scons: Use -g instead of -g3.
-g3 causes binaries to be 3x - 10x bigger, not only on MinGW w/ dwarf
debugging info, but linux as well.

Stick with -g, (which defaults to -g2), like autoconf does.
2011-09-08 09:59:01 +01:00
José Fonseca
221a04fa8e st/egl: Fix GDI build. 2011-09-08 09:32:10 +01:00
José Fonseca
1cf808c86e Define INLINE macro in terms of inline. 2011-09-08 09:17:42 +01:00
Benjamin Franzke
7645c49e07 st/egl: add premultiplied alpha support to wayland
Return true for NATIVE_PARAM_PREMULTIPLIED_ALPHA when all formats with
alpha support premultiplied alpha.

(Based on Chia-I Wu's patch)

[olv: remove the use of param_premultiplied_alpha from the original
      patch]
2011-09-08 16:05:41 +08:00
Benjamin Franzke
1191d20363 st/egl: correctly return configs under wayland
Handle "format" events and return configs for the supported formats.

(Based on Chia-I Wu's patch)

[olv: update and explain why PIPE_FORMAT_B8G8R8A8_UNORM should not be
      enabled without HAS_ARGB32]
2011-09-08 16:05:40 +08:00
Chia-I Wu
ee0e6ae2bb Revert "st/egl: correctly return configs under wayland"
This reverts commit 95b445699d.
2011-09-08 16:05:32 +08:00
Chia-I Wu
93a96abe16 Revert "st/egl: add premultiplied alpha support to wayland"
This reverts commit 23aa978a9d.
2011-09-08 16:05:22 +08:00
Chia-I Wu
23aa978a9d st/egl: add premultiplied alpha support to wayland
Return true for NATIVE_PARAM_PREMULTIPLIED_ALPHA when all formats with
alpha support premultiplied alpha.  Currently, it means when argb32 and
argb32_pre are both supported.
2011-09-08 11:16:12 +08:00
Chia-I Wu
95b445699d st/egl: correctly return configs under wayland
When wl_drm is avaiable and enabled, handle "format" events and return
configs for the supported formats.  Otherwise, assume all formats of
wl_shm are supported.
2011-09-08 11:16:12 +08:00
Chia-I Wu
41f5d2e8ac st/egl: overload NATIVE_PARAM_PREMULTIPLIED_ALPHA
EGL does not export this capability of a display server.  But wayland
makes use of EGL_VG_ALPHA_FORMAT to achieve it.

So, when the native display returns true for the parameter, st/egl will
set EGL_VG_ALPHA_FORMAT_PRE_BIT for all EGLConfig's with non-zero
EGL_ALPHA_SIZE.  EGL_VG_ALPHA_FORMAT attribute of a surface will affect
how the surface is presented.

Because st/vega does not support EGL_VG_ALPHA_FORMAT_PRE_BIT,
EGL_OPENVG_BIT will be cleared.
2011-09-08 11:16:12 +08:00
Chia-I Wu
f4c37d6ab2 st/egl: add NATIVE_PARAM_PREMULTIPLIED_ALPHA
Return TRUE if the display supports premultiplied alpha.
2011-09-08 11:16:12 +08:00
Chia-I Wu
08e1076fd2 st/egl: add native_present_control
Replace the parameters of native_surface::present by a struct,
native_present_control.  Using a struct allows us to add more control
options without having to update each backend every time.
2011-09-08 11:16:11 +08:00
Brian Paul
c0470bf77a glsl: s/int/unsigned/ to silence warning 2011-09-07 16:47:14 -06:00
Stéphane Marchesin
c1cac8feec st/mesa: Remove unused renderbuffer fields and functions.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-07 15:42:39 -07:00
Kenneth Graunke
4bc5bfb641 i965/fs: Implement ir_u2f opcode.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-07 10:43:09 -07:00
Kenneth Graunke
8de3314f63 i965: Fix disassembly for intdiv/intmod math functions.
The opcodes and strings were reversed.  Quotient means division, and
modulus means remainder.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-07 10:43:09 -07:00
Chia-I Wu
6b52e82768 st/egl: track changes to drop wl_visual in wayland
Follow a subset of changes in 7b1d94e5d1.
There are known issues, but it works to a certain degree.  Non-working
demos also fail gracefully.  More importantly, it fixes the build.
2011-09-08 01:26:24 +08:00
Chia-I Wu
b89bca6d8b st/egl: track server side wayland changes
Follow changes in c661ecce10.
2011-09-08 01:23:51 +08:00
Chia-I Wu
287278352e st/egl: use new wl_callback mechanism in wayland
Follow the changes in 6602bda23b.
2011-09-08 01:23:48 +08:00
Kenneth Graunke
477b74e85b i965: Use proper texture alignment units for cubemaps on Gen5+.
In particular, S3TC compressed textures need align_h == 4.

Fixes skybox errors in Quake 4 and FEAR.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-07 07:49:55 -07:00
Kenneth Graunke
8ceb235c9c glsl/ir_reader: Make sure constants have the right number of components.
The list of numbers in (constant type (<numbers>)) needs to contain
exactly type->components() numbers (16 for a mat4, 3 for a vec3, etc.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:49:32 -07:00
Kenneth Graunke
6afce988a9 glsl/builtins: Fix invalid float constant in noise4 built-in.
Throwing away the extra numbers ought to match the existing behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:48:56 -07:00
Kenneth Graunke
f6481be298 glsl/builtins: Fix invalid vecN constants in hyperbolic functions.
Each of these vecN constants only provided one component, which is
illegal.  The printed IR is meant to contain exactly as many components
as are necessary; the IR reader does not splat single values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:46:57 -07:00
Dave Airlie
99c1a58b30 varray.c: fix logic around BGRA with ARB_vertex_type_2_10_10_10_rev.
I introduced a regression in here, I've just split the logic ot now, so
its easier to read/understand.

Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=40664

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-07 10:20:47 +01:00
Vinson Lee
6edef25a4b mesa/vbo: s/inline/INLINE/
MSVC does not support inline keyword.
2011-09-06 21:43:51 -07:00
Eric Anholt
9bd8d90646 i965/vs: Fix point size handling on gen4.
Fixes glsl-vs-point-size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:02:00 -07:00
Eric Anholt
9367960ea6 i965/vs: Use write commits on scratch writes in pre-gen6.
This is required to ensure ordering between reads and writes within a
thread.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:57 -07:00
Eric Anholt
838bfe0c46 i965/vs: Fix setup of scratch space pointer on pre-gen6.
We were failing to relocate, so on the first draw run our scratch
would tend to get written to 0x0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:54 -07:00
Eric Anholt
ddf8e602a7 i965/vs: Fix message setup for array read/writes on pre-gen6.
We were passing an MRF as the source argument, instead of using the
implied move and putting the MRF number in the proper place in the
instruction encoding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:51 -07:00
Eric Anholt
88612e2c1b i965/vs: Fix constant-indexed array read/write addresses on pre-gen6.
The second vertex was getting a garbage index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:48 -07:00
Eric Anholt
bba910373f i965/vs: Add support for vector comparison ops resulting in bool cond codes.
Fixes a giant pile of VS tests on gen4.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:43 -07:00
Eric Anholt
9f84288607 i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.
On the old backend, we used scalar mode because Mesa IR math is
result.xyzw = math(op0.xxxx), which matched up well.  However, in GLSL
IR we do things like result.xy = math(op0.xy), so we want vector mode.
For the common case of result.x = math(op0.x), performance will be the
same (no cost for un-executed channels), though result.xyzw =
math(op0.xxxx) would be worse.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:23 -07:00
Eric Anholt
87be0ac96c i965/vs: Fix copy-and-paste disaster in pre-gen6 POW support.
Fixes vs-pow-float-float and friends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:20 -07:00
Eric Anholt
2ffc5ac1da i965/vs: Fix gen4 comparisons used for predication.
When we tried to retype a brw_null_reg() in CMP(), the retyping didn't
take effect because HW_REG just ignores the type field.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:17 -07:00
Eric Anholt
8adcad213e i965/vs: Fix GPU hangs in shaders with large virtual GRFs pre-gen6.
If you get your total GRF count wrong, you write over some other
shader's g0, and the GPU fails shortly thereafter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:00:57 -07:00
Brian Paul
23eec54bb0 i965: add casts to silence int/enum conversion warnings 2011-09-06 16:50:27 -06:00
Stéphane Marchesin
02f1b50987 state_trackers/dri/sw: Implement texture_from_pixmap.
Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2011-09-06 15:03:01 -07:00
Stéphane Marchesin
569bde1fa7 Duplicate state_tracker/dri/sw/dri_drawable.c
We need this for the upcoming fix for sw texture_from_pixmap.

Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2011-09-06 15:03:00 -07:00
nobled
55e763c86d Enable GLX_EXT_texture_from_pixmap in software.
Signed-off-by: nobled <nobled@dreamwidth.org>
Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2011-09-06 15:03:00 -07:00
Brian Paul
a4adc88a2d st/mesa: remove unneeded #include 2011-09-06 15:44:44 -06:00
Brian Paul
1a65d098ce mesa: whitespace fixes, just to be consistent 2011-09-06 15:31:26 -06:00
Brian Paul
51e7b05875 mesa: put _mesa_ prefix on vert_result_to_frag_attrib() 2011-09-06 15:29:24 -06:00
Brian Paul
a794ad3709 mesa: fix vert_result_to_frag_attrib() parameter type 2011-09-06 15:24:14 -06:00
Brian Paul
37afceeee9 mesa: s/inline/INLINE/ to fix MSVC build 2011-09-06 15:20:33 -06:00
Adam Jackson
7826067bd1 Drop some Glide remnants
Apparently the x11 driver had a hack for glide passthrough.  Who knew?

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
Adam Jackson
7f379df401 Remove an AmiWin leftover
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
Adam Jackson
c7cc61fea9 Remove dead glfbdev.h
This belonged to the now-dead swrast-on-fbdev driver.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
Adam Jackson
f6f2f59818 Drop documentation references for deleted backends
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
José Fonseca
f4dd099171 rtasm,translate: Disable on Mingw-w64.
Causes crash and stack corruption.

Needs more investigation. Disable for now.
2011-09-06 20:40:44 +01:00
Ian Romanick
5812b24845 docs: skeleton file for 7.12 release notes
Current just the items that have been removed from Mesa are mentioned
in the release notes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:36 -07:00
Ian Romanick
3602fbb201 mesa: Remove support for unpacking from client memory to color-index pixels
Mesa hasn't supported color-index rendering for a long time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:32 -07:00
Ian Romanick
d7cb905a5a swrast: Use GL_STENCIL_INDEX for address calculations
GL_COLOR_INDEX produced the same result (because GL_BITMAP is always
used for stencil glDrawPixels), but it was confusing to read.  I spent
about 15 minutes wondering, "WTF?"

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:28 -07:00
Ian Romanick
e174b5d483 mesa: Remove GL_COLOR_INDEX from _mesa_{dest,source}_buffer_exists
Mesa hasn't supported color-index rendering for a long time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:24 -07:00
Ian Romanick
559241d48c mesa: Remove GL_COLOR_INDEX from base format assertions
_mesa_make_temp_float_image can't work on color-index textures, but
there is no such thing as a color-index texture anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:20 -07:00
Ian Romanick
ede7d9fff5 swrast: Remove GL_COLOR_INDEX from assertions
These sampling functions don't work on color-index textures, but there
is no such thing as a color-index texture anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:16 -07:00
Ian Romanick
960f37a57a mesa: Remove unused struct gl_color_table
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:12 -07:00
Ian Romanick
81a6cf9ddf mesa: Remove unused functions _mesa_lookup_rgba_{float,ubyte}
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:09 -07:00
Ian Romanick
0b6dd75058 mesa: Remove all mention of GL_COLOR_INDEX*_EXT
These enums were only valid with the paletted texture extensions.
This allows a couple other trivial clean-ups.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:05 -07:00
Ian Romanick
eb805a5182 mesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ::UpdateTexturePalette
There's nothing left that can call any of these functions.  This also
removes the meta-ops code that implemented the first two.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:00 -07:00
Ian Romanick
eba527bf9f mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette
This was also discussed at XDS 2010.  However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx).  Now that those
drivers have been removed, this code can be removed as well.

v2: A lot of bits that were missed in the previous patch have been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:08:25 -07:00
Paul Berry
becd54eedb i965: Remove two_side_color from brw_compute_vue_map().
Since we now lay out the VUE the same way regardless of whether
two-sided color is enabled, brw_compute_vue_map() no longer needs to
know whether two-sided color is enabled.  This allows the two-sided
color flag to be removed from the clip, GS, and VS keys, so that fewer
GPU programs need to be recompiled when turning two-sided color on and
off.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:48 -07:00
Paul Berry
f2b09257ba i965: For GEN6+, always make front/back colors adjacent in VUE.
When doing two-sided color on GEN6+, we use the SF unit's
INPUTATTR_FACING mode to cause front colors to be used on front-facing
triangles, and back colors to be used on back-facing triangles.  This
mode requires that the front and back colors be adjacent in the VUE.

Previously, we would only place front and back colors adjacent in the
VUE when two-sided color was enabled.  Now we place them adjacent in
the VUE whether two-sided color is enabled or not.  (We still only
swizzle the colors when two-sided color is enabled, so there should be
no user-visible change).

This simplifies the implementation of the VUE map and reduces the
amount of code that is dependent on two-sided color mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:44 -07:00
Paul Berry
18dcda2dcf i965: GS: Use the VUE map to compute URB size.
The previous computation had two bugs: (a) it used a formula based on
Gen5 for Gen6 and Gen7 as well. (b) it failed to account for the fact
that PSIZ is stored in the VUE header.  Fortunately, both bugs caused
it to compute a URB size that was too large, which was benign.  This
patch computes the URB size directly from the VUE map, so it gets the
result correct in all circumstances.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:41 -07:00
Paul Berry
78be5bcb22 i965: clip: Remove no-longer-needed variables.
The variables offset[], idx_to_attr[], nr_bytes, nr_attrs, and
header_regs were all serving purposes which are now served by the VUE
map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:38 -07:00
Paul Berry
4efb32c642 i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex()
Previously, brw_clip_interp_vertex() iterated only through the
"non-header" elements of the VUE when performing interpolation
(because header elements don't need interpolation).  This code now
refers exclusively to the VUE map to figure out which elements need
interpolation, so that brw_clip_interp_vertex() doesn't need to know
the header size.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:34 -07:00
Paul Berry
71cb82f63a i965: clip: Change computation of nr_regs to use VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:31 -07:00
Paul Berry
2ef1fa6b3c i965: clip: Convert computations to ..._to_offset() for clarity.
This patch replaces some ad-hoc computations using ATTR_SIZE and the
offset[] array to use the VUE map functions
brw_vert_result_to_offset() and brw_vue_slot_to_offset().

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:28 -07:00
Paul Berry
54a62f8806 i965: clip: Add a function to determine whether a vert_result is in use.
Previously we would examine the offset[] array (since an offset of 0
meant "not in use").  This paves the way for removing the offset[]
array.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:25 -07:00
Paul Berry
620f06b126 i965: clip: Rework brw_clip_interp_vertex() to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:23 -07:00
Paul Berry
c46be4273c i965: clip: Modify brw_clip_interp_vertex() to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:20 -07:00
Paul Berry
5a93019a87 i965: clip: Move header_regs into brw_clip_compile.
This makes header_regs available for computing VUE offsets within clip code.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:17 -07:00
Paul Berry
2bc421845e i965: clip: Modify brw_clip_tri_alloc_regs() to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:14 -07:00
Paul Berry
62b0c8561e i965: clip: Move hpos_offest and ndc_offset into local functions.
The offsets within the VUE of HPOS and NDC are needed only in a few
auxiliary clipping functions.  This patch moves computation of those
offsets into the functions that need them, and does the computation
using the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:11 -07:00
Paul Berry
eae5b5c44e i965: clip: rename header_position_offset to the more correct ndc_offset.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:08 -07:00
Paul Berry
514eeca32c i965: clip: Add VUE map computation to clip stage for Gen4-5.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:05 -07:00
Paul Berry
9660e3b788 i965: SF: Change gen{6,7}_sf_state.c to compute URB read length based on VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:03 -07:00
Paul Berry
fc60a07d88 i965: SF: Move outputs_written to a local variable for clarity.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:59 -07:00
Paul Berry
2d909f431c i965: SF: New implementation of get_attr_override using the VUE map.
This patch changes get_attr_override() (which computes the
relationship between vertex shader outputs and fragment shader inputs)
to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:56 -07:00
Paul Berry
bbc53d6285 i965: SF: Remove unnecessary variables.
This patch removes the variables nr_attrs and nr_setup_attrs, whose
purpose is now being served by the VUE map.  nr_attr_regs and
nr_setup_regs are still needed, however they are now computed using
the VUE map rather than by counting the number of vertex shader
outputs (which caused subtle bugs when gl_PointSize was written).

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:53 -07:00
Paul Berry
58d9c95b3c i965: SF: Stop using nr_setup_attrs in compute_masks.
Previously, the SF used nr_setup_attrs to determine whether it was
looking at the last element of the VUE.  Changed this code to use the
VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:50 -07:00
Paul Berry
08f030baec i965: SF: Remove attr_to_idx and idx_to_attr.
These data structures were serving the same purpose as the VUE map,
but were buggy.  Now that the code has been transitioned to use the
VUE map, they are not needed.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:47 -07:00
Paul Berry
84e7d04e1d i965: SF: Change calculate_masks to use the VUE map.
Previously, SF code used the idx_to_attr[] array to compute the
location of entries in the VUE map.  This array didn't properly
account for gl_PointSize.  Now we use the VUE map directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:44 -07:00
Paul Berry
aafe2cdf86 i965: SF: Change the flags that refer to "attr" to be based on gl_vert_result.
Previously, some of the code in SF erroneously used bitfields based on
the gl_frag_attrib enum when actually referring to vertex results.
This worked, because coincidentally the particular enum values being
used happened to match between gl_frag_attrib and gl_vert_result.  But
it was fragile, because a future change to either gl_vert_result or
gl_frag_attrib would have made the enum values stop matching up.  This
patch switches the SF code to use the correct enum.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:41 -07:00
Paul Berry
8b362477d9 i965: SF: change get_vert_attr to use the VUE map, and rename it.
The new function, called get_vert_result(), uses the VUE map to find
the register containing a given vertex attribute.  Previously, we used
the attr_to_idx[] array, which served the same purpose but didn't
account for gl_PointSize correctly.

This fixes a bug on pre-Gen6 wherein the back side of a triangle would
be rendered incorrectyl if the vertex shader wrote to gl_PointSize.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:37 -07:00
Paul Berry
4a1fb81902 i965: SF: Modify calculate_point_sprite_mask to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:34 -07:00
Paul Berry
39fc725b0c i965: SF: Move the computation of urb_entry_read_offset.
This patch moves the computation of the SF URB entry read offset from
upload_sf_unit() to its own function, so that it can be re-used when
creating the gen4-5 SF program.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:29 -07:00
Paul Berry
f3ecc90730 i965: new VS: Compute urb entry size based on the VUE map.
Previously, the new VS backend computed the size of the URB entry by
counting the number of MRFs used in emitting the URB entry.  Now it
just gets it straight from the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:26 -07:00
Paul Berry
ee3195a5ff i965: new VS: Clarify comments about max_usable_mrf and add an assertion.
max_usable_mrf has been carefully set such that (max_usable_mrf -
base_mrf) is a multiple of 2, so that an even number of VUE slots are
emitted with each URB write (which Gen6 requires).  This patch adds an
assertion to confirm that this is the case, and moves the comment to
this effect to be near the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:22 -07:00
Paul Berry
e604f98f58 i965: new VS: use the VUE map to write out vertex attributes.
Previously, the new VS backend used two functions,
emit_vue_header_gen6() and emit_vue_header_gen4() to emit the fixed
parts of the VUE, and then a pair of carefully-constructed loops to
emit the rest of the VUE, leaving out the parts that were already
emitted as part of the header.

This patch changes the new VS backend to use the VUE map to emit the
entire VUE.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:18 -07:00
Paul Berry
d1435a49e9 i965: new VS: move clip distance computation (GEN5+) to a separate function.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:15 -07:00
Paul Berry
d9eca0b279 i965: new VS: Move PSIZ/flags computation to a separate function.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:13 -07:00
Paul Berry
f86d1976f8 i965: new VS: move NDC computation (GEN4-5) to a separate function.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:09 -07:00
Paul Berry
34fbab2125 i965: new VS: Use output_reg[] to find NDC and HPOS registers.
Previously, emit_vue_header_gen4() used local variables to keep track
of which registers were storing the NDC and HPOS.  This patch uses the
output_reg[] array instead, so that the code that manipulates NDC and
HPOS can be more easily refactored.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:05 -07:00
Paul Berry
85e57eb9ca i965: old VS: use the VUE map to compute the URB entry size.
Previously, the old VS backend computed the URB entry size by adding
the number of vertex shader outputs to the size of the URB header.
This often produced a larger result than necessary, because some
vertex shader outputs are stored in the header, so they were being
double counted.  This patch changes the old VS backend to compute the
URB entry size directly from the number of slots in the VUE map.

Note: there's a subtle change in that we no longer count header
registers towards the size of the VF input.  I believe this is
correct, because the header is only emitted in the output of the VS
stage--it is not present in the input.  (As evidence for this, note
that brw_vs_state.c sets urb_entry_read_offset to 0--it does not
include space for the header as part of the VS input).

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:01 -07:00
Paul Berry
3c17efd148 i965: old VS: Use brw_vue_map instead of implicit assumptions about VUE structure.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:03:57 -07:00
Paul Berry
7bb2dbfc97 i965: Add functions to compute offsets within the VUE map.
Some parts of the i965 driver keep track of locations within the VUE
(vertex URB entry) using byte offsets.  This patch adds inline
functions to compute these byte offsets using the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:03:53 -07:00
Paul Berry
45f1d7a666 i965: Write code to compute a VUE map.
Several places in the i965 code make implicit assumptions about the
structure of data in the VUE (vertex URB entry).  This patch adds a
function, brw_compute_vue_map(), which computes the structure of the
VUE explicitly.  Future patches will modify the rest of the driver to
use the explicitly computed map rather than rely on implicit
assumptions about it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:03:49 -07:00
Paul Berry
6489a1d5ba Refactor code that converts between gl_vert_result and gl_frag_attrib.
Previously, this conversion was duplicated in several places in the
i965 driver.  This patch moves it to a common location in mtypes.h,
near the declaration of gl_vert_result and gl_frag_attrib.

I've also added comments to remind us that we may need to revisit the
conversion code when adding elements to gl_vert_result and
gl_frag_attrib.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:02:32 -07:00
Brian Paul
afaf024f57 docs: more info about non-subscriber list postings 2011-09-06 09:19:36 -06:00
Brian Paul
2efc093d2c docs: update link, remove dead links 2011-09-06 08:45:44 -06:00
José Fonseca
129ace49f4 scons: Set -static-libstdc++ on mingw-w64
To avoid depending on libstdc++-xxx.dll
2011-09-06 13:18:58 +01:00
José Fonseca
0646246cae scons: Move MinGW flags from crossmingw.py to gallium.py
So that they are used by native MinGW compilers too.
2011-09-06 13:18:58 +01:00
Dave Airlie
1d52ddc3bb r600g: add TXQ and TXF support
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:23:08 +01:00
Dave Airlie
cdeffbfddc r600g: add initial evergreen integer opcode support
This just adds the opcodes for evergreen, need to work on r600 and cayman
implementations.

don't advertise nativeintegers yet until we work out all the regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:22:24 +01:00
Dave Airlie
2957e44664 docs: update gl3.txt for ARB_vertex_type_2_10_10_10_rev 2011-09-06 10:18:36 +01:00
Dave Airlie
f154ac9cc2 mesa/st: add support for 2101010 vertex format conversion.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:18:18 +01:00
Dave Airlie
6cd2d55a7b mesa/varray: add interface support for ARB_vertex_type_2_10_10_10_rev (v2)
This just adds all the API check for vertex arrays using 2101010 types.

2101010 is also useable with GL_BGRA.

v2: fix whitespace.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 10:18:18 +01:00
Dave Airlie
51fcf080a3 mesa/vbo: add ARB_vertex_type_2_10_10_10_rev APIs.
This adds the vertex processing paths for the 2101010 types. It converts
the attributes to floats for all the immediate entry points, some entrypoints
are normalised and the attrib APIs take a normalized parameter.

There are four main paths,
ui10 -> float unnormalized
i10 -> float unnormalized
ui10 -> float normalized
i10 -> float normalized
along with the ui2/i2 equivs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:18:17 +01:00
Dave Airlie
667351bc5f mesa: add initial API changes for ARB_vertex_type_2_10_10_10_rev.
add new APIs to the internal mesa driver interface + set funcs in vtxfmt.c

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 10:16:32 +01:00
Dave Airlie
2b3da6b01e glapi: regen API files for new extension
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:16:16 +01:00
Dave Airlie
3543160f56 glapi: add ARB_vertex_type_2_10_10_10_rev entrypoints. (v2)
These are the new API entrypoints for ARB_vertex_type_2_10_10_10_rev
extension, along with the new INT_2_10_10_10_REV enum.

v2: fixup crazy whitespace cut-n-paste mess

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 10:15:59 +01:00
Bryan Cain
4e64cfbb4e mesa: add a UniformBooleanTrue option
Drivers supporting native integers set UniformBooleanTrue to the integer value
that should be used for true when uploading uniform booleans.  This is ~0 for
Gallium and 1 for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-05 19:51:29 -05:00
Dave Airlie
f9b7d3bd4a r600g: add 10/10/10/2 vertex format conversion. 2011-09-05 19:08:18 +01:00
Dave Airlie
797bb0eb47 gallium: add missing formats for ARB_vertex_type_2_10_10_10_rev
This just reorgs one define in csv file, and adds all the new formats
that are needed for this extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-05 19:08:17 +01:00
Tobias Droste
4a468de2d7 gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn moved TargetRegistry.h and TargetSelect.h.
See revision 138450 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-09-05 18:49:11 +01:00
Bryan Cain
0dc575c6f6 glsl_to_tgsi: fixes for native integers and integer booleans
This fixes all but one of the piglit regressions from enabling native integers
in softpipe.  The change to fix the last regression is still being discussed.
2011-09-04 14:31:16 -05:00
Maarten Lankhorst
a09754c15f xvmc: Replace frame_started by picture_structure
The preferred solution to keeping track of the picture structure
has been putting it in the state tracker, so use picture_structure
instead of frame_started to check if a frame needs to begin.

If picture_structure has been changed, end the frame and start again.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-04 13:51:50 +02:00
Yuanhan Liu
0a00a9a05b intel: fix build error
Fix a build error introduced by commit 6862b54f:
i965_dri.so.tmp: undefined reference to `strerr'

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-09-03 07:26:52 -07:00
Marek Olšák
5572de8e7e mesa: handle zero-size buffers in MapBuffer and ranges in MapBufferRange (v3)
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-02 22:39:56 +02:00
Marek Olšák
0a33ac5413 glsl_to_tgsi: fix more potential shader reference leaks
The last one has been pointed out by Ian.
2011-09-02 22:39:56 +02:00
Eugeni Dodonov
6862b54f4d intel: Give an explanation why we are exiting for debugging.
This could happen in 3 different cases, and ERRNO can explain what
happened. First case would be EIO (gpu hang), second EINVAL (something is
wrong inside the batch), and we also discovered that sometimes it happens
with ENOSPACE. All of those cases are different it it could be worth to at
least know what happened.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-09-02 16:23:32 -03:00
Kenneth Graunke
ee41383ab3 i965/vs: Fix NULL pointer dereference in pre-Gen6 push constant loading.
According to the comment, we need to load /some/ push constants on
pre-Gen6 hardware or the GPU will hang.  The existing code set these
bogus parameters to NULL pointers; unfortunately, the code in
brw_curbe.c that loads them dereferences those pointers.  So, change
them to be pointers to an actual floating point value of 0.0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-02 12:17:06 -07:00
Eric Anholt
7fdbedac14 intel: Upload batchbuffer contents even if INTEL_NO_HW is set.
It is useful for debugging to dump batchbuffers while not actually
executing them.
2011-09-02 12:17:05 -07:00
Dave Airlie
0b666106c5 gallium: add caps for MIN/MAX texel offsets.
As per Brian's suggestion, add caps for drivers that support texture
offsets to advertise a min/max via TGSI, also use it in the state tracker.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-02 10:48:09 +01:00
Dave Airlie
2083a276eb tgsi: add support for texture offsets to the TGSI IR. (v2)
This adds tokens for texture offsets, to store 4 * swizzled vec 3
for use in TXF and other opcodes.

It also contains TGSI exec changes for softpipe to use this code,
along with GLSL->TGSI support for TXF.

v2: add some more comments, add back padding I removed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-02 10:47:45 +01:00
Christian König
49e24d3b8c st/vdpau: Implement VdpOutputSurfacePutBitsIndexed and VdpOutputSurfaceRenderOutputSurface
This gets mplayers menu overlay working.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:47 +02:00
Christian König
41fa51a49a st/xvmc: the alpha component of palette entries isn't used 2011-09-01 19:20:47 +02:00
Christian König
4f37636afb g3dvl: extend the functionality of the compositor
Prepares for vdpau menu overlay.
2011-09-01 19:20:46 +02:00
Christian König
23f01fd31c gallium: add R8A8 and A8R8 UNORM formats
They are mostly used for menu overlay in video decoding.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Christian König
8612235bbf st/xvmc: remove L4A4_UNORM workaround
This is no longer needed, since we now have native support for IA44 and AI44.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Christian König
0d0285ba91 r600g: add support for R4A4 and A4R4 textures.
Sampling worked out of the box, but this make them work as surface as well.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Christian König
cf49c49d0e gallium: try to cleanup a bit of the format mess created with pipe-video merge
Start with correctly defining IA44 and AI44 formats.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Kristian Høgsberg
64332917c9 wayland: Use wl_resource_* error functions 2011-09-01 09:54:10 -04:00
Benjamin Franzke
11f64668a9 egl_dri2: Destroy callback in release_pending_buffer 2011-09-01 11:44:43 +02:00
Benjamin Franzke
59884b9b59 wayland-drm: Fix compilation with wayland master
c661ecce introduced some not-yet-upstream stuff.
2011-09-01 11:44:25 +02:00
Brian Paul
db3a7c366b swrast: get rid of needless do/while 2011-08-31 21:30:02 -06:00
Brian Paul
025cf209bc mesa: fix broken store_texel() functions
This fixes the swrast failures for piglit's fbo-generatemipmap-formats
test (for uncompressed formats).  At some point down the road this code
will go away so I haven't checked all the other store_texel() functions.
2011-08-31 21:23:33 -06:00
Chia-I Wu
6b9e4b6ca7 intel: fix GLESv1 support
Add intelInitExtensionsES1 to enable required and optional GLESv1
extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-01 10:53:31 +08:00
Chia-I Wu
820789ac69 intel: rename intel_extensions_es2.c to intel_extensions_es.c
We'd like to add intelInitExtensionsES1 to it later.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-01 10:53:31 +08:00
Chia-I Wu
644929849c i915: build i915_dri.so for Android
Simple demos such as test-opengl-gl_basic work.  SurfaceFlinger does not
work yet due to missing GL_OES_draw_texture support (and maybe more).

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Chia-I Wu
47ba5c482f i915: factor our source lists into Makefile.sources
In preparation for porting i915 to Android, factor its source lists into
a shared makefile. This prevents duplication of source lists, and hence
prevents the Android build from breaking as often.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Chia-I Wu
05fdb44dd7 i965: fix Android build
Use $(TARGET_CC) instead of $(CC).  Correctly name and set LOCAL_CFLAGS.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Bryan Cain
488fe51cf8 mesa: Replace the EmitNoIfs compiler flag with a MaxIfDepth flag.
This is a better, more fine-grained way of lowering if statements.  Fixes the
game And Yet It Moves on nv50.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 21:49:26 -05:00
Kristian Høgsberg
7b1d94e5d1 wayland: Track changes to drop wl_visual 2011-08-31 18:33:47 -04:00
Kristian Høgsberg
447bb454d8 egl_dri2: Only clear EGL_PIXMAP_BIT if DRI config is double buffered
We don't want to set the pixmap bit in the EGL config if the DRI
config we're adding is a double buffered config.  However, don't clear
any other bits the platform might pass in in the surface_type
argument.
2011-08-31 18:33:36 -04:00
Kristian Høgsberg
c661ecce10 wayland: Track server side wayland changes 2011-08-31 18:20:40 -04:00
Kristian Høgsberg
6602bda23b wayland: Use new wl_callback mechanism 2011-08-31 16:50:50 -04:00
Brian Paul
82fff5f3ed mesa: fix comment typo: s/GL_SIGNED_NORMALED/GL_SIGNED_NORMALIZED/ 2011-08-31 14:34:48 -06:00
Bryan Cain
478034f34a glsl: Use a separate div_to_mul_rcp lowering flag for integers.
Using multiply and reciprocal for integer division involves potentially
lossy floating point conversions.  This is okay for older GPUs that
represent integers as floating point, but undesirable for GPUs with
native integer division instructions.

TGSI, for example, has UDIV/IDIV instructions for integer division,
so it makes sense to handle this directly.  Likewise for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 12:02:18 -07:00
Brian Paul
87679e2ea1 mesa: bump max program local params, max uniforms limit
Some driver support more than 1024.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 12:57:38 -06:00
Brian Paul
e26e9f77e7 swrast: initialize program native limits
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 12:57:01 -06:00
Eric Anholt
0c9ae24dbd i965/vs: Avoid the emit(), remove(), insert_before() for array instructions.
v2: Add generator instructions for the scratch opcodes.
    Add emit_before() for handling ->ir and ->annotation inheritance.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:30:33 -07:00
Eric Anholt
e45d0270c9 i965/vs: Move logic for weird CMP type handling to CMP generators.
v2: Don't bother with the no-dst-reg version of CMP()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:16:10 -07:00
Eric Anholt
a8e29987f5 i965/vs: Convert emit() calls to the new instruction generators.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:54 -07:00
Eric Anholt
ead7ffc62a i965/vs: Convert gen6 userclip handling to new generators.
This DP4 had one of its operands missing, so we were generating
garbage clip distances.  Using the per-opcode instruction generators
made it obvious.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:54 -07:00
Eric Anholt
2f12be5c95 i965/vs: Create instruction generators outside of the emit() functions.
v2: Fixed gen6 IF().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:49 -07:00
Benjamin Franzke
f811c1e6d6 egl_dri2: Drop dri2_surface_type enum
Was only used in platform_wayland, and the remaining egl stack
uses _EGLSurface::Type with one of EGL_{WINDOW,PIXMAP,PBUFFER}_BIT.
2011-08-31 11:45:34 +02:00
Chia-I Wu
93d5963744 egl_dri2: add pbuffer support to platform_android
This is a simple change thanks to allocateBuffer.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 12:06:26 +08:00
Chia-I Wu
c8e18f85da egl_dri2: check the surface type in platform_android
Check the surface type is EGL_WINDOW_BIT before doing anything, in
preparation for pbuffer support.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:58:34 +08:00
Chia-I Wu
384f228a25 egl_dri2: refactor droid_get_buffers_with_format
Move the loop to parse attachments to its own function.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:51:54 +08:00
Chia-I Wu
357d3f30f3 egl_dri2: set ctx->WindowRenderBuffer
Set ctx->WindowRenderBuffer to EGL_BACK_BUFFER.  As EGL_WINDOW_BIT of a
config is set only when there is dri_double_buffer, that makes sure
window surfaces are always double-buffered and contexts will render to
the back buffer.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:51:42 +08:00
Christoph Bumiller
66e8d223b6 nv50,nvc0: fix multisample format hack
Advertising different format support based on sample count was a
bad idea, it made resolve to window work, but resolve to anything
else would fail.

See 9f4998639c.
2011-08-31 00:06:22 +02:00
Eric Anholt
0b96b3ffa9 intel: Restructure TexSubImage as just the 2D implementation and blit func.
Fixes a segfault in piglit copyteximage where I accidentally removed
the dst_bo setup in the previous cleanup.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40474
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Sean McNamara <gm.potato.ul@gmail.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 14:58:52 -07:00
Eric Anholt
b26a08402f intel: Remove the passthrough TexSubImage[13]D functions.
All we need for these is _mesa_store_texsubimage[13]d(), since we
don't do the blit path.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 14:58:47 -07:00
Eric Anholt
81a0b21669 i965/vs: Fix GL_FIXED setup when a writemask is present.
By emitting code before generate_code(), we ended up in align1 mode
where writemasks don't exist, so we rescaled gl_Vertex.w and things
went badly.  By moving GL_FIXED support to the visitor, we end up with
normal codegen, and as a bonus the GL_FIXED setup ends up getting
printed appropriately in debug output.

Fixes gtf/GL2Tests/fixed_data_type

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
72cfc6f377 i965/vs: Pack live uniform vectors together in the push constant upload.
At some point we need to also move uniform accesses out to pull
constants when there are just too many in use, but we lack tests for
that at the moment.

Fixes glsl-vs-large-uniform-array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
7c84b9d303 i965/vs: Track uniforms as separate vectors once we've done array access.
This will make it easier to figure out which elements are totally
unused and not upload them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
ddca4592a7 i965/vs: Don't lower uniform array indexing.
This avoids the massive conditional move array access, and brings code
generation quality for the new VS backend into the realm of efficiency
of the old backend (roughly 20% more instructions generated than
before across shader-db, instead of assertion failing for generating
over 10,000 instructions on many shaders!).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
483f5b348b i965/vs: Add support for pull constant loads for uniform arrays.
v2: reworked the instruction emit and made use of gen6_resolve_implied_move,
    from Ken's review
2011-08-30 12:09:40 -07:00
Eric Anholt
88e08de801 i965/vs: Restructure emit() functions around a vec4_instruction constructor.
We sometimes want to put an instruction somewhere besides the end of
the instruction stream, and we also want per-opcode instruction
generation to enable compile-time checking of operands.
2011-08-30 12:09:40 -07:00
Eric Anholt
8654931d11 i965: Make the old VS backend record pull constant references in pull_params[].
We'll be using that to track things for the new VS backend, and this will
avoid cluttering brw_vs_surface_state.c for it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
9fa41f0742 mesa: Fix glGetUniform() type conversions.
We were primarily failing to convert in the NativeIntegers case, which
this fixes.  However, we were also just truncating float uniforms when
converting to integer, which does not appear to be the correct
behavior.  Note, however, that the NVIDIA drivers also truncate
instead of rounding.

GL_DOUBLE return type is dropped because it was never used and
completely broken.  It can be added when there's test code.

Fixes piglit ARB_shader_objects/getuniform

v2: This is a rewrite of my previous glGetUniform patch, which Ken
    pointed out missed storage_type-based conversions to integer,
    which was totally broken still thanks to a typo in the testcase.
v3: Quote the spec justifying the rounding behavior.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 12:09:40 -07:00
Eric Anholt
7708b25e2b mesa: Make the gl_constant_value's bool occupy the same space as float/int.
At least for Intel, all our uniform components are of uint32_t size, either
float or signed or unsigned int.  For uploading uniform data in the driver,
it's much easier to upload a full dword per uniform element instead of trying
to pick out the bool byte and then fill in the top 3 bytes of pad with 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
55b7fbb70f i965: Use native integer uniforms when the new VS backend is in use.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
2f82c33dee i965/vs: Move the flag for whether to use the new backend to the context.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Chad Versace
1995d1e207 i965: Build i965_dri.so for Android
Compile tested only.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
2f0edc60f4 i965: Fix Android build by removing relative includes
Replace each occurence of
    #include "../glsl/*.h"
with
    #include "glsl/*.h"

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
34349d4431 dri: Build libmesa_dri_common for Android
libmesa_dri_common is a static library that contains the sources in
src/mesa/drivers/dri/common. Each DRI driver should link to it.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
05049e709e make: Document imported variables
In src/mesa/Android.mk, it is non-trivial to determine which variables are
imported by `include sources.mak`. So document them.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
3758173149 mesa: Build libmesa_dricore.a for Android
libmesa_dricore.a is analogous to the libmesa.a built by the Autoconf
build.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Brian Paul
5d9e242c3e tnl: fix regression in bind_indices()
Commit 2ea1ff3816 caused the regression.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40413
2011-08-30 10:17:53 -06:00
Brian Paul
788d9bf121 tnl: add const qualifier to silence warning 2011-08-30 10:17:53 -06:00
Brian Paul
642bbc6f59 tnl: use buffer helper functions to improve readbility 2011-08-30 10:17:52 -06:00
Chad Versace
16f442e9d5 make: Factor out source lists from drivers/dri/common into Makefile.sources
In order that the Autoconf and Android build can share the same source
lists, move the lists from
    src/mesa/drivers/dri/Makefile.defines
into
    src/mesa/drivers/dri/common/Makefile.sources

I would like for Android to just reuse Makefile.defines, but the file is
unsuitable for reuse.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Chad Versace
e4a6ebdd87 make: Remove duplicate occurence of driverfuncs.c
driverfuncs.o is already contained in libmesa.a, so remove it from the
following source lists:
    src/mesa/drivers/dri/Makefiles.defines:COMMON_SOURCES.
    src/mesa/drivers/dri/swrast/Makefile:SWRAST_COMMON_SOURCES

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Chad Versace
08701b6c95 make: Remove duplicate defintion of COMMON_SOURCES in Radeon makefiles
Remove defintion of COMMON_SOURCES from {r300,r660}/Makefile. The
defintion is a duplicate of that found in
src/mesa/drivers/dri/Makefile.defines.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Christian König
8f4ec55f77 r600g: Make unaligned 3D textures work on +evergreen
The layersize calculation is slightly different on +evergreen.
This makes mpeg2 video decoding and piglits texture-packed-formats
test work correctly on this hardware.
2011-08-30 15:33:51 +02:00
Christoph Bumiller
d49525d0c5 nouveau: use PRIu64 for printing uint64_t 2011-08-30 14:52:17 +02:00
Christoph Bumiller
8476232b08 nouveau/mm: move slabs to correct list on memory release
Should get rid of "destroying GPU memory cache with some buffers
still in use" message.
2011-08-30 14:52:17 +02:00
Maarten Lankhorst
210ddf0819 winsys/radeon: Create async thread only once
I noticed that a thread was created for every time async flush was called, so I moved it and used some semaphores to synch.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-08-30 14:01:57 +02:00
Christoph Bumiller
3b3d2e53bc nvfx: use common NOUVEAU_RESOURCE_FLAG_LINEAR define 2011-08-30 13:55:08 +02:00
Christoph Bumiller
0a3f0ff264 nv50: add support for linear textures and render targets 2011-08-30 13:55:07 +02:00
Christoph Bumiller
55bab45a7c nv50: align pitch of linear surfaces correctly 2011-08-30 13:55:07 +02:00
Christoph Bumiller
eabb9b0fd9 nv50: handle TGSI_OPCODE_ROUND
Will round to nearest-even.
2011-08-30 13:55:07 +02:00
Christoph Bumiller
222b3ea653 nv50,nvc0: add states mask to state validation function
This prevents null dereferences in validation of interdependent
state after a switch to a pipe context where we mark all state
as dirty but where not all state is valid / set yet.
2011-08-30 13:55:07 +02:00
Christoph Bumiller
9f4998639c nv50,nvc0: reject R8G8B8A8/X8_UNORM for multisample surfaces
The window system buffer will be BGRA and applications will try to
directly resolve to it, which would trigger an INVALID_OPERATION in
BlitFramebuffer if the multisample renderbuffer is RGBA.
2011-08-30 13:55:07 +02:00
Christoph Bumiller
fb92fc25b0 mesa: update multisample state on _NEW_BUFFERS
A change in sampleBuffers affects the final enable value.
2011-08-30 13:55:07 +02:00
José Fonseca
0b263aeb8b glu: Avoid defining conflicting DEBUG NDEBUG macros. 2011-08-30 09:42:01 +01:00
José Fonseca
15465949e0 glu: Fix build on mingw-w64. 2011-08-30 09:42:01 +01:00
José Fonseca
99a8150a1a Remove dead Makefiles. 2011-08-30 09:42:01 +01:00
José Fonseca
282ecaf82c docs: Update scons info regarding mingw. 2011-08-30 09:42:01 +01:00
José Fonseca
3ab19bf82a Remote *.mgw stuff.
Totally broken, and deprecated by scons.
2011-08-30 09:42:01 +01:00
José Fonseca
a68ba5e0f0 libgl-gdi: Fix mingw-w64 build.
Mingw-w64 actually seems to be closer to MSVC in terms of .DEF parsing.
2011-08-30 09:42:01 +01:00
José Fonseca
ec759b3755 st/wgl: Fix build on mingw-w64
Which already declares wglSwapMultipleBuffers and WGLSWAP.
2011-08-30 09:42:01 +01:00
José Fonseca
d290febdc8 gdi: Remove mesa_wgl.h
All commonly used windows toolchains define wgl entrypoints in the windows
headers, and mesa_wgl.h not only is unnecessary but actually often stands
in the waydue to slight inconsistencies.

So remove it.
2011-08-30 09:42:01 +01:00
José Fonseca
191428ccb8 scons: Prefer x86_64-w64-mingw32- prefix.
This allows to use mingw-w64 binaries on debian systems which already
include a (typically incomplete) 64 cross compiler.
2011-08-30 09:42:01 +01:00
Maarten Lankhorst
f5cf4ec90d xorg/xvmc: Only set decode buffer when available
The nouveau xvmc decoder doesn't need it.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-08-29 19:39:22 -04:00
Marek Olšák
b2064ff311 glsl_to_tgsi: fix a reference leak on an error path 2011-08-29 22:31:10 +02:00
Kenneth Graunke
dc7f449d1a i965: Avoid generating MOVs for most ir_assignment handling.
This is a port of vec4_visitor::try_rewrite_rhs_to_dst to fs_visitor.

Not only is this technique less invasive and more robust, it also
generates better code.  Over and above the previous technique, this
reduced instruction count in shader-db by 0.28% on average and 1.4% in
the best case.

In no case did this technique result in more code than the prior method.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2011-08-29 11:39:41 -07:00
Kenneth Graunke
d28a3bd4bf i965/fs: Revert "Avoid generating MOVs for assignments for expressions."
This reverts commit 53c89c67f3, along with
the subsequent this->result = reg_undef additions it required.

Both Eric and I agree that the way he did this is really fragile; if you
forget to add this->result = reg_undef before calling accept(), it may
end up using the same register for two separate things, breaking things
in strange and mysterious ways.

The next commit will port over the new VS backend's method for solving
this problem, which is simpler, less intrusive, and still manages to
avoid MOVs in the common case.
2011-08-29 11:39:41 -07:00
Ian Romanick
55d232a815 mesa: Remove all mention of MESA_FORMAT_CI8
Nothing in Mesa supports color-index textures, and most of the other
infrastructure that could allow such support has already been removed.
This puts the final nail in the coffin.

Also clean out some GL_COLOR_INDEX comments in formats.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-29 11:07:49 -07:00
Ian Romanick
0c1b716654 dri: Remove MESA_FORMAT_CI8 bits from drivers that don't do paletted textures
This came from the "kill it with fire" discussion at XDS 2010.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-29 11:07:49 -07:00
Brian Paul
6f1846e392 scons: add swrast/s_texture.c to the build 2011-08-29 11:37:13 -06:00
Eric Anholt
336f87d5d5 intel: Rely on Mesa core for the non-blit glTexSubImage* implementation.
It uses MapTextureImage() now, so we don't need our own mapping.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Brian Paul
b8950c2225 mesa: Convert texture debug dump function to using MapTextureImage().
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Eric Anholt
bad53f3ba5 intel: Remove our custom _mesa_store_compressed_texsubimage2d().
Now that Mesa core knows how to map teximages, we no longer needed the
compressed paths here.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Brian Paul
81430ab54f mesa: Convert texstore.c to accessing textures using MapTextureImage.
This continues to allocate texImage->Data as before, so
drivers calling these functions need to use that when present.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Eric Anholt
5b257442a8 nouveau: Add MapTextureImage() implementation.
This is untested, but should be close to working since it's basically
a copy of nouveau_teximage_map().

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
587fdf07da radeon: Add MapTextureImage() implementation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
ff68e3d304 radeon: Refactor the common texture hook setup to common code.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Brian Paul
e10337da21 swrast: Add implementation of MapTextureImage/UnmapTextureImage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
bfc09e92ff intel: Add implementation of MapTextureImage/UnmapTextureImage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Brian Paul
0abb2659dd st/mesa: Add implementation of MapTextureImage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Brian Paul
570016cef2 mesa: Add driver hooks for texture image mapping/unmapping.
ctx->Driver.MapTextureImage() / UnmapTextureImage() will be called by
the glTex[Sub]Image(), glGetTexImage() functions, etc. when we're
accessing texture data, and also for software rendering when accessing
texture data.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
68f8cf7263 mesa: Don't check for image->Data when freeing an image's contents.
All driver implementations of FreeTextureImageBuffer already check
that Data != NULL and free it.  However, this means that we will also
free driver storage if the driver storage wasn't in the form of a Data
pointer.

This was produced by the following semantic patch:

@@
expression C;
expression T;
@@
- if (T->Data) {
- C->Driver.FreeTextureImageBuffer(C, T);
+ C->Driver.FreeTextureImageBuffer(C, T);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
5401590815 Rename some driver FreeTextureImageData functions to FreeTextureImageBuffer.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
0bb29949ba mesa: Rename FreeTexImageData to FreeTextureImageBuffer.
This was produced by sed, except for one hunk in driverfuncs.c where
trailing whitespace was dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-29 10:09:41 -07:00
Brian Paul
beca3316fb i915g: remove unused var in i915_flush_heuristically() 2011-08-29 08:11:50 -06:00
Kai Wasserbäch
d4e8f38477 winsys/g3dvl: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:06 -06:00
Kai Wasserbäch
066875f340 tests/unit: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:04 -06:00
Kai Wasserbäch
a546acdaf4 targets/xorg-vmwgfx: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:03 -06:00
Kai Wasserbäch
7ea550621e st/xorg: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:01 -06:00
Kai Wasserbäch
28f8ff6b62 vdpau: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
8bc7ccede1 va: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
92bc1111f3 d3d1x: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
51ecb33c6b include/pipe: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
8fb7f1a8a4 r600g: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
625593fde2 noop: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:54 -06:00
Kai Wasserbäch
19bcd21ed1 vl: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:54 -06:00
Kai Wasserbäch
137ba91aad util: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:49 -06:00
Kai Wasserbäch
e106d4c731 docs: Fix minor typos.
dbec3a5d introduced minor typos, this should fix them.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:46 -06:00
Christian König
d4bbdbd038 g3dvl: Fix a bug not decoding the last 32-64 bits of an mpeg2 bitstream.
Another bug found by Andy Furniss.
2011-08-29 10:36:06 +02:00
Christian König
ddd25cfbb0 st/vdpau: Respect source_rect in VideoMixerRender
Fixing a bug reported by Andy Furniss.
2011-08-29 10:16:56 +02:00
Benjamin Franzke
efb4872a9d egl: Use gbm/wayland flags regardless of egl_dri2
Since they are needed for display autodetection.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40443
2011-08-29 09:34:20 +02:00
Maarten Lankhorst
110f846c25 xvmc tests: Clean up test_rendering slightly
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-08-28 12:12:59 -04:00
Chia-I Wu
099faeef33 android: add support for egl_dri2
Add rules to build egl_dri2 and make it a built-in EGL driver of
libGLES_mesa.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-28 21:56:23 +08:00
Chia-I Wu
9779f6f5c1 egl_dri2: add support for Android
Add platform_android.c that supports _EGL_PLAFORM_ANDROID.  It works
with drm_gralloc, where back buffers of windows are backed by GEM
objects.

In Android a native window has a queue of back buffers allocated by the
server, through drm_gralloc.  For each frame, EGL needs to

  dequeue the next back buffer
  render to the buffer
  enqueue the buffer

After enqueuing, the buffer is no longer valid to EGL.  A window has no
depth buffer or other aux buffers.  They need to be allocated locally by
EGL.

Reviewed-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>

[olv: with assorted minor changes, mostly suggested during the review]
2011-08-28 21:56:23 +08:00
Chia-I Wu
58911b86a1 egl_dri2: allow RGBA masks to be specified for matching
Add rgba_masks to dri2_add_config.  When it is non-NULL, the DRI config
is accepted only when the offsets and sizes of the its channels match
rgba_mask.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-28 21:56:22 +08:00
Marek Olšák
c8fed01c73 glsl_to_tgsi: remove unused code 2011-08-27 19:26:14 -05:00
Chia-I Wu
09b5f1fd61 android: make DRM optional
For BOARD_GPU_DRIVERS=swrast build, DRM is not needed.
2011-08-27 18:02:11 +08:00
Chia-I Wu
534df79187 android: add support for nouveau
Compile tested only.
2011-08-27 17:29:13 +08:00
Chia-I Wu
c696d65793 android: add support for r300g
Compile tested only.
2011-08-27 17:29:12 +08:00
Chia-I Wu
99be968e99 android: add support for i915g
Quickly tested with 945GME.  SurfaceFlinger (the display server and
compositor) works.  2D apps with RGB or RGBA visuals work.  As for 3D
apps, some work and some do not.
2011-08-27 17:29:09 +08:00
Chia-I Wu
04dbb37eaa android: add support for vmwgfx
Quickly tested with VMWare Workstation 7.1.4 on Linux with GeForce
GT220.  SurfaceFlinger (the display server and compositor) works.  2D
apps with RGB visual works.  However, due to missing
PIPE_FORMAT_R8G8B8A8_UNORM support, those with RGBA visual do not.
2011-08-27 17:28:32 +08:00
Chia-I Wu
0cc0889007 winsys/i915: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:32 +08:00
Chia-I Wu
f9b55e23af winsys/svga: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:32 +08:00
Chia-I Wu
11a56c430b nouveau: share the source lists
For each driver, factor out C_SOURCES from Makefile to Makefile.sources,
and let Makefile and SConscript share it.
2011-08-27 17:28:31 +08:00
Chia-I Wu
1025f11327 r300g: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.

Note that

  $(TOP)/src/glsl/ralloc.c and
  $(TOP)/src/mesa/program/register_allocate.c

are removed from C_SOURCES in Makefile.sources and added back in
Makefile and SConscript.  The idea is that they are not part of r300g.
But having them in libr300.a makes build non-GL targets such as the
compiler tests or g3dvl much easier.  Also, for practical reason, TOP
would be an undefined variable in Makefile.sources.
2011-08-27 17:28:31 +08:00
Chia-I Wu
a558bf69cb i915g: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:31 +08:00
Chia-I Wu
d2f10d8267 svga: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:31 +08:00
Chia-I Wu
822fad64f8 targets/egl-static: fix nouveau and vmwgfx for Android
drmVersion and driver specific ioctls are used to get the PCI ID from a
DRM fd.  Eexpand the mechanism to nouveau and vmwgfx, except that for
nouveau, only the vendor ID is needed, and for vmwgfx, always assume
SVGA II.
2011-08-27 17:28:31 +08:00
Chia-I Wu
d074acb4fa pci_ids: add vmwgfx pci id list
There is only one chipset

 15ad:0405 VMware SVGA II Adapter
2011-08-27 17:28:30 +08:00
Ian Romanick
3a1ed4eaf2 mapi: Commit generated files modified by previous commit
Some of the changes are spurious because somebody forgot to do this
when adding glFramebufferTextureLayerARB.
2011-08-26 23:33:23 -07:00
Ian Romanick
f40c291ed6 mapi: Silence many "warning: unused parameter"
When generating dispatch templates, emit the '(void) blah;' magic to
make GCC happy.  This reduces a lot of warning spam if you build with
-Wunused-parameter or -Wextra.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-08-26 23:33:12 -07:00
Ian Romanick
5266c87c87 mesa/tnl_dd: Remove unused source tree mesa/tnl_dd/imm
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:24 -07:00
Ian Romanick
5dd6626a7a mesa/tnl_dd: Remove unused header file t_dd_vbtmp.h
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:24 -07:00
Ian Romanick
6118bbd0a6 mesa/tnl_dd: Remove unused header file t_dd_rendertmp.h
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:24 -07:00
Ian Romanick
93db12a721 mesa: Remove support for BeOS
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:23 -07:00
Ian Romanick
c30181c7c3 dri: Remove unused header files mmx.h and spantmp.h
These header files were only used by drivers removed in a previous commit.

Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:23 -07:00
Ian Romanick
dd10e7e0c3 dri: Remove driRenderbuffer::backBuffer field
The tdfx driver was the only user.

Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:22 -07:00
Ian Romanick
e4344161bd dri: Remove all DRI1 drivers
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:22 -07:00
Ian Romanick
117042b46f mesa: Remove obsolete Windows gldirect and ICD drivers
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:21 -07:00
Ian Romanick
17645103aa mesa: Remove obsolete linux-fbdev software driver
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:21 -07:00
Ian Romanick
5070903653 mesa: Remove stray, unused file
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:20 -07:00
Chad Versace
f55a9a481f i965: Factor our source lists into Makefile.sources
In preparation for porting i965 to Android, factor its source lists into
a shared makefile. This prevents duplication of source lists, and hence
prevents the Android from breaking as often.

Acked-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-26 18:44:06 -07:00
Stéphane Marchesin
f8e6d19f3f Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa 2011-08-26 17:37:25 -07:00
Brian Paul
e3b0e37766 g3dvl: use pointer_to_uintptr() to silence a cast warning 2011-08-26 14:16:20 -06:00
Lauri Kasanen
50da22ceb1 docs: Add a page on post-processing
With edits by Brian.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-26 14:05:28 -06:00
Brian Paul
0295ac9c8e svga: include LLVM in name string in debug builds 2011-08-26 13:57:23 -06:00
Christoph Bumiller
7ed14bec11 pp: initialize the sample mask
We cannot rely on pipe drivers to default to non-zero.

Fixes pp being a no-op on nv50.

Reviewed-by: Lauri Kasanen <cand@gmx.com>
2011-08-26 21:45:26 +02:00
Michel Dänzer
3bcb9a858f st/xorg: Fix solid fills for formats other than PICT_a8r8g8b8.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-08-26 18:22:07 +02:00
Michel Dänzer
433c740c1a r600g: Hook up xorg state tracker.
Mostly copied from r300g.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:21:38 +02:00
Michel Dänzer
702838a706 r600g: Handle PIPE_TRANSFER_MAP_DIRECTLY.
If the state tracker tries to map the resource directly but we can't or don't
want to do that, fail to create a transfer.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:21:18 +02:00
Michel Dänzer
f5a4e04cdb st/xorg: Disable dirty throttling by default.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:20:59 +02:00
Michel Dänzer
751f0ce773 st/xorg: Only damage non-front source in DRI2 CopyRegion hook.
Based on a vmwgfx xa/saa fix.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:18:35 +02:00
Brian Paul
005aea891e g3dvl: s/inline/INLINE/ to fix MSVC build 2011-08-26 08:24:01 -06:00
Brian Paul
b59715b13a g3dvl: fix compilation failure on MSVC
I assume the intention of "mb = {}" was to zero-initialize it.
2011-08-26 08:11:50 -06:00
Brian Paul
cdb7396390 scons: don't compile some files with -gstabs if using mingw32
Compiling some (large) files with i686-pc-mingw32-gcc 4.2.2 (at least)
and the -gstabs option triggers a compiler error.  Use this work-around
to simply compile the effected files without -gstabs.
2011-08-26 08:05:36 -06:00
Brian Paul
3d1af78fdc scons: add more LIBS for compiling with LLVM 2.9 on Windows
These extra libs shouldn't hurt with LLVM 2.8 or older.
2011-08-26 08:05:35 -06:00
Christian König
9765dede75 g3dvl: Rewrite the mpeg 1&2 bitstream parser
Based on work of Maarten Lankhorst this time.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:35 +02:00
Christian König
31096e13f8 g3dvl: Use a single texture for luma and chroma data
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:35 +02:00
Christian König
2e62b30826 g3dvl: Rework the decoder interface part 5/5
Make setting the quant matrixes a generic interface.
Also removes setting the quant matrix from the XvMC interface

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
835ea8480f g3dvl: Rework the decoder interface part 4/5
Make the picture_structure enum spec complient.
Also remove it from the compositor.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
d3770d6229 g3dvl: Rework the decoder interface part 3/5
Revert back to a macroblock based interface. The structure used
tries to keep as close to the spec as possible.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
231fce7d63 g3dvl: Rework the decoder interface part 2/5
Implement PIPE_CAP_NUM_BUFFERS_DESIRED giving the decoder control over
the number of buffers a state tracker should allocate.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
1d1d038c85 g3dvl: Rework the decoder interface part 1/5
First of all get ride of the decode_buffer structure, while still giving
the decoder the ability to organize it's buffers depending on the needs
of the state tracker.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Dave Airlie
6fb12bf031 tgsi: update tgsi.rst for TXQ
add some info on the TXQ opcode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-26 11:04:15 +01:00
David Reveman
a2c467c054 i915g: Fix off-by-one in scissors. 2011-08-25 22:57:48 -07:00
Stéphane Marchesin
3d9000393b i915g: Fix case where texcoords can overlap with fragpos/frontface. 2011-08-25 22:57:48 -07:00
Stéphane Marchesin
b97889f543 i915g: Improve the flush heuristic by using the previous frame's number of vertices. 2011-08-25 22:57:48 -07:00
Vadim Girlin
fdb62ef3f5 r600g: fix replace_gpr_with_pv_ps
Instructions with 3 source operands have no write mask, so we may replace their
destinations with PV/PS in the next group even if their dst.write is 0.

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-08-25 16:59:10 -04:00
Vadim Girlin
6ba68c7654 r600g: fix check_and_set_bank_swizzle
Need to do full check when not all bank swizzles in the group are forced
(e.g. when trying to merge interp_* group with the next instruction)

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-08-25 16:58:06 -04:00
Kenneth Graunke
778ecc9283 glcpp: Add GL_ARB_conservative_depth #define.
Forgotten in the patch that enabled the extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-25 13:14:24 -07:00
Ian Romanick
116680ddc2 i965: Remove all bits of NRM3 and NRM4 code
Nothing in Mesa generates these opcodes, and i965 hardware cannot
support it natively.  If support were ever added for this opcode in
Mesa, there had better be a lowering pass for hardware that doesn't
support it natively.
2011-08-25 13:12:21 -07:00
Dave Airlie
8ce716257a glsl: fix crash when a const is passed to texelFetchOffset
while debugging texelFetchOffset we kept hitting the assert.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-25 21:07:42 +01:00
Kenneth Graunke
c25b494332 glsl: Bail after reporting an error for non-constant const_in parameters.
Otherwise we continue and hit the "Illegal formal parameter mode"
assertion.

Fixes negative compile test texelFetchOffset.frag in piglit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-25 21:07:42 +01:00
Brian Paul
27395cb5b6 pp: add files to Makefile.sources 2011-08-25 10:36:59 -06:00
Brian Paul
6571c0774a Merge branch 'kasanen-post-process-v2'
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
2011-08-25 10:12:12 -06:00
Brian Paul
e3a7cb4a6c softpipe: add const qualifier to silence warnings 2011-08-25 10:08:15 -06:00
Dave Airlie
5f3de17ef0 glsl_to_tgsi: add TXF support. (v2)
This adds texelFetch support to translate from GLSL to TGSI TXF opcode.

I've tested this works with an r600g and softpipe backend.

v2: drop comments, fix title,

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-08-25 16:54:20 +01:00
Dave Airlie
62ad6e66a5 softpipe: implement TXF support via get_texel callback
This just calls the texel fetch functions directly bypassing the sampling,

notes:
1: loops inside switch should be more optimal.
2: borders can be sampled though only up to border depth, outside that
its undefined.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-25 16:54:20 +01:00
Dave Airlie
d562f97bef tgsi: add TXF support.
This is a straight texel fetch with no filtering or clamping. It uses
integers to specify the i/j/k (from EXT_gpu_shader4).

To enable this I had to add another hook into the tgsi sampler so that
we could easily bypass all the filtering sample does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-25 16:54:20 +01:00
Dave Airlie
515d9e8880 glsl_to_tgsi: implement TXS/TXQ. (v2)
GLSL uses TXS, call the gallium TXQ opcode.

v2: fix indent from 4->3.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-08-25 16:49:20 +01:00
Dave Airlie
461646f539 softpipe: add get_dims callback for TXQ support. (v2)
This adds the get_dims callback that is called from the tgsi exec_txq.

It returns values as per EXT_gpu_program4.

v2: fix one indent + use a switch (slighty modified from Brian)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-25 16:49:20 +01:00
Dave Airlie
7f1b9ddd12 tgsi: add TXQ support. (v2)
this adds another callback in the sampler struct containing get_dims
entry point. This is used to query the driver for the texture resource
dimensions for the resource bound to the current sampler.

v2: remove unusued variable, fix indent

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-25 16:49:20 +01:00
Kenneth Graunke
b9eb4d8a59 glsl: Implement the GL_ARB_conservative_depth extension.
It's the same as GL_AMD_conservative_depth.  The specs have slight
differences in wording, but don't differ in content or behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-25 08:07:21 -07:00
Kai Wasserbäch
dbec3a5daf Document the return type coding style.
As per discussion at [0] methods shouldn't use OpenGL return types, if
they're not part of the GL API.

[0] <http://marc.info/?l=mesa3d-dev&m=130754488901774&w=2>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-25 07:21:00 -07:00
Kai Wasserbäch
79a486ead9 Change return type of try_emit_* methods to bool.
Ian Romanick explained (Message-Id: <4E528973.6080902@freedesktop.org>),
that the return type of non-API methods shouldn't use GLboolean but a
standard C++ bool.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-08-25 07:21:00 -07:00
Christoph Bumiller
55592d9da1 d3d1x: save to correct slot in xs_set_constant_buffers 2011-08-25 12:52:35 +02:00
Christoph Bumiller
974412d7b9 d3d1x: fix xs_set_samplers 2011-08-25 12:34:23 +02:00
Chia-I Wu
7b1972d7be android: add support for r600g
Tested with a Radeon HD 6250.  SurfaceFlinger (the display server and
compositor) works.  2D apps with RGB or RGBA visuals work.  As for 3D
apps, some work but some don't (with serious rendering defects).

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu
689b45fb27 winsys/radeon: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu
027a45e5cf winsys/r600: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu
8dda3f2bcb r600g: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Ian Romanick
707d614d10 glsl: Make sure that Extensions.dummy_true is set to true
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-08-24 14:33:31 -07:00
Brian Paul
038d654bcb vbo: remove unused var, remove unneeded local var 2011-08-24 14:50:28 -06:00
Brian Paul
473cf06339 llvmpipe: add more restrict keywords
Put restrict in the function definitions to silence MSVC warnings
about incompatible assignments in "func = lp_tile_foobar;" when func
was declared with restrict keywords but the rhs function wasn't.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-08-24 14:45:02 -06:00
Paul Berry
43968261e4 docs: Document coding style conventions
This patch documents some Mesa coding style conventions that came up
during the discussion of commit 67b5a32 (Perform implicit type
conversions on function call out parameters).
2011-08-24 10:55:12 -07:00
Brian Paul
ddd6e5b8bc swrast: Remove swrast eject/validate texture image code.
No driver used the eject function, or set the validate hook that made
that function do anything.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Eric Anholt
4990e7e9fb radeon: Fix flushing before writing a teximage's BO when !t->bo.
Before, if we ended up here without a BO for our image, but did choose
a miptree that had active rendering in the command buffer, our
teximage data would jump ahead of the rendering using the old texture
contents.

This showed up as breakage in gen-teximage and friends in the
following commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Brian Paul
6dbad425bc st/mesa: remove st_texture_image::face,level fields
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Brian Paul
7dae1aaf14 intel: use new gl_texture_image:Face, Level fields
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Brian Paul
a231d24551 mesa: add gl_texture_image::Face, Level fields
Several drivers have these fields in their subclasses of gl_texture_image.
They'll be useful for core Mesa too...

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:19 -07:00
Brian Paul
c3ad95ed40 x11: add missing comma to fix compilation 2011-08-24 07:55:04 -06:00
Dave Airlie
cc9a8915f0 r600g: fill out missing entries in opcode tables.
this just adds the missing opcodes as unsupported.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-24 13:30:53 +01:00
Chia-I Wu
1284d5b255 winsys/svga: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.
2011-08-24 10:57:12 +08:00
Chia-I Wu
70b1837dfb winsys/radeon: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-24 10:57:12 +08:00
Chia-I Wu
9bda86c355 auxiliary/os: add wrappers for mmap/munmap
The use of mmap() in winsys requires large file support.  Not all OSes
have LFS so a wrapper should be used.  In particular, os_mmap() should
call __mmap2() on Android.
2011-08-24 10:57:12 +08:00
Ian Romanick
0d636213d4 i965: Only map the necessary buffer range in brw_prepare_indices
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:12 -07:00
Ian Romanick
2ea1ff3816 tnl: Only map the necessary buffer range in bind_indices
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:12 -07:00
Ian Romanick
655c7d7498 mesa: Only map the necessary buffer range in vbo_get_minmax_index
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:11 -07:00
Ian Romanick
28249bd260 mesa: Eliminate dd_function_table::MapBuffer
Replace all calls to dd_function_table::MapBuffer with appropriate
calls to dd_function_table::MapBufferRange, then remove all the cruft.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:11 -07:00
Ian Romanick
cccc7412c2 radeon: Hack up an implementation of MapBufferRange
This doesn't implement any of the "cool" features of MapBufferRange.
Adding this function is necessary for the next commit in the series.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Maciej Cencora <m.cencora@gmail.com>
2011-08-23 14:52:11 -07:00
Ian Romanick
b2184da684 mesa: Fix incorrect access parameter passed to MapBuffer
The code previously passed GL_DYNAMIC_DRAW for the access parameter.
By inspection, I believe that all drivers would treat this as
GL_READ_WRITE because it's not GL_READ_ONLY and it's not
GL_WRITE_ONLY.

It appears the i965 code wants GL_WRITE_ONLY (it's about to write a
bunch of data in, never read data), while the arrayelt code is
GL_READ_ONLY (just dereffed as arguments to CALL_Whatever*v).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Whitwell <keithw@vmware.com>
2011-08-23 14:52:10 -07:00
Ian Romanick
6183edc070 mesa: Remove target parameter from dd_function_table::FlushMappedBufferRange
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:10 -07:00
Ian Romanick
f973be59fa intel: Correctly check for read-only mappings in intel_bufferobj_map_range
The old code was an obvious cut-and-paste fail from intel_bufferobj_map.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2011-08-23 14:52:10 -07:00
Ian Romanick
4ddae2fb66 mesa: Remove target parameter from dd_function_table::MapBufferRange
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:10 -07:00
Ian Romanick
6c8aa3491a mesa: Remove target parameter from dd_function_table::GetBufferSubData
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
92f3fca0ea mesa: Remove target parameter from dd_function_table::BufferSubData
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
12d924c5ae mesa: Remove target parameter from dd_function_table::MapBuffer
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
56f0c00f12 mesa: Remove target parameter from dd_function_table::UnmapBuffer
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:08 -07:00
José Fonseca
0457655035 make: Add missing source file. 2011-08-23 19:50:54 +01:00
Eric Anholt
abbb8fc3a7 i965: Fix typo in 2b224d66a0
Unfortunately, since a previous efficiency improvement, we no longer
have any open-source testcases producing register spilling, so this
code was untested in the fragment shader path.  That should change
when we get proper temporary array support in the fragment shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40194
2011-08-23 11:23:04 -07:00
Eric Anholt
9d4b98eb9e i965/gen6+: Use non-normalized coordinates for GL_TEXTURE_RECTANGLE.
Improves performance of a GL_TEXTURE_RECTANGLE microbenchmark by 1.84%
+/- .15% (n=3)
2011-08-23 11:23:04 -07:00
Kenneth Graunke
4eeb4c1505 i965: Implement textureSize (TXS) on Gen4.
Also, remove the BRW_SAMPLER_MESSAGE_SIMD8_RESINFO #define because
there totally isn't a SIMD8 variant.

Unfortunately, resinfo returns FLOAT32 on Broadwater/Crestline, unlike
G45 which returns a proper UINT32.  This turns out to be simple,
however: when we emit MOVs to select the desired half of the SIMD16
result, we can simply override the register type to be float so it's
converted to an integer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:26 -07:00
Kenneth Graunke
ecf8963754 i965/fs: Implement textureSize (TXS) on Gen5+.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:25 -07:00
Kenneth Graunke
b6bdcf2a90 i965/fs: Rudimentary support for non-floating point texture results.
Not all texturing operations return floating point data.  For example,
the resinfo message (textureSize or TXS) returns integer data.  In the
future, we'll also add integer texture support.

ir_texture's type field contains this information; use its base type to
appropriately type the destination register.  We want to keep it as a
four component vector, however, since SIMD8 samplers always have a
response length of 4.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:08 -07:00
Kenneth Graunke
2054652796 glsl/builtins: Uncomment textureSize prototypes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-08-23 11:18:03 -07:00
Kenneth Graunke
583b295bbf texture_builtins.py: Add support for textureSize (txs).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:17:35 -07:00
Kenneth Graunke
1e3bcbdf31 glsl: Add a new ir_txs (textureSize) opcode to ir_texture.
One unique aspect of TXS is that it doesn't have a coordinate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-08-23 11:16:30 -07:00
Maarten Lankhorst
8f26b59f53 st/xorg: Advertise support for XvMC
Formats were based on a patch sent to xf86-video-nouveau by Bryan Cain

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

[Michel Dänzer: Add xorg_xvmc.c to SConscript.]
2011-08-23 12:13:03 +02:00
Chia-I Wu
29d7a0bb16 mesa: call _mesa_set_vp_override in glDrawTex*
The driver may install its own vertex shader.  _mesa_set_vp_override
must be called so that core mesa can generate correct fragment program..

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-23 09:12:12 +08:00
Chia-I Wu
dd250e6045 auxiliary: share the source lists
Factor out source lists from Makefile to Makefile.sources, and let
Makefile, SConscript, and Android.mk share it.

Note that files in $(GENERATED_SOURCES) are removed from $(C_SOURCES).

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:12:08 +08:00
Chia-I Wu
582b5d869c scons: add ParseSourceList method
ParseSourceList() can be used to parse a source list file and returns
the source files defined in it.  It is supposed to be used like this

  # get the list of source files from C_SOURCES in Makefile.sources
  sources = env.ParseSourceList('Makefile.sources', 'C_SOURCES')

The syntax of a source list file is compatible with GNU Make.  This
effectively allows SConscript and Makefile to share the source lists.

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:11:58 +08:00
Kenneth Graunke
6c8ea1eed6 glsl: Make ir_validate actually visit ir_if nodes.
There is no ir_hierarchical_visitor::visit(ir_if *) method, since ir_if
is not a leaf node.  Instead, there are visit_enter and visit_leave
methods.  Use visit_enter arbitrarily (either would work fine, though
visit_enter will catch errors sooner).

Found thanks to a warning emitted by Clang.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-22 10:30:47 -07:00
Chad Versace
69595283b6 intel: Abort when DRI2 separate stencil handshake fails
When intel_context requires separate stencil but the DRI2 separate stencil
handshake fails, then abort and emit an error instructing the user to
upgrade the DDX to 2.16.0.

CC: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-22 07:27:05 -07:00
Kenneth Graunke
7a5d28908c glsl_to_tgsi: Fix a few more struct vs. class warnings.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-21 23:07:14 -07:00
Bryan Cain
5379a70d3f glsl_to_tgsi: emit a MAD(b, -a, b) for !a && b
This is a port of commit ff2cfb8989 to glsl_to_tgsi.
2011-08-20 14:43:25 -05:00
Bryan Cain
c721d7b7bc glsl_to_tgsi: fix typo 2011-08-20 14:17:52 -05:00
Bryan Cain
9098953ee6 glsl_to_tgsi: implement ir_binop_all_equal using DP4 w/SGE
This is a port of commit ba01df11c4 to glsl_to_tgsi with integer support
added.
2011-08-20 14:15:03 -05:00
Bryan Cain
f3dce133f0 glsl_to_tgsi: implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLT
Implement the any() part of the operation the same way regular ir_unop_any
is implemented.

This is a port of commit e7bf096e8b to glsl_to_tgsi, with added integer
support.
2011-08-20 14:00:41 -05:00
Bryan Cain
a43f68810a glsl_to_tgsi: implement ir_unop_any using DP4 w/saturate or DP4 w/SLT
This is a port of commit 92ca560d68 to glsl_to_tgsi, with integer support
added.
2011-08-20 14:00:41 -05:00
Bryan Cain
c15eb5569b glsl_to_tgsi: make glsl_to_tgsi_visitor::emit_dp return the instruction 2011-08-20 14:00:40 -05:00
Bryan Cain
691cc0e3a8 glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLT
Logical-or is implemented using addition (followed by clamping to [0,1]) on
values of 0.0 and 1.0. Replacing the logical-or operators with addition gives
a + b which has a result on the range [0, 2].

Previously a SNE instruction was used to clamp the resulting logic value to
[0,1]. In a fragment shader, using a saturate on the add has the same effect.
Adding the saturate to the add is free, so (at least) one instruction is
saved. In a vertex shader, using an SLT on the negation of the add result has
the same effect. Many older shader architectures do not support the SNE
instruction. It must be emulated using two SLT instructions and an ADD. On
these architectures, the single SLT saves two instructions.

Note that SNE is still used when integers are used for boolean values, since
there is no such thing as an integer saturate, and older shader architectures
without SNE don't support integers.

This is a port of commit 41f8ffe5e0 to glsl_to_tgsi with integer support
added.
2011-08-20 14:00:40 -05:00
Bryan Cain
8c31bc7048 glsl_to_tgsi: implement ir_unop_logic_not using 1-x
Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x accurately
implements logical not.

This is a port of commit 6ad08989d7 to glsl_to_tgsi.
2011-08-20 14:00:40 -05:00
Chia-I Wu
112e68c503 st/egl: add a missing include
Reported by cwhuang.
2011-08-21 02:01:50 +08:00
Chia-I Wu
b71a7a2f37 st/egl: improve error logging
This helps diagnose problems in EGL initialization.
2011-08-21 02:01:50 +08:00
Chia-I Wu
5ce2dc692f st/egl: add buffer preserving support to Android
Use a staging color buffer when buffer preserving is enabled.
2011-08-21 02:01:50 +08:00
Chia-I Wu
4c222ff4fe st/egl: improve buffer cache for Android
There may be more than two back buffers.  Clean up and prepare the
buffer cache for that.
2011-08-21 02:01:50 +08:00
Chia-I Wu
62c7c2fca4 st/egl: swapping without a buffer is not an error
This fixes Kwaak3.
2011-08-21 02:01:49 +08:00
Chia-I Wu
8ccafbbbcc st/egl: use HAL formats for Android backend
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu
9650483acd winsys/sw/android: use HAL formats
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu
f496d8b86d winsys/sw/android: set bo usage correctly
Since this is the software path, set GRALLOC_USAGE_SW_WRITE_OFTEN when
PIPE_BIND_RENDER_TARGET, and set GRALLOC_USAGE_SW_READ_OFTEN when
PIPE_BIND_SAMPLER_VIEW.
2011-08-21 02:01:49 +08:00
Chia-I Wu
327de226ae android: make libGLES_mesa real
libGLES_mesa with swrast should link in these libraries

  libmesa_egl
  libmesa_egl_gallium
  libmesa_st_egl
  libmesa_st_mesa
  libmesa_glsl
  libmesa_glsl_utils
  libmesa_pipe_softpipe
  libmesa_winsys_sw_android
  libmesa_gallium

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
ee41fc898d android: build shared glapi
This builds the shared library libglapi from shared glapi.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
b81b82df95 android: build glsl
This builds the static library libmesa_glsl and executable glsl_compiler
from glsl.  glsl_compiler is only installed for engineering build.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
ee40f18054 android: build core mesa
This builds the static library libmesa_st_mesa from core mesa.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
2a77dc0c0d android: build core EGL
This builds the static library libmesa_egl from core EGL.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
faf9d580f5 android: build softpipe
This builds the static library libmesa_pipe_softpipe from softpipe.
2011-08-21 02:01:49 +08:00
Chia-I Wu
15576344f7 android: build android sw winsys
This builds the static library libmesa_winsys_sw_android from winsys/sw.
2011-08-21 02:01:49 +08:00
Chia-I Wu
b38da5f0a1 android: build targets/egl-static
This builds the static library libmesa_egl_gallium from
targets/egl-static.
2011-08-21 02:01:49 +08:00
Chia-I Wu
98345cf1b5 android: build st/egl with android backend
This builds the static library libmesa_st_egl from st/egl.
2011-08-21 02:01:48 +08:00
Chia-I Wu
688db6e8dc android: build gallium auxiliaries
This builds the static library libmesa_gallium from gallium auxiliaries.
2011-08-21 02:01:48 +08:00
Chia-I Wu
c9b21d986e android: build libGLES_mesa
This is the first step to integrate Mesa into Android(-x86) build
system.  You can git clone mesa under the external/ directory of Android
source tree and build Android with

 $ make BOARD_GPU_DRIVERS=swrast

It will build libGLES_mesa that will be loaded by Android runtime.

libGLES_mesa is still a stub in this commit.
2011-08-21 02:01:48 +08:00
Chia-I Wu
4b2b0b9fb8 targets/egl-static: do not rely on libudev on Android
There is no libudev on Android.  Use DRM to get the PCI ID directly.

Reviewed-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
2011-08-21 02:01:48 +08:00
Chia-I Wu
15418a8505 st/egl: add android backend
Both HW and SW rendering are supported for Android.  For SW rendering,
we use the generic gralloc lock/unlock for mapping and unmapping color
buffers (in winsys/android).

For HW rendering, we need to know the real type of color buffers.  This
backend works with drm_gralloc, where a color buffer is backed by a GEM
object.
2011-08-21 02:01:48 +08:00
Chia-I Wu
8e54c47a61 winsys/android: new SW winsys for Android
On Android, color buffers are passed between server and clients as
opaque buffer_handle_t.  This winsys makes use of gralloc, which
provides a generic way to map and unmap buffer_handle_t for CPU access.
2011-08-21 02:01:48 +08:00
Chia-I Wu
00b365bc78 egl: add Android-specific extensions
Add EGL_ANDROID_image_native_buffer and EGL_ANDROID_swap_rectangle.
There is no spec for them though.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
b0945c14df egl: add _EGL_PLATFORM_ANDROID
This is Android Gingerbread platform.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
504f92c739 mesa: android has no log2f nor ffs
Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
b34770d834 ralloc: include limits.h for SIZE_MAX on Android
Android does not define SIZE_MAX in stdint.h.  We have to include
limits.h for it.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
cd893ccba9 gallium: add PIPE_OS_ANDROID support
Android uses Linux kernel and its own C runtime.  It resembles
PIPE_OS_LINUX a lot with some minor exceptions.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-21 02:01:48 +08:00
Chia-I Wu
31753b50f3 glsl: remove an unnecessary header include
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:47 +08:00
Chia-I Wu
a40008ac64 mesa: fix !FEATURE_GL build
Move vbo_exec_FlushVertices_internal out of FEATURE_beginend.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:47 +08:00
Kenneth Graunke
f7d2dcae3b i965/gen7: Use align1 mode to set URB_WRITE_HWORD channel enables.
Makes the new vertex shader backend work on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-20 00:17:55 -07:00
Kenneth Graunke
e98ee06776 i965/fs: Don't double-convert integer/boolean uniforms.
When ctx->Const.NativeIntegers is set, Core Mesa loads integer/boolean
uniforms directly, rather than loading the floating point equivalent.
So, when that's set, we don't need to perform any conversions.

Unfortunately, we can't properly support native integers with the old
vertex shader backend, so this patch leaves them disabled for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-19 23:32:50 -07:00
Kenneth Graunke
01d81dedc7 mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.
Previously, native integer support was based on whether the driver
advertised GLSL 1.30 or not.  However, drivers that natively support
integers may wish to do so for older GLSL versions as well.  Adding this
new opt-in flag allows them to do so.

Currently disabled by default on all drivers, which was the existing
behavior (no drivers currently implement GLSL 1.30).

Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set:
- spec/glsl-1.10/fs-uniform-int-110.shader_test
- spec/glsl-1.30/fs-uniform-int-130.shader_test
(it was doubly converting the data)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-19 23:30:45 -07:00
Kenneth Graunke
07e9b9049f ir_to_mesa: Remove incorrect usage of the 'struct' keyword on classes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-19 23:29:24 -07:00
Kenneth Graunke
eb86bb55f5 i965/fs: Change incorrect use of 'struct fs_reg' to simply 'fs_reg'.
It's actually a class.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-19 23:29:24 -07:00
Kenneth Graunke
64f11db558 glsl: Remove unused variable. 2011-08-19 23:29:23 -07:00
Eric Anholt
f4db75547f i965/vs: Implement proper register allocation instead of 1:1 mapping.
Fixes vs-atan-* and several others.  This is not the real solution we
eventually want, which will pack floats, vec2s, and vec3s into vec4
registers, but this code should provide the framework for that.
2011-08-19 17:06:29 -07:00
Eric Anholt
8174945d33 i965/vs: Add simple dead code elimination.
This is copied right from the fragment shader.  It is needed for real
register allocation to work correctly.
2011-08-19 17:06:29 -07:00
Eric Anholt
3dadc1e3cc i965/vs: Copy the live intervals calculation over from the FS.
This is a rather pessimistic calculation, since it doesn't distinguish
individual channels of a vec4, or elements of an array, but should be
a minimum start for register allocation.
2011-08-19 16:55:02 -07:00
Eric Anholt
eb5454f20a i965/vs: Remove stale comment about compressed instructions.
This was copy'n'paste from the fragment shader, and didn't make sense
here.
2011-08-19 16:55:02 -07:00
Lauri Kasanen
88bc4eda0f pp/main queue: Add the PP headers
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:16 -06:00
Lauri Kasanen
85d2ee59d9 pp/main queue: Add pp_program.[ch]
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:16 -06:00
Lauri Kasanen
0d383d4790 pp/main queue: Add pp_init.c
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:16 -06:00
Lauri Kasanen
de43cd310c pp/main queue: Add pp_run.c
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:06 -06:00
Lauri Kasanen
caeb3cdf2f pp: Add Jimenez' MLAA
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:06 -06:00
Lauri Kasanen
f951550d3f pp: Add the MLAA areamap
The areamap contains precomputed data on different aliasing types.
It is necessary for good performance.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:06 -06:00
Lauri Kasanen
6ff00c1afa pp: Cel-shade filter
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:05 -06:00
Lauri Kasanen
e453289a77 pp: Color filters
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:05 -06:00
Lauri Kasanen
e86e4cf128 pp: Docs
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:05 -06:00
Lauri Kasanen
d2fdc58fe7 aux/Makefile,SConscript: Build PP
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:50:46 -06:00
Lauri Kasanen
421235d42a st/dri: Bind the post-processing queue to dri
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:49:33 -06:00
Lauri Kasanen
6a6441fc03 driconf: Add the PP descriptions
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:47:23 -06:00
Marek Olšák
db71537f01 r600g: don't allocate separate depth and stencil for transfer textures on EG
The state tracker expects depth and stencil pixels interleaved.
Evergreen can bind an interleaved depth-stencil resource as a colorbuffer,
but not as a zbuffer.

The hardware can do the interleaving for us when decompressing.
2011-08-19 23:12:15 +02:00
Marek Olšák
754ea4ea76 r600g: finally enable float depth buffers on evergreen 2011-08-19 23:12:11 +02:00
Marek Olšák
565f39bdb2 r600g: rename resource -> view in create_sampler_view
The sampler view is not a resource.
Also remove the unused desc variable.
2011-08-19 23:12:11 +02:00
Marek Olšák
751a6ed893 r600g: hack around a problem with texture alignment 2011-08-19 23:12:11 +02:00
Marek Olšák
98a87a594b r600g: simplify the conditionals determining array mode 2011-08-19 23:12:11 +02:00
Marek Olšák
7f29824fd5 r600g: put depth and stencil into one backing buffer
For DRI2 sharing.
2011-08-19 23:12:11 +02:00
Marek Olšák
68c54abb2c r600g: fix depth-stencil on evergreen
Such that it actually works in apps which use both.

A separate buffer is allocated for stencil. The only exception is
the window-system-provided depth-stencil buffer, where depth and stencil
share the same buffer.

This fixes:
- fbo-depthstencil-GL_DEPTH24_STENCIL8-clear
- fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-FLOAT-and-USHORT
- fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8
- fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-FLOAT-and-USHORT
2011-08-19 23:12:11 +02:00
Brian Paul
3e9dc51f82 mesa: handle array textures in GenerateMipmap(), FramebufferTexture1/2D()
This was an unfinished to-do item before.
With this patch and the two preceeding patches, piglit's
fbo-generatemipmap-array test runs and passes instead of generating
a GL error and dying on an assertion.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:11 -06:00
Brian Paul
0f8c43c34f meta: use fallback mipmap generation for 1D/2D texture arrays
We could do 1D/2D arrays with textured quad rendering, but it'll take
some work (as with 3D textures).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:11 -06:00
Brian Paul
0eb18ee557 mesa: set Q=1 for OPCODE_TEX execution
Q should not be significant for OPCODE_TEX, but it winds up getting
passed to the compute_lambda() function.  Make sure it's 1.0 to
prevent garbage values, which is effectively what we get when the
swizzle is coord.xyzz (which is what GLSL gives us).

Part of the fix for piglit's fbo-generatemipmap-array test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:10 -06:00
Brian Paul
352cab498a mesa: restructure error checking in _mesa_FramebufferTexture1D/2DEXT()
In anticipation of adding more texture targets.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:10 -06:00
Chad Versace
f23c3ebecc mesa: Declare _mesa_meta_begin()/end() as public
Declare _mesa_meta_begin()/end() in meta.h so that drivers can write
custom meta-ops (such as HiZ resolves for i965).

This necessitates moving the the META_* macros into meta.h. To prevent
naming collisions, this commit renames each macro to be MESA_META_*.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-19 10:49:59 -07:00
Christoph Bumiller
778997f9df nv50: fix potential null deref in insn modifer optimization pass
Bug introduced in 34980cd153.
2011-08-19 16:57:30 +02:00
Brian Paul
e975e18beb glx: use a block to fix declarations after code warning 2011-08-19 08:36:22 -06:00
Marek Olšák
e330d90e91 r600g: fix a possible crash in r600_adjust_gprs 2011-08-19 14:46:25 +02:00
Brian Paul
ccecc08f79 mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()
The spec says GL_INVALID_OPERATION is generated when texture!=0 and
textarget is not a legal value.  We had this right for the 2D function.
2011-08-18 11:51:53 -06:00
Paul Berry
e9ae4cadf5 glapi: update .gitignore for generated ES dispatch headers
Commit 6eff33dc (glapi: generate ES dispatch headers from core mesa)
replaced the autogenerated files
src/mapi/es1api/main/{dispatch,remap_helper}.h with new autogenerated
files src/mesa/main/api_exec_es{1,2}_{dispatch,remap_helper}.h.  This
patch updates the .gitignore files to properly ignore the new
autogenerated files, and stop ignoring the old autogenerated files.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-08-18 10:18:22 -07:00
José Fonseca
762bf931ca llvmpipe: Don't build lp_test_arit on MSVC.
Several issues due to expf/logf/etc either not being declared,
or being defined as a macro.
2011-08-18 18:04:44 +01:00
José Fonseca
a7f67b1c50 llvmpipe: snprintf->util_snprintf.
For MSVC.
2011-08-18 17:58:02 +01:00
José Fonseca
09042e08cb llvmpipe: Add u_math.h include.
Necessary on platforms with incomplete math.h
2011-08-18 16:06:00 +01:00
José Fonseca
7be4cf9c63 scons: Add support for LLVM-2.9 on Windows.
MinGW & MSVC, although I've only tested the former.
2011-08-18 16:00:59 +01:00
Kristian Høgsberg
4a7667b96b glx: Don't flush twice if we fallback to dri2CopySubBuffer
The flush extensions flush call indicates end of frame and should only
be called once per frame.  However, in the dri2SwapBuffer fallback
path, we call flush and then call dri2CopySubBuffer, which also calls
flush.  Refactor the code to only call flush once.
2011-08-18 09:46:06 -04:00
Marek Olšák
01680ce2f3 r600g: implement NV_primitive_restart functionality (v2)
Needed for GL3.

v2: evergreen support

I don't set PA_SU_SC_MODE_CNTL.MULTI_PRIM_IB_ENA.
piglit/primitive-restart does pass though. Tested on RV730 and EG-REDWOOD.
2011-08-18 00:25:07 +02:00
Marek Olšák
17867f06b1 r600g: fix scons build 2011-08-17 23:24:33 +02:00
Eric Anholt
3f78f71973 i965/fs: Fix 32-bit integer multiplication.
The MUL opcode does a 16bit * 32bit multiply, and we need to do the
MACH to get the top 16bit * 32bit added in.

Fixes fs-op-mult-int-*, fs-op-mult-ivec*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-17 11:51:01 -07:00
Christoph Bumiller
34980cd153 nv50: don't drop flags definition when merging SAT with ADD/MAD 2011-08-17 20:40:43 +02:00
Brian Paul
718b894dbb st/mesa: fix incorrect loop over instruction src regs
The array of src regs is of size 3, not 4.
2011-08-17 08:12:54 -06:00
Lauri Kasanen
65bdb878a0 st/dri: Indent driconf options 2011-08-17 00:39:17 -07:00
Lauri Kasanen
59e56957cc xmlpool.h: fix a typo 2011-08-17 00:39:17 -07:00
Lauri Kasanen
b629d5ba24 xmlconfig: Make the error message more informative 2011-08-17 00:39:17 -07:00
Ian Romanick
7125f1e87d mesa: Bump instruction execution limit to 65536
Shader Model 3.0[1] requires that shaders be able to execute at least
65536 instructions.  Bump Mesa maxExec to that limit.  This allows
several vertex shaders in the OpenGL ES 2.0 conformance test suite to
run to completion.

1: http://en.wikipedia.org/wiki/High_Level_Shader_Language

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:38:44 -07:00
Ian Romanick
54c48a95e6 mesa: Add partial constant propagation pass for Mesa IR
This cleans up some code generated by the IR-to-Mesa pass for i915.
In particular, some shaders involving arrays of constant matrices
result in really bad code.

v2: Silence several warnings from merging the gl_constant_value work.
Fix DP[23] folding.  Add support for a bunch more opcodes that appear
in piglit runs on i915.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:38:39 -07:00
Ian Romanick
ff2cfb8989 ir_to_mesa: Emit a MAD(b, -a, b) for !a && b
!a && b occurs frequently when nexted if-statements have been
flattened.  It should also be possible use a MAD for (a && b) || c,
though that would require a MAD_SAT.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:44 -07:00
Ian Romanick
ba01df11c4 ir_to_mesa: Implement ir_binop_all_equal using DP4 w/SGE
The operation ir_binop_all_equal is !(a.x != b.x || a.y != b.y || a.z
!= b.z || a.w != b.w).  Logical-or is implemented using addition
(followed by clampling to [0,1]) on values of 0.0 and 1.0.  Replacing
the logical-or operators with addition gives !bool((int(a.x != b.x) +
int(a.y == b.y) + int(a.z == b.z) + int(a.w == b.w)).  This can be
implemented using a dot-product with a vector of all 1.0.  After the
dot-product, the value will be an integer on the range [0,4].

Previously a SEQ instruction was used to clamp the resulting logic
value to [0,1] and invert the result.  Using an SGE instruction on the
negation of the dot-product result has the same effect.  Many older
shader architectures do not support the SEQ instruction.  It must be
emulated using two SGE instructions and a MUL.  On these
architectures, the single SGE saves two instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:43 -07:00
Ian Romanick
e7bf096e8b ir_to_mesa: Implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLT
The operation ir_binop_any_nequal is (a.x != b.x) || (a.y != b.y) ||
(a.z != b.z) || (a.w != b.w), and that is the same as any(bvec4(a.x !=
b.x, a.y != b.y, a.z != b.z, a.w != b.w)).  Implement the any() part
the same way the regular ir_unop_any is implemented.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:43 -07:00
Ian Romanick
92ca560d68 ir_to_mesa: Implement ir_unop_any using DP4 w/saturate or DP4 w/SLT
This is just like the ir_binop_logic_or case.  The operation
ir_unop_any is (a.x || a.y || a.z || a.w).  Logical-or is implemented
using addition (followed by clampling to [0,1]) on values of 0.0 and
1.0.  Replacing the logical-or operators with addition gives (a.x +
a.y + a.z + a.w).  This can be implemented using a dot-product with a
vector of all 1.0.

Previously a SNE instruction was used to clamp the resulting logic
value to [0,1].  In a fragment shader, using a saturate on the
dot-product has the same effect.  Adding the saturate to the
dot-product is free, so (at least) one instruction is saved.

In a vertex shader, using an SLT on the negation of the dot-product
result has the same effect.  Many older shader architectures do not
support the SNE instruction.  It must be emulated using two SLT
instructions and an ADD.  On these architectures, the single SLT saves
two instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:42 -07:00
Ian Romanick
7f4c65256c ir_to_mesa: Make ir_to_mesa_visitor::emit_dp return the instruction
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:41 -07:00
Ian Romanick
41f8ffe5e0 ir_to_mesa: Implement ir_binop_logic_or using an add w/saturate or add w/SLT
Logical-or is implemented using addition (followed by clampling to
[0,1]) on values of 0.0 and 1.0.  Replacing the logical-or operators
with addition gives a + b which has a result on the range [0, 2].

Previously a SNE instruction was used to clamp the resulting logic
value to [0,1].  In a fragment shader, using a saturate on the add has
the same effect.  Adding the saturate to the add is free, so (at
least) one instruction is saved.

In a vertex shader, using an SLT on the negation of the add result has
the same effect.  Many older shader architectures do not support the
SNE instruction.  It must be emulated using two SLT instructions and
an ADD.  On these architectures, the single SLT saves two
instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:40 -07:00
Ian Romanick
6ad08989d7 ir_to_mesa: Implement ir_unop_logic_not using 1-x
Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x
accurately implements logical not.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:40 -07:00
Chad Versace
3c9f172fe8 mesa: Add Android to list of platforms that define fpclassify()
This is a fix for the Android build.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-16 14:03:48 -07:00
Chad Versace
bd064a49f1 mesa: Fix Android build by #ifdef'ing out locale support
Bionic does not support locales. This commit #ifdef's out the locale usage
in _mesa_strtof().

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-16 13:43:15 -07:00
Chad Versace
eb0ff1a1c0 mesa: Remove use of fpu_control.h
Remove the inclusion of fpu_control.h from compiler.h.  Since Bionic lacks
fpu_control.h, this fixes the Android build.

Also remove the sole use of the fpu_control bits, which was in debug.c.
Those were brianp's debug bits, and he approved of their removal.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-16 13:34:33 -07:00
Eric Anholt
0ddf0f1c34 i965/vs: Fix multiplies to actually do 32-bit multiplies.
Fixes vs-op-mult-int-int and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt
7bf70c29ad i965/vs: Add support for conversion of FIXED_HW_REG src_reg to/from dst_reg.
This was quietly occurring in some emit code I produced, and failed.
2011-08-16 13:04:43 -07:00
Eric Anholt
e9a86ae337 i965/vs: Fix memory leak of ralloc context for the visitor. 2011-08-16 13:04:43 -07:00
Eric Anholt
feff7c62ce i965/vs: Fix condition code for scalar expression all_equals.
Fixes vs-op-eq-bool-bool.
2011-08-16 13:04:43 -07:00
Eric Anholt
8a649277cb i965/vs: Don't assertion fail on vertex texturing.
The linker will reject the program, but we need to survive until then.
Fixes abort in glsl1-2D Texture lookup with explicit lod (Vertex
shader)
2011-08-16 13:04:43 -07:00
Eric Anholt
d0c595ac80 i965/gen6: Force WHILE exec size to 8.
We can't just look at the instruction that happens to appear at the
start of the loop, because it might be some other exec size and cause
us to only loop on the first N channels.  We always want 8 in our
current code (since 16 doesn't work so we don't do 16-wide fragment in
that case).

Fixes loop-03.vert, which was triggering the assertions.
2011-08-16 13:04:43 -07:00
Eric Anholt
905f3d0309 i965/vs: Remove remaining use of foreach_iter. 2011-08-16 13:04:43 -07:00
Eric Anholt
54e66a0a63 i965/vs: Fix abs/negate handling on attributes.
Fixes glsl-vs-neg-attribute and glsl-vs-abs-attribute.
2011-08-16 13:04:43 -07:00
Eric Anholt
7642c1de6b i965/vs: Avoid generating a MOV for most ir_assignment handling.
Removes an average of 11.5% of instructions in 54% of vertex shaders
in shader-db.
2011-08-16 13:04:43 -07:00
Eric Anholt
7fbe7fe133 i965/vs: Run the shader backend at link time and return compile failures.
Link failure is something that shouldn't happen, but we sometimes want
it during development.  The precompile also allows analysis of shader
codegen with shader-db.
2011-08-16 13:04:43 -07:00
Eric Anholt
d376fa8e84 i965: Fix assertion failure on a loop consisting of while (true) { break }.
On enabling the precompile step in the VS, we tripped over this
assertion failure in glsl-link-bug-30552.
2011-08-16 13:04:43 -07:00
Eric Anholt
e8980c61b2 i965/vs: Fix the trivial register allocator's failure path. 2011-08-16 13:04:43 -07:00
Eric Anholt
193a9a209d i965/vs: Add support for if(any(bvec)) on gen6. 2011-08-16 13:04:43 -07:00
Eric Anholt
072d64121e i965/vs: Add support for GL_FIXED attributes.
Fixes arb_es2_compatibility-fixed-type
2011-08-16 13:04:43 -07:00
Eric Anholt
aed5e353e9 i965/vs: Clamp vertex color outputs when required by ARB_color_buffer_float.
Fixes glsl-vs-vertex-color.
2011-08-16 13:04:43 -07:00
Eric Anholt
a55fbbc1a2 i965/vs: Fix access of attribute arrays.
By leaving out the column index, we were reading an unallocated
attribute on glsl-mat-attribute.
2011-08-16 13:04:43 -07:00
Eric Anholt
fea7d34b35 i965/vs: Fix builtin uniform setup.
I want to intelligently pack them at some point, but for now we have
the params set up in groups of 4.  Fixes glsl-vs-normalscale.
2011-08-16 13:04:43 -07:00
Eric Anholt
0b359e3ea0 i965/vs: Add support for loops.
This is copied from brw_fs.cpp, instead of doing the temporary IR
generation that ir_to_mesa does.  Fixes glsl-vs-loop and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt
abf843a797 i965/vs: Add support for ir_binop_pow.
Fixes vs-pow-float-float.
2011-08-16 13:04:43 -07:00
Eric Anholt
250770b74d i965/vs: Respect the gen6 limitation that math opcodes can't be align16.
Fixes vs-acos-vec3 and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt
6408b0295f i965/vs: Fix implementation of ir_unop_any.
We were inheriting whatever previous predicate existed.
2011-08-16 13:04:42 -07:00
Eric Anholt
7b91eefe7c i965/vs: Slightly improve the trivial reg allocator to skip unused regs.
This fixes most of the regressions in the vs array test set from the
varying array indexing work, since the giant array that was originally
allocated in virtual GRF space never gets used and is only ever
read/stored from scratch space.
2011-08-16 13:04:42 -07:00
Eric Anholt
e94bdbe04a i965: Add gen6 disassembly for DP render cache messages. 2011-08-16 13:04:42 -07:00
Eric Anholt
54fa706d6f i965/vs: Enable variable array indexing in the VS. 2011-08-16 13:04:42 -07:00
Eric Anholt
584ff40748 i965/vs: Add support for scratch read/write codegen. 2011-08-16 13:04:42 -07:00
Eric Anholt
0f22f98ccd i965: Make some EU emit code for DP read/write messages non-static.
We keep building these strange interfaces for DP read/write where
there's a helper function with some partially-specific,
partially-general controls, which is used in exactly one place in code
generation.  Making these public will let us set up those instructions
in the one place they're to be generated.
2011-08-16 13:04:42 -07:00
Eric Anholt
d0e4d71070 i965/vs: Move virtual GRFs with array accesses to them to scratch space. 2011-08-16 13:04:42 -07:00
Eric Anholt
758c3c2b45 i965/vs: Reserve MRF 14/15 for array loads/register unspilling. 2011-08-16 13:04:42 -07:00
Eric Anholt
1ff4f11dd9 i965/vs: Track the variable index of array accesses.
This isn't used currently, as we lower all array accesses.
2011-08-16 13:04:42 -07:00
Eric Anholt
314c2574ff i965: Add remaining scratch space setup emit to unit states. 2011-08-16 13:04:42 -07:00
Eric Anholt
2b224d66a0 i965: Set up allocation of a VS scratch space if required. 2011-08-16 13:04:42 -07:00
Eric Anholt
e355b179b2 i965: Remove dead brw->wm.max_threads field. 2011-08-16 13:04:42 -07:00
Eric Anholt
160a5a3ff0 i965/vs: Add support for VUEs larger than a single URB write.
Fixes glsl-max-varyings.
2011-08-16 13:04:42 -07:00
Eric Anholt
31ef2e3ec2 i965/vs: Avoid generating extra moves when setting up large ir_constants.
We were also screwing up the types in the process, and just not
emitting moves was easier.
2011-08-16 13:04:42 -07:00
Eric Anholt
aba9801996 i965/vs: Fix types of varying outputs.
For structs/arrays/matrices, they were ending up as uint because we
forgot to set them.  All varyings in GLSL 1.20 are of base type float,
so just force the matter here (which gets inherited at
emit_urb_writes() time).

Fixes vs-varying-array-mat2-col-rd.
2011-08-16 13:04:42 -07:00
Eric Anholt
9790726131 i965/vs: Handle assignment of structures/arrays/matrices better.
This gets the right types on the instructions, as well as emitting
minimal swizzles/writemasks.
2011-08-16 13:04:42 -07:00
Eric Anholt
930afd1774 i965/vs: Don't forget to set up assignment condition code for arrays/structs.
Fixes vs-uniform-array-mat2-index-col-rd.
2011-08-16 13:04:42 -07:00
Eric Anholt
cda28bca0d i965/vs: Apply the gen6 math workaround for math1 instructions.
Fixes glsl-vs-masked-cos.
2011-08-16 13:04:42 -07:00
Eric Anholt
2b7632aeaa i965/vs: Add support for if(any_nequal()) and if(all_equal()) on gen6.
Fixes vs-temp-array-mat2-col-rd.shader_test.
2011-08-16 13:04:42 -07:00
Eric Anholt
c3752b399a i965/vs: Add support for dot product opcodes.
Fixes glsl-vs-dot-vec2.
2011-08-16 13:04:42 -07:00
Eric Anholt
8e947c2546 i965/vs: Fix the types of array/struct dereferences.
Fixes glsl-vs-arrays-3.
2011-08-16 13:04:42 -07:00
Eric Anholt
814a9bef30 i965/vs: Drop the assertion about dst.reg_offset == 0.
Adding the offset is the right thing to do here, and fixes
glsl-vs-mat-add-1.
2011-08-16 13:04:42 -07:00
Eric Anholt
e5363c7fd2 i965/vs: Use an appropriate swizzle on src regs from variables.
Fixes glsl-vs-if-bool.
2011-08-16 13:04:42 -07:00
Eric Anholt
eca762d831 i965/vs: Fix support for zero uniforms in use.
We were looking for attributes in the wrong place, and pointlessly
doing the work on gen6 at all.
2011-08-16 13:04:42 -07:00
Eric Anholt
164ccd2778 i965/vs: Fix support for "IF" instructions by copying brw_fs_visitor.cpp.
Fixes glsl-vs-if-greater.
2011-08-16 13:04:41 -07:00
Eric Anholt
aa753c5a14 i965/vs: Disable loops for now until rendering is generally correct. 2011-08-16 13:04:41 -07:00
Eric Anholt
bb468fc1ed i965/vs: Fix ir_swizzle handling.
I decided to refactor it a bit in adapting ir_to_mesa.cpp code, and
mangled it.  Fixes glsl-vs-cross-2.
2011-08-16 13:04:41 -07:00
Eric Anholt
78fac1892a i965/vs: Allocate storage for "auto" variables just like temps.
Fixes segfault in glsl-vs-cross-2.
2011-08-16 13:04:41 -07:00
Eric Anholt
82aa9299fb i965/vs: Allow scalar values in assignments, too.
Fixes glsl-vs-all-02 and many other tests.
2011-08-16 13:04:41 -07:00
Eric Anholt
c0f334a3ed i965/vs: Don't emit an extra copy of the vertex position.
Fixes glsl-vs-abs-neg, glsl-vs-all-01, and probably many other tests.
2011-08-16 13:04:41 -07:00
Eric Anholt
4a4857246c i965/vs: Port the fix for clip plane writemasks from brw_vs_emit.c. 2011-08-16 13:04:41 -07:00
Eric Anholt
83d5850518 i965/vs: Fix constant vector construction.
Fixes some issues noticed in glsl-vs-all-01.
2011-08-16 13:04:41 -07:00
Eric Anholt
a070d5f363 i965/vs: Start adding support for uniforms
There's no clever packing here, no pull constants, and no array support.
2011-08-16 13:04:41 -07:00
Eric Anholt
af3c9803d8 i965: Start adding the VS visitor and codegen.
The low-level IR is a mashup of brw_fs.cpp and ir_to_mesa.cpp.  It's
currently controlled by the INTEL_NEW_VS=1 environment variable, and
only tested for the trivial "gl_Position = gl_Vertex;" shader so far.
2011-08-16 13:04:41 -07:00
Eric Anholt
65b5cbbcf7 i965: Rename math FS_OPCODE_* to SHADER_OPCODE_*.
I want to just use the same enums in the VS.
2011-08-16 13:04:41 -07:00
Eric Anholt
6034b9a512 i965: Create a shared enum for hardware and compiler-internal opcodes.
This should make gdbing more pleasant, and it might be used in sharing
part of the codegen between the VS and FS backends.
2011-08-16 13:04:41 -07:00
Eric Anholt
c1f00731fd i965: Generate driver-specific IR for non-fragment shaders as well.
This will be used by the new vertex shader backend.  The scalarizing
passes are skipped for non-fragment, since vertex and geometry threads
are based on vec4s.
2011-08-16 13:04:41 -07:00
Brian Paul
11e4ea0010 mesa: ChooseTextureFormat() returns gl_format, not GLuint 2011-08-16 13:05:34 -06:00
Paul Berry
af501e2b29 glsl: Fix type error when lowering integer divisions
This patch fixes a bug when lowering an integer division:

  x/y

to a multiplication by a reciprocal:

  int(float(x)*reciprocal(float(y)))

If x was a plain int and y was an ivecN, the lowering pass
incorrectly assigned the type of the product to be float, when in fact
it should be vecN.  This caused mesa to abort with an IR validation
error.

Fixes piglit tests {fs,vs}-op-div-int-ivec{2,3,4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-16 11:00:46 -07:00
Marek Olšák
9e8f556b19 softpipe: fix an obvious copy-paste error in get_query_result
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-16 19:56:29 +02:00
Marek Olšák
5e7713caa9 st/dri: remove an unused-but-set variable 2011-08-16 19:39:59 +02:00
Marek Olšák
4a47662bea r600g: rename bc -> bytecode
It took me a while to figure out what it stands for.
2011-08-16 19:39:59 +02:00
Benjamin Franzke
61d2dfbe48 egl: Add include paths for platform autodetection
Needed since commit 85fe9484.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40145
2011-08-16 19:28:07 +02:00
Cooper Yuan
f272117def dri2: check if context is valid before flushing the pipe 2011-08-16 20:37:13 +08:00
Marek Olšák
e3be513118 r600g: expose ARB_ES2_compatibility by claiming fixed-point format support
I also needed to make some changes in u_vbuf_mgr in order to override
the caps from the driver and enable the fallback even though the driver
claims the format is supported.
2011-08-16 09:15:11 +02:00
Marek Olšák
21c5d11b7e noop: redirect the get_param/is_format.. queries to the underlying driver 2011-08-16 09:15:11 +02:00
Marek Olšák
363295d720 u_blitter: restore some states conditionally 2011-08-16 09:15:11 +02:00
Marek Olšák
233dd4953e u_blitter: rename util_blitter_copy_region -> util_blitter_copy_texture 2011-08-16 09:15:11 +02:00
Marek Olšák
a77431b3b0 r600g: consolidate two files r600d.h 2011-08-16 09:15:11 +02:00
Marek Olšák
47dcfb8dab r600g: set read/write usage flags for each relocation
This takes advantage of the new GEM_WAIT ioctl when mapping buffers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ebfcc58b93 winsys/radeon: take advantage of the new ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
1e3c81a068 winsys/radeon: hook up the new DRM_RADEON_GEM_WAIT ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
296b899095 winsys/radeon: remove broken bo-is-busy-for-write guessing
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
c79e9f0ed5 r600g: enable thread offloading
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
0bbbd82488 r600g: undefine RADEON_CTX_MAX_PM4
winsys/radeon has its own definition.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
d6da5185f9 r600g: don't include radeon_drm.h and xf86drm.h
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
efbccfeca0 winsys/radeon: remove the device file descriptor from the interface
r600g doesn't need it anymore.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
041ed559e1 r600g: remove an unused parameter from r600_bo_destroy
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
c6fec83726 r600g: merge radeon_bo with r600_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
5229ba494b r600g: remove radeon_bo::handle
This should be private to radeon_winsys.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ab630b5768 r600g: use buffer_map/unmap from radeon_winsys
This also drops the unneeded bo_busy/wait functions.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
e2e1dc9e66 r600g: set the flush callback in radeon_winsys
I have also renamed the winsys function.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
7ee65800c3 r600g: get tiling flags using radeon_winsys
Also remove some unused fence-related leftovers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ecfcf25387 r600g: get winsys_handle using radeon_winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
1b542aca6e r600g: move more DRM queries into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
03b25ad8ff winsys/radeon: consolidate the add_reloc function
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
e6fb62594f r600g: emit CS using radeon_winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
685b8345a8 r600g: remove struct r600_reloc
That is really private to winsys/radeon.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
1acaf09778 r600g: don't use RADEON_GEM_DOMAIN_CPU
Also staging resources shouldn't be allocated with the initial domain
being VRAM.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
3e57972216 r600g: remove reloc-related variables from radeon_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
638d75185e r600g: let radeon_winsys maintain the list of relocations
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
9865b1ec8c r600g: remove now-unused r600_context::fenced_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
591d8c3350 r600g: remove the fences which were used for the cache buffer manager
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
cdbb8a195a r600g: remove now-unused r600_bo::size
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
60ff68ad00 r600g: remove the cache buffer manager from winsys/r600
As we've just started using the one from winsys/radeon.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
11daa7e325 r600g: allocate/destroy buffers using radeon_winsys
We use the cache buffer manager from radeon_winsys now, but we don't use
anything else yet.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
edca57e533 r600g: remove unused function declarations
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
39db886548 r600g: remove unused r600_bo::tiling_flags
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
c092e236cc r600g: remove unused r600_bo::kernel_pitch
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
2ce783d8dd r600g: put radeon_winsys in screen::winsys, don't include drm_driver in the pipe
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
354f76f386 r600g: cleanup includes in winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
fb8cf51eeb r600g: move some queries into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
ce12f82692 r600g: first step into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Benjamin Franzke
8c40940321 dri2: Add __DRI_BUFFER_COUNT token
Remove definition from egl_dri2.
Defining this is egl_dri2.h breaks as soon as
a new dri2 buffer token is added like with commit
4501a5d6e8.
2011-08-16 09:06:41 +02:00
Cooper Yuan
9b784069ce dri2: add code to dri2_Flush extension.
It's going to flush client's commands in eglWaitClient(). Before this,
egl applications using pixmap or pbuffer flicker because of no flush.

Reviewed-by: Alan Hourihane
2011-08-16 09:32:10 +08:00
Eric Anholt
a313c29c77 glsl: When assigning to a whole array, mark the array as accessed.
The vs-varying-array-mat2-col-row-wr test writes a mat2[3] constant to
a mat2[3] varying out array, and also statically accesses element 1 of
it on the VS and FS sides.  At link time it would get trimmed down to
just 2 elements, and then codegen of the VS would end up generating
assignments to the unallocated last entry of the array.  On the new
i965 VS backend, that happened to land on the vertex position.

Some issues remain in this test on softpipe, i965/old-vs and
i965/new-vs on visual inspection, but i965 is passing because only one
green pixel is probed, not the whole split green/red quad.
2011-08-15 17:54:27 -07:00
Eric Anholt
5880a9a4a7 radeon: Explain to the user what went wrong when built without libdrm.
Before this commit, even LIBGL_DEBUG=verbose would just fail with:
libGL error: failed to create dri screen
2011-08-15 17:54:27 -07:00
Paul Berry
303e05cc24 glsl: Add validations for ir_call.
This patch extends ir_validate.cpp to check the following
characteristics of each ir_call:

- The number of actual parameters must match the number of formal
  parameters in the signature.

- The type of each actual parameter must match the type of the
  corresponding formal parameter in the signature.

- Each "out" or "inout" actual parameter must be an lvalue.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-15 17:23:02 -07:00
Paul Berry
a52b53b56e glsl: Make is_lvalue() and variable_referenced() const.
These functions don't modify the target instruction, so it makes sense
to make them const.  This allows these functions to be called from ir
validation code (which uses const to ensure that it doesn't
accidentally modify the IR being validated).

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-15 17:23:02 -07:00
Paul Berry
67b5a3267d glsl: Perform implicit type conversions on function call out parameters.
When an out parameter undergoes an implicit type conversion, we need
to store it in a temporary, and then after the call completes, convert
the resulting value.  In other words, we convert code like the
following:

void f(out int x);
float value;
f(value);

Into IR that's equivalent to this:

void f(out int x);
float value;
int out_parameter_conversion;
f(out_parameter_conversion);
value = float(out_parameter_conversion);

This transformation needs to happen during ast-to-IR convertion (as
opposed to, say, a lowering pass), because it is invalid IR for formal
and actual parameters to have types that don't match.

Fixes piglit tests
spec/glsl-1.20/compiler/qualifiers/out-conversion-int-to-float.vert and
spec/glsl-1.20/execution/qualifiers/vs-out-conversion-*.shader_test,
and bug 39651.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39651

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-15 17:23:01 -07:00
Kenneth Graunke
c548192caf docs: Remove GLw from the documentation except for a new FAQ entry.
Also remove an outdated reference to GLEW being in tree.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-15 13:37:27 -07:00
Kenneth Graunke
63720114b4 glw: Remove GLw source.
libGLw is an old OpenGL widget library with optional Motif support.
It almost never changes and very few people actually still care about
it, so we've decided to ship it separately.

The new home for libGLw is: git://git.freedesktop.org/mesa/glw/

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-15 13:37:09 -07:00
Ian Romanick
a352e2d08e glsl: Modify strategy for accumulating conditions when lowering if-statements
Previously if-statements were lowered from inner-most to outer-most
(i.e., bottom-up).  All assignments within an if-statement would have
the condition of the if-statement appended to its existing condition.
As a result the assignments from a deeply nested if-statement would
have a very long and complex condition.

Several shaders in the OpenGL ES2 conformance test suite contain
non-constant array indexing that has been lowered by the shader
writer.  These tests usually look something like:

    if (i == 0) {
        value = array[0];
    } else if (i == 1) {
        value = array[1];
    } else ...

The IR for the last assignment ends up as:

    (assign (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition) ) (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition@20) ) (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition@22) ) (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition@24) ) (var_ref if_to_cond_assign_condition@26) ) ) ) )  (x) (var_ref value) (array_ref (var_ref array) (constant int (5)))

The Mesa IR that is generated from this is just as awesome as you
might expect.

Three changes are made to the way if-statements are lowered.

1. Two condition variables, if_to_cond_assign_then and
if_to_cond_assign_else, are created for each if-then-else structure.
The former contains the "positive" condition, and the later contains
the "negative" condtion.  This change was implemented in the previous
patch.

2. Each condition variable is added to a hash-table when it is created.

3. When lowering an if-statement, assignments to existing condtion
variables get the current condition anded.  This ensures that nested
condition variables are only set to true when the condition variable
for all outer if-statements is also true.

Changes #1 and #3 combine to ensure the correctness of the resulting
code.

4. When a condition assignment is encountered with a condition that is
a dereference of a previously added condition variable, the condition
is not modified.

Change #4 prevents the continuous accumulation of conditions on
assignments.

If the original if-statements were:

    if (x) {
        if (a && b && c && d && e) {
            ...
        } else {
            ...
        }
    } else {
        if (g && h && i && j && k) {
            ...
        } else {
            ...
        }
    }

The lowered code will be

    if_to_cond_assign_then@1 = x;
    if_to_cond_assign_then@2 = a && b && c && d && e
        && if_to_cond_assign_then@1;
    ...
    if_to_cond_assign_else@2 = !if_to_cond_assign_then
        && if_to_cond_assign_then@1;
    ...

    if_to_cond_assign_else@1 = !if_to_cond_assign_then@1;
    if_to_cond_assign_then@3 = g && h && i && j;
        && if_to_cond_assign_else@1;
    ...
    if_to_cond_assign_else@3 = !if_to_cond_assign_then
        && if_to_cond_assign_else@1;
    ...

Depending on how instructions are emitted, there may be an extra
instruction due to the duplication of the '&&
if_to_cond_assign_{then,else}@1' on the nested else conditions.  In
addition, this may cause some unnecessary register pressure since in
the simple case (where the nested conditions are not complex) the
nested then-condition variables are live longer than strictly
necessary.

Before this change, one of the shaders in the OpenGL ES2 conformance
test suite's acos_float_frag_xvary generated 348 Mesa IR instructions.
After this change it only generates 124.  Many, but not all, of these
instructions would have also been eliminated by CSE.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:27 -07:00
Ian Romanick
4a026d6ba5 glsl: Slight change to the code generated by if-flattening
Now the condition (for the then-clause) and the inverse condition (for
the else-clause) get written to separate temporary variables.  In the
presence of complex conditions, this shouldn't result in more code
being generated.  If the original if-statement was

    if (a && b && c && d && e) {
        ...
    } else {
        ...
    }

The lowered code will be

   if_to_cond_assign_then = a && b && c && d && e;
   ...
   if_to_cond_assign_else = !if_to_cond_assign_then;
   ...

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:26 -07:00
Ian Romanick
13df36ecb6 glsl: Replace foreach_iter with foreach_list_safe
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:26 -07:00
Ian Romanick
5c84378541 glsl: Make move_block_to_cond_assign not care which branch it's processing
This will make some future changes a bit easier to digest.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:26 -07:00
Benjamin Franzke
2e71c7d4ff egl: Log (debug) native platform type
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-08-15 09:42:16 +02:00
Benjamin Franzke
85fe948494 egl: Native Display autodetection
EGL doesnt define howto manage different native platforms.
So mesa has a builtime configurable default platform,
whith non-standard envvar (EGL_PLATFORM) overwrites.
This caused unneeded bugreports, when EGL_PLATFORM was forgotten.

Detection is grouped into basic types of NativeDisplays (which itself
needs to be detected).  The final decision is based on characteristcs
of these basic types:

  File Desciptor based platforms (fbdev):
    - fstat(2) to check for being a fd that belongs to a character device
    - check kernel subsystem (todo)

  Pointer to structuctures (x11, wayland, drm/gbm):
    - mincore(2) to check whether its valid pointer to some memory.
    - magic elements (e.g. pointers to exported symbols):
      o wayland display stores interface type pointer (first elm.)
      o gbm stores pointer to its constructor (first elm.)
      o x11 as a fallback (FIXME?)

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-08-15 09:42:16 +02:00
Cooper Yuan
f5e757ea60 Destroy context in dri2/glx driver when apps call eglDestroyContext 2011-08-14 15:14:17 +08:00
Chia-I Wu
e09b706c9e glapi: remove gen-es
Not used anymore.
2011-08-13 15:14:24 +08:00
Chia-I Wu
6eff33dc7f glapi: generate ES dispatch headers from core mesa
GLESv1 and GLESv2 have their own dispatch.h and remap_helper.h.  These
headers are only used by api_exec_es1.c and api_exec_es2.c in core mesa.
Move the rules to generate them from glapi to core mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: updated after reviewing to fix SCons build]
2011-08-13 15:14:00 +08:00
Chia-I Wu
786e5a2fb4 glapi: add glapi_gen.mk to help header generation
glapi_gen.mk is supposed to be included by glapi users to simplify
header generation.  This commit also makes es1api, es2api, and
shared-glapi use it.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: updated after reviewing to prefix all variables in glapi_gen.mk by
 glapi_gen]
2011-08-13 13:57:10 +08:00
Chia-I Wu
5076561b35 glapi: use gl_and_es_API.xml to generate GLES headers
glapi/gen-es/ defines two sets of GLAPI XMLs for OpenGL ES 1.1
(es1_API.xml) and 2.0 (es2_API.xml) respectively.  They are used to
generate dispatch.h and remap_helper.h for GLES.  Together with
gl_and_es_API.xml, we have to maintain three sets of GLAPI XMLs.

This commit makes dispatch.h and remap_helper.h for GLES be generated
from gl_and_es_API.xml.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:57 +08:00
Chia-I Wu
b8202b3d44 glapi: add methods to filter functions
add gl_api::filter_functions and gl_function::filter_entry_points to
filter out unwanted functions and entry points.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:54 +08:00
Chia-I Wu
281947b351 glapi: add gles_api.py
Move the list of entry points belong to GLES from mapi_abi.py to a new
file.

Until we figure out how to describe the APIs an entry point belongs to
in the XML file, and how to handle the case where an entry point others
alias is missing in some APIs, this is an easier solution than
maintaining another two sets of XMLs in glapi/gen-es/.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:30 +08:00
Michel Dänzer
3ce243879a gallium/gbm: Add dependencies for libraries linked into pipe_*.so.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-08-12 11:10:56 +02:00
Chad Versace
9cd64ec35a x86-64: Fix compile error with clang
Remove the 'f' suffix from a float literal.
    - .float 0.0f+1.0
    + .float 1.0

This fixes the following compile error with clang:
    error: unexpected token in directive
    .float 0.0f+1.0
              ^

Note: This is a candidate for the stable branches.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-11 09:33:41 -07:00
Brian Paul
099aad2fb0 mesa: fix initialization of GL_FOG_MODE in _mesa_init_driver_state() 2011-08-11 09:05:53 -06:00
Brian Paul
9b8287f8f5 mesa: fix ColorMask array index in _mesa_init_driver_state()
This doesn't really make any difference because all the colormasks
are the same upon context set-up, but it makes more sense.
2011-08-11 09:04:48 -06:00
Brian Paul
37a64baea8 swrast: don't try to do depth testing if there's no depth buffer
Fixes piglit hiz-depth-stencil-test-fbo-d0-s8 crash.
See http://bugs.freedesktop.org/show_bug.cgi?id=37907

NOTE: This is a candidate for the 7.11 branch.
2011-08-11 08:53:17 -06:00
Andreas Fänger
e411cd7b0a swrast: initial multi-threaded span rendering
Optional parallel rendering of spans using OpenMP.
Initial implementation for aa triangles. A new option for scons is
also provided to activate the openmp support (off by default).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-11 08:33:59 -06:00
Ben Widawsky
fa351bd2e0 intel: GetBuffer fix
After copy buffer on preGEN6, it is necessary to wait for the blit to
complete before returning data to the user.

This should fix the piglit test: copy_buffer_coherency (pre-GEN6).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-10 16:07:40 -07:00
Lauri Kasanen
df7859be6b r600g: Add support for ROUND, v2
This is a GLSL 1.3 feature, but also used by MLAA.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2011-08-10 16:08:59 -04:00
Carl Simonson
09eeb0ff27 i830: Add missing vtable entry for i830 from the hiz work. 2011-08-10 11:10:43 -07:00
Eric Anholt
c9e81fe14f i965: Drop the reg/hw_reg distinction.
"reg" was set in only one case, virtual GRFs pre register allocation,
and would be unset and have hw_reg set after allocation.  Since we
never bothered with looking at virtual GRF number after allocation
anyway, just use the same storage and avoid confusion.
2011-08-10 11:03:48 -07:00
Eric Anholt
b1f0bffd39 i965/fs: Factor out the register allocator setup to a separate function.
Besides separating out a logical step of the giant register allocator
function, this now communicates a bunch of the allocator information
through entries in brw_context, which will make this code partially
reusable for caching the expensive allocator setup.
2011-08-10 11:03:48 -07:00
Eric Anholt
4e10d5825b i965/fs: Simplify the register allocator using a map from RA reg to GRF.
It's fewer pointers to track, and when we start caching the register
set, should be algorithmically better in the cache hit case (lookup in
a byte-per-register array, instead of a linear walk through
desctiption of register classes to find how to translate that class).
2011-08-10 11:03:48 -07:00
Eric Anholt
b76378d46a i965/fs: Eliminate the magic nature of virtual GRF 0.
This was a debugging aid at one point -- virtual grf 0 should never be
allocated, and it would be used if undefined register access occurred
in codegen.  However, it made the confusing register allocation code
even more confusing by indexing things off of 1 all over.
2011-08-10 11:03:48 -07:00
Eric Anholt
bbcf13adbe i965/fs: Use the new convenience interface for setting up reg conflicts.
That code I wrote was impenetrable, and hard to write the first time.
This makes things a lot more obvious.
2011-08-10 11:03:48 -07:00
Eric Anholt
fa43477fa3 mesa: Add a convenience interface for register allocator conflicts setup. 2011-08-10 11:03:48 -07:00
Henri Verbeet
e6c64800cc glsl_to_tgsi: improve assignment hack
Fixes StarCraft 2 and Fallout 3 in Wine.
2011-08-09 12:35:26 -05:00
Brian Paul
32faaea743 r300g: silence some warnings about uninitialized variables 2011-08-09 09:04:10 -06:00
Brian Paul
971905bf39 svga: add missing switch case for PIPE_SHADER_CAP_INTEGERS 2011-08-09 08:58:47 -06:00
Brian Paul
e0496b63ff glx: move declarations before code 2011-08-09 08:58:20 -06:00
Fabio Pedretti
afd1d85775 swrast: silence unused var warnings
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-09 08:08:59 -06:00
Dave Airlie
36291173c2 docs: update GL3.txt with new GL 4.2 extensions 2011-08-09 10:39:52 +01:00
Paul Berry
c148ef6ddb glsl: validate IR after linking (debug builds only)
At least one of the invariants verified by IR validation concerns the
relative ordering of toplevel constructs in the IR: references to
global variables must come after the declarations of those global
variables.

Since linking affects the ordering of toplevel constructs in the IR,
it's possible that a bug in the linker will cause invalid IR to be
generated, even if all the pre-linked shaders are valid.  (In fact,
such a bug was fixed by the previous commit.)

Bugs like this are easily masked by further optimization passes,
particularly inlining.  So to make them easier to track down, this
patch addes an IR validation step right after linking, and before
final optimization occurs.  The validation only occurs on debug
builds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:44:02 -07:00
Paul Berry
01a851c296 glsl: When linking, emit functions at the tail of the final linked program.
When link_functions.cpp adds a new function to the final linked
program, it needs to add it after any global variable declarations
that the function refers to, otherwise the IR will be invalid (because
variable declarations must occur before variable accesses).  The
easiest way to do that is to have the linker emit functions to the
tail of the final linked program.

The linker used to emit functions to the head of the final linked
program, in an effort to keep callees sorted before their callers.
However, this was not reliable: it didn't work for functions declared
or defined in the same compilation unit as main, for diamond-shaped
patterns in the call graph, or for some obscure cases involving
overloaded functions.  And no code currently relies on this sort
order.

No Piglit regressions with i965 Ironlake.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:57 -07:00
Paul Berry
d4144a123b glsl: Check array size is const before asserting that no IR was generated.
process_array_type() contains an assertion to verify that no IR
instructions are generated while processing the expression that
specifies the size of the array.  This assertion needs to happen
_after_ checking whether the expression is constant.  Otherwise we may
crash on an illegal shader rather than reporting an error.

Fixes piglit tests array-size-non-builtin-function.vert and
array-size-with-side-effect.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:53 -07:00
Paul Berry
789ee6516b glsl: Constant-fold built-in functions before outputting IR
Rearranged the logic for converting the ast for a function call to
hir, so that we constant fold before emitting any IR.  Previously we
would emit some IR, and then only later detect whether we could
constant fold.  The unnecessary IR would usually get cleaned up by a
later optimization step, however in the case of a builtin function
being used to compute an array size, it was causing an assertion.

Fixes Piglit test array-size-constant-relational.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38625
2011-08-08 12:43:45 -07:00
Paul Berry
0d81b0e184 glsl: Emit function signatures at toplevel, even for built-ins.
The ast-to-hir conversion needs to emit function signatures in two
circumstances: when a function declaration (or definition) is
encountered, and when a built-in function is encountered.

To avoid emitting a function signature in an illegal place (such as
inside a function), emit_function() checked whether we were inside a
function definition, and if so, emitted the signature before the
function definition.

However, this didn't cover the case of emitting function signatures
for built-in functions when those built-in functions are called from
inside the constant integer expression that specifies the length of a
global array.  This failed because when processing an array length, we
are emitting IR into a dummy exec_list (see process_array_type() in
ast_to_hir.cpp).  process_array_type() later checks (via an assertion)
that no instructions were emitted to the dummy exec_list, based on the
reasonable assumption that we shouldn't need to emit instructions to
calculate the value of a constant.

This patch changes emit_function() so that it emits function
signatures at toplevel in all cases.

This partially fixes bug 38625
(https://bugs.freedesktop.org/show_bug.cgi?id=38625).  The remainder
of the fix is in the patch that follows.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:38 -07:00
Paul Berry
482338842d Revert "glsl: Skip processing the first function's body in do_dead_functions()."
opt_dead_functions contained a shortcut to skip processing the first
function's body, based on the assumption that IR functions are
topologically sorted, with callees always coming before their callers
(therefore the first function cannot contain any calls).

This assumption turns out not to be true in general.  For example, the
following code snippet gets translated to IR that violates this
assumption:

    void f();
    void g();
    void f() { g(); }
    void g() { ... }

In practice, the shortcut didn't cause bugs because of a coincidence
of the circumstances in which opt_dead_functions is called:

(a) we do inlining right before dead function elimination, and
    inlining (when successful) eliminates all calls.

(b) for user-defined functions, inlining is always successful, because
    previous optimization passes (during compilation) have reduced
    them to a form that is eligible for inlining.

(c) the function that appears first in the IR can't possibly call a
    built-in function, because built-in functions are always emitted
    before the function that calls them.

It seems unnecessarily fragile to have opt_dead_functions depend on
these coincidences.  And the next patch in this series will break (c).
So I'm reverting the shortcut.  The consequence will be a slight
increase in link time for complex shaders.

This reverts commit c75427f4c8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:04 -07:00
Bryan Cain
ffb7d02154 st/mesa: inline st_prepare_fragment_program in st_translate_fragment_program
This reverts an unnecessary part of commit 4683529048 and fixes misrendering
and an assertion failure in Cogs.

Fixes freedesktop.org bug 39888.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-08 10:28:59 -05:00
Brian Paul
506de19549 glext: upgrade to version 72 2011-08-08 09:01:13 -06:00
Brian Paul
75a9874021 glsl: silence warning about trailing comma in enum list 2011-08-08 09:00:57 -06:00
Brian Paul
7d4d8a8de7 gallium: silence warnings about trailing commas in enum lists 2011-08-08 09:00:06 -06:00
Brian Paul
8488112d20 mesa: whitespace changes 2011-08-08 08:26:49 -06:00
Christoph Bumiller
4dd3272df9 d3d1x: adapt to resource_resolve interface change 2011-08-07 15:34:34 +02:00
Christoph Bumiller
9e466e87e6 nv50,nvc0: never convert in resource copy when format sizes match
If there are any cases left where the st thinks that RGBA -> BGRA
will swap components, it will get what it deserves.

Now the GPU's 2D engine goes unused. What a shame.
2011-08-07 15:34:34 +02:00
Christoph Bumiller
425b179faf st/mesa: don't resolve stencil twice 2011-08-07 15:34:34 +02:00
Marek Olšák
1554e69e00 winsys/radeon: disable use of the buffer busy-for-write flag 2011-08-06 05:45:19 +02:00
Kenneth Graunke
db726b048e mesa: In validate_program(), initialize errMsg for safety.
validate_program relies on validate_shader_program to fill in errMsg;
empirically, there exist cases where that doesn't happen.

While tracking those down may be worthwhile, initializing the string so
we don't try to ralloc_strdup random garbage also seems wise.

Fixes issues caught by valgrind while running some test case.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-05 14:19:39 -07:00
Eric Anholt
a9e97d022c intel: Fix warnings from gl_constant_parameter changes. 2011-08-05 12:56:12 -07:00
Bryan Cain
5164244df0 glsl_to_tgsi: replace open-coded swizzle_for_size()
This is a port of commit 4c7e215c7b to glsl_to_tgsi.
2011-08-05 14:39:18 -05:00
Bryan Cain
b44648c918 glsl_to_tgsi: try to avoid emitting a MOV_SAT to saturate an expression tree
This is a port of commit 62722d9 to glsl_to_tgsi, with minor aesthetic
changes (moved the declaration and assignment of new_inst inside the if block).
2011-08-05 14:39:18 -05:00
Eric Anholt
4c7e215c7b ir_to_mesa: Replace open-coded swizzle_for_size() 2011-08-05 10:37:15 -07:00
Christopher James Halse Rogers
fbc2fcf685 glx/dri2: Paper over errors in DRI2Connect when indirect
DRI2 will throw BadRequest for this when the client is not local, but
DRI2 is an implementation detail and not something callers should have
to know about.  Silently swallow errors in this case, and just propagate
the failure through DRI2Connect's return code.

Note: This is a candidate for the stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-08-05 10:11:05 -07:00
Eric Anholt
62722d90af ir_to_mesa: Try to avoid emitting a MOV_SAT to saturate an expression tree.
Fixes a regression in codegen quality for ff_fragment_shader
conversion to GLSL -- glean texCombine produces 7.5% fewer Mesa IR
instructions.
2011-08-05 10:08:31 -07:00
Eric Anholt
6bd5f43f21 prog_optimize: Add support for saturates to _mesa_merge_mov_into_inst.
This fixes the remaining regression from ff_fragment_shader in Mesa IR
instruction count, to now being a 1.9% win overall.
2011-08-05 10:08:31 -07:00
Eric Anholt
9998df36c2 i965: Add dumping for gen6 WM constants too.
This looks just like the VS dump for now.
2011-08-05 10:08:31 -07:00
Eric Anholt
69dc529da2 mesa: Remove dead "MemPool" field of gl_shader_state. 2011-08-05 10:08:31 -07:00
Eric Anholt
ee0373b833 i965/fs: Don't upload unused uniform components.
This saves both register space and upload bandwidth for unused values.

Note that previously we were relying on the visitor not initially
generating references to different sets of uniforms between the 8-wide
and 16-wide code generation, and now we're relying on them dead-code
eliminating the same stuff, too.
2011-08-05 10:08:31 -07:00
Eric Anholt
0722edc59c i965/fs: Don't allocate the old backend's compile structs for our compile.
This saves some 35MB when the program only uses GLSL shaders.
2011-08-05 10:08:31 -07:00
Marek Olšák
5b005ecc2b winsys/radeon: do the CS cleanup in the CS ioctl thread 2011-08-05 07:08:18 +02:00
Marek Olšák
64ab39b035 winsys/radeon: fix space checking
We should remove the relocations which caused a validation failure
from the list, so that the kernel receives only the validated ones.

NOTE: This is a candidate for the 7.11 branch.
2011-08-05 07:08:18 +02:00
Marek Olšák
115651241b st/dri: remove an unused-but-set variable 2011-08-05 07:08:18 +02:00
Marek Olšák
a3cde50eff st/dri: remove a dummy function dri2_create_context
It does nothing besides calling dri_create_context with the same parameters.
2011-08-05 07:05:24 +02:00
Marek Olšák
6e7942936c st/mesa: remove unused-but-set variables in st_glsl_to_tgsi.cpp 2011-08-05 07:05:24 +02:00
Marek Olšák
d99c8e191b r300g: handle new CAPs 2011-08-05 07:05:24 +02:00
Marek Olšák
6b3bbf52b8 r300g: adapt to the resource_resolve interface change 2011-08-05 07:05:24 +02:00
Marek Olšák
c251d83d91 vbo: do not call _mesa_max_buffer_index in debug builds
That code drops performance in Unigine Heaven and Tropics
by a factor of 10. That's too crazy even for a debug build.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-05 07:05:24 +02:00
Chia-I Wu
547212d963 glsl: empty declarations should be valid
Unlike C++, empty declarations such as

  float;

should be valid.  The spec is not explicit about this actually.

Some apps that generate their shader sources may rely on this.  This was
noted when porting one of them to Linux from Windows.

Reviewed-by: Chad Versace <chad@chad-versace.us>

Note: this is a candidate for the 7.11 branch.
2011-08-05 12:14:24 +09:00
Vinson Lee
a48118e510 mesa: Remove MSVC stdint typedefs from compiler.h.
MSVC can now include the stdint.h at include/c99/stdint.h.
2011-08-04 18:06:18 -07:00
Brian Paul
bf8d06c518 mesa: pass correct constant type to _mesa_fetch_state()
Fixes assorted warnings about float vs. gl_constant_value pointers.
2011-08-04 16:02:08 -06:00
Brian Paul
324857599b mesa: use gl_constant_value type in ARB program parser 2011-08-04 16:00:06 -06:00
Brian Paul
a0eb83401e mesa: use gl_constant_value type in _mesa_[Get]ProgramNamedParameter4fNV() 2011-08-04 15:55:50 -06:00
Brian Paul
d7f2e38fca mesa: add st_glsl_to_tgsi.cpp to Sconscript 2011-08-04 15:55:13 -06:00
Brian Paul
1c8d079e20 mesa: fix out of bounds array access in rtgc debug code
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39841
This would only be hit if someone set RGTC_DEBUG=1.
2011-08-04 15:33:39 -06:00
Brian Paul
d6a0692f9d mesa: don't use K&R style function pointer calls 2011-08-04 15:33:39 -06:00
Bryan Cain
4683529048 Merge branch 'glsl-to-tgsi'
Conflicts:
	src/mesa/state_tracker/st_atom_pixeltransfer.c
	src/mesa/state_tracker/st_program.c
2011-08-04 15:43:34 -05:00
Bryan Cain
9adcab9cd4 st/mesa: replace duplicated create_color_map_texture() function with shared function 2011-08-04 13:52:09 -05:00
Bryan Cain
b7e8911531 glsl_to_tgsi: remove debugging printf 2011-08-04 13:52:06 -05:00
Brian Paul
50073563b2 st/mesa: silence int/float and double/float conversion warnings 2011-08-04 08:22:31 -06:00
Brian Paul
09ba2527e8 st/mesa: move declaration before code 2011-08-04 08:22:31 -06:00
Brian Paul
192baaac0f mesa: minor comment updates in enable.c 2011-08-04 08:22:31 -06:00
Brian Paul
1e89a526c6 mesa: whitespace, formatting fixes in GetTexParameter() code 2011-08-04 08:22:31 -06:00
Brian Paul
02d81dfcaf mesa: add null ptr checks in GetTexParameterI[u]iv() functions 2011-08-04 08:22:31 -06:00
Brian Paul
1254a2b2e4 mesa: condense GL_TEXTURE_RESIDENT query code 2011-08-04 08:22:31 -06:00
Brian Paul
88a4f2fe54 mesa: make error handling in glGetTexParameter() a bit more concise 2011-08-04 08:22:30 -06:00
Christoph Bumiller
e9d84dab88 nv50: implement resource_resolve with custom blit 2011-08-04 15:38:49 +02:00
Christoph Bumiller
f253d83bc7 st/mesa: implement multisample resolve via BlitFramebuffer 2011-08-04 15:38:49 +02:00
Christoph Bumiller
94822c6d83 gallium: extend resource_resolve to accommodate BlitFramebuffer
Resolve via glBlitFramebuffer allows resolving a sub-region of a
renderbuffer to a different location in any mipmap level of some
other texture, and, with a new extension, even scaling. Therefore,
location and size parameters are needed.

The mask parameter was added because resolving only depth or only
stencil of a combined buffer is possible as well.

Full information about the blit operation allows the drivers to
take the most efficient path they possibly can.
2011-08-04 15:38:49 +02:00
Christoph Bumiller
57590e173b st/mesa: determine Const.MaxSamples in init_extensions
v2: Check for non-pow2 sample counts as well.
2011-08-04 15:38:49 +02:00
Benjamin Franzke
32f4cf3808 egl/gbm: Fix EGL_DEFAULT_DISPLAY 2011-08-04 14:09:34 +02:00
Benjamin Franzke
ca6bbfd769 gbm: link gbm_gallium_drm.so against math library
This avoids the following runtime error with EGL on platforms that
require linking with libm for nontrivial math functions:

failed to load module: /xorg/lib64/gbm/gbm_gallium_drm.so: undefined
symbol: powf

(Based on Kristóf RALOVICHs patch and Ian's suggestions in
http://lists.freedesktop.org/archives/mesa-dev/2011-August/010036.html)
2011-08-04 14:09:34 +02:00
RALOVICH, Kristóf
eeed782ecb gbm/dri: avoid crash in dri_screen_create 2011-08-04 14:09:34 +02:00
Marek Olšák
babb26776f r600g: remove more of unused code
This is a follow-up to f6df430a85.
2011-08-04 03:25:18 +02:00
Stephane Marchesin
974c49ed17 i915g: Fix whitespace. 2011-08-04 02:46:18 +02:00
Stephane Marchesin
d476d7ce5a i915g: fix whitespace. 2011-08-03 23:18:30 +02:00
Vadim Girlin
2bde0cc95d r600g: take into account force_add_cf in pops
When we have two ENDIFs in a row, we shouldn't modify the pop_count
for the same alu clause twice.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38163

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-03 10:17:50 -04:00
Vadim Girlin
6eb94fc344 r600g: use backend mask for occlusion queries
Use backend_map kernel query if supported, otherwise analyze ZPASS_DONE
results to get the mask.

Fixes lockups with predicated rendering due to incorrect query buffer
initialization on some cards.

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-08-03 10:17:44 -04:00
Marek Olšák
2664980760 winsys/radeon: remove dummy function pb_buffer 2011-08-03 01:18:10 +02:00
Marek Olšák
b5e3940583 util: fix a typo in util_format_swizzle_4f
Reported by Gustaw Smolarczyk.
2011-08-03 01:15:41 +02:00
Eric Anholt
e0e4c2e305 radeon: Remove some remaining set-but-unused variables.
These looked more like copy-and-paste to me than the others (which
looked more like possibly someone forgot to write some code in a
refactor), so I didn't verify where they came from.
2011-08-02 13:58:42 -07:00
Eric Anholt
8de1d42f24 radeon: Remove set-but-unused variables in radeon_lock.c
These have been unused since this function's introduction in the FBO
support development around 2009.
2011-08-02 13:58:42 -07:00
Eric Anholt
f5e612ab59 radeon: Remove set-but-unused variables in radeonSetTexBuffer2() variants.
These have been unused since 2009.
2011-08-02 13:58:42 -07:00
Eric Anholt
25fffa9364 radeon: Remove set-but-unused log2depth variable.
r100 doesn't support 3D GL_EXT_texture3D.
2011-08-02 13:51:14 -07:00
Eric Anholt
7cf799d472 radeon: Remove set-but-unused color_mask variable.
This has been around since the initial import in 2003 and never used.
2011-08-02 13:51:14 -07:00
Eric Anholt
0f1aae3ae7 intel: Fix unused variable warning. 2011-08-02 13:33:49 -07:00
Stephane Marchesin
e49c36b8d9 Fix trailing whitespace. 2011-08-02 19:40:26 +02:00
Marek Olšák
e69dde5233 r600g: remove dummy function r600_bo_offset
Always returned 0.
2011-08-02 18:52:17 +02:00
Marek Olšák
f6df430a85 r600g: remove unused code 2011-08-02 18:52:17 +02:00
Marek Olšák
be7407b75b gallium/util: add functions for manipulating swizzles
Some of those have been in drivers already.
2011-08-02 18:49:30 +02:00
Ian Romanick
0290a018a5 i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks
This makes piglit a lot more happy.  The errors are logged when
INTEL_DEBUG=fallbacks because the application is about to hit a big
software fallback.  We frequently ask people to run applications that
are hitting software fallbacks with INTEL_DEBUG=fallbacks so the we
can help them debug the reason for the software fallback.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
3bb2f0dde1 i915: Fail without crashing if a Mesa IR program uses too many registers
This can only happen in GLSL shaders because assembly shaders that use
too many temps are rejected by core Mesa.  It is easiest to make this
happen with shaders that contain flow-control that could not be lowered.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
322c3bf9dc ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered
Rely on the driver to do the right thing.  This probably means falling
back to software.  Page 88 of the OpenGL 2.1 spec specifically says:

    "A shader should not fail to compile, and a program object should
    not fail to link due to lack of instruction space or lack of
    temporary variables. Implementations should ensure that all valid
    shaders and program objects may be successfully compiled, linked
    and executed."

There is no provision for saying "No" to a valid shader that is
difficult for the hardware to handle, so stop doing that.

On i915 this causes a large number of piglit tests to change from FAIL
to WARN.  The warning is because the driver still emits messages to
stderr like "i915_program_error: Unsupported opcode: BGNLOOP".

It also fixes ES2 conformance CorrectFull_frag and CorrectParse1_frag
on i915 (and probably other hardware that can't handle loops).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
8aadd89d07 ir_to_mesa: Use Add linker_error instead of fail_link
The functions were almost identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
89193933cb mesa: Ensure that gl_shader_program::InfoLog is never NULL
This prevents assertion failures in ralloc_strcat.  The ralloc_free in
_mesa_free_shader_program_data can be omitted because freeing the
gl_shader_program in _mesa_delete_shader_program will take care of
this automatically.

A bunch of this code could use a refactor to use ralloc a bit more
effectively.  A bunch of the things that are allocated with malloc and
owned by the gl_shader_program should be allocated with ralloc (using
the gl_shader_program as the context).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
379a32f42e linker: Make linker_{error,warning} generally available
linker_warning is a new function.  It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:01 -07:00
Ian Romanick
586e741ac1 linker: Make linker_error set LinkStatus to false
Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error.  The function linker_error
was previously known as linker_error_printf.  The name was changed
because it may seem surprising that a printf function will set an
error flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:21:43 -07:00
Kenneth Graunke
81b036b4d7 i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.
For power-of-two sizes, h0 == mt->height0 since it's already a multiple
of two.  However, for NPOT, they're different; h1 should be computed
based on the original size.

Fixes piglit test "cubemap npot" and oglconform test "textureNPOT".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-01 23:57:37 -07:00
Stephane Marchesin
f9b2107da6 i915g: Proper indentation of func parameters. 2011-08-02 03:33:02 +02:00
Stephane Marchesin
019c6ccbb4 i915g: Remove heuristic flushing. 2011-08-02 03:31:21 +02:00
Bryan Cain
189e9f12c7 glsl_to_tgsi: copy reladdr in st_src_reg(st_dst_reg) constructor
This is a glsl_to_tgsi port of commit f7cd9a858c.
2011-08-01 17:59:10 -05:00
Bryan Cain
3e7fce9773 glsl_to_tgsi: add each relative address to the previous
This is a glsl_to_tgsi port of commit d6e1a8f714.
2011-08-01 17:59:10 -05:00
Bryan Cain
10d31cb307 glsl_to_tgsi: lower all ir_quadop_vector expressions
Unlike Mesa IR, TGSI doesn't have a SWZ opcode.
2011-08-01 17:59:10 -05:00
Bryan Cain
3354a5b563 glsl_to_tgsi: rework immediate tracking to not use gl_program_parameter_list 2011-08-01 17:59:10 -05:00
Bryan Cain
f751730ad0 glsl_to_tgsi: update comments 2011-08-01 17:59:10 -05:00
Bryan Cain
a2c3b9f38d glsl_to_tgsi: make coding style more consistent 2011-08-01 17:59:10 -05:00
Bryan Cain
0da994a9f1 glsl_to_tgsi: make assignment hack safer
Fixes an assertion failure in piglit test glsl-texcoord-array.
2011-08-01 17:59:10 -05:00
Bryan Cain
7732822c83 glsl_to_tgsi: separate immediates from array constants during IR translation
Before, if any uniform or constant array was accessed with indirect
addressing, st_translate_program() would emit uniform constants in the place
of immediates.  This behavior was unavoidable with ir_to_mesa/mesa_to_tgsi, but
glsl_to_tgsi can work around it since the GLSL IR backend and the TGSI
emission are both inside the state tracker.
2011-08-01 17:59:09 -05:00
Bryan Cain
87f8d8547d glsl_to_tgsi: fix mistakes in get_pixel_transfer_visitor()
I noticed these issues while working on get_bitmap_visitor().
2011-08-01 17:59:09 -05:00
Bryan Cain
5f0b4b0e9d st/mesa, glsl_to_tgsi: support glBitmap with a GLSL fragment shader active 2011-08-01 17:59:09 -05:00
Bryan Cain
c0dcab2882 st/mesa, glsl_to_tgsi: support glDrawPixels/glCopyPixels with a GLSL fragment shader active
Since this was previously implemented using Mesa IR and _mesa_combine_programs,
this commit adds a new code path that works with glsl_to_tgsi.
2011-08-01 17:59:09 -05:00
Bryan Cain
33e0c47b05 glsl_to_tgsi: replace MAX_PROGRAM_TEMPS (256) with MAX_TEMPS (4096) 2011-08-01 17:59:09 -05:00
Bryan Cain
54db6e618e r200, r600c, i965: fix build 2011-08-01 17:59:09 -05:00
Bryan Cain
9c2810103d glsl_to_tgsi: always run copy_propagate() and eliminate_dead_code_advanced()
These two passes are written to handle indirect addressing properly.
2011-08-01 17:59:09 -05:00
Bryan Cain
4c8b6a2868 glsl_to_tgsi: fix mistake in new dead code elimination pass
The conditions of IF opcodes were not being counted as reads, which sometimes
led to the condition register being wrong or undefined.
2011-08-01 17:59:09 -05:00
Bryan Cain
f00406b68c glsl_to_tgsi: improve assignment handling
This is a hack, but it's better than emitting an unnecessary MOV instruction
and hoping the optimization passes clean it up.
2011-08-01 17:59:09 -05:00
Bryan Cain
71cbc9e3c4 glsl_to_tgsi: improve eliminate_dead_code_advanced() 2011-08-01 17:59:09 -05:00
Bryan Cain
3bd06e5b82 glsl_to_tgsi: use the correct writemask in try_emit_mad() and try_emit_sat() 2011-08-01 17:59:09 -05:00
Bryan Cain
194732fd72 glsl_to_tgsi: use a more specific condition for gl_FragDepth hack in generating assignments
This reduces the number of instructions in the fragment shader of
glsl-fs-atan-2 from 174 to 146 with EmitNoIfs enabled.
2011-08-01 17:59:09 -05:00
Bryan Cain
41472f7809 glsl_to_tgsi: add a better, more advanced dead code elimination pass 2011-08-01 17:59:08 -05:00
Bryan Cain
7ec7dd4fb6 glsl_to_tgsi: remove handling of XPD opcode in compile_tgsi_instruction()
The opcode is never emitted by the glsl_to_tgsi_visitor, so its special case in
compile_tgsi_instruction() was dead code.
2011-08-01 17:59:08 -05:00
Bryan Cain
8b881ad1c3 glsl_to_tgsi: use swizzle_for_size for src reg in conditional moves
This prevents the copy propagation pass from being confused by undefined
channels and thus missing optimization opportunities.
2011-08-01 17:59:08 -05:00
Emil Velikov
8c50f18b29 glsl_to_tgsi: execute merge_registers() after eliminate_dead_code()
Fixes a regression unintentionally introduced by "glsl_to_tgsi: fix shaders with
indirect addressing of temps" that caused missing leaves in 3dmark01 test 4 (Nature)
and missing/displaced textures on human models in Counter-Strike: Source.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
2011-08-01 17:59:08 -05:00
Bryan Cain
29d21417e3 glsl_to_tgsi: implement simplify_cmp pass needed by r300g 2011-08-01 17:59:08 -05:00
Bryan Cain
552cc48fca glsl_to_tgsi: fix compile error with g++ 4.6 2011-08-01 17:59:08 -05:00
Bryan Cain
1141c3f4c4 glsl: remove glsl_type::get_vec4_type()
Thanks to Kenneth Graunke for pointing out that glsl_type::get_instance(base, 4, 1)
is the same as glsl_type::get_vec4_type(base).

The function was only used in st_glsl_to_tgsi, and this commit replaces that usage
with get_instance.
2011-08-01 17:59:08 -05:00
Bryan Cain
b30bbd7436 glsl_to_tgsi: silence compiler warning 2011-08-01 17:59:08 -05:00
Bryan Cain
bf1cee9f24 glsl_to_tgsi: finish some loose ends 2011-08-01 17:59:08 -05:00
Bryan Cain
b2c067e307 glsl-to-tgsi: fix piglit tests
This commit fixes all of the piglit tests regressed by "mesa, glsl_to_tgsi: add
native support for integers in shaders" on softpipe.
2011-08-01 17:59:08 -05:00
Bryan Cain
b191382c60 mesa, glsl_to_tgsi: add native support for integers in shaders
Disabled by default on all drivers.  To enable it, change ctx->GLSLVersion to 130
in st_extensions.c.  Currently, softpipe is the only driver with integer support.
2011-08-01 17:59:08 -05:00
Bryan Cain
f95169deb4 tgsi: add support for TGSI_OPCODE_MOD in tgsi_exec 2011-08-01 17:59:08 -05:00
Bryan Cain
6d89abadbc mesa: support boolean and integer-based parameters in prog_parameter
The functionality is not used by anything yet, and the glUniform functions will
need to be reworked before this can reach its full usefulness.  It is
nonetheless a step towards integer support in the state tracker and classic drivers.
2011-08-01 17:59:07 -05:00
Bryan Cain
17b695e6e7 gallium: add PIPE_SHADER_CAP_INTEGERS 2011-08-01 17:59:07 -05:00
Bryan Cain
16d7a717d5 glsl_to_tgsi: fix shaders with indirect addressing of temps
Fixes several Piglit tests, although it's a step backwards for optimization.
2011-08-01 17:59:07 -05:00
Bryan Cain
56dc2c176c glsl_to_tgsi: use TGSI opcodes when converting from GLSL IR
Before, the translator used Mesa IR opcodes (a holdover from ir_to_mesa) and
converted them to TGSI opcodes during TGSI emission.
2011-08-01 17:59:07 -05:00
Bryan Cain
3b0858f1ae glsl_to_tgsi: support DDY (ir_unop_dFdy) 2011-08-01 17:59:07 -05:00
Bryan Cain
a6705aa5ca glsl_to_tgsi: lower noise opcodes when converting from GLSL IR, not when generating TGSI 2011-08-01 17:59:07 -05:00
Bryan Cain
5768ed6429 glsl_to_tgsi: define the sampler objects used
Fixes the Nexuiz title screen and the water in 0 A.D.
2011-08-01 17:59:07 -05:00
Bryan Cain
556bd82ce1 glsl_to_tgsi: remove a bad assertion
It was triggered by Alien Arena.
2011-08-01 17:59:07 -05:00
Bryan Cain
c341d3cfd0 glsl_to_tgsi: remove reads to output registers
Fixes a regression in 0 A.D. introduced by 809a11c77073e999fd47.
2011-08-01 17:59:07 -05:00
Bryan Cain
44867da354 glsl_to_tgsi: stop generating Mesa IR
Before, it was still generating unused Mesa IR as a remnant of ir_to_mesa, and
depended on some of the information from it.
2011-08-01 17:59:07 -05:00
Bryan Cain
1e5fd8e480 mesa: fix segfault when no Mesa IR is generated 2011-08-01 17:59:07 -05:00
Bryan Cain
f379d8f730 st/mesa: Add a GLSL IR to TGSI translator.
It is still a work in progress at this point, but it produces working and
reasonably well-optimized code.

Originally based on ir_to_mesa and st_mesa_to_tgsi, but does not directly use
Mesa IR instructions in TGSI generation, instead generating TGSI from the
intermediate class glsl_to_tgsi_instruction.  It also has new optimization
passes to replace _mesa_optimize_program.
2011-08-01 17:59:07 -05:00
Paul Berry
b1b4ea0b36 glsl: improve the accuracy of the atan(x,y) builtin function.
The previous formula for atan(x,y) returned a value of +/- pi whenever
|x|<0.0001, and used a formula based on atan(y/x) otherwise.  This
broke in cases where both x and y were small (e.g. atan(1e-5, 1e-5)).

This patch modifies the formula so that it returns a value of +/- pi
whenever |x|<1e-8*|y|, and uses the formula based on atan(y/x)
otherwise.
2011-08-01 14:37:38 -07:00
Paul Berry
d4c80f5f85 glsl: improve the accuracy of the asin() builtin function.
The previous formula for asin(x) was algebraically equivalent to:

sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2))

where A, B, and C were arbitrary constants determined by a curve fit.

This formula had a worst case absolute error of 0.00448, an unbounded
worst case relative error, and a discontinuity near x=0.

Changed the formula to:

sign(x)*(pi/2 - sqrt(1-|x|)*(pi/2 + (pi/4-1)|x| + A|x|^2 + B|x|^3))

where A and B are arbitrary constants determined by a curve fit.  This
has a worst case absolute error of 0.00039, a worst case relative
error of 0.000405, and no discontinuities.

I don't expect a significant performance degradation, since the extra
multiply-accumulate should be fast compared to the sqrt() computation.

Fixes piglit tests {vs,fs}-asin-float and {vs,fs}-atan-*
2011-08-01 14:37:38 -07:00
Chad Versace
5541920e0a glsl: Remove duplicate comment
Remove duplicate doxgen comment for
ir_function.cpp:parameter_lists_match().

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-01 09:37:06 -07:00
Jeremy Huddleston
5b3c719983 darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 09:43:52 -07:00
Jeremy Huddleston
e737a99a6f Fix PPC detection on darwin
Fixes regression introduced by 7004582c18

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 09:24:35 -07:00
Chad Versace
5081d31a0e glsl: Clarify ir_function::matching_sigature()
The function used a variable named 'score', which was an outright lie.
A signature matches or it doesn't; there is no fuzzy scoring.

Change the return type of parameter_lists_match() to an enum, and
let ir_function::matching_sigature() switch on that enum.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:38 -07:00
Chad Versace
a5ab9398e3 glsl: Fix conversions in array constructors
Array constructors obey narrower conversion rules than other constructors
[1] --- they use the implicit conversion rules [2] instead of the scalar
constructor conversions [3].  But process_array_constructor() was
incorrectly applying the broader rules.

[1] GLSL 1.50 spec, Section 5.4.4 Array Constructors, page 52 (58 of pdf)
[2] GLSL 1.50 spec, Section 4.1.10 Implicit Conversions, page 25 (31 of pdf)
[3] GLSL 1.50 spec, Section 5.4.1 Conversion, page 48 (54 of pdf)

To fix this, first check (with glsl_type::can_be_implicitly_converted_to)
if an implicit conversion is legal before performing the conversion.

Fixes:
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec*-vec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:30 -07:00
Chad Versace
6efe1a8495 glsl: Remove ir_function.cpp:type_compare()
The function is no longer used and has been replaced by
glsl_type::can_implicitly_convert_to().

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:25 -07:00
Chad Versace
8b3627fd7b glsl: Fix implicit conversions in non-constructor function calls
Context
-------
In ast_function_expression::hir(), parameter_lists_match() checks if the
function call's actual parameter list matches the signature's parameter
list, where the match may require implicit conversion of some arguments.
To check if an implicit conversion exists between individual arguments,
type_compare() is used.

Problems
--------
type_compare() allowed the following illegal implicit conversions:
    bool -> float
    bvecN -> vecN

    int -> uint
    ivecN -> uvecN

    uint -> int
    uvecN -> ivecN

Change
------
type_compare() is buggy, so replace it with glsl_type::can_be_implicitly_converted_to().
This comprises a rewrite of parameter_lists_match().

Fixes piglit:spec/glsl-1.20/compiler/built-in-functions/outerProduct-bvec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:14 -07:00
Chad Versace
200e4972c1 glsl: Add method glsl_type::can_implicitly_convert_to()
This method checks if a source type is identical to or can be implicitly
converted to a target type according to the GLSL 1.20 spec, Section 4.1.10
Implicit Conversions.

The following commits use the method for a bugfix:
    glsl: Fix implicit conversions in non-constructor function calls
    glsl: Fix implicit conversions in array constructors

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:26:59 -07:00
Brian Paul
120d71a45c mesa: minor comment changes in teximage.c 2011-07-29 16:49:55 -06:00
Brian Paul
dc1f32deae mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries
And fix indentation.

NOTE: This is a candidate for the 7.11 branch.
2011-07-29 16:49:55 -06:00
Eric Anholt
f710b8c750 i965/fs: Allow register coalescing where the source is a uniform.
Removes 0.8% of the fragment shader instructions on Unigine Tropics.
2011-07-29 12:17:03 -07:00
Eric Anholt
a8b86459a1 i965/fs: Optimize a * 1.0 -> a.
This appears in our instruction stream as a result of the
brw_vs_constval.c handling.
2011-07-29 12:17:03 -07:00
Eric Anholt
6d8d6b41b8 i965/fs: If we see a RCP of a constant, try to constant fold it. 2011-07-29 12:17:03 -07:00
Eric Anholt
eb30820f26 i965/fs: Port texture projection avoidance optimization from the old backend.
This is part of fixing a ~1% performance regression in OpenArena when
changing the fixed function fragment shader to using the new backend.
Right now this just avoids the LINTERP of the projector, not the math
using it.
2011-07-29 12:17:03 -07:00
Eric Anholt
652ef8569c Revert "i965: Don't compute brw->wm.input_size_masks when it's unused."
This reverts commit 3412069e23.  We're
about to start using it in fragment shaders to handle avoiding
projection for fixed function.
2011-07-29 12:17:03 -07:00
Eric Anholt
44ffb4ae20 i965/fs: Stop using the exec_list iterator.
The old style has gone out of favor in the project, but I kept copy
and pasting from existing iterator code.
2011-07-29 12:17:03 -07:00
Alex Deucher
dc1c0ca22a r600g: fix up vs export handling
Certain attributes (position, psize, etc.) don't
count as params; they are handled separately by the hw.
However, the VS is required to export at least one param
and r600_shader_from_tgsi() takes care of adding a dummy
export if there is none.  Make sure the VS param export
count in the SPI properly accounts for this.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-29 11:34:02 -04:00
Chia-I Wu
5c9e0ad5fd st/egl: create pbuffers with PIPE_BIND_SAMPLER_VIEW
So that eglBindTexImage works.
2011-07-29 14:16:51 +09:00
Eric Anholt
4fdd289805 i965/fs: Respect ARB_color_buffer_float clamping.
This was done in the old codegen path, but not the new one.  Caught by
piglit fbo tests after the conversion to GLSL ff_fragment_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 20:58:18 -07:00
Eric Anholt
ef1854d090 mesa: Fix ff fragment shader inputs calculation when enabling a VS.
The FF VS generation happens just after the FF FS generation in
state.c, so the ctx->VP._Current value is for the previous state
update's vertex shader, not the one that will be chosen as a result of
this state update.  The vertexShader and vertexProgram variables
should be accurately telling us whether there's going to be a
ctx->VP._Current (except on _MaintainTnlProgram drivers, where it's
always true).

The glsl-vs-statechange-1 test was created to test for this, but it
turns out that the bug is hidden by the fact that we call
_mesa_update_state() twice per draw call -- once from
_mesa_valid_to_render() and once from vbo_draw_arrays(), and the
second one was fixing up the first one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-28 20:51:53 -07:00
Chia-I Wu
96ca6a6262 targets/{egl,gbm}: omit unneeded libdrm_radeon 2011-07-29 10:24:45 +09:00
Chia-I Wu
d6a9564854 egl: EGL_MATCH_NATIVE_NATIVE_PIXMAP cannot be EGL_DONT_CARE 2011-07-29 10:24:45 +09:00
Chia-I Wu
a5ab46909e egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED
eglSwapBuffers is no-op to these surface types anyway.
2011-07-29 10:24:39 +09:00
Eric Anholt
83f5d5e6aa Add dependency generation for Mesa and GLSL dricore objects.
Reviewed-By: Christopher James Halse Rogers
	     <christopher.halse.rogers@canonical.com>
2011-07-28 17:32:42 -07:00
Eric Anholt
f79e3518b4 softpipe: When doing write_all_cbufs, don't stomp over the color.
We have to make it through this loop processing the color multiple
times, so we can't go overwriting it on our first color buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-28 17:32:42 -07:00
Brian Paul
e4fdc95277 mesa: fix format selection for meta CopyTexSubImage()
When we do a glReadPixels into the temporary buffer, we don't want to
use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will
compute L=R+G+B which is not what we want.

This bug has existed all along but was only exposed by the elimination
of the driver hook for glCopyTexImage() in
5874890c26.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-28 17:29:36 -06:00
Brian Paul
26684e0b1a mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv() 2011-07-28 17:24:57 -06:00
Brian Paul
58d6aa8287 st/mesa: fix comment language 2011-07-28 17:24:56 -06:00
Vadim Girlin
95ee961f77 r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-28 18:58:40 -04:00
Kenneth Graunke
f73caddd33 i965: Remove the now unused intel_renderbuffer::draw_offset field.
The previous commit removed the last use of this field.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 14:04:39 -07:00
Kenneth Graunke
15c0bc5eef i965: Check actual tile offsets in Gen4 miptree workaround.
The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
support that.  However, it's insufficient: there are cases where
draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
assertion failure in brw_update_renderbuffer_surface with tile_y != 0.

Instead, simply call intel_renderbuffer_tile_offsets to compute the
actual X/Y offsets and check if either are non-zero.  This makes both
the workaround and the assertion check the same things.

Fixes piglit test fbo-generatemipmap-formats, and should also fix
bugs #34009 and #39487.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 14:04:39 -07:00
Kenneth Graunke
3e1fd13f60 i965/gen4: Fix message parameter loading for 1D TXD sampling.
We were neglecting to load dvdx and dvdy.  v is not optional.

Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline.
(We still need an execution test using sampler1D.)

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 14:04:39 -07:00
Paul Berry
fe33c886a7 glsl: improve the accuracy of the radians() builtin function
The constant used in the radians() function didn't have enough
precision, causing a relative error of 1.676e-5, which is far worse
than the precision of 32-bit floats.  This patch reduces the relative
error to 1.14e-9, which is the best we can do in 32 bits.

Fixes piglit tests {fs,vs}-radians-{float,vec2,vec3,vec4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 10:41:39 -07:00
Marek Olšák
0aed27ee37 configure.ac: add DLOPEN_LIBS to xlib build
Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.
2011-07-28 00:25:28 +02:00
Marek Olšák
c6f59fcd00 configure.ac: fix xlib-based softpipe build
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>

NOTE: This is a candidate for the 7.11 branch.
2011-07-28 00:25:12 +02:00
Ian Romanick
f622c6d7a2 glsl: Add source location tracking to TODO list 2011-07-27 11:41:14 -07:00
Ian Romanick
5e1b7097f3 glsl: Remove completed items from the TODO list 2011-07-27 11:41:14 -07:00
Christoph Bumiller
58c04435b1 mesa: don't forget about sampleBuffers in framebuffer visual update
Otherwise multisample will never been enabled for multisample
renderbuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-27 12:13:37 +02:00
Benjamin Franzke
79dcfb266a wayland-drm: Add copyright notice to protocol
Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
2011-07-27 10:07:14 +02:00
Tobias Droste
d4d5e3a336 egl/gallium: fix build without softpipe and llvmpipe
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-07-27 09:35:46 +02:00
Marek Olšák
1c2c4ddbd1 r300g: copy the compiler from r300c
What a beast.

r300g doesn't depend on files from r300c anymore, so r300c is now left
to its own fate. BTW 'make test' can be invoked from the gallium/r300
directory to run some compiler unit tests.
2011-07-26 22:35:49 +02:00
Bryan Cain
860c51d827 util: enable S3TC support when the force_s3tc_enable env var is set to "true"
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 12:54:42 -05:00
Bryan Cain
95739f19cc st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 12:54:40 -05:00
Ian Romanick
b189d1635d mesa: Make _mesa_get_compressed_formats match the texture compression specs
The implementation deviated slightly from the GL_EXT_texture_sRGB spec
and from other implementations.  A giant comment block was added to
justify the somewhat odd behavior of this function.

In addition, the interface had unnecessary cruft.  The 'all' parameter
was false at all callers, so it has been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:24 -07:00
Ian Romanick
143b65f761 mesa: Return the correct internal fmt when a generic compressed fmt was used
If an application requests a generic compressed format for a texture
and the driver does not pick a specific compressed format, return the
generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT
query.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:17 -07:00
Ian Romanick
09916e877f mesa: Add utility function to get base format from a GL compressed format
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:14 -07:00
Eric Anholt
3daa2d97eb i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-25 19:42:18 -07:00
Ian Romanick
c1e591eed4 glsl: Correctly return progress from lower_variable_index_to_cond_assign
lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-25 18:45:46 -07:00
Marek Olšák
99fba503b1 configure.ac: do not check for llvm-config if llvm is disabled
NOTE: This is a candidate for the 7.11 branch.
2011-07-25 23:47:22 +02:00
Tobias Droste
84f8548dfc r300/compiler: simplify code in peephole_add_presub_add
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-25 23:47:07 +02:00
Marek Olšák
f170555a18 winsys/radeon: fix typos in the driver interface 2011-07-25 23:10:40 +02:00
Marek Olšák
533e228923 winsys/radeon: manage constant buffers by the cache bufmgr too 2011-07-25 23:10:40 +02:00
Marek Olšák
7db148d3a5 winsys/radeon: remove usage parameter from buffer_create 2011-07-25 23:10:40 +02:00
Marek Olšák
e22a1005c0 winsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs 2011-07-25 23:10:40 +02:00
Marek Olšák
67c995e0f1 winsys/radeon: little change in radeon_bo_is_referenced_by_cs 2011-07-25 23:10:40 +02:00
Marek Olšák
ce9daf6f0b winsys/radeon: add R300 infix to winsys feature names 2011-07-25 23:10:39 +02:00
Marek Olšák
28a336dc38 winsys/radeon: simplify how value queries work
This drops the get_value query and adds a function query_info, which returns
all the values in one nice structure.
2011-07-25 23:10:39 +02:00
Eric Anholt
818db3848b i965: Fix many of the trivial WebGL demos that broke due to IB optimization.
The index buffer state emit only occurred if there was an IB in place
and we were in either a new batch or a new IB state.  But because we
only flagged new IB state if IB state changed from the last IB state
we calculated, we could simply never emit IB state after batchbuffer
wraps if the first draw didn't use the IB and we didn't actually
change the IB.

Fixes piglit glx-multi-context-ib-1.
2011-07-25 13:47:18 -07:00
Eric Anholt
a0e5affb22 i965: Use 3D clears on gen6+ to avoid inter-ring synchronization.
Improves firefox-talos-gfx around 5%.
2011-07-25 13:47:18 -07:00
Eric Anholt
8080246892 meta: Also save/restore clip planes for GLSL.
Fixes user-clip on 965 with 3D clears enabled.  I created a separate
flag because I wanted to avoid the overhead of the matrix operations
in this path.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 13:47:18 -07:00
Eric Anholt
185868c9c2 i965: Emit texture cache flushes on gen6 along with render cache flushes.
It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.
2011-07-25 13:47:01 -07:00
Paul Berry
d92463d5dc i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.

However, accumulator_contains() wasn't checking the val.negate or
val.abs flags.  As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.

Fixes piglit test vs-refract-vec4-vec4-float.

Tested on Gen5 and Gen6.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-25 11:40:53 -07:00
Kenneth Graunke
572f631895 i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.
On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-25 10:45:56 -07:00
Kenneth Graunke
156cef0fba i965/fs: Clear result before visiting shadow comparitor and LOD info.
Commit 53c89c67f3 ("i965: Avoid generating
MOVs for assignments of expressions.") added the line "this->result =
reg_undef" all over the code.  Unfortunately, since Eric developed his
patch before I landed Ivybridge support, he missed adding it to
fs_visitor::emit_texture_gen7() after rebasing.

Furthermore, since I developed TXD support before Eric's patch, I
neglected to add it to the gradient handling when I rebased.

Neglecting to set this causes the visitor to use this->result as storage
rather than generating a new temporary.  These missing statements
resulted in the same register being used to store several different
values.

Fixes the following piglit tests on Ivybridge:
- glsl-fs-shadow2dproj.shader_test
- glsl-fs-shadow2dproj-bias.shader_test

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-25 10:45:56 -07:00
Emeric
7746b7d4bf vdpau: enable mpeg1 hw decoding, using the exact same code path as mpeg2
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39307

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-07-25 19:22:35 +02:00
Christian König
4f90b89961 gallium: change formats merged with pipe-video to type "other"
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39276
2011-07-25 18:20:22 +02:00
Benjamin Franzke
42cdf4074e configure: Move gbm before egl in SRC_DIRS
egl_dri2 built into libEGL depends on libgbm.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39515
2011-07-25 09:37:02 +02:00
Christian König
4c84acc86f g3dvl: remove unused vs output from create_ref_vert_shader
The position of the quad vertex is calculated in calc_position,
so we don't need the output here any more.
2011-07-25 01:32:39 +02:00
Christian König
4d23c6df81 r600g: use file_max instead of file_count to determine reg offset
Otherwise shaders with skipped inputs/outputs doesn't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-07-24 19:17:27 +02:00
Younes Manton
ac6455e9a2 gallium/softpipe: Don't clobber dest color/alpha before masking.
The blend_quad function clobbers the actual render target color/alpha
values while applying the destination blend factor, which results in
restoring the wrong value during the masking stage for write-disabled
channels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-23 17:13:44 -04:00
Ian Romanick
6c8f1f483a glsl: Compare vector indices in blocks
Just like the non-constant array index lowering pass, compare all N
indices at once.  For accesses to a vec4, this saves 3 comparison
instructions on a vector architecture.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
90cc372400 glsl: Factor out code that generates block of index comparisons
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
156f85336f glsl: Treat ir_dereference_array of non-var as a constant for lowering
Previously the code would just look at deref->array->type to see if it
was a constant.  This isn't good enough because deref->array might be
another ir_dereference_array... of a constant.  As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL.  The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced().  If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries.  This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
1d3f09f159 i965: When emitting a src/dst read of an output, keep the swizzle and neg
Fixes i965 piglit vs-varying-array-mat[234]-row-rd.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
337e2dfad0 i965: When emitting a src/dst write of an output, keep the write mask
Fixes i965 piglit:

    vs-varying-array-mat[234]-col-row-wr
    vs-varying-array-mat[234]-index-col-row-wr
    vs-varying-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-row-wr
    vs-varying-mat[234]-col-row-wr
    vs-varying-mat[234]-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-23 01:24:18 -07:00
Ian Romanick
fbeb68e880 prog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion
Leaving the unused registers with other values caused assertion
failures and other problems in places that blindly iterate over all
sources.

brw_vs_emit.c:1381: get_src_reg: Assertion `c->regs[file][index].nr !=
0' failed.

Fixes i965 piglit:

    vs-uniform-array-mat[234]-col-row-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-row-rd
    vs-uniform-mat[234]-col-row-rd

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
f7cd9a858c ir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor
Fixes i965 piglit:

    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Fixes swrast piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-row-wr
    fs-temp-mat[234]-col-row-wr
    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
d6e1a8f714 ir_to_mesa: Add each relative address to the previous
This fixes many cases of accessing arrays of matrices using
non-constant indices at each level.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd

Fixes swrast piglit:

    fs-temp-array-mat[234]-index-col-rd
    fs-temp-array-mat[234]-index-col-row-rd
    fs-temp-array-mat[234]-index-col-wr
    fs-uniform-array-mat[234]-index-col-rd
    fs-uniform-array-mat[234]-index-col-row-rd
    fs-varying-array-mat[234]-index-col-rd
    fs-varying-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-rd
    vs-varying-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
601428d2bb glsl: When lowering non-constant vector indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
5f83dfe5b7 glsl: When lowering non-constant array indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
1731ac3086 glsl: Rework lowering of non-constant array indexing
The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
d2296e784a glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
8d5f3cef79 glsl: Move is_array_or_matrix outside visitor class
There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
José Fonseca
5161aff48a gallivm: Add a note about log2 computation and denormalized numbers. 2011-07-22 18:52:09 -07:00
José Fonseca
af82ff556c gallivm: Fix lp_build_exp2 order 4-5 polynomial coefficients and bump order.
Not sure how I computed these, but they were wrong (which explains why
bumping the polynomial order before never improved precision).

This allows to pass the EXP test cases of PSPrecision/VSPrecision DCTs.
2011-07-22 18:52:09 -07:00
José Fonseca
47d6d44a23 gallivm: Increase lp_build_rsqrt() precision.
Add an iteration step, which makes rqsqrt precision go from 12bits to
24, and fixes RSQ/NRM test case of PSPrecision/VSPrevision DCTs.

There are no uses of this function outside shader translation.
2011-07-22 18:52:09 -07:00
José Fonseca
ef1a2765a4 gallivm: Update minimax comments. 2011-07-22 18:52:09 -07:00
José Fonseca
1ac86e249e gallivm: Fix lp_build_exp/lp_build_log.
Never used so far -- we only used the base 2 variants -- which is why
it went unnoticed so far.
2011-07-22 18:52:09 -07:00
José Fonseca
0a1d49504d llvmpipe: Unit tests for arithmetic functions.
Conflicts:

	src/gallium/drivers/llvmpipe/SConscript
2011-07-22 18:52:08 -07:00
José Fonseca
eb7590f677 util: Store alpha value too. 2011-07-22 18:52:08 -07:00
Vinson Lee
edaadd94cb glsl: Add standalone_scaffolding.cpp to SConscript. 2011-07-22 10:38:05 -07:00
Paul Berry
659cdedb53 glsl: Add unit tests for lower_jumps.cpp
These tests invoke do_lower_jumps() in isolation (using the glsl_test
executable) and verify that it transforms the IR in the expected way.

The unit tests may be run from the top level directory using "make
check".

For reference, I've also checked in the Python script
create_test_cases.py, which was used to generate these tests.  It is
not necessary to run this script in order to run the tests.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-22 09:45:11 -07:00
Paul Berry
f1f76e157e glsl: Create a standalone executable for testing optimization passes.
This patch adds a new build artifact, glsl_test, which can be used for
testing optimization passes in isolation.

I'm hoping that we will be able to add other useful standalone tests
to this executable in the future.  Accordingly, it is built in a
modular fashion: the main() function uses its first argument to
determine which test function to invoke, removes that argument from
argv[], and then calls that function to interpret the rest of the
command line arguments and perform the test.  Currently the only test
function is "optpass", which tests optimization passes.
2011-07-22 09:45:11 -07:00
Paul Berry
f129f618fe glsl: Move functions into standalone_scaffolding.cpp for later reuse.
This patch moves the following functions from main.cpp (the main cpp
file for the standalone executable that is used to create the built-in
functions) to standalone_scaffolding.cpp, so that they can be re-used
in other standalone executables:

- initialize_context()*
- _mesa_new_shader()
- _mesa_reference_shader()

*initialize_context contained some code that was specific to main.cpp,
so it was split into two functions: initialize_context() (which
remains in main.cpp), and initialize_context_from_defaults() (which is
in standalone_scaffolding.cpp).
2011-07-22 09:45:11 -07:00
Paul Berry
12c22cab77 mesa: Add an ifndef guard around the definition of the INLINE macro
Several Mesa headers redundantly define the INLINE macro.  Adding this
guard prevents the compiler from complaining about macro redefinition.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-22 09:45:11 -07:00
Younes Manton
a87afba505 Revert "g3dvl: Preserve previously rendered components for MC output."
This reverts commit b56daf71d2.

The bug is actually in softpipe's blend and writemask interaction.
2011-07-21 20:09:11 -04:00
Marek Olšák
50e32fefb1 configure.ac: check for libdrm_radeon only when building classic 2011-07-21 22:31:24 +02:00
Brian Paul
636d01bd61 Merge branch 'gallium-polygon-stipple' 2011-07-21 10:38:21 -06:00
Brian Paul
57aa597b3d softpipe: use the polygon stipple utility module
This is an alternative to the draw module's polygon stipple stage.
The softpipe implementation here is just a test.  The advantange of
using the new polygon stipple utility module (with other drivers)
is we can avoid software vertex processing in the draw module and
get much better performance.
Polygon stipple doesn't require special vertex processing like
the other draw module stage.
2011-07-21 10:32:15 -06:00
Brian Paul
c534f11164 softpipe: implement fragment shader variants
We'll need shader variants to accomodate the new polygon stipple utility.
2011-07-21 09:57:37 -06:00
Brian Paul
3dde6be908 util: assorted updates to polygon stipple helper 2011-07-21 09:57:37 -06:00
Brian Paul
4736c0ba86 softpipe: use tgsi_shader_info fields for fragcoord origin, center, etc. 2011-07-21 09:57:37 -06:00
Brian Paul
2253906da3 tgsi: add info fields for fragcoord origin, center, etc 2011-07-21 09:57:33 -06:00
Brian Paul
9c1319d31d softpipe: remove obsolete comment 2011-07-21 09:55:22 -06:00
Brian Paul
f16d97feaa softpipe: rename a function 2011-07-21 09:55:22 -06:00
Brian Paul
ecc6a26a3d Merge branch 'remove-copyteximage-hook' 2011-07-21 08:46:02 -06:00
Chia-I Wu
afc160e1c8 u_vbuf_mgr: restore buffer offsets
u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.
2011-07-21 21:20:37 +08:00
Marek Olšák
000896c0bb mesa: GLES2 should return different error enums for invalid fbo queries
ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a0

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-21 14:16:43 +02:00
Christoph Bumiller
ea316c5e06 nouveau: hook up video decoding with nouveau_context
This doesn't include nvfx since its context struct is not derived
from common nouveau_context (yet).
2011-07-21 10:39:41 +02:00
Vinson Lee
76bccaff0c glsl: Add ir_function_detect_recursion.cpp to SConscript. 2011-07-20 20:16:27 -07:00
Ian Romanick
02c5ae1b3f glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 18:20:59 -07:00
Ian Romanick
1ad3ba4ad9 glsl: Make prototype_string publicly available
Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 18:20:59 -07:00
Marek Olšák
2d960d3f4e g3dvl: remove unused vertex shader inputs
See also comments in the code.
2011-07-20 22:55:24 +02:00
Eric Anholt
3e5d36267d i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 11:42:53 -07:00
Eric Anholt
407785d0e9 i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
2011-07-20 11:12:38 -07:00
Eric Anholt
dc7422405f i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 11:10:00 -07:00
Eric Anholt
540e66b3be intel: Use the GLSL-based meta clear when available.
Improves firefox-talos-gfx performance under GL when 3D clears are
enabled:
[  0]       gl-before     firefox-talos-gfx   20.193   20.251   0.27%    3/3
[  0]       gl-after      firefox-talos-gfx   18.013   18.040   0.19%    3/3
2011-07-20 11:03:26 -07:00
Eric Anholt
eee570290a meta: Add a GLSL-based _mesa_meta_Clear() variant.
This cuts out a large portion of the overhead of glClear() from
resetting the texenv state and recomputing the fixed function
programs.  It also means less use of fixed function internally in our
GLES2 drivers, which is rather bogus.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-20 11:03:20 -07:00
Younes Manton
b56daf71d2 g3dvl: Preserve previously rendered components for MC output.
Fixes xvmc-softpipe MC entrypoint, amongst others.
2011-07-20 13:52:45 -04:00
Younes Manton
8082816e27 g3dvl: Init/clean pipe fully when a shader-based decoder isn't used.
Fixes VDPAU CSC-only mode.
2011-07-20 13:52:45 -04:00
Kenneth Graunke
3875526926 glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.
When parsing S-Expressions, we need to store nul-terminated strings for
Symbol nodes.  Prior to this patch, we called ralloc_strndup each time
we constructed a new s_symbol.  It turns out that this is obscenely
expensive.

Instead, copy the whole buffer before parsing and overwrite it to
contain \0 bytes at the appropriate locations.  Since atoms are
separated by whitespace, (), or ;, we can safely overwrite the character
after a Symbol.  While much of the buffer may be unused, copying the
whole buffer is simple and guaranteed to provide enough space.

Prior to this, running piglit-run.py -t glsl tests/quick.tests with GLSL
1.30 enabled took just over 10 minutes on my machine.  Now it takes 5.

NOTE: This is a candidate for stable release branches (because it will
      make running comparison tests so much less irritating.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 10:42:43 -07:00
Brian Paul
8d044047f1 mesa: remove depend files from tarballs 2011-07-19 21:11:53 -06:00
Brian Paul
4470ff2ebf glsl: silence warning in linker.cpp 2011-07-19 21:10:25 -06:00
Brian Paul
d5e3239776 st/mesa: get rid of redundant clipping code in st_copy_texsubimage() 2011-07-19 20:03:05 -06:00
Brian Paul
1c1fc62e38 mesa: remove unused dd_function_table::CopyTexImage1D/2D() hooks 2011-07-19 20:03:05 -06:00
Brian Paul
774311fb54 meta: remove _mesa_meta_CopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul
0823ef84a5 st/mesa: remove st_CopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul
9ed87c4463 radeon: remove radeonCopyTexImage2D() 2011-07-19 20:03:05 -06:00
Brian Paul
fbe6836043 intel: remove intelCopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul
1da28fa959 mesa: remove comments referring to Driver.TexImage1D/2D 2011-07-19 20:03:05 -06:00
Brian Paul
5874890c26 mesa: stop using ctx->Driver.CopyTexImage1D/2D() hooks 2011-07-19 20:03:05 -06:00
Jørgen Lind
496bf3822a Make it possible to use gbm with c++
NOTE: This is a candiate for 7.11
2011-07-19 16:30:07 -07:00
Fredrik Höglund
d84791a72b st/mesa: fix the texture format in st_context_teximage
Commit 1a339b6c71 made
st_ChooseTextureFormat map GL_RGBA with type GL_UNSIGNED_BYTE
to PIPE_FORMAT_A8B8G8R8_UNORM.

The image format for ARGB pixmaps is PIPE_FORMAT_B8G8R8A8_UNORM
however. This mismatch caused the texture to be recreated in
st_finalize_texture.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39209
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-19 15:28:43 -06:00
Brian Paul
f0e306c343 mesa: update, shorten some comments in dd.h 2011-07-19 15:28:43 -06:00
Henri Verbeet
0f20e2e18f glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
2011-07-19 23:27:46 +02:00
Chad Versace
f7dbcba280 intel: Fix stencil buffer to be W tiled
Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-19 13:12:19 -07:00
Eric Anholt
fb5ff51f42 i965: Fix regression in 29a911c50e.
The previous define was the full 32-bit header, while the new define
was just the top 16 bits.
2011-07-19 12:20:14 -07:00
Brian Paul
b38c26f19f llvmpipe: include LLVM version number in name string 2011-07-19 08:42:46 -06:00
Tobias Droste
3143e95353 llvmpipe: fix build with LLVM 3.0svn
LLVM 3.0svn introduced a new type system. It defines a new way to create
named structs and removes the (now not needed) LLVMInvalidateStructLayout
function.  See revision 134829 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-19 08:23:28 -06:00
Emil Velikov
c2426bbf86 configure.ac: Check for the respective libdrm_* when building gallium drivers
In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-19 03:13:35 +02:00
Marek Olšák
8c47a5da9f xvmc-softpipe: remove LLVM_LIBS
this is added conditionally in Makefile.xmvc

Spotted by Chris Rankin.
2011-07-18 23:41:45 +02:00
Kenneth Graunke
348bdaa529 i965: Rename CMD_VF_STATISTICS_(965|GM45) to include "3DSTATE".
Including the full "3DSTATE_VF_STATISTICS" should make it easier to
cross-reference the code and documentation.

Also, move the 965/GM45 suffix to the beginning for consistency with
newer #defines.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Kenneth Graunke
797522f1c9 i965: Rename CMD_VERTEX_(BUFFER|ELEMENT) to 3DSTATE_VERTEX_...S.
This makes our code use the same names as the documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Kenneth Graunke
29a911c50e i965: Rename 3DSTATE_DRAWRECT_INFO_I965 to 3DSTATE_DRAWING_RECTANGLE.
The documentation uses 3DSTATE_DRAWING_RECTANGLE, and we already had it
defined in brw_defines.h; we were simply using an old #define from
intel_reg.h.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Eric Anholt
cb5e0ba2aa i915: Simplify intel_wpos_* with a helper function. 2011-07-18 11:26:34 -07:00
Eric Anholt
fceda4342c i915: Include gl_FragCoord.w data, not just xyz.
Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
2011-07-18 11:26:33 -07:00
Eric Anholt
af9548d335 i915: Add support for HW rendering with no color draw buffer.
This is useful for shadow map generation.  Tested with glsl-bug-22603,
which rendered the depth textures with fallbacks before.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
debf751aea i915: Fix incorrect depth scaling when enabling/disabling depth buffers.
We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
2011-07-18 11:26:33 -07:00
Eric Anholt
79fee3a76b i915: Make stencil test for no-stencil handling match depth test.
i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
2011-07-18 11:26:33 -07:00
Eric Anholt
fc4fba52cf i915: Disable the depth test whenever we don't have a depth buffer.
We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
2011-07-18 11:26:33 -07:00
Eric Anholt
4c47fce92e i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
94efc350b4 i965: Remove i915 paths from brw_update_draw_buffers().
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
c68270a26b i965: Remove unused region calculations in brw_update_draw_buffer().
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
15af0f54b8 i965: Remove empty brw_set_draw_region.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
dd898c3e89 i965: Remove FALLBACK() from brw_update_draw_region().
The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
f34ec6169d intel: Move intel_draw_buffers() code into each driver.
The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
8cf2741d2b intel: Clarify the depthRb == stencilRb logic.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
96cdbf4340 intel: Use the post-execution batchbuffer contents for dumping.
We were missing out on all the relocation changes by dumping what we
subdata()ed in instead of what's there after the kernel finished with
it.
2011-07-18 11:26:33 -07:00
Paul Berry
f07221056e glsl: Ensure that sampler declarations are always uniform or "in" parameters.
This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-18 10:48:27 -07:00
Paul Berry
ddc1c96390 glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
2011-07-18 10:48:27 -07:00
Vadim Girlin
9b3ec69cf4 r600g: fix corner case checks for the queries 2011-07-18 08:53:47 -04:00
Henri Verbeet
3093cbaad9 r600g: Get rid of leftover PB_USAGE_* flags.
These happen to work because their values are the same as the equivalent
PIPE_TRANSFER_* flags, but it's still misleading.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-18 01:36:07 +02:00
Ian Romanick
66f4ac988d linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
2011-07-17 13:02:49 -07:00
Jeremy Huddleston
7eed3d4808 darwin: Include glxhash.c in libGL on darwin
Fixes a build regression introduced by 4df137691e

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-16 22:02:55 -07:00
Emil Velikov
55b415ff77 xvmc-nouveau: Resolve build
The following resolves the build issues and missing symbols
Add "xvmc-nouveau/target.c" - missing symbol "driver_description"
Add "drivers/nvc0/libnvc0.a" - missing symbol "nvc0_screen_create"
Remove "drivers/softpipe/libsoftpipe.a" - unnessecary dependency
resolves build (when building without swrast)
Add "drivers/trace/libtrace.a" in Makefile

Note: With/without those patches xvmc-nouveau still segfaults
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2011-07-16 11:21:48 -04:00
Christoph Bumiller
56503fd138 nv50: fix bogus error message about 3d surfaces 2011-07-16 13:00:52 +02:00
Vinson Lee
9228bfb375 gallivm: Rename createAsmInfo to createMCAsmInfo with llvm-3.0.
llvm-3.0svn r135219 renamed createAsmInfo to createMCAsmInfo in
include/llvm/Target/TargetRegistry.h.
2011-07-16 00:17:46 -07:00
Marek Olšák
7854b8cb16 xmlconfig: remove an unused-but-set variable
I hate gcc 4.6 already.
2011-07-15 21:48:29 +02:00
Marek Olšák
036fb07908 r600g: print to stderr that a CS has been rejected by the kernel
Just fixing the warning that r is unused.
2011-07-15 21:48:29 +02:00
Marek Olšák
dade65505b prog_optimize: fix a warning that a variable may be uninitialized 2011-07-15 21:48:28 +02:00
Marek Olšák
ed5e95ada6 r300/compiler: remove an unused-but-set variable and simplify the code 2011-07-15 21:48:28 +02:00
Marek Olšák
2ce6c3ea6e r300/compiler: fix a warning that a variable may be uninitialized 2011-07-15 21:48:28 +02:00
Marek Olšák
2f02c2fe56 st/mesa: remove unused-but-set variables in st_program.c 2011-07-15 21:48:28 +02:00
Marek Olšák
3032d064fb swrast: remove an unused-but-set variable 2011-07-15 21:48:28 +02:00
Marek Olšák
eca3152de0 mesa: fix unused-but-set-variable warnings in dlist.c 2011-07-15 21:48:28 +02:00
Vadim Girlin
ef29bfee03 r600g: fix queries and predication
Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.
2011-07-15 15:42:46 -04:00
Marc Pignat
cfec000e75 drisw: Fix 24bpp software rendering, take 2
This patch add the support for 24bpp in the dri/swrast implementation.
See http://bugs.freedesktop.org/show_bug.cgi?id=23525

Signed-off-by: Marc Pignat <marc at pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-15 10:09:14 -06:00
Christian König
0d082390d9 g3dvl: no need for flushing inside the compositor any more
Move that also inside the state tracker where needed.
2011-07-15 17:54:06 +02:00
Christian König
2cbf532ae1 g3dvl: correctly distinct dst area and clip area in the compositor
Otherwise xine won't scale correctly.
2011-07-15 17:36:02 +02:00
Alex Deucher
a3d23a4868 r600c/g: add new NI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-15 10:55:02 -04:00
Christian König
1cf06218e4 g3dvl: link r300 and r600 targets width libdrm instead of libdrm_radeon 2011-07-15 10:45:31 +02:00
Marek Olšák
a2381665d5 gallium/targets: link vdpau, va, and xvmc with LLVM libs when requested
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-07-15 10:31:07 +02:00
Christian König
13da00f07c g3dvl: change picture parameter of decode_bitstream to general version
Using pipe_mpeg12_picture_desc was unintentional here.
2011-07-15 10:22:51 +02:00
Younes Manton
d4be170e8b g3dvl: Build softpipe when needed. 2011-07-15 01:30:21 -04:00
Younes Manton
b97816ddee g3dvl: Build the right winsys dependencies when needed. 2011-07-15 01:12:14 -04:00
José Fonseca
864eb844ff make: Fix program/lex.yy.c & friends generation.
Not sure how this ever worked before, given that the Makefile is in
src/mesa, not src/mesa/program.
2011-07-14 17:35:05 +01:00
José Fonseca
9a7f84d6b2 Squashed commit of the following:
commit 1856230d9fa61710cce3e152b8d88b1269611a73
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Tue Jul 12 23:41:27 2011 +0100

    make: Use better var names on packaging.

commit d1ae72d0bd14e820ecfe9f8f27b316f9566ceb0c
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Tue Jul 12 23:38:21 2011 +0100

    make: Apply several of Dan Nicholson's suggestions.

commit f27cf8743ac9cbf4c0ad66aff0cd3f97efde97e4
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 14:18:20 2011 +0100

    make: Put back the tar.bz2 creation rule.

    Removed by accident.

commit 34983337f9d7db984e9f0117808274106d262110
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 11:59:29 2011 +0100

    make: Determine tarballs contents via git ls-files.

    The wildcards were a mess:
    - lots of files for non Linux platforms missing
    - several files listed and archived twice

    Using git-ls-files ensures things are not loss when making the tarballs.

commit 34a28ccbf459ed5710aafba5e7149e8291cb808c
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 11:07:14 2011 +0100

    glut: Remove GLUT source.

    Most distros ship freeglut, and most people don't care one vs the other,
    and it hasn't been really maintained.

    So it is better to have Mesa GLUT be revisioned and built separately
    from Mesa.

commit 5c26a2c3c0c7e95ef853e19d12d75c4f80137e7d
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 10:31:02 2011 +0100

    Ignore the tarballs.

commit 26edecac589819f0d0efe2165ab748dbc4e53394
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 10:30:24 2011 +0100

    make: Create the Mesa-xxx-devel symlink automatically.

    Also actually remote the intermediate uncompressed tarballs.
2011-07-14 17:35:05 +01:00
Marcin Baczyński
ff2efdf599 configure: allow C{,XX}FLAGS override
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-14 10:34:02 -06:00
Marcin Baczyński
fa013419de configure: fix gcc version check
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-14 09:54:51 -06:00
Dave Airlie
b6df603e65 vbo: minor optimisation in vbo_exec_DrawRangeElements
this moves getting the context into the debug in this function,

just spotted it trawling callgrind traces for other things.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-07-14 15:22:58 +01:00
Brian Paul
e5f7e09210 gallium: don't use enum bitfields in p_video_state.h
Silences many warnings about "type of bit-field ‘field_select’ is a
GCC extension".

Since the field sizes were 8 and 16 bits, just use basic types.
2011-07-14 08:14:14 -06:00
Brian Paul
a5a9422561 gallium: put video-related enums in separate header
The forward references to video enum types in p_context.h causes
a massive number of compiler warnings (ISO C forbids forward references
to ‘enum’ types).

By putting the new video enums in a separate header that can be included
by p_context.h and p_screen.h we can avoid this.

Acked-by Christian König <deathsimple@vodafone.de>
2011-07-14 08:14:14 -06:00
Brian Paul
9726947b68 i915g: move declaration before code 2011-07-14 08:14:13 -06:00
Brian Paul
db0f2b3637 mesa: use inline function wrapper for _mesa_reference_texobj() 2011-07-14 08:14:13 -06:00
Brian Paul
74142f1bf2 mesa: use inline function wrapper for _mesa_reference_renderbuffer() 2011-07-14 08:14:13 -06:00
Brian Paul
5db7723ada mesa: use inline function wrapper for _mesa_reference_framebuffer() 2011-07-14 08:14:08 -06:00
Brian Paul
6214963c00 main: use inline function wrapper for _mesa_reference_buffer_object() 2011-07-14 08:09:38 -06:00
Dave Airlie
323e4bff79 mesa: split _mesa_reference_program() into hot/cold paths.
inline the hotpath of the reference remaining the same. This shouldn't
penalise the slow path at all but improve the hot path so we don't have
to jump to the function.

It also moves some assert checks under an #ifndef NDEBUG.

Minor clean-ups added by Brian.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-14 08:09:38 -06:00
Christian König
8619aa5683 g3dvl: check for existense of VA API header/libs
Building the VA state tracker only works when the header/libs are available.
Also add a warning that the state tracker is currently undmaintained.
2011-07-14 15:36:34 +02:00
Christian König
33bf410ace g3dvl: check for existense of VDPAU header/libs
Building the VDPAU state tracker only works when the header/libs are available.
2011-07-14 15:36:24 +02:00
Christian König
a8ae8cf3f1 g3dvl: check for existense of XvMC header/libs
Building the XvMC state tracker only works when the header/libs are available.
2011-07-14 15:36:14 +02:00
Christoph Bumiller
7e2827fad9 nv50,nvc0: extensive surface format renaming to get consistency
Now the component ordering is consistent and matches gallium again.
2011-07-14 12:51:06 +02:00
Christoph Bumiller
b2dcf880e8 nv50,nvc0: add support for multi-sample resources 2011-07-14 12:51:06 +02:00
Christoph Bumiller
c011f94b7b nv50,nvc0: add correct storage type for Z32_FLOAT 2011-07-14 12:51:06 +02:00
Christoph Bumiller
cad17554c4 nv50,nvc0: unify nvc0_miptree and nv50_miptree structs
Share some functions and restructure miptree creation a little.
Prepare for multi-sample resources.
2011-07-14 12:51:06 +02:00
Christoph Bumiller
ebeec1d43a nv50,nvc0: don't advertise unaligned texture format support
Because we don't support them.
For instance, R32G32B32 is not R32G32B32X32 as was assumed.

Add support for R8G8B8X8_UNORM instead of R8G8B8_UNORM surfaces.
2011-07-14 12:51:06 +02:00
Vinson Lee
3cf22a0c6e g3dvl: Remove non-constant expression array initializers.
The array initializer must be a constant expression in MSVC.
2011-07-13 21:57:50 -07:00
Marek Olšák
02c8ee202f configure.ac: don't build gallium driver libs just to see if there are no errors
I think the past are those times when the gallium interface was changed all
the time. Now it is not, so there is no reason to always compile the libs
if they are not needed.
2011-07-14 03:03:26 +02:00
Marek Olšák
67aba799bc gallium/targets: do not link every driver with libllvmpipe.a
Only some targets need that, the others don't.
2011-07-14 03:03:26 +02:00
Marek Olšák
5fe54df58f Rename swrastg_dri to swrast_dri
I prefer it this way and it has been suggested earlier by others too.
Opinions?
2011-07-14 03:03:26 +02:00
Brian Paul
b82db9a3c0 softpipe: fix various warnings about int/float/double conversions, etc 2011-07-13 18:54:31 -06:00
Vinson Lee
f292d07b47 g3dvl: Remove designated initializers.
MSVC does not support designated initializers.
2011-07-13 17:00:26 -07:00
Vinson Lee
49967950a5 g3dvl: s/inline/INLINE/
The inline keyword is not available in MSVC C.
2011-07-13 15:59:08 -07:00
Emil Velikov
88d647d83b utils: Add missing parentheses
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-13 16:37:29 -06:00
Vinson Lee
3e58345794 softpipe: Remove sp_video_context.c from SConscript.
sp_video_context.c was added to SConscript in commit
ed24e19070 (pipe-video merge) but no file
of that name was added.
2011-07-13 14:50:12 -07:00
Christian König
d4cbd1272b [g3dvl] don't upload all quant buffer layers at once
There seems to be a bug in r600g when uploading more than one layer of a
3D resource at once with a hardware blit.

So just do them one at a time to workaround this.
2011-07-13 23:33:20 +02:00
Christian König
ed24e19070 Merge branch 'pipe-video' 2011-07-13 22:56:06 +02:00
Stéphane Marchesin
85e1fa5506 i915g: don't try to check if a NULL buffer is busy. 2011-07-13 11:59:10 -07:00
Stéphane Marchesin
f7a85f603b Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-07-13 11:56:44 -07:00
Vadim Girlin
4f4855b249 st/mesa: flush bitmap cache on query and conditional render boundaries
Bitmap caching shouldn't affect the results of the queries and
conditional render.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-13 11:58:29 -06:00
Christian König
a2a6799fbe [g3dvl] remove some unneeded Makefiles 2011-07-13 19:37:28 +02:00
Christian König
211887c92b r600g: reenable hardware blits for STATIC and IMMUTABLE resources
Getting the driver in sync with mainline.
2011-07-13 17:05:58 +02:00
Christian König
a0a22fead5 r600g: prevent hardware blitting based on resource usage
It doesn't make much sense for STAGING and STREAM resources to be
hardware blitted into VRAM.
2011-07-13 16:37:15 +02:00
Christian König
c5110a1bfa [g3dvl] implement workaround for missing blender clamp control
It's about 20% slower, but should at least work with every hardware.
2011-07-13 16:07:30 +02:00
Christian König
c8dd301b6f r600g: revert "set BLEND_CLAMP depending on clamp_fragment_color"
BLEND_CLAMP doesn't seems to be the right way to implement "ARB_color_buffer_float".
2011-07-13 15:54:28 +02:00
Christian König
7c48575402 [g3dvl] keep a pointer in idct buffer to idct object
So we always know to which idct object a buffer belongs
2011-07-13 15:01:40 +02:00
Chia-I Wu
5fe5d236c2 targets/egl-static: fix a linking error
rbug is always linked in and it needs libpthread.
2011-07-13 15:26:34 +08:00
Eric Anholt
556a47a262 i915: Add support for gl_FragData[0] for output color.
We advertised ARB_draw_buffers, but either fell back to software when
using this output, or assertion failed.  Fixes glsl-fs-fragdata-1, and
failures in some webgl conformance tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39024
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34906
2011-07-12 16:01:21 -07:00
Daniel Vetter
ed570cb5e5 i915g: fixup context desdruction
Reported-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-07-13 00:09:36 +02:00
Eric Anholt
f2fd0d6304 i915: Fix NPOT compressed textures on 915.
We were failing at rounding, misplacing the non-baselevels.  Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:41:04 -07:00
Eric Anholt
898be7d5ac mesa: Fix assertion failure in X8_Z24/Z24_X8 texfetch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:41:01 -07:00
Eric Anholt
6aae729d6e i915: Fix depth texturing since 86e62b2357
The 965 driver already had the X8_Z24 case, but 915 was missing it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:40:52 -07:00
Eric Anholt
9a82d89a8f i915: Use _mesa_get_format_name to describe translate_tex_format() fail.
I don't want to go count up to what format number 29 is.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-12 14:40:43 -07:00
Eric Anholt
6e6b388604 i915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.
The first rendering after context create didn't know of the color
buffer yet, triggering a sw fallback.  The intel_prepare_render() from
intelSpanRenderStart then found the buffer and turned off fallbacks,
but intelSpanRenderFinish was never called and things were left
mapped.  By checking buffers before making the call on whether to do
the fallback pipeline or not, we avoid the fallback change inside of
the rendering pipeline.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31561
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:40:39 -07:00
Eric Anholt
aceb66951d intel: Use _mesa_tex_target_to_face() helper function instead of our own.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:40:31 -07:00
Alex Deucher
5d0d8366f9 r600g: emit SQ_LDS_RESOURCE_MGMT
Need to be initialized to a reasonable value as
compute code may change it.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=39119

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-12 12:01:25 -04:00
Brian Paul
8f6c207024 u_upload_mgr: add missing offset to src map in u_upload_buffer()
Fixes regression from dda8d7ac3f
2011-07-12 09:48:01 -06:00
Emil Velikov
1ab5e15242 st/mesa: check if _mesa_create_context() returns NULL
In some cases _mesa_create_context() can return NULL an in the mesa
state tracker, we do not concider the case, which may cause issues
within st_create_context_priv()

This patch adds a simple check (similar to the one in the dri drivers)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-12 08:30:15 -06:00
Christian König
5e5d7acc2f vaapi: cleanup the source and let the st at least compile again 2011-07-12 11:08:12 +02:00
Emil Velikov
4ef9c3d21b autoconf: Do not select Xlib when building DRI
As Chia-I Wu said 'There are two libGL providers, Xlib and DRI based
they cannot coexist'

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-12 01:38:28 +02:00
Marek Olšák
c369fb42ee st/mesa: choose a matching depth internal format for DrawPixels
This makes it easier to hit the fast path and get a float format
when we ask for it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-12 01:32:23 +02:00
Christian König
efc7fda462 [g3dvl] add some more PIPE_VIDEO_CAPs 2011-07-12 00:12:12 +02:00
Ian Romanick
db311b45be configure.ac: Make --{without,with}-gallium-drivers work as expected
This version is mostly Dan's post to the mesa-dev mailing list on
6/22/2011.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-07-11 15:02:16 -07:00
Marek Olšák
2df4b6117b st/mesa: get rid of unnecessary 'goto' in DrawPixels
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-11 23:45:01 +02:00
Marek Olšák
ab4d629613 st/mesa: derive a stencil sampler format from the actual texture format
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-11 23:45:01 +02:00
Vinson Lee
1844ae7e7e gallivm: Re-enable LLVMUnionTypeKind case for llvm-2.7 only.
LLVMUnionTypeKind is not in llvm-2.6, llvm-2.8, llvm-2.9, or llvm-3.0svn.
2011-07-11 14:08:24 -07:00
Andrew Randrianasulu
a09b7f7f15 dri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE
Broken accidentally in f4efc256fd,
the switch to rnn headers.

NV10TCL_VTXFMT_TYPE_BYTE_RGBA became U8_UNORM but B8G8R8A8_UNORM
was used instead.
2011-07-11 22:12:13 +02:00
David Heidelberger
278b832b78 nvfx: handle PIPE_CAP_SM3
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2011-07-11 21:52:24 +02:00
Vinson Lee
e4189f2e2e gallivm: Remove LLVMOpaqueKindType case with llvm-3.0.
llvm-3.0svn r134829 removed LLVMOpaqueKindType from enum LLVMTypeKind in
include/llvm-c/Core.h.
2011-07-11 12:48:06 -07:00
Kenneth Graunke
7304909d65 glsl: Reject ambiguous function calls (multiple inexact matches).
According to the GLSL 1.20 specification, "it is a semantic error if
there are multiple ways to apply [implicit] conversions [...] such that
the call can be made to match multiple signatures."

Fixes a regression caused by 60eb63a855,
which implemented the wrong policy of finding a "closest" match.
However, this is not a revert, since the original code failed to
continue looking for an exact match once it found two inexact matches.

It's OK to have multiple inexact matches if there's also an exact match.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 10:53:28 -07:00
Kenneth Graunke
186e37c754 i965/gen7: Add support for gl_PointCoord.
This is exactly analogous to Eric's Gen6 change in commit
6861a70177.  His explanation:

"This is just like PointSprite overrides, but it's always on for that
 attribute."

Fixes glsl-fs-pointcoord and gtf/point_sprites.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 10:46:35 -07:00
Kenneth Graunke
147d010295 i965/gen7: Fix point sprite texture coordinate overrides.
This is exactly analogous to Eric's Gen6 change in commit
f304bb8a5d.  His explanation:

"We were assuming that the input attribute n to the FS was
 FRAG_ATTRIB_TEXn, which happened to be true often enough for our
 testcases."

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 10:46:35 -07:00
Kenneth Graunke
5edb3ddf41 i965/gen7: Refactor SF setup a bit to handle overrides in one place.
This is exactly analogous to Eric's Gen6 change in commit
e7280b16d6.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 10:46:35 -07:00
Eric Anholt
f07cfebebe i965/gen4: Add a stub dumper for CC unit state, which is different from gen6.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
f7f03fb588 i965/gen4: Add state dumping for unit state using state_batch_list[].
This is just barely more pretty-printing than we previously had, but
at least it doesn't leave out unit states in the log.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
a1226bcd20 i965/gen6: Add state dumping for the VS constants.
This is quite a bit of spam, but I think it's useful to have in a full
INTEL_DEBUG=batch dump.  And a lot of this spam on glxgears is just
because we're awful at handling our constants :/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
6e17a01e42 i965/gen6: Add state dumping for the scissor packet.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
93c7a5da11 i965: When dumping programs, dump the whole cache. But don't by default.
The previous brw_state_dump output was rather useless -- last used
program per batch, and just the hex.  Now we dump all programs (since
we don't know which were used), and disassemble them.  But that's a
ton of spam, and usually when looking into program contents we use
INTEL_DEBUG={vs,wm,misc,other} and when looking into state updates we
use INTEL_DEBUG=batch, so this dump usually just massively clutters up
the output.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
6bbaa7c0e5 i965: Dump the binding table using state_batch_list[].
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
13e82ece6d i965: Dump the surface, sampler, and sdc state using state_batch_list[].
Now, for example, INTEL_DEBUG=batch tex-border-1 shows all the
texturing state involved.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
709a7af2af i965: Dump brw_state_batch data in an easier format for cross-referencing.
Now that we're using state base addresses for most things, we're less
interested in the absolute address of the state, and more in its
offset from the state base address (start of batchbuffer).  Also,
reorder the printout so it looks more like the batchbuffer dump.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
d484667423 i965: Map the batch once for dumping all our state batch structs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
00f07b33ec i965: Move the new gen6 state structs to using state_batch_list[].
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
fbfeff73f3 i965: Move the SF VP state dump to using the state_batch_list[]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
2a8d744345 i965: Move CLIP VP state dump to using the state_batch_list[].
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
65c6de000e i965: Track the brw_state_batch() data while under INTEL_DEBUG=batch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
d375df220f i965: Add a type argument to brw_state_batch().
I want to make brw_state_dump.c handle more than just the last
statechange, so I want to keep track of what's in the batch state.  By
using AUB file numbering for most of these packets, this may be
reusable for aub dumping.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
35d5d5df72 intel: Make our context structure be a ralloc context.
This will let me hang cached compiler structs off of the context
without having to worry about cleaning them up at destroy time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Brian Paul
be8551220c configs: do not let llvm-config define NDEBUG in debug builds
Following the examples of Marek and Jose for autoconf and scons.
2011-07-11 10:07:43 -06:00
Eric Anholt
a166720f2d ir_to_mesa: typo fix in a comment. 2011-07-11 08:58:37 -07:00
Eric Anholt
46a7639174 i965: Fix fp-dst-aliasing-[12].vpfp.
There's no pretty way to avoid the overwriting of the src operands, so
just use a temporary destination and rely on the MOV optimization.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-11 08:58:37 -07:00
Eric Anholt
e3ea5bc08e i965: Fix fp-lit-src-equals-dst.
We were stomping over the source for the body of the LIT instruction
when doing the MOV of 1.0 to the uninteresting channels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-11 08:58:37 -07:00
Marek Olšák
be039d296d configure.ac: do not let llvm-config define NDEBUG in debug builds
Re-enables assertions in src/mesa.
2011-07-11 17:32:06 +02:00
José Fonseca
acf82194ce scons: Filter-out NDEBUG define from llvm-config.
Based on a similar autoconf change from Marek.
2011-07-11 15:38:06 +01:00
Christian König
df5e0b9435 [g3dvl] fix a whole bunch of memory leaks 2011-07-11 16:29:02 +02:00
Brian Paul
d60880db35 glx: add a few missing glXChooseFBConfig() attributes
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38842

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 08:02:49 -06:00
Brian Paul
bb0d5cae00 glext.h: update to version 71 2011-07-11 08:02:48 -06:00
Marek Olšák
6c53d75e7d mesa: fix assertion failure in delete_wrapper 2011-07-11 15:32:34 +02:00
Marek Olšák
ceb04b32ba mesa: add a comment in _mesa_test_formats 2011-07-11 15:18:14 +02:00
Christian König
a7ec477ebc [g3dvl] revert some unintended white space changes 2011-07-11 14:36:03 +02:00
Marek Olšák
e134eaa2c5 mesa: fix assertion failure in _mesa_test_formats
Z32_FLOAT_X24S8 has DataType of GL_NONE.
2011-07-11 14:32:32 +02:00
Christian König
3d1057f243 [g3dvl] sync SConscript with Makefile 2011-07-11 13:55:56 +02:00
Christian König
96718d98de [g3dvl] softpipe is no longer needed for dri-nouveau 2011-07-11 12:31:54 +02:00
Christian König
358795bc0b r600g: revert "support textures with scaled number formats"
We should add those probably when merged to master.
2011-07-11 11:39:11 +02:00
Christian König
d6eb1f8257 pipe-video: merge fixes 2011-07-11 11:28:23 +02:00
Christian König
e45d895824 [g3dvl] remove some stale nv40 files 2011-07-11 11:08:45 +02:00
Christian König
f8898a70df [g3dvl] remove pipe_video_context from nouveau 2011-07-11 11:06:05 +02:00
Christian König
f919547f37 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state_inlines.h
2011-07-11 10:48:59 +02:00
Marek Olšák
12265d26dd Revert "WIP r600g: depth_buffer_float renderbuffer support on evergreen"
This reverts commit 91a52dae97.

Pushed accidentally.
2011-07-11 04:17:45 +02:00
Marek Olšák
dc9d789d1b r600g: more valgrind fixes 2011-07-11 04:13:35 +02:00
Marek Olšák
daf6604435 r600g: zero memory of ioctl parameters
Fixes valgrind warning.
2011-07-11 04:01:06 +02:00
Marek Olšák
01f48a979d mesa: implement packing of DEPTH_STENCIL & FLOAT_32_UNSIGNED_INT_24_8_REV combo
Tested with the new piglit fbo-depthstencil test.
2011-07-11 03:04:17 +02:00
Marek Olšák
91a52dae97 WIP r600g: depth_buffer_float renderbuffer support on evergreen 2011-07-10 21:47:20 +02:00
Marek Olšák
d1214cca08 swrast: fix depth/stencil blits when there's no colorbuffer
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-10 21:47:20 +02:00
Marek Olšák
83478e5d59 mesa: return early if mask is cleared to zero in BlitFramebuffer
From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.
2011-07-10 21:47:20 +02:00
Marek Olšák
3414447011 docs: update GL3 status 2011-07-10 21:41:17 +02:00
Marek Olšák
89954723bf r600g: depth_buffer_float support on r600-r700 2011-07-10 21:41:17 +02:00
Marek Olšák
d9ab6712cc gallium/util: handle Z32F_FLOAT_S8X24_USCALED in pipe_tile_raw_to_rgba
And make pipe_put_tile_rgba_format no-op like the other Z formats.
2011-07-10 21:41:17 +02:00
Marek Olšák
e860cb64db gallium/util: implement software Z32F_S8X24 depth-stencil clear 2011-07-10 21:41:17 +02:00
Marek Olšák
8ff6f90c3f gallium/util: implement pack functions for Z32F and Z32F_S8X24 2011-07-10 21:41:17 +02:00
Marek Olšák
e517e5ac7c st/mesa: implement read/draw/copypixels for Z32F and Z32F_S8X24 2011-07-10 21:41:17 +02:00
Marek Olšák
adea7ea0bc st/mesa: initial ARB_depth_buffer_float support 2011-07-10 21:41:17 +02:00
Marek Olšák
ba15e8260e mesa: implement depth/stencil renderbuffer wrapper accessors for Z32F_X24S8
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
bde6a04458 mesa: implement generatemipmap for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
b2f087cd87 mesa: implement texstore for DEPTH32F_STENCIL8
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
bc878c7f8b mesa: implement texstore for DEPTH_COMPONENT32F
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
bfb63b7d62 mesa: implement depth unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
ec6fbbe36e mesa: implement stencil unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
4843c7b24a mesa: implement texfetch functions for depth_buffer_float
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:16 +02:00
Marek Olšák
1165280cbd mesa: initial ARB_depth_buffer_float support
Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there.
The spec says the type is n/a.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:16 +02:00
Vadim Girlin
f0a7e28e29 r600g: LIT: clamp negative src.y to 0
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-10 13:19:38 -04:00
Marek Olšák
d644a50dc3 st/dri: remove unused variables 2011-07-10 17:40:38 +02:00
Christian König
cd4f18089e vdpau: make capabilities query more sane 2011-07-10 14:13:08 +02:00
Christian König
3d769619e2 vdpau: implement VdpOutputSurfaceGetParameters 2011-07-10 13:48:37 +02:00
Chia-I Wu
95f9e118fe st/egl: fix linking errors
Add symbols referenced by src/glx/dri2.c.
2011-07-10 15:11:15 +08:00
Kenneth Graunke
440224ab73 intel: Recognize all depth formats in get_teximage_readbuffer.
The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
wrongly returning the color buffer instead of the depth buffer.

Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
format, which (prior to this patch) resulted in an attempt to copy
ARGB8888 to X8_Z24.

Instead of adding the missing enumeration directly, convert the code to
use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
should catch any newly added depth formats in the future.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-09 10:37:42 -07:00
Henri Verbeet
7e591111bf r600g: Get rid of some superfluous braces.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
2e53725bbc r600g: Check for Evergreen chip class instead of Cedar family in r600_context_flush().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
2b5b289a57 r600g: Store the chip class directly in r600_bc.
Instead of deriving it from the family again.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
89dc31a28d r600g: Replace the CHIPREV_* defines with the chip_class enum.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
4f7dfd8ad3 r600g: Get rid of the superfluous family field from r600_shader.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
b3b946b0ab r600g: Store the chip class in r600_pipe_context.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
949896b82f r600g: Fix the type of the family field in r600_pipe_context.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Eric Anholt
d03fdc4cde i965/gen4: Fix GPU hangs since the program streaming change.
This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-09 07:45:48 -07:00
Kenneth Graunke
57b57f6d1c i965/gen7: Remove gratuitous dirty flags from WM and PS state.
Commit b46dc45cee claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 23:24:55 -07:00
Christian König
3ed8182c76 [g3dvl] stop calling dri2DestroyDrawable
When switching channels with xine it sometimes happens that xine
destroys the drawable before we get a chance to call
DRI2DestroyDrawable, resulting in an x error.
2011-07-09 00:00:10 +02:00
Vadim Girlin
3efb47f0b0 r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin
f87d566f4b r600g: introduce r600_bc_src_set_abs helper and fix LOG
LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin
b693787fdf r600g: RSQ: clear NEG for operand
Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin
86f8b4117f r600g: LIT: swap MUL_LIT operands to fix 0^0
For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Jesse Barnes
4df137691e GLX/DRI2: handle swap event swap count wrapping
Create a new GLX drawable struct to track client related info, and add a
wrap counter to it drawable and track it as we receive events.  This
allows us to support the full 64 bits of the event structure we pass to
the client even though the server only gives us a 32 bit count.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:38:20 -07:00
Jesse Barnes
1e39fc784b DRI2/GLX: use new swap event types
Use the new swap event type so we get valid SBC values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:31:13 -07:00
Christian König
34145ecdad vdpau: add implementation of VdpDecoderGetParameters 2011-07-08 20:53:39 +02:00
Christian König
ea78480029 [g3dvl] and finally remove pipe_video_context 2011-07-08 19:22:43 +02:00
Paul Berry
067c9d7bd7 glsl: Lower break instructions when necessary at the end of a loop.
Normally lower_jumps.cpp doesn't need to lower a break instruction
that occurs at the end of a loop, because all back-ends can produce
proper GPU instructions for a break instruction in this "canonical"
location.  However, if other break instructions within the loop are
already being lowered, then a break instruction at the end of the loop
needs to be lowered too, since after the optimization is complete a
new conditional break will be inserted at the end of the loop.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_breaks_6.
2011-07-08 09:59:30 -07:00
Paul Berry
e71b4ab8a6 glsl: In lower_jumps.cpp, lower both branches of a conditional.
Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
branch.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_returns_4.
2011-07-08 09:59:30 -07:00
Paul Berry
382cee91a4 glsl: Use foreach_list in lower_jumps.cpp
The visitor class in lower_jumps.cpp never removes or replaces the
instruction being visited, but it frequently alters or removes the
instructions that follow it.  Therefore, to make sure the altered IR
is visited, it needs to iterate through exec_lists using foreach_list
rather than visit_exec_list().

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Also, certain invariants assumed by lower_jumps.cpp may fail to hold,
causing assertion failures.

Fixes unit tests test_lower_pulled_out_jump,
test_lower_unified_returns, test_lower_guarded_conditional_break,
test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:30 -07:00
Paul Berry
03145ba655 glsl: lower unconditional returns and continues in loops.
Previously, lower_jumps.cpp would only lower return and continue
statements that appeared inside conditionals.  This patch makes it
lower unconditional returns and continue statements that occur inside
a loop.

Such unconditional flow control statements would be unlikely to be
explicitly coded by a reasonable user, however they might arise as a
result of other optimizations.

Without this patch, lower_jumps.cpp might not lower certain return and
continue statements, causing some backends to fail.

Fixes unit tests test_lower_return_void_at_end_of_loop and
test_remove_continue_at_end_of_loop.
2011-07-08 09:59:30 -07:00
Paul Berry
afc9a50fba glsl: Lower unconditional return statements.
Previously, lower_jumps.cpp only lowered return statements that
appeared inside of an if statement.

Without this patch, lower_jumps.cpp might not lower certain return
statements, causing some back-ends to fail (as in bug #36669).

Fixes unit test test_lower_returns_1.
2011-07-08 09:59:30 -07:00
Paul Berry
dbaa2e627e glsl: Refactor logic for determining whether to lower return statements.
Previously, do_lower_jumps.cpp determined whether to lower return
statements in ir_lower_jumps_visitor::should_lower_jumps().  Moved
this logic to ir_lower_jumps_visitor::visit(ir_function_signature *),
so that it can be used in determining whether to lower a return
statement at the end of a function.
2011-07-08 09:59:30 -07:00
Paul Berry
e2c748aec5 glsl: Add explanatory comments to lower_jumps.cpp.
No functional change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:30 -07:00
Paul Berry
f4830be938 glsl: Make ir_reader able to read plain (return) statements.
Previously ir_reader was only able to handle return of non-void.

This patch is necessary in order to allow optimization passes to be
tested in isolation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:29 -07:00
Paul Berry
5fb79fc69f glsl: Remove unused function prototypes.
No functional change.  Remove prototypes for do_mod_to_fract() and
do_sub_to_add_neg(), which haven't existed since November 2010.
2011-07-08 09:59:29 -07:00
Christian König
4e837f557b [g3dvl] move video buffer creation out of video context 2011-07-08 16:56:11 +02:00
Gustaw Smolarczyk
fc98444bd5 gallivm: Fix build with llvm-3.0
LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067 and
92e29dc5b0 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-08 07:57:27 -06:00
Christian König
3bb33c911b [g3dvl] remove the unused priv member from pipe_video_context 2011-07-08 15:07:39 +02:00
Christian König
bd5fd67a3e [g3dvl] move compositor creation and handling directly into the state trackers 2011-07-08 14:44:19 +02:00
Marek Olšák
7de28e80dc st/mesa: handle float formats in st_format_datatype
NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-08 13:02:27 +02:00
Marek Olšák
292148dc4b st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-08 13:02:22 +02:00
Christian König
10fd45114d [g3dvl] remove sampler view handling from video context 2011-07-08 12:47:52 +02:00
Christian König
06ddbc3b8e [g3dvl] remove create_surface from video context 2011-07-08 12:15:48 +02:00
Christian König
2ec350ff1d [g3dvl] make pipe_context mandatory for creation pipe_video_context 2011-07-08 12:03:13 +02:00
Christian König
7eca76952b [g3dvl] rename is_format_supported to is_video_format_supported and move it into screen object 2011-07-08 11:20:39 +02:00
Thomas Hellstrom
a65e970603 mesa/st: Fix piglit read-front with new drawable invalidation v2
When the state tracker adds a front buffer, nothing triggers a validate
drawable call, since the state tracker manager is never notified.

Force a validate drawable call by invalidating the framebuffer's stamp, so
that the window system's renderbuffer (if any) is picked up.

This fixes bug 38988
https://bugs.freedesktop.org/show_bug.cgi?id=38988

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-08 08:37:42 +02:00
Stéphane Marchesin
8c1a2e128e i915g: Make the optimizer more generic. 2011-07-07 21:59:09 -07:00
Brian Paul
d8f65c07e9 intel: add null src pointer check in intel_region_reference()
Fixes segfault when running cubemap demo on i945.  This happened
when intel_region_reference() was called in i915_set_draw_region()
with depth_region=NULL.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 19:22:06 -06:00
Stéphane Marchesin
9baad92660 i915g: Make optimization more generic. 2011-07-07 16:57:37 -07:00
Stéphane Marchesin
3c0c624879 Revert "i915: Eliminate redundant CONSTANTS updates"
This reverts commit 87641cffd9.
2011-07-07 16:57:37 -07:00
Brian Paul
7eb7d67d50 glsl: use casts to silence warning 2011-07-07 17:28:48 -06:00
José Fonseca
61efad6865 scons: Generate libGL.so.1.5 and libGL.so.1 symlinks.
In build/xxx/src/gallium/targets/libgl-xlib/SConscript
2011-07-07 23:41:06 +01:00
Eric Anholt
066bee64e1 intel: Fix use of freed buffer if glBitmap is called after a swap.
Regions looked up from the framebuffer are invalid after
intel_prepare_render().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266
Tested-by: Thomas Jones <thomas.jones@utoronto.ca>
2011-07-07 14:43:44 -07:00
Eric Anholt
a7a2704ab4 intel: Remove dead comment about software clears -- it's handled just above. 2011-07-07 14:43:44 -07:00
John
f39476b234 i915: Fix leak of ViewportMatrix data on context destroy.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
2011-07-07 14:43:44 -07:00
Eric Anholt
007c2d6cd2 intel: Remove gratuitous context checks in intel_delete_renderbuffer().
Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:43:44 -07:00
Eric Anholt
c7ef5e8498 intel: Remove now trivial intel_renderbuffer_set_{hiz_,}region().
As a result of this cleanup, a bug in
intel_process_dri2_buffer_no_separate_stencil() became quite apparent.
We were associating the NULL pointer after an unreference with the
STENCIL attachment -- clarify the logic and attach the right region.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:42:47 -07:00
Eric Anholt
b904321ed0 intel: Rely on intel_region_reference()'s support of *dst != NULL.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:05:20 -07:00
Eric Anholt
036b74a7f8 intel: Allow intel_region_reference() with *dst != NULL.
This should help us avoid leaking regions in region reference code by
making the API more predictable.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:05:20 -07:00
Eric Anholt
86e62b2357 intel: Mark MESA_FORMAT_X8_Z24 as always supported.
This prevents developer surprise at seeing a GL_DEPTH_COMPONENT
texture have stencil bits, and avoids the metaops path accidentally
copying stencil bits around in glCopyTexImage(GL_DEPTH_COMPONENT) (and
being broken because swrast's glReadPixels(GL_UNSIGNED_INT_24_8) is
broken).

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:05:20 -07:00
Christian König
f265a19426 [g3dvl] rename get_param to get_video_param and move into screen object 2011-07-07 22:51:45 +02:00
Kenneth Graunke
3de9405763 i965: Remove unused structures for command packets.
We simply emit these using OUT_BATCH and bitshifting, as it results in
better compiled code than packed structures.  Since our documentation
is public, it's not terribly useful to keep these around for reference.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
247e4c69ce i965: Convert system instruction pointer to OUT_BATCH style.
Also rename it from CMD_STATE_INSN_POINTER to CMD_STATE_SIP to match the
documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
87de78523a i965: Convert PIPELINE_SELECT to OUT_BATCH style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
473a519d20 i965: Emit 3DSTATE_VF_STATISTICS in OUT_BATCH style.
This is a little different from most because it's a single DWord;
there's no length field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
a68c5e6b71 i965: Convert 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP to OUT_BATCH style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Henri Verbeet
e01e30b916 mesa: Fix the BindSampler unit limit.
I'm not sure about this one. The current code actually follows the spec, but
considering the spec is supposed to be written against GL 3.2 I'd say the spec
is broken. I filled out a spec feedback form over a month ago, but either the
form is broken, or nobody cares.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
bfe284fd26 mesa: Fix a couple of TexEnv unit limits.
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
4744195628 mesa: Use the Elements macro for the sampler index assert in validate_samplers().
This is probably nicer if the array size ever changes.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
86adc2b29e mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.
The total number of units used by a shader is limited to MAX_TEXTURE_UNITS,
but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS,
since they're shared between vertex and fragment shaders.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
2e35d90fb9 mesa: Check the texture against all units in unbind_texobj_from_texunits().
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Christoph Bumiller
3069a7eaa5 nv50,nvc0: use screen instead of context for flush notifier
Context may become NULL and we still have to be able to flush
pending fences.
2011-07-07 15:00:12 +02:00
Christoph Bumiller
e54354e885 nv50: more formats for nv50_resource_copy_region conversion path
It's not supposed to do conversion, but st sometimes asks us to.
Sometimes conversion is even wrong (e.g. between UNORM and SRGB).

This should now include all formats the 2D engine supports.
2011-07-07 15:00:12 +02:00
Stéphane Marchesin
f934c80faf i915g: Apply optimization to ADDS/MUL and only if we're not saturating. 2011-07-07 01:47:33 -07:00
Thomas Hellstrom
1b23d4c9a5 st/xa: Fix up error reporting. Disable component alpha.
Component alpha is temporarily disabled since it seems a bit buggy.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-07 10:21:48 +02:00
Thomas Hellstrom
568d99cc6c st/xa: Fix render to xa_format_a8, which is backed by a gallium L8 texture
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-07 10:21:48 +02:00
Brian Paul
7a10976adb i915g: move code after declaration 2011-07-06 18:10:00 -06:00
Ian Romanick
d32d4f780f linker: Assign locations for fragment shader output
Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test.  The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs.  As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts.  The problem is
dealing with generic outputs that lack a layout qualifier.  There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
2011-07-06 16:59:34 -07:00
Ian Romanick
174cef7fee glsl: Don't choke when printing an anonymous function parameter
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-06 16:41:34 -07:00
Ian Romanick
dbda466fc0 ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-06 16:41:34 -07:00
Ian Romanick
0eb9797958 glsl: Track initial mask in constant propagation live set
The set of values initially available (before any kills) must be
tracked with each constant in the set.  Otherwise the wrong component
can be selected after earlier components have been killed.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Matthias Bentrup <matthias.bentrup@googlemail.com>
2011-07-06 16:41:34 -07:00
Stéphane Marchesin
31484b068d i915g: Fix optimize so that it actually gets used. 2011-07-06 14:18:24 -07:00
Brian Paul
b786db0654 mesa: fix texstore addressing bugs for depth/stencil formats
Using GLuint pointers worked when the pixel size was four bytes
or the row stride was a multiple of four but was otherwise broken.
Fixes failures found with the piglit fbo-stencil test.

This helps to fix https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch.
2011-07-06 15:14:47 -06:00
Brian Paul
057a107d44 softpipe: add missing stencil format case in convert_quad_stencil()
Part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch
2011-07-06 15:14:27 -06:00
Brian Paul
2ea7b374f6 tgsi: add some debug/print code in exec_tex(), disabled 2011-07-06 15:14:27 -06:00
Brian Paul
88349255ce softpipe: minor clean-ups in sp_quad_depth_test.c 2011-07-06 15:14:27 -06:00
Stéphane Marchesin
053af6ac8c i915g: Fix optimization, also make it more generic. 2011-07-06 12:00:47 -07:00
Eric Anholt
07e5295b6f mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)
The existing error result doesn't appear in the GL 2.1 or 3.2
compatibility specs, and triggers an unexpected GL error in Intel's
oglconform when it tries to reset the feedback state after usage so
that the "diff the state at error time vs. context init time" code
doesn't generate spurious diffs.  The unexpected GL error then
translates into testcase failure.  Brian wants the safety check on
buffer = NULL, though, so that people can't as easily set up a broken
buffer.
2011-07-06 11:17:20 -07:00
Eric Anholt
c9aac11713 mesa: Don't skip glGetProgramLocalParam4dvARB if there was already an error.
Like the previous commit, but fixes
ARB_vertex_program/getlocal4d-with-error.

v2: Move the success case line into the conditional, use ASSIGN_4V more.
2011-07-06 11:17:19 -07:00
Eric Anholt
e9d563e3ff mesa: Don't skip glGetProgramEnvParam4dvARB if there was already an error.
Fixes a bug caught by oglconform, and now piglit
ARB_vertex_program/getenv4d-with-error.  The wrapping of an existing
GL function made it so that we couldn't distinguish an error in
looking up our arguments from an existing error.  Instead, make a
helper function to choose the param, and use it from multiple callers.

v2: Move the success case line into the conditional, use COPY_4V more.
2011-07-06 11:17:19 -07:00
Eric Anholt
b043409adf glsl: Suppress warning from matching_signature change.
gcc isn't smart enough to see that we only look at matched_score after
we've initialized it (because match != NULL happens at the same time)
2011-07-06 11:17:19 -07:00
Eric Anholt
abbbd14dd4 glsl: Fix make clean for dricore. 2011-07-06 11:17:19 -07:00
Kenneth Graunke
eafc74d7d4 i965/fs: Fix message register allocation in FB writes.
Commit 6750226e6d bumped the base MRF to
m2 instead of m0, but failed to adjust inst->mlen, which was being set
to the highest MRF.  Subtracting the base MRF solves the issue.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2011-07-06 11:12:17 -07:00
Völgyes Dávid
f747d03b1d Fixes for leaks reported by cppcheck. 2011-07-06 10:11:04 -04:00
Stéphane Marchesin
e53b41f263 i915g: Improve flushing using heuristics. 2011-07-06 02:49:58 -07:00
Stéphane Marchesin
2bc5e0e97b i915g: introduce the tiny shader optimizer. 2011-07-06 02:49:48 -07:00
Stéphane Marchesin
cc78eb63cd i915g: Add comment about DDX/DDY. 2011-07-06 02:17:30 -07:00
Stéphane Marchesin
26e7436ad3 i915g: Move back to the old method for target format fixup. 2011-07-06 02:17:30 -07:00
Vadim Girlin
6bde225b8b r600g: fix buffer overflow check in r600_query_begin 2011-07-05 15:57:11 -04:00
Vadim Girlin
971e1b743e r600g: fix bo map usage flags in r600_query_begin 2011-07-05 15:57:08 -04:00
Vadim Girlin
fbe9d4261f r600g: reduce flushes for queries 2011-07-05 15:57:06 -04:00
Vadim Girlin
9bf4c30d73 r600g: fix buffer offset in r600_query_begin 2011-07-05 15:57:01 -04:00
Henri Verbeet
3fccc14b2f r600g: Get rid of the state_inlines headers.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:47 +02:00
Henri Verbeet
88cf65a600 r600g: Get rid of an unused include in r600_texture.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Henri Verbeet
4015b5877c r600g: Get rid of some unused functions.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Henri Verbeet
18cdb9c8ab r600g: Use the actual Evergreen functions to query format support on Evergreen.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Henri Verbeet
865f927218 r600g: Get rid of the unused "family" parameter to r600_is_vertex_format_supported().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Christian König
c3b2230b71 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/tests/trivial/Makefile
	src/gallium/winsys/g3dvl/dri/XF86dri.c
	src/gallium/winsys/g3dvl/dri/driclient.c
	src/gallium/winsys/g3dvl/dri/driclient.h
	src/gallium/winsys/g3dvl/dri/xf86dri.h
	src/gallium/winsys/g3dvl/dri/xf86dristr.h
	src/gallium/winsys/r600/drm/r600_bo.c
2011-07-04 15:04:41 +02:00
José Fonseca
f67de2ed46 draw: Fix fetch_max calculation.
It should be

 max_index = start + count - 1

instead of

 max_index = count - 1
2011-07-04 12:31:30 +01:00
Thomas Hellstrom
424b1210d9 Merge branch 'xa_branch'
Conflicts:
	configure.ac

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 10:21:35 +02:00
Thomas Hellstrom
a221807dc5 st/glx: Fix endless loop in drawable validation
This fixes a regression introduced with commit

"st-api: Rework how drawables are invalidated v3"

where the glx state tracker manager would invalidate a drawable each time it
checks the drawable dimensions, even during a validate call, which
resulted in an endless loop, since the state tracker would immediately
detect the new invalidation and rerun the validate...

This change marks the drawable invalid only if the drawable dimensions actually
changed during the validate, which will result in at most a single
unnecessary validate by the context running a validate during which the
dimensions changed.

To avoid unnecessary validates altogether, we need to implement yet another
st-api change: Returning the current time stamp from the validate function,
as suggested by Chia-I Wu. The glx state tracker manager could then return
the stamp resulting from the last drawable dimension check.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 09:56:45 +02:00
Thomas Hellstrom
f81ac1840a st/xa: Fix crosscompile builds with nonstandard ld locations
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 09:55:51 +02:00
Thomas Hellstrom
a2a5ba5145 xa-vmwgfx: Remove unnecessary include
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 09:55:40 +02:00
Henri Verbeet
39fecd3229 r600g: Support the PIPE_FORMAT_R16_FLOAT colorformat.
NOTE: This is a candidate for the 7.11 branch.
2011-07-03 23:03:07 +02:00
Benjamin Franzke
7ed1826e2e configure: Require libudev for drm & wayland egl platforms
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 14:01:07 +02:00
Benjamin Franzke
9b8cd49930 configure: Fix typo in gbm check for egl drm platform
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 14:00:55 +02:00
Benjamin Franzke
b18b2994ef configure: Enable st/gbm if st/egl has drm platform
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 13:56:27 +02:00
Benjamin Franzke
b2d6375e6a egl_dri2: Fix compilation if udev devel files are not installed
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 13:56:27 +02:00
Chia-I Wu
f2001df508 egl: add copyright notices
The list of copyright holders could be incomplete.  Please update
directly or notify me if your name is missing.
2011-07-02 18:21:31 +09:00
Chia-I Wu
8123934d5a autoconf: swrast does not require libdrm
This fixes

  $ ./configure --disable-driglx-direct \
                --with-dri-drivers=swrast \
                --with-gallium-drivers=
2011-07-02 10:15:23 +09:00
José Fonseca
b115662607 scons: Disable saving options automatically.
It makes things too random, as settings for temporary trials get stored
permannently, and it make difficult to build several platforms from the
same tree.

So disable it, again.
2011-07-01 19:04:57 +01:00
José Fonseca
1c59ea9592 svga: Use the correct element size.
Instead of always using the first element's size.

This fixes flashing floor on CINEBENCH R10.
2011-07-01 18:32:42 +01:00
José Fonseca
dda8d7ac3f u_upload_mgr: Use pipe_buffer_map_range istead of pipe_buffer_map.
pipe_buffer_map_range makes stricter assertions, and would have saved us
grief detecting a bug in svga user buffer uploads.
2011-07-01 18:32:40 +01:00
Micael Dias
7d39ff44a2 Gallium: fix buffer overflow
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-07-01 18:12:37 +01:00
Kristian Høgsberg
ad90f4cab4 driclient: Remove
Not used or maintained.  We talked about removing it a few releases ago,
there were no objections but it just never happened.  Now it's gone.
2011-07-01 09:36:46 -04:00
José Fonseca
4482eba9b2 scons: Actually add src/glx/SConscript. 2011-07-01 13:51:39 +01:00
Thomas Hellstrom
542194251c svga: Fix multiple uploads of the same user-buffer.
If a user-buffer was referenced twice by a draw command, the affected ranges
were uploaded separately, with only the last one being referenced by the
hardware. Make sure we upload only a single range.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:41 +02:00
Thomas Hellstrom
a8cf4b6acf svga: Ignore redefine_user_buffer calls
We currently always treat contents of user-buffers as volatile so
we don't need to take any particular action when the state tracker
announces that the contents has changed.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:40 +02:00
Brian Paul
762518d26a svga: fix incorrect user buffer size computation for instance divisor case
See preceeding commit for more info.
2011-07-01 13:30:40 +02:00
Brian Paul
fa4bd30212 svga: fix incorrect user buffer size computation
Viewperf uses some unusual vertex arrays where the stride is less
than the element size.  In this case, the stride was 4 while the
element size was 12.  The difference of 8 bytes causes us to miss
uploading the tail bit of the array data.

Typically the stride is >= the element size so there was no problem
with other apps.
2011-07-01 13:30:39 +02:00
José Fonseca
bd00fb2c06 svga: Handle null buffers in svga_buffer_is_user_buffer(). 2011-07-01 13:30:38 +02:00
Thomas Hellstrom
2b301df4aa gallium/svga: Upload only parts of user-buffers that we actually use
Stream user buffer contents rather than trying to maintain persistent
host / hardware copies.
Resulting negative array offsets are not allowed by the hardware,
(well, at least not according to header files), so adjust index bias
to make all array offsets positive.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:38 +02:00
Thomas Hellstrom
0277df86df gallium/svga: Make use of u_upload_flush().
This enables us to pack more data into single upload buffers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:37 +02:00
Thomas Hellstrom
cf4cd8592a gallium/util: Upload manager optimizations
Make sure that the upload manager doesn't upload data that's not
dirty. This speeds up the viewperf test proe-04/1 a factor 5 or so on svga.

Also introduce an u_upload_unmap() function that can be used
instead of u_upload_flush() so that we can pack
even more data in upload buffers. With this we can basically reuse the
upload buffer across flushes.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:36 +02:00
José Fonseca
6d58029bf0 svga: Flush when switching between HW to SW TNL, after updating need_swtnl.
Also, only flush when going from HW TNL to SW TNL, given it is impossible
for the buffers resulting from SWTNL to be ever referred by HW TNL path.
2011-07-01 13:30:36 +02:00
Chia-I Wu
c250363022 egl: fix a compiler warning 2011-07-01 18:28:56 +09:00
Chia-I Wu
bf04d9eebf st/egl: fix a typo
Wrong goto labels.
2011-07-01 18:28:46 +09:00
Chia-I Wu
c0b0e71148 st/egl: remove unused header 2011-07-01 18:19:31 +09:00
Chia-I Wu
94ec5fd1b3 autoconf: fix --disable-glx
libdrm is used in multiple places.  Always check for it and set
have_libdrm.  Each user can then check the variable.

This is useful when only EGL and DRI drivers are needed.
2011-07-01 17:46:27 +09:00
Chia-I Wu
5029ea4d9c autoconf: fix --disable-dri
Define GLX_INDIRECT_RENDERING and GLX_DIRECT_RENDERING when $enable_glx,
not $enable_dri.
2011-07-01 17:46:27 +09:00
Chia-I Wu
9e7a4147c7 autoconf: add --enable-{dri,glx,osmesa}
The idea is that DRI driver, libGL and libOSMesa are libraries that can
be independently enabled, yet --with-driver does not allow us to easily
do that, if not impossible.  This also matches what
--enable-{egl,xorg,d3d1x} do for the respective libraries.

There are two libGL providers: Xlib-based and DRI-based.  They cannot
coexist.  To be able to choose between them, --enable-xlib-glx is also
added.

With this commit, --with-driver=dri can be replaced by

  $ ./configure --enable-dri --enable-glx --disable-osmesa

--with-driver=xlib can be replaced by

  $ ./configure --disable-dri --enable-glx --enable-osmesa \
                --enable-xlib-glx

and --with-driver=osmesa can be replaced by

  $ ./configure --disable-dri --disable-glx --enable-osmesa

Some combinations that cannot be supported with --with-driver will
produce errors at the moment.  But in the future, we would like to
support, for example,

  $ ./configure --enable-dri --disable-glx --enable-egl
  (build libEGL and DRI drivers, but not libGL)

Note that this commit still keeps --with-driver for transitional
purpose.
2011-07-01 17:46:27 +09:00
Vinson Lee
f8fcaf0215 gallivm: Pass in CPU name to createTargetMachine when on llvm-3.0.
llvm-3.0svn revision 134127 changed createTargetMachine to take in
an additional argument of the CPU name.
2011-06-30 15:48:41 -07:00
Vinson Lee
b61e56756c gallivm: Rename TargetInstrDesc to MCInstrDesc when using llvm-3.0.
llvm-3.0svn revision 134021 renamed TargetInstrDesc to MCInstrDesc.
2011-06-30 15:07:57 -07:00
Marek Olšák
47362c2a61 docs: add GL3 GLX todo 2011-06-30 22:54:42 +02:00
Vadim Girlin
61c976c3cc r600g: fix check for empty cs 2011-06-30 16:39:08 -04:00
Marek Olšák
9e9d73ef10 docs: update GL3 status - vertex textures
They work fine on r600g.
2011-06-30 21:40:29 +02:00
José Fonseca
235225ec93 scons: Expose pkg-config in a simpler manner. 2011-06-30 17:36:37 +01:00
José Fonseca
2699fce0d6 scons: Buid libGL.so (WIP). 2011-06-30 11:34:51 +01:00
José Fonseca
0edb40cb69 scons: Make declaration-after-statement and pointer-arith just warnings.
Necessary, in order to build the whole tree.
2011-06-30 10:43:57 +01:00
Stéphane Marchesin
a9cb01f355 i915g: Implement surface format fixup without adding an extra instruction.
We also avoid writing output color twice, which might not work when we run out of phases.
2011-06-30 02:13:28 -07:00
Stéphane Marchesin
2adf02b456 i915g: update TODO. 2011-06-29 21:59:01 -07:00
Chia-I Wu
3e3df5fcd1 target/egl-static: fix a compiler warning 2011-06-30 10:23:50 +09:00
Stéphane Marchesin
5d7609715a i915g: Try to do better in the shader compiler.
- Copy i915c's support for phases, that should allow us to run a coupe more shaders.
- Fix the error messages.
- Still try to proceed when we get a shader that's too long.
2011-06-29 16:54:29 -07:00
Stéphane Marchesin
5349b95920 Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our stage. 2011-06-29 16:54:28 -07:00
Kenneth Graunke
578f6a9534 glsl: Don't use MOD_TO_FRACT lowering on GLSL 1.30's % operator.
MOD_TO_FRACT was designed to lower the GLSL 1.20 mod() function, which
operates on floating point values.  However, we also use ir_binop_mod
for GLSL 1.30's % operator, which operates on integers.

For now, make MOD_TO_FRACT only apply to floating-point mod operations.
In the future, we may want to add a lowering pass for integer-based mod.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
ed92b91212 glsl: Fix DIV_TO_MUL_RCP lowering for uint result types.
f2i results in an int/ivec; we need i2u to get a uint/uvec.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
8eb9753944 glsl: Distinguish "type mismatch" error messages for modulus operator.
Previously, it would simply say "type error" in three different cases:
- The LHS is not an integer
- The RHS is not an integer
- The LHS and RHS have different base types (int vs. uint)

Now the error messages state the specific problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
60eb63a855 glsl: Find the "closest" signature when there are multiple matches.
Previously, ir_function::matching_signature had a fatal bug: if a
function had more than one non-exact match, it would simply return NULL.

This occured, for example, when looking for max(uvec3, uvec3):
- max(vec3, vec3)   -> score 1 (found first)
- max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
- max(uvec3, uvec3) -> score 0 (exact match...the right answer)

This did not occur for max(ivec3, ivec3) since the second match found
was an exact match.

The new behavior is to return a match with the lowest score.  If there
is an exact match, that will be returned.  Otherwise, a match with the
least number of implicit conversions is chosen.

Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
6b1ba7ccef glsl: Use i2u and u2i to implement constructor conversions.
Inspired by a patch from Bryan Cain <bryancain3@gmail.com>.

Fixes piglit tests:
- ctor-int-uint.vert
- ctor-ivec4-uvec4.vert
- ctor-uint-int.vert
- ctor-uvec4-ivec4.vert

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
b633ddeb9f i965/fs: Implement new ir_unop_u2i and ir_unop_i2u opcodes.
No MOV is necessary since signed/unsigned integers share the same
bit-representation; it's simply a question of interpretation.  In
particular, the fs_reg::imm union shouldn't need updating.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Kenneth Graunke
006d5a1aa4 ir_to_mesa: "Support" u2f, i2u, and u2i operations by doing nothing.
Mesa IR actually stores all numbers as floating point, so this is
totally a farce, but we may as well keep it going.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Kenneth Graunke
3283e362e3 glsl: Revert "fix conversions from uint to bool and from..."
Reverts commit f41e1db327
"fix conversions from uint to bool and from float/bool to uint"

f2i, b2i, and b2i should not accept uint types.  Use i2u and u2i.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Bryan Cain
20ef96c7ff glsl: Add ir_unop_i2u and ir_unop_u2i operations.
These are necessary to handle int/uint constructor conversions.  For
example, the following code currently results in a type mismatch:

int x = 7;
uint y = uint(x);

In particular, uint(x) still has type int.

This commit simply adds the new operations; it does not generate them,
nor does it add backend support for them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Eric Anholt
4f799e6142 glsl: Use the default values of ir_assignment() in lower_mat_op_to_vec.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:10:43 -07:00
Eric Anholt
e617a53a74 glsl: Allow ir_assignment() constructor to not specify condition.
We almost never want to specify a condition, and when we do we're
already thinking about it (because we're writing a lowering pass
generating the condition), so a default argument should make the code
more pleasant to read.

NOTE: This is a candidate for the 7.11 branch (we want to be able to
cherry-pick future code).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:10:03 -07:00
Eric Anholt
487dd96c27 glsl: Avoid making a temporary for lower_mat_op_to_vec if not needed.
Our copy propagation tends to be bad at handling the later array
accesses of the matrix argument we moved to a temporary.  Generally we
don't need to move it to a temporary, though, so this avoids needing
more copy propagation complexity.

Reduces instruction count of some Unigine Tropics and Sanctuary
fragment shaders that do operations on uniform matrix arrays by 5.9%
on gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:54 -07:00
Eric Anholt
8fad8637ef glsl: Make lower_mat_op_to_vec track derefs, not variables.
We were constrained to using temporaries because we were assuming
variables all over.  This simplifies things a bit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:47 -07:00
Eric Anholt
408377aed1 glsl: Rename lower_mat_op_to_vec operands/results to be less hungarian.
This awkward typing was to avoid shadowing the function argument (the
matrix) with the temporary deref (the column) before the
get_column()/get_element()s were moved into the expression/assignment
constructors.  They're about to become not-variables, so the current
names had to go.  This change is almost mechanical (other than
column_expr), so it should make the next diff clearer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:32 -07:00
Eric Anholt
a47fd5c27d glsl: Move get_{column,element} to expression args.
I think this makes the code more obvious by moving the declarations to
their single usage (now that we aren't using them to get at the ->type
field for expression constructors).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:27 -07:00
Eric Anholt
e75b5954db glsl: Drop explicit types of lower_mat_op_to_vec expressions.
The constructor can figure it out for us these days.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:08 -07:00
Adam Jackson
d44f821213 drisw: Remove cargo culting that breaks GLX 1.3 ctors
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:19 -04:00
Adam Jackson
4833104718 glx: Verify that drawable creation on the client side actually worked
... and clean up if it didn't.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:19 -04:00
Adam Jackson
9e2bc5d4b0 glx: Alias glXFreeContextEXT to glXDestroyContext
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:18 -04:00
Kenneth Graunke
5ddc518401 i965/gen7: Add missing ! to brw->gs.prog_active assertion.
A typo in commit c173541d97 accidentally removed the !.
It's supposed to assert that there is _not_ an active GS program.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38762

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 10:57:55 -07:00
Brian Paul
e17f2bad3a mesa: bump version to 7.12 (devel) 2011-06-29 07:38:10 -06:00
Brian Paul
600e01e758 configs: add libdrm cflags to linux-llvm config 2011-06-29 07:38:10 -06:00
Jon TURNEY
8f0a331040 i915g: Move definition of M_PI in i915_fpc_translate.c
Move defintion of M_PI (for the benefit of <math.h> which do not define it), to
before the first use of it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-29 14:29:26 +01:00
Brian Paul
475685ce50 st/mesa: s/tex_usage/bindings/ in st_format.h
Just be consistent with the .c file.
2011-06-29 07:23:47 -06:00
Emil Velikov
9b5c538726 st/mesa: Use correct internal target
Commit 1a339b6c(st/mesa: prefer native texture formats when possible)
introduced two new arguments to the st_choose_format() functions.
This patch fixes the order and passes the correct internal_target
rather than GL_NONE

NOTE: This is a candidate for the 7.11 branch
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-29 07:18:32 -06:00
Thomas Hellstrom
5d2fad5444 st/glx: Fix compilation error
Fix compilation error due to commit
"Rework how drawables are invalidated v3"

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 15:03:52 +02:00
Andre Maasikas
19789e403c st/mesa: fix overwriting gl_format with pipe_format since 9d380f48
fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-29 06:52:45 -06:00
Thomas Hellstrom
ade9f0d727 st/dri: Get rid of the evil struct dri_drawable::context member
It's incorrect to assume a single context bound to a drawable.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 12:48:59 +02:00
Thomas Hellstrom
ac8fdbc1c7 st-api: Rework how drawables are invalidated v3.
The api and the state tracker manager code as well as the state tracker code
assumed that only a single context could be bound to a drawable. That is not
a valid assumption, since multiple contexts can bind to the same drawable.

Fix this by making it the state tracker's responsibility to update all
contexts binding to a drawable

Note that the state trackers themselves don't use atomic stamps on
frame-buffers. Multiple context rendering to the same drawable should
be protected by the application.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 12:48:59 +02:00
Stéphane Marchesin
1a7e17e44a i915g: Fix unimplemented Abs comment. 2011-06-29 01:23:44 -07:00
Stéphane Marchesin
4e6120576f i915g: If we have a program, that means the other fields are ours and we can free them.
Otherwise they probably belong to draw.
2011-06-28 20:42:39 -07:00
Stéphane Marchesin
c66877c290 i915g: Don't overflow the program buffer.
Otherwise it corrupts other fields of the struct and hilarity ensues.
2011-06-28 20:42:38 -07:00
Stéphane Marchesin
dd691032c8 i915g: Update the TODO with another idea. 2011-06-28 20:42:38 -07:00
Paul Berry
3097715d41 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 14:00:20 -07:00
Paul Berry
9c4445de6e glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 13:57:03 -07:00
Paul Berry
b078aad8ab glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
2011-06-28 13:49:11 -07:00
Stéphane Marchesin
fe36bc0c41 i915g: Fix comment about sin/cos constants. 2011-06-28 12:07:11 -07:00
Stéphane Marchesin
bd1ee76442 i915g: Fix staging texture uploads a bit.
They still look corrupted, but at least now they don't look tiled any more.
2011-06-28 12:05:28 -07:00
Eric Anholt
a09c5c2e30 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
2011-06-28 10:17:39 -07:00
Eric Anholt
cd7bfd5d44 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
2011-06-28 10:17:39 -07:00
Alan Hourihane
6479922499 glx: Check HAVE_XF86VIDMODE before adding it as an implicit link
library.
2011-06-28 17:41:39 +01:00
Jon TURNEY
db78643182 Don't use -fvisibilty=hidden on cygwin
All it's going to do is generate lots and lots and lots of
'warning: visibility attribute not supported in this configuration; ignored'
warnings

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-06-28 17:07:02 +01:00
Jon TURNEY
560f76227c Fix config check that claims to test if CXX supports -fvisibility=hidden option to actually test the C++ compiler.
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-06-28 17:06:59 +01:00
Stéphane Marchesin
de33b0dd23 i915g: Add a debug_printf when we get the Abs flag. 2011-06-28 02:14:43 -07:00
Stéphane Marchesin
2e481e5fc4 i915g: Support PIPE_FORMAT_B10G10R10A2_UNORM. 2011-06-28 01:41:57 -07:00
Stéphane Marchesin
062a1e291f i915g: Improve SIN/COS a bit. 2011-06-28 00:59:41 -07:00
Stéphane Marchesin
77896b256a i915g: When emulating LUMINANCE8 and INTENSITY8 texutres, route alpha properly.
That fixes some formats in fbo-alphatest-formats.
2011-06-28 00:59:40 -07:00
Stéphane Marchesin
6f62a25448 i915g: fix shadow compare.
"Works" as well as i915c now.
2011-06-28 00:59:40 -07:00
Chia-I Wu
24137afb31 targets/egl-static: fix library search order
Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.
2011-06-28 15:25:00 +09:00
Chia-I Wu
aa281dd392 st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
2011-06-28 15:07:30 +09:00
Stéphane Marchesin
a2537bbc95 i915g: Enable GL_ARB_instanced_arrays. 2011-06-27 19:27:58 -07:00
Stéphane Marchesin
8dd1e3670f i915g: Fix a bug in facing.
However doesn't work because of limitations in the draw module.
2011-06-27 18:29:50 -07:00
Ben Widawsky
6750226e6d i965: step message register allocation
The system routine requires m0 be reserved for saving off architectural
state. Moved the allocation to start at 2 instead of 0.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-27 14:21:22 -07:00
Ian Romanick
d2c6cef18a glsl: Fix depth unbalancing problem in if-statement flattening
Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-27 14:00:14 -07:00
Stéphane Marchesin
c191c87c81 i915g: Remove unused cbuf_dirty. 2011-06-27 02:08:44 -07:00
Stéphane Marchesin
e2422f77a2 i915g: Add a comment about a bug. 2011-06-27 02:06:00 -07:00
Stéphane Marchesin
ef3dac2aff i915g: initial support for SEMANTIC_FACE.
Doesn't work yet, see TODO.
2011-06-27 02:06:00 -07:00
Stéphane Marchesin
4887e1c31a i915g: update TODO. 2011-06-27 02:06:00 -07:00
Stéphane Marchesin
9d29d48bb0 i915g: Return the max result for the fake occlusion queries. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
b13865e694 i915g: Fix depth texture formats.
Depth compare still looks broken though.
2011-06-27 02:05:59 -07:00
Stéphane Marchesin
a8ebc5400e i915g: Fix u_blitter comment. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
811963a7ae i915g: Implement fake DDX/DDY. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
d2f05283d2 i915g: Fix gl_FragCoord. 2011-06-27 02:05:58 -07:00
Benjamin Franzke
992680c8b4 egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
2011-06-27 10:25:12 +02:00
Thomas Hellstrom
69140b719b st/xa: Update README.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:23:37 +02:00
Thomas Hellstrom
9a0c5b4634 st/xa: Add a function to check for supported formats
Typically this was done by having a surface creation function fail if
the format was not supported.
However, in some situations when changing hardware surface formats,
it's desirable to do this check before attempting costly readback operations.

Also updated the surface_redefine interface.

Bump minor.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:14:39 +02:00
Thomas Hellstrom
ab3587f70d st/xa: Various fixes for composite.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:14:34 +02:00
Chia-I Wu
3a07d9594a st/d3d1x: fix for st/egl native.h interface change
The interface was changed in 73df31eedd.
2011-06-27 12:20:52 +09:00
Marek Olšák
618dbc8130 configure.ac: sort Gallium directories alphabetically 2011-06-27 03:12:57 +02:00
Chia-I Wu
a1cadf2b5c targets/egl-static: fix building without libudev
Thanks to José for pointing out.
2011-06-26 18:04:42 +09:00
Chia-I Wu
450f486276 targets/egl-static: refactor drm_fd_get_screen_name
Add drm_fd_get_pci_id to get the PCI ID.  Fix a leak with udev on error.
2011-06-26 08:17:52 +09:00
Chia-I Wu
ed47d65c7c st/egl: fix a compile error
It is triggered when --with-driver=xlib is specified.
2011-06-26 08:16:59 +09:00
Chia-I Wu
56ec8e17d3 targets/gbm: attemp to fix unresolved symbols
Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.
2011-06-26 07:42:04 +09:00
Marek Olšák
bc517d64da r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-06-25 18:34:09 +02:00
Brian Paul
42e7a13e7b Revert "Fix 24bpp software rendering"
This reverts commit c0c0bb6cb1.
2011-06-25 06:17:01 -06:00
Chia-I Wu
8ea5330200 egl: fix EGL_MATCH_NATIVE_PIXMAP
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.
2011-06-25 18:51:11 +09:00
Chia-I Wu
a0ad339915 st/egl: add get_pixmap_format callback to native_display
And use it for EGL_MATCH_NATIVE_PIXMAP.  Remove is_pixmap_supported
meanwhile.
2011-06-25 18:50:53 +09:00
Chia-I Wu
31520548b7 egl: make implementing eglChooseConfig easier
Add a new helper function, _eglFilterConfigArray, for drivers and hide
_eglSortConfigs.
2011-06-25 18:17:38 +09:00
Chia-I Wu
1e9f0b1736 targets/egl-static: do not use DRI_LIB_DEPS
It brings in libraries that are not necessarily needed.
2011-06-25 18:17:38 +09:00
Chia-I Wu
53d354b224 st/egl: add a fast path for ximage eglCopyBuffers 2011-06-25 16:23:21 +09:00
Chia-I Wu
7c4e9dcdce st/egl: clean up eglCopyBuffers
Add copy_to_pixmap method to native_display and use it for
eglCopyBuffers.
2011-06-25 16:23:21 +09:00
Chia-I Wu
73df31eedd st/egl: reorganize backend initialization
Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().
2011-06-25 16:23:20 +09:00
Stéphane Marchesin
ac8f59b23e i915g: always upload the vs constants.
This fixes a crash in llvm draw.
2011-06-24 19:59:17 -07:00
Eric Anholt
773556e0f5 i965/gen5: Fix grf_used calculation for 16-wide.
If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
2011-06-24 17:57:53 -07:00
Stéphane Marchesin
7b44830ef4 i915g: add fake occlusion queries.
Those always return 0, but at least we don't crash when exposing GL 2.0.
2011-06-24 17:28:54 -07:00
Stéphane Marchesin
3a7953910a i915g: Don't do shader fixup if no surface is bound. 2011-06-24 16:43:58 -07:00
Stéphane Marchesin
1a69b50b3b i915g: Fix point sprites. 2011-06-24 16:30:19 -07:00
Brian Paul
6b28b44d45 indices: fix conversion of PIPE_PRIM_POLYGON to lines
When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 16:44:43 -06:00
Paul Berry
95c2e0b601 i965: fix mask used to write to clip distance registers when gen>6
In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test
2011-06-24 15:35:49 -07:00
Alex Deucher
3acae45915 r600g: limit fs_write_all shader rebuild to eg+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:27:39 -04:00
Alex Deucher
feec48114b r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:22:47 -04:00
Chad Versace
6062692cc6 intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
97f263c229 intel: Change framebuffer validation criteria
Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
e357ae9494 intel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
bffae4c9cd intel: Factor region updates out of intel_update_wrapper
... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
d09704b4e9 intel: During glTexImage, allocate renderbuffers for faking s8z24 textures
... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
5cd4d85517 intel: Declare some functions in intel_fbo.c as non-static
... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
8869a26237 intel: Change signature of intel_create_wrapped_renderbuffer
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
951b75808e intel: Perform gather on s8z24 texture images during glGetTexImage
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
01e493980c intel: Define functions intel_texture_s8z24_scatter/gather
... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
1a062dfc6f intel: Add fields to intel_texture for faking s8z24 with separate stencil
Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Stéphane Marchesin
407832b0d2 st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.
2011-06-24 14:32:48 -07:00
Marek Olšák
100a37587f mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
12c105b5de mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
e41a91cea7 mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
2011-06-24 22:09:27 +02:00
Marek Olšák
2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul
09e71cf722 st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Commit 1a339b6c71 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38649

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 14:03:40 -06:00
Benjamin Franzke
629c15aaac egl_dri2: Build drm platform only if enabled 2011-06-24 22:00:45 +02:00
Vadim Girlin
eafd331cf3 r600g: implement fragment and vertex color clamp
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:41 -04:00
Vadim Girlin
d81126b714 r600g: optimize spi update
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:38 -04:00
Vadim Girlin
8567e02dca r600g: LIT: fix x&y slots order
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:35 -04:00
Eric Anholt
0c27dcb75c i965: Make the brw_format_for_mesa_format table static const.
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:22 -07:00
Eric Anholt
3541cc0d40 i965: Don't bother telling swrast_setup about state updates until fallback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:18 -07:00
Eric Anholt
6cf3d1cace i965: Don't bother telling tnl about state updates unless we fall back.
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:15 -07:00
Eric Anholt
18d4a44bdc i965: Reuse existing program data when a new compiled program matches.
It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:36:49 -07:00
Brian Paul
d91dc4a356 st/mesa: fix all_varyings_in_vbos() regression
Fixes regression from d631c19db4.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626
2011-06-24 10:41:44 -06:00
Marc Pignat
c0c0bb6cb1 Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 09:38:24 -06:00
Brian Paul
08183357c0 gallium/tests/trivial: update comment 2011-06-24 09:02:57 -06:00
Brian Paul
b663292ae9 gallium/tests/trivial: use CXX to do final link 2011-06-24 09:02:47 -06:00
Alon Levy
c9760c5c89 gallium/tests/trivial: make it build
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 08:59:42 -06:00
Chia-I Wu
febf5e4147 st/egl: make native_buffer interface typed
Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.
2011-06-24 16:49:27 +09:00
Chia-I Wu
875a1f8960 targets/egl: removed
Not used.
2011-06-24 16:49:27 +09:00
Chia-I Wu
b8f097f7a0 targets/egl-static: replace targets/egl
Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.
2011-06-24 16:49:27 +09:00
Chia-I Wu
7451bffad4 targets/egl-static: allow st/mesa to be dynamically loaded
When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).
2011-06-24 16:43:03 +09:00
Chia-I Wu
a000745f80 targets/egl-static: add support for driver lookup
Use pci id to driver map to look up the driver name.  This is based on
a433755ec5.
2011-06-24 16:43:03 +09:00
Chia-I Wu
f36d210c93 targets/gbm: build pipe drivers
Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.

[with an update by Benjamin Franzke to use --{start|end}-group]
2011-06-24 16:43:03 +09:00
Benjamin Franzke
15e64242f9 configure: Disable drm egl platform by default
So that gbm(_dri) which pulls in shared-glapi is not needed.
2011-06-24 09:37:19 +02:00
Stéphane Marchesin
d3d3fea720 dri/r200: properly spell current_atom. 2011-06-23 21:00:26 -07:00
Stéphane Marchesin
5f691ba36f dri/r200: rename __atom to current_atom.
__atom is defined by gcc when the atom compile optimizations are used.
2011-06-23 20:58:05 -07:00
Vinson Lee
ad7387fe12 gallivm: Fix x86 build with llvm-3.0svn.
LLVM revision 133739 renamed StackAlignment to StackAlignmentOverride.
2011-06-23 20:48:05 -07:00
Chia-I Wu
45aecf0114 st/egl: drop guess_gl_api from egl_g3d_loader
It is not used and confusing.
2011-06-24 12:18:52 +09:00
Chia-I Wu
cb29ee91a2 st/egl: use a helper to get st_api from the loader 2011-06-24 12:18:52 +09:00
Brian Paul
ca7510bbf9 mesa: fix incorrect error string 2011-06-23 17:09:13 -06:00
Christoph Bumiller
9c5d15e929 nv50,nvc0: prevent pushbuf flush during ctx reloc emission
Should unify this too, but will delay that until the planned
libdrm_nouveau/winsys changes which are likely to cause major
changes to this bo validation code too.
2011-06-24 00:15:58 +02:00
Brian Paul
1f544cc587 st/mesa: fix format selection regression
Note all gallium formats are supported by Mesa so disable them.
Fixes regression from 1a339b6c71.

See https://bugs.freedesktop.org/show_bug.cgi?id=38602
2011-06-23 16:06:42 -06:00
Eric Anholt
d631c19db4 vbo: Don't discount stride == 0 for testing all varyings in VBOs.
In fixed function, stride == 0 (e.g. glColor4f() outside of the draw
call) would get turned into uniform inputs, which is why it was
ignored originally in this test.  For shaders, drivers end up seeing a
need to upload stride == 0 data, and get confused by needing to upload
when vbo_all_varyings_in_vbos() returned true.  In the 965 driver
case, it wouldn't bother to compute the min/max index, and uploaded
nothing if the min/max wasn't known.

We've talked about removing the ff stride=0-into-uniforms code, so
this check shouldn't be missed once that's gone.

Fixes ARB_vertex_buffer_object/mixed-immediate-and-vbo
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37934
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:23 -07:00
Eric Anholt
8f28c05d07 vbo: Don't bother checking for stride == 0 for "any varying in a VBO".
We would still want to consider that data as being in a VBO even if we
managed to produce this case, which as far as I know we can't.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:17 -07:00
Eric Anholt
babe1fc004 i965/gen6: Add a couple more packets to the nonpipelined workaround list.
All the packets chosen before came from grepping the pdf for
nonpipelined, and these two came from grepping for non.pipelined.  We
could stand a review by looking at all packets emitted and identifying
what kind they are.
2011-06-23 13:41:42 -07:00
Paul Berry
935e7e4126 glsl: Flagged extension EXT_texture3D as "supported" in the builtin compiler.
Previously, the builtins in OES_texture_3D.{frag,vert} were only
compiling properly as a consequence of bug 38015, which allows
unsupported extensions to be enabled.  This fix eliminates the builtin
compiler's reliance on bug 38015, so that bug 38015 can be fixed.
2011-06-23 13:39:47 -07:00
Benjamin Franzke
e9d49d282d st/egl: Fix scons build 2011-06-23 22:23:57 +02:00
Benjamin Franzke
737bd7367e st/egl: Hookup gbm for drm backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
e5fc4c81ce egl_dri2: Hookup gbm as drm platform 2011-06-23 21:07:17 +02:00
Benjamin Franzke
48d4a001b3 gbm: Add gallium (drm) backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
2ff797060d gbm: Add dri backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
eddcecbf74 Add gbm (generic/graphics buffer manager) 2011-06-23 21:07:17 +02:00
Benjamin Franzke
15d7f1c1c7 st/dri: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
3af3c58dfd intel: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
5fbbd4c19f dri: Add dupImage to DRIimageExtension 2011-06-23 21:07:17 +02:00
Benjamin Franzke
fa5478c5fe r600g: Add R8G8B8A8_UNORM to evergreen colorswap table
Fixes broken glTexImage2D with format=GL_RGBA since
1a339b6c71

The origin for this behaviour is that r600_is_format_supported
checks only against r600_state_inline.h tables not evergreens.
2011-06-23 21:06:36 +02:00
Marek Olšák
1e5cef96d1 r600g: bump shader input limits 2011-06-23 15:58:49 +02:00
Brian Paul
8a5a28b731 st/wgl: return height, not width for WGL_PBUFFER_HEIGHT_ARB
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38599
2011-06-23 06:54:53 -06:00
Benjamin Franzke
87c3bb65bb st/egl/wayland: Take resize parameters only if size changes
This matches what we do in egl_dri2, and clients should
behave like this anyway.
2011-06-23 12:17:48 +02:00
Chia-I Wu
7587c140cd st/mesa: use a helper for st_framebuffer creation
In st_api_make_current, we would like to reuse the exising
st_framebuffer if possible.  Use a helper function to make the code
clearer.
2011-06-23 10:36:00 +09:00
Stéphane Marchesin
1a339b6c71 st/mesa: prefer native texture formats when possible.
If possible, we want to match the hardware format to what the app uses. By
doing so, we avoid the need for pixel conversions and therefore greatly speed
up texture uploads.
2011-06-22 17:02:21 -07:00
Stéphane Marchesin
98ce1373e4 i915g: Add draw point sprites.
It's not that much work; hopefully blend func separate also works and we get GL 2.0 for real.
2011-06-22 16:51:02 -07:00
Stéphane Marchesin
468c2c0841 i915g: Fix comment.
Reported-by: Marcin Baczynski <marbacz@gmail.com>
2011-06-22 16:47:36 -07:00
Stéphane Marchesin
465183c6ae i915g: Support more texture and render target formats. 2011-06-22 16:44:54 -07:00
Alex Deucher
5ff22ab229 r600c: add missing bank tiling case for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:38:29 -04:00
Alex Deucher
c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Michel Dänzer
eb2c9b5814 r600g: Fix use of uninitialized local variable extra_size.
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=38566 .
2011-06-22 16:23:36 +02:00
Thierry Vignaud
76bd1c1818 mesa: add missing DRI Makefiles to tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-22 08:22:02 -06:00
Brian Paul
9786688672 mesa: comments and 80-column wrapping 2011-06-22 08:12:10 -06:00
Brian Paul
3c95ff209f mesa: update comments in update_program_enables() 2011-06-22 08:12:10 -06:00
Brian Paul
79dddedfd1 mesa: update/fix comments in update_program() 2011-06-22 08:12:10 -06:00
Brian Paul
f3f080e526 mesa: update comment for gl_texture_unit 2011-06-22 08:12:10 -06:00
Marcin Slusarz
50d7d03a79 xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card.
Doing it in screen_create would be too late.
2011-06-22 12:35:40 +02:00
Andre Maasikas
63e8cda9f1 r600c: use BASE_VTX_LOC & AUTO_INDEX for drawing nonindexed with offset
Saves cmd buffer space as we were generating indexes into cs  in this case.
This was laying around in https://bugs.freedesktop.org/show_bug.cgi?id=32768
for a long time.
2011-06-22 12:40:12 +03:00
Alex Deucher
21972c85ea r600g: fix fbo depth/stencil texture allocation for evergreen+
evergreen+ stores depth and stencil separately so when we
allocate a depth/stencil fbo, make sure we allocate enough
memory for both depth and stencil buffers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-21 17:32:42 -04:00
Thomas Hellstrom
adf166b6c4 st/xa: Solid fill (tested) and composite (yet untested)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-21 21:37:02 +02:00
Chad Versace
3db27d4a4a intel: Allocate s8_z24 non-texture renderbuffers when using separate stencil
Now all infrastructure is in place to support s8_z24 non-texture
renderbuffers for gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:22:05 -07:00
Chad Versace
36e05c6870 intel: Unobfuscate intel_alloc_renderbuffer_storage
Hiz buffer allocation can only occur if the 'else' branch has been taken,
so move the hiz buffer allocation into the 'else' branch.

Having the hiz buffer allocation dangling outside of the if-tree was just
damn confusing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
39d0e3632a intel: Add fields to intel_renderbuffer for unwrapping packed depth/stencil buffers
Add the following fields:
    intel_renderbuffer.wrapped_depth;
    intel_renderbuffer.wrapped_stencil

If the intel_context is using separate stencil and the renderbuffer has
a packed depth/stencil format, then wrapped_depth and wrapped_stencil are
the real renderbuffers.

Alter the following functions to accomodate the wrapped buffers:
    intel_delete_renderbuffer
    intel_draw_buffer
    intel_get_renderbuffer
    intel_renderbuffer_map
    intel_renderbuffer_unmap

Subsequent commits allocate renderbuffer storage for wrapped_depth and
wrapped_stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
23ed3b90c7 intel: Unconditionally enable support for S8_Z24 texture format
Commit b5c847c7ca erroneously disabled
support for S8_Z24 texture format when the context required separate
stencil (intel_context.must_use_separate_stencil).

But the GL spec requires implementations to support GL_DEPTH24_STENCIL8.
So we better find a way to fake it...

From page 180 (196 of pdf) of the OpenGL 3.0 spec:
    In addition, implementations are required to support the following
    sized internal [texture] formats.

    [...]

    - Combined depth+stencil formats: DEPTH32F_STENCIL8 and and
      DEPTH24_STENCIL8.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Benjamin Franzke
0cb356dd5c egl_dri2/wayland: Hook up new buffer.release event 2011-06-21 13:11:43 -04:00
Benjamin Franzke
8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Benjamin Franzke
0c74091591 st/mesa: Invalidate drawables on context switch 2011-06-21 15:09:55 +02:00
Dave Airlie
e251b3903a r600g: use maths instead of a loop to work out mask.
This is equivalent results with less looping.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 15:18:44 +10:00
Dave Airlie
59a402cecd r600g: optimise draw vbo function a bit more.
this drop a bunch of unnecessary checks (i.e. should be trapped
at gallium level), and also removes the switch statement in favour
of some calculated values for the vgt values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 14:20:49 +10:00
Pierre-Eric Pelloux-Prayer
abe74a9820 r600g: reorder LIT instructions to support src == dst
the attached patch should be an improvement over Vadim Girlin's patch
fixing LIT instruction for r600g (commit
2fe39b46e7).

Instructions used in tgsi_lit have been reordered to always write to a
dst channel after the same channel in src has been read (so if src ==
dst, input values are not overwritten before being used).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 12:50:44 +10:00
Ben Skeggs
4112ca54e3 nvfx: nasty hack to make glFinish() actually finish..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-21 12:59:53 +10:00
Stéphane Marchesin
75be6b76ee glx: Fix compile. 2011-06-20 17:19:00 -07:00
Stéphane Marchesin
649d03d54d st/mesa: Remove unneeded texture format terminators.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-20 18:15:50 -06:00
Brian Paul
bc60a7515a st/mesa: put const qualifer on format_map table 2011-06-20 18:15:50 -06:00
Jeremy Huddleston
4fbdde889c glx: Bind to our context before __glXSetCurrentContext
We want to bind to our context before calling __glXSetCurrentContext or
messing with the gc rect in order to properly handle error conditions.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
517614141b glx: Destroy the old context only after the new one has been bound
This fixes a regression introduced by 49d7e48b33

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
559e4f8ebc glx: Allow a context-specific fallback for glXGetProcAddress
In applegl, GLX advertises the same extensions provided by OpenGL.framework
even if such extensions are not provided by glapi.  This allows a client
to get access to such API.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
fbd7448977 glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT
FramebufferTextureLayer is an alias of FramebufferTextureLayerEXT, so
FramebufferTextureLayerARB needs to be listed as an alias of
FramebufferTextureLayerEXT rather than FramebufferTextureLayer.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Thomas Hellstrom
5f20fae40d st/xa: Really support xa_surface_format. Bump minor.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-21 00:11:20 +02:00
Ian Romanick
de77324d8f linker: Reject shaders that use too many varyings
Previously it was up to the driver or later code generator to reject
these shaders.  It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 15:01:10 -07:00
Thomas Hellstrom
642951fbca st/xa: Support format-changing copy.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-20 23:47:13 +02:00
Dan Nicholson
4e5c51a05e glw: Mark all extern symbols GLAPI to regain default visibility (#31294)
Since switching to hidden visibility on gcc, GLw apps were failing to
link. Use the GLAPI definition to use default visibility where necessary.

$ nm lib/libGLw.so | grep DrawingArea
0000000000004020 T GLwCreateMDrawingArea
0000000000003430 T GLwDrawingAreaMakeCurrent
0000000000003410 T GLwDrawingAreaSwapBuffers
0000000000204c60 D glwDrawingAreaClassRec
0000000000204d48 D glwDrawingAreaWidgetClass
00000000002053c0 D glwMDrawingAreaClassRec
00000000002054e0 D glwMDrawingAreaWidgetClass

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: justin <jlec@gentoo.org>
2011-06-20 12:31:01 -07:00
Eric Anholt
f6e5230b26 i965/gen6: Apply documented workaround for nonpipelined state packets.
Fixes a 100% reproducible GPU hang in topogun-1.06-orc-84k.trace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 08:42:16 -07:00
Eric Anholt
0ab7d6f437 i965/gen6: Limit the workaround flush to once per primitive.
We're about to call this function in a bunch of state emits, so let's
not spam the hardware with flushes too hard.
2011-06-20 08:37:43 -07:00
Eric Anholt
dfada714f8 i965/gen6: Use an BO instead of writing to address 0 for PIPE_CONTROL W/A.
This was spectacularly unsafe.  On my system, address 0 happens to be
the hardware status page for the render ring, and the first quadword
of that happens to contain nothing we ever look at, but I sure didn't
look forward to having to debug some day when, for example, the kernel
happened to bind the ringbuffer before binding the hwsp.
2011-06-20 08:37:43 -07:00
Eric Anholt
8f9e8d79c8 i965/gen6: Factor the PIPE_CONTROL workaround to a separate function.
We're need this workaorund a lot more than we're currently doing, so
let's reuse it.
2011-06-20 08:37:43 -07:00
Eric Anholt
911768700e i965/gen6: Remove state flagging on BRW_NEW_CURBE_OFFSETS.
That flag was leftover from gen4, where brw_curbe.c is choosing ranges
of the CURBE space for constants to live in, and the unit state tells
where to load them from.  That's not the case on gen6 -- we don't set
this flag (since constants aren't in the URB), nor do we have any
state like that to upload.
2011-06-20 08:37:43 -07:00
Eric Anholt
c860f48f11 i965/gen4: Remove old VS unit state key structure.
We're streaming VS state out now, not caching it.
2011-06-20 08:37:42 -07:00
Eric Anholt
7d4d608240 i965/gen6: Add missing state flag for VS push constants.
It was already annotated up above and everything.
2011-06-20 08:37:42 -07:00
Eric Anholt
b46dc45cee i965/gen6+: Correct gratuitous dependency on NEW_POLYGONSTIPPLE.
That flag is for the contents of the stipple, not the enable flag.
2011-06-20 08:37:42 -07:00
Eric Anholt
416a698b3c i965/gen6+: Add a missing state flag for WM constants. 2011-06-20 08:37:42 -07:00
Kristian Høgsberg
16a04e019d wayland: Pass use_invalidate extension to driver 2011-06-20 11:05:26 -04:00
Benjamin Franzke
80636ff2da egl_dri2/x11: Check availability of the dri2 extension
Do this before query versions, or xcb will shutdown
and the connection can not be used for swrast.
2011-06-20 10:06:24 -04:00
Chia-I Wu
8eea050f5a docs: update EGL for changed configure options 2011-06-20 11:19:16 +09:00
Chia-I Wu
66c71d150a configure.ac: remove deprecated EGL options 2011-06-20 11:19:16 +09:00
Marcin Slusarz
c772d4e6f3 xorg/nouveau: rename to nouveau2
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:29:28 +02:00
Marcin Slusarz
a97b40a886 st/xorg: initialize drm_mode.type
it's uninitialized, but used by kernel (drm_mode_setcrtc -> drm_mode_set_crtcinfo)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:28:02 +02:00
Marcin Slusarz
21c0556b61 st/xorg: add GALLIUM_AUXILIARIES to target dependencies
Without it changes to GALLIUM_AUXILIARIES don't induce target rebuild

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:26:53 +02:00
Marcin Slusarz
2f6a9687cf gallium/nouveau: remove unused nouveau_screen_bo_user 2011-06-20 02:23:12 +02:00
Marcin Slusarz
fe20edf959 st/xorg: fix crash triggered by rendercheck -t composite -f a8r8g8b8 -o Src, Saturate
samplers[0] may remain uninititialized if src picture/pixmap is null
2011-06-20 02:20:26 +02:00
Marcin Slusarz
54d1b718b8 st/xorg: fix crash triggered by rendercheck -t blend -f a8r8g8b8 -o Clear 2011-06-20 02:11:12 +02:00
Marek Olšák
badf0335ef r600g: implement seamless_cube_map on r600-r700
st/mesa guarantees that all bound sampler states have the same value
in seamless_cube_map.
2011-06-20 00:19:07 +02:00
Marek Olšák
9bcce02f47 r600g: remove some magic numbers 2011-06-19 23:28:33 +02:00
Marek Olšák
1251e1df0f configure.ac: add back --enable-gallium-egl 2011-06-19 21:15:55 +02:00
Cyril Brulebois
9ba2907f2e configure.ac: Avoid running llvm-config when it hadn't been checked for.
If --disable-gallium is passed, llvm-config isn't checked for, so mark
it explicitly as absent, through LLVM_CONFIG=no.

Passing --disable-gallium would result in:
| ../configure: line 9739: --version: command not found
| ../configure: line 9740: --cppflags: command not found
| ../configure: line 9741: --libs: command not found
| ../configure: line 9743: --ldflags: command not found

With this commit, one gets that instead:
| configure: error: LLVM is required to build Gallium R300 on x86 and x86_64

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-19 21:15:55 +02:00
Marek Olšák
0c7c5b6876 configure.ac: build r600g by default
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:52 +02:00
Marek Olšák
58b6a19ea4 configure.ac: add option --with-gallium-drivers=DIRS
This removes all the --enable-gallium-$driver options and --disable-gallium.

Gallium can be disabled by --with-gallium-drivers= (without parameters).

Default is:
--with-gallium-drivers=r300,swrast

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:48 +02:00
Marek Olšák
440d71db78 configure.ac: remove --with-state-trackers
There is an obvious redundancy:

--with-driver=dri VS --with-state-trackers=dri
--with-driver=xlib VS --with-state-trackers=glx
--enable-openvg VS --with-state-trackers=vega
--enable-egl VS --with-state-trackers=egl

This patch adds two new options for the remaining state trackers:
--enable-xorg
--enable-d3d1x

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:45 +02:00
Marek Olšák
ad50abbac9 configure.ac: remove redundant option --enable-gallium-egl
We already have --enable-gallium, --enable-egl, and --with-state-trackers=egl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:13:57 +02:00
Marek Olšák
d1f66a9424 u_vbuf_mgr: make u_vbuf_mgr_draw_begin return flags in a bitmask 2011-06-19 21:09:18 +02:00
Marek Olšák
8623c68aec r600g: fix warning: assignment discards qualifiers from pointer target type 2011-06-19 21:09:18 +02:00
Marek Olšák
0d58723cde u_vbuf_mgr: fix uploading if format size is greater than stride 2011-06-19 21:09:18 +02:00
Kenneth Graunke
dd3b812962 i965: Enable extension GL_ARB_shader_texture_lod.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36987

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:54:01 -07:00
Kenneth Graunke
6430df3773 i965/fs: Add support for TXD with shadow comparisons.
Our hardware doesn't have a sample_d_c message, so we have to do a
regular sample_d and emit instructions to manually perform the
comparison.

This requires a state dependent recompile whenever the sampler's compare
mode or function change.  This adds the per-sampler comparison functions
to brw_wm_prog_key, but only sets them when the sampler's compare mode
is GL_COMPARE_R_TO_TEXTURE (i.e. only for shadow sampling).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:57 -07:00
Kenneth Graunke
01fa9addf4 i965/fs: Refactor texture result swizzling into a helper function.
The next patch will add a few additional uses.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:55 -07:00
Kenneth Graunke
f1622cfe9c i965/fs: Move sampler fetch to the top of the ir_texture visit function.
This makes it available earlier, which will soon be necessary.
(Separating code motion from actual changes.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:53 -07:00
Kenneth Graunke
6c947cfd19 i965/fs: Add support for non-shadow textureGrad (TXD) on gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:52 -07:00
Kenneth Graunke
2f4a4b943f i965/fs: Add support for non-shadow textureGrad (TXD) on gen5/6.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:50 -07:00
Kenneth Graunke
3fa910fff9 i965/fs: Add support for non-shadow textureGrad (TXD) on Ivybridge.
This is somewhat ugly, but I couldn't think of a nicer way to handle the
interleaved coordinate/derivative parameter loading.

Ironlake and Sandybridge will still hit an assertion in visit().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:47 -07:00
Kenneth Graunke
ad9481e128 i965/fs: Check for compilation failure and bail before optimizing.
Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:24 -07:00
Eric Anholt
c173541d97 i965: Use state streaming on programs, and state base address on gen5+.
There will be a little bit of thrashing of the program cache BO as the
cache warms up, but once the application is in steady state, this
reduces relocations on gen5 and later.

On my T420 laptop, cairogl firefox-talos-gfx performance improves 2.6%
+/- 1.3% (n=6).  No statistically significant performance difference
on nexuiz (n=5).
2011-06-18 16:00:45 -07:00
Eric Anholt
962dab9486 i965: Only flag the new-batch related state as dirty at new batch time.
This was debug code from the initial import of the driver.  No
statistically significant performance difference on cairo-gl or
nexuiz (n=6).
2011-06-18 16:00:45 -07:00
Eric Anholt
6f998b58bc mesa: Fix render-to-texture regression.
Accidentally introduced in fc8c4a3a7b.
Fixes fbo-drawbuffers-maxtargets and friends.
2011-06-18 15:59:00 -07:00
Eric Anholt
001e071443 mesa: Flag _NEW_BUFFERS when unbinding an attachment on glDeleteTextures.
The _ColorDrawBuffers[] wouldn't get updated despite us having updated
what it depends on (Attachments[]->Renderbuffer).  Other callers of
_mesa_remove_attachment are already flagging _NEW_BUFFERS for other
reasons.  The specific bug report that led to this fix (and
the fbo-finish-deleted testcase) was fixed by
23b6f9606d, though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-18 15:26:26 -07:00
Eric Anholt
a5a36d9b15 i965: Don't try to continue space before the start of a VBO.
This loop is trying to see if all the buffers to be uploaded happen to
be the same increment from the start of the 3DSTATE_VERTEX_BUFFERS
currently loaded in the hardware.  However, we might be at a smaller
offset than the previous set of VERTEX_BUFFERS, so we can't reuse
because that packet made the first entry be its starting offset (you
can't access outside the given bounds).

Fixes piglit ARB_vertex_buffer_object/elements-negative-offset.
2011-06-18 15:20:36 -07:00
Eric Anholt
5c2c60175d i965: Add missing state flag for vertex elements on current VS program.
Fixes a missing 3DSTATE_VERTEX_ELEMENTS on topogun.trace.
2011-06-18 15:20:35 -07:00
Marek Olšák
a4f4e24f07 r300g: rename AOS -> VARRAYS 2011-06-18 21:09:08 +02:00
Marek Olšák
7df7eaf845 r300g: fix handling PREP_* options
This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
2011-06-18 21:09:08 +02:00
Vadim Girlin
2fe39b46e7 r600g: fix LIT to handle src==dst properly
Current LIT implementation uses dst components for storing temp
results, possibly overwriting still needed values (depends on the
swizzles).
This patch uses temp reg for one of such cases (found in etqw) and
fixes "LIT R.z, R.xyzz".

Tested on evergreen. Fixes some etqw-demo rendering glitches when
"Lighting" is set to "High" in the settings.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:03:04 +10:00
Vadim Girlin
8ab1c5328b r600g: fix RSQ to use abs value of operand on evergreen
fixes https://bugs.freedesktop.org/show_bug.cgi?id=36917

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:01:03 +10:00
Vadim Girlin
a916d4279a r600g: fix source box in r600_resource_copy_region
Source box needs to be adjusted for blitting from compressed formats.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 15:45:59 +10:00
Brian Paul
753660780a mesa: allow depth texture arrays
The GL_EXT_texture_array spec allows this (Section 3.8.1).
Fixes failing piglit fbo-depth-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-06-17 13:44:59 -06:00
Brian Paul
da5c852d63 st/mesa: remove unneeded test for GL_TRUE 2011-06-17 13:44:59 -06:00
Brian Paul
15750d89b9 st/mesa: remove redundant _mesa_is_depth_format() call
The _mesa_is_depth_or_stencil_format() call covers all depth
format cases too.
2011-06-17 13:44:59 -06:00
Brian Paul
3ea6fdfdf1 st/mesa: remove trailing whitespace in st_format.c 2011-06-17 13:44:59 -06:00
Brian Paul
befaab8fa1 st/mesa: move comment for ChooseTextureFormat() to right place 2011-06-17 13:44:59 -06:00
Jeremy Huddleston
cb5a5f055b apple: Use apple_cgl_get_dl_handle() rather than opening a new handle
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-17 12:20:57 -07:00
José Fonseca
10562fbc5c scons: List all targets. 2011-06-17 20:13:16 +01:00
José Fonseca
ef4bf40db0 scons: Remember the options set on the command line.
Save them in config.py
2011-06-17 20:13:16 +01:00
José Fonseca
c9be435c79 scons: Don't list MSVS_VERSION option outside windows platforms. 2011-06-17 20:13:16 +01:00
José Fonseca
d6a0fe19e8 scons: Correct glapi USE_xxx_ASM flags. 2011-06-17 20:13:16 +01:00
José Fonseca
c7bd0fa485 scons: Accept verbose=yes instead of quiet=no.
'verbose' is affirmative, and much more common name for this sort of option.
2011-06-17 20:13:16 +01:00
Stéphane Marchesin
bf69ce37f0 glx: implement drawable refcounting.
The current dri context unbind logic will leak drawables until the process
dies (they will then get released by the GEM code). There are two ways to fix
this: either always call driReleaseDrawables every time we unbind a context
(but that costs us round trips to the X server at getbuffers() time) or
implement proper drawable refcounting. This patch implements the latter.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-06-17 11:20:19 -07:00
José Fonseca
8173471fc2 scons: Move all env setup to scons/gallium.py 2011-06-17 16:41:05 +01:00
José Fonseca
4175010749 scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
2011-06-17 14:50:37 +01:00
Thomas
a18ffcd40d st/xa: Make sure we blit all yuv regions.
The code forgot to increment a pointer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-16 16:25:18 +02:00
Thomas
7ba80e0c50 st/xa: Fix a typo pointed out by Keith Whitwell.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-16 16:25:18 +02:00
Thomas
82301ea011 target/dri-vmwgfx: Throttle dri clients by default.
Throttle pretty hard in order to prioritize user-space interactivity over
3D application speed. May revisit this later.

Signed-off-by: Thomas <thellstrom@vmware.com>
2011-06-16 16:25:17 +02:00
Brian Paul
fc8c4a3a7b mesa: use helper functions to distinguish between user/winsys FBOs
And replace IS_CUBE_FACE() macro w/ inline function.
2011-06-16 07:31:58 -06:00
Brian Paul
37e6ab7b2d mesa: refactor, create _mesa_update_draw_buffers() helper
Move this code out of _mesa_make_current() and put it into a
helper function.
2011-06-16 07:31:58 -06:00
Brian Paul
2960526816 mesa: updated comments in _make_current() 2011-06-16 07:31:58 -06:00
Vadim Girlin
016621ee14 r600: fix SPI inputs setup on r600/r700
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-16 15:23:06 +10:00
Chad Versace
8875dd5871 intel: Fix typo in intel_offset_S8 comments
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:50:45 -07:00
Chad Versace
d105f6684d i965/gen5,6: Fix hang when emitting hiz buffer without stencil buffer
When emitting either a hiz or stencil buffer, the 'separate stencil
enable' and 'hiz enable' bits are set in 3DSTATE_DEPTH_BUFFER. Therefore
we must emit both 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER.

Even if there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be
emitted; failure to do so causes a hang on gen5 and a stall on gen6.

This also fixes a silly, obvious segfault that occured when a hiz buffer
xor separate stencil buffer existed.

Fixes the piglit tests below on Gen5 when hiz and separate stencil are
manually enabled:
    fbo-alphatest-nocolor
    fbo-depth-sample-compare
    fbo
    hiz-depth-read-fbo-d24-s0
    hiz-depth-stencil-test-fbo-d24-s0
    hiz-depth-test-fbo-d24-s0
    hiz-stencil-read-fbo-d0-s8
    hiz-stencil-test-fbo-d0-s8
    fbo-missing-attachment-clear
    fbo-clear-formats
    fbo-depth-*

Changes piglit test result from crash to fail:
    hiz-depth-stencil-test-fbo-d0-s8

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:47:59 -07:00
Marek Olšák
6f243ec25d r600g: disable render condition for some blitter operations 2011-06-15 15:24:37 +02:00
Thomas Hellstrom
9f2f5b3d7f st/xa: Initial import of the xa state-tracker and the xa-vmwgfx target.
See the file src/gallium/state_trackers/xa/README for more info.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-15 11:06:16 +02:00
Mike Kaplinskiy
40aec11b75 r600g: fix TXD src regs needing fetching.
[airlied: final chunk of Mike's patch from bug 37476
this uses a loop to emit the GRADIENTS and does a check to
see if we need to fetch to a temporary register. It also
increases the context src gpr to 4 which is needed here.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Mike Kaplinskiy
6415f25663 r600g: use inlines for some common tex instr setup code.
[airlied: taken from Mike's patch in bug 37476]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Kenneth Graunke
ef8f6a8c59 glsl/builtins: Actually implement int/ivec variants of abs().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches (and don't forget
      to re-run "make builtins" after cherry-picking.)
2011-06-14 23:41:16 -07:00
Mike Kaplinskiy
de91ea1c06 r600g: fix TXD when shadowing is enabled.
Mike had actually done a lot of the TXD support in a patch in bug
37476 which I see now, I'll add the bits of his work that I didn't think
to add to my work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:54:21 +10:00
Dave Airlie
13c9a8552b r600g: add TXD support.
This at least passes the piglit arb_shader_texture_lod-texgrad test,
the AMD shader analyzer seems to multiply the V component by an unspecified
constant value no idea why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:18:42 +10:00
Brian Paul
34a774797c i915g: add const qualifier to silence warning 2011-06-14 20:47:47 -06:00
Marek Olšák
d9ca94836e r600g: also set TILE_MODE of the base level 2011-06-15 04:16:05 +02:00
Marek Olšák
677a4406d2 r600g: force OpenGL's BASE_LEVEL behavior on r600-r700
This sets the base level as the zero level, which fixes
piglit/texturing/tex-miplevel-selection*.

The r600 hardware ignores the BASE_LEVEL field in some cases, so we can't
use it.

Evergreen might need this too.
2011-06-15 03:39:24 +02:00
Kenneth Graunke
7c7a8a38e5 glsl/generate_builtins.py: Remove regexp to kill pointer addresses.
Commit 56ef62d988
"glsl: Generate readable unique names at print time."
changed ir_print_visitor to not generate @0x1234567 suffixes except
where necessary.  So there's no need to manually remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-14 18:29:48 -07:00
Jeremy Huddleston
1e16c34c5c glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL
This change to _glapi_create_table_from_handle causes it to fill the dispatch
table with NoOps for unimplemented functionality.  This matches what is done
in indirect_init.c and also allows us to enable logging (when built with
-DDEBUG and the MESA_DEBUG or LIBGL_DEBUG environment variables are set) to
catch cases where clients are trying to use these unimplemented extentions.

Additionally, this fixes some gcc -pedantic warnings.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 18:22:01 -07:00
Brian Paul
3751aa4592 st/mesa: fix indentation, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
99feecc7d1 st/mesa: replace st->ctx with ctx 2011-06-14 17:19:53 -06:00
Brian Paul
c1477f6ffe st/mesa: fix comments, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
cbad86841b docs: 7.10.3 updates 2011-06-14 17:19:53 -06:00
Brian Paul
ee231b30a8 st/mesa: improved is_interleaved_arrays() checking
Check that the difference in array pointers/offsets from the 0th
array are less than the stride, for both VBOs and user-space arrays.
Previously, we were only doing this for the later.

This tightens up the interleaved array test and fixes a problem with
the llvmpipe driver where we were creating way too many vertex fetch
variants only because the pipe_vertex_element::src_offset values were
changing frequently.  This change results in a 5x speed-up for one of
the viewperf tests.

Also, clean up the function to make it easier to understand.
2011-06-14 17:19:53 -06:00
Alex Deucher
24a760e9cb r600c: add tiling support for evergreen+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-14 18:40:37 -04:00
Marek Olšák
7d488ade23 r600g: fix RGB32F texturing 2011-06-14 20:47:57 +02:00
Marek Olšák
df6355512a r600g: fix indentation and comments 2011-06-14 20:37:57 +02:00
Eric Anholt
10e418f381 mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.
The code was playing fast and loose with rowstrides, which meant that
if a driver chose anything different for its alignment requirements,
the generated mipmaps came out garbage.  Unlike the uncompressed case,
we can't generate mipmaps directly into image->Data, so by using
TexImage2D we cut out most of the weird logic that existed to generate
in-place into ->Data.  The up/downside is that the driver recovery
code for the fact that _mesa_generate_mipmaps whacked ->Data has to be
turned off for compressed now.

Fixes 6 piglit tests about compressed mipmap gen.
2011-06-14 11:17:39 -07:00
Eric Anholt
b0c4db68b2 mesa: Remove uncompressed code from generate_mipmaps_compressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
2bfd81df0a mesa: Remove compressed code from generate_mipmaps_uncompressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
ba55ccd312 mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.
The path taken is wildly different based on this (do we generate from
a temporary image, or from level-1's data), and we appear to have
stride bugs in the compressed case that are tough to disentangle.

This just duplicates the code for the moment, the followon commit will
do the actual changes.  Only real code change here is handling
maxLevel in one common place.
2011-06-14 11:17:39 -07:00
Eric Anholt
b9fbb9df22 intel: Fix miptree height alignment for compressed NPOT textures.
This is effectively just "round up when dividing by 4" compared to the
previous code.  Fixes the broken stripe at the top of
fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.
2011-06-14 11:17:39 -07:00
Eric Anholt
56965aa007 intel: Drop dead preinitialization of align_w, align_h. 2011-06-14 11:17:39 -07:00
Eric Anholt
f94fef83db intel: Drop the cpp argument to intel_miptree_create(). 2011-06-14 11:17:39 -07:00
Eric Anholt
6dcc398ac0 intel: Calculate compress_byte in intel_miptree_create.
One less argument and thing to get wrong.
2011-06-14 11:17:39 -07:00
Eric Anholt
9c5fdbb721 intel: Use the gl_format to get the base_format for miptree create.
One less argument to this insanely long function call.
2011-06-14 11:17:39 -07:00
Eric Anholt
9a523a48af intel: Drop the internal_format field of the mipmap tree.
This has been replaced with the gl_format now.
2011-06-14 11:17:38 -07:00
Eric Anholt
0fac09a87c intel: Make the intel_miptree_match_image format check more specific.
We don't care just about the internalFormat/cpp/compressed, but about
the specific format chosen.  We have no support for format
translations as part of texture validation, and furthermore it has
restrictions in the GL specification.  However, we should be making
consistent decisions for this check anyway.
2011-06-14 11:17:38 -07:00
Eric Anholt
afbe605eff i915: Drop dead argument to translate_texture_format(). 2011-06-14 11:17:38 -07:00
Eric Anholt
4a60b0c8d2 intel: Add block alignment for RGTC textures.
We were using the default 4x2 alignment instead of the 4x4 required
for RGTC textures.
2011-06-14 11:17:26 -07:00
Eric Anholt
d5809115b5 intel: Add the MESA_FORMAT as a field of the miptree.
We only had internal_format before, which is way more irritating to
work with.
2011-06-14 11:15:43 -07:00
Eric Anholt
51ce86b781 intel: Fix 2x2 and 1x1 compressed teximages from _mesa_generate_mipmap()
Generally image uploads to a the region occur at TexImage time, but
that's not the case for fallback _mesa_generate_mipmap(), and in this
path we were forgetting to align the width when dividing height.  We
were just leaving out parts of the compressed block at 2x2 and 1x1
levels.

Fixes gen-compressed-teximage.
2011-06-14 11:15:29 -07:00
Marek Olšák
13dcf3f20d r600g: disable shader_texture_lod until there is driver support 2011-06-14 20:03:04 +02:00
Adam Jackson
130e7ead87 llvmpipe: SSE2 fastpaths for b8g8r8x8 {un,}swizzle
Copy-and-paste from the bgra cases.  The C paths attempt to avoid
copying the 'x' channel, but it's harmless, you might as well.  Good for
about 5% in glxgears (740 to 780 fps).

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-14 11:51:13 -04:00
Christoph Bumiller
a8b9a75b92 nv50: fix copy/paste error in nv50_gmtyprog_validate
Used the vertprog instead of gmtyprog.
2011-06-14 17:15:08 +02:00
Jeremy Huddleston
a128355ecb apple: Set the glapi dispatch table on context bind
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 00:48:20 -07:00
Marek Olšák
c17fb8539f configure.ac: cleanup the gallium-r300 option 2011-06-14 04:11:26 +02:00
Marek Olšák
e823ab1b00 st/xorg: remove unused variable 2011-06-14 03:49:26 +02:00
Marek Olšák
f318a15f45 r600g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
b5b7d2acc6 r300g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
be2b9bdcee xorg-radeon: rename to xorg-r300 2011-06-14 01:45:11 +02:00
Marek Olšák
63e38bd0f6 target-helpers: remove copy-pasted function inline_noop_helper 2011-06-14 01:45:11 +02:00
Vadim Girlin
9346d895e7 r600g: skip SPI setup for position and face inputs
fixes fdo bug 38145

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Dave Airlie
2743851c1a r600g: move depth texture flushing out of line.
this needs a piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Eric Anholt
296e6b9038 meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.
glReadPixels() was performing RGB -> L conversion differently from the
glTexImage() style conversion appropriate for glCopyTexImage().

Fixes gles2conform copy_texture.
2011-06-13 15:56:36 -07:00
Eric Anholt
df46eb8ec0 intel: Fix mipmap and format handling of blit glCopyPixels().
Fixes fbo-mipmap-copypix.
2011-06-13 15:56:36 -07:00
Eric Anholt
ef0d548838 intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.
We were mapping the renderbuffer once, then walking over all the
buffers to map just the texture ones using the other texture mapping
function that handled the x/y offset to the image in the region.  But
then we would go and overwrite *those* mappings with the original
mappings for depth/stencil, which was wrong.

Instead, just walk over the attachments once and map the attachments.
Wasn't that easy?
2011-06-13 15:56:36 -07:00
Eric Anholt
fb60e2061b intel: Use rb->Data and rb->RowStride to handle spans Y flipping.
This is already pointing at 0 or Height - 1 and with an appropriate
pitch, so no need to recompute those values per customization of the
spans code.  Cuts 3 out of 21kb of the compiled size.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
d29117752f intel: Clean up intel_render_texture with a rename and a helper function.
The "newImage" isn't particularly new -- it might be the same texture
that was attached to the same attachment point before.  This function
also gets called when just rebinding back to an FBO with a texture
attachment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
b17aab5753 intel: Move the draw_x/draw_y to the renderbuffer where it belongs.
It was originally located in the region because the tracking of
depth/color buffers was on the regions, and getting back to the irb
would have been tricky.  Now, we're keying off of the renderbuffer in
more places, which means we can move these fields where they belong.

This could fix potential rendering failure with a single texture
having multiple images attached to different renderbuffers across
shareCtx (as far as I can tell, this was the only failure we could
cause, since anything else should trigger intel_render_texture in
between, for example a BindFramebuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Brian Paul
4fa01d705f dri: include swrast.h, not s_texrender.h 2011-06-13 16:07:55 -06:00
Jeremy Huddleston
816b8acfe8 glx: Remove check for gc->vtable->destroy
gc->vtable->destroy is always set and is used unconditionally
in other places, so don't bother checking for it first.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
c6cf82fb55 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
e903cc17bb apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
b44d13e67b glapi: Add check for NULL symbol_prefix in gentable and fix warnings
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:50:37 -07:00
Daniel Vetter
df8d26ec09 i915g: add a few more render target formats
Snatched from xvmc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 23:05:43 +02:00
Brian Paul
755f2e2ae5 mesa: move texrender.c to swrast
This stuff is really for software rendering, it's not core Mesa.
A small step toward pushing the FetchTexel() stuff down into swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-13 13:45:39 -06:00
Brian Paul
8852e35e29 vbo: minor simplification in print_draw_arrays() debug function 2011-06-13 13:45:39 -06:00
Brian Paul
e6e1864f1c mesa: move invariant code out of loop in get_tex_rgba() 2011-06-13 13:45:39 -06:00
Mathias Fröhlich
2f0b44f981 r600g: Put shaders into immutable buffers.
Put the shader programs into an immutable buffer object.
Also make sure that those object can be taken from the user
space buffer object pool.
2011-06-13 11:33:20 -04:00
Mathias Fröhlich
b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich
e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Mathias Fröhlich
e2529442e6 r600g: Fix typo.
Fix an obvious typo in the yet unused part of the shader setup.
2011-06-13 11:31:13 -04:00
Pierre-Eric Pelloux-Prayer
92563476e4 r600g: remove useless call to u_upload_flush
No regressions found with :
- piglit (quick.tests)
- Unigine Heaven
- Lightsmark
- openarena
- Imprudence (Second Life fork)

agd5f Note: this patch was previously reverted due to piglit
regressions, but I'm not able to reproduce them here.
See this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=34008
and discussion:
http://lists.freedesktop.org/archives/dri-devel/2011-June/011996.html

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-13 11:26:54 -04:00
Marek Olšák
317247390a st/mesa: rebind vertex arrays if _NEW_BUFFER_OBJECT is dirty
This fixes piglit/vbo-bufferdata. It's a regression in 7.11.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-13 17:03:56 +02:00
Pierre-Eric Pelloux-Prayer
b19d86701e r600g: fixed bo memory leak issue
pipe_resource_reference call was miossing, thus creating massive memory under certain conditions.
Fix : https://bugs.freedesktop.org/show_bug.cgi?id=37168
2011-06-13 10:47:07 -04:00
Chia-I Wu
77b7e1b58f mapi: declare x86_entry_start/end static
x86_entry_start and x86_entry_end are defined by the inline assembly.
Declaring them static saves one instruction in entry_get_public.
2011-06-13 12:19:47 +08:00
Benjamin Franzke
3e1caf5d26 mapi: Fix tls with shared/es-glapi on x86-64
x86_64_entry_start needs to be declared static in the C code,
in order to have the correct address in entry_get_public
(seems not to be needed on x86).

The compiler needs to lookup a local not a global object.

Otherwise addresses needed for _glapi_proc_address will be computed
from some random offset (0x6400229a61058b48 in my case).
2011-06-13 12:19:47 +08:00
Chia-I Wu
982cb36584 wayland-drm: remove depend on "make clean" 2011-06-13 12:19:47 +08:00
Chia-I Wu
77e031a1c4 egl_dri2: try swrastg_dri if swrast_dri fails
Per libGL.
2011-06-13 12:19:39 +08:00
Chia-I Wu
cf69eeacc6 egl_dri2: add dri2_load_driver_swrast
Refactor dri2_load_driver and add dri2_load_driver_swrast for loading
swrast DRI driver.
2011-06-13 11:11:43 +08:00
Benjamin Franzke
16e30276e8 egl_dri2: Compare configs before matching them
This compares attribs like buffer size, and will prevent merging
unequal configs because of match criterion is e.g. ATLEAST.
2011-06-12 08:56:35 -04:00
Benjamin Franzke
a23bf646bd st/eglwayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Benjamin Franzke
b8325fd255 egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Jeremy Huddleston
9a00dd9746 apple: Request OpenGL 3.2 from OpenGL.framework if available
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:38 -07:00
Jeremy Huddleston
df1dacf093 apple: Store the CGL API version number for future reference
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:03 -07:00
Jeremy Huddleston
02b6e97c75 apple: Use a struct glx_config * rather than a void * in apple_visual_create_pfobj
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 22:54:59 -07:00
Jeremy Huddleston
f35913b96e apple: Use _glapi_create_table_from_handle to initialize our dispatch table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Jeremy Huddleston
85937f4c0d glapi: Add API that can create a _glapi_table from a dlfcn handle
Example usage:

void *handle = dlopen(opengl_library_path, RTLD_LOCAL);
struct _glapi_table *disp = _glapi_create_table_from_handle(handle, "gl");

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Marek Olšák
837dc61011 r300g: max_anisotropy of 1 is not anisotropic filtering 2011-06-11 23:03:20 +02:00
Daniel Vetter
219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Eric Anholt
4176025d46 i965: Add support for GL_FIXED vertex attributes.
This sadly requires work in the VS to rescale them, because the
hardware doesn't support this format natively.

Fixes arb_es2_compatibility-fixed-type and gtf/fixed_data_type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-10 13:17:10 -07:00
Eric Anholt
20f087863d glsl: Fix incorrect optimization of instructions before discard statements.
The function was named "find_unconditional_discard", but didn't
actually check that the discard statement found was unconditional.
Fixes piglit glsl-fs-discard-04.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 13:17:01 -07:00
Eugeni Dodonov
23ef4a6063 Fix format not a string literal error with -Werror=format-security
A trivial fix for error: format not a string literal and no format
arguments with compiling with -Werror=format-security flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 12:20:07 -07:00
Chad Versace
97d230b0bc i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attached
If either depth or stencil buffer has packed depth/stencil format, then do
not use separate stencil.

Before this commit, emit_depthbuffer() incorrectly assumed that the
texture's stencil renderbuffer wrapper was a *separate* stencil buffer,
because the depth and stencil renderbuffer wrappers are distinct for
depth/stencil textures (that is, depth_irb != stencil_irb).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-10 10:37:30 -07:00
Alex Deucher
eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher
8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Eric Anholt
6861a70177 i965/gen6: Add support for gl_PointCoord.
This is just like PointSprite overrides, but it's always on for that
attribute.

Fixes glsl-fs-pointcoord, gtf/point_sprites.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:54 -07:00
Eric Anholt
f304bb8a5d i965/gen6: Fix point sprite texture coordinate overrides.
We were assuming that the input attribute n to the FS was
FRAG_ATTRIB_TEXn, which happened to be true often enough for our
testcases.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:51 -07:00
Eric Anholt
e7280b16d6 i965/gen6: Refactor SF setup a bit to handle overrides in one place.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:45 -07:00
Christian König
003401f95c Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/r600/drm/r600_hw_context.c
2011-06-09 09:35:09 +02:00
Marek Olšák
da8b4c0798 r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture
isn't 3D, r300 always samples the border color regardless of texture
coordinates.

I HATE THIS HARDWARE.

NOTE: This is a candidate for the 7.10 branch.
2011-06-09 04:19:03 +02:00
Marek Olšák
466ce95ddf r300g: don't enable aniso with nearest filtering 2011-06-09 04:19:03 +02:00
Dave Airlie
04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Marek Olšák
d56fe67c62 r600g: remove unused variable 2011-06-09 01:34:24 +02:00
Marek Olšák
578d4539ba r300g: fix draw_vbo splitting on r3xx-r4xx
NOTE: This is a candidate for the 7.10 branch.
2011-06-09 01:25:52 +02:00
Marek Olšák
f48412c39f r300g: make translate_primitive table-driven 2011-06-09 01:25:52 +02:00
Roland Scheidegger
d302804deb util: fix strict aliasing issues in u_format_r11g11b10f.h 2011-06-09 01:14:51 +02:00
Roland Scheidegger
c1090f3019 mesa: get rid of homegrown logbase2 implementation in drivers
Some of the logbase2 functions did just the same as _mesa_logbase2,
though they were taking signed numbers (but it shouldn't matter for them).
2011-06-09 01:14:51 +02:00
Roland Scheidegger
da009212fe mesa: fix gcc version check for _mesa_bitcount
The version check was bogus, and only inside a non-gcc block anyway.
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b537f54b3a mesa: use __builtin_clz for logbase2 when available
Also rename to _mesa_logbase2 and move to imports.h to keep the ugly
ifdef GNUC stuff outside other files (also to allow reuse).
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b3d5822e93 util: add gcc version check for builtins
Looks like only next_power_of_two, logbase2 and bitcount use builtins
requiring gcc 3.4, so maybe everything else compiles with older gcc.
2011-06-09 01:14:50 +02:00
Benjamin Bellec
894db40f12 util: better logbase2/next_power_of_two implementations
Use __builtin_clz when available for logbase/next_power_of_two,
and replace next_power_of_two with faster implementation otherwise.
2011-06-09 01:14:50 +02:00
José Fonseca
9f865646f1 glx/xlib: Handle glXCreateContextAttribsARB in glXGetProcAddress. 2011-06-08 22:53:27 +01:00
Kenneth Graunke
4ef8464068 i965/gen7: Call gen7_create_constant_surface instead of brw_[...].
Fixes 17 piglit tests:
- glsl-vs-arrays-3
- glsl-vs-texturematrix-2
- glsl-vs-uniform-array-2
- arl
- nv-arl
- nv-init-zero-addr
- vp-address-01
- vp-arl-constant-array
- vp-arl-constant-array-huge
- vp-arl-constant-array-huge-offset
- vp-arl-constant-array-huge-offset-neg
- vp-arl-constant-array-huge-relative-offset
- vp-arl-constant-array-huge-varying
- vp-arl-env-array
- vp-arl-local-array
- vp-arl-neg-array
- vp-arl-neg-array-2

Fixes 4 glean tests:
- glsl1-constant array of vec4 with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader (2)
- vp1-ARL test

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
acf82657f4 i965/gen7: Enable SIMD16 fragment shader dispatch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
2a63807616 i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.
According to vol2a.07, it only applies from Cantiga to Sandybridge.

I found this in my ringbuffers while investigating various GPU hangs.
While it may not have been the cause, it seemed wise to remove it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
626440add5 i965/gen7: Program stencil buffers on Ivybridge.
Thanks to Chad's hard work implementing separate stencil and HiZ
support, this is entirely straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
53b53a141e i965/gen7: Add a prepare_depthbuffer function.
We need to call add_validated_bo to do proper aperture space accounting.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:50:38 -07:00
Kenneth Graunke
a00ca90815 i965/gen7: gen7_emit_depthbuffer needs the _NEW_DEPTH dirty bit.
For ctx->Depth.Mask.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:12 -07:00
Kenneth Graunke
bd265201da i965/gen7: Remove stencil renderbuffer from gen7_depth_format.
Since Gen7 doesn't support packed depth/stencil, the stencil buffer
can't possibly be relevant for determining the depth format.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:04 -07:00
Brian Paul
e37e196151 st/mesa: more helpful debug message in destroy_program_variants_cb() 2011-06-08 15:15:07 -06:00
Brian Paul
2d22186ca8 svga: fix typos, update comments 2011-06-08 15:08:19 -06:00
Jeremy Huddleston
3b23cf43a4 glx: Remove some GLX_USE_APPLEGL guards around glapi
Now that we're using glapi, we don't need some GLX_USE_APPLEGL ifdef-foo

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 12:03:10 -07:00
Jeremy Huddleston
1b90d7d36b darwin: Use -fvisibility=hidden to set default symbol visibility
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:47:00 -07:00
Jeremy Huddleston
2835c5112d darwin: mklib: Make the real file match the id
This makes mesa more consistent with glibtool and XCode where the
generated file matches the dylib id rather using an extra symlink

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:24:26 -07:00
Chad Versace
aea2236af6 intel: Request DRI2 buffers for separate stencil and hiz
When it is sensible to do so,
    1) intelCreateBuffer() now attaches separate depth and stencil
       buffers
       to the framebuffer it creates.
    2) intel_update_renderbuffers() requests for the framebuffer
       a separate stencil buffer (DRI2BufferStencil).

The criteria for "sensible" is:
    - The GLX config has nonzero depth and stencil bits.
    - The hardware supports separate stencil.
    - The X driver supports separate stencil, or its support has not yet
      been determined.

If the hardware supports hiz too, then intel_update_renderbuffers()
also requests DRI2BufferHiz.

If after requesting DRI2BufferStencil we determine that X driver did not
actually support separate stencil, we clean up the mistake and never ask
for DRI2BufferStencil again.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
f4efb7ff4f intel: Add assertions to intelCreateBuffer()
Assert that the GLX config has an expected depth/stencil bit combination:
one of d24/s8, d16/s0, d0/s0. These are the only depth/stencil
configurations that we advertise.

Remove the check for software stencil, because given the assertions'
constraints the check always fails.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
89d34cfd3e intel: Refactor intel_update_renderbuffers()
Extract the code that queries DRI2 to obtain the DRIdrawable's buffers
into intel_query_dri2_buffers_no_separate_stencil().

Extract the code that assigns the DRI buffer's DRM region to the
corresponding renderbuffer into
intel_process_dri2_buffer_no_separate_stencil().

Rationale
---------
The next commit enables intel_update_renderbuffers() to query for separate
stencil and hiz buffers. Without separating the separate-stencil and
no-separate-stencil paths, intel_update_renderbuffers() degenerates into
an impenetrable labyrinth of if-trees.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
84294fe26c intel: Add function intel_renderbuffer_set_hiz_region()
It's the analog of intel_renderbuffer_set_region(), but for the hiz region
of course.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
beb8b7da20 intel/intel_context.c: Remove unused functions
Remove functions intel_override_hiz() and
intel_override_separate_stencil(). They are now located in intel_screen.c.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
6b2bf272ee intel: Add flags to intel_screen for hiz and separate stencil
Add the fields below to intel_screen. The expression in parens is the
value to which intelInitScreen2() currently sets the field.
    GLboolean hw_has_separate_stencil      (true iff gen >= 7)
    GLboolean hw_must_use_separate_stencil (true iff gen >= 7)
    GLboolean hw_has_hiz                   (always false)
    enum intel_dri2_has_hiz dri2_has_hiz   (INTEL_DRI2_HAS_HIZ_UNKNOWN)

The analogous fields in intel_context now inherit their values from
intel_screen.

When hiz and separate stencil become completely implemented for a given
chipset, then the respective fields need to be enabled.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
df9f533c67 intel: Define enum intel_dri2_has_hiz
... which indicates if the X driver supports DRI2BufferHiz and
DRI2BufferStencil.

I'm placing this in its own commit due to the large comment block.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
4501a5d6e8 dri2: Add token for DRI2BufferHiz
CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
ff99103c0a intel: Define span functions for S8 renderbuffers
Since the stencil buffer is interleaved, the generic Mesa renderbuffer
accessors do not suffice. Custom span functions are necessary.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chad Versace
2abc8cae87 i965/brw: Emit state for hiz and separate stencil buffers
When emitting 3DSTATE_DEPTH_BUFFER, also emit 3DSTATE_HIER_DEPTH_BUFFER if
there is a hiz buffer. Ditto for 3DSTATE_STENCIL_BUFFER and a separate
stencil buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chia-I Wu
6b492d0976 st/egl: set EGL_ALPHA_MASK_SIZE 2011-06-09 00:23:24 +08:00
Chia-I Wu
4bb748b609 mesa: merge glapidispatch.h into dispatch.h
glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
2011-06-08 23:19:01 +08:00
Chia-I Wu
0dc45374f2 mesa: fix function remapping for dlist
glapidispatch.h should not be included directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36282
2011-06-08 23:18:57 +08:00
Chia-I Wu
fed482f5e3 mesa: fix GLES remap table setup again
Generate different glapidispatch.h's for GL and GLES.  For GLES, we want
a local remap table.

This reverts commit 5af46e8360.  The
commit will break GL remap table setup when main/glapidispatch.h is
regenerated.
2011-06-08 23:17:57 +08:00
Alex Deucher
fe3a343441 r600g: fix mixup in GPR resource reg setup
GLOBAL_GPR regs should be 0.  Need to set the
number of temp regs in SQ_GPR_RESOURCE_MGMT_1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-08 10:50:18 -04:00
Brian Paul
7c2847a972 vbo: run 'indent' on vbo_save_api.c 2011-06-08 08:05:41 -06:00
Brian Paul
9404835ccd mesa: add include/c99/*.h files to tarballs
See https://bugs.freedesktop.org/show_bug.cgi?id=36238

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1733d16de vbo: rename DO_FALLBACK -> dlist_fallback 2011-06-08 08:05:41 -06:00
Brian Paul
62811057f4 vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()
See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1cdce95f6 vbo: check array indexes to prevent negative indexing
See the piglit dlist-fdo31590.c test

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
a25271fcb8 st: use _mesa_is_bufferobj() 2011-06-08 08:05:41 -06:00
Brian Paul
d329b68f35 vbo: added a comment 2011-06-08 08:05:41 -06:00
Brian Paul
713fb50759 gallium: fix comments for pipe_stream_output_state 2011-06-08 08:05:40 -06:00
Brian Paul
3d75c42bbf mesa: remove old comment 2011-06-08 08:05:40 -06:00
Brian Paul
f9c2feb96b mesa: add more sampler types to is_sampler_type() 2011-06-08 08:05:40 -06:00
Brian Paul
5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Brian Paul
f6572017b9 draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)
Previously, we were errantly drawing some interior edges of clipped
polygons and quads.  Also, we were introducing extra edges where
polygons intersected the view frustum clip planes.

The main problem was that we were ignoring the edgeflags encoded in
the primitive header's 'flags' field which are set during polygon/quad
->tri decomposition.  We need to observe those during clipping.  Since
we can't modify the existing vert's edgeflag fields, we need to store
them in a parallel array.

Edge flags also need to be handled differently for view frustum planes
vs. user-defined clip planes.  In the former case we don't want to draw
new clip edges but in the later case we do.  This matches NVIDIA's
behaviour and it just looks right.

Finally, note that the LLVM draw code does not properly set vertex
edge flags.  It's OK on the regular software path though.
2011-06-08 08:05:40 -06:00
Jeremy Huddleston
0e8d045bf8 osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3a71f880d2 apple: Update dispatch table to current OpenGL specs
This updates the apple dispatch table to match the current glapi.
Aliases are still not handled very well.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3871e74733 apple: Dead code removal
Now that we're using glapi, all of this is no longer needed.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
e157f381f2 apple: Remove apple_glx_get_proc_address
Now that we're using glapi, we don't need to special case this.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
7d215e7c4d apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing
its own dispatch.  In this implementation, two dispatch tables are created:

__ogl_framework_api always points into OpenGL.framework.
__applegl_api is the vtable that is used.  It points into OpenGL.framework
or to local implementations that override / interpose this in OpenGL.framework

The initialization for __ogl_framework_api was copied from XQuartz with some
modifications and probably still needs further edits to better deal with
aliases.

This is a good step towards supporting both indirect and direct rendering
on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Jeremy Huddleston
88cec59170 apple: Rename __gl_api to __ogl_framework_api
In starting the migration to using mapi, rename __gl_api to
__ogl_framework_api since it is a vtable for OpenGL.framework

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Dave Airlie
19b9e523c5 r600g: missed one line in eg dyn gpr fallback.
need more sleep or something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:53:11 +10:00
Dave Airlie
9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
190bfea2de r600g: condition evergreen dyn gpr resource management
So only with kernel version 2.7 can this work, thanks to Alex
for pointing that out. Also add a workaround for a hw bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie
c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie
f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie
a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie
745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie
e66053d01c r600g: take alpha ref update out of line.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Ian Romanick
bb4758669c mesa: Ignore blits to/from missing buffers
The EXT_framebuffer_object spec (and later specs) say:

     "If a buffer is specified in <mask> and does not exist in both
     the read and draw framebuffers, the corresponding bit is silently
     ignored."

Check for color, depth, and stencil that the source and destination
FBOs have the specified buffers.  If the buffer is missing, remove the
bit from the blit request mask and continue.

Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and
fixes 'fbo-missing-attachment-blit es2 from'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Ian Romanick
7f9c17aaa8 mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the
framebuffer can be complete with some attachments be missing.  In this
case the _ColorDrawBuffers pointer will be NULL.

Fixes the crash in piglit test fbo-missing-attachment-clear.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Nicolas Kaiser
1d71bbed3b mga: enable GL_ARB_vertex_array_object extension
Tested on a Matrox G550 AGP.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-07 16:32:30 -06:00
Benjamin Franzke
ac3c2c8ece egl_dri2: Add missing header 2011-06-07 17:59:16 -04:00
Benjamin Franzke
3b11d67ef6 egl_dri2: Add missing license 2011-06-07 17:58:59 -04:00
Benjamin Franzke
ec2b08de77 egl_dri2: Use libudev only if available
Broken since 7f881c43df.
2011-06-07 17:58:47 -04:00
Pierre-Eric Pelloux-Prayer
bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37028

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher
5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher
7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Christian König
00b4e48560 [g3dvl] rework video buffer format handling 2011-06-07 22:01:30 +02:00
Christian König
8b02f9e67b xvmc: fix some warning about uninitialized vars 2011-06-07 21:15:58 +02:00
Christian König
f1bf7d3dbf [g3dvl] move dummy quantification into xvmc state tracker 2011-06-07 21:13:59 +02:00
Marek Olšák
d7111353bd r300g: consolidate deducing chipset info
Use the new PCI ID table, make it simpler.
2011-06-07 21:02:52 +02:00
Marek Olšák
4123131f3c r300_pci_ids: set families to match r300g 2011-06-07 21:02:52 +02:00
Marek Olšák
eaae63b715 r600g: add missing r300 families
Wondering why r600g needs to include r300_pci_ids.h
2011-06-07 21:02:52 +02:00
Eric Anholt
6d894f68af intel: Update intel-decode.c from intel-gpu-tools. 2011-06-07 11:44:11 -07:00
Eric Anholt
23b6f9606d intel: Implement glFinish() correctly by waiting on all previous rendering.
Before, we were waiting for (most of) the current framebuffer to be
done, which is not quite the same thing.
2011-06-07 10:46:04 -07:00
Jeremy Huddleston
6ea70600b9 darwin: Fix VG_LIB_GLOB to also match the unversioned symlink
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Jeremy Huddleston
cebdffaa2a darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Marek Olšák
ed0e4bb4c1 r300_pci_ids: add missing 4B48
Found in r300_chipset.h.
2011-06-07 18:45:23 +02:00
Benjamin Franzke
42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
6b82193677 radeon: Use pciid list to generate PCI_CHIP_<FAMILY>_<ID> defines
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
a433755ec5 targets/egl: Support driver name lookup using pci lists
Make use of this in drm and wayland st/egl backends.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
7f881c43df egl_dri2: Use external driver pci list
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
88fd16d548 Add radeon pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
09f83ce4da Add intel pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Brian Paul
681ed756c0 tgsi: s/varient/variant/ 2011-06-07 07:57:26 -06:00
Brian Paul
b3e75a61ee draw: rename draw_vs_varient.c to draw_vs_variant.c 2011-06-07 07:57:26 -06:00
Brian Paul
47f3d5d42d draw/llvm: whitespace, formatting fixes 2011-06-07 07:57:26 -06:00
Brian Paul
57f2f84f0e draw: s/1/TRUE/ 2011-06-07 07:57:26 -06:00
Eric Anholt
ef59049c52 i965: Fix flipped GT1 vs GT2 URB VS entry count limits. 2011-06-07 00:08:42 -07:00
Stéphane Marchesin
7d2cb9a53c Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-06-06 20:42:30 -07:00
Stéphane Marchesin
abb4365269 i915g: Do generic remapping.
With complex shaders there are often "holes" in the fs inputs, and we only
have 8 tex coorsd to map those to. To fix this, we remap fs inputs to [0..8].
This lets us to run many more GLSL programs.
2011-06-06 20:40:16 -07:00
Jeremy Huddleston
22c320aa2c darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 19:56:19 -04:00
Dave Airlie
ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie
63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie
f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie
be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie
cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie
eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie
6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Stéphane Marchesin
2292025c49 i915g: implement more opcodes. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0f091333d1 i915g: implement TGSI_OPCODE_SEQ. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0ce977a66e i915g: handle varyings properly. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
893b92adff i915g: add missing and unsupported PIPE_CAPs to avoid debug messages. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3d3ecb8520 dri2: protect dri2FlushFrontBuffer against NULL buffers. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
cec2082ae5 Gallium: fix indentation in u_blitter.c 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3103c08ae9 i915g: don't destroy a texture buffer if it's NULL. 2011-06-06 12:35:58 -07:00
Stéphane Marchesin
1af8b7250f llvmpipe: use $(CXX) instead of g++ for linking.
This allows setting the path to the C++ compiler.
2011-06-06 12:35:58 -07:00
Kenneth Graunke
c2e659037f i965: Update SURFACE_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
4ba9cfe4b8 i965: Update SAMPLER_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
f9a3200adb i965: Update SF_CLIP_VIEWPORT state dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:04 -07:00
Jeremy Huddleston
e5d241ddb2 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 12:48:08 -04:00
Jeremy Huddleston
d563009cd1 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:38:05 -04:00
Jeremy Huddleston
2ee5272e16 apple: Finish build fixes for applegl_glx.c
libGL.dylib now *builds* on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:27:19 -04:00
Jeremy Huddleston
7c5f37c032 apple: More fixes for compilation failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:17:38 -04:00
Andreas Faenger
f4537f99cc softpipe: Anisotropic filtering extension.
Reference implementation which produces high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-06 08:21:09 -06:00
Brian Paul
b438005d96 st/mesa: fix renderbuffer internal format for accum buffer
Fixes an accum buffer regression since switching to the table-based
format selection code.
2011-06-06 08:06:34 -06:00
Marcin Slusarz
155cf15ce2 util: add \n to debug_checkpoint_full
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-06-06 12:41:07 +01:00
Marcin Slusarz
fb40f1f532 nv50: fix nv50_sampler_state_delete array overflow
num_samplers is array of 3 elements, not 5
2011-06-06 11:20:54 +02:00
Jeremy Huddleston
5d35343d12 apple: Fix multiple build failures in applegl_glx.c
It is still not building, but this gets us many steps closer

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 21:25:27 -04:00
Jeremy Huddleston
1885cf27c9 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
3843bbcb4c glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
8593bb32ea apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Jeremy Huddleston
7cdf969527 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Ben Skeggs
1d24e6ec1d dri/nouveau: fix gnome-shell segfault
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-06 10:17:59 +10:00
Jeremy Huddleston
279e471750 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:22:47 -04:00
Jeremy Huddleston
b7f0ed8444 apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:19:59 -04:00
Jeremy Huddleston
488d6c739f apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
22613d1670 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
bb621cb61e apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:07:05 -04:00
Jeremy Huddleston
4c9bab78a1 apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:45 -04:00
Jeremy Huddleston
8e89d0bea7 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:44 -04:00
Eric Anholt
e8ea8793e3 meta: Don't do sRGB encode for framebuffer blits on sRGB-enabled framebuffers.
Fixes fbo-srgb-blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35373
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:29:00 -07:00
Eric Anholt
a513bee2f2 meta: Don't do srgb to linear decode when blitting srgb textures.
Fixes the GL_SRGB8_ALPHA8 -> GL_RGBA8 blits in fbo-srgb-blit.c

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:28:59 -07:00
Christian König
b4fa7db656 [g3dvl] split quant matrix out of picture info 2011-06-05 18:59:57 +02:00
Christian König
c4a168819d [g3dvl] rename map/unmap to begin/end frame
mapping and unmapping of buffers is just an implementation detail.
begining and ending an frame is much more descriptive
2011-06-05 17:53:48 +02:00
Christian König
7e1fbb3603 [g3dvl] remove unused and dublicate fields from picture structure 2011-06-05 17:07:17 +02:00
Christian König
c6c2ef0709 [g3dvl] use a vertex element instead of the instance id
Enable this change permanently
2011-06-05 16:39:10 +02:00
Christian König
bdfe77444d st/mesa: some more merge fixes 2011-06-05 01:28:44 +02:00
Christian König
129a3c1cf0 r600g: some merge fixes 2011-06-05 00:59:58 +02:00
Christian König
1eb957bb41 Merge remote-tracking branch 'origin/master' into pipe-video 2011-06-05 00:11:41 +02:00
Christian König
a6c76c8a90 [g3dvl] use a vertex element instead of the instance id 2011-06-04 23:54:46 +02:00
Christian König
f82cfe1eb4 Revert "Merge remote-tracking branch 'mareko/r300g-draw-instanced' into pipe-video"
This reverts commit 10370b752c, reversing
changes made to ded2a9a628.
2011-06-04 12:55:43 +02:00
Eric Anholt
164108e3db glx: Fix use-before-null-check in dri2InvalidateBuffers().
The compiler used our dereference here to skip the NULL check below.
Fixes window resize in "jconsole -J-Dsun.java2d.opengl=True" under
OpenJDK 6.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37766
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-03 16:03:34 -07:00
Eric Anholt
836a595594 i965: Drop remaining strict conformance fallback for GL_POINT_SMOOTH.
We actually could do this in hardware in the fragment shader using
gl_PointCoord and the point's size.
2011-06-03 16:03:18 -07:00
Eric Anholt
e9868979c5 i965: Drop strict conformance fallback for GL_LINE_STIPPLE.
We implement line stipples, just not *quite* correctly.  We have a
piglit testcase to use when we want to fix it, if we do.  Until then,
don't lie to our test suites.
2011-06-03 16:03:18 -07:00
Eric Anholt
d313346db6 i965: Drop strict conformance fallback for GL_LINE_SMOOTH.
We do have hardware antialised lines.  If we care, we should actually
fix them to be conformant (or as close as possible) instead of using
this knob to fool testcases using swrast.

For some interesting reading on the state of GL_*_SMOOTH across
several drivers, see:
http://homepage.mac.com/arekkusu/bugs/invariance/HWAA.html
2011-06-03 16:03:18 -07:00
Eric Anholt
d8b733643d i965: Drop strict conformance fallback for GL_POLYGON_SMOOTH.
From my reading of the GL 2.1 spec, no antialiasing is strictly
conformant for polygon smoothing.  Yes, it's absurd, but then,
hardware doesn't support this so maybe it's not so absurd.
2011-06-03 16:03:18 -07:00
Eric Anholt
3f05374574 i965: Drop INTEL_CONFORMANCE=2 fallback code.
This was just a duplicate of no_rast=true driconf option, which is
relatively standard across drivers.
2011-06-03 16:03:18 -07:00
Paul Berry
6491e9593d glsl: fixed printing of structure constants.
ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 12:48:49 -06:00
Paul Berry
26b566e19c AST dump: fixed printing of conditionals.
ast_expression::print() had an incorrect index into the subexpressions
array, so (a ? b : c) was being incorrectly rendered as (a ? b : b).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 11:07:00 -06:00
Christian König
10370b752c Merge remote-tracking branch 'mareko/r300g-draw-instanced' into pipe-video 2011-06-03 10:47:56 +02:00
Dave Airlie
4077336fc7 r600g: move spi update to only when states change.
This updates the spi state after ps/vs binding or rasteriser state
change.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:27:00 +10:00
Dave Airlie
1dbcb83881 cso: move cso hashes to a more table driven scheme
this removes a bad branch pain in the hash table lookup fn.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
970726dd6f u_prim: convert u_trim_pipe_prim to table driven.
This makes this function not be an always miss for the branch predictor.

Noticed using cachegrind, makes a minor difference to gears numbers on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
de0adb691f r600g: make conv pipe prim table driven.
This is a lot more branch predictor friendly, it actually
showed up in cachegrind profiles.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Brian Paul
aaeb9a8216 mesa: fix typo (s/GLGL/GLSL/) 2011-06-02 21:49:49 -06:00
Brian Paul
52f6e79b7c mesa: 80-column wrapping 2011-06-02 21:49:49 -06:00
Brian Paul
9653acc52a mesa: consolidate glGetUniform code 2011-06-02 21:49:49 -06:00
Brian Paul
bbce18c647 mesa: refactor/consolidate uniform lookup code 2011-06-02 21:49:49 -06:00
Brian Paul
230c71d9ee mesa: add some minor fixes for geometry shaders 2011-06-02 21:49:49 -06:00
Brian Paul
b03296c1e9 dri: add missing files from 873379a881 2011-06-02 18:27:10 -06:00
Pierre-Eric Pelloux-Prayer
09201cc7a0 mesa: add implementation of glDrawElementsInstancedBaseVertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:48 -06:00
Pierre-Eric Pelloux-Prayer
0dae94610e glapi: regenerated files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:13 -06:00
Brian Paul
898f4c5133 glapi: add glDrawElementsInstancedBaseVertex() function to xml
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:54:55 -06:00
Johannes Obermayr
873379a881 dri/nouveau: Fix build with --enable-shared-dricore.
- Based on the work of Себастьян Gliţa Κατινα <cglita@yahoo.com>
- Split Makefile.template into Makefile.defines and Makefile.targets
- Adapt other drivers to new situation
- Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35441

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:21:26 -06:00
Brian Paul
a9c5efb111 r300: remove MIN3 macro, already defined in macros.h 2011-06-02 17:21:26 -06:00
Dave Airlie
51d0892ee2 r600g: sampler and texture state doesn't need a range/block.
These are handled separately in the winsys, so don't need the calculations
done at this point. this manifested as a crash in point-sprite,

Thanks to XoD on #radeon for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 08:54:25 +10:00
Adam Jackson
e09e5cb7d8 glx: Remove (unused, broken) fastImageUnpack fast path
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:22 -04:00
Adam Jackson
776a2a5447 glx: Fix another case of using req outside of the display lock
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:21 -04:00
Marek Olšák
bddf275db4 softpipe: add a better fake implementation of fences
The flush function, when asked for, should not return a NULL fence.

NULL can only be returned if fences are not implemented, and st/mesa
doesn't call any of the fence functions if it receives a NULL fence
(because some drivers don't even set the fence hooks).

ARB_sync is exposed if fence_finish is set.
2011-06-02 16:50:46 +02:00
Brian Paul
f62e1f41b4 util: faster logbase2 2011-06-02 08:45:27 -06:00
Benjamin Bellec
bab3b4a758 mesa: faster logbase2
With minor clean-ups by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 08:31:20 -06:00
Brian Paul
029ea39fb9 st/mesa: add GL_R11F_G11F_B10F to format table
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-02 08:01:28 -06:00
Christoph Bumiller
d1fd740bb7 d3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0 2011-06-02 14:10:37 +02:00
Christoph Bumiller
a531513b06 d3d1x/sm4: fix swizzle for 1 component operands
For example, "mov o0.w, l(1)" would use imm_values[3], which is
not valid.
2011-06-02 14:10:34 +02:00
Chris Wilson
f61d1deac7 i965: Raise const.MaxTextureLevels to 14 (8192)
Mesa now limits, by default, the max number of texture levels to 15 so we
can now support the architectural maximum for gen4-6 of 14.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-02 08:30:21 +01:00
Dave Airlie
b0dc2d0c3b r600g: add spi state and move spi/vgt to modify register
This modifies the VGT state and move the SPI setup to its own discrete state.

It then just sets the SPI state up and the VGT state up once and modifies
them thereafter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:08:24 +10:00
Dave Airlie
573758fd09 r600g: decrease CPU time on set buffer resources
This splits the initialisation and the setting of values in the resource
buffers. We only should end up initialising once and updateing with new values
when needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:03:52 +10:00
Dave Airlie
4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie
42502b6f03 r600g: deinline r600_pipe_state_add_reg.
This is going to get too big to be a forced inline. Also going to remove it
from some hotpaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:53:15 +10:00
Dave Airlie
7f6672f6a7 r600g: prepare for passing ctx into _r600_pipe_state_add_reg
This moves the functions down the file, and also adds a ctx parameter.

This is precursor patch just moving stuff around and getting it ready.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:50:18 +10:00
Dave Airlie
991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie
c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie
8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie
9eb86f89a9 r600g: optimise state setting in r600_draw_vbo.
This drop the r600_draw_vbo CPU usage on a run of nexuiz from 1.40% to 0.72%
in sysprof for me on my Fusion APU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Dave Airlie
8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Brian Paul
57242715cb st/mesa: add format table entry for GL_RGB9_E5
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-01 16:25:42 -06:00
Christian König
ded2a9a628 [g3dvl] respect maximum instruction for idct render targets 2011-06-01 20:37:57 +02:00
Christian König
a019b60dd3 [g3dvl] dynamical adjust blocks per line 2011-06-01 19:41:43 +02:00
Nathan Kidd
f3652f0983 glapi: Make xserver location error more helpful
glx code hasn't lived under xserver/GL for a long time now.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-01 08:30:59 -06:00
Marek Olšák
b9e9df78a0 mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-01 16:07:58 +02:00
Marek Olšák
d69dc2e203 mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-01 16:03:26 +02:00
Marek Olšák
37a85b1830 r300g: remove unused debug option DBG_UPLOAD
And renumber the options.
2011-06-01 04:47:41 +02:00
Alex Deucher
c5903ed454 r600c: add support for llano
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher
414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Eric Anholt
c331b3123e i965/fs: Use the embedded compare in SEL on gen6+.
This avoids the extra CMP and the predication on SEL, so in addition
to one less instruction, it makes scheduling less constrained.

Improves glbenchmark Egypt performance 0.6% +/- 0.2% (n=3).  Reduces
FS instruction count across affected shaders in shader-db by 1.3%
without regressing any.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:23:50 -07:00
Benjamin Franzke
089aa313b4 wayland-drm: Check visual for being NULL 2011-05-31 15:13:37 -04:00
Benjamin Franzke
fc5aec9342 Fiuxp make tarballs for wayland-egl/drm 2011-05-31 15:13:37 -04:00
Benjamin Franzke
a7cd65fb38 st/egl: Fix udev linkage when egl_dri2 is not build 2011-05-31 15:13:37 -04:00
Benjamin Franzke
aa87a938fb egl_dri2: Fix usage of bool values 2011-05-31 15:13:36 -04:00
Benjamin Franzke
5bf6cc95c1 wayland-egl: Remove left-over headers and struct 2011-05-31 15:13:36 -04:00
Eric Anholt
f04765922c i965: Remove brw_surface_state struct that is now unused.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
ee643b23ff i965: Switch brw_state_dump to using bitshifting for surface state.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
e764f10ea5 i965: Replace struct with bit shifting for WM null surfaces.
Reduces compiled size of brw_wm_surface_state.o another 1.9%.

Overall, this brw_wm_surface_state reduction series cuts
firefox-talos-gfx runtime by 0.68% +/- 0.42% (n=6).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
9bdc44a528 i965: Replace struct with bit shifting for WM pull constant surfaces.
This reduces compiled size (4.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ac11c01dde i965: Replace struct with bit shifting for WM render target surfaces.
This massively reduces compiled size (6.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ae5c1fceba i965: Replace structs with bitfield shifting for WM texture surfaces.
This massively reduces compiled size (4.9% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
7d437b1f7f i965: Add defines for surface state setup using bitfield shifting.
It turns out that gcc is just awful at generating code for
brw_structs.h style state setup, and using bitshifting on u32s
generates better code while being similarly readable (and more
verifiable compared to the specs, using the INTEL_MASK macro).
2011-05-31 12:07:28 -07:00
Eric Anholt
3412069e23 i965: Don't compute brw->wm.input_size_masks when it's unused.
It's only used in the old fragment program path, to avoid projection
when w is always 1.  We do want to do this in the new path pre-gen6
too, but we'll probably do it through the ir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:07:28 -07:00
Eric Anholt
bcbb1a536f i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
d1946f5348 i965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.
Interestingly, the compiler wasn't doing this for us at -O2, so we
were doing the computation for every non-_ReallyEnabled unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Ian Romanick
f29bc77572 intel: Remove unused NO_TILE macro
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-31 11:46:29 -07:00
Marek Olšák
b1246cf13b r300g: set squared microtiling for the dummy zbuffer
The pitch of 4 is allowed for squared microtiling only.
2011-05-31 18:19:27 +02:00
Alex Deucher
b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Marek Olšák
c4175c811e r300g: log when getting unsupported texture format 2011-05-31 15:20:38 +02:00
Dave Airlie
d2ede5e648 gallium: include limits.h in p_config.h
We are getting inconsistent methods for endian detection (same answer when
it works, just doesn't work on some platforms) depending on whether __GLIBC__
is defined, which of course depends on include ordering before p_config.h

Just make p_config.h include limits.h to solve this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-31 17:28:48 +10:00
Dave Airlie
0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie
65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Marek Olšák
29ceeeba20 mesa: forbid UseProgram to be called inside Begin/End
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 16:26:02 +02:00
Marek Olšák
1b37a41661 st/mesa: don't use resource_copy_region for CopyPixels with conditional render
The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:06 +02:00
Marek Olšák
8d45bbc422 st/mesa: conditional rendering should not kill texture decompression via blit
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:03 +02:00
Marek Olšák
91e56c8897 st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:01 +02:00
Marek Olšák
ccfeb90b75 st/mesa: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:58 +02:00
Marek Olšák
c0277d9539 swrast: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:53 +02:00
Marek Olšák
1c95c3ef9c st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:43 +02:00
Marek Olšák
24ed0b384b st/mesa: fix typos and add some format fallbacks in format_map
Always default to DEFAULT_*_FORMATS for mandatory GL formats.
   (st_choose_format must not fail for those)
Use DEFAULT_RGBA when alpha is required instead of RGB.
Use DEFAULT_RGB otherwise.

These are more or less the remaining differences between the old code and
the new one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:35 +02:00
Marek Olšák
6c638b7ca1 st/mesa: consolidate listing of depth formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:31 +02:00
Marek Olšák
26d718ff71 st/mesa: add GL_DEPTH_COMPONENT32 fallback formats
This makes D32 work again on chipsets which can't do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:27 +02:00
Marek Olšák
49d4e803d3 st/mesa: fix changing internal format via RenderbufferStorage
The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e57
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e57 is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:21 +02:00
Marek Olšák
ff038170ff tgsi/ureg: bump the limit of immediates
Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:48:03 +02:00
Christian König
912dc8ff09 [g3dvl] move quantification into shaders 2011-05-29 20:07:57 +02:00
Christian König
ae56a1dd67 [g3dvl] implement mismatch control inside idct shaders 2011-05-29 20:07:57 +02:00
Christian König
b4837a53d3 [g3dvl] fix resource type for idct
Only the intermediate resource are 3D textures
2011-05-29 20:07:57 +02:00
Marek Olšák
f133ff51a2 trace: implement texture_barrier 2011-05-29 16:17:11 +02:00
Marek Olšák
b9e8cb0a59 trace: implement render_condition 2011-05-29 16:17:11 +02:00
Marek Olšák
76056510bc r300g: clear can be killed by render condition
Fixes piglit:
- NV_conditional_render/clear
2011-05-29 16:17:11 +02:00
Christian König
0e88621919 Initial r300g support
Based uppon a patch from Pali Rohár <pali.rohar@gmail.com>.
This seems to get at least YUV->RGB conversion working.
So a simple "mplayer -vo vdpau" now seems to work fine.
2011-05-29 13:53:17 +02:00
Tom Stellard
aae56150f5 r300g: Fix non-dri builds
This is just a temporary solution for now until there is a better way
to share code between mesa and gallium.
2011-05-28 21:16:00 -07:00
Marek Olšák
f76787b3ea r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array
2011-05-29 05:15:27 +02:00
Marek Olšák
d18792f93d r300g: cleanup render_condition a bit 2011-05-29 05:15:27 +02:00
Marek Olšák
70b86fb273 r300g: remove fake occlusion queries (debug option) 2011-05-29 05:15:27 +02:00
Marek Olšák
2397f20b6b r300g: remove debug option DBG_FALL 2011-05-29 05:15:27 +02:00
Marek Olšák
9a3f861faf r300g: print some HyperZ debug info 2011-05-29 03:03:14 +02:00
Stéphane Marchesin
fc48de4fab glx: Fix glXGetFBConfigFromVisualSGIX.
We want to check for Success, otherwise it will fail even with the right visual.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Pierre-Eric Pelloux-Prayer
4eeabd5a3d mesa: set parameter list StateFlags field in _mesa_layout_parameters()
When using _mesa_layout_parameters, all params copied in the 'layout'
output in the PASS 1 don't modify StateFlags (because they are simply
memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list
StateFlags field is the same as the input one.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Eric Anholt
0653c450cc i965/fs: Fix up for 8752764076.
I failed to commit and squash before pushing.
2011-05-27 09:51:28 -07:00
Eric Anholt
9bd7e9c6b2 mesa: Include shader target in dumps of GLSL source.
This makes automatic parsing of MESA_GLSL=dump output easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 09:07:32 -07:00
Eric Anholt
8752764076 i965/fs: Do a FS compile up front at link time to produce link errors.
At glLinkShaders time, a fail() call in FS compile in 8-wide (the one
that's required to succeed, though we may relax that at some point for
pre-Ironlake performance) will now report out as a link error.
2011-05-27 09:07:32 -07:00
Eric Anholt
d1f70a8a6c i965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.
We now have:
brw_fs.cpp handles calling out to everything and optimization.
brw_fs_visitor.cpp handles translating to our LIR.
brw_fs_emit.cpp handles emitting from our LIR to native code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:40 -07:00
Eric Anholt
11dd9e9c0f i965/fs: Split the BRW native code emit to brw_fs_emit.cpp
This is all separate from the visitor and the optimization passes
which feed into it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:39 -07:00
Eric Anholt
b7b700aeb0 i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
These will be used by the VS backend as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:30 -07:00
Eric Anholt
14b86f3c91 i965: Move non-FS-specific shader support to brw_shader.cpp.
These only existed in brw_fs.cpp because it was the only .cpp file in
the area when I wrote them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:05 -07:00
Eric Anholt
53c89c67f3 i965: Avoid generating MOVs for assignments of expressions.
No statistically significant difference measured in 3dbenchmark
egypt/pro.  It does reduce fragment shader instructions across
shader-db by 0.3%.
2011-05-27 08:19:52 -07:00
Eric Anholt
1791857d7d i965/fs: Move the computation of register block count from unit to compile.
No net code size change, but unit update is down 0.8% code size
pre-gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:19:27 -07:00
Eric Anholt
615117ce4e i965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.
There's an assumption here that fixed GRFs will never intersect with
the allocated GRFs.  That's true today, though it might change some
day if we decide to register-allocate the regs containing push
constants once they're dead.

This fixes a regression in 0f7325b890 in
Lightsmark from the texture instructions now containing g0 references
instead of having that be implied.  Performance is improved 15.2% +/-
3.6% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34968
2011-05-27 08:08:23 -07:00
Eric Anholt
40540cc517 i965/fs: Add a helper function for add_dep(before, after, before->latency).
This lets us avoid a bunch of before==NULL checks in the callers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:08:23 -07:00
Trevor Davenport
828b26b7eb nv50: fix emit_add_a16 to emit correct source reg
emit_add_a16 was using the incorrect source.
This caused adds in the form of:

   add u16 $a0 s32 $a1 u32 0x00000200

to have a source AREG of $a0 instead of $a1.

Fixes World of Warcraft in OpenGL and D3D without GLSL.
2011-05-27 10:25:40 +02:00
Brian Paul
4609e80288 mesa: s/height/depth/ in texsubimage()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37648
2011-05-26 19:25:44 -06:00
Brian Paul
e401c1f57f mesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table 2011-05-26 19:25:44 -06:00
Brian Paul
6126d50e75 mesa: plug in GL_ARB_vertex_array_object display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
e00481586c mesa: more geometry shader display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
3b0f431820 mesa: more transform feedback display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
919e260bff mesa: make query object API functions static
Only directly referenced by the _mesa_init_queryobj_dispatch() function.
2011-05-26 19:25:44 -06:00
Brian Paul
848bcd2e8c mesa: simplify query object display list dispatch setup 2011-05-26 19:25:44 -06:00
Eric Anholt
f7b3f40b70 i965: Pack the lookup and line_aa bits into the first dword of the key.
They were occupying whole 32-bit words, despite being only 10 or so
bits.  Reduces code size slightly (80/3300 bytes).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
9a729ab4b2 i965: Remove dead shadowtex_mask entry in the WM key.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
f147599ef4 i965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.
From the GL 2.1 spec:

   "Required perspective-correct interpolation for all fragment
    attributes except depth in sections 3.4.1 and 3.5.1, effectively
    making GL PERSPECTIVE CORRECT HINT a no-op."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
c095335fa5 intel: Drop doubly irrelevant code in intelReadBuffers.
First, FBO read/draw == NULL validation happens in mesa core not
intelReadBuffers -> intel_draw_buffers.  Second, that condition is no
longer tested for in our driver since ARB_ES2_compatibility was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
6d4b974e89 mesa: Flush vertices before updating drawbuffer computed state.
Otherwise, the driver is likely to draw the flushed vertices to the
new drawbuffer instead of the old one, missing the point of the flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
d3451f7f9c mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.
From the ARB_ES2_compatibility spec:

    "(8) How should we handle draw buffer completeness?

    RESOLVED: Remove draw/readbuffer completeness checks, and treat
    drawbuffers referring to missing attachments as if they were NONE."

Fixes arb_es2_compatibility-drawbuffers when the short-circuit for
ARB_ES2_compatibility in the previous commit is dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
f73ff463a2 mesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.
glDrawBuffers pointing at an unattached buffer is supposed to be
incomplete without ARB_ES2_compatibility.  The testcase to catch the
bug of not implementing that bit of the spec was tricked by this
missing piece of state update.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Brian Paul
179a88d52c mesa: minor whitespace fixes 2011-05-25 21:07:50 -06:00
Brian Paul
f84be846ca mesa: plug in sync object display list functions
Most just dispatch through to the immediate mode functions, except
for glWaitSync(), per the extension spec.
2011-05-25 21:06:51 -06:00
Brian Paul
95fa22c864 mesa: display list support for glProgramParameteriARB() 2011-05-25 20:44:35 -06:00
Brian Paul
001aa6c979 mesa: plug shader object functions into display list dispatch 2011-05-25 20:39:08 -06:00
Brian Paul
4535c98cdb mesa: plug in GL 3.0 ClearBuffer() display list functions 2011-05-25 20:27:44 -06:00
Brian Paul
8f7c815568 mesa: fill in missing sampler object display list functions 2011-05-25 20:20:22 -06:00
Brian Paul
3e06803c2c st/mesa: simplify some st_context(ctx)->pipe code 2011-05-25 18:16:03 -06:00
Brian Paul
bf14ab417c st/mesa: fix incorrect texture level/face/slice accesses
If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-25 18:07:35 -06:00
Jakob Bornecrantz
1697dac642 i915g: Bump texture sizes
Spotted and tested by Christopher Egert.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-05-25 22:06:11 +02:00
Eric Anholt
b5846865de i965: Warnings cleanup.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Eric Anholt
fa42de5ad7 i965: Fix assertion failures in unused brw_reg setup by deleting it.
I was using undefined values to create an unused value.  Go me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37366
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Alex Deucher
5ed7a7b720 r600g: remove duplicate opcode in r600_opcodes.h
V_SQ_CF_WORD1_SQ_CF_INST_HALT is 0x1f on both
evergreen and cayman.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 11:04:25 -04:00
Chad Versace
e7bcfadc22 intel: Change FBO validation criteria to accomodate hiz and seprate stencil
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
ce8fdf666f intel: Fix intel_draw_buffer() to accomodate hiz and separate stencil
The logic of intel_draw_buffers() expected that stencil buffers were
always combined depth/stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
c270f1a628 intel: Add hiz_region to intel_mipmap_tree
When a texture is attached to multiple FBO's, a separate renderbuffer
wrapper is created for each attachment. This necessitates storing the hiz
region for these renderbuffers in the texture itself instead of the
renderbuffer wrapper.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
6ed829fe50 intel: Refactor the wrapping of textures with renderbuffers
Before this commit, the renderbuffer's region was updated in
intel_renderbuffer_texture(). This commit moves the update into
intel_update_wrapper(), which is a more logical location for updates.

This is in preparation for the next commit, which allocates and
updates the texture's hiz region in intel_update_wrapper(). Having the two
region updates located in the same function makes good form.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
7c0e6d9bbc intel: Add hiz_region to intel_renderbuffer
A hiz surface must be supplied to the hardware when rendering to a depth
buffer with hiz. There are three potential places to store that surface:
    1. Allocate a larger intel_region for the depthbuffer, and let the
       region's tail be the hiz surface.
    2. Allocate a separate intel_region for hiz, and store it as
       brw_context state.
    3. Allocate a separate intel_region for hiz, and store it in
       intel_renderbuffer.

We choose method 3.

Method 1 has not been chosen due to future complications it might cause
when requesting a DRI drawable's depth buffer attachment from X.

Method 2 has not been chosen because storing the hiz region apart from
the depth region makes lazy hiz/depth resolves difficult to implement.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
a9e6509785 intel: Add is_hiz_depth_format() to intel_contex.vtbl
Given a format, is_hiz_depth_format() indicates if HiZ can be enabled on
a depthbuffer of that format.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
1a1411e09b intel: Allocate region for separate stencil buffer
... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
b5c847c7ca intel: Change supported texture formats for separate stencil
When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
4e0654ec29 mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
76f77cb07e intel: Add flags to intel_context for hiz and separate stencil
Add the following flags:
    intel_context.has_separate_stencil
    intel_context.must_use_separate_stencil
    intel_context.has_hiz

The flags are currently set to false, and will be enabled for a given
chipset once the feature is completely implemented.

Since it may be some time before these features are completed, their
values can be overridden with environment variables INTEL_HIZ and
INTEL_SEPARATE_STENCIL. Valid values for these environment variables are
"0" and "1".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Adam Jackson
a95ec18549 glx: Don't refer to the request buffer outside of {L,Unl}ockDisplay
... because that's not a safe thing to do.  The request buffer is shared
storage among all threads, and after UnlockDisplay the 'req' pointer may
point into someone else's request.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-25 06:19:29 -04:00
Alex Deucher
c44dad559a egl_dri2: add new cayman pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 01:27:34 -04:00
Alex Deucher
017cd5dcc3 r600g: fix eg/cayman scissor workaround
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-24 22:44:16 -04:00
Dave Airlie
868c04205c r600g: add workaround for buggy hw scissor on eg/cayman.
This is ported from the same fix to the DDX.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:50:17 +10:00
Dave Airlie
7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie
d1b8f8e8b3 r600g: don't lookup a vs semantic for position/face.
These don't need one, and I was seeing 0xff being returned and set in
the GPU registers with some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 10:01:25 +10:00
Dave Airlie
ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Adam Jackson
3869be74af glx: More comment cleanup
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:45:02 -04:00
Adam Jackson
a3aecd190b glx: Remove some misleading comments
These functions have already been modified for direct rendering.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:33 -04:00
Adam Jackson
5a6897ff0b drisw: Namespace better for ease of navigation
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:21 -04:00
Adam Jackson
b24f291e42 drisw: dead store removal
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:43:53 -04:00
Mike Kaplinskiy
d3b6e8a2b8 mesa: fix glGetTexImage for cases when srgb decode is skipped
See http://bugs.freedesktop.org/show_bug.cgi?id=37150

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-24 09:06:04 -06:00
Brian Paul
cd5417aac7 st/mesa: prefer formats without stencil for DEPTH_COMPONENT
for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.
2011-05-24 09:00:17 -06:00
Brian Paul
d57e95f22a st/mesa: rewrite st_choose_format() to be table driven
Instead of using a giant switch statement with lots of code, use a
table to convert GL format enums to pipe formats.

Tested by running the old code next to the new and asserting that
the return value was the same for piglit tests.

We're doing a linear search, but if that ever appears to be too slow
the table could easily be sorted or hashed.
2011-05-24 08:49:01 -06:00
José Fonseca
c3c1976f52 wgl: Don't hold on to user supplied HDC.
Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).
2011-05-24 13:12:39 +01:00
Thierry Reding
5af46e8360 mesa: Fix remap_table setup.
Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.
2011-05-23 16:19:44 +01:00
Adam Jackson
e8b1c6d6f5 mesa: Fix return type of _mesa_get_format_bytes() (#37351)
Despite that negative values aren't sensible here, making this unsigned
is dangerous.  Consider get_pointer_generic, which computes a value of
the form:

    void *base + (int x * int stride + int y) * unsigned bpp

The usual arithmetic conversions will coerce the (x*stride + y)
subexpression to unsigned.  Since stride can be negative, this is
disastrous.

Fixes at least the following piglit tests on Ironlake:

    fbo/fbo-blit-d24s8
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-23 11:07:34 -04:00
Kenneth Graunke
d0c6d24a9e i965/gen7: Fix miptree layout for cube surfaces.
Volume 1a section 8.20.4.7.3 gives new equations which multiply by 12
instead of 11.

Fixes 8 piglit tests:
- fbo-cubemap
- texCube
- glsl-fs-texturecube
- glsl-fs-texturecube-2
- glsl-fs-texturecube-2-bias
- glsl-fs-texturecube-bias
- arb_seamless_cubemap
- cubemap

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
Kenneth Graunke
b522eb0717 i965: Remove comments about pre-965 hardware.
They're irrelevant for this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
Christian König
311eb749a1 [g3dvl] rework resource format handling 2011-05-22 18:36:47 +02:00
Christian König
5705fb1dca r600g: revert commit 36b322dffd for now
Disable scaled textures, since they didn't work 100% right now.
2011-05-22 18:28:09 +02:00
pepp
fd6f2d6e57 st/mesa: assign renderbuffer's format field when allocating storage
See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-21 09:49:14 -06:00
Christian König
aa63ebc48a Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-21 16:43:12 +02:00
Christian König
3c5e741862 r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 16:40:20 +02:00
Christian König
120b55a96e r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 15:37:29 +02:00
Kenneth Graunke
9be8524af7 i965: Fix sampling on Ivybridge after headerless change.
Fixes a regression since 90e922267a.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
24de02acac i965: Remove "TXD" from justification of sampler message headers.
The coordinate offsets set in the m1 header are for textureOffset;
they have nothing to do with textureGrad (TXD).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
5e48560926 i965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.
The same as 3e43adef95 but for Gen7.

This doesn't quite fix GL_ARB_depth_texture/fbo-clear-formats; there's
still a 1 pixel wide black line on the right edge of the smaller squares.

The results were entirely wrong before, and are at least close now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:31:18 -07:00
Benjamin Franzke
733fa000ce st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ea90eca44b st/dri: Support dri2 useflags in dri2_create_image 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ca79036fe8 st/egl/wayland: Deal with wayland visual changes
Since wayland 4bde293ff8109d55eeaee8732f5a6ee0c8cd4bd9 we cant
lookup visuals, as we dont receive the visual token events.

The format for pixmap-images thus has to default to argb for now.
2011-05-20 13:05:14 -04:00
Thierry Reding
8e7d4d4e0c mesa: Emit definition of GLAPIENTRYP in es_generator.py.
GLES uses GL_APIENTRYP instead of GLAPIENTRYP, which breaks with the
latest API table generation code. This fixes the issue by emitting a
definition for GL_APIENTRYP when generating the GLES files.
2011-05-20 12:59:23 +01:00
José Fonseca
075d2bfb72 glapi: More type-checking in Get_xxx too. 2011-05-20 12:59:23 +01:00
José Fonseca
a436b3b2d4 gallivm: Fix for dynamically linked LLVM 2.8 library.
This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.
2011-05-20 11:54:52 +01:00
Brian Paul
4f59b32178 r300: move declaration before code 2011-05-19 21:23:39 -06:00
Brian Paul
38f89c7008 st/glx: define/set new ST_CONTEXT_FLAG_bits 2011-05-19 21:18:33 -06:00
Brian Paul
1929d52fd9 st/glx: pass major, minor, context flags, etc to XMesaCreateContext() 2011-05-19 21:18:33 -06:00
Brian Paul
d1cd1cc871 st/glx: implement glXCreateContextAttribsARB() 2011-05-19 21:18:33 -06:00
Brian Paul
81183b1e3e st/glx: pass version, context flags, etc to create_context() 2011-05-19 21:18:33 -06:00
Brian Paul
7be3e50731 st/glx: refactor create-context functions 2011-05-19 21:18:33 -06:00
Brian Paul
43bdabd47d mesa: fix vertex array enable checking in check_valid_to_render()
In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th).  Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-19 21:18:33 -06:00
Roland Scheidegger
be0a2f62f3 mesa: handle some srgb cases in the fast path in _mesa_get_teximage
Previously, always did unorm8->float/nonlinear-to-linear conversion (using
lookup table), then convert back to nonlinear (using the expensive math
func pow among others), and finally convert back to int (assuming caller
wants unorm8), because the float texture fetch function is used for getting
the actual texel values. This should probably all be changed at some point,
but for now simply enable the memcpy path also for srgb formats (but if for
instance swizzling is required, still the whole conversion will be done).
2011-05-20 01:43:40 +02:00
Kristian Høgsberg
339544f4bb wayland-drm: Use new generic error event 2011-05-19 12:07:00 -04:00
José Fonseca
ec4dfc2aad glapi: Implement SET_xxx as inline functions instead of macros.
In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.
2011-05-19 16:49:49 +01:00
José Fonseca
f4a9868811 mesa: add another missing GLAPIENTRY keyword
NOTE: this is a candidate for the 7.10 branch.
2011-05-19 16:39:57 +01:00
Maxim Levitsky
116133af34 nv50: add support for user clip planes
Clip distance is calculated each time vertex position is written
which is suboptiomal is some cases but very safe.
User clip planes are an obsolete feature anyway.

Every time number of clip planes increases, the vertex program
is recompiled.
That ensures no overhead in normal case (no user clip planes)
and reasonable overhead otherwise.

Fixes 3D windows in compiz, and reflection effect in neverball.
Also fixes compiz expo plugin when windows were dragged and each
window shown 3 times.
2011-05-19 12:50:28 +02:00
Kristian Høgsberg
bfaa458445 wayland: Fix link order for libwayland-drm.a 2011-05-18 18:57:05 -04:00
Eric Anholt
3e43adef95 i965: Add support for rendering to depthbuffer mipmap levels > 0.
Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
2011-05-18 13:57:18 -07:00
Eric Anholt
a98dd64af7 i965: Stop caching the combined depth/stencil region in brw_context.c.
This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
2011-05-18 13:57:17 -07:00
Eric Anholt
64f8ddaf9b i965/gen6: Add support for point min/max size from ARB_point_parameters.
Fixes glean pointAtten.
2011-05-18 13:57:17 -07:00
Eric Anholt
90e922267a i965/fs: Don't emit a header on gen5+ sample messages unless required.
Improves glbenchmark egypt performance 0.6% +/- 0.4% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
4bbc7915f1 i965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.
In the 16-wide rework, I missed that we were setting some things to be
SIMD16 mode (corresponding to their setup in emit_texture_gen4()).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
b126a0c0cb i965: Add support for correct GL_CLAMP behavior by clamping coordinates.
This removes the stupid strict-conformance fallback code I broke when
adding ARB_sampler_objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36572
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-05-18 13:57:17 -07:00
Eric Anholt
7592f00560 i965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.
These fields are documented to be in the payload, and though the FB
write docs say they *aren't* in the payload, for all other fields the
payload and header is structured so that no overwriting is required
except for non-default options.
2011-05-18 13:57:17 -07:00
Eric Anholt
136eb2bde7 i965/fs: Add support for "if" statements in 16-wide mode on gen6+.
It turns out there's nothing in the hardware preventing this.  It
appears that it ought to work on pre-gen6 as well, but just produces
GPU hangs.

Improves glbenchmark Egypt framerate 4.4% +/- 0.3% (n=3), and Pro by
2.6% +/- 0.6% (n=3).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
27b0392661 i965/fs: Fix discard and alpha test in 16-wide.
As of gen6, alt-mode (which we use) MOVs of floats are not raw --
they'll modify infs/nans.  This broke discard and alpha test in
16-wide, where apparently the upper 8 bits of the pixel enables being
set were causing the whole value to get trashed upon being moved.
Treating the values as UD instead of float makes sure they get
preserved.  While I'm here, replace the two 8-wide moves of the halves
of the header with a single compressed move.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36648
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
367020d87c i965/gen6: Fix blending state when no color buffer is bound.
This is part of fixing fbo-alphatest-nocolor -- a regression in
35e8fe5c99 after the initial regression,
that had us using a garbage BLEND_STATE[0] (in particular, the alpha
test enable) if no color buffer was bound.
2011-05-18 13:57:16 -07:00
Eric Anholt
51761a1aef i965/fs: Cut an instruction and a temporary from gen6 discard statements.
I thought I was thwarted initially when I couldn't do conditional mod
on a MOV, and couldn't use two immediate constants in one instruction.
But g0 != g0 is also a way to produce a failing comparison.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:16 -07:00
Eric Anholt
5dd5be69f0 i965/fs: Fix compiler warnings about dead code from 9634318290 2011-05-18 13:57:16 -07:00
Christian König
0ef773ff79 vdpau: rename vdpau driver to r600/softpie 2011-05-18 21:30:09 +02:00
José Fonseca
61c67eca7d gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
Fixes fdo 36738.
2011-05-18 18:14:37 +01:00
Andreas Faenger
8a98aabe0b swrast: anisotropic filtering extension
Anisotropic filtering extension for swrast intended to be used by osmesa
to create high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).
A 2nd implementation using footprint assembly is also provided.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-18 08:14:33 -06:00
Brian Paul
707eadcb7f mesa: simplify error check in _mesa_MapBufferRange() 2011-05-18 08:14:32 -06:00
Brian Paul
496bf04905 mesa: only update array _MaxElement if array is enabled
Fixes failed assertion when calling _mesa_print_arrays() debug function.
2011-05-18 08:14:32 -06:00
Brian Paul
de1df26b5c mesa: check that flex/bison are installed
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
2011-05-18 07:51:33 -06:00
Kenneth Graunke
3e0bb02358 i965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.
This should help distinguish Sandybridge GT1/GT2 from Ivybridge GT1/GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 01:31:29 -07:00
Tapani Pälli
2758e65f28 add $SELINUX_LIBS to EGL and OpenVG lib deps
Correctly links against selinux library when MESA is built with --enable-selinux option.

Fixes bug #36333 in Freedesktop bugzilla

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:58:53 +10:00
Dave Airlie
bb31ecf4fb mesa/st: split updating vertex and fragment shader stages.
this seems like a logical thing to do and sets the correct st flags
for vertex textures.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
6bd8647b54 st/mesa: only memset sampler when about to use it.
This function was taking a lot more CPU than required due to it memsetting
a bunch of memory that didn't require it from what I can see.

We should only memset here when we are about to fill out the sampler,
otherwise we end up doing a bunch of memsets for everytime this function
is called, basically setting 0 memory to 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Eric Anholt
4e98318fc1 i965: Instead of fallback on missing region, just bind a null renderbuffer.
The change for GPU hanging in 13bab58f04
fell back even when rb == NULL, which is wrong for GLES2 and caused
segfaulting in GLES2 conformance.  For the GPU hang case (where the
broken 2D driver failed to allocate a BO for the window system
renderbuffer), it also would assertion fail/segfault immediately after
the fallback setup when the renderbuffer map failed.

Fixes GLES2 conformance packed_depth_stencil.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:17 -07:00
Kenneth Graunke
461e193971 i965: Updated fixed-point sizes in Ivybridge SAMPLER_STATE.
Texture LOD Bias is now S4.8 instead of S4.6;
Min LOD, and Max LOD are now U4.8 instead of U4.6.

Fixes piglit test tex-miplevel-selection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:16 -07:00
Kenneth Graunke
ead7d73a51 i965: Ivybridge uses the Gen4 SAMPLER_BORDER_COLOR_STATE.
Volume 5c 1.13.7 lists it as [PreDevILK] and [DevIVB+].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:47:52 -07:00
Kenneth Graunke
b2c1f8ff1d egl: Recognize Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
1b3d354743 intel: Recognize new Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
7f5e0d2a90 i965: Disable register spilling on Ivybridge for now.
The data port messages for this are rather different.  For now, fail to
compile rather than hanging the GPU.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
344283de5d i965: Fix RNDZ and RNDE on Sandybridge and Ivybridge.
On gen4/5, the RNDZ and RNDE instructions return floor(x), but set special
"round increment bits" in the flag register; a predicated ADD (+1) fixes
the result.

The documentation still lists '.r' as existing, and says that the
predicated add is necessary, but it apparently lies.  According to the
simulator, BRW_CONDITIONAL_R (7) is not a valid conditional modifier
and the RNDZ and RNDE instructions simply produce the correct value.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
199a2f90ab i965: Fix data port reads on Ivybridge.
These also need to use gen7_dp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
2a95568f64 i965: Avoid register coalescing away MATH workarounds on Ivybridge.
The MATH instruction cannot handle source modifiers, even on Gen7.
So, apply this workaround for Sandybridge on Ivybridge as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
6e918163df i965: Make the CONT instruction point to the WHILE instruction.
This fixes piglit test glsl-fs-loop-continue.shader_test on Ivybridge.
According to the documentation, the CONT instruction's UIP field should
point to the WHILE instruction on both Sandybridge and Ivybridge.

The previous code made UIP point to the implicit DO instruction, which
seems incorrect.  I'm not sure how it could have worked on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
77397ef96e i965: Add support for loops on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
64ce592679 i965: Add support for IF/ELSE/ENDIF control flow on Ivybridge.
Ivybridge's IF instruction doesn't support conditional modifiers.
It also introduces UIP, which must point to the ENDIF instruction.

ELSE and ENDIF remain the same except that JIP moves from dst to src1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
ff6e3c73f6 i965: Add support for Ivybridge texturing messages.
Ivybridge puts the shadow comparator first, then lod/bias, and finally
the coordinate---unlike previous generations which always reserved four
slots for the coordinate at the beginning.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
36f8de02e7 i965: Fix sampler message descriptor on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3f44043da3 i965: Fix SAMPLER_STATE on Ivybridge.
Most of this code copied from brw_wm_sampler_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3984372104 i965: Mark some brw_wm_sampler_state.c helper functions as non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
b2b6cc6622 i965: Update SURFACE_STATE for Ivybridge.
I'm still not happy with the amount of code duplication here, but it
will have to do for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
c12a93d5c4 i965: Mark a few more brw_wm_surface_state functions as non-static.
I need to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
70c6cd39bd i965: Change brw_format_for_mesa_format to a non-static function.
This will make it easier to share between files.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
62b79b4bb9 i965: Set Address Modify Enable in VERTEX_BUFFER on Ivybridge.
Otherwise, Ivybridge seems to ignore the newly supplied data, giving us
rubbish for vertices.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
09d881bf74 i965: Enable channel masks in Ivybridge's URB_WRITE_HWORD header.
This shouldn't be done using MRFs, but until I have a proper solution
for dealing with MRFs, this allows my hack to keep working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
97d4d6f77e i965: Fix the URB write message descriptor on Ivybridge.
The message header is still incorrect, but this is a start.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
ce526a7452 i965: Fix render target writes on Ivybridge.
Ivybridge shifts the data port messages by one bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
482e8a6cd5 i965: Mad hacks to avoid using MRFs on Ivybridge.
Ivybridge's SEND instruction uses GRFs instead of MRFs.  Unfortunately,
a lot of our code explicitly uses MRFs, and rewriting it would take a
fair bit of effort.  In the meantime, use a hack:

- Change brw_set_dest, brw_set_src0, and brw_set_src1 to implicitly
  convert any MRFs into the top 16 GRFs.
- Enable gen6_resolve_implied_move on Ivybridge: Moving g0 to m0
  actually moves it to g111 thanks to the previous hack.

It remains to officially reserve these registers so the allocator
doesn't try to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
550ad737f7 i965: Emit 3DPRIMITIVE Ivybridge-style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
fa4b23581b i965: Don't use the GS for breaking down quads on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
d58400eb4a i965: Emit extra 0's in 3DSTATE_MULTISAMPLE on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
8c8985bdd7 i965: Add depth buffer support on Ivybridge.
This also disables the HiZ and separate stencil buffers.  We still need
to implement stencil.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
bc08d4ebb8 i965: Upload sampler state pointers on Ivybridge.
Since we currently only support sampling in the fragment shader, we only
bother to emit the PS variant.  In the future we'll need to emit others.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
a94fe79464 i965: Disable binding table pointers for unused pipeline stages.
This may not be necessary, but it seems like a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
706dbf85f1 i965: Upload binding table pointers on Ivybridge.
Ivybridge uses per-stage commands to update binding table pointers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
e0e2c04596 i965: Split BRW_NEW_BINDING_TABLE dirty bit into one per stage.
Ivybridge can update each stage's binding table pointer independently,
so we want separate dirty bits.  Previous generations can simply
subscribe to all three dirty bits and emit as usual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
bac10b58de i965: Explicitly disable unused pipeline stages on Ivybridge.
This may not be strictly necessary, but seems wise.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
6b2010df7d i965: Initial Ivybridge VS state.
Copied from gen6_vs_state.c; reuses create_vs_constant_bo from there.

The 3DSTATE_VS command is identical but 3DSTATE_CONSTANT_VS is not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
18402fbf79 i965: Initial Ivybridge Viewport state setup.
SF and CLIP viewport state has been combined into SF_CLIP_VIEWPORT;
SF_CLIP and CC state pointers can now be uploaded independently.

Some portions of the hardware documentation refer to separate upload
commands for SF and CLIP; these are outdated and incorrect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
81fd03fe56 i965: Initial Ivybridge Clip state setup.
Copied from gen6_clip_state.c.

This enables early culling and sets the necessary fields.  Otherwise, it
is entirely the same, so I doubt this patch is strictly necessary for a
functional driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
24d0ed72c1 i965: Initial Ivybridge CC state setup.
The state itself still seems to be the same; the only change is that
each part (CC, BLEND, DEPTH_STENCIL) can now be uploaded independently.
Thus, we still rely on the code in gen6_cc.c to set up the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
a924d69b57 i965: Initial Ivybridge WM/PS state setup.
Copied from gen6_wm_state.c.

The main change from Sandybridge seems to be that 3DSTATE_WM was split
into two separate state packet commands: 3DSTATE_WM and 3DSTATE_PS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
7d608d0c33 i965: Initial Ivybridge SF/SBE state setup.
Copied from gen6_sf_state.c.

The main change from Sandybridge seems to be that 3DSTATE_SF was split
into two separate state packet commands: 3DSTATE_SF and 3DSTATE_SBE
("setup backend").  The bit-offsets are even the same - only the DWords
numbers have shuffled around a bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
3dc4bc1f78 i965: Make gen6_sf_state.c's get_attr_override non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
8832920c29 i965: Initial Ivybridge URB space partitioning, including push constants.
Currently this always reserves 16kB for push constants, regardless of
how much space is needed, and partitions it evenly betwen the VS and FS.
This is probably not ideal, but is straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
477e2fe031 i965: Set maximum number of threads for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
235fa21a09 i965: Split out tracked state atoms for Ivybridge.
Currently, gen7_atoms is a verbatim copy of gen6_atoms; future commits
will update it to contain gen7-specific state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
89a82d72ca intel: Initial IS_GEN7 plumbing.
Currently, IS_GEN7, IS_IVYBRIDGE, IS_IVB_GT1, and IS_IVB_GT2 all return
false.  This allows me to write the code for them before actually adding
the PCI IDs and thus enabling the hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d55471768e i965: Rename max_vs_handles to max_vs_entries for consistency.
The documentation uses the term "vertex URB entries", the code talks
about "entry size", and so on.  Also, handles are just "pointers" to
entries (actually small integers).

Also rename max_gs_handles to max_gs_entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d0f0d06482 i965: Convert BRW_NEW_* dirty bits to use an enum.
This will make it much easier to add new dirty bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
c638180fc7 i965: Rework IF/ELSE jump target back-patching.
The primary motivation for this is to better support Ivybridge control
flow.  Ivybridge IF instructions need to point to the first instruction
of the ELSE block -and- the ENDIF instruction; the existing code only
supported back-patching one instruction ago.

A second goal is to simplify and centralize the back-patching, hopefully
clarifying the code somewhat.

Previously, brw_ELSE back-patched the IF instruction, and brw_ENDIF
back-patched the previous instruction (IF or ELSE).  With this patch,
brw_ENDIF is responsible for patching both the IF and (optional) ELSE.

To support this, the control flow stack (if_stack) maintains pointers to
both the IF and ELSE instructions.  Unfortunately, in single program
flow (SPF) mode, both were emitted as ADD instructions, and thus
indistinguishable.

To remedy this, this patch simply emits IF and ELSE, rather than ADDs;
brw_ENDIF will convert them to ADDs (the SPF version of back-patching).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
5936d96d33 i965: Move IF stack handling into the EU abstraction layer/brw_compile.
This hides the IF stack and back-patching of IF/ELSE instructions from
each of the code generators, greatly simplifying the interface.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
774fb90db3 i965: Get a ralloc context into brw_compile.
This would be so much easier if we were using C++; we could simply use
constructors and destructors.  Instead, we have to update all the
callers.

While we're at it, ralloc various brw_wm_compile fields rather than
explicitly calloc/free'ing them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
ebeea98573 i965/gs: Move generation check for bailing earlier.
On Sandybridge, we don't need to break down primitives.  There's no need
to bother setting up brw_compile and such if it's not going to be used;
bail as early as possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:57 -07:00
Kenneth Graunke
c6175d7870 i965: Add _NEW_LIGHT to Gen6 clip state dirty bits.
ctx->Light.ProvokingVertex depends on _NEW_LIGHT.

Found by inspection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:30:46 -07:00
Brian Paul
3559440873 mesa: add some missing GLAPIENTRY keywords
NOTE: this is a candidate for the 7.10 branch.
2011-05-17 21:24:05 -06:00
Tom Stellard
217cd216ea r300/compiler: Fix bug in rc_get_variables()
Variables that write to the same source select need to pe paired
together otherwise the register allocator might fail.

https://bugs.freedesktop.org/show_bug.cgi?id=36753
2011-05-17 19:13:47 -07:00
Christian König
9f64199d39 [g3dvl] fix missing swizzle on instanceid 2011-05-18 00:10:59 +02:00
Marek Olšák
390196ecc7 u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset 2011-05-17 01:21:30 +02:00
Marek Olšák
a3ac28a736 mesa: make RGB9_E5 non-renderable on swrast again
_BaseFormat for RGB9_E5 is GL_RGBA due to the previous revert.
2011-05-17 00:13:43 +02:00
Marek Olšák
947190ab4b Revert "mesa: set reasonable defaults in update_wrapper"
This reverts commit 1d5f16ff8f.

It breaks fbo-readpixels on swrast.
For some reason, swrast likes GL_RGBA and CHAN_TYPE.
2011-05-17 00:13:43 +02:00
Christian König
9937e85bcc [g3dvl] add missing ureg_END 2011-05-16 23:05:38 +02:00
Christian König
07114b3fdc [g3dvl] softpipe now needs the llvm libs 2011-05-16 23:04:47 +02:00
Kenneth Graunke
1309d2ea72 i965: Pass brw_compile pointer to brw_set_src[01].
This makes it symmetric with brw_set_dest, which is convenient, and will
also allow for assertions to be made based off of intel->gen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-16 13:30:16 -07:00
Kenneth Graunke
2b8e7215eb i965: Fix "Paramater" typo in gen6_wm_state.c.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-16 09:41:00 -07:00
Benjamin Franzke
b8033a5651 egl: Compile wayland-drm.a into libEGL independent of egl_dri2
Fixes egl_gallium when egl_dri2 is not enabled.
2011-05-16 10:36:36 +02:00
Christian König
3e976ef31a [g3dvl] store the idct matrix as hex values
Give the dct matrix a higher precision.
2011-05-16 00:26:44 +02:00
Dave Airlie
c9aa3bbda4 st/mesa: overhaul vertex/fragment sampler and sampler views.
This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me.

I've no idea if someone had another plan for this that is smarter than what
I've done here, but what I've basically done is

split fragment and vertex sampler and sampler_view setup function, factor
out the common chunks of both.

side-cleanups:
drop st->state.sampler_list - unused
don't update border color if we have no border color.

should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bc16c73407 gallium: block signals for new thread when spawning threads
I'm hard pressed to think of any reason a gallium thread would want to
receive a signal, especially considering its probably loaded as a library
and you don't want the threads interfering with the main threads signal
handling.

This solves a problem loading llvmpipe into the X server for AIGLX,
where the X server relies on the SIGIO signal going to the main thread,
but once llvmpipe loads the SIGIO can end up in any of its threads.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-16 06:40:26 +10:00
Christian König
828540e491 Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-15 19:26:53 +02:00
Christian König
3db6514357 [g3dvl] enable gl_rasterization_rules for idct 2011-05-15 19:21:21 +02:00
Christian König
20aabb9c2e [g3dvl] enable gl_rasterization_rules for zscan 2011-05-15 19:05:30 +02:00
Christian König
235de23e57 [g3dvl] store mvpos seperately from x,y cord 2011-05-15 15:27:38 +02:00
Christian König
5d7c8130b8 [g3dvl] pre apply zscan to quant matrix 2011-05-15 14:53:13 +02:00
Christian König
0121aae967 [g3dvl] no need for seperate intermediate buffers any more
This should reduce the video memory footprint drastically.
2011-05-15 14:07:39 +02:00
Christian König
56457ffe11 [g3dvl] move alignment of buffers to mb size into context 2011-05-15 13:08:38 +02:00
Dave Airlie
bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Tom Stellard
6d539579ad r300/compiler: Use ALU Result for IF conditionals
This saves one instruction per IF.
2011-05-14 22:35:28 -07:00
Marek Olšák
8a4136f624 r300g: HiZ fixes
Nothing special, just changing conditions for when HiZ can be enabled and
when HiZ memory becomes invalid.

I was thinking about it again and realized it had not been quite right.
2011-05-15 03:28:32 +02:00
Marek Olšák
19f59dd413 r300g: don't set other HyperZ states if depth and stencil tests are disabled
Such as HiZ.
2011-05-15 03:28:32 +02:00
Marek Olšák
fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Marek Olšák
904f43f190 r300g: fix conversion from int to boolean 2011-05-15 03:26:29 +02:00
Marek Olšák
51095f74cf u_vbuf_mgr: fix max_index computation once again
See how I compute and use the 'unused' variable in the code.
It's crucial for getting max_index right.

Fixed with the help of apitrace.
(bisecting the problematic draw call manually was not fun though)

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36268
https://bugs.freedesktop.org/show_bug.cgi?id=36609
2011-05-14 20:03:03 +02:00
Christian König
6c731191c0 [g3dvl] fix fi_frame mb increment 2011-05-14 17:11:33 +02:00
Marek Olšák
ad2999d211 st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels
GL_RGBA was always used for baseInternalFormat regardless of the chosen
texture internal format.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-14 01:53:30 +02:00
Kenneth Graunke
2bba244329 i965: Use BRW_DATAPORT_READ_TARGET_DATA_CACHE instead of 0.
Using the #define'd constant is better than 0 with a comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-13 15:20:52 -07:00
Kenneth Graunke
c77855d64e i965: Rename dp_render_target struct to gen6_dp.
This is actually just the message descriptor for Gen6+ dataport access;
it has nothing to do with the render cache.  Access to the sampler cache
and constant cache also would use this struct; rename for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:20:45 -07:00
Kenneth Graunke
17eaff77b0 i965: Attempt to un-muddle Gen6 data port message target defines.
These are documented on page 245 of IHD_OS_Vol4_Part2.pdf (the public
Sandybridge documentation/SEND instruction description).

Somebody had the bright idea to reuse gen4/5 defines labelled READ/WRITE
which just happened to be the same values as Render Cache/Sampler Cache.
It turns out that this field has nothing to do with READ/WRITE on
Sandybridge, but rather represents which data port to direct it to.

This was especially confusing in brw_set_dp_read_message, which
used "BRW_MESSAGE_TARGET_DATAPORT_WRITE."  In a read function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:19:31 -07:00
Christoph Bumiller
5f5d486717 nvc0: prevent overlap between load address and destination regs
For example, an indirect load like "ld b128 $r0q c0[$r0]" seems to
overwrite the address register before finishing the load, but only
if there are a lot of threads running.

Visible as displaced geoemtry in Unigine Heaven.
2011-05-13 18:47:54 +02:00
Marek Olšák
dd445ae120 docs: update relnotes-7.11 2011-05-13 18:10:30 +02:00
Marek Olšák
e28e3a774c st/mesa: expose ARB_shader_texture_lod if SM3 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-13 17:57:56 +02:00
Matt Turner
fae77579ad util_logbase2 takes and returns unsigned, not int
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:50 -06:00
Matt Turner
c5ac8a8aa2 Remove redundant util_unsigned_logbase2
util_logbase2 is exactly the same function.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:34 -06:00
Matt Turner
48a0a096f8 u_math.h: Remove redundant mingw32 ffs definition
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:20 -06:00
Benjamin Franzke
184bb09ff5 st/egl: Implement EGL_WL_bind_wayland_display for x11,drm,wayland 2011-05-13 09:31:10 -04:00
Benjamin Franzke
83c68758be egl_dri2: Discard similar configs 2011-05-13 09:31:09 -04:00
Kristian Høgsberg
93aea63a33 egl_dri2: Make it possible to not compile in the X11 platform 2011-05-13 09:31:09 -04:00
Francesco Marella
64e3cd0c42 nvfx: fill some PIPE_CAPs
Signed-off-by: Francesco Marella <francesco.marella@gmail.com>
2011-05-13 14:56:40 +02:00
Kenneth Graunke
f247b2d633 i965: Fix incorrectly named data port define.
According to my documentation this is actually "Media Block Write" on
Gen4-5; there has never been a "DWord Block Write."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:36:07 -07:00
Kenneth Graunke
ceaec24149 i965: Fix typo in Gen6 "DWord Scattered Write" message define.
It's DWORD, not DWORLD.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:35:13 -07:00
Vinson Lee
ac85ab066b i915g: Fix typos in print messages. 2011-05-12 23:21:58 -07:00
Dave Airlie
c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Marek Olšák
8a50637453 mesa: EXT_texture_sRGB_decode little fixup
It doesn't fix bug 37150 though.
2011-05-13 01:43:28 +02:00
Dave Airlie
1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie
240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie
d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie
d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie
5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
José Fonseca
5de2c67ba7 egl/dri2: Avoid unused static functions. 2011-05-12 15:24:26 +01:00
José Fonseca
4a47d6d46b egl/dri2: Prevent uninitialized variable dereference. 2011-05-12 15:23:48 +01:00
José Fonseca
6c26072bd1 egl/dri2: Fix const pointer duplication, prevent unitialized variable dereference.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:23:02 +01:00
José Fonseca
6a661895e9 egl: Fix int <-> ptr casts.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:12:16 +01:00
zhigang gong
6699cd4e8d glu: Fix _GLUfuncptr typedef.
typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning:
function declaration isn't a prototype.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-05-12 11:45:30 +01:00
José Fonseca
32a95cb70c mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

This fixes tracing yofrankie with apitrace, given it requires accurate
results from GetVertexAttribiv*.

NOTE: This is a candidate for the stable branches.
2011-05-12 01:09:55 +01:00
Tom Stellard
95c93651b4 r300/compiler: Fix bug in rc_get_variables()
Variables that share readers were not always being linked together.

https://bugs.freedesktop.org/show_bug.cgi?id=36939
2011-05-11 16:16:29 -07:00
Tom Stellard
4612554dce r300/compiler: Limit instructions to 3 source selects
Some presubtract conversions were generating more than 3 source
selects.

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

Note: This is a candidate for the 7.10 branch.
2011-05-11 16:16:29 -07:00
Tom Stellard
d1e8195c07 r300/compiler: Add simple unit test framework
Plus three tests for rc_inst_can_use_presub()
2011-05-11 16:16:29 -07:00
Alex Deucher
b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca
7a271151a5 mesa: Don't append fog code for programs that don't output color.
Fixes fdo 36919.

NOTE: This is a candidate for the stable branches.

It should be cherry-picked to the sames branches that
3aa21f93dc was.
2011-05-11 14:04:08 +01:00
José Fonseca
2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
José Fonseca
a67ecfeebc st/wgl: Remove buggy assertion.
The assertion is wrong, now that state tracker can cope with a window with
zero width or height.
2011-05-10 16:13:05 +01:00
Maxim Levitsky
d6b248652a nv50: fix mistake in pipe caps for pre-NVA0 cards
Introduced by 531b12af35.
2011-05-10 10:16:54 +02:00
Kenneth Graunke
68074387a4 ir_to_mesa: Emit TXD instruction.
Mesa already supports this because of NV_fragment_program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
5a3a242a8f glsl: Add compiler support for ARB_shader_texture_lod.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
1d4eb8d5d8 mesa: Add ARB_shader_texture_lod to the extension list; off by default.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-09 11:23:54 -07:00
Marcin Slusarz
4e1b1cbd0d nv50/nvc0: make transfers aware of PIPE_TRANSFER_MAP_DIRECTLY
If state tracker asked us to map resource directly and we can't
do it (because of tiling), return NULL instead of doing full transfer
- state tracker should handle it and fallback to some other method
or repeat transfer without PIPE_TRANSFER_MAP_DIRECTLY.

It greatly improves performance of xorg state tracker on nv50+,
because its fallback (DFS/UTS) is much faster than full transfer.
2011-05-09 20:19:19 +02:00
Matt Turner
86852236a3 r300/compiler: align memory allocations to 8-bytes
Eliminates unaligned accesses on strict architectures. Spotted by Jay
Estabrook.

Signed-off-by: Matt Turner <mattst88@gmail.com>

NOTE: This is a candidate for the 7.10 branch.
2011-05-09 20:01:58 +02:00
Marek Olšák
7297f2ac3c r300g: unreference a zbuffer surface after decompression 2011-05-09 20:01:58 +02:00
Marek Olšák
56b39fcd8b r300g: remove redundant state variable hyperz_locked 2011-05-09 20:01:58 +02:00
Marek Olšák
801fbdf286 mesa: document instructions ir_to_mesa emits
GLSL stopped using:
   BRA, EXP, LOG, LRP, NRM3, NRM4, XPD.

GLSL started using:
   KIL, SCS, SSG, SWZ.
(omg why SWZ? isn't proc_src_register flexible enough?)

GLSL doesn't use these opcodes some Radeons do support:
   ARR, DP2A, DST, LRP, XPD.

These opcodes are now unused:
   AND, NOT, NRM3, NRM4, OR, XOR.
(plus maybe the NV extensions which are unused by Gallium)

In addition to that, we don't use two-dimensional indirect addressing,
which the Mesa IR can do.
2011-05-09 20:01:58 +02:00
Michel Dänzer
39be542f73 r300c: Fix up for register allocator rewrite.
Was broken by commit fe622bac0c ('r300/compiler:
Rewrite register allocator').
2011-05-09 18:26:50 +02:00
Jerome Glisse
b9e8ea6a27 r600g: anisotropic filtering support for evergreen hw
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-05-09 12:18:41 -04:00
Carl-Philip Haensch
ad904cdf98 r600g: add support for anisotropic filtering 2011-05-09 12:09:16 -04:00
Michel Dänzer
9d792d013c gallium: Factor out unknown endianness detection. 2011-05-09 12:29:47 +02:00
Matt Turner
991c1f0249 Don't allow compilation if endianness isn't known
PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of
ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here
only serves to allow bad things to happen.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:23:21 +02:00
Matt Turner
5e945863ca p_config.h: Rely on glibc endianness definitions when available
Suggested by Julien Cristau.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:22:59 +02:00
Marcin Slusarz
bd3ce30ee7 st/xorg: add some debugging messages to xorg_exa.c 2011-05-09 12:22:50 +02:00
Marcin Slusarz
6e0263fdd4 st/xorg: remove DEBUG_PRINT macro and add exa_debug_printf
Localizes preprocessor usage to one place.
2011-05-09 12:22:45 +02:00
Marcin Slusarz
7c5eaf5a2d st/xorg: fix compilation of xorg_exa.c with DEBUG_PRINT set to 1 2011-05-09 12:22:24 +02:00
Christian König
ce31aaec02 [g3dvl] move dct_type detection out of get_macroblock_modes 2011-05-08 22:28:33 +02:00
Nicolas Kaiser
7074801ed7 cell: fix unbalanced parenthesis
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-08 07:41:26 -06:00
Christian König
3b773d06d2 [g3dvl] fix field selection of mb without mc 2011-05-08 13:39:56 +02:00
Christian König
626352648a [g3dvl] memcpy the DCT buffer instead of writing it directly
It looks like texture buffers are not cached so this seems to be alot faster
2011-05-07 18:09:31 +02:00
Christian König
e06a09ac37 vdpau: use multiple buffers to speed up rendering 2011-05-07 15:28:04 +02:00
Christian König
cd13ec253a vdpau: implement PresentationQueueSetBackgroundColor 2011-05-07 15:00:52 +02:00
Christian König
e0cc970a54 vdpau: as long as we don't have a background picture we don't want an alpha channel 2011-05-07 14:51:17 +02:00
Christian König
6a5d2d7967 [g3dvl] rgba surfaces are clearing if the alpha channel is one 2011-05-07 14:49:58 +02:00
Christian König
a67a0bb60c [g3dvl] using reciprocals for size calc is sometimes not precise enough 2011-05-07 14:39:35 +02:00
Christian König
213b9004a6 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_state.c
2011-05-07 14:11:40 +02:00
Marek Olšák
03615c02d8 r300/compiler: implement TXD and TXL opcodes 2011-05-07 02:51:38 +02:00
Marek Olšák
d8e222d887 r300g: handle seamless_cube_map caps 2011-05-07 02:51:38 +02:00
Benjamin Franzke
6bb230970c egl/wayland: Follow wl_resource_destroy changes 2011-05-06 16:50:45 -04:00
Christoph Bumiller
531b12af35 nv50,nvc0: activate seamless cube map filtering 2011-05-06 21:11:03 +02:00
Marek Olšák
27d3e0b25c docs: update relnotes-7.11 2011-05-06 20:14:28 +02:00
Marek Olšák
483d2ea5e3 docs: update GL3 status 2011-05-06 20:14:28 +02:00
Marek Olšák
d931b0d8b3 r600g: implement seamless_cube_map for evergreen
The r600/r700 support will follow soon.
2011-05-06 20:13:05 +02:00
Marek Olšák
a5f0a11477 gallium: implement seamless cubemap extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
bf65c9ea41 mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
a19c42ffc6 mesa: implement AMD_seamless_cubemap_per_texture 2011-05-06 20:06:30 +02:00
Alex Deucher
3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Marcin Slusarz
3b2bc4ac5b gallium/xorg st/nv50: add PIPE_BIND_CURSOR
We need to distinguish surfaces for mouse cursors from scanouts,
because nv50 hardware display engine ignores tiling flags.
2011-05-06 19:09:23 +02:00
Kostas Georgiou
8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher
2c3232da7a egl_dri2: add new radeon pci ids
There seriously needs to be a better way to do
this.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:02:24 -04:00
Matt Turner
de3d9fa956 mesa: add precision to M_PI constant
Value found in my math.h header.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:36:32 -06:00
Matt Turner
ebc0b2dca0 mesa: replace ONE_DIV_LN2 constant with M_LOG2E
1/ln(2) is equivalent to log2(e), so define it as such.

log2(e) = ln(e)/ln(2) = 1/ln(2)

Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2
(right beside each other!) weren't the same.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:33:15 -06:00
Kristian Høgsberg
e5169e9615 egl: Add a cursor use bit to MESA_drm_image 2011-05-06 10:33:50 -04:00
Benjamin Franzke
834b84149d egl/wayland-drm: Generalize interface
Do not depend on _EGLDisplay and _EGLImage.
2011-05-06 10:33:50 -04:00
nobled
a3e2c8f31f glx: Check flush DRI extension version at runtime
The DRI driver itself might not have version 3 of the
DRI2 flush extension, in which case this would've
pointed to out of bounds memory...
2011-05-06 09:39:24 +02:00
Alex Deucher
31d27259b6 r600g: add back SOURCE_FORMAT setting that get accidently dropped
Spotted by Henri Verbeet

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 19:30:30 -04:00
Alex Deucher
5939bc03bc r600g: fix up the rules for enabling SOURCE_FORMAT(EXPORT_NORM)
Setting SOURCE_FORMAT to EXPORT_NORM is an optimization.
Leaving SOURCE_FORMAT at 0 will work in all cases, but is less
efficient.  The conditions for the setting the EXPORT_NORM
optimization are as follows:

R600/RV6xx:
BLEND_CLAMP is enabled
BLEND_FLOAT32 is disabled
11-bit or smaller UNORM/SNORM/SRGB

R7xx/evergreen:
11-bit or smaller UNORM/SNORM/SRGB
16-bit or smaller FLOAT

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:54:03 -04:00
Alex Deucher
bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie
5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher
d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Marcin Slusarz
a041525ed9 mesa: don't call git if it's not git repository
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:21 -07:00
Marcin Slusarz
02a6c9428d mesa: don't touch git_sha1.h if sha1 didn't change
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:15 -07:00
Henri Verbeet
f60235e73a r600g: Match alpha ref precision to color format precision.
This fixes piglit fbo-alphatest-formats on Evergreen.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-05-05 21:00:38 +02:00
Christian König
6ad846ee78 [g3dvl] move zscan into shaders 2011-05-05 20:09:34 +02:00
Dave Airlie
dc4a3edcf9 Revert "DRI2/GLX: make swap event handling match spec"
This reverts commit 70227e21bb.

revert this until we sort things out, with a new glproto release
with compatible struct names.
2011-05-05 16:25:33 +10:00
Dave Airlie
ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Jesse Barnes
70227e21bb DRI2/GLX: make swap event handling match spec
We only handle a 32 bit swap count, so use the new structure definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Jesse Barnes
6ae9e8cbab GLX: don't crash when indirect clients try to set an event mask
After sending the GLXChangeDrawableAttributes request, we also set a
local set of attributes on the DRI drawable.  But in the indirect case
this array won't be present, so skip the setting in that case to avoid a
crash.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Christian König
352bfb525a [g3dvl] remove quantizer_scale from picture structure 2011-05-04 22:30:16 +02:00
Christian König
a9b1c4fe2e [g3dvl] remove dc_dct_pred from picture structure 2011-05-04 22:16:03 +02:00
Christian König
e3789105fe [g3dvl] divide mpg12 width height by 16 2011-05-04 22:05:03 +02:00
Christian König
0f24c19eea [g3dvl] remove the dubble zscan from the mpg12 decoder 2011-05-04 20:39:54 +02:00
Christian König
08f3a7cf7e vdpau: make state tracker far less noisy 2011-05-04 19:58:33 +02:00
Christian König
7709e6ebc3 vdpau: remove empty color.c file 2011-05-04 19:44:20 +02:00
Christian König
ff20be919a [g3dvl] remove the unused bitstream parser components 2011-05-04 19:38:40 +02:00
Christian König
ee92f0fdad vdpau: remove the unused and incomplete mpeg2 parser 2011-05-04 19:37:46 +02:00
Christian König
c888fe027c [g3dvl] Implement MPEG2 VLD
Based uppon xine's slice_xvmc.c.
This gets VDPAU up and running.
2011-05-04 18:58:55 +02:00
José Fonseca
37058c3497 scons: Add a few more human friendly messages. 2011-05-04 14:10:24 +01:00
José Fonseca
da87370032 mesa/gdi: Silence gcc warning about unused result. 2011-05-04 14:10:15 +01:00
José Fonseca
9fbd708932 st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.

This change overrides the windows maximum size, allow to create windows
arbitrarily large.
2011-05-04 13:09:14 +01:00
José Fonseca
c636daa145 st/wgl: Cope with zero width/height windows.
While ensuring the framebuffer area is never zero.
2011-05-04 13:09:13 +01:00
Brian Paul
fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Brian Paul
f85cd39fc4 mesa: remove unused restart.[ch] files
_mesa_PrimitiveRestartIndex() is in varray.c and glPrimitiveRestart()
is handled in the vbo module.
2011-05-03 18:22:04 -06:00
Ian Romanick
0f0179b8c2 glsl: Remove extra newline from error message 2011-05-03 14:51:02 -07:00
Alex Deucher
27477248d3 r600c: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:12:04 -04:00
Alex Deucher
c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Marcin Slusarz
a8bbce8d6d st/xorg: flush after loading the cursor
We need cursor data to land in destination buffer before drmModeSetCursor.
It fixes "cursor lag" on nv50.
2011-05-03 16:36:54 +02:00
Michel Dänzer
5829332a9b gallium/draw: Fix enum type taken by draw_get_shader_param().
Pointed out by clang:

src/gallium/auxiliary/draw/draw_context.h:251:41: warning: implicit conversion
from enumeration type 'enum pipe_cap' to different enumeration type
'enum pipe_shader_cap' [-Wconversion]
      return tgsi_exec_get_shader_param(param);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
2011-05-03 16:33:15 +02:00
Marek Olšák
5ba2e7adf0 mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-03 12:03:22 +02:00
Marek Olšák
93754d8499 r600g: reorder caps 2011-05-03 12:03:22 +02:00
Marek Olšák
320adb93a1 r600g: set correct PIPE_CAP_MAX_COMBINED_SAMPLERS 2011-05-03 12:03:22 +02:00
Marek Olšák
a677952e68 mesa: make AMD_draw_buffers_blend an alias of the ARB variant
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
3be1c7f260 glapi: regenerate files for AMD_draw_buffers_blend 2011-05-03 00:35:50 +02:00
Marek Olšák
9ecb46f59e glapi: add functions for AMD_draw_buffers_blend
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
62aa51b78a mesa: flush vertices before changing GL_RASTERIZER_DISCARD state, not after
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
aafbaa9e6a mesa: make _NEW_TEXTURE dirty when changing GL_TEXTURE_CUBE_MAP_SEAMLESS
Otherwise there would be no way to know whether the state has been changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Christoph Bumiller
220abb7adf nv50,nvc0: advertise GL_FIXED vertex buffers as supported
We'll handle them like f64 vertex buffers, by falling back to
copying vertex data to the command buffer through translate.
2011-05-03 00:02:36 +02:00
Christoph Bumiller
f986a6560f mesa,st/mesa: fix WPOS adjustment
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-03 00:00:55 +02:00
Jon TURNEY
9cb800a97c Default to --disable-gallium-r300 if not --with-driver=dri
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-05-02 17:34:42 +02:00
Marek Olšák
02b352e2ac gallium: reorder fields of pipe_rasterizer_state to pack it more tightly
sizeof(struct pipe_rasterizer_state):
    Before: 32 bytes
    After: 28 bytes

Reviewed-by: Brian Paul <brianp@vmare.com>
2011-05-02 17:16:09 +02:00
Marek Olšák
ca6896ba14 r600g: document some new evergreen formats 2011-05-02 17:16:09 +02:00
Marek Olšák
929b3d8233 r600g: remove some more FIXME comments 2011-05-02 13:15:43 +02:00
Michel Dänzer
5815d06ac5 st/xorg: Fix two more instances of typo 'accle'. 2011-05-02 09:36:49 +02:00
Marcin Slusarz
951244c4cd st/xorg: fix typos 2011-05-02 09:28:16 +02:00
Eric Anholt
484b51d484 i965/gen6: Align interleaved URB writes for overflow outputs as well.
Fixes glsl-max-varyings.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35614
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-01 20:13:10 -07:00
Marcin Slusarz
eb0a9e9a5a targets/xorg-nouveau: load nouveau_dri.so instead of i915_dri.so 2011-05-02 02:39:44 +02:00
Marcin Slusarz
1654988562 targets/xorg-nouveau: add libnvc0.a to nouveau libs 2011-05-02 02:39:44 +02:00
Marek Olšák
0d5ceb5891 r600g: remove some FIXME comments
All texture LOD tests pass.
2011-05-02 01:43:33 +02:00
Marek Olšák
72c6a748b9 Revert "r600g: truncate point sampled texture coordinates"
This reverts commit 1dc204d145.

MC_COORD_TRUNCATE is for MPEG and produces quite an interesting behavior
on regular textures. Anyway that commit broke filtering in demos/cubemap.
2011-05-02 01:20:22 +02:00
Marek Olšák
fb8786bda3 st/mesa: remove set-but-unused variables 2011-05-01 14:31:41 +02:00
Marek Olšák
08520bdea2 tgsi: remove set-but-unused variables 2011-05-01 14:13:09 +02:00
Marek Olšák
cacdc42e36 draw: remove set-but-unused variable 2011-05-01 14:12:47 +02:00
Marek Olšák
425cfa139b rbug: remove set-but-unused variables 2011-05-01 14:07:31 +02:00
Marek Olšák
847d397b34 ir_to_mesa: remove set-but-unused variables 2011-05-01 14:02:36 +02:00
Marek Olšák
2032daced1 mesa: remove set-but-unused variables in texcompress_s3tc 2011-05-01 14:02:35 +02:00
Marek Olšák
2d2b546189 mesa: remove set-but-unused variable in bind_attrib_location 2011-05-01 14:02:35 +02:00
Marek Olšák
f507530d25 mesa: remove unused-but-set variable in extract_uint_rgba 2011-05-01 14:02:35 +02:00
Marek Olšák
97398d1d56 r300/compiler: remove set-but-unused variables 2011-05-01 14:02:35 +02:00
Marek Olšák
56e83b4aa2 r600g: remove set-but-unused variable 2011-05-01 13:25:52 +02:00
Marek Olšák
e9d2ef79de r600g: remove FIXME comment
DONTBLOCK is correctly handled in r600_bo_map.
2011-05-01 01:54:29 +02:00
José Fonseca
dc9e5ed5e1 mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean. 2011-04-30 22:38:00 +01:00
Tom Stellard
7679a4ddf4 r300/compiler: Cleanups from the regalloc merge 2011-04-30 13:15:29 -07:00
Tom Stellard
d7cf9833d7 r300/compiler: Add return statement to rc_list() 2011-04-30 12:57:09 -07:00
Tom Stellard
7edf7d1169 r300g: Fix scons build
Broken by the dependency on ralloc introduced by
fe622bac0c
2011-04-30 12:35:06 -07:00
Daniel Vetter
899b786b19 i915g: enable X-tiling for s3tc textures
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-04-30 20:42:34 +02:00
Tom Stellard
d379e938f0 r300/compiler: Enable swizzle packing in the allocator for r300 and r400 2011-04-30 11:00:16 -07:00
Tom Stellard
1b75d48e84 r300/compiler: Handle loops in the register allocator 2011-04-30 11:00:16 -07:00
Tom Stellard
ac952a11df r300/compiler: Handle loops in rc_get_readers() 2011-04-30 11:00:16 -07:00
Tom Stellard
fe622bac0c r300/compiler: Rewrite register allocator
The new allocator uses ra and does swizzle packing.

Also, a data structure (struct rc_variable) and associated functions have
been added for generating UD and DU chains.
2011-04-30 11:00:15 -07:00
Tom Stellard
e4a765ae2d ra: Add ra_set_node_reg()
This function can be used to avoid creating single register classes for
input/payload registers.  This makes optimistic coloring less likely
to fail.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-30 11:00:15 -07:00
Tom Stellard
dbac75fa2f r300/compiler: Use RC_MASK_W when converting RGB to Alpha instructions 2011-04-30 11:00:15 -07:00
Tom Stellard
4f4d1d06da r300/compiler: rc_reader_data: Add ExitOnAbort flag 2011-04-30 11:00:15 -07:00
Tom Stellard
bbcee3268a r300/compiler: Add more info to struct rc_reader
For pair instructions we need a reference to both the arg
and source.
2011-04-30 11:00:15 -07:00
Tom Stellard
6a6068e5e1 r300/compiler: Add remove dead sources pass
The instruction scheduler will sometimes leave orphaned sources when
converting instructions from RGB to Alpha.  If one of these orphaned
sources has an index greater than the maximum temporary register index,
then the compiler will incorrectly report "Too many hardware temporaries
used".  The dead sources pass cleans up these orphaned sources.
2011-04-30 11:00:15 -07:00
Marek Olšák
bd661a933b docs: add ARB_ES2_compatibility in relnotes-7.11 2011-04-30 12:02:01 +02:00
Marek Olšák
fdff7e635b st/mesa: expose ARB_ES2_compatibility if GL_FIXED vertex format is supported
Tested with softpipe and llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Marek Olšák
0f1e59deac mesa: accept GL_FIXED in glVertexAttribPointer (ARB_ES2_compatibility)
GL_FIXED should not be accepted in the other gl*Pointer calls in OpenGL.

There is a new piglit for this: arb_es2_compatibility-fixed-type.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Brian Paul
076bd11112 mesa: fix error string, remove out of date comment 2011-04-29 18:42:09 -06:00
Brian Paul
be293c14c6 mesa: remove commented-out #include 2011-04-29 18:40:56 -06:00
Thierry Vignaud
04bdb2f314 mesa: fix tarball creation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-29 17:56:35 -06:00
Eric Anholt
6a02679f01 i965/gen6: Fix LogicOp handling for GL_COPY and/or floating-point RTs.
We were accidentally leaving blending enabled for LogicOp GL_COPY,
which ARB_color_buffer_float/GL_RGBA32F-render (and friends) caught.
Additionally, the GL spec says that no LogicOp should be done to
floating-point targets, and the GPU gets really angry even if you say
to LogicOp GL_COPY to float.
2011-04-29 15:27:02 -07:00
Eric Anholt
3032582d03 i965: Remove dead entrypoints to state cache, rename the one that's left.
As we expanded the usage of the state cache, it grew extra
functionality.  However, with the recent state streaming rework, we're
back to the state cache being used only for shader kernels, which is
the piece of GPU state that's actually expensive to compute again from
scratch, since it involves compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:27:02 -07:00
Eric Anholt
acb4d5cd96 i965/gen4: Move the GS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:56 -07:00
Eric Anholt
8ba0c025a4 i965/gen4: Move clip state to state streaming
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
d6ba7b1603 i965: Drop the now unused brw_cache_data() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
bb7ff01deb i965: Fix up state dumping for SF state.
It was moved to state streaming a while back and this was left over.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
588cebce2d i965/gen4: Move VS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:43 -07:00
Eric Anholt
04e3f1d3c2 mesa: Add a bunch of documentation to the register allocator.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:34 -07:00
Eric Anholt
a82a43e8d9 i965/gen6: Use the dynamic state base address to reduce relocations.
Now that all the dynamic state is streamed through the top of the
batchbuffer, we can cut out many of our relocations to that state by
using the base address.

Improves 3DMMES taiji performance 3.3% +/- 0.4% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:23 -07:00
Eric Anholt
855f56ca13 i965/gen6: Move scissor state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:18 -07:00
Eric Anholt
5c742ea1ee i965: Move sampler state to state streaming.
Overall, across this series since the last set of numbers, gen6 3DMMES
taiji performance has dropped 0.8% +/- 0.3% (n=15), probably due to
the increased reissuing of state from some of the state objects that
otherwise never changed, and increased occurrence of the per-batch
overhead as we've increased how much we put in the batch BO without
increasing the batch BO's size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:14 -07:00
Eric Anholt
1a447749ed i965/gen4: Move WM state to state streaming.
The samplers are about to become streamed for gen6 performance, which
would cause this unit to blow out the state cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:04 -07:00
Eric Anholt
c108a3f863 i965/gen6: Move the depth/stencil state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:59 -07:00
Eric Anholt
35e8fe5c99 i965/gen6: Move the blend state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:54 -07:00
Eric Anholt
2ee1fd2e8f i965/gen6: Move the color calc state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:50 -07:00
Eric Anholt
d67c08319f i965: Move the CC VP to state streaming.
This is in a way a revert of f5bb775fd1.
The tiny win that had will be overwhelmed by the win of using the gen6
dynamic state base address.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:49 -07:00
Eric Anholt
8d2047ca7e i965/gen6: Move the SF VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:45 -07:00
Eric Anholt
3628e123f1 i965/gen6: Move the clip VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:41 -07:00
Eric Anholt
32cc0c9d8d i965/gen6: Stream the VS push constants.
Improves 3DMMES taiji demo performance by 10.1% +/- 0.9% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:37 -07:00
Eric Anholt
90c70123b8 i965/gen6: Stream the WM push constants.
Improves 3DMMES taiji demo performance by 5.1% +/- 1.9% (n=15), by
reducing CPU time spent thrashing around those tiny little constant BOs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:30 -07:00
Eric Anholt
530de3a2f5 i965: Give the push constants and pull constants unique function names.
This helps clarify profiling results.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:23:21 -07:00
Eric Anholt
03b2e0fcdf i965: Fix fragcoord_w on gen6 with 16-wide.
The payload regs can go all the way up to register 60+, so just give
them 8 bits to be addressed by instead of 3-4 (which made source_w_reg
of 8 end up 0).  There's no reason to aggressively pack these fields,
as they are just used as compiler information, where being easier to
access is probably more important than shaving a byte or two off of
the structure.

Fixes piglit fragcoord_w.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36649
2011-04-29 12:25:21 -07:00
Eric Anholt
8c1637a4c2 meta: Don't ask for floating point textures if not ARB_texture_float.
I was promoting to float for ARB_color_buffer_float unclamped, which
failed when ARB_texture_float wasn't present.  Since the metaops don't
need results outside of [0,1] when not drawing to a floating point
destination, they can just use a fixed point texture when floating
point destinations are impossible.

Fixes regression in fdo23670-depth_test when --enable-texture-float is
not present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36473
2011-04-29 12:02:44 -07:00
Brian Paul
2be2e1d3ad mesa: fix a few incorrect error messages 2011-04-29 12:03:48 -06:00
Benjamin Franzke
dc520d4fef egl/wayland: Fix possible lockup in drm initialization
Lockup happens when wl_drm interface is not available.
2011-04-29 17:05:16 +02:00
Jon TURNEY
8a58eccc62 Add git_sha1.h to .gitignore
Since commit de579a1 "Include GIT SHA1 in GL version string"

$ git status
 On branch master
 Your branch is ahead of 'origin/master' by 2 commits.

 Untracked files:
   (use "git add <file>..." to include in what will be committed)

       src/mesa/main/git_sha1.h
nothing added to commit but untracked files present (use "git add" to track)

Add git_sha1.h to .gitignore so git knows not to warn it is present but untracked

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-29 12:56:53 +01:00
Marek Olšák
f8279fb9d8 r600g: print opcodes names instead of numbers 2011-04-29 13:16:40 +02:00
Marek Olšák
f974bdebee docs: update relnotes-7.11 2011-04-29 11:32:55 +02:00
Marek Olšák
aed76e5af3 docs: update GL3 status 2011-04-29 11:32:55 +02:00
Marek Olšák
aeac658e25 mesa: remove unused variable bytesPerRow 2011-04-29 11:32:55 +02:00
Marek Olšák
8b558451ad r600g: implement EXT_packed_float 2011-04-29 11:31:55 +02:00
Marek Olšák
e62530a6c0 st/mesa: support EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
631d23daa9 mesa: implement EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-29 11:31:55 +02:00
Marek Olšák
b48359184e util: implement R11G11B10_FLOAT pack/unpack functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1271424615 mesa, util: move RGB9E5 conversion functions to gallium/util
Also use MAX3 and incorporate Ian's suggestion in texformat.c.

I don't think wrapping u_format_rgb9e5.h in another header and thus making it
more complicated is worth it.
2011-04-29 11:31:55 +02:00
Marek Olšák
de9f55437a r600g: trivially implement EXT_texture_shared_exponent
Nothing else needed.
2011-04-29 11:31:55 +02:00
Marek Olšák
349184be36 util: implement R9G9B9E5 pack and unpack functions
softpipe and llvmpipe support done (sampler only).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1da44f5923 st/mesa: support EXT_texture_shared_exponent
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
9d7698c468 mesa: implement EXT_texture_shared_exponent
swrast support done.

There is no renderbuffer support in swrast, because it's not required
by the extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1d5f16ff8f mesa: set reasonable defaults in update_wrapper
I was wondering why I had been getting GL_RGBA for GL_RGB9_E5.

Instead of setting GL_RGBA and CHAN_TYPE for most types,
use the helper functions to obtain the info.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Christopher Egert
608a4a17fe i915g: Enable S3TC texture support
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-29 02:15:07 +02:00
Kenneth Graunke
19efd1442c prog_print: Add support for printing the TXD opcode.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-28 14:51:29 -07:00
Brian Paul
8cce283038 llvmpipe: move active_query assignment
Fixes piglit regression.
2011-04-28 12:41:49 -06:00
Johannes Obermayr
f20608b951 [g3dvl] Name of pkg-config file is libva.
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-04-28 19:06:39 +02:00
Johannes Obermayr
f6f773189b [g3dvl] Fix compile error.
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-04-28 19:04:27 +02:00
Brian Paul
284191560b llvmpipe: move active_query assignment in lp_setup_begin_query()
If we run out of bin memory and do an early return from
lp_setup_begin_query() we'd omit setting the setup->active_query
pointer.  Then, when lp_setup_end_query() was later called, the
assertion for setup->active_query == pq would fail.  Moving the
assigment in lp_setup_begin_query() avoids that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-28 07:51:55 -06:00
Christian König
2471acfc4c vdpau: start to implement MPEG2 decoder part 2011-04-27 20:38:31 +02:00
José Fonseca
fa7a051c25 sgi: Fix MSVC build.
Including windows.h was ineffective on MSVC because we define the NOGDI macro,
which skips the wingdi.h include.

Unsetting NOGDI is also a bad idea because it causes all sort of symbol
clashes with SGI code.

The real problem is that WINGDAPI was not being defined, also due to NOGDI,
so simply define it to blank if not done already.  This seems to make
everybody happy.
2011-04-27 19:06:07 +01:00
Brian Paul
f9cc6acbfa st/mesa: raise shader MaxParameters if driver supports more
The default value is 64 but drivers usually advertise more, like 4096.
Allows ARB vp/fp programs to use more parameters.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-27 11:58:42 -06:00
Brian Paul
f3c92c2323 mesa: emit more info in program parser error message 2011-04-27 11:57:04 -06:00
Brian Paul
0be6ae74e9 svga: emit user-defined clip plane state
User-defined clip planes were a swtnl fallback before.
2011-04-27 11:51:30 -06:00
Eric Anholt
33afdf8356 docs: Note that ES2_compatibility is already done. 2011-04-27 09:48:38 -07:00
Eric Anholt
aa3e1c25d3 Revert "intel: use throttle ioctl for throttling"
This reverts commit 50ade6ea69.

Fixes jerky rendering again on apps that don't block on the GPU per
frame and are GPU bound (e.g. 3DMMES on Ironlake).  The whole point of
this complicated throttle scheme is to wait on frame n-1 to have
started rendering before starting frame n's rendering.  Otherwise, the
GPU-bound app will race ahead and call the GL to draw many
nearly-identical frames, then >0ms later get stuck waiting for them
(all dispatched at about the same time) to retire, then render a new
batch of nearly-identical frames.
2011-04-27 09:48:26 -07:00
Brian Paul
66d95919d5 st/mesa: choose 3-component float formats before 4-component formats
If GL_RGB16F or GL_RGB32F is specified let's try the 3-component float
texture formats before trying the 4-component ones.  Before this,
GL_RGB16/32F were treated the same as GL_RGBA16/32F.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-27 09:06:31 -06:00
Brian Paul
48aa772589 st/mesa: whitespace fixes 2011-04-27 09:05:30 -06:00
Christian König
563f6c225c [g3dvl] make clear color configureable 2011-04-27 16:50:34 +02:00
Christian König
221e1b7aba [g3dvl] make reset_dirty_area a public interface 2011-04-27 15:28:13 +02:00
Christian König
0d53cb2e83 [g3dvl] implement clearing of dirty destination surface areas 2011-04-27 15:19:35 +02:00
Marek Olšák
b8de75d537 util: make macros MIN3, MAX3, MIN4, MAX4 little more efficient 2011-04-27 13:16:35 +02:00
Marek Olšák
069a9766a9 mesa: add macros MIN3 and MAX3 2011-04-27 13:16:35 +02:00
Marek Olšák
7e5953fca2 gallium/nouveau: fix printf warnings 2011-04-27 13:16:35 +02:00
Marek Olšák
31200d0688 gallivm: fix warning: ‘value’ may be used uninitialized in this function
The path where it's uninitialized is guarded by an assert.
2011-04-27 13:16:35 +02:00
Marek Olšák
e031bed122 st/mesa: fix warning: ‘user_memory’ may be used uninitialized in this function
It's initialized later in a conditional the condition of which is always true
the first time it's evaluated.
2011-04-27 13:16:35 +02:00
Marek Olšák
1e5dc6a778 svga: fix warning: ‘uc.ui’ may be used uninitialized in this function
This is safe because it's initialized if buffers & PIPE_CLEAR_COLOR and
probably doesn't have any effect otherwise.
2011-04-27 13:16:35 +02:00
Christian König
6092fbed46 [g3dvl] move compositor src and dst normalisation into layer setting 2011-04-27 13:01:01 +02:00
Christian König
559f6d6cf4 [g3dvl] fix setting width, height and chroma format in video buffer 2011-04-27 12:59:30 +02:00
nobled
39cd791f34 os: simplify ifdef
The actual code that needs this include is just using
"if defined (PIPE_OS_UNIX)", and the two conditions should match.

This should also make the file compile under Hurd.
2011-04-27 11:35:02 +01:00
Christian König
f3f212acf0 xvmc: recreate drawable surface only when dst area changes 2011-04-27 12:05:46 +02:00
Christian König
76d881b8b0 [g3dvl] fix a couple of bugs around paletted subpictures 2011-04-27 10:41:19 +02:00
Brian Paul
2d422a6c48 docs: fix typo, wrap lines in 7.11 release notes 2011-04-26 14:58:33 -06:00
Brian Paul
83eda35f16 docs: add GL_ARB_robustness to 7.11 release notes 2011-04-26 14:57:57 -06:00
Brian Paul
6b329b9274 Squashed commit of the following:
commit 864fe253b04105b7469e5f7b064dc37637b944f8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 21 20:13:07 2011 -0600

    mesa: s/exec/disp/ in _mesa_init_histogram_dispatch()

    This function isn't normally compiled (FEATURE_histogram).

commit f4bf45e2b94b582cacd19cdca873c5be627e4250
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: hook up GL_ARB_robustness dispatch functions

    ...and advertise the extension.

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 2b89e38e5f572dc40cebc06381ae7c5d04386998
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: regenerated API files for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    glapi: add ARB_robustness xml

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: implement GL_ARB_robustness functions

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 938fd71f4c4742f274922d53492a7290ab8d9c9b
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add context fields for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 72075137bc79e65be03dac7e97b6dba93c3a86a4
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize more bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 32a3fc23746db49da903fbc08afa0135af3007d2
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize some bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit cecbf1f4d164207de373dec0cadee2e84e1f9656
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add more bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit edc895b52383d5bd274422db56adead1d81daf5f
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 3a96ef28a538f158a219b406cd090dee70470c85
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: use is_bufferobj() helper function

    Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-26 14:54:41 -06:00
Eric Anholt
37642518b8 i965/fs: Add support for compute-to-mrf in 16-wide mode.
This is more painful than instruction scheduling, as we have to
compare two MRF writes to see if they coincide, and have to handle
partial GRF writes before that (for example, the result of a math
instruction written to color).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:22 -07:00
Eric Anholt
445289b509 i965/fs: Typo fix a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:19 -07:00
Eric Anholt
0834607a89 i965/fs: Enable constant propagation in 16-wide.
All that needed fixing was skipping the newly-possible
uncompressed/sechalf partial GRF constant writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:16 -07:00
Eric Anholt
91d1a14158 i965/fs: Fix and enable the instruction scheduler for 16-wide.
Most of the work of the scheduler is agnostic to wide dispatch.  It
operates on our virtual GRF file, which means instructions are
generally referring to 8 or 16 wide naturally.  For the MRF file
management we're trying to track the actual hardware MRF file, so we
need to watch if an instruction writes multiple MRFs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:12 -07:00
Eric Anholt
3b20f999bb i965/fs: Add support for 16-wide dispatch with uniforms in use.
This is glued in in a bit of an ugly way -- we rely on the uniforms
having been set up by 8-wide dispatch, and we just reuse them without
the ability to add new uniforms for any reason, since the 8-wide
compile is already completed.  Today, this all works out because our
optimization passes are effectively the same for both and even if they
weren't, we don't reduce the set of uniforms pushed after
optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:05 -07:00
Eric Anholt
b061b5ffb0 hash_table: Add an iterator for doing things like cleanup of the HT.
Without this, consumers often have to keep linked lists of the
entries, at additional malloc cost.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:02 -07:00
Eric Anholt
b943b9b1a6 i965/fs: Add a little whitespace between shader dumping debug.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:59 -07:00
Eric Anholt
9c57780dc0 i965/fs: Add support for compr4 MRF writes.
These reduce an emitted (not decoded) instruction per shader on
g4x/gen5, but may allow for additional register coalescing as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:52 -07:00
Eric Anholt
42ad2f0b9b i965/fs: Add support for 16-wide dispatch on gen5.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:49 -07:00
Eric Anholt
662f1b48bd i965/fs: Add initial support for 16-wide dispatch on gen6.
At this point it doesn't do uniforms, which have to be laid out the
same between 8 and 16.  Other than that, it supports everything but
flow control, which was the thing that forced us to choose 8-wide for
general GLSL support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:46 -07:00
Eric Anholt
76b7a0c1af i965/fs: Add support for discard instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:43 -07:00
Eric Anholt
148a32e622 i965/fs: Add support for math instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:40 -07:00
Eric Anholt
54990673a6 i965/fs: Fix interference calculation of pixel_[xy] in 16-wide.
Fixes glsl-fs-ceil in that mode, which produced the code in the comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:33 -07:00
Eric Anholt
af20328271 i965/fs: Disable some optimization passes under 16-wide for now.
These are fixable for 16, but that can wait until after it's basically
working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:30 -07:00
Eric Anholt
8575d18362 i965/fs: Add support for 16-wide texturing on gen5+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:27 -07:00
Eric Anholt
141b0bb277 i965/fs: Add support for computing pixel_[xy] in 16-wide.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:25 -07:00
Eric Anholt
2ac1cb8b83 i965/fs: Add support for 16-wide dispatch to the register allocator.
Note that the virtual grfs are in increments of the dispatch_width,
not hardware registers -- this makes the 16-wide emit and 8-wide emit
mostly the same.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:21 -07:00
Eric Anholt
7c647a2fe9 i965: Move the destination reg setup for 8/16 wide to the emit code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:05 -07:00
Kristian Høgsberg
5dfba09d49 intel: Use tiling for dri2AllocateBuffer implementation 2011-04-26 13:26:34 -04:00
Kristian Høgsberg
7363088f9f intel: Set gen in intelInitScreen, just copy value in intelInitContext 2011-04-26 13:26:31 -04:00
Kristian Høgsberg
63325a0586 intel: Use X tiling for DRM EGL Images 2011-04-26 13:26:28 -04:00
Christian König
e602ecf9ef r600g: revert commit 68cc6bc5d8
Revert commit "remove the unneeded bo from COLOR[0-9]_INFO
Also implement a working alternative.
2011-04-26 19:09:45 +02:00
Christian König
2516a46544 vdpau: implement OutputSurfaceDestroy 2011-04-26 11:49:31 +02:00
Christian König
67d93ea940 vdpau: implement PresentationQueueDestroy 2011-04-26 11:48:33 +02:00
Christian König
13a50bd47d vdpau: implement VideoMixerDestroy 2011-04-26 11:16:54 +02:00
Christian König
38bd813177 vdpau: add stups for the missing functions 2011-04-26 11:12:59 +02:00
Ian Romanick
cd354b4eb8 mesa: Remove SWcontext::_FogMode, use gl_context::gl_fog_attrib::Mode everywhere
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-25 18:27:17 -07:00
Kristian Høgsberg
f274dfaca4 egl: Use the right extension name in #ifdef 2011-04-25 15:34:04 -04:00
Kristian Høgsberg
b6ed837ffe wayland: Fix prototypes for EGL_WL_bind_wayland_display extension 2011-04-25 15:07:15 -04:00
Nicolas Kaiser
4dfbb81891 main: remove duplicated includes
Remove duplicated includes of guarded headers.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-25 11:03:01 -06:00
Benjamin Franzke
6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke
d72e7f0dd9 st/egl: Add wayland shm softpipe support 2011-04-25 10:45:57 -04:00
Benjamin Franzke
34fd282b27 st/egl: Generalize wayland backend a bit 2011-04-25 10:45:56 -04:00
Benjamin Franzke
aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Henri Verbeet
b2a98c3531 r600g: Unify comment style somewhat.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:22 +02:00
Henri Verbeet
d7577ae3a6 r600g: Cleanup the big endian support a bit.
In particular, make sure the code is at least compiled on little endian
systems.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Henri Verbeet
32001c2244 r600g: Use EG constants in EG r600_colorformat_endian_swap().
This would actually fail to compile when PIPE_ARCH_BIG_ENDIAN is defined.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Marek Olšák
596f09aa7b r300g: implement draw_instanced for HWTCL 2011-04-25 14:04:51 +02:00
Marek Olšák
0fecb928f5 configure.ac: require LLVM for r300g on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
a86fc719d6 configure.ac: enable LLVM by default on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
9e59ed59c1 mesa: add stricter checks for float formats in the texstore memcpy path
E.g. when the internal format was RGBA16F and the source was RG, it would use
memcpy.
2011-04-25 13:45:05 +02:00
Marek Olšák
628544421d mesa: implement generate-mipmap fallback for RGB10_A2
I hit this when testing RV350, which lacks RGB10_A2 render target
support. It had been missed when implementing the format and probably
unused by anything else too.

Not applicable to 7.10.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-25 13:45:05 +02:00
Christian König
5aa2641243 vdpau: implement and cleanup PresentationQueueTarget destruction 2011-04-25 11:39:41 +02:00
Christian König
7cde6722b0 xvmc: futher optimize ycbcr upload 2011-04-25 10:33:48 +02:00
Vinson Lee
077b1a6144 r600g: Remove r600_helper.c from SConscript.
This is a follow-up to commit d737857ed2.
2011-04-24 23:58:39 -07:00
Marek Olšák
774c165d76 docs: update GL3 status 2011-04-25 01:54:12 +02:00
Marek Olšák
71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák
512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Marek Olšák
def6a91a62 r600g: trivially implement LATC/3DC
Passes fbo-generatemipmap-formats.
2011-04-25 01:20:40 +02:00
Christian König
7f04fe5338 [g3dvl] merge idct stage 2 and mc ycbcr stage into a single draw 2011-04-25 01:20:15 +02:00
Dave Airlie
d737857ed2 r600g: drop r600_helper.c no point in it
move the one function into state common

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 09:06:14 +10:00
Dave Airlie
de48199693 r600g: enable EXT_draw_buffers2
Doesn't cause any piglit regression and passes the fbo-draw-buffers-blend
test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 06:55:09 +10:00
Dave Airlie
863eecd0d8 st/mesa: fix regression since a22aba4eae
"st/mesa: check image size before copy_image_data_to_texture()" caused
a regression in piglit fbo-generatemipmap-formats test on all gallium drivers.

Level 0 for NPOT textures will not match minified values, so don't do this
check for level 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 05:59:47 +10:00
Christian König
104ac00663 [g3dvl] rework fence handling and add r600g workaround 2011-04-24 20:08:11 +02:00
Christian König
3ea7e2713c [g3dvl] start supporting different render target formats
Let's start with NV12, but anything else shouldn't be much of a problem any more.
2011-04-24 19:29:34 +02:00
Christian König
b54909910c [g3dvl] remove resource_format workaround 2011-04-24 16:04:23 +02:00
Christian König
4e6528428d r600g: implement clamp_fragment_color handling
The first small step to get arb_color_buffer_float working.
2011-04-24 13:03:16 +02:00
Christian König
68cc6bc5d8 r600g: remove the unneeded bo from COLOR[0-9]_INFO
The COLOR[0-7]_INFO registers doesn't neeed a bo.
2011-04-24 12:47:42 +02:00
Dave Airlie
0a9cec3475 r600g: fix glean clipflat test.
the provoking vertex doesn't apply to quad/strip/polygon.

This fixes clipFlat on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 20:35:06 +10:00
Marek Olšák
0b3122cfcb r300g: reorder caps 2011-04-24 12:00:00 +02:00
Marek Olšák
0c71da18ee r300g: fix exposing caps on r300-r400
Broken with 72239d16cd.
2011-04-24 12:00:00 +02:00
Bryan Cain
f18a086326 glsl: Fix typos in comments. 2011-04-23 21:33:47 -07:00
Dave Airlie
6372660d12 r600g: fix glsl-fs-abs-neg
the hw does neg after abs, so don't neg the source in the ABS instruction case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 11:04:46 +10:00
Dave Airlie
77dc4c154c r600g: fix bank swizzle calcs for scalar only operations.
In the initial code if we had nothing in the vector slots r would
never get reset to 0, so we'd fail to compile shaders, after the previous
commit this would happen for the LIT tests. When I fixed that we did a lot
of unnecessary loops through all the vector states when we had no vector
slots filled. So this patch optimises thing for the scalar only state.

This fixes the 3 LIT piglit tests on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:33:19 +10:00
Dave Airlie
22d5a71e4d r600g: PV/PS have cycle restrictions in scalar operations
In the R600 ISA document:
Section 4.7.5 Cycle restrictions for the ALU.trans states that
PV/PS have cycle restrictions wrt constants.

This is part of a fix for the LIT tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:30:08 +10:00
Eric Anholt
e4da46e007 mesa: Add some comments about FRAG_RESULT_COLOR vs FRAG_RESULT_DATAn.
This came from reading what swrast does, and 965 now behaves the same
and gallium appears to as well.
2011-04-23 13:21:58 -07:00
Eric Anholt
d7f4c4e1b1 mesa: Fix fragment.color (no index) writes with OPTION ARB_draw_buffers.
Fixes a bug in Trine where fragment.color would write
FRAG_RESULT_COLOR (which is interpreted by drivers as being the "write
this to all color buffers" option) instead of FRAG_RESULT_DATA0 (just
the first target).

Fixes piglit ATI_draw_buffers/arbfp-no-index.
2011-04-23 13:21:57 -07:00
Eric Anholt
79bde19ef9 i965: Don't double-emit fragment.color writes for MRT with ARB_fp. 2011-04-23 13:21:57 -07:00
Eric Anholt
bad8da8b00 i965: Fill in the remaining fields of gen5+ sampler default color.
Still doesn't fix texwrap.
2011-04-23 13:21:57 -07:00
Eric Anholt
e1e6545c88 i965: Fix batch decode for the gen5+ sampler default color. 2011-04-23 13:21:57 -07:00
Eric Anholt
1f32c665c8 intel: Add support for ARB_sampler_objects.
This extension support consists of replacing
"gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->".
One instance of referencing the texture's base sampler remains in the
initial miptree allocation, where I'm not sure we have a clear
association with any texture unit.

Tested with piglit ARB_sampler_objects/sampler-objects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
1df72402d9 i965: Add support for NV_conditional_render.
Since we lack hardware support for it, this is a simple matter of
checking _mesa_check_conditional_render at the entrypoints, and
suppressing it for the metaops where it doesn't apply.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
332822bd3d swrast: Disable glAccum drawing during conditional rendering. 2011-04-23 13:21:56 -07:00
Eric Anholt
fb60040b69 meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.
The NV_conditional_render spec calls out specific operations that
conditional rendering applies to, which doesn't include these.

Fixes NV_conditional_render/generatemipmap on swrast.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
4093fdce6d i965: Add support for ARB_texture_compression_rgtc.
Tested with rgtc-teximage-0[12].
EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT
just like S3TC does.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
7d1a2056a8 mesa: Don't assert on the compressed convertformat for GenerateMipmaps.
This assertion doesn't make any sense to me -- the convertFormat is
already something valid (tested above), and the BaseFormat dictated by
convertFormat doesn't matter to the function about to be called (it's
the datatype/comps that were pulled out of convertFormat).

Fixes assertion failure in
GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats

(still has a rendering failure in NPOT like S3TC does).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
bc880b8d40 mesa: Choose RGTC formats for GL_COMPRESSED_RED, GL_COMPRESSED_RG.
We were falling through to the default R8 and RG88 formats instead of
compressing when possible.  Noticed by swrast fbo-blending-formats
actually doing rendering.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
José Fonseca
da49de811d mesa/gdi: Address compiler warnings.
In particular the function prototypes.
2011-04-23 20:25:11 +01:00
José Fonseca
5bd545f5aa mesa/gdi: Remove InitCritSections.cpp.
We are now able to declare global critical sections through other
mechanisms so this is useless code.
2011-04-23 18:44:19 +01:00
José Fonseca
336487450e Drop fx windows driver.
Irrelevant now that glide driver was removed.
2011-04-23 18:32:56 +01:00
Jakob Bornecrantz
fed8a07ddb glu: Fix linux build 2011-04-23 17:01:19 +02:00
Jakob Bornecrantz
97efac09b2 glu: Clone the enviroment 2011-04-23 16:58:48 +02:00
Christian König
fa31b1095e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configs/linux-dri
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state.c
	src/gallium/include/pipe/p_format.h
	src/gallium/tests/graw/fragment-shader/frag-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-add.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-2d.sh
	src/gallium/tests/graw/fragment-shader/frag-dp3.sh
	src/gallium/tests/graw/fragment-shader/frag-dp4.sh
	src/gallium/tests/graw/fragment-shader/frag-dst.sh
	src/gallium/tests/graw/fragment-shader/frag-ex2.sh
	src/gallium/tests/graw/fragment-shader/frag-face.sh
	src/gallium/tests/graw/fragment-shader/frag-flr.sh
	src/gallium/tests/graw/fragment-shader/frag-frc.sh
	src/gallium/tests/graw/fragment-shader/frag-kil.sh
	src/gallium/tests/graw/fragment-shader/frag-lg2.sh
	src/gallium/tests/graw/fragment-shader/frag-lit.sh
	src/gallium/tests/graw/fragment-shader/frag-lrp.sh
	src/gallium/tests/graw/fragment-shader/frag-mad-immx.sh
	src/gallium/tests/graw/fragment-shader/frag-mad.sh
	src/gallium/tests/graw/fragment-shader/frag-max.sh
	src/gallium/tests/graw/fragment-shader/frag-min.sh
	src/gallium/tests/graw/fragment-shader/frag-mov.sh
	src/gallium/tests/graw/fragment-shader/frag-mul.sh
	src/gallium/tests/graw/fragment-shader/frag-rcp.sh
	src/gallium/tests/graw/fragment-shader/frag-rsq.sh
	src/gallium/tests/graw/fragment-shader/frag-sge.sh
	src/gallium/tests/graw/fragment-shader/frag-slt.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-absneg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-neg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-swz.sh
	src/gallium/tests/graw/fragment-shader/frag-sub.sh
	src/gallium/tests/graw/fragment-shader/frag-tempx.sh
	src/gallium/tests/graw/fragment-shader/frag-xpd.sh
	src/gallium/tests/graw/vertex-shader/vert-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-add.sh
	src/gallium/tests/graw/vertex-shader/vert-arl.sh
	src/gallium/tests/graw/vertex-shader/vert-arr.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-2d.sh
	src/gallium/tests/graw/vertex-shader/vert-dp3.sh
	src/gallium/tests/graw/vertex-shader/vert-dp4.sh
	src/gallium/tests/graw/vertex-shader/vert-dst.sh
	src/gallium/tests/graw/vertex-shader/vert-ex2.sh
	src/gallium/tests/graw/vertex-shader/vert-flr.sh
	src/gallium/tests/graw/vertex-shader/vert-frc.sh
	src/gallium/tests/graw/vertex-shader/vert-lg2.sh
	src/gallium/tests/graw/vertex-shader/vert-lit.sh
	src/gallium/tests/graw/vertex-shader/vert-lrp.sh
	src/gallium/tests/graw/vertex-shader/vert-mad.sh
	src/gallium/tests/graw/vertex-shader/vert-max.sh
	src/gallium/tests/graw/vertex-shader/vert-min.sh
	src/gallium/tests/graw/vertex-shader/vert-mov.sh
	src/gallium/tests/graw/vertex-shader/vert-mul.sh
	src/gallium/tests/graw/vertex-shader/vert-rcp.sh
	src/gallium/tests/graw/vertex-shader/vert-rsq.sh
	src/gallium/tests/graw/vertex-shader/vert-sge.sh
	src/gallium/tests/graw/vertex-shader/vert-slt.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-absneg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-neg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-swz.sh
	src/gallium/tests/graw/vertex-shader/vert-sub.sh
	src/gallium/tests/graw/vertex-shader/vert-xpd.sh
	src/gallium/tools/trace/dump.py
	src/gallium/tools/trace/format.py
	src/gallium/tools/trace/model.py
	src/gallium/tools/trace/parse.py
2011-04-23 14:27:40 +02:00
José Fonseca
c2c44f2641 docs: Remove MSVS project files.
They were totally broken for several releases.

scons now builds everything the project files built and more, and can be
kept up-to-date with little effort.
2011-04-23 13:18:45 +01:00
José Fonseca
d34ddad9a5 scons: Build glu. 2011-04-23 13:16:03 +01:00
Christian König
24d76d2966 [g3dvl] cleanup error handling 2011-04-23 13:58:08 +02:00
José Fonseca
15eaf8297e scons: Build classic mesa gdi driver.
Build as

  scons platform=windows mesagdi
2011-04-23 12:41:28 +01:00
Christian König
2e6274fc3b [g3dvl] make ycbcr stream and block data a public interface 2011-04-23 13:24:35 +02:00
José Fonseca
4c92f3fa6e osmesa: Fix Mingw build.
Build as

  scons platform=windows osmesa
2011-04-23 12:23:42 +01:00
José Fonseca
8e8a56eaa0 scons: Build osmesa.
Just type

  scons osmesa
2011-04-23 12:22:59 +01:00
José Fonseca
c89cca648d mapi/glapi: Avoid warnings about visibility being unsupported on MinGW. 2011-04-23 12:14:39 +01:00
José Fonseca
abda64efce mesa/vf: Remove.
Unused.  Probably replaced by translate module.
2011-04-23 11:49:41 +01:00
José Fonseca
de29ee0e6d graw: Replace dead symlinks to delete python statetracker shaders with their contents. 2011-04-23 11:07:27 +01:00
Christian König
f0819a22f3 [g3dvl] start implementing zscan and quantification
Not 100% complete, but at least a good start.
2011-04-23 03:37:05 +02:00
Brian Paul
931432fea6 draw: fix point/line/tri flushing bug in vbuf code
Need to reset the point/line/tri functions to point to the "first"
versions whenever we flush vertices.  Fixes unfilled polygon rendering
errors seen in demos/samples/logo.c.  See comments for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-04-22 13:39:50 -06:00
Marek Olšák
72239d16cd r300g: do not advertise color_buffer_float on r300 and r400
It seems they can't do unclamped vertex colors. Tested on RV350.
2011-04-22 20:25:24 +02:00
Marek Olšák
9d07ff63fc r300/compiler: fix up error message 2011-04-22 20:25:24 +02:00
Benjamin Franzke
01b036adea egl/wayland: Follow buffer.attach removal 2011-04-22 12:21:46 -04:00
Benjamin Franzke
b1a9172277 egl/wayland: Update to buffer.damage addition 2011-04-22 12:21:37 -04:00
Marek Olšák
5b2ff543ab configure.ac: fix up the help text for --enable-gallium-r300 2011-04-22 16:56:31 +02:00
Marek Olšák
673cec467a r300g: disallow A16F,L16F,LA16F,I16F texture formats on DRM<2.8.0 2011-04-22 16:19:41 +02:00
Benjamin Franzke
400a99a679 st/egl: Update to wayland protocol,egl changes 2011-04-22 08:56:36 -04:00
Benjamin Franzke
f09c66b3cc egl_dri2: Create wl_buffers for pixmap surfaces
Needed since wayland-egl doesnt do this anymore.
2011-04-22 08:56:33 -04:00
Benjamin Franzke
1617b268ef egl/wayland: Add new version parameter for post_drm 2011-04-22 08:56:30 -04:00
Benjamin Franzke
2225397d1c egl/wayland: Fix prefixes for interface names 2011-04-22 08:56:27 -04:00
Marek Olšák
1faf079a69 swrast: fix readpix clamping
Broken with e5c6a92a12. (ARB_color_buffer_float)

Clamping should occur if type != float, otherwise the MSBs of the resulting
pixels are killed off. For example, reading back LUMINANCE = R+G+B can be
greater than 0xff, but the result is naturally masked by 0xff
for UNSIGNED_BYTE, leading to bogus results.

The following bug report seems to want clamping to occur if type == half_float
too. Not sure what's correct.

Bug: [bisected pineview] oglc case pxconv-read failed
https://bugs.freedesktop.org/show_bug.cgi?id=35852

Tested by: Fang Xun <xunx.fang@intel.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-22 06:35:36 +02:00
Kristian Høgsberg
7142a67473 WL_bind_wayland_display: clarify that context must be NULL 2011-04-21 23:47:59 -04:00
Ian Romanick
d439491a77 i915: Gut all remaining bits of hardware fog
None of this ever gets used.  Fog is always calculated by a fragment
program.  Even though the fixed-function fog unit is never used, state
updates are still sent to the hardware.  Removing those spurious state
updates can't hurt performance.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:41 -07:00
Ian Romanick
499f7c0114 i915: i915_context::vertex_fog is always I915_FOG_NONE, so kill it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:38 -07:00
Ian Romanick
c41cb17037 i915: There's always a fragment program
Fragment programs are generated by core Mesa for fixed-function.
Because of this, there's no reason to handle cases where there is no
fragment program for fog.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:35 -07:00
Ian Romanick
8fc5ed18bc i915: Delete disabled try_pixel_fog paths
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:32 -07:00
Ian Romanick
4d203a01e2 mesa: Kill gl_fragment_program::FogOption with fire
All drivers expect this to always be GL_NONE.  Don't let there be any
opportunity for a bad value to leak out and infect some unsuspecting
driver.  If any driver for hardware that had fixed-function
per-fragment fog (i915 and perhaps some r300-ish) was ever going to
add support, it would have done it by now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:29 -07:00
Ian Romanick
df7555e763 i915: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:26 -07:00
Ian Romanick
8780c38983 i965: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:24 -07:00
Ian Romanick
f0188d4b08 mesa: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:21 -07:00
Ian Romanick
3aa21f93dc mesa: Fix bugs in ff fragment shader fog handling
This patch fixes two bugs related to fog in the fixed-function
fragment shader generation code.

Fog was only lowered to instructions if MRTs were used.  The fragment
shader assembler always lowers "fog option" code to instructions, and
many drivers (e.g., r300) expect this.

When fog lowering did happen, it was after the instruction count was
checked against implementation limits.  Since fog lowering may add up
to 5 instructions, a program that was below the limits before lowering
may exceed the limits after lowering.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:18 -07:00
Brian Paul
a22aba4eae st/mesa: check image size before copy_image_data_to_texture()
We should only copy images into the dest texture if the size is correct.
This fixes a failed assertion when finalizing a texture with mis-defined
mipmap levels such as:
level 0: 32x32
level 1: 8x8

Also, fix incorrect mipmap level used in assertion at the top of
copy_image_data_to_texture().

NOTE: This is a candidate for the 7.10 branch.
2011-04-21 13:02:02 -06:00
Marek Olšák
4ad63659c0 galahad,util: warn on resource target mismatch in copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
f9dafcb8f2 st/mesa: implement CopyBufferSubData using resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
883d8a0b44 gallium: add fallback for copying buffers to all drivers
Just to keep drivers working.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
64f55216e4 util: add a simple memcpy path for copying buffers in util_resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Kenneth Graunke
08ba9778db glsl/ast_to_hir: Only use the local 'type' variable as a temporary.
Lots of code (deleted by this patch) tried to make type == result->type,
but not all cases did.  Don't pretend; just use result->type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-20 16:46:17 -07:00
Kenneth Graunke
dfaaf7c5e8 i965: Remove dead vertex buffer structs.
We do this OUT_BATCH-style in brw_draw_upload.c.
2011-04-20 16:43:52 -07:00
Kristian Høgsberg
c0f8c9911c wayland-egl: Update to wayland-egl.h changes, drop struct wl_egl_display 2011-04-20 17:47:20 -04:00
Brian Paul
42d377224a mesa: fix void pointer arithmetic warning 2011-04-20 12:04:25 -06:00
Eric Anholt
2ea0aa4cd9 docs: Mention that GLSL 1.30 is started.
Things definitely remaining todo: switch statements, clip distances.
On 965, we also need real integers in the VS, and implementations of
some things like isinf/isnan.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
6e13cbcb74 docs: Update for Intel ARB_texture_float and ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
d22e2ebe35 intel: Add support for ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
99fa449bb9 meta: Add support for ARB_color_buffer_float to _mesa_meta_Clear().
Tested with piglit arb_color_buffer_float-clear.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b249197259 meta: Add support for ARB_color_buffer_float to _mesa_meta_DrawPixels.
Tested with piglit arb_color_buffer_float-drawpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
87478cd6e3 intel: Add support for ARB_texture_float.
For 1 and 2-channel formats the hardware only supports rendering to R
and RG.  To do I and L render targets we just call them R and
everything works out.  For A, we would need to rewrite the CC to do
the alpha channel's blending on color instead, and send the fragment
alpha down the red channel.  For LA, there doesn't seem to be any
hope, because we can't do independent color/alpha blending while
treating the LA surface as RG.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
0bbbeba2db intel: Add support for blit copies of >32bpp formats.
The blitter only does up 32bpp at a time, so we handle it by mangling
coordinates and calling the surface 32bpp.

Fixes ARB_texture_rg/fbo-generatemipmap-formats-float with ARB_texture_float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b31a99367c mesa: Add renderbuffer accessors for A, I, L, FLOAT32.
Of these, intel will be using I and L initially, and A once we rewrite
fragment shaders and the CC for rendering to it as R.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
bad08969b5 mesa: Add renderbuffer accessors for MESA_FORMAT_R_FLOAT32, RG_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
f7c26109c2 mesa: Add ChooseTexFormat fallbacks for floating point textures.
This covers X_FLOAT16 -> X_FLOAT32, and X -> RGBA_FLOAT32.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
ba99c2fbd9 mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
a45b757f78 swrast: Add LUMINANCE, INTENSITY, LUMINANCE_ALPHA to span asserts.
Fixes ARB_texture_float/fbo-alphatest-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Alex Deucher
abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Christian König
b7acf83d52 [g3dvl] make motion vector buffers a public interface 2011-04-20 13:44:26 +02:00
Fredrik Höglund
6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Brian Paul
8b7f760f83 translate: disable clamping of instanced array indexes
This fixes piglit's draw-instanced-divisor test for softpipe on both
the generic and SSE paths.  This is temporary until we have the
correct per-array max_index information.
2011-04-19 16:13:47 -06:00
Christian König
3511780a43 [g3dvl] revert commit 310eea52ca
Using a seperate vertex buffer for mc and ycbcr handling is still better.
2011-04-19 21:06:59 +02:00
Alex Deucher
08d1c91e6c r600g: add evergreen+ big endian support
Based on Cédric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:35:19 -04:00
Cédric Cano
843dfe3206 r600g: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:02:14 -04:00
Alex Deucher
b545b2987a r600c: add evergreen big endian support
Based on Cedric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Cédric Cano
3c3a259603 r600c: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Brian Paul
7a6061d7a6 Makefile: add missing Scons files 2011-04-19 09:07:44 -06:00
Thierry Vignaud
494b333b03 Makefile: add missing .cpp, .ll, .yy files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-19 08:34:06 -06:00
Dave Airlie
66866d642f r600g: add cb support for snorm formats.
Check for signed type and enable SNORM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 20:44:13 +10:00
Marek Olšák
5722286be2 configure.ac: rename --enable-gallium-radeon to --enable-gallium-r300
Also fix up the help string for both r300 and r600.
2011-04-19 12:28:51 +02:00
Marek Olšák
ab13ebf7c1 r200: enable some extensions
Such as:
- GL_ARB_half_float_pixel
- GL_ARB_vertex_array_object
- GL_APPLE_vertex_array_object
- GL_EXT_gpu_program_parameters
2011-04-19 12:23:41 +02:00
Dave Airlie
c98fa6be4b r600g: fix warnings with piglit texture-rg test.
Fill in the swaps for the formats to fix warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 18:45:58 +10:00
Dave Airlie
723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Tom Stellard
ffc1d166d2 r300/compiler: Fix dataflow analysis bug with ELSE blocks
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060
2011-04-18 21:27:03 -07:00
Bryan Cain
f41e1db327 glsl: fix conversions from uint to bool and from float/bool to uint
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-18 17:09:47 -07:00
Dave Airlie
f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen
02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie
c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Ian Romanick
edf2e4f79d glsl: 80-column wrapping and whitespace fixes 2011-04-18 17:06:08 -07:00
Kenneth Graunke
ff5dd55e26 i965: Convert 3DPRIMITIVE command from struct-style to OUT_BATCH style.
Most of the newer portions of the code use OUT_BATCH style.  I prefer
this style because it offers a clear distinction between a) hardware
messages/structures with a mandatory format, and b) data structures for
our own internal use that we can format however we want.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Kenneth Graunke
42a8057000 i965: Allocate the whole URB to the VS and fix calculations for Gen6.
Since we never enable the GS on Sandybridge, there's no need to allocate
it any URB space.

Furthermore, the previous calculation was incorrect: it neglected to
multiply by nr_vs_entries, instead comparing whether twice the size of
a single VS URB entry was bigger than the entire URB space.  It also
neglected to take into account that vs_size is in units of 128 byte
blocks, while urb_size is in bytes.

Despite the above problems, the calculations resulted in an acceptable
programming of the URB in most cases, at least on GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Ian Romanick
3d5cfcfed1 glsl: Emit a warning when the left-hand operand of a comma has no effect
The expression

    x = y, 5, 3;

will generate

    0:7(9): warning: left-hand operand of comma expression has no effect

The warning is only emitted for the left-hand operands, becuase the
right-most operand is the result of the expression.  This could be
used in an assignment, etc.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-18 14:43:48 -07:00
Brian Paul
7ca38f5d97 mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
2011-04-18 13:01:05 -06:00
Brian Paul
9418d05914 mesa: fix wrong parameter type in set_sampler_max_lod() 2011-04-18 12:43:42 -06:00
Brian Paul
1249e54f8b nvfx: comment-out unused var 2011-04-18 12:34:29 -06:00
Eric Anholt
dad95c112f intel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().
Fixes warnings in fbo-storage-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
bc57df0356 Revert "intel: Add spans code for the ARB_texture_rg support."
This reverts what remains of commit
28bab24e16.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
73f0700481 intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
2b624634dd swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
f0471d904c mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
a52803e108 mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
6ab9889a27 mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
0778fdb002 intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
9f164823c7 mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
155200c154 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
348ea34d03 mesa: Repack single-byte fields in gl_renderbuffer.
Cuts 8 out of 120 bytes in the struct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
91226ce648 mesa: Remove renderbuffer deletion debug field.
It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
641dd899bd swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
cd3568c329 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Marek Olšák
699ecec58c r300g: remove non-existing include path from SConscript 2011-04-18 03:07:46 +02:00
Marek Olšák
d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Thierry Vignaud
f79717d27a Fix mesa tarball creation again
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-18 01:26:47 +02:00
Marek Olšák
fc8e30edbc r600g: disable ARB_draw_instanced
The very presence of this extension breaks things.
This should bring us closer to being able to run Unigine Heaven.

The extension will be re-enabled once gl_InstanceID is implemented.
2011-04-18 00:44:17 +02:00
Marek Olšák
3f32efa2b8 r300g: disable ARB_draw_instanced on SWTCL chipsets.
This fixes Unigine Heaven.
2011-04-18 00:44:17 +02:00
Christian König
849bc838e8 [g3dvl] give each color component their own vertex buffer 2011-04-17 23:21:32 +02:00
Christian König
38a315b704 [g3dvl] no need for seperate mv vertex states any more 2011-04-17 21:31:31 +02:00
Eric Anholt
4673f9433f i965: Quit spamming gen6 DP read/write send instructions with gen5 bits.
This was copy-and-paste from originally trying to get DP read/write
working reliably, and notably for other common messages (URB, sampler)
we weren't doing this.
2011-04-17 10:26:09 -07:00
Eric Anholt
59c6b775a6 i965/fs: Add gen6 register spilling support.
Most of this is code movement to get the scratch space allocated in a
shared location.  Other than that, the only real changes are that the
old oword block messages now operate on oword-aligned areas (with new
messages for unaligned access, which we don't do), and that the
caching control is in the SFID part of the descriptor instead of
message control.

Fixes glsl-fs-convolution-1.
2011-04-17 10:26:09 -07:00
Eric Anholt
14eedf3028 mesa: Fix _mesa_unpack_dudv_span_byte assertion.
It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-17 10:26:09 -07:00
Christian König
b8a6e0e6fc [g3dvl] give mv their own vertex buffer back 2011-04-17 18:53:22 +02:00
Christian König
0a2310b375 [g3dvl] move blender state into idct code 2011-04-17 13:01:56 +02:00
Christian König
ca79aeb91e [g3dvl] rename vl_mpeg12_mc_renderer into vl_mc
It's still not 100% free from mpeg12 specific stuff,
but should now be a good start for other codecs.
2011-04-17 12:15:14 +02:00
Christian König
9c8bb28ca1 [g3dvl] move top/bottom field selection into mc code
Removes the workaround and get interlaced videos to work 100% correctly.
2011-04-17 12:04:18 +02:00
Carl Worth
9dacbe2226 glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion
with the following test case:

	#define A(a, b) B(a, b)
	#define C A(0, C)
	C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-17 01:02:24 -07:00
Dave Airlie
93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie
70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Marcin Slusarz
b5dfc38eea gallium: include u_format.h for util_format_is_supported
Without it gcc complains:
nv50_screen.c: In function ‘nv50_screen_is_format_supported’:
nv50_screen.c:48: warning: implicit declaration of function ‘util_format_is_supported’

and handles it wrongly - util_format_is_supported returns boolean, which is typedef'ed
to uchar, but function without prototype is assumed to return int.

For me nv50_screen_is_format_supported was returning true for float formats without
--enable-texture-float...
2011-04-17 01:15:52 +02:00
Christoph Bumiller
25a7f66214 nvc0: work around what looks like a code prefetch bug
Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.
2011-04-17 00:17:14 +02:00
Christoph Bumiller
f4ad25fefb nv50,nvc0: add new texture and render target formats 2011-04-17 00:17:14 +02:00
Christoph Bumiller
b4c7cd3fd6 nv50,nvc0: fix normalized RG16 and RGBA32 texture format entries 2011-04-17 00:17:14 +02:00
Christoph Bumiller
a582b859f7 nvc0: fix viewport rectangle calculation 2011-04-17 00:17:14 +02:00
Tom Stellard
97535699ee prog_optimize: Add simplify CMP optimization pass
This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP
instruction is the first instruction to write to register T0.
This pass is useful for hardware that requires a lot of lowering passes
that generate many CMP instructions.
2011-04-16 13:55:55 -07:00
Tom Stellard
257cc48de2 prog_optimize: get_src_arg_mask() respect writemask for more opcodes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-16 13:55:54 -07:00
Tom Stellard
0fa81d6d05 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-16 13:55:54 -07:00
Christian König
f1485e155a [g3dvl] make macroblock_size configurable in mc 2011-04-16 16:22:53 +02:00
Carl-Philip Haensch
d5a5893adc mesa: provide more info for glCompressedTexImage() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-16 08:13:47 -06:00
Brian Paul
af0e2ef8cc mesa: move error check code in compressedteximage()
This was mistakenly inside the #if FEATURE_ES block.
2011-04-16 08:05:14 -06:00
Christian König
cfe921a9b6 [g3dvl] remove dummy sampler from mc 2011-04-16 16:02:40 +02:00
Christian König
5294ac6223 [g3dvl] move mc fb and viewport handling into buffer object 2011-04-16 13:40:19 +02:00
Christian König
ff210aea7c [g3dvl] back to seperate mc for y and c planes 2011-04-16 13:04:04 +02:00
Christian König
ffcf287aa2 vdpau: implement VDPAU_DUMP option 2011-04-16 12:57:45 +02:00
José Fonseca
77db34b50d docs: Reapply some of Marek's typo fixes.
There were some typos too.
2011-04-16 11:15:29 +01:00
José Fonseca
bb78f6ad78 gallium/docs: Improve min_index/max_index description. 2011-04-16 10:18:20 +01:00
José Fonseca
4ee40c37a0 docs: Undo Marek typo fixes to original text.
Not really typos.
2011-04-16 09:41:00 +01:00
Christian König
c87b83d4b2 [g3dvl] give mc and ycbcr stage its own vertex element state 2011-04-15 22:15:17 +02:00
Christian König
b1c44b0ea6 [g3dvl] give mv and ycbcr stage its own vertex shader 2011-04-15 21:26:06 +02:00
Brian Paul
41b38bd21c translate: s/varient/variant/ 2011-04-15 10:16:53 -06:00
Brian Paul
0630593c5f vbo: init prim[] array with memset()
This fixes a Coverity warning about uninitialized data.
2011-04-15 08:33:20 -06:00
Brian Paul
1b800c10e4 vega: move ureg_destroy(ureg) after last use of ureg var 2011-04-15 08:33:20 -06:00
Brian Paul
2c57caa893 st/mesa: simplify a bit of the previous patch
Grrr, this was supposed to go in the previous commit.
2011-04-15 08:33:20 -06:00
Pierre-Eric Pelloux-Prayer
6e9c7c4c11 st/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels
With minor edits by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-15 08:30:10 -06:00
Marek Olšák
d2afae33f8 Revert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"
This reverts commit cd2857fae1.

It breaks Unigine Heaven.
2011-04-15 05:08:00 +02:00
Marek Olšák
9305922563 docs: update relnotes-7.11
I made a glxinfo diff between 7.10 and master and added missing items
and also sorted the list.
2011-04-15 05:08:00 +02:00
Marek Olšák
397e478683 docs: update GL3 status 2011-04-15 05:08:00 +02:00
Marek Olšák
75fa5c99a8 gallium: add and use generic function for querying patented format support (v2)
v2: Unsigned floats are allowed regardless of the configure switch.
2011-04-15 05:08:00 +02:00
Marek Olšák
848f7d368d configure.ac: add an enable switch for float textures (v2)
So --enable-texture-float it is.

Hardware drivers (including the Gallium ones) should
use #ifdef TEXTURE_FLOAT_ENABLED to hide any code that may
expose floating-point renderbuffers via any interface,
public or private.

v2: Print a warning when using --enable-texture-float.
2011-04-15 05:08:00 +02:00
Marek Olšák
2d12dbb28d docs: add patents.txt
Thanks to José Fonseca for writing this.
2011-04-15 05:08:00 +02:00
Marek Olšák
faba01d171 r300g: enable A/L/LA/I float render targets 2011-04-15 05:08:00 +02:00
Marek Olšák
8e28d842d1 st/mesa: convert Mesa float formats to Gallium
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    st/mesa: require RGBA16F and RGBA32F to be renderable
    st/mesa: fix L32F and L16F format translation
    st/mesa: also convert the R/RG float formats

commit 49a9948b6a81b7d813304d081139d98e95ba5d1a
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 20 10:36:17 2010 +0200

    mesa/st: enable ARB_texture_float if supported formats allow it

commit 7383632f7b6f9021b65f4973b7e7c99f0e8ce9b2
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:46 2010 +0200

    mesa/st: support ARB_texture_float internal formats

commit 7c362cc06982586c2d29fac55f6bcc4bcd1550b5
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:33 2010 +0200

    mesa/st: convert L/A/I floating point formats
2011-04-15 05:08:00 +02:00
Luca Barbieri
33128310b0 gallium: add A/L/LA/I floating point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
15f99d1362 mesa: finish up ARB_texture_float
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
2011-04-15 05:08:00 +02:00
Marek Olšák
0ecbb0ab74 mesa: add R/RG floating-point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
19648fcf01 mesa: fix L16F and L32F format properties 2011-04-15 05:08:00 +02:00
Carl Worth
3d78f83cde Add expected file for 095-recursive-define test case.
It's clear enough that the current segmentation fault isn't what we
want. And it's also very easy to know what we do want here, (just
check with any functional C preprocessor such as "gcc -E").

Add the desired output as an expected file so that the test suite
gives useful output, (showing the omitted output and the segfault),
rather than just reporting "No such file" for the expected file.
2011-04-14 16:20:49 -07:00
Carl Worth
02d293c08e glcpp: Simplify calling convention of parser's active_list functions
These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.
2011-04-14 15:35:41 -07:00
Christian König
4fc4f7b9ea [g3dvl] set ref samplers to linear again 2011-04-15 00:01:27 +02:00
Carl Worth
0b80f2d4c9 glcpp: Add --valgrind option to the glcpp-test utility
The common case for this test suite is to quickly test that everything
returns the correct results. In this case, the second run of the test
suite under valgrind was just annoying, (and the user would often
interrupt it).

Now, do what is wanted in the common case by default (just run the
test suite), and require a run with "glcpp-test --valgrind" in order
to test with valgrind.
2011-04-14 14:55:52 -07:00
Carl Worth
6affa4806a Add an expected file for 084-unbalanced-parentheses
The expected file here captures the current behavior of glcpp (which
is to generate an obscure "syntax error, unexpected $end" diagnostic
for this case).

It would certainly be better for glcpp to generate a nicer diagnostic,
(such as "missing closing parenthesis in function-like macro
definition" or so), but the current behavior is at least correct, and
expected. So we can make the test suite more useful by marking the
current behavior as expected.
2011-04-14 14:43:11 -07:00
Carl Worth
d3c6ed382d Add an expected file for 094-divide-by-zero-short-circuit
The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).
2011-04-14 14:42:52 -07:00
Christian König
10c49b2875 [g3dvl] use blending for mc of ref frames 2011-04-14 23:39:27 +02:00
Carl Worth
ea3b2560b1 Add an expected file for 093-divide-by-zero
This test is behaving just fine already---it's generating an informative
diagnostic, ("error: division by 0 in preprocessor directive"), so adding
this in the expected file makes things pass.
2011-04-14 14:29:34 -07:00
José Fonseca
6881cfc7f7 mesa/st: Avoid spurious transfers when creating fbo textures without image data.
We could actually try to do an early return both for gallium textures and
malloc memory textures, but I'm not sure exactly which situations
stImage->pt is NULL, and whether texImage->Data == NULL would be acceptible
or not.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-14 19:51:45 +01:00
pepp
78e90bf247 st/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-14 07:55:02 -06:00
Eric Anholt
a9a02c8a39 mesa: Expose ATI_draw_buffers.
This is the same as ARB_draw_buffers (which derived from it), except
for s/ARB/ATI/.  The glapi bits were already in place, and what was
missing was just the ARB_fp part.  The new Humble Bundle game "trine"
tries to use this extension without checking that it's exposed, which
this works around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36182
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:32 -07:00
Eric Anholt
fb6e39737a mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:01 -07:00
Eric Anholt
28cec9e832 mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:05:44 -07:00
Eric Anholt
4847f802c2 i965/fs: Constant-fold immediates in src0 of SEL instructions.
This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:53 -07:00
Eric Anholt
811c147220 i965/fs: Constant-fold immediates in src0 of CMP instructions.
This is like what we do with add/mul, but we also have to flip the
conditional test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:46 -07:00
Eric Anholt
756c262756 glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:43 -07:00
Eric Anholt
175829f1a8 glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
9e04b190b5 glsl: Semantically check the RHS of `||' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
7ec0c97896 glsl: Semantically check the RHS of `&&' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:25 -07:00
Eric Anholt
01822706ec glsl: Avoid cascading errors when looking for a scalar boolean and failing.
By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:02 -07:00
Christian König
e61a63a651 [g3dvl] cleanup blender and sampler views 2011-04-14 00:40:24 +02:00
Christian König
b88fa92400 [g3dvl] split mc into seperate stages 2011-04-13 23:21:11 +02:00
Christian König
751eb75310 [g3dvl] move intra handling into fetch_ycbcr 2011-04-13 20:07:21 +02:00
Christian König
efaf024f8c xvmc: use a pipe_video_rect for subpicture src & dst 2011-04-13 19:32:49 +02:00
Christian König
c7b65dcaff xvmc: Define some Xv attribs to allow users to specify color standard and procamp 2011-04-13 18:50:18 +02:00
Christian König
537370be4b xvmc: move subpicture swizzle into own function 2011-04-12 22:07:03 +02:00
Christian König
87e81a3e9d xvmc: fix compiler warning 2011-04-12 21:51:41 +02:00
Christian König
4d057864d0 xvmc: flush surface of macroblock (0,0) is detected 2011-04-12 21:42:08 +02:00
Christian König
3745025b28 [g3dvl] make resource_format param const 2011-04-12 20:45:31 +02:00
Christian König
b486766725 xvmc: cleanup headers 2011-04-12 20:38:21 +02:00
Christian König
f63aba41fb vdpau: switch cb cr planes in vlVdpVideoSurfacePutBitsYCbCr 2011-04-12 20:19:59 +02:00
Christian König
62373e8f9e vdpau: set at least a basic csc matrix 2011-04-12 19:42:47 +02:00
Christian König
4f3fb1586a [g3dvl] make resource format selection a public interface 2011-04-12 19:21:07 +02:00
Christian König
ccc80d2c09 [g3dvl] fully support different formats for source and intermediate textures 2011-04-11 23:55:36 +02:00
Christian König
36b322dffd r600g: support textures with scaled number formats 2011-04-11 00:49:28 +02:00
Christian König
bad3085c78 [g3dvl] autoselect texture formats 2011-04-10 22:45:22 +02:00
Christian König
871d6d49c9 [g3dvl] autoconfigure nr of idct render targets 2011-04-10 20:49:18 +02:00
Christian König
b6af6ba6c0 [g3dvl] remove unused rasterizer state from mpeg decoder 2011-04-10 20:34:21 +02:00
Christian König
ad4ed0e7f6 [g3dvl] give idct it's own init buffer function 2011-04-10 20:30:27 +02:00
Christian König
5ed848129c [g3dvl] cleanup headers and comments 2011-04-10 19:16:38 +02:00
Christian König
fcf765620d [g3dvl] make number of idct render targets configurable 2011-04-10 19:08:11 +02:00
Christian König
31109e1be2 [g3dvl] also use video buffer for idct intermediate 2011-04-10 18:46:31 +02:00
Christian König
8b0a9cc62c [g3dvl] get softpipe to work again 2011-04-10 00:33:36 +02:00
Christian König
816d820b7d xvmc: add a workaround for xines xxmc vo plugin 2011-04-09 20:46:24 +02:00
Christian König
7a5390b06f [g3dvl] make mv weights a public interface 2011-04-09 20:38:20 +02:00
Christian König
44477ac489 [g3dvl] give each mv an individual weight 2011-04-09 12:01:29 +02:00
Christian König
cae77aa80b vdpau: Implement basic output functionality
Even with totally wrong color space conversion
we finally se a picture with VDPAU. Yeah!
2011-04-09 01:34:02 +02:00
Christian König
f3ead63e70 vdpau: get at least the very basic mixer functions working 2011-04-08 22:13:46 +02:00
Christian König
255033e481 [g3dvl] use scissor to handle compositor dst_area 2011-04-08 22:07:30 +02:00
Christian König
574ffb440d vdpau: add compositor to mixer 2011-04-08 20:12:30 +02:00
Christian König
6710e690f6 vdpau: add compositor to presentation queue 2011-04-08 20:03:35 +02:00
Christian König
b98b58c76a vdpau: implement output surface creation 2011-04-08 19:21:13 +02:00
Christian König
19402275fb [g3dvl] stop waiting for replay of DRI2CopyRegion 2011-04-07 23:04:10 +02:00
Christian König
30c4a07310 [g3dvl] create composite buffer with USAGE_STREAM
Also add PIPE_TRANSFER_DONTBLOCK to mapping options
2011-04-07 23:00:26 +02:00
Christian König
fcdf50f74b [g3dvl] add support for different decoding entry points 2011-04-07 20:10:55 +02:00
Christian König
9d2e630cd0 [g3dvl] move mapping/unmapping and uploading of blocks out of idct code 2011-04-07 19:24:22 +02:00
Christian König
2c21d28e83 vdpau: implement vlVdpVideoSurfacePutBitsYCbCr 2011-04-06 20:38:16 +02:00
Christian König
05a2247a94 [g3dvl] set buffer_format correctly 2011-04-06 20:36:31 +02:00
Christian König
d9ad3aa3b9 [g3dvl] and finally split the decoder part out of the context
This should give a good basis to implement vdpau ontop of it.
2011-04-06 00:06:20 +02:00
Christian König
3a2b906805 [g3dvl] rename ycbcr buffer to video buffer and add some more functionality 2011-04-04 23:28:18 +02:00
Christian König
ebd564587a g3dvl/vdpau: some more indention fixes 2011-04-03 22:01:15 +02:00
Christian König
087e17f52e [g3dvl] fix vertex buffer size calculation 2011-04-03 20:49:15 +02:00
Christian König
e6176ce371 [g3dvl] some more debugging output in xvmc st 2011-04-03 19:57:49 +02:00
Christian König
e5f78a74f8 [g3dvl] split compositor out of video context
Also redesign the compositor a bit and make the result a public available interface
2011-04-03 16:09:23 +02:00
Christian König
e6d41e4d03 [g3dvl] start to cleanup the mess and provide at least basic functionality 2011-04-03 00:14:38 +02:00
Christian König
d5b05a869a [g3dvl] start over with vdpau decoding 2011-04-03 00:09:01 +02:00
Christian König
7dc87676f2 vdpau: get state tracker to compile again 2011-04-02 23:16:21 +02:00
Christian König
59774e5c7a [g3dvl] remove unused color_swizzle from idct code 2011-04-02 22:36:26 +02:00
Christian König
e6049aa0a9 [g3dvl] rework mpeg12 context error handling 2011-04-02 22:26:06 +02:00
Christian König
3e92b4fd14 g3dvl/xvmc: fix a stupid of by one bug 2011-04-02 20:29:27 +02:00
Christian König
71ee815b5c [g3dvl] remove PIPE_CAP_DECODE_TARGET_PREFERRED_FORMAT
It wasn't fully implemented anyway.
2011-04-02 19:50:37 +02:00
Christian König
794cde3f5e [g3dvl] splitt vertex element state into y, cb, cr 2011-04-02 12:05:22 +02:00
Christian König
4de5d81638 [g3dvl] some minor cleanup 2011-04-01 23:47:20 +02:00
Christian König
1f3a85ec79 [g3dvl] let mc code work on the different color planes seperately 2011-03-29 20:01:49 +02:00
Christian König
f3c9161b15 [g3dvl] remove texture dependencies from mc code 2011-03-27 20:41:43 +02:00
Christian König
020328ca32 [g3dvl] introduction of ycbcr buffers
Moves most of the buffer creation out of the idct code.
2011-03-27 19:43:02 +02:00
Christian König
5a351e5129 [g3dvl] no need for individual samplers for idct stage 1 & 2 2011-03-27 01:53:04 +01:00
Christian König
8330bc29dd [g3dvl] cleanup and improve idct error handling 2011-03-27 01:41:10 +01:00
Christian König
c6182cc6d4 [g3dvl] improve and cleanup mc error handling 2011-03-27 01:04:00 +01:00
Christian König
e8a701f40b [g3dvl] remove unused backbuffer from xvmc 2011-03-27 00:19:25 +01:00
Christian König
7f426615ab [g3dvl] fully implement paletted subpictures 2011-03-26 12:36:01 +01:00
Christian König
9a59f22d11 [g3dvl] correct subpicture stride in upload 2011-03-26 11:53:27 +01:00
Christian König
849a0b0a82 [g3dvl] start implementing palettes for subpictures 2011-03-26 11:46:07 +01:00
Christian König
5f23328a8a [g3dvl] get sampler swizzle right for subpictures
This should make ai44 work correctly.
2011-03-26 10:58:38 +01:00
Christian König
c001c39371 [g3dvl] add blend state to compositor
This seems to get at least mplayer working
2011-03-26 02:03:16 +01:00
Christian König
adbc9cee0d [g3dvl] correct layer size calculation 2011-03-26 01:26:52 +01:00
Christian König
05a2c182f1 [g3dvl] use quads instead of triangles for the compositor 2011-03-26 01:01:18 +01:00
Christian König
133add9c50 [g3dvl] the sampler textview map is no longer needed 2011-03-26 00:30:22 +01:00
Christian König
3d40d4f391 [g3dvl] throw out all unused parts of the interface 2011-03-26 00:20:16 +01:00
Christian König
4a0b80f00d [g3dvl] rework supicture handling
This gets ia44 and ai44 at least partial working
2011-03-25 23:38:50 +01:00
Christian König
a17788ac49 [g3dvl] start implementing AI44 and IA44 subpicture 2011-03-25 21:10:56 +01:00
Christian König
ce6f8331fa [g3dvl] make ref_surface handling more sane 2011-03-25 19:32:22 +01:00
Christian König
da3c6dd099 [g3dvl] move sampler views for reference frames into context 2011-03-24 21:24:58 +01:00
Christian König
884cb79edf [g3dvl] make mapping and flushing of buffers a public interface 2011-03-24 20:33:32 +01:00
Christian König
f65cdb9ea5 [g3dvl] fix configure.ac for r600 video targets 2011-03-22 21:58:28 +01:00
Christian König
f08d3bb59b [g3dvl] buffers must be aligned to macroblock size 2011-03-22 21:52:06 +01:00
Christian König
ba0bff8530 [g3dvl] make video buffer a public available interface 2011-03-22 19:58:21 +01:00
Christian König
52766c2c37 [g3dvl] handle different mc types more similary 2011-03-20 22:50:09 +01:00
Christian König
f2c6affa36 [g3dvl] simplify motion vector calculation 2011-03-20 22:14:49 +01:00
Christian König
bac8760f7f [g3dvl] rename motion vector fields 2011-03-20 21:34:38 +01:00
Christian König
dd6cd206a6 [g3dvl] correctly implement non power of two buffers 2011-03-20 19:45:06 +01:00
Christian König
713a52d856 [g3dvl] cleanup idct init 2011-03-20 19:29:47 +01:00
Christian König
1a238efe42 [g3dvl] fix power_of_two buffer with/height handling 2011-03-20 19:00:50 +01:00
Christian König
e9b305c100 [g3dvl] merge fixes 2011-03-19 12:26:17 +01:00
Christian König
74e1d64c6d r600g: revert some asm optimisations
They didn't have the desired effect and are still quite buggy
2011-03-19 11:40:22 +01:00
Christian König
2bf95c519e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/tests/unit/SConscript
2011-03-19 01:02:40 +01:00
Christian König
f36846c77e vdpau: add vdpau-r600 target 2011-03-19 00:06:47 +01:00
Christian König
cbb3ad3d5a vdpau: fix formating and idention of surface.c 2011-03-19 00:06:46 +01:00
Christian König
d1655b60b0 get softpipe winsys to compile again 2011-03-19 00:06:46 +01:00
Christian König
49f4aff75c vdpau: make indention and formating more sane 2011-03-19 00:06:46 +01:00
Christian König
b90f569a0f vdpau: merge fixes for vdpau state tracker 2011-03-19 00:06:46 +01:00
Christian König
0719fdee2e fix chroma swizzle 2011-03-19 00:06:46 +01:00
Christian König
1d72cf6986 move empty block mask into mpeg12 context 2011-03-19 00:06:46 +01:00
Christian König
a1fecd09c2 [g3dvl] move mpeg12 context out of softpipe 2011-03-17 00:08:20 +01:00
Christian König
e87bd8c957 [g3dvl] cleanup and documentation 2011-03-16 23:09:52 +01:00
Christian König
0f07da0a1c [g3dvl] move idct out of mc code
iDCT and MC now look good, but sp_video_context is a total mess
2011-03-09 23:40:08 +01:00
Christian König
37a548c9d1 [g3dvl] start to cleanup the mess
Move the vertex buffer out of the mc code
2011-03-08 21:30:33 +01:00
Christian König
310eea52ca [g3dvl] use a single vertex buffer for both idct and mc 2011-03-08 18:34:05 +01:00
Christian König
43af13b2cb r600g: set start instance correctly 2011-03-08 16:48:39 +01:00
Christian König
4ea3817602 [g3dvl] use instanced drawing to reduce the vertex buffer payload 2011-03-05 16:36:38 +01:00
Christian König
199034a3cc Merge remote branch 'origin/master' into pipe-video 2011-03-05 15:46:56 +01:00
Christian König
54f11a27a1 Merge remote branch 'origin/master' into pipe-video 2011-03-04 17:15:43 +01:00
Christian König
0eccb1038a Merge remote branch 'origin/master' into pipe-video 2011-03-03 00:59:12 +01:00
Christian König
ed12c29bc4 r600g: merge fix 2011-03-02 20:48:03 +01:00
Christian König
b97e41c7b1 Merge remote branch 'origin/master' into pipe-video 2011-02-28 23:59:53 +01:00
Christian König
77217af40d r600g: Merge fix 2011-02-24 22:28:38 +01:00
Christian König
b922a0ce12 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/drivers/r600/r600_texture.c
2011-02-24 22:02:42 +01:00
Christian König
f013b4f8f1 r600g: bugfixing register remapping 2011-01-29 12:10:37 +01:00
Christian König
86e5b79a27 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_texture.c
2011-01-21 21:51:24 +01:00
Christian König
78faf8d0e9 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
2011-01-20 22:43:18 +01:00
Christian König
d2ff6b8715 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_shader.c
2011-01-20 22:10:37 +01:00
Christian König
e755c7bec3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2011-01-12 00:51:45 +01:00
Christian König
a96fe679e2 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2011-01-12 00:48:10 +01:00
Christian König
7965e2fc16 [g3dvl] merge fix 2011-01-11 21:54:30 +01:00
Christian König
9032d2a13e Merge remote branch 'vdpau/pipe-video' into pipe-video
Conflicts:
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/include/pipe/p_format.h
	src/gallium/state_trackers/xorg/xvmc/context.c
	src/gallium/tests/unit/SConscript
2011-01-10 23:41:08 +01:00
Christian König
b725bbebae [g3dvl] static usage for intermediate buffer 2011-01-10 22:19:14 +01:00
Christian König
1b1c15a54a r600g: place buffers into different domains, based on usage flags 2011-01-10 22:09:41 +01:00
Christian König
c8236aaf70 [g3dvl] move to integer verticies 2011-01-10 19:15:42 +01:00
Christian König
4025958e1b [g3dvl] use a table of empty block mask instead of calculating it 2011-01-09 14:19:14 +01:00
Christian König
3789a480ed r600g: check if hardware blits are possible bevore enabling tilling 2011-01-09 13:18:48 +01:00
Christian König
9bf8adc45e r600g: some merge fixes 2011-01-09 13:18:30 +01:00
Christian König
72e3099155 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/eg_asm.c
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/include/pipe/p_format.h
	src/gallium/targets/dri-nouveau/Makefile
2011-01-08 13:24:36 +01:00
Christian König
ef4def1d9a r600g: join export instructions 2011-01-08 11:11:48 +01:00
Christian König
10dbabc481 r600g: fully implement barrier handling 2011-01-07 18:26:51 +01:00
Christian König
3a49b567cf r600g: rearange exports 2010-12-28 23:45:46 +01:00
Christian König
c099fcd28a r600g: optimize unneeded alu moves 2010-12-28 13:09:54 +01:00
Christian König
f23dce0532 r600g: fix gpr usage intersection and add conditiona code handling 2010-12-27 20:50:05 +01:00
Christian König
22de93b435 r600g: implement register remapping 2010-12-27 17:58:00 +01:00
Christian König
2191d8064e [g3dvl] fix merge conflicts 2010-12-22 21:38:48 +01:00
Christian König
e179a8bf34 Merge remote branch 'origin/master' into pipe-video 2010-12-22 21:12:24 +01:00
Christian König
1b03996b12 r600g: remove some unneded barriers 2010-12-22 20:50:16 +01:00
Christian König
f853ea0078 [g3dvl] move code around for more optimal shader generation 2010-12-22 20:01:39 +01:00
Christian König
26127d6a2f r600g: rework literal handling 2010-12-22 17:45:51 +01:00
Christian König
adf89a3329 r600g: fix bug created by 120a558624 2010-12-21 21:27:57 +01:00
Christian König
ac5b174706 r600g: merge alu groups 2010-12-20 22:09:09 +01:00
Christian König
7b0cc9bd38 r600g: implement replacing gpr with pv and ps 2010-12-18 21:32:16 +01:00
Christian König
79f881156f r600g: rework bank swizzle code 2010-12-18 17:56:36 +01:00
Christian König
f6c47f686d r600g: fix alu slot assignment 2010-12-18 13:57:18 +01:00
Christian König
7ff871ee15 [g3dvl] add some missing writemasks 2010-12-18 00:47:00 +01:00
Christian König
120a558624 r600g: optimize away CF ALU instructions even if type doesn't match 2010-12-18 00:45:59 +01:00
Christian König
8cff56168d r600g: fix alu dumping 2010-12-17 22:57:36 +01:00
Christian König
01e3e7c7c3 r600g: fix tex and vtx joining 2010-12-16 22:23:48 +01:00
Christian König
f2fe373518 r600g: improve r600_bc_dump 2010-12-16 22:05:33 +01:00
Christian König
f780626c35 [g3dvl] move scaling completely into matrix and use less temp registers 2010-12-16 18:41:13 +01:00
Christian König
08c8cd26b8 r600g: implement output modifiers and use them to further optimize LRP 2010-12-16 16:42:14 +01:00
Christian König
f75578b31e r600g: use special constants for 0, 1, -1, 1.0f, 0.5f etc 2010-12-14 23:38:30 +01:00
Christian König
270f6d194c r600g: optimize temp register handling for LRP 2010-12-14 20:49:31 +01:00
Christian König
d98d2e7c6c [g3dvl] no need to swizzle a scalar 2010-12-14 20:20:36 +01:00
Christian König
9d967fc91e r600g: DP4 also supports writemasking 2010-12-14 19:32:08 +01:00
Christian König
d92e97d884 r600g: optimize away CF_INST_POP
If last instruction is an CF_INST_ALU we don't need to emit an
additional CF_INST_POP for stack clean up after an IF ELSE ENDIF.
2010-12-14 00:43:53 +01:00
Christian König
e13fecbbd6 [g3dvl] add reg_fixup_label to IF ELSE ENDIF 2010-12-13 00:04:58 +01:00
Christian König
be4de05c10 [g3dvl] move idct texture addr generation into vertex shader 2010-12-12 22:55:23 +01:00
Christian König
ebab090ed9 [g3dvl] seperate texture addr generation from fetching 2010-12-12 21:40:41 +01:00
Christian König
7bc9ab1181 r600g: texture instructions also work fine with TGSI_FILE_INPUT 2010-12-12 15:37:54 +01:00
Christian König
d5295552f5 r600g: Why all this fiddling with tgsi_helper_copy?
tgsi_helper_copy is used on several occasions to copy a temporary result
into the real destination register to emulate writemasks for OP3 and
reduction operations. According to R600 ISA that's unnecessary.

This patch fixes this use for MAD, CMP and DP4.
2010-12-12 15:37:14 +01:00
Christian König
ad643bfc12 [g3dvl] remove "Nouveau can't writemask tex dst regs" workaround
This now works with r600g, but will probably break Nouveau.
It's just way faster on r600 hardware, so let's fix Nouveau.
2010-12-11 14:34:01 +01:00
Christian König
dbe6454aa3 [g3dvl] move mv into vertex stream 2010-12-11 14:00:59 +01:00
Christian König
772b25e1f3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_texture.c
2010-12-11 13:43:44 +01:00
Christian König
ab130400cf [g3dvl] move z-coord generation for multiple render targets into vertex shader 2010-12-10 12:05:30 +01:00
Christian König
4a8420513d [g3dvl] move idct stage 1 scaling into matrix 2010-12-10 11:31:17 +01:00
Christian König
680f118138 [g3dvl] double buffering seems to be enough 2010-12-10 11:05:11 +01:00
Christian König
9c296be7d6 [g3dvl] make render targets full configureable 2010-12-10 02:56:15 +01:00
Christian König
593a2cf8c5 [g3dvl] move interlaced dct handling into vertex shader 2010-12-10 01:27:21 +01:00
Christian König
1fb4bf84d5 [g3dvl] move frame predition handling vom fragment into vertex shader 2010-12-10 00:29:59 +01:00
Christian König
cf234984f4 [g3dvl] avoid some ELSE blocks 2010-12-10 00:13:32 +01:00
Christian König
00e60387fc [g3dvl] try a different buffer aproach 2010-12-09 22:34:43 +01:00
Christian König
25cdc79f32 [g3dvl] fix buffer handling in mc code 2010-12-09 22:28:31 +01:00
Christian König
7c4887f5ae [g3dvl] fix idct matrix upload 2010-12-09 22:27:03 +01:00
Christian König
1e3f5e9520 [g3dvl] split mc code into state and buffer 2010-12-08 23:37:57 +01:00
Christian König
3b2ef2d007 [g3dvl] move buffer mapping/unmapping out of flush 2010-12-08 22:35:30 +01:00
Christian König
877edb6785 [g3dvl] replace IF THEN ELSE with CMP statement 2010-12-08 21:28:38 +01:00
Christian König
1482b9a7f3 [g3dvl] remove shadow buffering of vertex buffers 2010-12-08 20:48:34 +01:00
Christian König
8df88ca10f [g3dvl] remove mb type handler structure 2010-12-08 19:41:01 +01:00
Christian König
050e7035f2 [g3dvl] move macro block type handling into shaders part 3 2010-12-08 19:18:55 +01:00
Christian König
5790ca5289 [g3dvl] moving macroblock type handling into shaders part 2 2010-12-08 18:42:48 +01:00
Christian König
081b01fd60 [g3dvl] start moving macroblock type handling into shaders 2010-12-08 18:26:58 +01:00
Christian König
b680476b52 [g3dvl] allways use all motion vectors
reprogramming the vertex buffers takes more time than pumping
all motion vectors through the vertex shader
2010-12-08 16:11:29 +01:00
Christian König
d8d8939dd5 [g3dvl] split empty block handling
Empty block handling is split between vertex shader (x-axis)
and fragment shader (y-axis).
2010-12-08 14:50:28 +01:00
Christian König
0b749d6dcb [g3dvl] split idct code into state and buffers 2010-12-08 02:12:24 +01:00
Christian König
22b4acb206 [g3dvl] use buffer width instead of texture size or vs constants 2010-12-07 21:23:14 +01:00
Christian König
bfb4fb057d [g3dvl] move vertex buffer handling into vl_vertex_buffer.c 2010-12-07 20:13:37 +01:00
Christian König
eb7452e267 [g3dvl] rework pot buffer handling and flushing 2010-12-07 00:29:02 +01:00
Christian König
6484898752 [g3dvl] move mapping/unmapping of buffers one layer up 2010-12-05 22:30:38 +01:00
Christian König
5701873402 [g3dvl] move vertex handling into vl_vb object 2010-12-05 17:57:52 +01:00
Christian König
8e0c05960d [g3dvl] cleanup empty block handling
doing empty block handling in the mc code is indeed faster
2010-12-05 16:46:10 +01:00
Christian König
9af3c243d9 move empty block handling back into mc for testing 2010-12-03 19:04:01 +01:00
Christian König
29840040af add rasterizer state 2010-12-03 19:04:01 +01:00
Christian König
27016941bc use CMP also for referenz frame fetch 2010-12-03 19:04:01 +01:00
Christian König
c8b7cf469f cleanup and use CMP instead of IF ELSE ENDIF 2010-12-03 19:04:01 +01:00
Christian König
74c71f09f3 move to four component calculation for idct code 2010-12-03 19:04:01 +01:00
Christian König
69f53c3dc8 copy only mv really needed to vb 2010-12-03 19:04:01 +01:00
Christian König
d2888c5f2f use vertex buffer also for mc code 2010-12-03 19:04:01 +01:00
Christian König
c7068d79a0 give each vertex element its own buffer 2010-12-03 19:04:00 +01:00
Christian König
838d109207 use vl_vb_upload_quads also for mc 2010-12-03 19:04:00 +01:00
Christian König
3e6a5077ca move vertex elemt states into mb type handlers 2010-12-03 19:04:00 +01:00
Christian König
3bbbb3c54f move macroblock type handling into its own structure 2010-12-03 19:04:00 +01:00
Christian König
4abe738288 use a shadow buffer for vertex data to optimize memory access 2010-12-03 19:04:00 +01:00
Christian König
a984c67b31 make nr of render targets configureable for testing 2010-12-03 19:04:00 +01:00
Christian König
336c7735ae [g3dvl] join empty blocks to get larger slices 2010-11-28 01:21:41 +01:00
Christian König
e742a1043d [g3dvl] use 8 zslices for idct 2010-11-27 18:20:38 +01:00
Christian König
3fd53e6c2a [g3dvl] some more bugfixing 2010-11-27 14:08:15 +01:00
Christian König
12836fbcfa [g3dvl] idividual vs for each stage and a bunch of bugsfixes 2010-11-27 14:01:01 +01:00
Christian König
027704db75 [g3dvl] give idct stage 1 & 2 its own sb_state and viewport 2010-11-27 11:24:24 +01:00
Christian König
13e28cff76 [g3dvl] use four component fetch also for idct source 2010-11-26 21:50:14 +01:00
Christian König
a981d62c97 r600g: disable hardware blit for stream texture 2010-11-26 21:44:22 +01:00
Christian König
cfe489b897 [g3dvl] split matrix mul into seperate functions 2010-11-26 20:25:00 +01:00
Christian König
7408a6ab89 [g3dvl] use inline constants instead of vs_const for idct 2010-11-26 19:14:55 +01:00
Christian König
3dd7bf7d39 [g3dvl] no need to keep the idct matrix multiple times 2010-11-25 22:10:21 +01:00
Christian König
9cff905343 [g3dvl] add dump option to xvmc 2010-11-25 21:23:48 +01:00
Christian König
ed8b767a8e [g3dvl] also use four elemets on right side multiplikation 2010-11-25 19:37:12 +01:00
Christian König
c9e10c666a [g3dvl] use four elements in matrix texture fetch 2010-11-24 23:54:21 +01:00
Christian König
de623b96ab r600g: disable not working formats 2010-11-24 23:44:30 +01:00
Christian König
431e72984b r600g: reenable texture uploads, but keep R16_SNORM disabled 2010-11-24 21:40:50 +01:00
Christian König
a51b0daa59 r600g: disable R32 float also in r600_translate_colorformat 2010-11-24 21:36:54 +01:00
Christian König
2c9db2484b [g3dvl] no need for all samplers at all stages 2010-11-24 20:00:52 +01:00
Christian König
5391ef8606 [g3dvl] remove flushing between stages 2010-11-24 19:46:51 +01:00
Christian König
ed49905944 [g3dvl] spread scaling between idct stages 2010-11-24 19:40:47 +01:00
Christian König
5a8078486a [g3dvl] remove invalid use of assert 2010-11-23 22:43:29 +01:00
Christian König
58d04f816c [g3dvl] switch to r32 float for idct matrix 2010-11-23 21:26:26 +01:00
Christian König
21efda8687 [g3dvl] add some error handling 2010-11-23 00:19:02 +01:00
Christian König
e6b71530da Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
2010-11-21 19:40:52 +01:00
Christian König
42c7291d2c [g3dvl] inverse check for iDCT 2010-11-21 14:34:38 +01:00
Christian König
ac1fd50163 [g3dvl] first working version of idct code 2010-11-21 14:19:40 +01:00
Christian König
331eb58d15 r600g: disable staging upload for now 2010-11-21 13:58:23 +01:00
Christian König
cc998ddf92 r600g: remove accidentally added r32 float format 2010-11-21 13:57:02 +01:00
Christian König
95febb69cc [g3dvl] move empty block handling into idct code 2010-11-20 22:24:42 +01:00
Christian König
03c5a0ea5c [g3dvl] enable stage 1&2 buffers in idct code 2010-11-20 21:08:12 +01:00
Christian König
749504a935 r600g: add support for signed normalized frame buffers 2010-11-20 21:06:42 +01:00
Christian König
e639e1b83e [g3dvl] next round of idct implementation 2010-11-16 22:30:50 +01:00
Christian König
508a4a056c [g3dvl] add skeleton and incomplete idct 2010-11-14 23:16:49 +01:00
Christian König
3cbe27a988 [g3dvl] ups missed this check 2010-11-14 20:35:02 +01:00
Christian König
3886295a0c [g3dvl] remove need for XVMC_INTRA_UNSIGNED
Move from unsigned to signed intra dct blocks.
You also need to update xf86-video-ati for this to work.
2010-11-14 20:14:25 +01:00
Christian König
48e19e8f35 [g3dvl] fix of my one bug in SCALE_FACTOR_16_TO_9 2010-11-14 02:17:39 +01:00
Christian König
0bc51ba484 [g3dvl] switch to using macroblock vertices 2010-11-13 17:16:27 +01:00
Christian König
35a8efe577 [g3dvl] move empty block handling completely into shaders 2010-11-13 16:56:59 +01:00
Christian König
d128c091c7 [g3dvl] use quads instead of triangles 2010-11-13 14:06:47 +01:00
Christian König
33311ffed5 [g3dvl] cleanup
Add missing comments simplyfy shaders etc...
2010-11-12 23:49:33 +01:00
Christian König
1eaf4806cd [g3dvl] and finally move field codec dct handling into shaders 2010-11-12 12:00:33 +01:00
Christian König
fa4d274516 [g3dvl] make room for second z-coord and interlaced flag 2010-11-12 01:04:22 +01:00
Christian König
7af05c4fe6 [g3dvl] move applying z-coord to fragment shader 2010-11-12 00:29:37 +01:00
Christian König
d8192f1821 [g3dvl] use constants for vertex shader outputs and move field calculation into own function 2010-11-12 00:17:56 +01:00
Christian König
97e92ab63b [g3dvl] move xfer_buffers_map/unmap into flush 2010-11-11 22:08:00 +01:00
Christian König
195bbe8ce2 Merge remote branch 'origin/master' into pipe-video 2010-11-11 21:07:42 +01:00
Christian König
99b57bc20e [g3dvl] move stuff from flush into own functions 2010-11-11 15:01:27 +01:00
Christian König
e406936b9e [g3dvl] remove empty block handling for now
Maybe this isn't going into the right direction,
but it makes handling the code easier for now.
2010-11-11 12:49:47 +01:00
Christian König
745906257a [g3dvl] use only one vertex element for ycbcr z-coord 2010-11-11 12:32:44 +01:00
Christian König
4c90c039f0 [g3dvl] move the rest of the calculations into the vertex shader 2010-11-11 11:53:12 +01:00
Christian König
1be1aa7ba1 [g3dvl] cleanup vert_stream_0 2010-11-11 00:39:30 +01:00
Christian König
3a247a08e8 [g3dvl] use clamp to border for empty block handling 2010-11-10 23:22:56 +01:00
Christian König
d073fec718 [g3dvl] move to 3D textures for y cb cr 2010-11-10 21:35:55 +01:00
Christian König
c2ec28be3a [g3dvl] again rework vertex shader a bit 2010-11-10 15:24:28 +01:00
Christian König
1eade3271a [g3dvl] workaround for motion vertical field selection 2010-11-09 23:18:33 +01:00
Christian König
5182416f03 [g3dvl] start handling motion_vertical_field_select 2010-11-09 20:01:58 +01:00
Christian König
725a5e15cf [g3dvl] cleanup naming convention and comments 2010-11-06 17:08:55 +01:00
Christian König
34e5ae5aed [g3dvl] motion type depends on picture structure not dct type 2010-11-06 16:18:24 +01:00
Christian König
d7fc97b6ab [g3dvl] simplyfy shaders and fix bugs 2010-11-05 22:48:27 +01:00
Christian König
dd51858850 [g3dvl] it finally starts to look like a badly deinterlaced video 2010-11-05 02:16:43 +01:00
Christian König
de2eec6a3d [g3dvl] move scaling to macroblocksize into vertex shader 2010-11-05 00:20:33 +01:00
Christian König
325233fdef [g3dvl] move vertex normalisation into vertex shader 2010-11-04 23:23:42 +01:00
Christian König
b4c5c6f51a [g3dvl] rework shader a bit 2010-11-04 21:41:39 +01:00
Christian König
2e4a7b7306 Fix zero block handling for field based mc 2010-11-03 00:38:07 +01:00
Christian König
0b75203c59 First try of field based mc 2010-10-30 01:42:16 +02:00
Thomas Balling Sørensen
2b296ec77c vl: initial implementation of vlVaQueryImageFormats(), vlVaCreateImage(), vlVaQuerySubpictureFormats(), vlVaCreateSurfaces(), vlVaQueryConfigEntrypoints(), vlVaQueryConfigProfiles() 2010-10-28 22:46:28 +02:00
Christian König
41ed47d6b8 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-28 20:24:56 +02:00
Thomas Balling Sørensen
8ba4c96f82 vl: rest of va stubs 2010-10-28 14:32:54 +02:00
Thomas Balling Sørensen
a565f58eda vl: enable target va-r600 2010-10-28 13:40:59 +02:00
Thomas Balling Sørensen
3fac09ad87 vl: Initial implementation of vlVaQuerySubpictureFormats. 2010-10-28 12:51:35 +02:00
Thomas Balling Sørensen
fd2cbe94df vl: small typos and stuff 2010-10-28 09:40:25 +02:00
Thomas Balling Sørensen
6b6310e67c vl: morefixes to Luc's patch 2010-10-27 20:27:11 +02:00
Thomas Balling Sørensen
664f10625a vl: rest of Luc's patch 2010-10-27 13:01:18 +02:00
Thomas Balling Sørensen
990cb62963 vl: commited Orasanu Lucian's patch containing va stubs. 2010-10-27 11:00:11 +02:00
Thomas Balling Sørensen
17ea7d16bd vl: creating cleaner way of naming libraries 2010-10-26 14:06:01 +02:00
Thomas Balling Sørensen
050dfe9caf vl: fix some build issues after the merge 2010-10-26 13:58:19 +02:00
Thomas Balling Sørensen
6ac1bbe21a vl: pipe-video branch merged with Königs pipe-video branch 2010-10-26 13:44:19 +02:00
Thomas Balling Sørensen
4926c57480 Merge branch 'pipe-video' of git://anongit.freedesktop.org/~deathsimple/xvmc-r600 into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
2010-10-26 13:01:40 +02:00
Thomas Balling Sørensen
dbf3a15313 Merge branch 'master' into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-26 12:49:41 +02:00
Thomas Balling Sørensen
1dccc4cfaa vl: add'ed stub for VaCreateImage 2010-10-25 21:38:08 +02:00
Thomas Balling Sørensen
aea4d004d2 vl: more stub work for a va implementation 2010-10-25 20:52:02 +02:00
Christian König
97a7cf230a Workaround for skipping vertex elements for r600g 2010-10-25 19:59:31 +02:00
Thomas Balling Sørensen
501ac572c6 vl: va state-tracker configuration scripts 2010-10-24 19:27:29 +02:00
Christian König
b0dfc3f261 Remove code copied over from r300 2010-10-24 00:53:49 +02:00
Christian König
4381580936 First xvmc-r600 implementation 2010-10-23 17:47:30 +02:00
Thomas Balling Sørensen
b122e50c3e vl: initial va-api implementation 2010-10-23 15:59:45 +02:00
Christian König
de4c2b91f4 Fix uninitialized memory problems 2010-10-23 14:01:13 +02:00
Christian König
ba9caba9c8 Some more merge fixes 2010-10-23 13:54:47 +02:00
Christian König
b13a0af510 Fix problems created by Merge 2010-10-16 16:41:09 +02:00
Thomas Balling Sørensen
2990292f0f vl: more work on the bitstream_parser 2010-10-13 11:27:07 +02:00
Christian König
695cc370a2 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/nvfx/Makefile
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/winsys/nouveau/drm/nouveau_drm_api.c
2010-10-12 23:07:29 +02:00
Thomas Balling Sørensen
7d2bdc2d4d vl: bitstream decoder finds startcodes 2010-10-08 13:59:31 +02:00
Thomas Balling Sørensen
bff1ac875c vl: some more fixes and addition to the decoder handling 2010-10-07 00:26:46 +02:00
Thomas Balling Sørensen
65fe0866ae vl: implemented a few functions and made stubs to get mplayer running 2010-10-06 23:30:08 +02:00
Thomas Balling Sørensen
d0e203f1f0 vl: initial commit of the bitstream parser 2010-10-06 00:19:53 +02:00
Thomas Balling Sørensen
7d9e070b0d Merge branch 'pipe-video' of ssh://cgit.freedesktop.org/~tball/mesa-gallium-vdpau into pipe-video 2010-10-05 22:45:05 +02:00
Thomas Balling Sørensen
062149e2d2 Merge branch 'master' of ssh://cgit.freedesktop.org/~tball/mesa-gallium-vdpau into pipe-video 2010-10-05 22:42:56 +02:00
Thomas Balling Sørensen
2194e078c7 Merge remote branch 'origin/master' into pipe-video 2010-10-05 22:38:38 +02:00
Thomas Balling Sørensen
cd114a92b9 vl: change the xvmc state_tracker to the new gallium API 2010-10-05 15:18:29 +02:00
Thomas Balling Sørensen
d64d6f7712 vl: changed video pipe to use the new gallium API within master 2010-10-05 14:25:29 +02:00
Thomas Balling Sørensen
1218430e12 Merge branch 'master' into pipe-video
Conflicts:
	configs/linux-dri
	configure.ac
	src/gallium/drivers/nvfx/Makefile
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/tests/python/samples/tri.py
	src/gallium/tests/trivial/Makefile
	src/gallium/tests/unit/Makefile
	src/gallium/tests/unit/SConscript
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/nouveau/drm/nouveau_drm_api.c
2010-10-05 12:04:08 +02:00
Thomas Balling Sørensen
63b1525cf0 vl: ... 2010-10-05 11:06:02 +02:00
Thomas Balling Sørensen
cac5e60fd3 vl: moved some functions to more appropriate places 2010-09-30 15:58:57 +02:00
Thomas Balling Sørensen
8291db1cdb vl: Renamed function to appropriate name. 2010-09-27 22:45:05 +02:00
Thomas Balling Sørensen
a90bdd09b6 vl: Made vdpauinfo run again 2010-09-21 19:44:30 +02:00
Thomas Balling Sørensen
c5b6f7d166 vl: Made the project compile again. 2010-09-21 19:20:00 +02:00
Thomas Balling Sørensen
5386a8a2e0 vl: Various cleanups. Need to start from scratch with bitstream parser 2010-09-21 15:23:52 +02:00
Thomas Balling Sørensen
09a10be4db Fixed an endianproblem 2010-08-04 11:07:26 +02:00
Thomas Balling Sørensen
966b836e2d Stubs for the bitstream mpeg2 decoder 2010-08-01 11:10:19 +02:00
Thomas Balling Sørensen
6ada38d29a Added stubs for the rest of the vdpau interface 2010-07-22 01:46:40 +02:00
Thomas Balling Sørensen
725e4ada30 Made some decoding function for mpeg2-decoding 2010-07-20 14:27:06 +02:00
Thomas Balling Sørensen
c97ccc3353 Added decode.c 2010-07-18 23:42:49 +02:00
Thomas Balling Sørensen
06a49b1872 fixed compilation 2010-07-14 00:51:18 +02:00
Thomas Balling Sørensen
3299997bcc vdpau changes 2010-07-14 00:36:17 +02:00
Thomas Balling Sørensen
15bc635499 added surface.c and made some changes in device.c 2010-07-14 00:30:46 +02:00
Younes Manton
f3e34ba6fb st/vdpau: Initial commit.
Enough plumbing here to get vdpauinfo working.
2010-06-27 00:01:18 -04:00
Younes Manton
b9fe966519 vl: Fix RGB subpictures. 2010-06-13 17:37:33 -04:00
Younes Manton
4b2fcb2bcb vl: Add transfer funcs to pipe_video_context and softpipe. 2010-06-13 17:36:34 -04:00
Younes Manton
511cb3fbf9 vl: Decode to XRGB, not ARGB. 2010-06-06 13:31:53 -04:00
Younes Manton
6414952efe vl: Drop DRI1, clean up DRI2 bits. 2010-06-06 12:19:22 -04:00
Younes Manton
156fbb9fc5 vl: Check mo_type not mb_type when setting motion vectors. 2010-05-31 00:35:20 -04:00
Younes Manton
ea3a01ae4d vl: Get nouveau building again.
Still some DRI2 bits to sort out.
2010-05-29 19:22:14 -04:00
Younes Manton
62074f44bb st/xvmc: Restore tests removed by merge. 2010-05-29 19:20:41 -04:00
Younes Manton
2798958d89 vl: Dec sampler view refs instead of destroying them.
Gets rid of a bunch of double frees and the crash at shutdown.
2010-05-24 13:44:06 -04:00
Younes Manton
0a51e86332 vl: Use pipe_screen::video_context_create hook instead of SP ctor. 2010-05-24 00:14:45 -04:00
Younes Manton
0e59cd33e6 vl: Get softpipe working again.
Still segfaults on softpipe->destroy() in the draw module when
freeing a vertex buffer.
2010-05-23 19:56:12 -04:00
Younes Manton
2c29a93e87 vl: Get softpipe building again. 2010-05-08 20:11:29 -04:00
Younes Manton
fa3f0c832c gallium: Get rid of auxilary/util files that were removed in master. 2010-05-08 20:10:04 -04:00
Younes Manton
a8ea1dacc6 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/auxiliary/util/u_format.csv
	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_compositor.h
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
	src/gallium/drivers/identity/id_objects.c
	src/gallium/drivers/identity/id_objects.h
	src/gallium/drivers/identity/id_screen.c
	src/gallium/drivers/nv40/Makefile
	src/gallium/drivers/nv40/nv40_screen.c
	src/gallium/drivers/softpipe/sp_texture.c
	src/gallium/drivers/softpipe/sp_texture.h
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/drivers/softpipe/sp_video_context.h
	src/gallium/include/pipe/p_format.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/pipe/p_video_context.h
	src/gallium/include/pipe/p_video_state.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/state_trackers/dri/common/dri_context.c
	src/gallium/state_trackers/xorg/xvmc/attributes.c
	src/gallium/state_trackers/xorg/xvmc/block.c
	src/gallium/state_trackers/xorg/xvmc/context.c
	src/gallium/state_trackers/xorg/xvmc/subpicture.c
	src/gallium/state_trackers/xorg/xvmc/surface.c
	src/gallium/state_trackers/xorg/xvmc/tests/.gitignore
	src/gallium/state_trackers/xorg/xvmc/tests/Makefile
	src/gallium/state_trackers/xorg/xvmc/xvmc_private.h
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/g3dvl/vl_winsys.h
	src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
	src/gallium/winsys/sw/Makefile
2010-04-30 20:42:30 -04:00
Younes Manton
404fb63b46 vl: WIP DRI2 support in the winsys. 2010-04-28 19:51:10 -04:00
Younes Manton
3107b54b01 st/xvmc: Mark exported funcs with PUBLIC. 2010-04-24 21:16:59 -04:00
Younes Manton
f64d0cf524 vl: Adapt to dri changes. 2010-04-24 15:37:25 -04:00
Younes Manton
356473121c vl: Get rid of pipe_video_surface on the nouveau side as well. 2010-04-24 13:52:47 -04:00
Younes Manton
edca5360ca vl: Fix up configure.ac/Makefile 2010-04-24 13:52:23 -04:00
Younes Manton
5eb822cb6a vl: Do some subpicture validation. 2010-04-18 12:16:40 -04:00
Younes Manton
99218cd2b3 vl: Add some query methods to pipe_video_context and use them. 2010-03-12 19:03:37 -05:00
Younes Manton
035332cbbb vl: Remove pipe_video_surface hooks from pipe_screen as well. 2010-03-12 14:38:37 -05:00
Younes Manton
f1bbd41e32 vl: Don't wrap blocks in pipe_user_buffers.
Mallocing/free eat up a noticeable amount of CPU time for no
practical benefit.
2010-03-12 13:36:52 -05:00
Younes Manton
69c3ad3fc1 vl: Use pipe_surface instead of pipe_texture in interfaces. 2010-03-12 12:38:33 -05:00
Younes Manton
299407aaa3 vl: Get rid of pipe_video_surface. 2010-03-12 12:09:44 -05:00
Younes Manton
81badd5029 gallium: Add common video format enums. 2010-03-12 11:20:06 -05:00
Younes Manton
a8238bb08a Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/vl/Makefile
	src/gallium/auxiliary/vl/SConscript
	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_compositor.h
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
	src/gallium/drivers/nouveau/nouveau_winsys.h
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/include/pipe/p_video_state.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/state_trackers/xorg/xvmc/surface.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/g3dvl/nouveau/Makefile
2010-03-12 01:37:49 -05:00
Younes Manton
8046846489 vl: Subpicture/compositing fixes. 2010-03-05 23:26:03 -05:00
Younes Manton
8580b7a0ee vl: Add some basic debug output for XvMC.
Set the XVMC_DEBUG env var to:
	0 for no extra output
	1 for error output
	2 for warning output
	3 for tracing output
2010-03-05 23:14:49 -05:00
Younes Manton
40cd082afa vl: Add switches to autoconf.
Pass 'xorg/xvmc' to --with-state-trackers to get the XvMC state tracker.
Pass --enable-gallium-g3dvl to enable the winsys.
2010-03-05 23:11:05 -05:00
Cooper Yuan
4d65133e86 r300g/g3dvl: Fix build error and correct Makefile for xvmc lib 2010-02-01 17:53:46 +08:00
Cooper Yuan
6783672a97 r300g/g3dvl: port xvmc video stuff to mesa/pipe-video branch 2010-01-29 21:42:09 +08:00
Younes Manton
447dddb93d Merge branch 'master' into pipe-video
Conflicts:

	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_compositor.h
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/auxiliary/vl/vl_shader_build.c
2009-12-06 16:44:11 -05:00
Younes Manton
9e8ab2e7c1 g3dvl: It's ok to not have cliprects (minimized windows, etc). 2009-12-05 12:53:42 -05:00
Younes Manton
5f730690f8 g3dvl: Basic subpicture support.
RGB subpictures only at the moment.
2009-11-22 16:40:15 -05:00
Younes Manton
334676ed9a nouveau: Link with softpipe. 2009-11-14 14:00:52 -05:00
Younes Manton
8cdfa77b18 g3dvl: Use a func instead of large ugly macro to gen per-block verts. 2009-11-09 16:55:37 -05:00
Younes Manton
c756cb8463 g3dvl: Use immediates in shaders where possible. 2009-11-07 20:20:09 -05:00
Younes Manton
e57f7b7b10 g3dvl: Use ureg to build shaders. 2009-11-07 19:46:33 -05:00
Younes Manton
09878fb91a g3dvl: Unbreak debug build. 2009-11-07 19:45:47 -05:00
Younes Manton
181d034ad5 g3dvl: Remove src/driclient
It's in src/gallium/winsys/g3dvl/dri now.
2009-11-06 01:09:24 -05:00
Younes Manton
8ebc795ec4 g3dvl: Shared drm winsys bits. 2009-11-05 23:58:29 -05:00
Younes Manton
dcccbfd14e g3dvl: Wrap macroblock block buffer in a pipe user buffer. 2009-11-02 22:03:09 -05:00
Younes Manton
d18bd04dde g3dvl: Put misc helpers in u_video.h. 2009-11-02 21:22:14 -05:00
Younes Manton
e60a8e4fcf g3dvl: DRM winsys changes. 2009-11-02 20:32:58 -05:00
4031 changed files with 370683 additions and 660248 deletions

10
.dir-locals.el Normal file
View File

@@ -0,0 +1,10 @@
((nil
(indent-tabs-mode . nil)
(tab-width . 8)
(c-basic-offset . 3)
(c-file-style . "stroustrup")
(eval . (progn
(c-set-offset 'innamespace '0)
(c-set-offset 'inline-open '0)))
)
)

View File

@@ -1,10 +0,0 @@
;; -*- emacs-lisp -*-
;;
;; This file is processed by the dirvars emacs package. Each variable
;; setting below is performed when this dirvars file is loaded.
;;
indent-tabs-mode: nil
tab-width: 8
c-basic-offset: 3
kde-emacs-after-parent-string: ""
evaluate: (c-set-offset 'inline-open '0)

15
.gitignore vendored
View File

@@ -2,6 +2,8 @@
*.dll
*.exe
*.ilk
*.la
*.lo
*.o
*.obj
*.os
@@ -10,13 +12,20 @@
*.pyc
*.pyo
*.so
*.so.*
*.sw[a-z]
*.tar
*.tar.bz2
*.tar.gz
*.zip
*~
depend
depend.bak
bin/ltmain.sh
lib
lib64
configure
configure.lineno
autom4te.cache
aclocal.m4
config.log
@@ -25,4 +34,10 @@ cscope*
.scon*
config.py
build
libtool
manifest.txt
Makefile.in
.dir-locals.el
.deps/
.libs/
/Makefile

63
Android.common.mk Normal file
View File

@@ -0,0 +1,63 @@
# Mesa 3-D graphics library
#
# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
# Copyright (C) 2010-2011 LunarG Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# use c99 compiler by default
ifeq ($(LOCAL_CC),)
ifeq ($(LOCAL_IS_HOST_MODULE),true)
LOCAL_CC := $(HOST_CC) -std=c99
else
LOCAL_CC := $(TARGET_CC) -std=c99
endif
endif
LOCAL_C_INCLUDES += \
$(MESA_TOP)/include
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
major := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
minor := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
LOCAL_CFLAGS += \
-DANDROID_VERSION=0x0$(major)0$(minor)
LOCAL_CFLAGS += \
-DPTHREADS \
-fvisibility=hidden \
-Wno-sign-compare
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += \
-DUSE_X86_ASM
endif
endif
LOCAL_CPPFLAGS += \
-Wno-error=non-virtual-dtor \
-Wno-non-virtual-dtor
# uncomment to keep the debug symbols
#LOCAL_STRIP_MODULE := false
ifeq ($(strip $(LOCAL_MODULE_TAGS)),)
LOCAL_MODULE_TAGS := optional
endif

94
Android.mk Normal file
View File

@@ -0,0 +1,94 @@
# Mesa 3-D graphics library
#
# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
# Copyright (C) 2010-2011 LunarG Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
# gallium drivers: swrast i915g nouveau r300g r600g radeonsi vmwgfx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
MESA_TOP := $(call my-dir)
MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
MESA_PYTHON2 := python
DRM_TOP := external/drm
DRM_GRALLOC_TOP := hardware/drm_gralloc
classic_drivers := i915 i965
gallium_drivers := swrast i915g nouveau r300g r600g radeonsi vmwgfx
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
# warn about invalid drivers
invalid_drivers := $(filter-out \
$(classic_drivers) $(gallium_drivers), $(MESA_GPU_DRIVERS))
ifneq ($(invalid_drivers),)
$(warning invalid GPU drivers: $(invalid_drivers))
# tidy up
MESA_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(MESA_GPU_DRIVERS))
endif
# host and target must be the same arch to generate matypes.h
ifeq ($(TARGET_ARCH),$(HOST_ARCH))
MESA_ENABLE_ASM := true
else
MESA_ENABLE_ASM := false
endif
ifneq ($(filter $(classic_drivers), $(MESA_GPU_DRIVERS)),)
MESA_BUILD_CLASSIC := true
else
MESA_BUILD_CLASSIC := false
endif
ifneq ($(filter $(gallium_drivers), $(MESA_GPU_DRIVERS)),)
MESA_BUILD_GALLIUM := true
else
MESA_BUILD_GALLIUM := false
endif
# add subdirectories
ifneq ($(strip $(MESA_GPU_DRIVERS)),)
SUBDIRS := \
src/mapi \
src/glsl \
src/mesa \
src/egl/main
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
SUBDIRS += \
src/egl/drivers/dri2 \
src/mesa/drivers/dri
endif
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
SUBDIRS += src/gallium
endif
mkfiles := $(patsubst %,$(MESA_TOP)/%/Android.mk,$(SUBDIRS))
include $(mkfiles)
endif

502
Makefile
View File

@@ -1,502 +0,0 @@
# Top-level Mesa makefile
TOP = .
SUBDIRS = src
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
@$(TOP)/bin/extract_git_sha1
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
all: default
doxygen:
cd doxygen && $(MAKE)
clean:
-@touch $(TOP)/configs/current
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
realclean: clean
-rm -rf lib*
-rm -f $(TOP)/configs/current
-rm -f $(TOP)/configs/autoconf
-rm -rf autom4te.cache
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
distclean: realclean
install:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
.PHONY: default doxygen clean realclean distclean install
# If there's no current configuration file
$(TOP)/configs/current:
@echo
@echo
@echo "Please choose a configuration from the following list:"
@ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
@echo
@echo "Then type 'make <config>' (ex: 'make linux-x86')"
@echo
@echo "Or, run './configure' then 'make'"
@echo "See './configure --help' for details"
@echo
@echo "(ignore the following error message)"
@exit 1
# Rules to set/install a specific build configuration
aix \
aix-64 \
aix-64-static \
aix-gcc \
aix-static \
autoconf \
bluegene-osmesa \
bluegene-xlc-osmesa \
beos \
catamount-osmesa-pgi \
darwin \
darwin-fat-32bit \
darwin-fat-all \
freebsd \
freebsd-dri \
freebsd-dri-amd64 \
freebsd-dri-x86 \
hpux10 \
hpux10-gcc \
hpux10-static \
hpux11-32 \
hpux11-32-static \
hpux11-32-static-nothreads \
hpux11-64 \
hpux11-64-static \
hpux11-ia64 \
hpux11-ia64-static \
hpux9 \
hpux9-gcc \
irix6-64 \
irix6-64-static \
irix6-n32 \
irix6-n32-static \
irix6-o32 \
irix6-o32-static \
linux \
linux-i965 \
linux-alpha \
linux-alpha-static \
linux-cell \
linux-cell-debug \
linux-debug \
linux-dri \
linux-dri-debug \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-dri-xcb \
linux-egl \
linux-indirect \
linux-fbdev \
linux-ia64-icc \
linux-ia64-icc-static \
linux-icc \
linux-icc-static \
linux-llvm \
linux-llvm-debug \
linux-opengl-es \
linux-osmesa \
linux-osmesa-static \
linux-osmesa16 \
linux-osmesa16-static \
linux-osmesa32 \
linux-ppc \
linux-ppc-static \
linux-profile \
linux-sparc \
linux-sparc5 \
linux-static \
linux-ultrasparc \
linux-tcc \
linux-x86 \
linux-x86-debug \
linux-x86-32 \
linux-x86-64 \
linux-x86-64-debug \
linux-x86-64-profile \
linux-x86-64-static \
linux-x86-profile \
linux-x86-static \
netbsd \
openbsd \
osf1 \
osf1-static \
solaris-x86 \
solaris-x86-gcc \
solaris-x86-gcc-static \
sunos4 \
sunos4-gcc \
sunos4-static \
sunos5 \
sunos5-gcc \
sunos5-64-gcc \
sunos5-smp \
sunos5-v8 \
sunos5-v8-static \
sunos5-v9 \
sunos5-v9-static \
sunos5-v9-cc-g++ \
ultrix-gcc:
@ if test -f configs/current -o -L configs/current; then \
if ! cmp configs/$@ configs/current > /dev/null; then \
echo "Please run 'make realclean' before changing configs" ; \
exit 1 ; \
fi ; \
else \
cd configs && rm -f current && ln -s $@ current ; \
fi
$(MAKE) default
# Rules for making release tarballs
VERSION=7.11-devel
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
# This is part of MAIN_FILES
MAIN_ES_FILES = \
$(DIRECTORY)/src/mesa/main/*.xml \
$(DIRECTORY)/src/mesa/main/*.py \
$(DIRECTORY)/src/mesa/main/*.dtd
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/configure \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
$(DIRECTORY)/bin/version.mk \
$(DIRECTORY)/configs/[a-z]* \
$(DIRECTORY)/docs/*.html \
$(DIRECTORY)/docs/COPYING \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
$(DIRECTORY)/include/GL/glu.h \
$(DIRECTORY)/include/GL/glu_mangle.h \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glxext.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/Makefile \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
$(DIRECTORY)/src/mesa/vbo/*.[chS] \
$(DIRECTORY)/src/mesa/vbo/descrip.mms \
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
$(DIRECTORY)/src/mesa/drivers/Makefile \
$(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \
$(DIRECTORY)/src/mesa/x86/*.[ch] \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
$(DIRECTORY)/include/GLES2/*.h \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/src/mapi/es?api/Makefile \
$(DIRECTORY)/src/mapi/es?api/*.pc.in \
$(DIRECTORY)/src/mapi/glapi/gen/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen/*.py \
$(DIRECTORY)/src/mapi/glapi/gen/*.dtd \
$(DIRECTORY)/src/mapi/glapi/gen-es/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.py \
$(DIRECTORY)/src/mapi/glapi/Makefile \
$(DIRECTORY)/src/mapi/glapi/SConscript \
$(DIRECTORY)/src/mapi/glapi/sources.mak \
$(DIRECTORY)/src/mapi/glapi/*.[chS] \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/include/EGL/*.h \
$(DIRECTORY)/src/egl/Makefile \
$(DIRECTORY)/src/egl/*/Makefile \
$(DIRECTORY)/src/egl/*/Makefile.template \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/auxiliary/gallivm/*.cpp \
$(DIRECTORY)/src/gallium/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*.csv \
$(DIRECTORY)/src/gallium/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/glu.pc.in \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.mgw \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
$(DIRECTORY)/src/glu/sgi/glu.exports \
$(DIRECTORY)/src/glu/sgi/glu.exports.darwin \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
$(DIRECTORY)/src/glu/sgi/libtess/README \
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
$(SGI_GLU_FILES) \
$(GLW_FILES)
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
tarballs: md5
rm -f ../$(LIB_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
ACLOCAL_FLAGS =
AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
$(LIB_NAME).zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
$(GLUT_NAME).zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
md5: $(ARCHIVES)
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@-md5sum $(GLUT_NAME).tar.gz
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5

124
Makefile.am Normal file
View File

@@ -0,0 +1,124 @@
# Copyright © 2012 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = src
doxygen:
cd doxygen && $(MAKE)
check-local:
$(MAKE) -C src/mapi/glapi/tests check
$(MAKE) -C src/mesa/main/tests check
$(MAKE) -C src/glsl/tests check
$(MAKE) -C src/glx/tests check
clean-local:
-@touch $(top_builddir)/configs/current
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@test -s $(top_builddir)/configs/current || rm -f $(top_builddir)/configs/current
distclean-local:
-rm -rf lib*
-rm -f $(top_builddir)/configs/current
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
.PHONY: doxygen
# Rules for making release tarballs
PACKAGE_VERSION=8.1-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
src/mesa/main/api_exec_es1.c \
src/mesa/main/api_exec_es1_dispatch.h \
src/mesa/main/api_exec_es1_remap_helper.h \
src/mesa/main/api_exec_es2.c \
src/mesa/main/api_exec_es2_dispatch.h \
src/mesa/main/api_exec_es2_remap_helper.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h
IGNORE_FILES = \
-x autogen.sh
parsers: configure
-@touch $(top_builddir)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip
tarballs: md5
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
manifest.txt: .git
( \
ls -1 $(EXTRA_FILES) ; \
git ls-files $(IGNORE_FILES) \
) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
../$(PACKAGE_DIR):
ln -s $(PWD) $@
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
rm -f $(PACKAGE_NAME).zip ; \
cd .. ; \
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

View File

@@ -40,6 +40,9 @@ env = Environment(
ENV = os.environ,
)
# XXX: This creates a many problems as it saves...
#opts.Save('config.py', env)
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
@@ -80,44 +83,6 @@ env.Append(CPPPATH = [
if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# Embedded
if env['platform'] == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# Posix
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if env['gcc']:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if env['platform'] == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# for debugging
#print env.Dump()
@@ -130,7 +95,7 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
#
# Create host environent
if env['crosscompile'] and env['platform'] != 'embedded':
if env['crosscompile'] and not env['embedded']:
host_env = Environment(
options = opts,
# no tool used
@@ -179,3 +144,18 @@ SConscript(
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
########################################################################
# List all aliases
try:
from SCons.Node.Alias import default_ans
except ImportError:
pass
else:
aliases = default_ans.keys()
aliases.sort()
env.Help('\n')
env.Help('Recognized targets:\n')
for alias in aliases:
env.Help(' %s\n' % alias)

View File

@@ -15,4 +15,6 @@ MAKEFLAGS=""
autoreconf -v --install || exit 1
"$srcdir"/configure "$@"
if test -z "$NOCONFIGURE"; then
"$srcdir"/configure "$@"
fi

8
bin/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
config.guess
config.sub
install-sh
/depcomp
/missing
ylwrap
compile
ar-lib

View File

@@ -1,48 +0,0 @@
#!/bin/bash -e
usage()
{
echo "Usage: $0 <target1> <target2>"
echo "Highlight differences between Mesa configs"
echo "Example:"
echo " $0 linux linux-x86"
}
die()
{
echo "$@" >&2
return 1
}
case "$1" in
-h|--help) usage; exit 0;;
esac
[ $# -lt 2 ] && die 2 targets needed. See $0 --help
target1=$1
target2=$2
topdir=$(cd "`dirname $0`"/..; pwd)
cd "$topdir"
[ -f "./configs/$target1" ] || die Missing configs/$target1
[ -f "./configs/$target2" ] || die Missing configs/$target2
trap 'rm -f "$t1" "$t2"' 0
t1=$(mktemp)
t2=$(mktemp)
make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t1
TOP = .
include \$(TOP)/configs/$target1
default:
EOF
make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t2
TOP = .
include \$(TOP)/configs/$target2
default:
EOF
diff -pu -I'^#' $t1 $t2

1555
bin/config.guess vendored

File diff suppressed because it is too large Load Diff

1685
bin/config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +0,0 @@
#!/bin/sh
touch src/mesa/main/git_sha1.h
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h
fi

View File

@@ -1 +0,0 @@
minstall

View File

@@ -260,7 +260,7 @@ if [ $STATIC = 1 ]; then
NEWOBJECTS=""
for OBJ in $OBJECTS ; do
case $OBJ in
-Wl,*)
-Wl,*|-L*|-l*)
echo "mklib: warning: ignoring $OBJ for static library"
;;
*)
@@ -334,7 +334,9 @@ case $ARCH in
# environment. If so, pass -m32 flag to linker.
set ${OBJECTS}
ABI32=`file $1 | grep 32-bit`
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
ARM=`file $1 | grep ARM`
# Do not add "-m32" option for arm.
if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
OPTS="-m32 ${OPTS}"
fi
@@ -391,7 +393,9 @@ case $ARCH in
# environment. If so, pass -m32 flag to linker.
set ${OBJECTS}
ABI32=`file $1 | grep 32-bit`
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
ARM=`file $1 | grep ARM`
# Do not add "-m32" option for arm.
if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
OPTS="-m32 ${OPTS}"
fi
if [ "${ALTOPTS}" ] ; then
@@ -767,9 +771,8 @@ case $ARCH in
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
# examine first object to determine ABI
set ${OBJECTS}
@@ -782,9 +785,6 @@ case $ARCH in
OPTS=${ALTOPTS}
fi
# XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# to OPTS here?
# determine linker
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -796,8 +796,7 @@ case $ARCH in
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME}
ln -s ${LIBNAME} ${LINKNAME2}
FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
FINAL_LIBS="${LIBNAME} ${LINKNAME}"
fi
;;
@@ -807,22 +806,6 @@ case $ARCH in
FINAL_LIBS=`make_ar_static_lib -ru 0 ${LIBNAME} ${OBJECTS}`
;;
'BeOS')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making BeOS static library: " ${LIBNAME}
FINAL_LIBS=`make_ar_static_lib -cru 0 ${LIBNAME} ${OBJECTS}`
else
LIBNAME="lib${LIBNAME}.so"
echo "mklib: Making BeOS shared library: " ${LIBNAME}
gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}"
mimeset -f "${LIBNAME}"
# XXX remove the Mesa3D stuff here since mklib isn't mesa-specific.
setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!"
fi
FINAL_LIBS=${LIBNAME}
;;
'QNX')
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making QNX library: " ${LIBNAME}
@@ -980,6 +963,43 @@ case $ARCH in
fi
;;
'Haiku')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
if [ "x$LINK" = "x" ] ; then
# -linker was not specified so set default link command now
if [ $CPLUSPLUS = 1 ] ; then
LINK=g++
else
LINK=gcc
fi
fi
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
echo "mklib: Making static library for Haiku: " ${LIBNAME}
# expand .a into .o files
NEW_OBJECTS=`expand_archives ${LIBNAME}.obj $OBJECTS`
# make static lib
FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${NEW_OBJECTS}`
# remove temporary extracted .o files
rm -rf ${LIBNAME}.obj
else
LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
OPTS="-shared"
echo "mklib: Making shared library for Haiku: " ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} ${OBJECTS} ${DEPS} -o ${LIBNAME}
FINAL_LIBS="${LIBNAME}"
fi
;;
'example')
# If you're adding support for a new architecture, you can
# start with this:

23
bin/shortlog_mesa.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# This script is used to generate the list of changes that
# appears in the release notes files, with HTML formatting.
typeset -i in_log=0
git shortlog $* | while read l
do
if [ $in_log -eq 0 ]; then
echo '<p>'$l'</p>'
echo '<ul>'
in_log=1
elif echo "$l" | egrep -q '^$' ; then
echo '</ul>'
echo
in_log=0
else
mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')
echo ' <li>'${mesg}'</li>'
fi
done

View File

@@ -1,17 +0,0 @@
#!/usr/bin/make -sf
# Print the various Mesa version fields. This is mostly used to add the
# version to configure.
# This reflects that this script is usually called from the toplevel
TOP = .
include $(TOP)/configs/default
version:
@echo $(MESA_VERSION)
major:
@echo $(MESA_MAJOR)
minor:
@echo $(MESA_MINOR)
tiny:
@echo $(MESA_TINY)

View File

@@ -31,9 +31,15 @@ _machine_map = {
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'BePC': 'x86',
'Intel': 'x86',
'ppc' : 'ppc',
'BeBox': 'ppc',
'BeMac': 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
'sparc': 'sparc',
'sun4u': 'sparc',
}
@@ -79,14 +85,18 @@ def AddOptions(opts):
from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('openmp', 'EXPERIMENTAL: compile with openmp (swrast)', 'no'))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -1,30 +0,0 @@
# Configuration for AIX, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -O -DAIXV3 -DPTHREADS
CXXFLAGS = -O -DAIXV3 -DPTHREADS
# Misc tools and flags
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lpthread -lm
GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXm -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC

View File

@@ -1,27 +0,0 @@
# Configuration for AIX 64-bit, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64
# Compiler and flags
CC = xlc
CXX = xlC
CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS
CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXm -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/lib64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@@ -1,25 +0,0 @@
# Configuration for AIX, static libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64-static
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -q64 -O -DAIXV3 -DPTHREADS
CXXFLAGS = -q64 -O -DAIXV3 -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
APP_LIB_DEPS = -q64 -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
-lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@@ -1,23 +0,0 @@
# Configuration for AIX with gcc
include $(TOP)/configs/default
CONFIG_NAME = aix-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -DAIXV3
CXXFLAGS = -O2 -DAIXV3
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -arch aix-gcc
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi

View File

@@ -1,25 +0,0 @@
# Configuration for AIX, static libs
include $(TOP)/configs/default
CONFIG_NAME = aix-static
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -O -DAIXV3 -DPTHREADS
CXXFLAGS = -O -DAIXV3 -DPTHREADS
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
-lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@@ -1,219 +0,0 @@
# Autoconf configuration
# Pull in the defaults
include $(TOP)/configs/default
# This is generated by configure
CONFIG_NAME = autoconf
# Compiler and flags
CC = @CC@
CXX = @CXX@
OPT_FLAGS = @OPT_FLAGS@
ARCH_FLAGS = @ARCH_FLAGS@
ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
MAKE = @MAKE@
SHELL = @SHELL@
MKLIB_OPTIONS = @MKLIB_OPTIONS@
MKDEP = @MKDEP@
MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
# Python and flags (generally only needed by the developers)
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
GLU_LIB_NAME = @GLU_LIB_NAME@
GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLU_LIB_GLOB = @GLU_LIB_GLOB@
GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
# GLw motif setup
GLW_SOURCES = @GLW_SOURCES@
MOTIF_CFLAGS = @MOTIF_CFLAGS@
# Library/program dependencies
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLUT_LIB_DEPS@
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
# Installation directories (for make install)
INSTALL_DIR = $(prefix)
INSTALL_LIB_DIR = $(libdir)
INSTALL_INC_DIR = $(includedir)
# DRI installation directories
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
# pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
GL_PC_CFLAGS = @GL_PC_CFLAGS@
DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@
GLU_PC_REQ = @GLU_PC_REQ@
GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
GLUT_PC_REQ_PRIV = @GLUT_PC_REQ_PRIV@
GLUT_PC_LIB_PRIV = @GLUT_PC_LIB_PRIV@
GLUT_PC_CFLAGS = @GLUT_PC_CFLAGS@
GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
ifneq ($(LLVM_VERSION),)
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
endif
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@

View File

@@ -1,103 +0,0 @@
# Configuration for BeOS
# Written by Philippe Houdoin
include $(TOP)/configs/default
CONFIG_NAME = beos
DEFINES = \
-DBEOS_THREADS
MACHINE=$(shell uname -m)
ifeq ($(MACHINE), BePC)
CPU = x86
else
CPU = ppc
endif
ifeq ($(CPU), x86)
# BeOS x86 settings
DEFINES += \
-DGNU_ASSEMBLER \
-DUSE_X86_ASM \
-DUSE_MMX_ASM \
-DUSE_3DNOW_ASM \
-DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)
CC = gcc
CXX = g++
LD = gcc
CFLAGS = \
-Wall -Wno-multichar -Wno-ctor-dtor-privacy \
$(DEFINES)
CXXFLAGS = $(CFLAGS)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
LDFLAGS += -Xlinker
ifdef DEBUG
CFLAGS += -g -O0
LDFLAGS += -g
DEFINES += -DDEBUG
else
CFLAGS += -O3
endif
GLUT_CFLAGS = -fexceptions
else
# BeOS PPC settings
CC = mwcc
CXX = $(CC)
LD = mwldppc
CFLAGS = \
-w on -requireprotos \
$(DEFINES)
CXXFLAGS = $(CFLAGS)
LDFLAGS += \
-export pragma \
-init _init_routine_ \
-term _term_routine_ \
-lroot \
/boot/develop/lib/ppc/glue-noinit.a \
/boot/develop/lib/ppc/init_term_dyn.o \
/boot/develop/lib/ppc/start_dyn.o
ifdef DEBUG
CFLAGS += -g -O0
CXXFLAGS += -g -O0
LDFLAGS += -g
else
CFLAGS += -O7
CXXFLAGS += -O7
endif
GLUT_CFLAGS = -fexceptions
endif
# Directories
SRC_DIRS = gallium mesa glu glut/beos
GLU_DIRS = sgi
DRIVER_DIRS = beos
# Library/program dependencies
GL_LIB_DEPS =
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS =
GLUT_LIB_DEPS = -lgame -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB)

View File

@@ -1,32 +0,0 @@
# Configuration for building only libOSMesa on BlueGene, no Xlib driver
# This doesn't really have a lot of dependencies, so it should be usable
# on other (gcc-based) systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = bluegene-osmesa
# Compiler and flags
CC = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-gcc
CXX = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURC
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lOSMesa -lGLU -lm

View File

@@ -1,28 +0,0 @@
# Configuration for building only libOSMesa on BlueGene using the IBM xlc compiler
# This doesn't really have a lot of dependencies, so it should be usable
# on similar systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = bluegene-osmesa
# Compiler and flags
CC = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlc
CXX = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlC
CFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lOSMesa -lGLU -lm

View File

@@ -1,31 +0,0 @@
# Configuration for building only libOSMesa on Cray Xt3
# for the compute nodes running Catamount using the
# Portland Group compiler. The Portland Group toolchain has to be
# enabled before using "module switch PrgEnv-gnu PrgEnv-pgi" .
# This doesn't really have a lot of dependencies, so it should be usable
# on other similar systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = catamount-osmesa-pgi
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lOSMesa -lGLU -lm

View File

@@ -1,42 +0,0 @@
# MinGW config include file updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
# The generated DLLs by MingW with STDCALL are not totally compatible
# with the ones linked by Microsoft's compilers.
#
# xxx_USING_STDCALL = 1 Compiling MESA with __stdcall. This is default!
#
# xxx_USING_STDCALL = 0 Compiling MESA without __stdcall. I like this:)
#
# In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be
# different. For example:
#
# GL_USING_STDCALL = 0
# GLUT_USING_STDCALL = 1
#
# Suggested setting:
#
# ALL_USING_STDCALL = 1
#
# That's default!
#
ALL_USING_STDCALL = 1
ifeq ($(ALL_USING_STDCALL),1)
GL_USING_STDCALL = 1
GLUT_USING_STDCALL = 1
else
GL_USING_STDCALL = 0
GLUT_USING_STDCALL = 0
endif

227
configs/current.in Normal file
View File

@@ -0,0 +1,227 @@
# Autoconf configuration
# Pull in the defaults
include $(TOP)/configs/default
# This is generated by configure
CONFIG_NAME = autoconf
# Compiler and flags
CC = @CC@
CXX = @CXX@
OPT_FLAGS = @OPT_FLAGS@
ARCH_FLAGS = @ARCH_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LIBS = @RADEON_LIBS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_BINDIR = @LLVM_BINDIR@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_CPPFLAGS = @LLVM_CPPFLAGS@
LLVM_CXXFLAGS = @LLVM_CXXFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBDIR = @LLVM_LIBDIR@
LLVM_LIBS = @LLVM_LIBS@
LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@
GLW_CFLAGS = @GLW_CFLAGS@
GLX_TLS = @GLX_TLS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_FILES = @MESA_ASM_FILES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
MAKE = @MAKE@
SHELL = @SHELL@
MKLIB_OPTIONS = @MKLIB_OPTIONS@
MKDEP = @MKDEP@
MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
AWK = @AWK@
GREP = @GREP@
NM = @NM@
# Perl
PERL = @PERL@
# Indent (used for generating dispatch tables)
INDENT = @INDENT@
INDENT_FLAGS = @INDENT_FLAGS@
# Python and flags (generally only needed by the developers)
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @LEX@
BISON = @YACC@
# Library names (base name)
GL_LIB = @GL_LIB@
GLU_LIB = @GLU_LIB@
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
GLU_LIB_NAME = @GLU_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLU_LIB_GLOB = @GLU_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
# GLw motif setup
GLW_SOURCES = @GLW_SOURCES@
MOTIF_CFLAGS = @MOTIF_CFLAGS@
# Library/program dependencies
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
# Installation directories (for make install)
INSTALL_DIR = $(prefix)
INSTALL_LIB_DIR = $(libdir)
INSTALL_INC_DIR = $(includedir)
# DRI installation directories
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
# XVMC library install directory
XVMC_LIB_INSTALL_DIR=@XVMC_LIB_INSTALL_DIR@
# VDPAU library install directory
VDPAU_LIB_INSTALL_DIR=@VDPAU_LIB_INSTALL_DIR@
# VA library install directory
VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
# Path to OpenCL C library libclc
LIBCLC_PATH = @LIBCLC_PATH@
# pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
GL_PC_CFLAGS = @GL_PC_CFLAGS@
DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@
GLU_PC_REQ = @GLU_PC_REQ@
GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@
GALLIUM_PIPE_LOADER_DEFINES = @GALLIUM_PIPE_LOADER_DEFINES@
GALLIUM_PIPE_LOADER_LIBS = @GALLIUM_PIPE_LOADER_LIBS@

View File

@@ -1,59 +0,0 @@
# Configuration for Darwin / MacOS X, making dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = darwin
INSTALL_DIR = /usr/X11
X11_DIR = $(INSTALL_DIR)
# Compiler and flags
CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED \
-DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL
# -DGLX_INDIRECT_RENDERING \
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
# -DIN_DRI_DRIVER
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu glut/glx
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast

View File

@@ -1,7 +0,0 @@
# Configuration for Darwin / MacOS X, making 32bit fat dynamic libs
RC_CFLAGS=-arch ppc -arch i386
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-fat-32bit

View File

@@ -1,7 +0,0 @@
# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs
RC_CFLAGS=-arch ppc -arch i386 -arch ppc64 -arch x86_64
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-fat-all

View File

@@ -8,8 +8,8 @@
CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=11
MESA_MAJOR=8
MESA_MINOR=1
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
@@ -19,11 +19,9 @@ DRM_SOURCE_PATH=$(TOP)/../drm
# Compiler and flags
CC = cc
CXX = CC
HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
@@ -38,6 +36,9 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
PKG_CONFIG = pkg-config
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
@@ -52,7 +53,6 @@ INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = OSMesa
EGL_LIB = EGL
@@ -60,13 +60,10 @@ GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
GLU_LIB_NAME = lib$(GLU_LIB).so
GLUT_LIB_NAME = lib$(GLUT_LIB).so
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
EGL_LIB_NAME = lib$(EGL_LIB).so
@@ -74,12 +71,10 @@ GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
@@ -87,13 +82,9 @@ GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
MESA_ASM_FILES =
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
# order to build the Motif widget too)
@@ -104,17 +95,14 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu glut/glx glw
gallium egl gallium/winsys gallium/targets glu
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# Gallium directories and
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 svga r300 nvfx nv50
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
@@ -130,17 +118,13 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
# Program dependencies - specific GL libraries added in Makefiles
X11_LIBS = -lX11
DLOPEN_LIBS = -ldl
@@ -169,9 +153,6 @@ GLU_PC_REQ = gl
GLU_PC_REQ_PRIV =
GLU_PC_LIB_PRIV =
GLU_PC_CFLAGS =
GLUT_PC_REQ_PRIV =
GLUT_PC_LIB_PRIV =
GLUT_PC_CFLAGS =
GLW_PC_REQ_PRIV =
GLW_PC_LIB_PRIV =
GLW_PC_CFLAGS =
@@ -186,6 +167,16 @@ GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
# default targets
# this helps reduce the mismatch between our automake Makefiles and the old
# custom Makefiles while we transition.
all: default
am--refresh:
distclean: clean
check:
test:

View File

@@ -1,31 +0,0 @@
# Configuration for FreeBSD
include $(TOP)/configs/default
CONFIG_NAME = FreeBSD
# Compiler and flags
CC = cc
CXX = c++
MAKE = gmake
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM \
-DHZ=100
X11_INCLUDES = -I/usr/local/include
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
EXTRA_LIB_PATH = -L/usr/local/lib
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,53 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd
CONFIG_NAME = freebsd-dri
# Compiler and flags
CC = gcc
CXX = g++
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
EXPAT_INCLUDES = -I/usr/local/include
X11_INCLUDES = -I/usr/local/include
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \
$(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES)
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
DRM_SOURCE_PATH=$(TOP)/../drm
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis

View File

@@ -1,10 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86-64
ASM_FLAGS = -DUSE_X86_64_ASM
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)

View File

@@ -1,13 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86
# Unnecessary on x86, generally.
PIC_FLAGS =
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,14 +0,0 @@
# Configuration for HPUX v10, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux10
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
APP_LIB_DEPS = -$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,20 +0,0 @@
# Configuration for HPUX v10, with gcc
include $(TOP)/configs/default
CONFIG_NAME = hpux10-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -ansi -O3 -D_HPUX_SOURCE
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,30 +0,0 @@
# Configuration for HPUX v10, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux10-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm -lstdc++

View File

@@ -1,30 +0,0 @@
# Configuration for HPUX v11
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread -lCsup -lcl

View File

@@ -1,26 +0,0 @@
# Configuration for HPUX v11, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,31 +0,0 @@
# Configuration for HPUX v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)
GL_LIB_DEPS = -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, 64-bit, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread -lCsup -lcl

View File

@@ -1,30 +0,0 @@
# Configuration for HPUX IA64 v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-ia64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.so
GLU_LIB_NAME = libGLU.so
GLUT_LIB_NAME = libglut.so
GLW_LIB_NAME = libGLw.so
OSMESA_LIB_NAME = libOSMesa.so
# Library/program dependencies
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, 64-bit, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-ia64-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lXt -lX11 -lpthread -lm -lCsup -lcl

View File

@@ -1,16 +0,0 @@
# Configuration for HPUX v9, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux9
# Compiler and flags
CC = cc
# XXX fix this
CXX = c++
CFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM
CXXFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,14 +0,0 @@
# Configuration for HPUX v10, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux9-gcc
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,17 +0,0 @@
# Configuration for IRIX 6.x, make n64 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-64
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib64
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lpthread -lm

View File

@@ -1,26 +0,0 @@
# Configuration for IRIX 6.x, make n64 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-64-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib64
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,17 +0,0 @@
# Configuration for IRIX 6.x, make n32 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-n32
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552 -DPTHREADS
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lfpe -lpthread -lm

View File

@@ -1,25 +0,0 @@
# Configuration for IRIX 6.x, make n32 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-n32-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -n32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -n32 -mips2 -O2 -ansi -woff 3262,3666 -DPTHREADS
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,18 +0,0 @@
# Configuration for IRIX 6.x, make o32 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-o32
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm

View File

@@ -1,25 +0,0 @@
# Configuration for IRIX 6.x, make o32 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-o32-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,38 +0,0 @@
# Configuration for generic Linux
include $(TOP)/configs/default
CONFIG_NAME = linux
# Compiler and flags
CC = gcc
CXX = g++
OPT_FLAGS = -O3 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32
# to build properly on 64-bit platforms.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -Wdeclaration-after-statement \
-Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = -Wall -Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GLUT_CFLAGS = -fexceptions
EXTRA_LIB_PATH = -L/usr/X11R6/lib

View File

@@ -1,22 +0,0 @@
# Configuration for Linux on Alpha
include $(TOP)/configs/default
CONFIG_NAME = linux-alpha
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -1,31 +0,0 @@
# Configuration for Linux on Alpha, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-alpha-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -L/usr/X11R6/lib -lX11 -lm

View File

@@ -1,72 +0,0 @@
# linux-cell (non-debug build)
include $(TOP)/configs/linux
CONFIG_NAME = linux-cell
# Omiting other gallium drivers:
GALLIUM_DRIVERS_DIRS = cell softpipe trace rbug identity
# Compiler and flags
CC = ppu32-gcc
CXX = ppu32-g++
HOST_CC = gcc
APP_CC = gcc
APP_CXX = g++
OPT_FLAGS = -O3
# Cell SDK location
## For SDK 2.1: (plus, remove -DSPU_MAIN_PARAM_LONG_LONG below)
#SDK = /opt/ibm/cell-sdk/prototype/sysroot/usr
## For SDK 3.0:
SDK = /opt/cell/sdk/usr
COMMON_C_CPP_FLAGS = $(OPT_FLAGS) -Wall -Winline \
-fPIC -m32 -mabi=altivec -maltivec \
-I. -I$(SDK)/include \
-DGALLIUM_CELL $(DEFINES)
CFLAGS = $(COMMON_C_CPP_FLAGS) -Wmissing-prototypes -std=c99
CXXFLAGS = $(COMMON_C_CPP_FLAGS)
# Omitting glw here:
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium gallium/winsys gallium/targets glu glut/glx
# Build no traditional Mesa drivers:
DRIVER_DIRS =
MKDEP_OPTIONS = -fdepend -Y
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread \
-L$(SDK)/lib -m32 -Wl,-m,elf32ppc -R$(SDK)/lib -lspe2
CELL_SPU_LIB = $(TOP)/src/gallium/drivers/cell/spu/g3d_spu.a
### SPU stuff
SPU_CC = spu-gcc
SPU_CFLAGS = $(OPT_FLAGS) -W -Wall -Winline -Wmissing-prototypes -Wno-main \
-I. -I$(SDK)/spu/include -I$(TOP)/src/mesa/ $(INCLUDE_DIRS) \
-DSPU_MAIN_PARAM_LONG_LONG \
-include spu_intrinsics.h
SPU_LFLAGS = -L$(SDK)/spu/lib -Wl,-N -lmisc -lm
SPU_AR = ppu-ar
SPU_AR_FLAGS = -qcs
SPU_EMBED = ppu32-embedspu
SPU_EMBED_FLAGS = -m32

View File

@@ -1,10 +0,0 @@
# linux-cell-debug
include $(TOP)/configs/linux-cell
# just override name and OPT_FLAGS here:
CONFIG_NAME = linux-cell-debug
OPT_FLAGS = -g -DDEBUG

View File

@@ -1,9 +0,0 @@
# Configuration for debugging on Linux
include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g
#CFLAGS += -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,73 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -O2 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
# Directories
SRC_DIRS := glx egl $(SRC_DIRS)
# EGL directories
EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast
INTEL_LIBS = `pkg-config --libs libdrm_intel`
INTEL_CFLAGS = `pkg-config --cflags libdrm_intel`
RADEON_LIBS = `pkg-config --libs libdrm_radeon`
RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon`

View File

@@ -1,16 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri-debug: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-debug
OPT_FLAGS = -O0 -g
ARCH_FLAGS = -DDEBUG
# Helpful to reduce the amount of stuff that gets built sometimes:
#DRI_DIRS = i915tex i915
#DRI_DIRS = i965
#DRI_DIRS = radeon r200 r300
#DRI_DIRS = unichrome sis
#DRI_DIRS = i810 mga r128 tdfx

View File

@@ -1,17 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-ppc
OPT_FLAGS = -Os -mcpu=603
PIC_FLAGS = -fPIC
ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM
MESA_ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = mach64 r128 r200 r300 radeon tdfx

View File

@@ -1,13 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-x86
ARCH_FLAGS = -m32 -mmmx -msse -msse2
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,24 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-x86-64
ARCH_FLAGS = -m64
ASM_FLAGS = -DUSE_X86_64_ASM
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)
LIB_DIR = lib64
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# sis is missing because it has not been converted to use
# the new interface. i810 are missing because there is no x86-64
# system where they could *ever* be used.
#
DRI_DIRS = i915 i965 mach64 mga r128 r200 r300 radeon savage tdfx unichrome

View File

@@ -1,56 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri-xcb
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = $(shell pkg-config --cflags-only-I x11) $(shell pkg-config --cflags-only-I xcb) $(shell pkg-config --cflags-only-I x11-xcb) $(shell pkg-config --cflags-only-I xcb-glx)
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome

View File

@@ -1,58 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
$(LIBDRM_LIB)
# Directories
SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = egl_drm
GALLIUM_TARGET_DIRS =
DRI_DIRS = intel

View File

@@ -1,18 +0,0 @@
# Configuration for Linux fbdev interface
include $(TOP)/configs/linux
CONFIG_NAME = linux-fbdev
CFLAGS += -DUSE_GLFBDEV_DRIVER
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
SRC_DIRS += glut/fbdev
DRIVER_DIRS = fbdev osmesa
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm

View File

@@ -1,9 +0,0 @@
# Configuration for standalone mode i965 debug
include $(TOP)/configs/linux-debug
CONFIG_NAME = linux-i965
GALLIUM_DRIVER_DIRS = i965
GALLIUM_WINSYS_DIRS = drm/i965/xlib
GALLIUM_TARGET_DIRS =

View File

@@ -1,21 +0,0 @@
# Configuration for Linux with Intel C compiler
include $(TOP)/configs/default
CONFIG_NAME = linux-icc
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -arch icc-istatic
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)

View File

@@ -1,27 +0,0 @@
# Configuration for Linux with Intel C compiler, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-icc-static
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static -arch icc-istatic
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -i-static -cxxlib-icc -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lpthread -lm -lcxa -lunwind

View File

@@ -1,22 +0,0 @@
# Configuration for Linux with Intel C compiler
include $(TOP)/configs/default
CONFIG_NAME = linux-icc
# Compiler and flags
CC = icc
CXX = g++
CFLAGS = -O3 -tpp6 -axK -KPIC -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -arch icc
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,27 +0,0 @@
# Configuration for Linux with Intel C compiler, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-icc-static
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -tpp6 -axK -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -tpp6 -axK -DPTHREADS
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static -arch icc
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLUT_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -lpthread -lcxa -lunwind
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,52 +0,0 @@
# -*-makefile-*-
# Configuration for linux-indirect: Builds a libGL capable of indirect
# rendering, but *NOT* capable of direct rendering.
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DGLX_INDIRECT_RENDERING \
-DPTHREADS -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx glu glut/glx glw
DRIVER_DIRS =

View File

@@ -1,44 +0,0 @@
# -*-makefile-*-
# Configuration for Linux and LLVM with optimizations
# Builds the llvmpipe gallium driver
include $(TOP)/configs/linux
CONFIG_NAME = linux-llvm
# Add llvmpipe driver
GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
# override -std=c99
CFLAGS += -std=gnu99
LLVM_VERSION := $(shell llvm-config --version)
ifeq ($(LLVM_VERSION),)
$(warning Could not find LLVM! Make Sure 'llvm-config' is in the path)
MESA_LLVM=0
else
MESA_LLVM=1
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
# $(info Using LLVM version: $(LLVM_VERSION))
endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
LLVM_CXXFLAGS=
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++

View File

@@ -1,12 +0,0 @@
# -*-makefile-*-
# Configuration for Linux and LLVM with debugging info
# Builds the llvmpipe gallium driver
include $(TOP)/configs/linux-llvm
CONFIG_NAME = linux-llvm-debug
OPT_FLAGS = -g -ansi -pedantic
DEFINES += -DDEBUG -UNDEBUG

View File

@@ -1,28 +0,0 @@
# Configuration for OpenGL ES on Linux
include $(TOP)/configs/linux
CONFIG_NAME = linux-opengl-es
# Directories to build
LIB_DIR = lib
SRC_DIRS = egl glsl mapi/es1api mapi/es2api mesa/es \
gallium gallium/winsys gallium/targets
# egl st needs this
DEFINES += -DGLX_DIRECT_RENDERING
# no mesa or egl drivers
DRIVER_DIRS =
EGL_DRIVERS_DIRS =
GALLIUM_DRIVERS_DIRS = softpipe
# build libGLES*.so
GALLIUM_STATE_TRACKERS_DIRS = es
# build egl_x11_{swrast,i915}.so
GALLIUM_DRIVERS_DIRS += trace rbug i915
GALLIUM_STATE_TRACKERS_DIRS += egl
GALLIUM_WINSYS_DIRS += drm/intel
GALLIUM_TARGET_DIRS += egl-swrast egl-i915

View File

@@ -1,27 +0,0 @@
# Configuration for building only libOSMesa on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -g -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,36 +0,0 @@
# Configuration for building static libOSMesa.a on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc -m32
CXX = g++ -m32
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
$(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm

View File

@@ -1,30 +0,0 @@
# Configuration for 16 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa16
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa16
OSMESA_LIB_NAME = libOSMesa16.so
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,31 +0,0 @@
# Configuration for 16 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa16-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa16
OSMESA_LIB_NAME = libOSMesa16.a
# Directories
SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,30 +0,0 @@
# Configuration for 32 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa32
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa32
OSMESA_LIB_NAME = libOSMesa32.so
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,9 +0,0 @@
# Configuration for Linux on PPC
include $(TOP)/configs/linux
CONFIG_NAME = linux-ppc
OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops
# FIXME: Use of PowerPC assembly should be enabled here.

View File

@@ -1,15 +0,0 @@
# Configuration for Linux on PPC, static libs
include $(TOP)/configs/linux-ppc
CONFIG_NAME = linux-ppc-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux with gprof
include $(TOP)/configs/linux-static
CONFIG_NAME = linux-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

View File

@@ -1,9 +0,0 @@
# Configuration for Linux on Sparc
include $(TOP)/configs/linux
CONFIG_NAME = linux-sparc
#ASM_FLAGS = -DUSE_SPARC_ASM
#MESA_ASM_SOURCES = $(SPARC_SOURCES)
#GLAPI_ASM_SOURCES = $(SPARC_API)

View File

@@ -1,7 +0,0 @@
# Configuration for Linux on Sparc5
include $(TOP)/configs/linux-sparc
CONFIG_NAME = linux-sparc5
ARCH_FLAGS += -mcpu=ultrasparc

View File

@@ -1,26 +0,0 @@
# Configuration for generic Linux, making static libs
include $(TOP)/configs/linux
CONFIG_NAME = linux-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \
-l$(GL_LIB) -lm -L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread

View File

@@ -1,7 +0,0 @@
# Configuration for Linux on UltraSparc
include $(TOP)/configs/linux-sparc
CONFIG_NAME = linux-ultrasparc
ARCH_FLAGS += -mv8 -mtune=ultrasparc

View File

@@ -1,11 +0,0 @@
# Configuration for Linux with x86 optimizations
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86
ARCH_FLAGS = -m32 -mmmx -msse -msse2
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,7 +0,0 @@
# To build Linux x86 32-bit in an x86-64 environment
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-32
ARCH_FLAGS += -m32

View File

@@ -1,14 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86-64
ARCH_FLAGS = -m64
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)
ASM_FLAGS = -DUSE_X86_64_ASM
LIB_DIR = lib64
EXTRA_LIB_PATH = -L/usr/X11R6/lib64

View File

@@ -1,8 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-debug
OPT_FLAGS = -g
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux for 64-bit X86 (Opteron) with gprof
include $(TOP)/configs/linux-x86-64-static
CONFIG_NAME = linux-x86-64-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

View File

@@ -1,27 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron), static libs
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \
-l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group \
$(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm

View File

@@ -1,9 +0,0 @@
# Configuration for Linux with x86 code, but no gcc optimizations and
# debugging enabled.
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-debug
OPT_FLAGS = -g
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux with x86 optimizations with gprof
include $(TOP)/configs/linux-x86-static
CONFIG_NAME = linux-x86-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

Some files were not shown because too many files have changed in this diff Show More