Commit graph

33078 commits

Author SHA1 Message Date
Eric Anholt
fa2deb3ddc i965: Hack in avoidance of c++ reserved keyword in libdrm.
I'm also fixing this upstream in libdrm, but this avoids new libdrm
dependency for the moment.
2010-08-26 15:43:36 -07:00
Eric Anholt
363d0f6774 i965: Add GLSL IR-level source annotation and comments to new FS debug.
This should make debugging way easier, as now we have context for
reading large programs.
2010-08-26 14:55:44 -07:00
Eric Anholt
7268bd82f6 i965: Use the implied move in brw_math() in the new FS. 2010-08-26 14:55:44 -07:00
Eric Anholt
e85f8272d0 i965: Add support for in varyings to the new FS codegen.
At least some tests, like glsl-vs-sign, now work.
2010-08-26 14:55:44 -07:00
Eric Anholt
dcb7c0009b i965: Start building the codegen visitor.
This can successfully emit a real program that generates magenta now.
2010-08-26 14:55:44 -07:00
Eric Anholt
9763d0a82a i965: Start building direct GLSL2 IR to 965 assembly codegen.
Our channel-expressions and vector-splitting changes now happen into a
private copy of the IR that we maintain for ourselves.  Uniform
assignment still happens by the core, so we continue using Mesa IR
generation not just for swrast fallbacks but also for uniform values
(since there's no storage for their contents other than
shader_program->FragmentProgram->Parameters->ParameterValues).  And
most importantly, at the moment no actual codegen is hooked up other
than emitting our favorite color to the framebuffer.
2010-08-26 14:55:44 -07:00
Eric Anholt
c1dfdcb93a i965: Add new pass to split vectors into scalar variables
Combined with the previous pass, this lets other optimization passes
do their work thanks to ir_tree_grafting.  Still have regression in
instruction count with INTEL_NEW_FS, but register count is even
better.
2010-08-26 14:55:44 -07:00
Eric Anholt
3a8ad33dde i965: Add a pass for the FS to reduce vector expressions down to scalar.
This is a step towards implementing a GLSL IR backend for the 965
fragment shader.  Because it has downsides with the current codegen,
it is hidden under the environment variable INTEL_NEW_FS.

This results in an increase in instruction count at the moment (1444
-> 1752 for glsl-fs-raytrace, 345 -> 359 on my demo), because dot
products are turned into a series of multiplies and adds instead of a
custom expansion of MULs and MACs, and by not splitting the variable
types up we don't get tree grafting and thus there are extra moves of
temporary storage.  However, register count drops for the non-GLSL
path (64 -> 56 on my demo shader) because the register allocator sees
all the sub-operations.
2010-08-26 14:55:43 -07:00
Eric Anholt
a1bebf73df i965: Start building 965 FS backend. 2010-08-26 14:55:43 -07:00
Brian Paul
4418a493c2 llvmpipe: fix PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS query
Fixes crashes in glean glsl1 and demos/src/glsl/vert-tex.
See comments for details.
2010-08-26 15:54:51 -06:00
José Fonseca
98ccee9ea6 graw: Add copyright headers to the interfaces. 2010-08-26 22:32:47 +01:00
Eric Anholt
264ba1ab88 ir_to_mesa: Don't assume that an ir_dereference_array is of a variable.
Fixes:
glsl-array-bounds-02 (software)
glsl-array-bounds-04
glsl-array-bounds-06 (software)
glsl-array-bounds-08
2010-08-26 11:23:09 -07:00
Eric Anholt
2db7bb9c66 glsl: Add a quick hack to constant folding to reduce duplicated work.
Reduces runtime of glsl-max-varyings 92% on my system.
2010-08-26 10:53:20 -07:00
Vinson Lee
9b4384c322 st/mesa: Remove unnecessary header. 2010-08-26 10:38:28 -07:00
José Fonseca
64b5a81e19 scons: Fix inverted logic. 2010-08-26 18:29:04 +01:00
José Fonseca
58087b8d27 scons: Add glsl_symbol_table.cpp 2010-08-26 18:19:57 +01:00
Eric Anholt
9629dbf4f2 i965: Add support for destination RelAddr writes in the VS.
Fixes: glsl-vs-varying-array
2010-08-26 09:53:01 -07:00
Eric Anholt
b72c85df55 i965: Fix the test for variable indexing of shader inputs.
Shader inputs appear in source registers, not dst registers.  Catches
unsupported shaders in glsl-fs-varying-array and Humus
RaytracedShadows.
2010-08-26 09:53:01 -07:00
Ian Romanick
de3b40d8cd glsl2: Remove a couple FINISHME comments that have already been resolved 2010-08-26 09:24:58 -07:00
Kenneth Graunke
a044285e25 glsl: Move built-ins to live beyond the global scope.
Per the GLSL 1.20 specification (presumably a clarification of 1.10).

