Commit graph

33680 commits

Author SHA1 Message Date
Keith Whitwell
8e8a42ffc5 llvmpipe: return zero from floor_pot(zero) 2010-09-15 16:41:59 +01:00
Dave Airlie
fd4c6bd135 r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb

test run glxgears, resize.
(cherry picked from commit 09ef8e9283)
2010-09-15 13:32:29 +02:00
Marek Olšák
5d4409e0e5 r300g: prevent creating multiple winsys BOs for the same handle
This fixes a DRM deadlock in the cubestorm xscreensaver, because somehow
there must not be 2 different BOs relocated in one CS if both BOs back
the same handle. I was told it is impossible to happen, but apparently
it is not, or there is something else wrong.
(cherry picked from commit 0b9eb5c9bb)
2010-09-15 04:34:36 +02:00
Luca Barbieri
26e63a431d auxiliary: fix unintended fallthrough 2010-09-14 23:22:16 +02:00
Andre Maasikas
b0bc026c12 r600c: fix setting negative values to bitfields
when setting negative integers to bitfields we could overwrite
other parts of it. So mask the value to be written correctly.
This is used quite often in the driver - hope it doesnt affect
performace or uncover behaviour relied before...

fixes strange effects when setting negative lodbias on evergreen
2010-09-14 19:00:35 +03:00
Brian Paul
7993832c12 mesa: update to version 64 of GL/glext.h
A number of other files had to be updated as well because const
qualifiers were added to the glMultiDrawArrays() function.
Also, GL_FIXED is now defined in glext.h.
2010-09-14 09:37:37 -06:00
Brian Paul
83f5f50f2f mesa: move, redefine MESA_GEOMETRY_PROGRAM 2010-09-14 09:16:40 -06:00
Brian Paul
1c0644e9da glsl2: add case for ir_unop_noise
Silences a compiler warning.  Still need to add some assertions
for this case.
2010-09-14 09:15:20 -06:00
Brian Paul
2b04ead569 glsl2: fix comments 2010-09-14 09:05:46 -06:00
Chia-I Wu
9476efe77f mesa: Remove unnecessary FEATURE tests.
Remove all FEATURE tests in mesa/drivers/common/.  They are not needed
and the code looks better without them.
2010-09-14 15:49:58 +08:00
Chia-I Wu
10ff2646a4 mesa: Less FEATURE_ARB_sync tests.
Add dummy static inline definitions to syncobj.h when FEATURE_ARB_sync
is 0, and remove most FEATURE_ARB_sync tests.
2010-09-14 15:49:47 +08:00
Chia-I Wu
db6273e0dd mesa: Remove unused _MESA_INIT_*_FUNCTIONS.
They were intended to be used to build OpenGL ES only DRI drivers, but
that never happened.
2010-09-14 15:49:43 +08:00
Vinson Lee
1c6992b873 gallivm: Remove unnecessary header. 2010-09-14 00:42:20 -07:00
Vinson Lee
aeb83928fd llvmpipe: Initialize variable for potentially unhandled switch case. 2010-09-14 00:17:13 -07:00
Vinson Lee
45ee8463a2 i965g: Fix 'control reaches end of non-void function' warning.
Fixes the following GCC warning.
brw_screen.c: In function 'brw_get_shader_param':
brw_screen.c:241: warning: control reaches end of non-void function
2010-09-14 00:08:45 -07:00
Vinson Lee
706380cf7d i915g: Fix 'control reaches end of non-void function' warning.
Fixes the following GCC warning.
i915_screen.c: In function 'i915_get_shader_param':
i915_screen.c:184: warning: control reaches end of non-void function
2010-09-13 23:58:42 -07:00
Vinson Lee
d4d48c0579 i915: Fix "implicit declaration of function 'draw_get_shader_param'" warning.
Fixes the following GCC warning.
i915_screen.c: In function 'i915_get_shader_param':
i915_screen.c:147: warning: implicit declaration of function 'draw_get_shader_param'
2010-09-13 23:42:35 -07:00
Vinson Lee
c5867acb0d identity: Fix 'assignment from incompatible pointer type' warning.
This is a follow-up to commit a508d2dddc.

Fixes the following GCC warning.
id_screen.c: In function 'identity_screen_create':
id_screen.c:317: warning: assignment from incompatible pointer type
2010-09-13 23:23:34 -07:00
Vinson Lee
4f2f02b7d6 rbug: Fix 'assignment from incompatible pointer type' warning.
This is a follow-up to commit a508d2dddc.

Fixes the following GCC warning.
rbug_screen.c: In function 'rbug_screen_create':
rbug_screen.c:331: warning: assignment from incompatible pointer type
2010-09-13 23:02:37 -07:00
Luca Barbieri
fbc7c9b7a9 mesa/st: ask GLSL to not emit noise since we have a dummy implementation
Note, BTW, that the Gallium implementation returns 0.5, which seems
to violate the GLSL spec, where it should return 0.0 instead.

