Commit Graph

36440 Commits

Author SHA1 Message Date
Chia-I Wu a4a38dcf61 egl: Cleanup _EGLDisplay initialization.
Reorder/rename and document the fields that should be set by the driver during
initialization.  Drop the major/minor arguments from drv->API.Initialize.
2011-01-13 17:57:38 +08:00
Kenneth Graunke 47b2af2c62 glsl/s_expression: Read and ignore Scheme-style comments.
A single-semicolon until the end of the line, i.e.
; this is a comment.
2011-01-12 23:55:34 -08:00
Kenneth Graunke 5bfb68cd0f glsl/builtins: Remove unnecessary (constant bool (1)) from assignments.
This isn't strictly necessary, but is definitely nicer.
2011-01-12 23:55:34 -08:00
Kenneth Graunke bbafd2b849 ir_reader: Make assignment conditions optional.
You can now simply write (assign (xy) <lhs> <rhs>) instead of the
verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
2011-01-12 23:55:34 -08:00
Kenneth Graunke b74ff382a4 ir_reader: Convert to a class.
This makes it unnecessary to pass _mesa_glsl_parse_state around
everywhere, making at least the prototypes a lot easier to read.

It's also more C++-ish than a pile of static C functions.
2011-01-12 23:55:34 -08:00
Kenneth Graunke ec7e4f0ec5 ir_reader: Combine the three dereference reading functions into one.
These used to be more complicated, but now are so simple there's no real
point in keeping them separate.
2011-01-12 23:55:34 -08:00
Kenneth Graunke e486fca2d3 ir_reader: Relax requirement that function arguments be s_lists.
All of these functions used to take s_list pointers so they wouldn't all
need SX_AS_LIST conversions and error checking.  However, the new
pattern matcher conveniently does this for us in one centralized place.

So there's no need to insist on s_list.  Switching to s_expression saves
a bit of code and is somewhat cleaner.
2011-01-12 23:55:33 -08:00
Kenneth Graunke d798815272 ir_reader: Remove s_list::length() method.
Most code now relies on the pattern matcher rather than this function,
and for the only remaining case, not using this saves an iteration.
2011-01-12 23:55:33 -08:00
Kenneth Graunke daeb0c646e ir_reader: Add a pattern matching system and use it everywhere.
Previously, the IR reader was riddled with code that:
1. Checked for the right number of list elements (via a linked list walk)
2. Retrieved references to each component (via ->next->next pointers)
3. Downcasted as necessary to make sure that each sub-component was the
   right type (i.e. symbol, int, list).
4. Checking that the tag (i.e. "declare") was correct.

This was all very ad-hoc and a bit ugly.  Error checking had to be done
at both steps 1, 3, and 4.  Most code didn't even check the tag, relying
on the caller to do so.  Not all callers did.

The new pattern matching module performs the whole process in a single
straightforward function call, resulting in shorter, more readable code.

Unfortunately, MSVC does not support C99-style anonymous arrays, so the
pattern must be declared outside of the match call.
2011-01-12 23:55:33 -08:00
Dave Airlie 407184fe08 mesa/srgb: handle SARGB8 case in the sw fbo renderer. 2011-01-13 16:51:30 +10:00
Fredrik Höglund 71b889f904 st/mesa: fix a regression from cae2bb76
stObj->pt is null when a TFP texture is passed to st_finalize_texture,
and with the changes introduced in the above commit this resulted in a
new texture being created and the existing image being copied into it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-13 01:22:20 -05:00
Ben Skeggs bd2b72359e nvc0: disable calling of sw methods we don't implement
Left in the code as a marker of what NVIDIA do, just in case we need
to do this some day.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 15:26:31 +10:00
Dave Airlie 8c8e26d66a mesa/fbo: prevent assert trigger on i965 with piglit fbo-srgb test. 2011-01-13 15:17:34 +10:00
Ben Skeggs 0c1db2feb9 nvc0: fix mp_stack_bo relocation
Fixes a PT_NOT_PRESENT error cause by:
- allocating in VRAM
- emitting GART relocs to 0x17bc/0x17c0, moving the buffer
- telling the bufmgr that the buffer should be in VRAM when we use it,
  but not correcting the value sent to 0x17bc/0x17c0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 13:31:29 +10:00
Vinson Lee 31b1051663 mesa: Move loop variable declarations outside for loop in extensions.c.
Fixes MSVC build.
2011-01-12 17:43:28 -08:00
Brian Paul dd973cd9e8 mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:14:18 -07:00
Brian Paul 67722ae403 mesa: don't assert in GetIntegerIndexed, etc
We were getting an assertion upon invalid pname.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:13:18 -07:00
Brian Paul 2fa6012f6a mesa: fix num_draw_buffers==0 in fixed-function fragment program generation
This fixes a problem when glDrawBuffers(GL_NONE).  The fragment program
was writing to color output[0] but OutputsWritten was 0.  That led to a
failed assertion in the Mesa->TGSI translation code.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 17:55:45 -07:00
Brian Paul 30616fdacf st/mesa: add st_BeginQuery() case for GL_ANY_SAMPLES_PASSED
Fixes piglit occlusion_query2 failure.
2011-01-12 17:55:44 -07:00
Brian Paul 1b173fb3ba glsl: remove trailing comma to silence warning 2011-01-12 17:55:44 -07:00
Brian Paul 4d96af9337 noop: change var type to silence warning 2011-01-12 17:55:44 -07:00
Kenneth Graunke b076551e3b glsl/Makefile: Fix build with --as-needed. 2011-01-12 16:37:03 -08:00
Vinson Lee 356e2e962f mesa: Move declaration before code in extensions.c.
Fixes SCons build.
2011-01-12 16:23:11 -08:00
Chad Versace a7b5664c05 mesa: Change OES_point_sprite to depend on ARB_point_sprite
The extension string in GLES1 contexts always advertised
GL_OES_point_sprite. Now advertisement depends on ARB_point_sprite being
enabled.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace 039150169e mesa: Change dependencies of some OES extension strings
Change all OES extension strings that depend on ARB_framebuffer_object to
instead depend on EXT_framebuffer_object.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace 19418e921a mesa: Add/remove extensions in extension string
Add GL_OES_stencil8 to ES2.

