Commit Graph

44590 Commits

Author SHA1 Message Date
José Fonseca 2699fce0d6 scons: Buid libGL.so (WIP). 2011-06-30 11:34:51 +01:00
José Fonseca 0edb40cb69 scons: Make declaration-after-statement and pointer-arith just warnings.
Necessary, in order to build the whole tree.
2011-06-30 10:43:57 +01:00
Stéphane Marchesin a9cb01f355 i915g: Implement surface format fixup without adding an extra instruction.
We also avoid writing output color twice, which might not work when we run out of phases.
2011-06-30 02:13:28 -07:00
Stéphane Marchesin 2adf02b456 i915g: update TODO. 2011-06-29 21:59:01 -07:00
Chia-I Wu 3e3df5fcd1 target/egl-static: fix a compiler warning 2011-06-30 10:23:50 +09:00
Stéphane Marchesin 5d7609715a i915g: Try to do better in the shader compiler.
- Copy i915c's support for phases, that should allow us to run a coupe more shaders.
- Fix the error messages.
- Still try to proceed when we get a shader that's too long.
2011-06-29 16:54:29 -07:00
Stéphane Marchesin 5349b95920 Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our stage. 2011-06-29 16:54:28 -07:00
Kenneth Graunke 578f6a9534 glsl: Don't use MOD_TO_FRACT lowering on GLSL 1.30's % operator.
MOD_TO_FRACT was designed to lower the GLSL 1.20 mod() function, which
operates on floating point values.  However, we also use ir_binop_mod
for GLSL 1.30's % operator, which operates on integers.

For now, make MOD_TO_FRACT only apply to floating-point mod operations.
In the future, we may want to add a lowering pass for integer-based mod.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke ed92b91212 glsl: Fix DIV_TO_MUL_RCP lowering for uint result types.
f2i results in an int/ivec; we need i2u to get a uint/uvec.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke 8eb9753944 glsl: Distinguish "type mismatch" error messages for modulus operator.
Previously, it would simply say "type error" in three different cases:
- The LHS is not an integer
- The RHS is not an integer
- The LHS and RHS have different base types (int vs. uint)

Now the error messages state the specific problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke 60eb63a855 glsl: Find the "closest" signature when there are multiple matches.
Previously, ir_function::matching_signature had a fatal bug: if a
function had more than one non-exact match, it would simply return NULL.

This occured, for example, when looking for max(uvec3, uvec3):
- max(vec3, vec3)   -> score 1 (found first)
- max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
- max(uvec3, uvec3) -> score 0 (exact match...the right answer)

This did not occur for max(ivec3, ivec3) since the second match found
was an exact match.

The new behavior is to return a match with the lowest score.  If there
is an exact match, that will be returned.  Otherwise, a match with the
least number of implicit conversions is chosen.

Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke 6b1ba7ccef glsl: Use i2u and u2i to implement constructor conversions.
Inspired by a patch from Bryan Cain <bryancain3@gmail.com>.

Fixes piglit tests:
- ctor-int-uint.vert
- ctor-ivec4-uvec4.vert
- ctor-uint-int.vert
- ctor-uvec4-ivec4.vert

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke b633ddeb9f i965/fs: Implement new ir_unop_u2i and ir_unop_i2u opcodes.
No MOV is necessary since signed/unsigned integers share the same
bit-representation; it's simply a question of interpretation.  In
particular, the fs_reg::imm union shouldn't need updating.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Kenneth Graunke 006d5a1aa4 ir_to_mesa: "Support" u2f, i2u, and u2i operations by doing nothing.
Mesa IR actually stores all numbers as floating point, so this is
totally a farce, but we may as well keep it going.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Kenneth Graunke 3283e362e3 glsl: Revert "fix conversions from uint to bool and from..."
Reverts commit f41e1db327
"fix conversions from uint to bool and from float/bool to uint"

f2i, b2i, and b2i should not accept uint types.  Use i2u and u2i.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Bryan Cain 20ef96c7ff glsl: Add ir_unop_i2u and ir_unop_u2i operations.
These are necessary to handle int/uint constructor conversions.  For
example, the following code currently results in a type mismatch:

int x = 7;
uint y = uint(x);

In particular, uint(x) still has type int.

This commit simply adds the new operations; it does not generate them,
nor does it add backend support for them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Eric Anholt 4f799e6142 glsl: Use the default values of ir_assignment() in lower_mat_op_to_vec.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:10:43 -07:00
Eric Anholt e617a53a74 glsl: Allow ir_assignment() constructor to not specify condition.
We almost never want to specify a condition, and when we do we're
already thinking about it (because we're writing a lowering pass
generating the condition), so a default argument should make the code
more pleasant to read.

NOTE: This is a candidate for the 7.11 branch (we want to be able to
cherry-pick future code).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:10:03 -07:00
Eric Anholt 487dd96c27 glsl: Avoid making a temporary for lower_mat_op_to_vec if not needed.
Our copy propagation tends to be bad at handling the later array
accesses of the matrix argument we moved to a temporary.  Generally we
don't need to move it to a temporary, though, so this avoids needing
more copy propagation complexity.