Not sure whether changing it to 0 is correct or not.
2010-09-14 06:08:03 +02:00
Luca Barbieri
b37459388b mesa/st: set compiler options based on Gallium shader caps
This turns on if conversion and unlimited loop unrolling if control
flow is not supported.

NOTE: this will change the behavior of r300g and any other driver
that doesn't advertise control flow
2010-09-14 06:08:03 +02:00
Luca Barbieri
a508d2dddc gallium: introduce get_shader_param (ALL DRIVERS CHANGED) (v3)
Changes in v3:
- Also change trace, which I forgot about

Changes in v2:
- No longer adds tessellation shaders

Currently each shader cap has FS and VS versions.

However, we want a version of them for geometry, tessellation control,
and tessellation evaluation shaders, and want to be able to easily
query a given cap type for a given shader stage.

Since having 5 duplicates of each shader cap is unmanageable, add
a new get_shader_param function that takes both a shader cap from a
new enum and a shader stage.

Drivers with non-unified shaders will first switch on the shader
and, within each case, switch on the cap.

Drivers with unified shaders instead first check whether the shader
is supported, and then switch on the cap.

MAX_CONST_BUFFERS is now per-stage.
The geometry shader cap is removed in favor of checking whether the
limit of geometry shader instructions is greater than 0, which is also
used for tessellation shaders.

WARNING: all drivers changed and compiled but only nvfx tested
2010-09-14 06:07:41 +02:00
Ian Romanick
309cd4115b glsl2: Port equal() and notEqual() to ir_unop_all_equal and ir_unop_any_nequal 2010-09-13 17:53:32 -07:00
Luca Barbieri
4dfb89904c glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmps
Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal"
and "ir_binop_nequal" to compare all elements and give a single bool.

This is highly unintuitive and prevents generation of optimal Mesa IR.

Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and
"ir_binop_nequal" to "ir_binop_any_nequal".

Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics
as less, lequal, etc.

Third, allow all comparisons to acts on vectors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13 17:53:04 -07:00
Luca Barbieri
2cdbced10d loop_unroll: unroll loops with (lowered) breaks
If the loop ends with an if with one break or in a single break unroll
it.  Loops that end with a continue will have that continue removed by
the redundant jump optimizer.  Likewise loops that end with an
if-statement with a break at the end of both branches will have the
break pulled out after the if-statement.

Loops of the form

   for (...) {
      do_something1();
      if (cond) {
	 do_something2();
	 break;
      } else {
	 do_something3();
      }
   }

will be unrolled as

   do_something1();
   if (cond) {
      do_something2();
   } else {
      do_something3();
      do_something1();
      if (cond) {
	 do_something2();
      } else {
	 do_something3();
	 /* Repeat inserting iterations here.*/
      }
   }

ir_lower_jumps can guarantee that all loops are put in this form
and thus all loops are now potentially unrollable if an upper bound
on the number of iterations can be found.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13 16:20:40 -07:00
Ian Romanick
8f2214f489 glsl2: Add pass to remove redundant jumps 2010-09-13 14:25:26 -07:00
Ian Romanick
e79a1bb02a glsl: Explain file naming convention 2010-09-13 14:06:32 -07:00
Luca Barbieri
710d41131b loop_controls: fix analysis of already analyzed loops
The loop_controls pass didn't look at the counter values it put in ir_loop
on previous iterations, so while the first iteration worked, subsequent
ones couldn't determine max_iterations.
2010-09-13 13:03:10 -07:00
Ian Romanick
4de7a3b76a i965: Request that returns be lowered in shader main
Fixes piglit tests glsl-vs-main-return and glsl-fs-main-return.
2010-09-13 13:03:10 -07:00
Luca Barbieri
87708e8c90 glsl: call ir_lower_jumps according to compiler options 2010-09-13 13:03:09 -07:00
Luca Barbieri
3361cbac2a glsl: add continue/break/return unification/elimination pass (v2)
Changes in v2:
- Base class renamed to ir_control_flow_visitor
- Tried to comply with coding style

This is a new pass that supersedes ir_if_return and "lowers" jumps
to if/else structures.

Currently it causes no regressions on softpipe and nv40, but I'm not sure
whether the piglit glsl tests are thorough enough, so consider this
experimental.

It can be asked to:
1. Pull jumps out of ifs where possible
2. Remove all "continue"s, replacing them with an "execute flag"
3. Replace all "break" with a single conditional one at the end of the loop
4. Replace all "return"s with a single return at the end of the function,
   for the main function and/or other functions