Also, when creating user functions, make a new ir_function that shadows the
built-in ir_function, rather than adding new signatures.  User functions
are supposed to hide built-ins, not overload them.

Fixes piglit tests redeclaration-{04, 12, 14}.vert.
2010-08-26 09:19:48 -07:00
Kenneth Graunke
b6f15869b3 glsl: Move is_built_in flag from ir_function_signature to ir_function.
Also rename it to "is_builtin" for consistency.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-26 09:19:48 -07:00
Kenneth Graunke
5d25746640 glsl: Refactor variable declaration handling.
Moving the check for an earlier variable declaration helps cleanly
separate out the re-declaration vs. new declaration code a bit.  With
that in place, conflicts between variable names and structure types or
function names aren't caught by the earlier "redeclaration" error
message, so check the return type on glsl_symbol_table::add_variable
and issue an error there.  If one occurs, don't emit the initializer.

Fixes redeclaration-01.vert and redeclaration-09.vert.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-26 09:19:48 -07:00
Kenneth Graunke
ac2376e6f5 glsl: Don't add overloads to existing structure constructors.
Instead, make a new ir_function and try to add it to the symbol table.

Fixes piglit test redeclaration-08.vert.
2010-08-26 09:19:48 -07:00
Kenneth Graunke
e09591317b glsl: Remove name_declared_this_scope check when adding functions.
Instead, rely on the symbol table's rules.

Fixes redeclaration-02.vert.
2010-08-26 09:19:48 -07:00
Kenneth Graunke
e9c7ceed27 glsl: Use a single shared namespace in the symbol table.
As of 1.20, variable names, function names, and structure type names all
share a single namespace, and should conflict with one another in the
same scope, or hide each other in nested scopes.

However, in 1.10, variables and functions can share the same name in the
same scope.  Structure types, however, conflict with/hide both.

Fixes piglit tests redeclaration-06.vert, redeclaration-11.vert,
redeclaration-19.vert, and struct-05.vert.
2010-08-26 09:19:48 -07:00
Brian Paul
86ddb356e8 st/mesa: add missing packed depth/stencil formats in st_format_datatype()
Fixes llvmpipe regression from one of the prev commits.
2010-08-26 09:20:21 -06:00
Brian Paul
7b07674667 mesa: fix mixed-up function call name 2010-08-26 08:59:54 -06:00
Nick Bowler
e71a9042cb mesa: Identify packed depth/stencil buffers using the Format field.
Intel sometimes uses packed depth/stencil buffers even when only a depth
buffer or only a stencil buffer was requested.  Common code currently
uses the _BaseFormat field to determine whether a depth/stencil wrapper
is necessary.  But unless the user explicitly requested a packed
depth/stencil buffer, the _BaseFormat field does not encode this
information, and the required wrappers are not created.