Remove the following:
   GL_OES_compressed_paletted_texture : ES1
   GL_OES_depth32                     : ES1, ES2
   GL_OES_stencil1                    : ES1, ES2
   GL_OES_stencil4                    : ES1, ES2
Mesa advertised these extensions, but did not actually support them.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace 9b260c377f mesa: Refactor handling of extension strings
Place GL, GLES1, and GLES2 extensions in a unified extension table. This
allows one to enable, disable, and query the status of GLES1 and GLES2
extensions by name.

When tested on Intel Ironlake, this patch did not alter the extension
string [as given by glGetString(GL_EXTENSIONS)] for any API.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-01-12 15:45:03 -08:00
Ian Romanick bd33055ef4 glsl: Track variable usage, use that to enforce semantics
In particular, variables cannot be redeclared invariant after being
used.

Fixes piglit test invariant-05.vert and bugzilla #29164.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 14:30:31 -08:00
Eric Anholt c3f000b392 i965/fs: Do flat shading when appropriate.
We were trying to interpolate, which would end up doing unnecessary
math, and doing so on undefined values.   Fixes glsl-fs-flat-color.
2011-01-12 13:51:01 -08:00
Christian König 6881262eff r600g: also look at tex inst when for maximum gpu count 2011-01-12 20:41:15 +01:00
Vinson Lee a42906f862 generate_builtins.py: Add missing import.
Import sys for sys.exit.
2011-01-12 11:35:43 -08:00
Eric Anholt e1fb511570 meta: Actually use mipmapping when generating mipmaps.
With the change to not reset baselevel, this GL_LINEAR filtering was
resulting in generating mipmaps off of the base level instead of the
next higher detail level.  Fixes fbo-generatemipmap-filtering.

Reported by: Neil Roberts <neil@linux.intel.com>
2011-01-12 11:08:07 -08:00
Eric Anholt e880a57a71 i965: Clarify when we need to (re-)calculate live intervals.
The ad-hoc placement of recalculation somewhere between when they got
invalidated and when they were next needed was confusing.  This should
clarify what's going on here.
2011-01-12 11:08:07 -08:00
Christian König c60cb25bfb r600g: implement output modifiers and use them to further optimize LRP 2011-01-12 19:44:49 +01:00
Christian König 7728bef290 r600g: use special constants for 0, 1, -1, 1.0f, 0.5f etc 2011-01-12 19:40:52 +01:00
Christian König dffad730df r600g: optimize temp register handling for LRP 2011-01-12 19:36:55 +01:00
Christian König 8813842121 r600g: optimize away CF_INST_POP
If last instruction is an CF_INST_ALU we don't need to emit an
additional CF_INST_POP for stack clean up after an IF ELSE ENDIF.
2011-01-12 19:31:36 +01:00
Christian König 052b9e8fab r600g: make dumping of shaders an option 2011-01-12 19:17:49 +01:00
Christian König 95a2b265fa r600g: fix alu dumping 2011-01-12 19:17:49 +01:00
Christian König 47e7c6f571 r600g: improve r600_bc_dump 2011-01-12 19:17:49 +01:00
Eric Anholt 9351ef7a44 i965/vs: When MOVing to produce ABS, strip negate of the operand.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-vs-abs-neg.
2011-01-12 09:50:34 -08:00
Eric Anholt ab56e3be9a i965/fs: When producing ir_unop_abs of an operand, strip negate.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-fs-abs-neg.
2011-01-12 09:50:10 -08:00
José Fonseca 416ca90138 glsl: Make builtin_compiler build on Windows with MSVC. 2011-01-12 16:58:37 +00:00
José Fonseca 0035d1d902 glsl: Make builtin_compiler portable for non-unices. 2011-01-12 16:54:25 +00:00
José Fonseca f9bb5323eb getopt: Make code more portable. 2011-01-12 16:54:21 +00:00
José Fonseca 6d670f6c0f getopt: Import OpenBSD getopt implementation for MSVC. 2011-01-12 15:32:17 +00:00
José Fonseca 46662de68b scons: Update windows build for vgapi->openvg rename. 2011-01-12 15:13:57 +00:00
José Fonseca b07ad1d6bd scons: Fix build on systems without libOpenVG.so 2011-01-12 15:06:57 +00:00
Chia-I Wu 1e4f412242 egl: When EGL_DRIVER is set, do not add other drivers.
Setting EGL_DRIVER forces the driver to be loaded, as documented.  There
should be no fallbacks.
2011-01-12 18:10:15 +08:00
Chia-I Wu 4924cb9036 egl: libEGL depends on LOCAL_LIBS.
So that libEGL is rebuilt whenever LOCAL_LIBS changes.
2011-01-12 18:10:15 +08:00