Compare commits

...

2460 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
1998 changed files with 188976 additions and 202296 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)

9
.gitignore vendored
View File

@@ -2,6 +2,8 @@
*.dll
*.exe
*.ilk
*.la
*.lo
*.o
*.obj
*.os
@@ -19,9 +21,11 @@
*~
depend
depend.bak
bin/ltmain.sh
lib
lib64
configure
configure.lineno
autom4te.cache
aclocal.m4
config.log
@@ -30,5 +34,10 @@ cscope*
.scon*
config.py
build
libtool
manifest.txt
Makefile.in
.dir-locals.el
.deps/
.libs/
/Makefile

View File

@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
# gallium drivers: swrast i915g nouveau r300g r600g vmwgfx
# 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.
@@ -37,7 +37,7 @@ DRM_TOP := external/drm
DRM_GRALLOC_TOP := hardware/drm_gralloc
classic_drivers := i915 i965
gallium_drivers := swrast i915g nouveau r300g r600g vmwgfx
gallium_drivers := swrast i915g nouveau r300g r600g radeonsi vmwgfx
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))

263
Makefile
View File

@@ -1,263 +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)
check:
cd src/glsl/tests/ && ./optimization-test
make -C tests check
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 check
# 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 \
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-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
PACKAGE_VERSION=8.0-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
tests/Makefile.in \
tests/glx/Makefile.in \
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/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)/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
# Helper for autoconf builds
ACLOCAL = aclocal
ACLOCAL_FLAGS =
AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
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

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

6
bin/.gitignore vendored
View File

@@ -1,2 +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,20 +0,0 @@
#!/bin/sh
if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
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.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi

View File

@@ -1 +0,0 @@
minstall

View File

@@ -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

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',
}
@@ -83,7 +89,7 @@ def AddOptions(opts):
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', 'windows', 'darwin', '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'))

View File

@@ -1,27 +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
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
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXm -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)

View File

@@ -1,24 +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
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
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXm -lXt -lX11

View File

@@ -1,21 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,21 +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

View File

@@ -1,20 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,31 +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)

View File

@@ -1,27 +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)

View File

@@ -1,30 +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)

View File

@@ -11,13 +11,12 @@ 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)
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
@@ -32,19 +31,22 @@ 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@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
MESA_ASM_FILES = @MESA_ASM_FILES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
@@ -58,13 +60,20 @@ 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 = @FLEX@
BISON = @BISON@
FLEX = @LEX@
BISON = @YACC@
# Library names (base name)
GL_LIB = @GL_LIB@
@@ -75,8 +84,6 @@ GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -88,8 +95,6 @@ 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@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -101,16 +106,12 @@ 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@
GBM_LIB_GLOB = @GBM_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@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -121,9 +122,6 @@ GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drive
# 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@
@@ -147,8 +145,6 @@ 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_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
@@ -179,6 +175,9 @@ 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@
@@ -188,6 +187,9 @@ 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@
@@ -207,12 +209,6 @@ 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@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
@@ -224,9 +220,8 @@ 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@
GALLIUM_PIPE_LOADER_DEFINES = @GALLIUM_PIPE_LOADER_DEFINES@
GALLIUM_PIPE_LOADER_LIBS = @GALLIUM_PIPE_LOADER_LIBS@

View File

@@ -1,58 +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 -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-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 = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad
#GALLIUM_DRIVERS_DIRS += llvmpipe

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

@@ -9,7 +9,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=8
MESA_MINOR=0
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
@@ -62,8 +60,6 @@ GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
@@ -75,8 +71,6 @@ 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
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -88,14 +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)*
GBM_LIB_GLOB = $(GBM_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)
@@ -110,12 +99,6 @@ SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -140,8 +123,6 @@ 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
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL libraries added in Makefiles
X11_LIBS = -lX11
@@ -160,9 +141,6 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -189,9 +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 =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_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,29 +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)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
EXTRA_LIB_PATH = -L/usr/local/lib

View File

@@ -1,51 +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)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu
DRIVER_DIRS = dri
DRM_SOURCE_PATH=$(TOP)/../drm
DRI_DIRS = i915 i965 r200 radeon

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,13 +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

View File

@@ -1,18 +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
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing

View File

@@ -1,26 +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
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 =
GLW_LIB_DEPS =

View File

@@ -1,27 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
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
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,25 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,24 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,28 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
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
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,25 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,28 +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
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
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,25 +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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,15 +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

View File

@@ -1,13 +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

View File

@@ -1,16 +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

View File

@@ -1,24 +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
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,16 +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

View File

