Commit graph

40728 commits

Author SHA1 Message Date
Ian Romanick
13f57d42b6 glsl: Add unary ir_expression constructor 2010-11-19 15:00:25 -08:00
Ian Romanick
8e498050dc glsl: Add ir_rvalue::is_negative_one predicate 2010-11-19 15:00:25 -08:00
Ian Romanick
fc92e87b97 glsl: Eliminate assumptions about size of ir_expression::operands
This may grow in the near future.
2010-11-19 15:00:25 -08:00
Ian Romanick
f2616e56de glsl: Add ir_unop_sin_reduced and ir_unop_cos_reduced
The operate just like ir_unop_sin and ir_unop_cos except that they
expect their inputs to be limited to the range [-pi, pi].  Several
GPUs require this limited range for their sine and cosine
instructions, so having these as operations (along with a to-be-written
lowering pass) helps this architectures.

These new operations also matche the semantics of the
GL_ARB_fragment_program SCS instruction.  Having these as operations
helps in generating GLSL IR directly from assembly fragment programs.
2010-11-19 15:00:25 -08:00
Alex Deucher
04ffbe1ac6 r600g: use full range of VS resources for vertex samplers
Now that we have fetch shaders, the full range of VS resources
can be used for sampling.
2010-11-19 15:51:24 -05:00
Alex Deucher
4afd068385 r600g: use meaningful defines for chiprev
Makes the code much clearer.
2010-11-19 15:32:02 -05:00
Alex Deucher
52c66120d8 r600g: translate ARR instruction for evergreen
evergreen variant of:
9f7ec103e2
2010-11-19 15:20:59 -05:00
Jerome Glisse
f609b2ab03 r600g: add fetch shader capabilities
Use fetch shader instead of having fetch instruction in the vertex
shader. Allow to restrict shader update to a smaller part when
vertex buffer input layout changes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 13:40:55 -05:00
Alex Deucher
3e76ed4e25 r600g: All EVENT_WRITE packets need the EVENT_INDEX field
6xx-evergreen
2010-11-19 13:35:53 -05:00
Viktor Novotný
af17d89966 dri/nouveau: Clean up magic numbers in get_rt_format
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-19 19:04:50 +01:00
Jerome Glisse
fab804bdfe r600g: fix occlusion query on evergreen (avoid lockup)
Occlusion query on evergreen need the event index field to be
set otherwise we endup locking up the GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 11:53:01 -05:00
Ian Romanick
c05ccc1ebd ir_to_mesa: Generate smarter code for some conditional moves
Condiation moves with a condition of (a < 0), (a > 0), (a <= 0), or (a
>= 0) can be generated with "a" directly as an operand of the CMP
instruction.  This doesn't help much now, but it will help with
assembly shaders that use the CMP instruction.
2010-11-18 18:19:45 -08:00
Ian Romanick
ad87f2ddc7 glsl: Make is_zero and is_one virtual methods of ir_rvalue
This eliminates the need in some cames to validate that an rvalue is
an ir_constant before checking to see if it's 0 or 1.
2010-11-18 18:19:45 -08:00
Brian Paul
83e93b6008 mesa: pass gl_format to _mesa_init_teximage_fields()
This should prevent the field going unset in the future.  See bug
http://bugs.freedesktop.org/show_bug.cgi?id=31544 for background.

Also remove unneeded calls to clear_teximage_fields().

Finally, call _mesa_set_fetch_functions() from the
_mesa_init_teximage_fields() function so callers have one less
thing to worry about.
2010-11-18 16:15:38 -07:00
José Fonseca
3dcc3153b0 scons: Use inline wrap helpers more consistently. 2010-11-18 13:02:36 +00:00
Dave Airlie
185d862cd8 gallium/noop: report GL 2.1
this should at least make app use the same paths as they would for a real
driver.
2010-11-18 18:11:27 +10:00
Vinson Lee
855c66bde7 glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning.
ir.cpp: In static member function
'static unsigned int ir_expression::get_num_operands(ir_expression_operation)':
ir.cpp:199: warning: control reaches end of non-void function
2010-11-17 22:43:52 -08:00
Chia-I Wu
ca9f99d9c5 mesa: Clean up core.h.
Remove version.h and context.h from core.h.
2010-11-18 11:56:01 +08:00
Chia-I Wu
997a2547d1 st/glx: Replace MESA_VERSION_STRING by xmesa_get_name.
xmesa_get_name returns the name of the st_api, which is the same as
MESA_VERSION_STRING.
2010-11-18 11:56:01 +08:00
Chia-I Wu
db1689c236 st/wgl: Use st_context_iface::share for DrvShareLists. 2010-11-18 11:56:01 +08:00
Chia-I Wu
4f38dcd974 gallium: Add st_context_iface::share to st_api.
It will be used to implement wglShareLists.  Fill st_context_iface::copy
for glXCopyContext as well.
2010-11-18 11:56:00 +08:00
Chia-I Wu
28105471af gallium: Add st_api::name.
It is the name of the rendering API.  This field is informative.
2010-11-18 11:56:00 +08:00
Chia-I Wu
cc5c908d7d st/vega: Do not wait NULL fences. 2010-11-18 11:56:00 +08:00
Eric Anholt
50b4508319 i965: Eliminate dead code more aggressively.
If an instruction writes reg but nothing later uses it, then we don't
need to bother doing it.  Before, we were just killing code that was
never read after it was ever written.