Reduces instruction count of some Unigine Tropics and Sanctuary
fragment shaders that do operations on uniform matrix arrays by 5.9%
on gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:54 -07:00
Eric Anholt 8fad8637ef glsl: Make lower_mat_op_to_vec track derefs, not variables.
We were constrained to using temporaries because we were assuming
variables all over.  This simplifies things a bit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:47 -07:00
Eric Anholt 408377aed1 glsl: Rename lower_mat_op_to_vec operands/results to be less hungarian.
This awkward typing was to avoid shadowing the function argument (the
matrix) with the temporary deref (the column) before the
get_column()/get_element()s were moved into the expression/assignment
constructors.  They're about to become not-variables, so the current
names had to go.  This change is almost mechanical (other than
column_expr), so it should make the next diff clearer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:32 -07:00
Eric Anholt a47fd5c27d glsl: Move get_{column,element} to expression args.
I think this makes the code more obvious by moving the declarations to
their single usage (now that we aren't using them to get at the ->type
field for expression constructors).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:27 -07:00
Eric Anholt e75b5954db glsl: Drop explicit types of lower_mat_op_to_vec expressions.
The constructor can figure it out for us these days.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:08 -07:00
Adam Jackson d44f821213 drisw: Remove cargo culting that breaks GLX 1.3 ctors
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:19 -04:00
Adam Jackson 4833104718 glx: Verify that drawable creation on the client side actually worked
... and clean up if it didn't.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:19 -04:00
Adam Jackson 9e2bc5d4b0 glx: Alias glXFreeContextEXT to glXDestroyContext
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:18 -04:00
Kenneth Graunke 5ddc518401 i965/gen7: Add missing ! to brw->gs.prog_active assertion.
A typo in commit c173541d97 accidentally removed the !.
It's supposed to assert that there is _not_ an active GS program.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 10:57:55 -07:00
Brian Paul e17f2bad3a mesa: bump version to 7.12 (devel) 2011-06-29 07:38:10 -06:00
Brian Paul 600e01e758 configs: add libdrm cflags to linux-llvm config 2011-06-29 07:38:10 -06:00
Jon TURNEY 8f0a331040 i915g: Move definition of M_PI in i915_fpc_translate.c
Move defintion of M_PI (for the benefit of <math.h> which do not define it), to
before the first use of it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-29 14:29:26 +01:00
Brian Paul 475685ce50 st/mesa: s/tex_usage/bindings/ in st_format.h
Just be consistent with the .c file.
2011-06-29 07:23:47 -06:00
Emil Velikov 9b5c538726 st/mesa: Use correct internal target
Commit 1a339b6c(st/mesa: prefer native texture formats when possible)
introduced two new arguments to the st_choose_format() functions.
This patch fixes the order and passes the correct internal_target
rather than GL_NONE

NOTE: This is a candidate for the 7.11 branch
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-29 07:18:32 -06:00
Thomas Hellstrom 5d2fad5444 st/glx: Fix compilation error
Fix compilation error due to commit
"Rework how drawables are invalidated v3"

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 15:03:52 +02:00
Andre Maasikas 19789e403c st/mesa: fix overwriting gl_format with pipe_format since 9d380f48
fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-29 06:52:45 -06:00
Thomas Hellstrom ade9f0d727 st/dri: Get rid of the evil struct dri_drawable::context member
It's incorrect to assume a single context bound to a drawable.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 12:48:59 +02:00
Thomas Hellstrom ac8fdbc1c7 st-api: Rework how drawables are invalidated v3.
The api and the state tracker manager code as well as the state tracker code
assumed that only a single context could be bound to a drawable. That is not
a valid assumption, since multiple contexts can bind to the same drawable.

Fix this by making it the state tracker's responsibility to update all
contexts binding to a drawable

Note that the state trackers themselves don't use atomic stamps on
frame-buffers. Multiple context rendering to the same drawable should
be protected by the application.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 12:48:59 +02:00
Stéphane Marchesin 1a7e17e44a i915g: Fix unimplemented Abs comment. 2011-06-29 01:23:44 -07:00
Stéphane Marchesin 4e6120576f i915g: If we have a program, that means the other fields are ours and we can free them.
Otherwise they probably belong to draw.
2011-06-28 20:42:39 -07:00
Stéphane Marchesin c66877c290 i915g: Don't overflow the program buffer.
Otherwise it corrupts other fields of the struct and hilarity ensues.
2011-06-28 20:42:38 -07:00
Stéphane Marchesin dd691032c8 i915g: Update the TODO with another idea. 2011-06-28 20:42:38 -07:00
Paul Berry 3097715d41 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 14:00:20 -07:00
Paul Berry 9c4445de6e glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 13:57:03 -07:00
Paul Berry b078aad8ab glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

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

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
2011-06-28 13:49:11 -07:00
Stéphane Marchesin fe36bc0c41 i915g: Fix comment about sin/cos constants. 2011-06-28 12:07:11 -07:00
Stéphane Marchesin bd1ee76442 i915g: Fix staging texture uploads a bit.
They still look corrupted, but at least now they don't look tiled any more.
2011-06-28 12:05:28 -07:00
Eric Anholt a09c5c2e30 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
2011-06-28 10:17:39 -07:00
Eric Anholt cd7bfd5d44 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
2011-06-28 10:17:39 -07:00
Alan Hourihane 6479922499 glx: Check HAVE_XF86VIDMODE before adding it as an implicit link
library.
2011-06-28 17:41:39 +01:00
Jon TURNEY db78643182 Don't use -fvisibilty=hidden on cygwin
All it's going to do is generate lots and lots and lots of
'warning: visibility attribute not supported in this configuration; ignored'
warnings

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-06-28 17:07:02 +01:00
Jon TURNEY 560f76227c Fix config check that claims to test if CXX supports -fvisibility=hidden option to actually test the C++ compiler.
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-06-28 17:06:59 +01:00