The problem was introduced by commit 45e76d2665 ("mesa: remove a
bunch of gl_renderbuffer fields"), which killed off the _ActualFormat
field upon which the decision to create a wrapper used to be made.  This
patch changes the logic to use the Format field instead, which is more
like the old code.

Fixes fdo bug 27590.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-26 08:42:24 -06:00
Nick Bowler
bda941e1b8 intel: Merge identical cases in switch statement.
Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-26 08:19:35 -06:00
Andre Maasikas
0599509fc4 r600: fix vertex buffer size calculation
when we dont know max_index we cannot calculate vb size from count
anymore - just use the bo size.
Also added an assert to remind that we dont handle GL_INT GL_DOUBLE
upload when we dont' know max_index - will fix later
2010-08-26 16:55:21 +03:00
José Fonseca
90437330e2 graw: Undo late loading of graw drivers.
Keith prefers a clean separation between graw applications and
implementations, where apps do not link libgallium.a but instead
get all functionality they need via graw interface.

Although this is not incompatible with late loading of graw drivers, it
it would make it very hard to maintain, as wrappers for every utility
symbol exposed in graw would have to be written or generated somehow.
2010-08-26 11:37:42 +01:00
Chia-I Wu
0f74efdef0 st/mesa: Fix glEGLImageTargetTexture2DOES.
stObj->pt should be set in st_bind_surface, just as in st_TexImage.  On
the other hand, st_TexImage should unreference stObj->pt.  It also needs
to initialize the texture image again as _mesa_clear_texture_object
clears the image.
2010-08-26 16:40:01 +08:00
Chia-I Wu
4f6faf65d1 st/egl: Add support for EGL_MESA_image_drm. 2010-08-26 16:40:01 +08:00
Chia-I Wu
9b6a63a0e2 st/egl: Add support for EGL_KHR_surfaceless_*. 2010-08-26 16:40:01 +08:00
Chia-I Wu
41c095bf31 st/mesa: Add support for surfaceless current contexts.
A surfaceless current context is a context that is made current without
draw and read framebuffers.  Such contexts can only render to FBOs.
2010-08-26 16:40:01 +08:00
Chia-I Wu
c5279fd795 st/egl: Make KMS support optional in KMS backend.
It should be called DRM backend now.
2010-08-26 16:40:01 +08:00
Vinson Lee
038068909f r300g: Include missing header in r300_texture_desc.h.
Include p_format.h for enum pipe_format symbol.

Fixes r300g build.
2010-08-26 01:38:23 -07:00
Vinson Lee
121b6d68c2 gallium: Clean up header file inclusion in p_defines.h.
Remove p_format.h.
Include p_compiler.h for boolean and uint64_t symbols.
2010-08-26 01:30:50 -07:00
Vinson Lee
81ac08f89d gallium: Clean up header file inclusion in p_context.h.
Remove p_state.h.
Include p_compiler.h for boolean symbol.
Add needed forward declarations after removing p_state.h.
2010-08-26 01:21:10 -07:00
Vinson Lee
2badf0f642 graw: Include missing header in graw_dl.h.
Include p_state.h for pipe_shader_state symbol.
2010-08-26 01:14:28 -07:00
Vinson Lee
57ce0de8cb util: Include missing header in u_simple_shaders.c.
Include p_state.h for PIPE_MAX_COLOR_BUFS symbol.
2010-08-26 01:08:30 -07:00
Vinson Lee
f099e73b7b tgsi: Include missing header in tgsi_sse2.h.
Include p_compiler.h for boolean symbol.
Clean up forward declarations.
2010-08-26 00:34:30 -07:00
Vinson Lee
b47af6ad6d rtasm: Include missing header in rtasm_x86sse.h.
Include p_compiler.h for stdint.h uint*_t symbols.
2010-08-26 00:29:58 -07:00
Vinson Lee
7822f99193 pipebuffer: Clean up header file inclusion in pb_bufmgr.h.
Remove p_compiler.h and p_defines.h.
Include pb_buffer.h for pb_size symbol.
2010-08-26 00:22:19 -07:00
Eric Anholt
9fd2a8d692 glsl2: Move ir_expression_flattening to using the rvalue visitor class.
The previous implementation was missing handling of some rvalues, such
as "if" conditions, leading to glsl-mat-int-from-ctor-* not getting
caught.
2010-08-26 00:15:18 -07:00
Eric Anholt
c735d85395 glsl: Don't consider things with a type containing a sampler as an lvalue.
We had ad-hoc handled some common cases by flagging sampler-typed
variables as read_only, and rejected initializers of samplers.
However, people could sneak them in in all sorts of surprising ways,
like using whole-array or structure assignment.

Fixes:
glslparsertest/glsl2/sampler-01.frag
glslparsertest/glsl2/sampler-03.frag
glslparsertest/glsl2/sampler-04.frag
glslparsertest/glsl2/sampler-06.frag

Bug #27403.
2010-08-25 23:43:21 -07:00
Eric Anholt
aa2f55883b mesa: Disable the debug spam for x86 CPU detection with a compile-time flag.
I don't know of any problems with CPU detection in years.  Don't spam
the user that was just looking to enable assertions with this stuff.
2010-08-25 23:43:21 -07:00
Eric Anholt
7af8f7f164 mesa: Move the x86 detection debug messages next to the detection. 2010-08-25 23:43:21 -07:00
Eric Anholt
0673b46933 mesa: Don't warn when the desired result of s3tc lib available occurs. 2010-08-25 23:43:21 -07:00
Vinson Lee
d8ad10dc45 util: Include missing header in u_blit.h.
Include p_compiler.h for uint symbol.
Clean up forward declarations.
2010-08-25 23:37:27 -07:00