@@ -1,23 +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
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,17 +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

View File

@@ -1,23 +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
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,37 +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
EXTRA_LIB_PATH = -L/usr/X11R6/lib

View File

@@ -1,19 +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
# 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
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11

View File

@@ -1,27 +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
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
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11

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,76 +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)
# 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 svga/drm
GALLIUM_TARGET_DIRS = dri-vmwgfx
GALLIUM_STATE_TRACKERS_DIRS = egl dri
DRI_DIRS = i915 i965 nouveau r200 radeon swrast
INTEL_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_intel)
INTEL_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_intel)
NOUVEAU_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_nouveau)
NOUVEAU_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -1,14 +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

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 = r200 radeon

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,20 +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
DRI_DIRS = i915 i965 r200 radeon

View File

@@ -1,55 +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
DRIVER_DIRS = dri
DRI_DIRS = i915 r200 radeon

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 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
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)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,23 +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
MKLIB_OPTIONS = -static -arch icc-istatic
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =

View File

@@ -1,19 +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
MKLIB_OPTIONS = -arch icc
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,23 +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
MKLIB_OPTIONS = -static -arch icc
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
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
DRIVER_DIRS =

View File

@@ -1,47 +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|sed 's/-DNDEBUG\>//g'`
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++
# to allow the NV drivers to compile
LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)

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,26 +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)

View File

@@ -1,32 +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
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 =
GLW_LIB_DEPS =

View File

@@ -1,29 +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)

View File

@@ -1,30 +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

View File

@@ -1,29 +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)

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,14 +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
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,23 +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
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 =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
-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,21 +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
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 =
GLW_LIB_DEPS =

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

View File

@@ -1,21 +0,0 @@
# Configuration for Linux with x86 optimizations, static libs
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.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 =
GLW_LIB_DEPS =

View File

@@ -1,15 +0,0 @@
# Configuration for NetBSD
include $(TOP)/configs/default
CONFIG_NAME = netbsd
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100
CXXFLAGS = -O2 -fPIC
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing

View File

@@ -1,20 +0,0 @@
# Configuration for OpenBSD
include $(TOP)/configs/default
CONFIG_NAME = openbsd
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DUSE_XSHM -DHZ=100
CXXFLAGS = -O2 -fPIC -I/usr/X11R6/include -DHZ=100
# 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
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)

View File

@@ -1,14 +0,0 @@
# Configuration for OSF/1
include $(TOP)/configs/default
CONFIG_NAME = osf1
# Compiler and flags
CC = cc
CXX = cxx
CFLAGS = -O0 -std1 -ieee_with_no_inexact -DUSE_XSHM -DPTHREADS -D_REENTRANT
CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm

View File

@@ -1,15 +0,0 @@
# Configuration for OSF/1
include $(TOP)/configs/default
CONFIG_NAME = osf1
# Compiler and flags
CC = cc
CXX = cxx
CFLAGS = -O2 -std1 -ieee_with_no_inexact -DUSE_XSHM -DPTHREADS -D_REENTRANT
CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT
MKLIB_OPTIONS = -static
GL_LIB_DEPS =
GLU_LIB_DEPS =

View File

@@ -1,16 +0,0 @@
# Configuration for Solaris on x86
include $(TOP)/configs/default
CONFIG_NAME = solaris-x86
# Compiler and flags
CC = cc
CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM
MKLIB_OPTIONS = -static
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,18 +0,0 @@
# Configuration for Solaris on x86 with gcc, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = solaris-x86-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -march=i486 -fPIC -I/usr/openwin/include -DUSE_XSHM
CXXFLAGS = -O3 -march=i486 -fPIC
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm

View File

@@ -1,24 +0,0 @@
# Configuration for Solaris on x86 with gcc, static libs
include $(TOP)/configs/default
CONFIG_NAME = solaris-x86-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -march=i486 -fPIC -I/usr/openwin/include -DUSE_XSHM
CXXFLAGS = -O3 -march=i486 -fPIC
MKLIB_OPTIONS = -static
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,11 +0,0 @@
# Configuration for SunOS 4, shared libs
include $(TOP)/configs/default
CONFIG_NAME = sunos4
# Compiler and flags
CC = acc
CFLAGS = -Kpic -O -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4

View File

@@ -1,17 +0,0 @@
# Configuration for SunOS 4, with gcc, shared libs
include $(TOP)/configs/default
CONFIG_NAME = sunos4-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4
CXXFLAGS = -fPIC -O3 -I/usr/openwin/include -DSUNOS4
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing

Some files were not shown because too many files have changed in this diff Show More