This removes many interpolation instructions for attributes with only
a few comopnents used.  Improves nexuiz high-settings performance .46%
+/- .12% (n=3) on my Ironlake.
2010-11-18 11:16:14 +08:00
Brian Paul
48af60b465 mesa: upgrade to glext.h version 66
The type of the num/count parameter to glProgramParameters4[df]vNV()
changed so some API dispatch code needed updates too.
2010-11-17 20:04:45 -07:00
Alex Deucher
a23f25eba1 r600g: fix buffer alignment
This should fix the remaining buffer alignment issues in r600g.
2010-11-17 21:33:40 -05:00
Eric Anholt
da35388044 i965: Fail on loops on gen6 for now until we write the EU emit code for it. 2010-11-18 09:18:47 +08:00
Eric Anholt
3c8db58a17 i965: Add dumping of the sampler default color. 2010-11-18 09:18:47 +08:00
Eric Anholt
95addca019 i965: Add state dumping for sampler state. 2010-11-18 09:18:47 +08:00
Eric Anholt
03ff02d08b mesa: Don't spam the console in a debug build unless some spam is requested.
It's annoying to use test suites under a Mesa debug build because
pretty output is cluttered with stderr's continuous reports that
you're still using the debug driver.
2010-11-18 09:18:47 +08:00
Eric Anholt
d512cbf58f i965: Shut up spurious gcc warning about GLSL_TYPE enums. 2010-11-18 09:18:47 +08:00
Jakob Bornecrantz
e89e8a4347 gallium: Remove redundant sw and debug target helpers 2010-11-17 23:49:09 +00:00
Jakob Bornecrantz
b46340c740 graw: Use inline debug helper instead of non-inline version 2010-11-17 23:49:09 +00:00
Jakob Bornecrantz
c30656d8c2 libgl-xlib: Use inline debug helper instead of non-inline version 2010-11-17 23:49:08 +00:00
Chad Versace
7819435f2e glsl: Improve usage message for glsl_compiler
The new usage message lists possible command line options. (Newcomers to Mesa
currently have to trawl through the source to find the command line options,
and we should save them from that trouble.)

Example Output
--------------
usage: ./glsl_compiler [options] <file.vert | file.geom | file.frag>

Possible options are:
    --glsl-es
    --dump-ast
    --dump-hir
    --dump-lir
    --link
2010-11-17 15:44:41 -08:00
Kenneth Graunke
007f488150 glsl: Refactor get_num_operands.
This adds sentinel values to the ir_expression_operation enum type:
ir_last_unop, ir_last_binop, and ir_last_opcode.  They are set to the
previous one so they don't trigger "unhandled case in switch statement"
warnings, but should never be handled directly.

This allows us to remove the huge array of 1s and 2s in
ir_expression::get_num_operands().
2010-11-17 15:44:41 -08:00
Jerome Glisse
7ffd4e976f r600g: code cleanup (indent, trailing space, empty line ...)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-17 17:22:08 -05:00
Kenneth Graunke
9935fe705d glsl: Remove the ir_binop_cross opcode. 2010-11-17 13:59:17 -08:00
Kenneth Graunke
af1cba2260 Refresh autogenerated file builtin_function.cpp. 2010-11-17 13:37:16 -08:00
Kenneth Graunke
671ccf593e glsl: Reimplement the "cross" built-in without ir_binop_cross.
We are not aware of any GPU that actually implements the cross product
as a single instruction.  Hence, there's no need for it to be an opcode.
Future commits will remove it entirely.
2010-11-17 13:20:30 -08:00
Kenneth Graunke
302fe4049c Regenerate glcpp parser. 2010-11-17 12:53:07 -08:00
Kenneth Graunke
d719bf8fb4 glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
This is really supposed to be defined only if the driver supports highp
in the fragment shader - but all of our current ES2 implementations do.
So, just define it.  In the future, we'll need to add a flag to
gl_context and only define the macro if the flag is set.

"Fixes" freedesktop.org bug #31673.
2010-11-17 12:50:35 -08:00
Robert Hooker
778917069c egl_dri2: Add missing intel chip ids.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
2010-11-17 12:10:53 -08:00
Chad Versace
df883eb157 glsl: Fix Doxygen tag \file in recently renamed files 2010-11-17 12:07:24 -08:00
Chad Versace
b4cdba687c glsl: Fix erroneous cast in ast_jump_statement::hir()
Return values were erroneously cast from (ir_rvalue*) to (ir_expression*).

NOTE: This is a candidate for the 7.9 branch.
2010-11-17 11:59:32 -08:00
Kenneth Graunke
e16c9d5d03 glsl: Fix constant expression handling for <, >, <=, >= on vectors.
ir_binop_less, ir_binop_greater, ir_binop_lequal, and ir_binop_gequal
are defined to work on vectors as well as scalars, as long as the two
operands have the same type.

This is evident from both ir_validate.cpp and our use of these opcodes
in the GLSL lessThan, greaterThan, lessThanEqual, greaterThanEqual
built-in functions.

Found by code inspection.  Not known to fix any bugs.  Presumably, our
tests for the built-in comparison functions must pass because C.E.
handling is done on the ir_call of "greaterThan" rather than the inlined
opcode.  The C.E. handling of the built-in function calls is correct.

NOTE: This is a candidate for the 7.9 branch.
2010-11-17 11:58:56 -08:00
Marek Olšák
fb7ae06f59 r300g: print FS inputs uninitialized due to hardware limits to stderr 2010-11-17 19:01:12 +01:00
Alex Deucher
75e52556a8 r600c/evergreen: texture align is group_bytes just like 6xx/7xx
Default group bytes to 512 on evergreen.  Don't query
tiling config yet for evergreen, the current info returned is not
adequate for evergreen (no way to get bank info).
2010-11-17 11:30:52 -05:00
Brian Paul
1d39df42c4 mesa: minor clean-ups in context code 2010-11-16 20:12:34 -07:00
Brian Paul
85288ad722 mesa: reorder texture_error_check() params
To better match other functions.
2010-11-16 20:12:34 -07:00