This gives several great benefits:
1. All functions can be inlined after this pass
2. nv40 and other pre-DX10 chips without "continue" can be supported
3. nv30 and other pre-DX10 chips with no control flow at all are better supported

Note that for full effect we should also teach the unroller to unroll
loops with a fixed maximum number of iterations but with the canonical
conditional "break" that this pass will insert if asked to.

Continues are lowered by adding a per-loop "execute flag", initialized to
TRUE, that when cleared inhibits all execution until the end of the loop.

Breaks are lowered to continues, plus setting a "break flag" that is checked
at the end of the loop, and trigger the unique "break".

Returns are lowered to breaks/continues, plus adding a "return flag" that
causes loops to break again out of their enclosing loops until all the
loops are exited: then the "execute flag" logic will ignore everything
until the end of the function.

Note that "continue" and "return" can also be implemented by adding
a dummy loop and using break.
However, this is bad for hardware with limited nesting depth, and
prevents further optimization, and thus is not currently performed.
2010-09-13 13:03:09 -07:00
Luca Barbieri
55adbebc62 glsl: add ir_control_flow_visitor
This is just a subclass of ir_visitor with empty implementations of all
the visit methods for non-control flow nodes.

Used to avoid duplicating that in ir_visitor subclasses.

ir_hierarchical_visitor is another way to solve this, but is less natural
for some applications.
2010-09-13 13:03:09 -07:00
José Fonseca
6b5575baaa llvmpipe: Fix non SSE2 builds.
Should fix fdo 30168.
2010-09-13 20:43:36 +01:00
Marek Olšák
428dc6d7d2 r300g/swtcl: unlock VBO after draw_flush
https://bugs.freedesktop.org/show_bug.cgi?id=29901
https://bugs.freedesktop.org/show_bug.cgi?id=30132
2010-09-13 21:12:07 +02:00
Witold Baryluk
c40858fa0d llvmpipe: Change asm to __asm__.
According to gcc documentation both are equivalent,
second are prefered as first can make conflict with existing symbols.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-09-13 18:58:50 +01:00
Jesse Barnes
e7eff0cfce EGL DRI2: 0xa011 is Pineview not Ironlake
Point about needing a better way to do this validated.
2010-09-13 10:55:56 -07:00
Alex Deucher
9532eea509 r600c: const buffer sizes must be a multiple of 16 consts
This applies to r6xx/r7xx/evergreen
2010-09-13 13:41:46 -04:00
Jesse Barnes
c121608b6e EGL DRI2: add PCI ID for Ironlake mobile
Allows KMS EGL driver to load.  We need a better way of doing this.
2010-09-13 10:36:46 -07:00
Alex Deucher
6f839eb631 r600c/eg: remove obselete comment 2010-09-13 12:16:00 -04:00
Alex Deucher
2ef5bc3976 r600c/eg: remove unused emit timestamp function 2010-09-13 12:14:24 -04:00
Alex Deucher
07d95cdbfb r600c/eg: emit CB_BLEND_ALPHA with the other blend values
saves a few dwords
2010-09-13 12:11:29 -04:00
Alex Deucher
105ef5eb5e r600c: remove redundant state emit on evergreen
r700start3d already emits the context control packets
2010-09-13 12:06:34 -04:00
Kristian Høgsberg
7dcb305000 mesa: Revert accidentally committed vertex code chunk 2010-09-13 10:32:15 -04:00
Andre Maasikas
cdfe02d3fc r600c: eg: fix typo
probably copy/paste error
2010-09-13 16:55:58 +03:00
Andre Maasikas
629842b44c r600c: eg: 256 float4 constants may need more than 256 bytes 2010-09-13 16:29:44 +03:00
Andre Maasikas
c82beb436b r600c: eg - fix uninitialized variable 2010-09-13 16:19:18 +03:00
Kristian Høgsberg
4ebf07a426 glx: Don't destroy DRI2 drawables for legacy glx drawables
For GLX 1.3 drawables, we can destroy the DRI2 drawable when the GLX
drawable is destroyed.  However, for legacy drawables, there os no
good way of knowing when the application is done with it, so we just
let the DRI2 drawable linger on the server.  The server will destroy
the DRI2 drawable when it destroys the X drawable or the client exits
anyway.

https://bugs.freedesktop.org/show_bug.cgi?id=30109
2010-09-13 08:42:22 -04:00
Marek Olšák
0392e48867 r300g: fix SWTCL
https://bugs.freedesktop.org/show_bug.cgi?id=29901
2010-09-13 13:26:35 +02:00
José Fonseca
501d43028e llvmpipe: Unbreak rasterization on 64bit. 2010-09-13 12:03:35 +01:00
José Fonseca
91a9325761 gallium: Change the resource_copy_region semantics to allow copies between different yet compatible formats 2010-09-13 11:33:44 +01:00