Compare commits

...

2753 Commits

Author SHA1 Message Date
Jeremy Huddleston
a96360a951 apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5c44c1348e)
2011-10-24 16:26:46 -07:00
Jeremy Huddleston
c8f2665f02 apple: Silence some debug spew
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 098ecfad83)
2011-10-24 15:54:31 -07:00
Dave Airlie
1e279de4b0 r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ecc051d65b, see
https://bugs.freedesktop.org/show_bug.cgi?id=40979)
2011-10-03 17:00:35 +02:00
Jeremy Huddleston
7c3cf50d99 Fix PPC detection on darwin
Fixes regression introduced by 7004582c18

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e737a99a6f)
2011-07-31 09:49:02 -07:00
Paul Berry
7b8e7f4450 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.

Some changes were made in glsl_parser_extras.h during cherry pick to
7.10 because 7.11 and master support many extensions that 7.10 does
not.  The unsupported extensions were removed.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-20 13:36:46 -07:00
Paul Berry
db3d21d676 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.

Some changes were made in glsl_parser_extras.h during cherry pick to
7.10 because 7.11 and master support many extensions that 7.10 does
not.  The unsupported extensions were removed.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9c4445de6e)
2011-07-20 13:36:46 -07:00
Paul Berry
0a838d1d32 glsl: Ensure that sampler declarations are always uniform or "in" parameters.
This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f07221056e)
2011-07-20 13:36:46 -07:00
Paul Berry
94a1fe1fd8 glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
(cherry picked from commit ddc1c96390)
2011-07-20 13:36:46 -07:00
Ian Romanick
f2ef6036e8 linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
(cherry picked from commit 66f4ac988d)
2011-07-20 13:36:45 -07:00
Henri Verbeet
f81058140f glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

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

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
(cherry picked from commit 0f20e2e18f)
2011-07-19 23:34:55 +02:00
Marek Olšák
3871c55a18 swrast: fix depth/stencil blits when there's no colorbuffer
NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit d1214cca08)
2011-07-11 22:59:48 +02:00
Marek Olšák
7a75fcd657 mesa: return early if mask is cleared to zero in BlitFramebuffer
From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.
(cherry picked from commit 83478e5d59)
2011-07-11 22:59:38 +02:00
Marek Olšák
e041956cb2 st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 292148dc4b)
2011-07-08 13:24:25 +02:00
Ian Romanick
c286f7870f linker: Assign locations for fragment shader output
Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test.  The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs.  As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts.  The problem is
dealing with generic outputs that lack a layout qualifier.  There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
(cherry picked from commit d32d4f780f)
2011-07-07 14:06:01 -07:00
Paul Berry
4e2a5d013d 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
(cherry picked from commit b078aad8ab)
2011-07-07 14:06:00 -07:00
Ian Romanick
cd73c06eed glsl: Don't choke when printing an anonymous function parameter
This is based on commit 174cef7fee, but
the code is heavily changed.  The original commit modifies
ir_print_visitor::unique_name, but there is no such method in 7.10.
Instead, this code just modifies ir_print_visitor::visit(ir_variable
*ir) to "do the right thing" when ir_variable::name is NULL.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
2011-07-06 17:24:54 -07:00
Ian Romanick
7424f9c1fe ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dbda466fc0)
2011-07-06 17:17:34 -07:00
Ian Romanick
cb6dd6c399 glsl: Track initial mask in constant propagation live set
The set of values initially available (before any kills) must be
tracked with each constant in the set.  Otherwise the wrong component
can be selected after earlier components have been killed.

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Matthias Bentrup <matthias.bentrup@googlemail.com>
(cherry picked from commit 0eb9797958)
2011-07-06 17:17:25 -07:00
Ian Romanick
85b965b462 linker: Reject shaders that use too many varyings
Previously it was up to the driver or later code generator to reject
these shaders.  It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit de77324d8f)
2011-06-27 16:39:43 -07:00
Marek Olšák
459012b148 r600g: bump shader input limits
(cherry picked from commit 1e5cef96d1)
2011-06-27 16:39:43 -07:00
Ben Skeggs
bd40e7cebd nouveau: fix includes for latest libdrm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit 5c102dd94f)
2011-06-26 18:09:23 +02:00
Marek Olšák
9370ddde85 r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit bc517d64da)

Conflicts:

	src/gallium/drivers/r300/r300_texture.c
2011-06-25 20:01:23 +02:00
Marek Olšák
26ab29cf79 mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 12c105b5de)
2011-06-24 23:18:54 +02:00
Marek Olšák
a312052add mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit e41a91cea7)
2011-06-24 23:17:34 +02:00
Brian Paul
6128739b75 st/wgl: return height, not width for WGL_PBUFFER_HEIGHT_ARB
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38599
(cherry picked from commit 8a5a28b731)
2011-06-23 06:56:46 -06:00
Alex Deucher
bc46f0c969 r600c: add missing bank tiling case for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 16:51:58 -04:00
Marek Olšák
1ad06c7a25 r300g: fix handling PREP_* options
This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 7df7eaf845)

Conflicts:

	src/gallium/drivers/r300/r300_render.c
2011-06-18 22:59:28 +02:00
Alex Deucher
bdc518e341 r600c: add tiling support for evergreen+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-14 18:47:11 -04:00
Jeremy Huddleston
338e8e5f14 apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e903cc17bb)
(cherry picked from commit 5078cb6858)
2011-06-13 23:23:09 -07:00
Jeremy Huddleston
5255e844af apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit c6cf82fb55)
2011-06-13 21:41:26 -07:00
Brian Paul
45f369c74d docs: fix 'release release' typos 2011-06-13 18:29:44 -06:00
Ian Romanick
39ad7dc7b1 docs: Add 7.10.3 md5sums 2011-06-13 16:53:24 -07:00
Ian Romanick
2d0fd07037 docs: Add change log to 7.10.3 release notes 2011-06-13 16:22:29 -07:00
Ian Romanick
edbaa9e856 docs: Add list of bugs fixed in 7.10.3 release 2011-06-13 16:22:29 -07:00
Ian Romanick
a40eed0a10 mesa: Regenerate parser files from previous two commits 2011-06-13 16:22:17 -07:00
Eric Anholt
2b7ee98588 mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fb6e39737a)
2011-06-13 15:36:02 -07:00
Eric Anholt
ff07695e19 mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 28cec9e832)
2011-06-13 15:35:55 -07:00
José Fonseca
fc23cc06af wgl: Don't hold on to user supplied HDC.
Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).
2011-06-12 09:16:00 +01:00
José Fonseca
195e15559e st/wgl: Remove buggy assertion.
The assertion is wrong, now that state tracker can cope with a window with
zero width or height.
2011-06-12 09:15:58 +01:00
José Fonseca
22bf0ec991 st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.

This change overrides the windows maximum size, allow to create windows
arbitrarily large.
2011-06-12 09:15:52 +01:00
José Fonseca
3f3d199121 st/wgl: Cope with zero width/height windows.
While ensuring the framebuffer area is never zero.
2011-06-12 09:15:49 +01:00
José Fonseca
ac28843c1a st/wgl: Prevent spurious framebuffer sizes when the window is minimized.
When the window is minimized GetClientRect will return zeros.

Instead of creating a 1x1 framebuffer, simply preserve the current window
size, until the window is restored or maximized again.
2011-06-12 09:15:45 +01:00
José Fonseca
c78ac563f1 st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size(). 2011-06-12 09:15:42 +01:00
José Fonseca
b6c601a5e8 st/wgl: Adjust the pbuffer invisible window size.
Thanks to Brian Paul for diagnosing the issue.
2011-06-12 09:15:35 +01:00
José Fonseca
27f6db0f38 gallivm: Fix for dynamically linked LLVM 2.8 library.
This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.
2011-06-12 09:13:24 +01:00
José Fonseca
c1da25aede gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
Fixes fdo 36738.
2011-06-12 09:13:24 +01:00
Jeremy Huddleston
05d9a4ab1c osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
(cherry picked from commit 0e8d045bf8)
2011-06-11 22:16:43 -07:00
Marek Olšák
b0625f8486 mesa: return after invalidating renderbuffer
(cherry picked from commit a674ef7814)
2011-06-12 05:58:28 +02:00
Marek Olšák
b10abac70e mesa: invalidate framebuffer if internal format of renderbuffer is changed
RenderTexture doesn't have to be called in invalidate_rb, I guess.
(cherry picked from commit df818d572e)
2011-06-12 05:57:26 +02:00
Marek Olšák
7d30582c91 mesa: fix up assertion in _mesa_source_buffer_exists
This was probably missed when implementing luminance and luminance alpha
render targets.

_mesa_get_format_bits checks for both GL_*_BITS and GL_TEXTURE_*_SIZE.

This fixes:
main/framebuffer.c:892: _mesa_source_buffer_exists: Assertion `....' failed.
(cherry picked from commit c0110d5450)
2011-06-12 05:56:18 +02:00
Dave Airlie
08c47e4851 st/mesa: fix compressed mipmap generation.
If the underlying transfer had a stride wider for hw alignment reasons,
the mipmap generation would generate badly strided images.

this fixes a few problems I found while testing r600g with s3tc

Signed-off-by: Dave Airlie <airlied@redhat.com>

(cherry picked from commit fdb4373a20 by Marek)
This fixes the DXT1 tests from fbo-generatemipmap-formats on some drivers.
2011-06-12 05:45:07 +02:00
Ian Romanick
39865f5c46 mesa: Ignore blits to/from missing buffers
The EXT_framebuffer_object spec (and later specs) say:

     "If a buffer is specified in <mask> and does not exist in both
     the read and draw framebuffers, the corresponding bit is silently
     ignored."

Check for color, depth, and stencil that the source and destination
FBOs have the specified buffers.  If the buffer is missing, remove the
bit from the blit request mask and continue.

Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and
fixes 'fbo-missing-attachment-blit es2 from'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
(cherry picked from commit bb4758669c by Marek)
2011-06-12 05:29:18 +02:00
Ian Romanick
6586475f37 mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the
framebuffer can be complete with some attachments be missing.  In this
case the _ColorDrawBuffers pointer will be NULL.

Fixes the crash in piglit test fbo-missing-attachment-clear.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 7f9c17aaa8 by Marek)
2011-06-12 05:29:14 +02:00
Marek Olšák
b9f2eefd1d st/mesa: remove asserts in st_texture_image_copy
This is for 7.10 only. The fix in master looks too complex to be
cherry-picked.

The assertions fail when generating mipmaps for NPOT textures.

This fixes:
- fbo-generatemipmap-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-11 22:34:01 +02:00
Brian Paul
48a3b03409 mesa: bump version to 7.10.3 2011-06-10 15:25:38 -06:00
Brian Paul
29164dcac8 docs: 7.10.3 release notes skeleton file, links 2011-06-10 15:25:38 -06:00
Brian Paul
f2901d3f98 mesa: add include/c99/*.h files to tarballs
See https://bugs.freedesktop.org/show_bug.cgi?id=36238

NOTE: This is a candidate for the 7.10 branch.
2011-06-10 15:25:38 -06:00
Brian Paul
3b89e1c0e6 st/mesa: fix software accum buffer format bug 2011-06-10 15:25:38 -06:00
Brian Paul
8a78e6cf80 vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()
See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 62811057f4)
2011-06-10 13:09:41 -06:00
Brian Paul
788dda53cf vbo: check array indexes to prevent negative indexing
See the piglit dlist-fdo31590.c test

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit f1cdce95f6)
2011-06-10 13:09:41 -06:00
Brian Paul
cc5d54e797 draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)
Previously, we were errantly drawing some interior edges of clipped
polygons and quads.  Also, we were introducing extra edges where
polygons intersected the view frustum clip planes.

The main problem was that we were ignoring the edgeflags encoded in
the primitive header's 'flags' field which are set during polygon/quad
->tri decomposition.  We need to observe those during clipping.  Since
we can't modify the existing vert's edgeflag fields, we need to store
them in a parallel array.

Edge flags also need to be handled differently for view frustum planes
vs. user-defined clip planes.  In the former case we don't want to draw
new clip edges but in the later case we do.  This matches NVIDIA's
behaviour and it just looks right.

Finally, note that the LLVM draw code does not properly set vertex
edge flags.  It's OK on the regular software path though.
(cherry picked from commit f6572017b9)
2011-06-10 13:09:40 -06:00
Brian Paul
59b147c6a3 st/mesa: fix incorrect texture level/face/slice accesses
If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit bf14ab417c)

Conflicts:

	src/mesa/state_tracker/st_cb_drawpixels.c
2011-06-10 13:07:03 -06:00
Brian Paul
5ec931eb7d mesa: check that flex/bison are installed
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit de1df26b5c)
2011-06-10 13:07:03 -06:00
Brian Paul
9c7e1b054d mesa: add some missing GLAPIENTRY keywords
NOTE: this is a candidate for the 7.10 branch.
(cherry picked from commit 3559440873)
2011-06-10 13:07:03 -06:00
Marek Olšák
3d5e6c4c1e r300g: clear can be killed by render condition
Fixes piglit:
- NV_conditional_render/clear
(cherry picked from commit 76056510bc)

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2011-06-10 19:45:45 +02:00
Marek Olšák
bbebbdd3e7 r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array
(cherry picked from commit f76787b3ea)

Conflicts:

	src/gallium/drivers/r300/r300_state.c

Squashed with cherry-picked b1246cf13b.
2011-06-10 19:45:45 +02:00
Marek Olšák
e5408efb20 r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture
isn't 3D, r300 always samples the border color regardless of texture
coordinates.

I HATE THIS HARDWARE.

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit da8b4c0798)

Conflicts:

	src/gallium/drivers/r300/r300_state_derived.c
2011-06-09 04:23:14 +02:00
Marek Olšák
8f8d7d0803 r300g: fix draw_vbo splitting on r3xx-r4xx
NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 578d4539ba)

Conflicts:

	src/gallium/drivers/r300/r300_render.c
2011-06-09 01:38:24 +02:00
Jeremy Huddleston
addc396d18 darwin: Fix VG_LIB_GLOB to also match the unversioned symlink
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 6ea70600b9)
2011-06-07 13:28:19 -04:00
Jeremy Huddleston
8ea26afd8b darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit cebdffaa2a)
2011-06-07 13:28:14 -04:00
Jeremy Huddleston
ca9ab0a6a1 darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22c320aa2c)
2011-06-06 19:57:00 -04:00
Jeremy Huddleston
1a79cde8fa apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e5d241ddb2)
2011-06-06 12:48:54 -04:00
Jeremy Huddleston
4d934efa19 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d563009cd1)
2011-06-06 12:00:16 -04:00
Jeremy Huddleston
aba30d8fbe apple: Fix build failures in applegl_glx.c
See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

This commit squashes three cherry-picks:
(cherry picked from commit 5d35343d12)
(cherry picked from commit 7c5f37c032)
(cherry picked from commit 2ee5272e16)
2011-06-06 12:00:16 -04:00
Jeremy Huddleston
4e18ad9d71 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1885cf27c9)
2011-06-06 12:00:16 -04:00
Jeremy Huddleston
12537b0baf glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 3843bbcb4c)
2011-06-06 12:00:16 -04:00
Jeremy Huddleston
891ce8aaa8 apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8593bb32ea)
2011-06-06 12:00:15 -04:00
Jeremy Huddleston
0f11d05e81 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7cdf969527)
2011-06-06 11:51:46 -04:00
Jeremy Huddleston
1605525111 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 279e471750)
2011-06-06 11:51:37 -04:00
Jeremy Huddleston
d92931467d apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit b7f0ed8444)
2011-06-06 11:51:28 -04:00
Jeremy Huddleston
ee004cc681 apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 488d6c739f)
2011-06-06 11:51:22 -04:00
Jeremy Huddleston
60291c0798 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22613d1670)
2011-06-06 11:51:12 -04:00
Jeremy Huddleston
56930eccb2 apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit bb621cb61e)
2011-06-06 11:51:06 -04:00
Jeremy Huddleston
6ad7721500 apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4c9bab78a1)
2011-06-06 11:50:58 -04:00
Jeremy Huddleston
5e1199ff12 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8e89d0bea7)
2011-06-06 11:50:46 -04:00
Brian Paul
a10cba3a7f mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
(cherry picked from commit 7ca38f5d97)
2011-06-01 08:33:09 -06:00
Marek Olšák
f8b4ca7e47 mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit b9e9df78a0)
2011-06-01 16:10:56 +02:00
Marek Olšák
9e1f40c182 mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d69dc2e203)
2011-06-01 16:10:49 +02:00
Eric Anholt
4d08ca20ba Revert "intel: Add spans code for the ARB_texture_rg support."
This reverts what remains of commit
28bab24e16.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit bc57df0356)
2011-05-31 17:45:42 -07:00
Eric Anholt
fd9a093086 intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 73f0700481)
2011-05-31 17:45:42 -07:00
Eric Anholt
c7e0c21d42 swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2b624634dd)
2011-05-31 17:45:42 -07:00
Eric Anholt
dc8599cdf1 mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f0471d904c)
2011-05-31 17:45:42 -07:00
Eric Anholt
25134f877b mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a52803e108)
2011-05-31 17:45:42 -07:00
Eric Anholt
27fb522faa mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
This is a squash of the following two commits:

    mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*

    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 6ab9889a27)

    mesa: Fix return type of  _mesa_get_format_bytes() (#37351)

    Despite that negative values aren't sensible here, making this unsigned
    is dangerous.  Consider get_pointer_generic, which computes a value of
    the form:

        void *base + (int x * int stride + int y) * unsigned bpp

    The usual arithmetic conversions will coerce the (x*stride + y)
    subexpression to unsigned.  Since stride can be negative, this is
    disastrous.

    Fixes at least the following piglit tests on Ironlake:

        fbo/fbo-blit-d24s8
        spec/ARB_depth_texture/fbo-clear-formats
        spec/EXT_packed_depth_stencil/fbo-clear-formats

    NOTE: This is a candidate for the 7.10 branch.

    Reviewed-by: Chad Versace <chad.versace@intel.com>
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit e8b1c6d6f5)
2011-05-31 17:45:41 -07:00
Eric Anholt
3436f5d82f intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 0778fdb002)
2011-05-31 17:45:41 -07:00
Eric Anholt
77be3db45c mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9f164823c7)
2011-05-31 17:45:41 -07:00
Eric Anholt
1d58f70e56 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 155200c154)
2011-05-31 17:45:41 -07:00
Eric Anholt
bb8336f82c swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 641dd899bd)
2011-05-31 17:45:41 -07:00
Eric Anholt
d264ed0b48 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cd3568c329)
2011-05-31 17:45:41 -07:00
Eric Anholt
e78908d152 glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 756c262756)
2011-05-31 17:45:41 -07:00
Eric Anholt
1d779672fa glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
(cherry picked from commit 175829f1a8)
2011-05-31 17:45:41 -07:00
Eric Anholt
0ab66b7d0b glsl: Semantically check the RHS of `||' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9e04b190b5)
2011-05-31 17:45:41 -07:00
Eric Anholt
b47825e626 glsl: Semantically check the RHS of `&&' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7ec0c97896)
2011-05-31 17:45:41 -07:00
Eric Anholt
7609af4228 glsl: Avoid cascading errors when looking for a scalar boolean and failing.
By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 01822706ec)
2011-05-31 17:45:41 -07:00
Kenneth Graunke
ef96b6148b i965: Never enable the GS on Gen6.
Prior to Gen6, we use the GS for breaking down quads, quad-strips,
and line loops.  On Gen6, earlier stages already take care of this,
so we never need the GS.

Since this code is likely completely untested, remove it for now.
We can write new code when enabling real geometry shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 35b3f597bd)
2011-05-31 17:45:41 -07:00
Kenneth Graunke
4d9becfb1f i965: Rename various gen6 #defines to match the documentation.
This should make it easier to cross-reference the code and hardware
documentation, as well as clear up any confusion on whether constants
like CMD_3D_WM_STATE mean WM_STATE (pre-gen6) or 3DSTATE_WM (gen6+).

This does not rename any pre-gen6 defines.
(cherry picked from commit e31defc825)
2011-05-31 17:45:40 -07:00
Hans de Goede
157f4a9d28 texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616
According to https://bugs.freedesktop.org/show_bug.cgi?id=34280
commit 5d1387b2da causes the font corruption
problems people have been seeing under various apps and gnome-shell on r200
cards.

This commit changed (loosened) the check for using the memcpy path in the
former al88 / al1616 texstore functions, which are now also used to
store rg texures. This patch restores the old strict check in case of
al textures. I've no idea why this fixes things, since I don't know the
code in question at all. But after seeing the bisect in bfdo34280 point
to this commit, I gave this fix a try and it fixes the font issues seen on
r200 cards.

[airlied:
r200 has no native working A8, so it does an internal storage format of AL88
however srcFormat == internalFormat == ALPHA when we get to this point,
so it copies, but it wants to store into an AL88 not ALPHA so fails,
I'll also push a piglit test for this on r200].

Many thanks to Nicolas Kaiser who did all the hard work of tracking this down!

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e338a1b0ce)
2011-05-31 17:45:40 -07:00
Ian Romanick
5f8729859e i965: Remove hint_gs_always and resulting dead code
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a7fa203f0d)
2011-05-31 17:45:40 -07:00
Henri Verbeet
db17691e28 glx: Only remove the glx_display from the list after it's destroyed.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
(cherry picked from commit a26121f375)
2011-05-31 17:45:40 -07:00
Henri Verbeet
43ad25baa7 glx: Destroy dri2Hash on DRI2 display destruction.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
(cherry picked from commit a75de67c51)
2011-05-31 17:45:40 -07:00
Henri Verbeet
9e5da5894d mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.
NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
(cherry picked from commit 158d42c8b0)
2011-05-31 17:45:40 -07:00
Marek Olšák
10bf7aeeeb mesa: forbid UseProgram to be called inside Begin/End
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 29ceeeba20)
2011-06-01 01:44:41 +02:00
Marek Olšák
e6c031c440 st/mesa: conditional rendering should not kill texture decompression via blit
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8d45bbc422)
2011-06-01 01:43:28 +02:00
Marek Olšák
6850899f44 st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 91e56c8897)
2011-06-01 01:42:43 +02:00
Marek Olšák
c6b6688f88 st/mesa: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ccfeb90b75)
2011-06-01 01:42:34 +02:00
Marek Olšák
831c7b1768 swrast: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c0277d9539)
2011-06-01 01:42:25 +02:00
Marek Olšák
06b04a2a64 st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 1c95c3ef9c)

Conflicts:

	src/mesa/state_tracker/st_context.h
2011-06-01 01:41:54 +02:00
Marek Olšák
23d9baa5a1 st/mesa: fix changing internal format via RenderbufferStorage
The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e57
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e57 is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 49d4e803d3)

Conflicts:

	src/mesa/state_tracker/st_cb_fbo.c
2011-06-01 01:39:36 +02:00
pepp
1b8df41f75 st/mesa: assign renderbuffer's format field when allocating storage
See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fd6f2d6e57)
2011-06-01 01:27:57 +02:00
Marek Olšák
224ed851ed tgsi/ureg: bump the limit of immediates
Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ff038170ff)
2011-06-01 01:26:31 +02:00
Kenneth Graunke
b531e75cc5 glsl: Regenerate autogenerated file builtin_function.cpp.
For changes way back in ab58b21634.

Should fix fd.o bug #35603.
2011-05-31 12:02:53 -07:00
Brian Paul
eaadbacb5c mesa: s/height/depth/ in texsubimage()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37648

(cherry picked from commit 4609e80288)
2011-05-26 19:26:36 -06:00
Kenneth Graunke
9286d0ddd3 glsl: Fix memory error when creating the supported version string.
Passing ralloc_vasprintf_append a 0-byte allocation doesn't work.  If
passed a non-NULL argument, ralloc calls strlen to find the end of the
string.  Since there's no terminating '\0', it runs off the end.

Fixes a crash introduced in 14880a510a.

(cherry-picked from commit a7d350790b)
2011-05-26 10:45:19 -07:00
Kenneth Graunke
c66ffcf663 intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Nexuiz was hitting a software fallback.

(cherry-picked from commit d1fc920f61)
2011-05-19 11:00:10 -07:00
José Fonseca
4a14f76c69 draw: Fix draw_variant_output::format's type.
(cherry picked from commit b79b05e17e)
2011-05-18 13:43:35 -06:00
Brian Paul
068926aaea glsl: add cast to silence signed/unsigned comparison warning 2011-05-18 13:42:37 -06:00
Brian Paul
a5c0969087 glsl: add static qualifier to silence warning 2011-05-18 13:42:13 -06:00
Matt Turner
b6bca28113 r300/compiler: align memory allocations to 8-bytes
Eliminates unaligned accesses on strict architectures. Spotted by Jay
Estabrook.

Signed-off-by: Matt Turner <mattst88@gmail.com>

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 86852236a3)
2011-05-13 01:23:08 +02:00
José Fonseca
348779a1fc mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

This fixes tracing yofrankie with apitrace, given it requires accurate
results from GetVertexAttribiv*.

NOTE: This is a candidate for the stable branches.
2011-05-12 14:12:26 +01:00
Tom Stellard
abf9217ea4 r300/compiler: Limit instructions to 3 source selects
Some presubtract conversions were generating more than 3 source
selects.

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

(cherry picked from commit 4612554dce)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c
2011-05-11 18:46:02 -07:00
Alex Buell
0309089e5a configure: bump LIBDRM_REQUIRED to 2.4.24
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 12:01:35 -06:00
Kostas Georgiou
a8032483ec r600c/g: Add pci id for FirePro 2270
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:10:38 -04:00
Alex Deucher
8963295b1b r600g: add new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:20:24 -04:00
Alex Deucher
3371397b1a r600c: add new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:18:58 -04:00
José Fonseca
b8c6362389 mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean. 2011-04-30 22:46:16 +01:00
Ian Romanick
73f4273b86 glsl: Regenerate compiler and glcpp files from cherry picks 2011-04-21 17:26:39 -07:00
Carl Worth
6d35d0bda6 glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion
with the following test case:

	#define A(a, b) B(a, b)
	#define C A(0, C)
	C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 9dacbe2226)
2011-04-21 11:35:15 -07:00
Carl Worth
29c2e1f3f7 glcpp: Simplify calling convention of parser's active_list functions
These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.
(cherry picked from commit 02d293c08e)
2011-04-21 11:35:06 -07:00
Kenneth Graunke
dca5ddf471 i965: Allocate the whole URB to the VS and fix calculations for Gen6.
Since we never enable the GS on Sandybridge, there's no need to allocate
it any URB space.

Furthermore, the previous calculation was incorrect: it neglected to
multiply by nr_vs_entries, instead comparing whether twice the size of
a single VS URB entry was bigger than the entire URB space.  It also
neglected to take into account that vs_size is in units of 128 byte
blocks, while urb_size is in bytes.

Despite the above problems, the calculations resulted in an acceptable
programming of the URB in most cases, at least on GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 42a8057000)
2011-04-20 15:28:45 -07:00
Ian Romanick
ff77a69ae3 intel: Fix ROUND_DOWN_TO macro
Previously the macro would (ALIGN(value - alignment - 1, alignment)).
At the very least, this was missing parenthesis around "alignment -
1".  As a result, if value was already aligned, it would be reduced by
alignment.  Condisder:

     x = ROUND_DOWN_TO(256, 128);

This becomes:

    x = ALIGN(256 - 128 - 1, 128);

Or:

    x = ALIGN(127, 128);

Which becomes:

    x = 128;

This macro is currently only used in brw_state_batch
(brw_state_batch.c).  It looks like the original version of this macro
would just use too much space in the batch buffer.  It's possible, but
not at all clear to me from the code, that the original behavior is
actually desired.

In any case, this patch does not cause any piglit regressions on my
Ironlake system.

I also think that ALIGN_FLOOR would be a better name for this macro,
but ROUND_DOWN_TO matches rounddown in the Linux kernel.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Whitwell <keithw@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 7e809f0b8d)
2011-04-20 15:28:45 -07:00
Eric Anholt
510fb3269e i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.
(cherry picked from commit 904b8ba1bb)
2011-04-20 15:28:45 -07:00
Kenneth Graunke
62fad6cb30 intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.
Also, refactor IS_GEN6 to use the IS_GT1 and IS_GT2 macros.

(cherry picked from commit ee8d182426)
2011-04-20 15:28:45 -07:00
Kenneth Graunke
0f02b4253d i965: Resolve implied moves in brw_dp_READ_4_vs_relative.
Fixes piglit test glsl-vs-arrays-3 on Sandybridge, as well as garbage
rendering in 3DMarkMobileES 2.0's Taiji demo and GLBenchmark 2.0's
Egypt and PRO demos.

NOTE: This a candidate for stable release branches.  It depends on
commit 9a21bc6401.
(cherry picked from commit 9d60a7ce08)
2011-04-20 15:28:45 -07:00
Kenneth Graunke
773ea1a234 i965: Refactor Sandybridge implied move handling.
This is actually a squash of the following two commits.  The first
caused a regression, and the second fixes it.  The refactor of the
first is needed for another patch that fixes an SNB bug.

    i965: Refactor Sandybridge implied move handling.

    This was open-coded in three different places, and more are necessary.
    Extract this into a function so it can be reused.

    Unfortunately, not all variations were the same: in particular, one set
    compression control and checked that the source register was not
    ARF_NULL.  This seemed like a good idea, so all cases now do so.
    (cherry picked from commit 9a21bc6401)

    i965: Fix null register use in Sandybridge implied move resolution.

    Fixes regressions caused by commit 9a21bc6401, namely GPU hangs when
    running gnome-shell or compiz (Mesa bugs #35820 and #35853).

    I incorrectly refactored the case that dealt with ARF_NULL; even in that
    case, the source register needs to be changed to the MRF.

    NOTE: This is a candidate for the 7.10 branch (if 9a21bc6401 is
    cherry-picked, take this one too).
    (cherry picked from commit a019dd0d6e)
2011-04-20 15:28:45 -07:00
Zou Nan hai
41d5dd4a6e i965: Align interleaved URB write length to 2
The BSpec says that interleave URB writes must be aligned, so this
patch fulfills that requirement.

This is half of patch 6c32477 from master.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-20 15:28:45 -07:00
Brian Paul
2c83c28608 docs: replace llvmpipe/README with docs/llvmpipe.html 2011-04-20 09:57:48 +01:00
Brian Paul
d4a82b3146 llvmpipe: document issue with LLVM 2.8 and earlier with AVX 2011-04-20 09:57:07 +01:00
José Fonseca
8d539264ca llvmpipe: Update readme. 2011-04-20 09:56:39 +01:00
Alan Hourihane
c13a7748de Check for out of memory when creating fence 2011-04-20 09:51:48 +01:00
Vinson Lee
f814e28e6d gallivm: Disable MMX-disabling code on llvm-2.9.
The disable-mmx option was removed in llvm-2.9svn by revisions 122188
and 122189.

Fixes FDO bug 32564.
2011-04-20 09:50:55 +01:00
Brian Paul
7e325d5e62 Makefile: add missing Scons files 2011-04-19 09:11:29 -06:00
Brian Paul
4373f6b9ad scons: remove dangling reference to state_trackers/python/SConscript 2011-04-19 09:06:54 -06:00
Tom Stellard
1f8c5611a2 r300/compiler: Fix dataflow analysis bug with ELSE blocks
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060

(cherry picked from commit ffc1d166d2)
2011-04-18 21:54:58 -07:00
Tom Stellard
bf9a469cb6 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

(cherry picked from commit 0fa81d6d05)
2011-04-16 14:40:20 -07:00
Ian Romanick
f890661a9a ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly
The code would previously handle the projection, then swizzle the
shadow comparitor into place.  However, when the projection is done
"by hand," as in the TXB case, the unprojected shadow comparitor would
over-write the projected shadow comparitor.

Shadow comparison with projection and LOD is an extremely rare case in
real application code, so it shouldn't matter that we don't handle
that case with the greatest efficiency.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=32395
(cherry picked from commit 9996a86085)
2011-04-11 19:06:48 -07:00
Ian Romanick
b31425aae9 glsl: Fix off-by-one error setting max_array_access for non-constant indexing
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 0d9d036004)
2011-04-11 19:06:48 -07:00
Kenneth Graunke
6c7a5d52ee i965/fs: Switch W and 1/W in Sandybridge interpolation setup.
Various documentation mentions that "W" is handed to the WM stage,
but further digging seems to indicate that they really mean 1/W.

The code here is still unclear, but changing this fixes piglit
test "fragcoord_w" on Sandybridge as well as a Khronos ES2 conformance
test.  I also tested 3DMarkMobile ES2.0's taiji and hoverjet demos, as
well as Nexuiz, just to be safe.

(cherry-picked from commit 5d7fefb9af)
2011-04-11 13:21:53 -07:00
Brian Paul
3c405079fd docs: add link to 7.10.2 release notes 2011-04-11 13:13:58 -06:00
Ian Romanick
1fb1012bf1 docs: Add 7.10.2 md5sums 2011-04-06 13:44:29 -07:00
Ian Romanick
b0866f6cfd docs: update news.html with 7.10.2 release 2011-04-06 13:41:43 -07:00
Ian Romanick
c6a68814b4 docs: Add change log to 7.10.2 release notes 2011-04-06 13:32:09 -07:00
Ian Romanick
3831ba6dd1 mesa: Remove nonexistant files from _FILES lists
This allows 'make -j1 tarballs' to work.
2011-04-06 13:29:59 -07:00
Ian Romanick
812e11f4b4 mesa: set version string to 7.10.2 2011-04-06 10:01:02 -07:00
Ian Romanick
0c69a2fda5 docs: Initial bits of 7.10.2 release notes 2011-04-06 09:59:32 -07:00
Tom Stellard
6e08ceb77d r300/compiler: Don't try to convert RGB to Alpha in full instructions
(cherry picked from commit cd2857fae1)
2011-04-06 00:41:29 -07:00
Ian Romanick
50dccfdbef Revert "i965: bump VS thread number to 60 on SNB"
Increasing the number of VS threads beyond 1 causes some regressions
in vertex shader tests on Sugar Bay GT1 systems.

This reverts commit c21a44463a.

References: https://bugs.freedesktop.org/show_bug.cgi?id=35730
2011-04-05 16:14:39 -07:00
Ian Romanick
22035e3d84 glcpp: Refresh autogenerated lexer files
These are the results of commit 9ebb904 and 7cf7c966.
2011-04-05 16:09:47 -07:00
Tom Stellard
62b75d889c r300/compiler: Fix vertex shader MAD instructions with constant swizzles
(cherry picked from commit d8361400b7)
2011-04-05 09:26:26 -07:00
Brian Paul
7c9d66c60f glsl: silence warning in printf() with a cast
(cherry picked from commit 0eab3a8a97)
2011-04-05 09:12:20 -06:00
Fabian Bieler
1068b7f9ed st/mesa: Apply LOD from texture object
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 5d5db24a26)
2011-04-05 09:10:49 -06:00
Brian Paul
e17ac39d38 st/mesa: Apply LOD bias from correct texture unit
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d863bd7d7b)
2011-04-05 09:10:26 -06:00
Brian Paul
33129c040b mesa: Guard against null pointer deref in fbo validation
This matches the behaviour below when numSamples is compared.

At least with the gallium state tracker this can actually occur if st_render_texture fails.

Signed-off-by: Brian Paul <brianp@vmware.com>

(cherry picked from commit c7339d42c6)
2011-04-05 07:54:04 -06:00
Brian Paul
ed5c9ae016 docs: update prerequisites, remove old demo info
(cherry picked from commit 32a11e5324)
2011-04-04 11:31:30 -06:00
Brian Paul
06422ce0d2 docs: update info about Mesa packaging/contents
(cherry picked from commit 48f696c793)
2011-04-04 11:31:16 -06:00
Marek Olšák
cd2cf02139 r300/compiler: apply the texture swizzle to shadow pass and fail values too
Piglit tests:
- glsl-fs-shadow2d-01
- glsl-fs-shadow2d-02
- glsl-fs-shadow2d-03
- fs-shadow2d-red-01
- fs-shadow2d-red-02
- fs-shadow2d-red-03

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 0d96ae8fc7)
2011-04-04 19:14:29 +02:00
Marek Olšák
f3a21be95e r300/compiler: propagate SaturateMode down to the result of shadow comparison
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 2679760834)
2011-04-04 19:14:20 +02:00
Alex Deucher
5a3f1aee64 r600g: add some additional ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:27:25 -04:00
Alex Deucher
0372db6fa8 r600c: add new ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:27:09 -04:00
Marek Olšák
868ca30235 r300g: tell the GLSL compiler to lower the continue opcode
NOTE: This is a candidate for the stable branches.
(cherry picked from commit f814dd7a81)
2011-04-03 19:37:43 +02:00
Kenneth Graunke
b39603e008 glsl: Accept precision qualifiers on sampler types, but only in ES.
GLSL 1.30 states clearly that only float and int are allowed, while the
GLSL ES specification's issues section states that sampler types may
take precision qualifiers.

Fixes compilation failures in 3DMarkMobileES 2.0 and GLBenchmark 2.0.

(cherry-picked from commit 8752824f27)
2011-04-02 20:11:10 -07:00
Kenneth Graunke
73f7453318 i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.
Civilization 4's shaders make heavy use of gl_Color and don't use
perspective interpolation.  This resulted in rivers, units, trees, and
so on being rendered almost entirely white.  This is a regression
compared to the old fragment shader backend.

Found by inspection (comparing the old and new FS backend code).

References: https://bugs.freedesktop.org/show_bug.cgi?id=32949

(cherry-picked from commit 0c8beb0ab5)
2011-04-02 20:10:40 -07:00
Tom Stellard
a947d9be61 prog_optimize: Fix reallocating registers for shaders with loops
Registers that are used inside of loops need to be considered live
starting with the first instruction of the outermost loop.

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

(cherry picked from commit 18dcbd358f)

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-03-31 21:24:32 -07:00
Jerome Glisse
ed4aa47d42 r600g: move user fence into base radeon structure
This avoid any issue when context is free and we still try to
access fence through radeon structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 63b9790a55)
2011-03-30 11:06:52 +02:00
Michel Dänzer
5bbaf1992c Use proper source row stride when getting depth/stencil texels.
(cherry picked from commit b082e04619)
2011-03-30 10:54:51 +02:00
Benjamin Franzke
71b06c63ce st/dri: Fix surfaceless gl using contexts with previous bound surfaces
ctx->dPriv might be != NULL then draw which is NULL is accessed:

struct dri_drawable *draw = dri_drawable(driDrawPriv);
[..]
if (ctx->dPriv != driDrawPriv) {
      ctx->dPriv = driDrawPriv;
      draw->texture_stamp = driDrawPriv->lastStamp - 1;
}

Cherry-picked from 0acb31be17

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-03-30 02:26:41 +02:00
Henri Verbeet
7fcaf9ae80 st/mesa: Validate state before doing blits.
Specifically, this ensures things like the front buffer actually exist. This
fixes piglt fbo/fbo-sys-blit and fd.o bug 35483.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
(cherry picked from commit 5d7c27f5ec)
2011-03-30 00:53:07 +02:00
Marek Olšák
d464f5908f r300g: fix alpha-test with no colorbuffer
Piglit:
- fbo-alphatest-nocolor

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 226ae9d6c8)
2011-03-24 23:46:28 +01:00
Eric Anholt
78fa94f091 i965: Fix alpha testing when there is no color buffer in the FBO.
We were alpha testing against an unwritten value, resulting in garbage.
(part of) Bug #35073.
(cherry picked from commit a99447314c)
2011-03-24 13:42:18 -07:00
Eric Anholt
1ae33556dd i965: Apply a workaround for the Ironlake "vertex flashing".
This is an awful hack and will hurt performance on Ironlake, but we're
at a loss as to what's going wrong otherwise.  This is the only common
variable we've found that avoids the problem on 4 applications
(CelShading, gnome-shell, Pill Popper, and my GLSL demo), while other
variables we've tried appear to only be confounding.  Neither the
specifications nor the hardware team have been able to provide any
enlightenment, despite much searching.

https://bugs.freedesktop.org/show_bug.cgi?id=29172
Tested by:	Chris Lord <chris@linux.intel.com> (Pill Popper)
Tested by:	Ryan Lortie <desrt@desrt.ca> (gnome-shell)
(cherry picked from commit 1a57717bbe)
2011-03-24 13:40:43 -07:00
Zou Nan hai
c21a44463a i965: bump VS thread number to 60 on SNB
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
(cherry picked from commit 6c324777a6)
2011-03-24 13:40:25 -07:00
Ian Romanick
386921cf45 glsl: Only allow unsized array assignment in an initializer
It should have been a tip when the spec says "However, implicitly
sized arrays cannot be assigned to. Note, this is a rare case that
*initializers and assignments appear to have different semantics*."
(empahsis mine)

Fixes bugzilla #34367.

NOTE: This is a candidate for stable release branches.
(cherry picked from commit 85caea29c1)
2011-03-23 18:59:31 -07:00
Ian Romanick
310d85c492 glsl: Use insert_before for lists instead of open coding it
(cherry picked from commit bdb6a6ef83)
2011-03-23 18:59:22 -07:00
Ian Romanick
55d86204f3 linker: Add imported functions to the linked IR
Fixes piglit test glsl-function-chain16 and bugzilla #34203.

NOTE: This is a candidate for stable release branches.
(cherry picked from commit 60f898a90e)
2011-03-23 18:12:55 -07:00
Ian Romanick
da8c178c8b glsl: Add several function / call related validations
The signature list in a function must contain only ir_function_signature nodes.

The target of an ir_call must be an ir_function_signature.

These were added while trying to debug Mesa bugzilla #34203.
(cherry picked from commit 8bbfbb14ee)
2011-03-23 18:12:24 -07:00
Ian Romanick
9dec904ef3 glsl: Function signatures cannot have NULL return type
The return type can be void, and this is the case where a `_ret_val'
variable should not be declared.
(cherry picked from commit 2df56b002d)
2011-03-23 18:12:16 -07:00
Ian Romanick
856a661d2f glsl: Process redeclarations before initializers
If an array redeclaration includes an initializer, the initializer
would previously be dropped on the floor.  Instead, directly apply the
initializer to the correct ir_variable instance and append the
generated instructions.

Fixes bugzilla #34374 and piglit tests glsl-{vs,fs}-array-redeclaration.

NOTE: This is a candidate for stable release branches.  0292ffb8 and
8e6cb9fe are also necessary.
(cherry picked from commit 09a4ba0fc3)
2011-03-23 16:55:08 -07:00
Ian Romanick
f0231a44b9 glsl: Refactor AST-to-HIR code handling variable redeclarations
Some significant edits were made to this patch during cherry picking.
There some fairly major conflicts due to GLSL 1.30 features and
extensions added in master that do not exist in the 7.10 branch.

(cherry picked from commit 8e6cb9fe51)
2011-03-23 16:55:07 -07:00
Ian Romanick
a28cef5e6e glsl: Refactor AST-to-HIR code handling variable initializers
(cherry picked from commit 0292ffb85c)
2011-03-23 16:55:07 -07:00
José Fonseca
1efb7428ed mesa: More glGet* fixes.
glGet(GL_NORMAL_ARRAY) giving potentially wrong results.

Most of glGet(GL_XXX_ARRAY_BUFFER_BINDING) giving totally bogus results.
2011-03-23 17:18:54 +00:00
Chad Versace
b8a077cee0 i965: Fix tex_swizzle when depth mode is GL_RED
Change swizzle from (x000) to (x001).

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-22 19:55:05 -07:00
Kenneth Graunke
9ebb904bbd glcpp: Remove trailing contexts from #if rules.
These are now unnecessary.

(cherry picked from commit 09e1bebc25)
2011-03-22 19:55:05 -07:00
Kenneth Graunke
7cf7c966f8 glcpp: Rework lexer to use a SKIP state rather than REJECT.
Previously, the rule deleted by this commit was matched every single
time (being the longest match).  If not skipping, it used REJECT to
continue on to the actual correct rule.

The flex manual advises against using REJECT where possible, as it is
one of the most expensive lexer features.  So using it on every match
seems undesirable. Perhaps more importantly, it made it necessary for
the #if directive rules to contain a look-ahead pattern to make them
as long as the (now deleted) "skip the whole line" rule.

This patch introduces an exclusive start state, SKIP, to avoid REJECTs.
Each time the lexer is called, the code at the top of the rules section
will run, implicitly switching the state to the correct one.

Fixes piglit tests 16384-consecutive-chars.frag and
16385-consecutive-chars.frag.

(cherry picked from commit f20656e944)
2011-03-22 19:44:37 -07:00
José Fonseca
7628e489e4 mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*). 2011-03-22 23:00:13 +00:00
Tom Stellard
d525a1b468 r300/compiler: Use a 4-bit writemask in pair instructions
We now use a 4-bit writemask for all instruction types, which makes it
easier to write generic helper functions to manipulte writemasks.

(cherry picked from commit 9d2ef284bb)
2011-03-18 19:52:14 -07:00
Dave Airlie
d59da64817 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-14 07:11:16 +10:00
Marek Olšák
ea26cc8696 st/mesa: fix crash when using both user and vbo buffers with the same stride
If two buffers had the same stride where one buffer is a user one and
the other is a vbo, it was considered to be one interleaved buffer,
resulting in incorrect rendering and crashes.

This patch makes sure that the interleaved buffer is either user or vbo,
not both.
(cherry picked from commit 695cdee678)
2011-03-12 22:10:44 +01:00
Marek Olšák
954787cee1 r300/compiler: remove unused variables
(cherry picked from commit ff8baec5bc)
2011-03-12 22:04:17 +01:00
Marek Olšák
75fd54e7bd r300/compiler: fix equal and notequal shadow compare functions
(cherry picked from commit 4dfcf3c4fe)
2011-03-12 22:03:55 +01:00
Marek Olšák
8453dce232 r300/compiler: saturate Z before the shadow comparison
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31159

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit eb1acd1613)
2011-03-12 22:03:41 +01:00
Marek Olšák
e48b0b9032 r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500
The docs say it can be set for direct texture lookups, but even that
causes problems.

This fixes the wireframe bug:
https://bugs.freedesktop.org/show_bug.cgi?id=32688

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 6da4866ffd)
2011-03-12 21:51:28 +01:00
Marek Olšák
3a1b2bb372 r300/compiler: TEX instructions don't support negation on source arguments
This fixes piglit:
- glsl-fs-texture2d-dependent-4

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 1e97b4dd10)
2011-03-12 21:51:17 +01:00
Marek Olšák
38f0e9b651 r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)
NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 589d835dfd)
2011-03-12 21:51:05 +01:00
Marek Olšák
aaf7c86b30 r300/compiler: fix translating the src negate bits in pair_translate
(1, -_, ...) was converted to (-1, ...) because of the negation
in the second component.
Masking out the unused bits fixes this.

Piglit:
- glsl-fs-texture2d-branching

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d96305e4fc)
2011-03-12 21:50:53 +01:00
Marek Olšák
c3fcd8af4f r300/compiler: fix the saturate modifier when applied to TEX instructions
This bug can only be triggered if the source texture is either signed or float.
(cherry picked from commit e4707604ab)
2011-03-12 21:50:36 +01:00
Marek Olšák
b5d293e4fd st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
This fixes:
  state_tracker/st_format.c:401:st_pipe_format_to_mesa_format:
  Assertion `0' failed.
(cherry picked from commit fb5d9e1199)

Conflicts:

	src/mesa/state_tracker/st_cb_fbo.c
2011-03-12 21:46:01 +01:00
Marek Olšák
3a02a2bf25 st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL
This fixes the game Tiny and Big.
(cherry picked from commit 7942e6a5ae)
2011-03-12 21:40:47 +01:00
Brian Paul
3ed9054cc5 docs: add, fix release notes links 2011-03-08 09:16:30 -07:00
Brian Paul
9a5de0895e docs: fill in 7.10.1 release data 2011-03-08 09:16:14 -07:00
Brian Paul
2aebe261aa docs: update news.html with 7.10.1 and 7.9.2 releases 2011-03-08 09:15:56 -07:00
Brian Paul
d7c64d7c36 docs: pull 7.9.2 release notes into 7.10 branch 2011-03-08 09:14:33 -07:00
Ian Romanick
68cdea9fb2 docs: Add 7.10.1 md5sums 2011-03-02 14:14:33 -08:00
Ian Romanick
565caabf40 docs: Add change log to 7.10.1 release notes 2011-03-02 13:54:20 -08:00
Ian Romanick
e4fefc3c32 mesa: set version string to 7.10.1 (final) 2011-03-02 13:49:17 -08:00
Ian Romanick
b0a7492aeb intel: Remove driver date and related bits from renderer string
Not only did this contain lies, it contained lies that wouldn't be
useful even if true.
2011-03-01 13:35:39 -08:00
Ian Romanick
8aabb1bc99 docs: Clean up bug fixes list
All the unnumbered bugs are first.  These are followed by numbered
bugs sorted by bug number.
2011-03-01 13:19:58 -08:00
Ian Romanick
a67a0a0589 docs: Update 7.10.1 with (hopefully) the last of the cherry picks 2011-03-01 13:03:47 -08:00
Cyril Brulebois
a6263f2738 Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org
Suggested by a freedesktop.org admin.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
(cherry picked from commit d252db7af1)
2011-03-01 12:57:29 -08:00
Brian Paul
7e158e85bd docs: updated environment variable list
(cherry picked from commit 1bf9954bb4)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-03-01 12:55:44 -08:00
Sam Hocevar
2fc2553261 docs: fix glsl_compiler name
(cherry picked from commit fde4943688)
2011-03-01 12:54:25 -08:00
Sam Hocevar
355601812a docs: add glsl info
(cherry picked from commit 3e8fb54fb8)
2011-03-01 12:53:56 -08:00
Chad Versace
8a27f9845b tnl: Add support for datatype GL_FIXED in vertex arrays
Before populating the vertex buffer attribute pointer (VB->AttribPtr[]),
convert vertex data in GL_FIXED format to GL_FLOAT.

Fixes bug: http://bugs.freedesktop.org/show_bug.cgi?id=34047

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit a231ac23f4)
2011-03-01 11:53:58 -08:00
Ian Romanick
e160c815c2 i915: Force lowering of all types of indirect array accesses in the FS
NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 4c1dc1c4d7)
2011-03-01 10:47:01 -08:00
Ian Romanick
a9d3cce8f3 i915: Calculate partial result to temp register first
Previously the SNE and SEQ instructions would calculate the partial
result to the destination register.  This would cause problems if the
destination register was also one of the source registers.

Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal,
glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal,
glsl-fs-vec4-operator-notequal.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 53b8b68843)
2011-03-01 10:46:52 -08:00
Ian Romanick
a62d3534e1 i915: Only mark a register as available if all components are written
Previously a register would be marked as available if any component
was written.  This caused shaders such as this:

  0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D;
  1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx;
  2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1];
  3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2];
  4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx;
  5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D;
  6: MOV TEMP[0].w, TEMP[1].wwww;
  7: MOV OUTPUT[2], TEMP[0];
  8: END

to produce incorrect code such as this:

  BEGIN
  DCL S[0]
  DCL T_TEX0
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[0].xyz = MOV U[0]
  R[1] = MUL CONST[0], R[0].xxxx
  R[2] = MAD CONST[1], R[0].yyyy, R[1]
  R[1] = MAD CONST[2], R[0].zzzz, R[2]
  R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[1].w = MOV U[0]
  R[0].w = MOV R[1].wwww
  oC = MOV R[0]
  END

Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are
still expected to hold a calculated value.

Fixes piglit tests draw-elements-vs-inputs, fp-kill, and
glsl-fs-color-matrix.  It also fixes Meego bugzilla #13005.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit a04582739e)
2011-03-01 10:46:41 -08:00
Kenneth Graunke
f9f01e40c7 Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."
This reverts commit 2171197559, as it
caused a regression on Ironlake (bug #34646).
2011-03-01 01:09:52 -08:00
Kenneth Graunke
c9ded4d418 glsl: Use reralloc instead of plain realloc.
Plugs a memory leak when compiling shaders with user defined structures.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit eb639349e2)
2011-02-28 16:40:58 -08:00
Kenneth Graunke
022f1110dd i965: Increase Sandybridge point size clamp in the clip state.
255.875 matches the hardware documentation.  Presumably this was a typo.

NOTE: This is a candidate for the 7.10 branch, along with
      commit 2bfc23fb86.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit e6e5c1f46d)
2011-02-28 16:40:58 -08:00
Kenneth Graunke
bb90087eda i965/fs: Refactor control flow stack handling.
We can't safely use fixed size arrays since Gen6+ supports unlimited
nesting of control flow.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit df2aef0e19)
2011-02-28 16:40:58 -08:00
Kenneth Graunke
e0f6193024 i965: Increase Sandybridge point size clamp.
255.875 matches the hardware documentation.  Presumably this was a typo.

Found by inspection.  Not known to fix any issues.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2bfc23fb86)
2011-02-28 16:40:57 -08:00
Kenneth Graunke
2171197559 i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.
pixel_w is the final result; wpos_w is used on gen4 to compute it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 4a3b28113c)
2011-02-28 16:40:57 -08:00
Kenneth Graunke
ec4822a316 i965/fs: Avoid register coalescing away gen6 MATH workarounds.
The code that generates MATH instructions attempts to work around
the hardware ignoring source modifiers (abs and negate) by emitting
moves into temporaries.  Unfortunately, this pass coalesced those
registers, restoring the original problem.  Avoid doing that.

Fixes several OpenGL ES2 conformance failures on Sandybridge.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2c2686b912)
2011-02-28 16:40:57 -08:00
Eric Anholt
f13e45d45d i965/fs: Add a helper function for detecting math opcodes.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

(cherry picked from commit 382c2d99da)
2011-02-28 16:40:57 -08:00
Kenneth Graunke
4fef0bc115 i965: Fix shaders that write to gl_PointSize on Sandybridge.
gl_PointSize (VERT_RESULT_PSIZ) doesn't take up a message register,
as it's part of the header.  Without this fix, writing to gl_PointSize
would cause the SF to read and use the wrong attributes, leading to all
kinds of random looking failure.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3e91070ea8)
2011-02-28 16:32:15 -08:00
Kenneth Graunke
8bf3a4f05e i965/fs: Apply source modifier workarounds to POW as well.
Single-operand math already had these workarounds, but POW (the only two
operand function) did not.  It needs them too - otherwise we can hit
assertion failures in brw_eu_emit.c when code is actually generated.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 72cd7e87d3)
2011-02-28 16:32:04 -08:00
Ian Romanick
aa180f2786 docs: update 7.10.1 release notes with Ian's recent cherry picks 2011-02-28 15:58:05 -08:00
Ian Romanick
52a274a4c0 linker: Fix off-by-one error implicit array sizing
Arrays are zero based.  If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 25b36e8ff8)
2011-02-28 15:16:56 -08:00
nobled
d7d55ab841 glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.

Also add a null check for psc, and drop gc's redundant initialization.
(cherry picked from commit b5dc40710d)
2011-02-28 15:16:56 -08:00
Ian Romanick
bba05bc699 glsl: Regenerate compiler and glcpp files from cherry picks 2011-02-28 15:16:55 -08:00
Ian Romanick
bcdb23ef8a glsl: Finish out the reduce/reduce error fixes
Track variables, functions, and types during parsing.  Use this
information in the lexer to return the currect "type" for identifiers.

Change the handling of structure constructors.  They will now show up
in the AST as constructors (instead of plain function calls).

Fixes piglit tests constructor-18.vert, constructor-19.vert, and
constructor-20.vert.  Also fixes bugzilla #29926.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 8842158944)
2011-02-28 14:58:19 -08:00
Keith Packard
5db7ee0fde glsl: Eliminate reduce/reduce conflicts in glsl grammar
This requires lexical disambiguation between variable and type
identifiers (as most C compilers do).

Signed-off-by: Keith Packard <keithp@keithp.com>

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit f4b812e1a6)
2011-02-28 14:58:11 -08:00
Chad Versace
614eff1fc6 glsl: Reinstate constant-folding for division by zero
Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160

Commit e7c1f058d1 disabled constant-folding
when division-by-zero occured. This was a mistake, because the spec does
allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing
by zero does not cause an exception but does result in an unspecified
value.)

For floating-point division, the original pre-e7c1f05 behavior is
reinstated.

For integer division, constant-fold 1/0 to 0.

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

(cherry picked from commit 62c8c77333)
2011-02-28 14:52:09 -08:00
Chad Versace
89576ea75b glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
From section 5.9 of the GLSL 1.20 spec:
   The operator modulus (%) is reserved for future use.

From section 5.8 of the GLSL 1.20 spec:
   The assignments modulus into (%=), left shift by (<<=), right shift by
   (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These
   operators are reserved for future use.

The GLSL ES 1.00 spec and GLSL 1.10 spec have similiar language.

Fixes bug:
https://bugs.freedesktop.org//show_bug.cgi?id=33916

Fixes Piglit tests:
spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.10/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.10/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.20/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.20/compiler/assignment-operators/modulus-assign-00.frag
(cherry picked from commit 82f994f386)
2011-02-28 14:48:02 -08:00
Chad Versace
0ca5a1593d glcpp: Raise error when modulus is zero
For example, this now raises an error:
   #define XXX 1 / 0

Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507
Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit fd1252ab67)
2011-02-28 14:47:37 -08:00
Ian Romanick
ec162447a5 mesa: Initial size for secondary color array is 3
See table 6.7 on page 347 of the OpenGL 3.0 specification.
(cherry picked from commit 09e15ac76a)
2011-02-28 14:47:01 -08:00
Eric Anholt
8b91cf406a i965: Fix a bug in i965 compute-to-MRF.
Fixes piglit glsl-fs-texture2d-branching.  I couldn't come up with a
testcase that didn't involve dead code, but it's still worthwhile to
fix I think.
(cherry picked from commit 8ce425f3e3)
2011-02-28 14:46:02 -08:00
Kenneth Graunke
ab58b21634 glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.
This has probably existed since e5e34ab18e or so.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit dfdb9fda82)
2011-02-28 14:33:56 -08:00
Ian Romanick
d92cc2f45f glsl: Reject shader versions not supported by the implementation
Previously we'd happily compile GLSL 1.30 shaders on any driver.  We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.

NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit 14880a510a)
2011-02-28 14:33:33 -08:00
Ian Romanick
a527411469 glsl: Ensure that all GLSL versions are supported in the stand-alone compiler
NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit e5e34ab18e)
2011-02-28 14:33:19 -08:00
Ian Romanick
f9e01af6c3 intel: Fix typeos from 3d028024 and 790ff232
...and remove egg from face.
(cherry picked from commit 2fb0aebd4a)
2011-02-28 13:55:36 -08:00
Ian Romanick
0a92301c80 i915: Set correct values for range/precision of fragment shader types
(cherry picked from commit 790ff232e2)
2011-02-28 13:55:36 -08:00
Ian Romanick
3274681f80 i965: Set correct values for range/precision of fragment shader types
(cherry picked from commit 3d028024e5)
2011-02-28 13:55:36 -08:00
Ian Romanick
96917f1f0c mesa: Connect glGetShaderPrecisionFormat into the dispatch table
(cherry picked from commit dde3270c19)
2011-02-28 13:55:36 -08:00
Brian Paul
1d35ffc541 mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed.
No drivers do this yet.
(cherry picked from commit 3ee60a3558)
2011-02-28 13:55:35 -08:00
Chia-I Wu
15e6d05650 mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.
Core mesa has gained support for GL_ARB_ES2_compatibility.  Make GLES
generated dispatch table use them.
(cherry picked from commit a4a5a9a5ce)
2011-02-28 13:55:35 -08:00
Eric Anholt
d3c1fb7775 mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.
Fixes piglit arb_es2_compatibility-shadercompiler
(cherry picked from commit 4620de7eea)
2011-02-28 13:55:35 -08:00
Eric Anholt
6428ca32c0 mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.
Fixes piglit arb_es2_compatibility-maxvectors.
(cherry picked from commit 8395f206a8)
2011-02-28 13:55:35 -08:00
Eric Anholt
281d3fe3c0 mesa: Add support for glDepthRangef and glClearDepthf.
These are ARB_ES2_compatibility float variants of the core double
entrypoints.  Fixes arb_es2_compatibility-depthrangef.
(cherry picked from commit e12c4faf7e)
2011-02-28 13:55:35 -08:00
Eric Anholt
88f24e2598 mesa: Add actual support for glReleaseShaderCompiler from ES2.
Fixes no-op dispatch warning in piglit
arb_es2_compatibility-releaseshadercompiler.c.
(cherry picked from commit 7b987578a9)
2011-02-28 13:55:35 -08:00
Eric Anholt
7992b59087 mesa: Add extension enable bit for GL_ARB_ES2_compatibility.
(cherry picked from commit 9c6954fc9d)
2011-02-28 13:55:34 -08:00
Ian Romanick
ac06d610fb glapi: Regenerate for GL_ARB_ES2_compatibility.
This is not a cherry pick, but it matches 841ad6bf.
2011-02-28 13:55:34 -08:00
Eric Anholt
9d1b17059d glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.
(cherry picked from commit 8560cb939b)
2011-02-28 13:24:08 -08:00
Chad Versace
525c5458f5 i915: Disable extension OES_standard_derivatives
OES_standard_derivatives must be manually disabled for i915 because Mesa
enables it by default.
(cherry picked from commit 7b9dc40b0d)
2011-02-25 17:24:34 -08:00
Chad Versace
3a4ab56f32 mesa: Change OES_standard_derivatives to be stand-alone extension
Add a bit in struct gl_extensions for OES_standard_derivatives, and enable
the bit by default. Advertise the extension only if the bit is enabled.

Previously, OES_standard_derivatives was advertised in GLES2 contexts
if ARB_framebuffer_object was enabled.
(cherry picked from commit 78838b2d1b)
2011-02-25 17:24:34 -08:00
Vinson Lee
654ee9f282 mesa: Move loop variable declarations outside for loop in extensions.c.
Fixes MSVC build.
(cherry picked from commit 31b1051663)
2011-02-25 17:24:34 -08:00
Vinson Lee
f012e8832b mesa: Move declaration before code in extensions.c.
Fixes SCons build.
(cherry picked from commit 356e2e962f)
2011-02-25 17:24:34 -08:00
Chad Versace
1328fbdefb 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>
(cherry picked from commit a7b5664c05)
2011-02-25 17:24:34 -08:00
Chad Versace
d9d1b8dab0 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>
(cherry picked from commit 039150169e)
2011-02-25 17:24:34 -08:00
Chad Versace
21e44e947a 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>
(cherry picked from commit 19418e921a)
2011-02-25 17:24:34 -08:00
Chad Versace
2d1b154f73 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>
(cherry picked from commit 9b260c377f)
2011-02-25 17:24:34 -08:00
Dave Airlie
76366ee06b radeon: avoid segfault on 3D textures.
This is a candidate for 7.9 and 7.10
2011-02-22 15:27:02 -05:00
Dave Airlie
d3d2be2de1 radeon: calculate complete texture state inside TFP function
(really not sure why I'm doing this).

This is a candidate for 7.9 and 7.10 branches.
2011-02-22 15:26:44 -05:00
Dave Airlie
8402caf752 radeon/r200: fix fbo-clearmipmap + gen-teximage
sw clears were being used and not getting the correct offsets in the span
code.

also not emitting correct offsets for CB draws to texture levels.

(I've no idea why I'm playing with r100).

This is a candidate for 7.9 and 7.10
2011-02-22 15:26:24 -05:00
Paulo Zanoni
f0fa040d94 dri_util: fail driCreateNewScreen if InitScreen is NULL
Without this, X doesn't start with UMS on r300g.

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

Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-22 15:20:20 -05:00
Fredrik Höglund
b847da213e 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-02-22 15:19:54 -05:00
Marek Olšák
e7d1b5489e st/dri: Track drawable context bindings
Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
(cherry picked from commit 94ccc31ba4)

Conflicts:

	src/gallium/state_trackers/dri/common/dri_context.c
2011-02-20 17:03:43 +01:00
Brian Paul
6c7adb0822 docs: add link to 7.10.1 release notes 2011-02-21 18:05:56 -07:00
Brian Paul
917c44aa52 docs: update 7.9.2 release notes with Brian's cherry-picks 2011-02-21 18:05:39 -07:00
Brian Paul
49a190bb0e st/mesa: need to translate clear color according to surface's base format
When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit e2d108ec82)
2011-02-21 17:48:47 -07:00
Brian Paul
71eee987d9 st/mesa: fix the default case in st_format_datatype()
Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit c966c6980c)
2011-02-21 17:38:59 -07:00
Brian Paul
0ed0670fa9 st/mesa: set renderbuffer _BaseFormat in a few places
NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit 633c9fcf78)
2011-02-21 17:38:35 -07:00
Brian Paul
f3f0e30e8e st/mesa: fix incorrect glCopyPixels position on fallback path
If we hit the pipe_get/put_tile() path for setting up the glCopyPixels
texture we were passing the wrong x/y position to pipe_get_tile().
The x/y position was already accounted for in the pipe_get_transfer()
call so we were effectively reading from 2*readX, 2*readY.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d1becefb05)

Conflicts:

	src/mesa/state_tracker/st_cb_drawpixels.c
2011-02-21 17:37:07 -07:00
Brian Paul
a835f586c6 cso: fix loop bound in cso_set_vertex_samplers()
Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d087cfaabf)
2011-02-21 17:31:44 -07:00
Julien Cristau
d91ec5322a glx: fix length of GLXGetFBConfigsSGIX
The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cbe9fc12a6)
2011-02-21 17:30:48 -07:00
Julien Cristau
739d099d43 glx: fix GLXChangeDrawableAttributesSGIX request
xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e27913f805)
2011-02-21 17:30:29 -07:00
Dimitry Andric
dd34903790 glapi: add @GOTPCREL relocation type
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cfb9aae3ec)
2011-02-21 17:30:04 -07:00
Brian Paul
d15da60f3b softpipe: fix off-by-one error in setup_fragcoord_coeff()
If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 40ac24e631)
2011-02-21 17:29:15 -07:00
Brian Paul
63733afc48 st/mesa: fix incorrect fragcoord.x translation
emit_adjusted_wpos() needs separate x,y translation values.  If we
invert Y, we don't want to effect X.

Part of the fix for http://bugs.freedesktop.org/show_bug.cgi?id=26795

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit bb56631f0c)
2011-02-21 17:28:57 -07:00
Dimitry Andric
2fa6aef594 glapi: adding @ char before type specifier in glapi_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33433
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 37bffe8d12)
2011-02-21 17:28:32 -07:00
Julien Cristau
24797bd375 glx: fix request lengths
We were sending too long requests for GLXChangeDrawableAttributes,
GLXGetDrawableAttributes, GLXDestroyPixmap and GLXDestroyWindow.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4324d6fdfb)
2011-02-21 17:26:15 -07:00
Dimitry Andric
0ec3ec8086 mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33386
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 811ee32a9e)
2011-02-21 17:25:13 -07:00
Dimitry Andric
5a4be4455e mesa: s/movzx/movzbl/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33388
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3fda80246f)
2011-02-21 17:24:02 -07:00
Brian Paul
cdcad7bb31 llvmpipe: make sure binning is active when we begin/end a query
This fixes a potential failure when a begin/end_query is the first
thing to happen after flushing the scene.

NOTE: This is a candidate for the 7.10 and 7.9 branches.
(cherry picked from commit 42dbc2530b)
2011-02-21 17:23:09 -07:00
Brian Paul
a23311e5c7 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.
(cherry picked from commit dd973cd9e8)
2011-02-21 17:22:03 -07:00
Brian Paul
89fb9a94bb 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.
(cherry picked from commit 67722ae403)
2011-02-21 17:21:30 -07:00
Brian Paul
7739b6b54c 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.
(cherry picked from commit 2fa6012f6a)
2011-02-21 17:21:02 -07:00
Brian Paul
9d54f6bf83 mesa: fix a few format table mistakes, assertions
The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 0073f50cd4)
2011-02-21 17:19:56 -07:00
Brian Paul
1a6154e022 gallivm: fix copy&paste error from previous commit
Fixes piglit regression, http://bugs.freedesktop.org/show_bug.cgi?id=32452

NOTE: This is a candidate for the 7.10 branch
(cherry picked from commit 3ecf47af12)
2011-02-21 17:18:41 -07:00
Brian Paul
5b844eff0a gallivm: work around LLVM 2.6 bug when calling C functions
Create a constant int pointer to the C function, then cast it to the
function's type.  This avoids using trampoline code which seem to be
inadvertantly freed by LLVM in some situations (which leads to segfaults).
The root issue and work-around were found by José.

NOTE: This is a candidate for the 7.10 branch
(cherry picked from commit ee16e97ed1)
2011-02-21 17:18:41 -07:00
Ian Romanick
fef0bf65a7 docs: Update 7.10.1 release notes
Add recent cherry picks
2011-02-21 13:35:59 -08:00
Ian Romanick
5ad00ef7a3 Use C-style system headers in C++ code to avoid issues with std:: namespace
Based on commit 497baf4e4a from master.
2011-02-21 13:19:34 -08:00
Ian Romanick
60675572f7 mesa: Fix error checks in GetVertexAttrib functions
Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
(cherry picked from commit 5c3f1cdbbe)
2011-02-21 13:19:33 -08:00
Ian Romanick
6b7b2af43a linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
(cherry picked from commit ce9171f9d8)
2011-02-21 13:19:33 -08:00
Ian Romanick
9a9bd548b0 mesa: glGetUniform only returns a single element of an array
Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.
(cherry picked from commit 20d278a7ff)
2011-02-21 13:19:33 -08:00
Marek Olšák
d5a1325f81 mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2 2011-02-16 20:49:52 +01:00
Christoph Bumiller
0555e04aaa nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs
fixes 34179.

Reported-by: Sense Hofstede
Requested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 10:33:00 +10:00
Tom Stellard
cc1636b6db r300/compiler: Don't erase sources when converting RGB->Alpha
https://bugs.freedesktop.org/show_bug.cgi?id=34030

(cherry picked from commit 9106b98766)
2011-02-11 20:16:25 -08:00
Bryce Harrington
995edd4c0a r300g: Null pointer check for buffer deref in gallium winsys
radeon_drm_bufmgr_create_buffer_from_handle() can return NULL buffers
sometimes (seen when alt-tabbing in compiz).  Avoid dereferencing the
buffer pointer in this case.

Ref.: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653
Also: https://bugzilla.redhat.com/show_bug.cgi?id=660143

Signed-off-by: Bryce Harrington <bryce@canonical.com>
2011-02-11 02:33:36 +01:00
Vinson Lee
546aade286 ralloc: Add missing va_end following va_copy.
(cherry picked from commit cde443e0b9)
2011-02-07 15:02:53 -08:00
Kenneth Graunke
77e3c82ad1 Remove the talloc sources from the Mesa repository.
(cherry picked from commit 1568b19e3b)
2011-02-07 15:02:39 -08:00
Kenneth Graunke
5c1e361b8e Remove talloc from the SCons build system.
(cherry picked from commit 8aac5d123c)

Conflicts:
	src/SConscript
	src/gallium/targets/egl-static/SConscript
	src/glsl/SConscript
	src/mesa/SConscript
2011-02-07 15:02:39 -08:00
Kenneth Graunke
72f90dc3ee Remove talloc from the make and automake build systems.
(cherry picked from commit d1d8120545)

Conflicts:
	src/glsl/Makefile
	src/mesa/Makefile
	src/mesa/drivers/osmesa/Makefile
2011-02-07 15:02:39 -08:00
Kenneth Graunke
6fb448c314 ralloc: a new MIT-licensed recursive memory allocator.
(cherry picked from commit 42fd9c2ebb)
2011-02-07 15:02:39 -08:00
Kenneth Graunke
2e226777a4 Convert everything from the talloc API to the ralloc API.
(cherry-picked from d3073f58c1 and
 cfd8d45ccd then squashed)

Conflicts:
	src/glsl/builtin_function.cpp
	src/glsl/glcpp/glcpp-parse.c
	src/glsl/ir_reader.cpp
	src/glsl/loop_analysis.cpp
	src/glsl/main.cpp
	src/mesa/drivers/dri/i965/brw_fs_schedule_instructions.cpp
	src/mesa/program/ir_to_mesa.cpp
	src/mesa/program/register_allocate.c
2011-02-07 15:02:39 -08:00
Kenneth Graunke
4e5b184a61 ralloc: Add a fake implementation of ralloc based on talloc.
(cherry picked from commit dc55254f5b)
2011-02-07 15:02:39 -08:00
Kenneth Graunke
511e5e30a5 glcpp: Remove use of talloc reference counting.
We almost always want to simply steal; we only need to copy when copying
a token list (in which case we're already cloning stuff anyway).

(cherry picked from commit 6ecee54a9a)
2011-02-07 15:02:39 -08:00
Kenneth Graunke
281e3bee4b glsl, i965: Remove unnecessary talloc includes.
These are already picked up by ir.h or glsl_types.h.

(cherry picked from commit e256e4743c)
2011-02-07 15:02:39 -08:00
Kenneth Graunke
ea4df94d61 glsl: Don't bother unsetting a destructor that was never set.
This was totally copied and pasted from glsl_symbol_table.

(cherry picked from commit 21031b4e88)
2011-02-07 15:02:39 -08:00
Tom Stellard
92a619b43f r300/compiler: Disable register rename pass on r500
The scheduler and the register allocator are not good enough yet to deal
with the effects of the register rename pass.  This was causing a 50%
performance drop in Lightsmark.  The pass can be re-enabled once the
scheduler and the register allocator are more mature.  r300 and r400
still need this pass, because it prevents a lot of shaders from using
too many texture indirections.

(cherry picked from commit 68b701f5de)
2011-02-05 23:30:08 -08:00
Ian Romanick
b54faf45dc docs: Update 7.10.1 release notes
Add recent cherry picks for precision qualifers, linker bugs, and other issues.
2011-02-04 16:51:17 -08:00
Ian Romanick
3370f9b606 linker: Propagate max_array_access while linking functions
Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.

Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 0f4b2a0a23)
2011-02-04 15:14:01 -08:00
Ian Romanick
bdcdcb5c18 linker: Set sizes for non-global arrays as well
Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.

Fixes piglit test glsl-fs-implicit-array-size-02.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit c87e9ef4d2)
2011-02-04 15:14:01 -08:00
Ian Romanick
b51b8db450 glsl: Don't assert when the value returned by a function has no rvalue
The rvalue of the returned value can be NULL if the shader says
'return foo();' and foo() is a function that returns void.

Existing GLSL specs do *NOT* say that this is an error.  The type of
the return value is void.  If the return type of the function is also
void, then this should compile without error.  I expect that future
versions of the GLSL spec will fix this (wink, wink, nudge, nudge).

Fixes piglit test glsl-1.10/compiler/expressions/return-01.vert and
bugzilla #33308.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2db46fe5f0)
2011-02-04 15:14:01 -08:00
Kenneth Graunke
32786b8a33 glsl: Expose a public glsl_type::void_type const pointer.
This is analogous to glsl_type::int_type and all the others.
(cherry picked from commit 5c229e5fbd)
2011-02-04 15:14:01 -08:00
Chad Versace
7bb3fe50c2 glsl: Mark 'in' variables at global scope as read-only
Fixes Piglit tests:
spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag
(cherry picked from commit 01a584d093)
2011-01-31 16:19:50 -08:00
Chad Versace
c4b626018a glsl: Fix segfault due to missing printf argument
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 46f7105df4)
2011-01-31 16:19:50 -08:00
Chad Versace
a9eec42b0e glsl: Fix semantic checks on precision qualifiers
The check for
   Precision qualifiers only apply to floating point and integer types.
was incomplete. It rejected only type 'bool' and structures.
(cherry picked from commit 45e8e6c6b1)
2011-01-31 16:19:50 -08:00
Ian Romanick
0ee9a6698d glsl: Refresh autogenerated lexer and parser files.
For the previous few commits.
2011-01-31 16:19:50 -08:00
Chad Versace
10f6e286d5 glsl: Remove redundant semantic check in parser
The removed semantic check also exists in ast_type_specifier::hir(), which
is a more natural location for it.

The check verified that precision statements are applied only to types
float and int.
(cherry picked from commit a9bf8c12ee)
2011-01-31 16:08:10 -08:00
Chad Versace
b2b1b1f596 glsl: Add support for default precision statements
* Add new field ast_type_specifier::is_precision_statement.
* Add semantic checks in ast_type_specifier::hir().
* Alter parser rules accordingly.
(cherry picked from commit 08a286c9cc)
2011-01-31 16:07:33 -08:00
Chad Versace
757a49cafd glsl: Add semantic checks for precision qualifiers
* Check that precision qualifiers only appear in language versions 1.00,
  1.30, and later.
* Check that precision qualifiers do not apply to bools and structs.

Fixes the following Piglit tests:
* spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag

(cherry picked from commit 889e1a5b6c)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-01-31 16:06:42 -08:00
Chad Versace
9016ab24b8 glsl: Change default value of ast_type_specifier::precision
Change default value to ast_precision_none, which denotes the absence of
a precision of a qualifier.

Previously, the default value was ast_precision_high. This made it
impossible to detect if a precision qualifier was present or not.
(cherry picked from commit aaa31bf8f4)
2011-01-31 16:03:32 -08:00
Chad Versace
c597334ef2 glsl: Fix parser rule for type_specifier
Do not assign a value to ast_type_specifier::precision when no precision
qualifier is present.
(cherry picked from commit 33279cd2d3)
2011-01-31 16:03:06 -08:00
Tom Fogal
84b857ef73 Regenerate gl_mangle.h. 2011-01-27 15:09:12 -07:00
Ian Romanick
a80384d7f6 docs: Update 7.10.1 release notes
Replace "Fix an error in uniform arrays in row calculating" with the
actual bugzilla that was fixed.

Put the entry for bug #30156 in the correct order.
2011-01-26 10:16:36 -08:00
Ian Romanick
092b6f2ca8 glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'
The specs that add 'layout' require the use of 'in' or 'out'.
However, a number of implementations, including Mesa, shipped several
of these extensions allowing the use of 'varying' and 'attribute'.
For these extensions only a warning is emitted.

This differs from the behavior of Mesa 7.10.  Mesa 7.10 would only
accept 'attribute' with 'layout(location)'.  This behavior was clearly
wrong.  Rather than carrying the broken behavior forward, we're just
doing the correct thing.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 4bcff0c190)
2011-01-25 16:17:51 -08:00
Ian Romanick
c8e504eec5 doc: Update 7.10.1 release notes 2011-01-25 15:52:56 -08:00
Jian Zhao
acc7369285 mesa: fix an error in uniform arrays in row calculating.
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.

NOTE: This is a candidate for 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2a7380e9c3)
2011-01-25 15:52:56 -08:00
Eric Anholt
2d22c508c7 docs: Add a relnote for the Civ IV on i965. 2011-01-18 12:06:54 -08:00
Eric Anholt
aba5e843dd i965: Fix dead pointers to fp->Parameters->ParameterValues[] after realloc.
Fixes texrect-many regression with ff_fragment_shader -- as we added
refs to the subsequent texcoord scaling paramters, the array got
realloced to a new address while our params[] still pointed at the old
location.
(cherry picked from commit e4be665bbd)
2011-01-18 11:34:54 -08:00
Eric Anholt
4e0d6cf7ba intel: Make renderbuffer tiling choice match texture tiling choice.
There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
(cherry picked from commit 29c4f95cbc)
2011-01-18 11:34:54 -08:00
Eric Anholt
2afa3f47af i965: Avoid double-negation of immediate values in the VS.
In general, we have to negate in immediate values we pass in because
the src1 negate field in the register description is in the bits3 slot
that the 32-bit value is loaded into, so it's ignored by the hardware.
However, the src0 negate field is in bits1, so after we'd negated the
immediate value loaded in, it would also get negated through the
register description.  This broke this VP instruction in the position
calculation in civ4:

MAD TEMP[1], TEMP[1], CONST[256].zzzz, CONST[256].-y-y-y-y;

Bug #30156
(cherry picked from commit 1d1ad6306d)
2011-01-18 11:34:54 -08:00
Eric Anholt
219b8b672d 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.
(cherry picked from commit c3f000b392)
2011-01-18 11:34:54 -08:00
Eric Anholt
b90223f4cf 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.
(cherry picked from commit 9351ef7a44)
2011-01-18 11:34:54 -08:00
Eric Anholt
e15ad414d0 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.
(cherry picked from commit ab56e3be9a)
2011-01-18 11:34:54 -08:00
Eric Anholt
a702858139 glsl: Fix the lowering of variable array indexing to not lose write_masks.
Fixes glsl-complex-subscript on 965.
(cherry picked from commit c00bc13564)
2011-01-18 11:34:53 -08:00
Ian Romanick
8f3eef1206 mesa: bump version to 7.10.1-devel 2011-01-17 16:28:02 -08:00
Ian Romanick
0a0b0c8f7e docs: Initial bits of 7.10.1 release notes 2011-01-17 16:27:58 -08:00
Ian Romanick
05ff61dc6b glsl: Allow 'in' and 'out' when 'layout' is also available
All of the extensions that add the 'layout' keyword also enable (and
required) the use of 'in' and 'out' with shader globals.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 82c4b4f88a)
2011-01-17 16:24:45 -08:00
Ian Romanick
aff4170849 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.
(cherry picked from commit bd33055ef4)
2011-01-17 16:24:45 -08:00
Ian Romanick
d81615ee19 glsl: Disallow 'in' and 'out' on globals in GLSL 1.20
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.

NOTE: This is a candidate for the 7.9 and 7.10 branches.  This patch
also depends on the previous two commits.
(cherry picked from commit 469ea695bb)
2011-01-17 16:24:45 -08:00
Ian Romanick
4ee68e2d47 glsl & glcpp: Refresh autogenerated lexer and parser files.
For the previous few commits.
2011-01-17 16:24:44 -08:00
Ian Romanick
27ef465276 glsl: Add version_string containing properly formatted GLSL version
(cherry picked from commit eebdfdfbcf)
2011-01-17 14:50:01 -08:00
Ian Romanick
50d40edb8c glcpp: Generate an error for division by zero
When GCC encounters a division by zero in a preprocessor directive, it
generates an error.  Since the GLSL spec says that the GLSL
preprocessor behaves like the C preprocessor, we should generate that
same error.

It's worth noting that I cannot find any text in the C99 spec that
says this should be an error.  The only text that I can find is line 5
on page 82 (section 6.5.5 Multiplicative Opertors), which says,

    "The result of the / operator is the quotient from the division of
    the first operand by the second; the result of the % operator is
    the remainder. In both operations, if the value of the second
    operand is zero, the behavior is undefined."

Fixes 093-divide-by-zero.c test and bugzilla #32831.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 9ca5300b6e)
2011-01-17 14:49:53 -08:00
Chad Versace
c2b721bc0e glcpp: Fix segfault when validating macro redefinitions
In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add
a guard that prevents dereferncing a null token list.

This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and
Bugzilla #32695.
(cherry picked from commit 4fff52f1c9)
2011-01-17 14:49:48 -08:00
Chad Versace
45be27d09b glsl: At link-time, check that globals have matching centroid qualifiers
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
(cherry picked from commit 61428dd2ab)
2011-01-17 14:49:39 -08:00
Ian Romanick
6fded6d29d glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 86b4398cd1)
2011-01-17 14:49:30 -08:00
Brian Paul
ea96167f2f docs: added news item for 7.9.1 and 7.10 release 2011-01-14 17:35:27 -07:00
Brian Paul
b8062cdf4b docs: add links to 7.9.1 and 7.10 release notes 2011-01-14 17:35:08 -07:00
Brian Paul
0e809808b1 draw: Fix an off-by-one bug in a vsplit assertion.
When use_spoken is true, istart (the first vertex of this segment) is
replaced by i0 (the spoken vertex of the fan).  There are still icount
vertices.

Thanks to Brian Paul for spotting this.
(cherry picked from commit abbb1c8f08)
2011-01-13 11:35:34 -07:00
Alberto Milone
b28a90c9a7 r600c: add evergreen ARL support.
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
2011-01-11 14:50:10 -05:00
Marek Olšák
38c3d8a828 docs: fix messed up names with special characters in relnotes-7.9.1
(cherry picked from commit 67aeab0b77)
2011-01-08 03:07:25 +01:00
Marek Olšák
36009724fd docs: fix messed up names with special characters in relnotes-7.10 2011-01-08 03:06:04 +01:00
Ian Romanick
50a82a8601 docs: Add 7.10 md5sums 2011-01-07 14:20:27 -08:00
Ian Romanick
7a3f869a47 mesa: set version string to 7.10 2011-01-07 14:09:03 -08:00
Ian Romanick
c18447bf97 docs: Update 7.10 release notes 2011-01-07 14:07:51 -08:00
Ian Romanick
5768445eaf docs: Import 7.9.1 release notes from 7.9 branch
(cherry picked from commit 46a360b26a)
2011-01-07 13:41:15 -08:00
Alex Deucher
fbd98eae6a r600c: fix up SQ setup in blit code for Ontario/NI 2011-01-07 03:12:28 -05:00
Marek Olšák
14950c50e1 r300/compiler: disable the rename_regs pass for loops
This workaround fixes rendering of kwin thumbnails.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 8543902bfb)
2011-01-07 07:10:49 +01:00
Alex Deucher
ca8e49f303 r600g: support up to 64 shader constants
From the r600 ISA:
Each ALU clause can lock up to four sets of constants
into the constant cache.  Each set (one cache line) is
16 128-bit constants. These are split into two groups.
Each group can be from a different constant buffer
(out of 16 buffers). Each group of two constants consists
of either [Line] and [Line+1] or [line + loop_ctr]
and [line + loop_ctr +1].

For supporting more than 64 constants, we need to
break the code into multiple ALU clauses based
on what sets of constants are needed in that clause.

Note: This is a candidate for the 7.10 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-06 19:51:14 -05:00
Alex Deucher
f2f89f7b18 r600c: add support for NI asics 2011-01-06 18:41:23 -05:00
Alex Deucher
3285d1dc57 r600g: add support for NI (northern islands) asics
This adds support for barts, turks, and caicos.
2011-01-06 18:17:18 -05:00
Dave Airlie
9ba827100a r600g: hack around property unknown issues.
should fix https://bugs.freedesktop.org/show_bug.cgi?id=32619

Need to add proper support for properties later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-06 15:54:47 -05:00
Alex Deucher
002ce07abe r600g: remove useless switch statements
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-06 15:54:47 -05:00
Dave Airlie
949c24862a r600g: fix evergreen segfaults.
evergreen was crashing running even gears here.

This is a 7.10 candidate if its broken the same.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-06 15:54:47 -05:00
Jerome Glisse
34c58f6d46 r600g: avoid segfault
Candidates 7.10

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-06 15:54:47 -05:00
Jerome Glisse
ece71d605b r600g: properly unset vertex buffer
Fix bug http://bugs.freedesktop.org/show_bug.cgi?id=32455

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-06 15:54:47 -05:00
Jerome Glisse
0fc205152c r600g: need to reference upload buffer as the might still live accross flush
Can't get away from referencing upload buffer as after flush a vertex buffer
using the upload buffer might still be active. Likely need to simplify the
pipe_refence a bit so we don't waste so much cpu time in it.

candidates for 7.10 branch

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-06 15:54:47 -05:00
Jerome Glisse
4434614844 r600g: fix segfault when translating vertex buffer
Note the support for non float vertex draw likely regressed need to
find what we want to do there.

candidates for 7.10 branches

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-06 15:54:47 -05:00
Jerome Glisse
e7b12f2a0e r600g: fix bo size when creating bo from handle
Spoted by Alex Diomin

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-06 15:54:47 -05:00
Ian Romanick
b11623a5df glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20
GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30.  Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.

There are some spurious whitespace changes in this commit.  I changed
the layout (and wording) of the error message so that all three cases
would be similar.  The 1.10/1.20 and 1.30 text is the same.  The only
difference is that one is an error, and the other is a warning.  The
GLSL ES 1.00 wording is similar but not quite the same.

Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
2011-01-06 10:07:50 -08:00
Zou Nan hai
bbf7cc1f2a i965: skip too small size mipmap
this fixes doom3 crash.
2011-01-06 11:42:38 +08:00
Xiang, Haihao
4e8f123f14 i965: use BLT to clear buffer if possible on Sandybridge
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32713
(cherry picked from commit 266d8eed69)
2011-01-05 14:12:59 +08:00
Chia-I Wu
f5c1346932 autoconf: Fix --with-driver=xlib --enable-openvg.
st/egl should be enabled with --enable-openvg even the driver is xlib or
osmesa.  Also, GLX_DIRECT_RENDERING should not be defined because libdrm
is not checked.
(cherry picked from commit ada9c78c29)
2011-01-05 11:37:17 +08:00
Chia-I Wu
ebcb7f27e5 docs: Add an example for EGL_DRIVERS_PATH.
EGL_DRIVERS_PATH can be set to test EGL without installation.
(cherry picked from commit cba7786954)
2011-01-05 11:37:12 +08:00
Eric Anholt
52586ceb2b intel: When validating an FBO's combined depth/stencil, use the given FBO.
We were looking at the current draw buffer instead to see whether the
depth/stencil combination matched.  So you'd get told your framebuffer
was complete, until you bound it and went to draw and we decided that
it was incomplete.
(cherry picked from commit b7b2791c6b)
2011-01-04 13:01:42 -08:00
Eric Anholt
438fc337d4 intel: Fix segfaults from trying to use _ColorDrawBuffers in FBO validation.
The _ColorDrawBuffers is a piece of computed state that gets for the
current draw/read buffers at _mesa_update_state time.  However, this
function actually gets used for non-current draw/read buffers when
checking if an FBO is complete from the driver's perspective.  So,
instead of trying to just look at the attachment points that are
currently referenced by glDrawBuffers, look at all attachment points
to see if they're driver-supported formats.  This appears to actually
be more in line with the intent of the spec, too.

Fixes a segfault in my upcoming fbo-clear-formats piglit test, and
hopefully bug #30278
(cherry picked from commit 0ea49380e2)
2011-01-04 13:01:42 -08:00
Eric Anholt
7b6c5804f0 intel: Add a couple of helper functions to reduce rb code duplication.
(cherry picked from commit e339b669a1)
2011-01-04 13:01:42 -08:00
Eric Anholt
29bcf0a940 intel: Add spans code for the ARB_texture_rg support.
This starts spantmp2.h down the path of using MESA_FORMAT_* for
specifying the format instead of the crazy GL format/type combo.
(cherry picked from commit 28bab24e16)
2011-01-04 13:01:42 -08:00
Eric Anholt
fa61cb3609 intel: Use tri clears when we don't know how to blit clear the format.
Bug #32207.  Fixes ARB_texture_rg/fbo-clear-formats (see my
fbo-clear-formats piglit branch currently)
(cherry picked from commit 30fef21aa3)
2011-01-04 13:01:42 -08:00
Eric Anholt
db4e1c44b2 intel: Handle forced swrast clears before other clear bits.
Fixes a potential segfault on a non-native depthbuffer, and possible
accidental swrast fallback on extra color buffers.
(cherry picked from commit 94ed481131)
2011-01-04 13:01:41 -08:00
Eric Anholt
d4ae5f3411 intel: Only do frame throttling at glFlush time when using frontbuffer.
This is the hack for input interactivity of frontbuffer rendering
(like we do for backbuffer at intelDRI2Flush()) by waiting for the n-2
frame to complete before starting a new one.  However, for an
application doing multiple contexts or regular rebinding of a single
context, this would end up lockstepping the CPU to the GPU because
every unbind was considered the end of a frame.

Improves WOW performance on my Ironlake by 48.8% (+/- 2.3%, n=5)
(cherry picked from commit b01b73c482)
2011-01-04 13:01:41 -08:00
Zhenyu Wang
1feecbdb00 i965: Fix provoking vertex select in clip state for sandybridge
Triangle fan provoking vertex for first convention should be
'vertex 1' in sandybridge clip state.

Partly fix glean/clipFlat case
(cherry picked from commit 9977297ad9)
2011-01-04 13:01:41 -08:00
Zhenyu Wang
8847205976 i965: Use last vertex convention for quad provoking vertex on sandybridge
Until we know how hw converts quads to polygon in beginning of
3D pipeline, for now unconditionally use last vertex convention.

Fix glean/clipFlat case.
(cherry picked from commit bea6539abf)
2011-01-04 13:01:41 -08:00
Eric Anholt
8604d91ae4 i965: Do lowering of array indexing of a vector in the FS.
Fixes a regression in ember since switching to the native FS backend,
and the new piglit tests glsl-fs-vec4-indexing-{2,3} for catching this.
(cherry picked from commit df4d83dca4)
2011-01-04 13:01:41 -08:00
Eric Anholt
bba89b3793 i965: Fix regression in FS comparisons on original gen4 due to gen6 changes.
Fixes 26 piglit cases on my GM965.
(cherry picked from commit 54df8e48bc)
2011-01-04 13:01:41 -08:00
Eric Anholt
f4f3274ba3 i965: Factor out the ir comparision to BRW_CONDITIONAL_* code.
(cherry picked from commit 74dffb39c3)
2011-01-04 13:01:41 -08:00
Eric Anholt
7b1200901a i965: Improve the hacks for ARB_fp scalar^scalar POW on gen6.
This is still awful, but my ability to care about reworking the old
backend so we can just get a temporary value into a POW is awfully low
since the new backend does this all sensibly.

Fixes:
fp1-LIT test 1
fp1-LIT test 3 (case x < 0)
fp1-POW test (exponentiation)
fp-lit-mask
(cherry picked from commit d88aa6fe3e)
2011-01-04 13:01:40 -08:00
Tom Stellard
9dfa27c924 r300/compiler: Fix black terrain in Civ4
rc_inst_can_use_presub() wasn't checking for too many RGB sources in
Alpha instructions or too many Alpha sources in RGB instructions.

(cherry picked from commit e96e86d07b)
2011-01-04 11:37:08 -08:00
Kenneth Graunke
b71bff0100 i965: Internally enable GL_NV_blend_square on ES2.
Hopefully should fix bug #32520.
(cherry picked from commit 6bb1e4541e)
2011-01-04 09:47:03 -08:00
Kenneth Graunke
8cfce0c643 i965: Flatten if-statements beyond depth 16 on pre-gen6.
Gen4 and Gen5 hardware can have a maximum supported nesting depth of 16.
Previously, shaders with control flow nested 17 levels deep would
cause a driver assertion or segmentation fault.

Gen6 (Sandybridge) hardware no longer has this restriction.

Fixes fd.o bug #31967.
(cherry picked from commit 634a7dce9c)
2011-01-04 09:46:55 -08:00
Kenneth Graunke
9d3573c905 glsl: Support if-flattening beyond a given maximum nesting depth.
This adds a new optional max_depth parameter (defaulting to 0) to
lower_if_to_cond_assign, and makes the pass only flatten if-statements
nested deeper than that.

By default, all if-statements will be flattened, just like before.

This patch also renames do_if_to_cond_assign to lower_if_to_cond_assign,
to match the new naming conventions.
(cherry picked from commit 9ac6a9b2fa)
2011-01-04 09:46:17 -08:00
Marek Olšák
8d2c910e66 mesa: fix texel store functions for some float formats
These are copy-paste errors obviously.
(cherry picked from commit bf7b6f60ae)
2011-01-04 09:44:11 -08:00
Ian Romanick
f0c2420917 Refresh autogenerated file builtin_function.cpp.
See also a954dbeb.
2011-01-04 09:44:11 -08:00
Kenneth Graunke
83b39afc46 glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).
These mistakenly computed 't' instead of t * t * (3.0 - 2.0 * t).

Also, properly vectorize the smoothstep(float, float, vec) variants.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d7423a6531)
2011-01-04 09:39:01 -08:00
Brian Paul
adb49457c6 st/mesa: fix renderbuffer pointer check in st_Clear()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=30694

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit efbd33aff9)
2011-01-04 08:00:33 -07:00
Kenneth Graunke
9da0e20e46 Remove OES_compressed_paletted_texture from the ES2 extension list.
We don't support it.
(cherry picked from commit d0f8eea9a0)
2011-01-03 14:26:35 -08:00
Brian Paul
07342c84a9 glsl: new glsl_strtod() wrapper to fix decimal point interpretation
We always want to use '.' as the decimal point.

See http://bugs.freedesktop.org/show_bug.cgi?id=24531

NOTE: this is a candidate for the 7.10 branch.
(cherry picked from commit bb10e081c8)
2011-01-03 14:26:17 -08:00
Ian Romanick
3501fd8594 ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors
This is the same as what the array dereference handler does.

Fixes piglit test glsl-link-struct-array (bugzilla #31648).

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2d577ee730)
2011-01-03 14:26:08 -08:00
Ian Romanick
4febfee3b7 linker: Allow built-in arrays to have different sizes between shader stages
Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
(cherry picked from commit cb2b547a47)
2011-01-03 14:25:54 -08:00
Ian Romanick
d3fa3c60f2 glsl: Inherrit type of declared variable from initializer after processing assignment
do_assignment may apply implicit conversions to coerce the base type
of initializer to the base type of the variable being declared.  Fixes
piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
probably also fixes bugzilla #32273.

NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
(cherry picked from commit d7f27e2e76)
2011-01-03 14:25:34 -08:00
Henri Verbeet
4ad4c700bf st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().
(cherry picked from commit 59051ad443)
2010-12-31 07:50:56 +01:00
Fredrik Höglund
aa196d047c r600g: fix pow(0, 0) evaluating to NaN
We have to use the non-IEEE compliant version of MUL here, since
log2(0) is -inf, and 0 * -inf is NaN in IEEE arithmetic.

candidates for 7.10 branch
2010-12-29 11:04:32 -05:00
Alex Deucher
747279c21c r600g: fix rendering with a vertex attrib having a zero stride
The hardware supports zero stride just fine.  This is a port
of 2af8a19831 from r300g.

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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-29 10:59:53 -05:00
richard
0092793735 r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well. 2010-12-29 10:59:00 -05:00
Zhenyu Wang
96685a662f i965: Fix occlusion query on sandybridge
Clear target query buffer fixed occlusion query on sandybridge.

https://bugs.freedesktop.org/show_bug.cgi?id=32167
(cherry picked from commit 689aca7822)
2010-12-29 09:41:52 +08:00
Marek Olšák
7e3c1f221a r300g: mark vertex arrays as dirty after a buffer_offset change
We shouldn't hit this bug in theory.

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit d9b84017e0)
2010-12-28 19:41:46 +01:00
Marek Olšák
1e58915062 r300g/swtcl: re-enable LLVM
Based on a patch from Drill <drill87@gmail.com>.

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 88550083b3)

Conflicts:

	src/gallium/drivers/r300/r300_context.c
2010-12-28 19:41:00 +01:00
Xiang, Haihao
1ca240ec2d i965: don't spawn GS thread for LINELOOP on Sandybridge
LINELOOP is converted to LINESTRIP at the beginning of the 3D pipeline.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32596
(cherry picked from commit b832ae8a4a)
2010-12-28 09:08:24 +08:00
Eric Anholt
d7e5620d6e i965: Add support for gen6 reladdr VS constant loading.
(cherry picked from commit 3a3b1bd722)
2010-12-27 14:30:42 -08:00
Eric Anholt
0bb9a3215e i965: Add support for gen6 constant-index constant loading.
(cherry picked from commit 15566183a6)
2010-12-27 14:30:42 -08:00
Eric Anholt
962ef4cada i965: Set the alternative floating point mode on gen6 VS and WM.
This matches how we did the math instructions pre-gen6, though it
applies to non-math as well.

Fixes vp1-LIT test 2 (degenerate case: 0 ^ 0 -> 1)
(cherry picked from commit c52adfc2e1)
2010-12-27 14:30:42 -08:00
Chris Wilson
a8e34dd8c2 intel: Check for unsupported texture when finishing using as a render target
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 8b9570e685)
2010-12-27 14:30:42 -08:00
Zhenyu Wang
4fd0d556fc i965: explicit tell header present for fb write on sandybridge
Determine header present for fb write by msg length is not right
for SIMD16 dispatch, and if there're more output attributes, header
present is not easy to tell from msg length. This explicitly adds
new param for fb write to say header present or not.

Fixes many cases' hang and failure in GL conformance test.
(cherry picked from commit 4374703a9b)
2010-12-27 14:30:42 -08:00
Eric Anholt
8a908819cc i965: Avoid using float type for raw moves, to work around SNB issue.
The SNB alt-mode math does the denorm and inf reduction even for a
"raw MOV" like we do for g0 message header setup, where we are moving
values that aren't actually floats.  Just use UD type, where raw MOVs
really are raw MOVs.

Fixes glxgears since c52adfc2e1, but no
piglit tests had regressed(!)
(cherry picked from commit 4fe78d3e12)
2010-12-27 14:30:42 -08:00
Eric Anholt
6af8eac21b intel: Support glCopyTexImage() from XRGB8888 to ARGB8888.
The only mismatch between the two is that we have to clear the
destination's alpha to 1.0.  Fixes WOW performance on my Ironlake,
from a few frames a second to almost playable.
(cherry picked from commit 290a1141bc)
2010-12-27 14:30:42 -08:00
Eric Anholt
0874c37195 intel: Try to sanely check that formats match for CopyTexImage.
Before, we were going off of a couple of known (hopeful) matches
between internalFormats and the cpp of the read buffer.  Instead, we
can now just look at the gl_format of the two to see if they match.
We should avoid bad blits that might have been possible before, but
also allow different internalFormats to work without having to
enumerate each one.
(cherry picked from commit ec03b316b4)
2010-12-27 14:30:42 -08:00
Eric Anholt
0874356dbf intel: Drop commented intel_flush from copy_teximage.
The blit that follows appears in the command stream so it's serialized
with previous rendering.  Any queued vertices in the tnl layer were
already flushed up in mesa/main/.
(cherry picked from commit e65c643792)
2010-12-27 14:30:42 -08:00
Eric Anholt
3232019b67 intel: Update renderbuffers before looking up CopyTexImage's read buffer.
Not fixing a particular bug, just noticed by code inspection.
(cherry picked from commit 99c7840b0c)
2010-12-27 14:30:41 -08:00
Zhenyu Wang
fdf27dfdf8 i965: Use MI_FLUSH_DW for blt ring flush on sandybridge
Old MI_FLUSH command is deprecated on sandybridge blt.
(cherry picked from commit 845d651cf6)
2010-12-27 14:30:41 -08:00
Eric Anholt
10757e86f2 i965: Add support for using the BLT ring on gen6.
(cherry picked from commit c27285610c)
2010-12-27 14:30:41 -08:00
Eric Anholt
d62a383d53 i965: Fix gl_FragCoord.z setup on gen6.
Fixes glsl-bug-22603.
(cherry picked from commit 036c817f77)
2010-12-27 14:30:41 -08:00
Eric Anholt
c043c5ae00 i956: Fix the old FP path fragment position setup on gen6.
Fixes fp-arb-fragment-coord-conventions-none
(cherry picked from commit 5fbd8da8df)
2010-12-27 14:30:41 -08:00
Eric Anholt
da4ecaef8a i965: Fix ARL to work on gen6.
RNDD isn't one of the instructions that can do conversion from
execution type to destination type.

Fixes glsl-vs-arrays-3.
(cherry picked from commit 7cec7bf56c)
2010-12-27 14:30:41 -08:00
Eric Anholt
9a6d7d7eb8 intel: Include stdbool so we can stop using GLboolean when we want to.
This requires shuffling the driconf XML macros around, since they use
true and false tokens expecting them to not get expanded to anything.
(cherry picked from commit df9f891544)
2010-12-27 14:30:41 -08:00
Xiang, Haihao
1988cba847 i965: use align1 access mode for instructions with execSize=1 in VS
All operands must be 16-bytes aligned in aligh16 mode. This fixes l_xxx.c
in oglconform.
(cherry picked from commit dc987adc9f)
2010-12-27 08:49:05 +08:00
Xiang, Haihao
8953ac2570 i965: fix register region description
This fixes
 brw_eu_emit.c:179: validate_reg: Assertion `width == 1' failed.
(cherry picked from commit 8249321604)
2010-12-27 08:48:54 +08:00
Xiang, Haihao
639f595fa0 i965: support for two-sided lighting on Sandybridge
VS places color attributes together so that SF unit can fetch the right
attribute according to object orientation. This fixes light issue in
mesa demo geartrain, projtex.
(cherry picked from commit e47eacdc53)
2010-12-27 08:48:30 +08:00
Brian Paul
604009fa77 mesa/meta: fix broken assertion, rename stack depth var
assert(current_save_state < MAX_META_OPS_DEPTH) did not compile.

Rename current_save_state to SaveStackDepth to be more consistent with
the style of the other fields.
(cherry picked from commit 2a4df8933e)
2010-12-27 08:47:43 +08:00
Xiang, Haihao
7e856fd043 meta: allow nested meta operations
_mesa_meta_CopyPixels results in nested meta operations on Sandybridge.
Previoulsy the second meta operation overrides all states saved by the
first meta function.
(cherry picked from commit d1196bbc19)
2010-12-27 08:47:05 +08:00
Chia-I Wu
fd2b11e433 st/egl: Fix eglChooseConfig when configs is NULL.
When configs is NULL, the app wants to know the number of matching
configs.
(cherry picked from commit 9f2062fb12)
2010-12-26 23:39:33 +08:00
Chia-I Wu
662afccabe docs/egl: Update egl.html.
Various updates and a new section about packaging.
(cherry picked from commit 65e8f81110)
2010-12-25 02:57:58 +08:00
Eric Anholt
7d0c7d52e4 i965: Correct the dp_read message descriptor setup on g4x.
It's mostly like gen4 message descriptor setup, except that the sizes
of type/control changed to be like gen5.  Fixes 21 piglit cases on
gm45, including the regressions in bug #32311 from increased VS
constant buffer usage.
(cherry picked from commit 5dc53444c8)
2010-12-23 15:36:48 -08:00
Chia-I Wu
b7c187df9a st/egl: Assorted fixes for dri2_display_get_configs.
Set window_bit only when the visual id is greater than zero.  Correct
visual types.  Skip slow configs as they are not relevant.  Finally, do
not return duplicated configs.
(cherry picked from commit 445cb9e53b)
2010-12-22 16:07:18 +08:00
Chia-I Wu
55fb7269f0 st/egl: Fix eglCopyBuffers.
Flush before presenting.
(cherry picked from commit a31e2e3312)
2010-12-22 14:27:04 +08:00
Chia-I Wu
0dc5b97ddd st/egl: Plug pbuffer leaks.
Unreference validated resources or remove unnecessary validations.
(cherry picked from commit 18bc427ade)
2010-12-22 14:27:01 +08:00
Marek Olšák
612e26e82c r300g: finally fix the texture corruption on r3xx-r4xx
Even though a bound texture stays bound when calling set_fragment_sampler_views,
it must be assigned a new cache region depending on the occupancy of other
texture units.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28800

Thanks to Álmos <aaalmosss@gmail.com> for finding the bug in the code.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit daffaca53e)
2010-12-18 10:19:16 +01:00
Marek Olšák
ed9eed088e r300g: fix rendering with a vertex attrib having a zero stride
The hardware apparently does support a zero stride, so let's use it.

This fixes missing objects in ETQW, but might also fix a ton of other
similar-looking bugs.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit 2af8a19831)
2010-12-16 17:29:46 +01:00
Marek Olšák
ccff6dcf0d r300/compiler: fix swizzle lowering with a presubtract source operand
If a source operand has a non-native swizzle (e.g. the KIL instruction
cannot have a swizzle other than .xyzw), the lowering pass uses one or more
MOV instructions to move the operand to an intermediate temporary with
native swizzles.

This commit fixes that the presubtract information was lost during
the lowering.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit d0990db6bd)
2010-12-16 17:29:32 +01:00
Marek Olšák
c547e230bb r300/compiler: fix LIT in VS
This fixes broken rendering of trees in ETQW. The trees still disappear
for an unknown reason when they are close.

Broken since:
2ff9d4474b
r300/compiler: make lowering passes possibly use up to two less temps

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 9e1fbd3d6e)
2010-12-16 17:29:16 +01:00
Dave Airlie
32218e4cc8 r300g: fixup rs690 tiling stride alignment calculations.
The RS690 memory controller prefers things to be on a different
boundary than the discrete GPUs, we had an attempt to fix this,
but it still failed, this consolidates the stride calculation
into one place and removes the really special case check.

This fixes gnome-shell and 16 piglit tests on my rs690 system.

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

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d19b5cbd31)
2010-12-16 11:51:43 +10:00
Brian Paul
7db3e66ba8 mesa, st/mesa: disable GL_ARB_geometry_shader4
The new GLSL compiler doesn't support geom shaders yet so disable the
GL_ARB_geometry_shader4 extension.  Undo this when geom shaders work again.

NOTE: This is a candidate for the 7.10 branch.

(cherry picked from commit bb7c2691d2)
2010-12-14 16:30:01 -07:00
Brian Paul
ad523d08b5 tnl: a better way to initialize the gl_program_machine memory
This improves commit ef3f7e61b3

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

(cherry picked from commit 6577f753b2)
2010-12-14 16:29:31 -07:00
Brian Paul
7d38797ac9 tnl: Initialize gl_program_machine memory in run_vp.
Fixes piglit valgrind glsl-array-bounds-04 failure (FDO bug 29946).

NOTE:
This is a candidate for the 7.10 branch.
This is a candidate for the 7.9 branch.

(cherry picked from commit ef3f7e61b3)
2010-12-14 16:29:18 -07:00
Brian Paul
d50e8b2276 draw/llvm: don't flush in vs_llvm_delete()
Fixes piglit glx-shader-sharing crash.

When shaders are shared by multiple contexts, the shader's draw context
pointer may point to a previously destroyed context.  Dereferencing the
context pointer will lead to a crash.

In this case, simply removing the flushing code avoids the crash (the
exec and sse shader paths don't flush here either).

There's a deeper issue here, however, that needs examination.  Shaders
should not keep pointers to contexts since contexts might get destroyed
at any time.

NOTE: This is a candidate for the 7.10 branch (after this has been
tested for a while).

(cherry picked from commit becc4bb90c)
2010-12-14 16:28:41 -07:00
Luca Barbieri
0e50c21e24 glsl: Unroll loops with conditional breaks anywhere (not just the end)
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.

However, if breaks are not lowered, they tend to appear at the beginning, so
add support for a conditional break anywhere.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-12-09 16:42:05 -08:00
Kenneth Graunke
13c45c590b glsl: Consider the "else" branch when looking for loop breaks.
Found this bug by code inspection.  Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch.  However, the code actually looked at the
last instruction in the "then" branch twice.
2010-12-09 16:42:05 -08:00
Kenneth Graunke
528fa8ce32 glsl: Clean up code by adding a new is_break() function. 2010-12-09 16:42:05 -08:00
Eric Anholt
b13a2e640f glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.
If you used a constant array index to access the matrix, we'd flag a
bunch of wrong inputs/outputs as being used because the index was
multiplied by matrix columns and the actual used index was left out.

Fixes glsl-mat-attribute.
2010-12-09 14:41:50 -08:00
Eric Anholt
3fb18d6775 intel: Set the swizzling for depth textures using the GL_RED depth mode.
Fixes depth-tex-modes-rg.
2010-12-09 14:41:50 -08:00
Eric Anholt
b4e8ec3a57 intel: Use plain R8 and RG8 for COMPRESSED_RED and COMPRESSED_RG.
Fixes texture-rg.
2010-12-09 14:41:50 -08:00
Vinson Lee
c3ca384e71 i965: Silence uninitialized variable warning.
Fixes this GCC warning.
brw_fs.cpp: In function 'brw_reg brw_reg_from_fs_reg(fs_reg*)':
brw_fs.cpp:3255: warning: 'brw_reg' may be used uninitialized in this function
2010-12-09 14:17:17 -08:00
Vinson Lee
af5f7b3260 r600g: Fix SCons build. 2010-12-09 14:03:58 -08:00
Jerome Glisse
121079bd67 r600g: indentation cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:16:22 -05:00
Jerome Glisse
7055068eea r600g: specialized upload manager
Allow important performance increase by doing hw specific implementation
of the upload manager helper. Drop the range flushing that is not hit with
this code (and wasn't with previous neither). Performance improvement are
mostly visible on slow CPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:05 -05:00
Jerome Glisse
15753cf54d r600g: avoid using pb* helper we are loosing previous cpu cycle with it
r600g is up to a point where all small CPU cycle matter and pb* turn
high on profile. It's mostly because pb try to be generic and thus
trigger unecessary check for r600g driver. To avoid having too much
abstraction & too much depth in the call embedded everythings into
r600_bo. Make code simpler & faster. The performance win highly depend
on the CPU & application considered being more important on slower CPU
and marginal/unoticeable on faster one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:01 -05:00
Fabian Bieler
ef534f3838 glsl: fix lowering conditional returns in subroutines
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass

Fixes piglit tests glsl-functions-5 and glsl-functions-6.
2010-12-09 11:28:06 -08:00
Eric Anholt
834cc8e501 i965: remove unused variable since brw_wm_glsl.c removal. 2010-12-09 11:11:04 -08:00
Eric Anholt
cfcc2ef587 i965: Set render_cache_read_write surface state bit on gen6 constant surfs.
This is said to be required in the spec, even when you aren't doing writes.
2010-12-09 11:11:04 -08:00
Eric Anholt
30f25a1019 i965: Set up the correct texture border color state struct for Ironlake.
This doesn't actually fix border color on Ironlake, but it appears to
be a requirement, and gen6 needs it too.
2010-12-09 10:51:00 -08:00
Eric Anholt
14a9153a32 i965: Clean up VS constant buffer location setup. 2010-12-09 10:51:00 -08:00
Eric Anholt
8fab1c0e2e i965: Fix VS constants regression pre-gen6.
Last minute change for gen6 with 0 used params dropped the multiply.
2010-12-09 10:50:59 -08:00
José Fonseca
cdd4f04f80 llvmpipe: Plug fence leaks. 2010-12-09 16:48:26 +00:00
Shuang He
9946f15d30 mesa: allow GLfixed arrays for OpenGL ES 2.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-09 08:23:54 -07:00
Chia-I Wu
0c0eda393a mesa: Fix glTexCoordPointer with type GL_FIXED.
GL_FIXED is also a legal type for glTexCoordPointer.
2010-12-09 19:37:56 +08:00
Chia-I Wu
2d270ac090 mesa: Fix GL_FIXED arrays.
It is broken since 433e5e6def.
2010-12-09 19:25:05 +08:00
Eric Anholt
05e534e6c4 i965: Drop push-mode reladdr constant loading and always use constant_map.
This eases the gen6 implementation, which can only handle up to 32
registers of constants, while likely not penalizing real apps using
reladdr since all of those I've seen also end up hitting the pull
constant buffer.  On gen6, the constant map means that simple NV VPs
fit under the 32-reg limit and now succeed.  Fixes around 10 testcases.
2010-12-08 22:26:18 -08:00
Alex Deucher
fd543e1f95 radeon: bump mip tree levels to 15
I forgot to bump this when I bumped the tex levels.
2010-12-09 00:16:02 -05:00
Brian Paul
09a5e028a6 mesa: simplify target checking for TexImage functions 2010-12-08 21:38:35 -07:00
Brian Paul
7404fa3f07 mesa: revamp error checking for compressed texture images
Simplify some code, remove unneeded checks, etc.
2010-12-08 21:38:35 -07:00
Chad Versace
f0f2ec4d8a glsl: In ast_to_hir, check sampler array indexing
Raise error if a sampler array is indexed with a non-constant expression.

From section 4.1.7 of the GLSL 1.30 spec:
  "Samplers aggregated into arrays within a shader (using square
  brackets [ ]) can only be indexed with integral constant
  expressions [...]."
2010-12-08 18:53:53 -08:00
Eric Anholt
d547ab150a i965: Drop KIL_NV from the ff/ARB_fp path since it was only used for GLSL. 2010-12-08 11:14:52 -08:00
Eric Anholt
dba6fde08c i965: Use the new pixel mask location for gen6 ARB_fp KIL instructions.
Fixes:
fp-kil
fp-generic/kil-swizzle.
2010-12-08 11:14:35 -08:00
Eric Anholt
39eaacff14 i965: Set the render target index in gen6 fixed-function/ARB_fp path.
Fixes:
fbo-drawbuffers2-blend
fbo-drawbuffers2-colormask
2010-12-08 10:51:04 -08:00
Eric Anholt
4b4dc778b6 i965: Set up the per-render-target blend state on gen6.
This will let us get EXT_draw_buffers2 blending and colormasking working.
2010-12-08 10:50:57 -08:00
Eric Anholt
0d3b8a5cc2 i965: Set up the color masking for the first drawbuffer on gen6.
Fixes glean/maskedClear
2010-12-08 09:53:16 -08:00
Chia-I Wu
d2028ba339 mesa: Do not advertise GL_OES_texture_3D.
GL_OES_texture_3D has a GLSL counterpart.  Since it is not implemented,
GL_OES_texture_3D should not be advertised.
2010-12-08 22:35:40 +08:00
Chia-I Wu
98ee6739d9 vbo: Fix GLES2 glVertexAttrib.
Attribute 0 has no special meaning in GLES2.  Add VertexAttrib4f_nopos
for that purpose and make _es_VertexAttrib* call the new function.

Rename _vbo_* to _es_* to avoid confusion.  These functions are only
used by GLES, and now some of them (_es_VertexAttrib*) even behave
differently than vbo_VertexAttrib*.
2010-12-08 22:19:19 +08:00
Chia-I Wu
9f0d7dd259 vbo: Drop second ATTR macro.
There is no need to have a special version of ATTR for
!FEATURE_beginend, since 81ccb3e2ce.
2010-12-08 22:18:37 +08:00
Brian Paul
7da704ee72 configure: use llvm-config --cppflags instead of --cflags 2010-12-08 06:45:00 -07:00
Brian Paul
c64447f47d mesa: make _mesa_test_proxy_teximage() easier to read 2010-12-07 21:37:20 -07:00
Brian Paul
4ff70b7a8f mesa: consolidate glCompressedTexImage1/2/3D() functions 2010-12-07 21:37:20 -07:00
Brian Paul
1c23b860ce mesa: consolidate glCopyTexSubImage1/2/3D() functions 2010-12-07 21:37:20 -07:00
Brian Paul
11f386fb50 mesa: consolidate glCopyTexImage1/2D() code 2010-12-07 21:37:19 -07:00
Brian Paul
45124e043d mesa: consolidate the glTexSubImage1/2/3D() functions 2010-12-07 21:37:19 -07:00
Brian Paul
35f620d55c mesa: simplify proxy texture code in texture_error_check() 2010-12-07 21:37:19 -07:00
Marek Olšák
c4f9e55d61 r300/compiler: remove at least unused immediates if externals cannot be removed 2010-12-08 04:39:51 +01:00
Marek Olšák
2ff9d4474b r300/compiler: make lowering passes possibly use up to two less temps
CMP may now use two less temps, other non-native instructions may end up
using one less temp, except for SIN/COS/SCS, which I am leaving unchanged
for now.

This may reduce register pressure inside loops, because the register
allocator doesn't do a very good job there.
2010-12-08 04:39:51 +01:00
Marek Olšák
93f2df0760 r300/compiler: handle DPH and XPD in rc_compute_sources_for_writemask
This bug can only be triggered if you put deadcode before native rewrite.
2010-12-08 04:39:50 +01:00
Marek Olšák
95080fb50f r300/compiler: do not print pair/tex/presub program stats for vertex shaders 2010-12-08 04:39:50 +01:00
Marek Olšák
8fac29d49e r300/compiler: cleanup rc_run_compiler 2010-12-08 04:39:50 +01:00
Marek Olšák
2592a8f506 r300/compiler: add a function to query program stats (alu, tex, temps..) 2010-12-08 04:39:50 +01:00
Marek Olšák
431b4c0c84 r300/compiler: don't terminate regalloc if we surpass max temps limit
The same check is already in a later pass (translate_vertex_program).
2010-12-08 04:39:50 +01:00
Eric Anholt
2f07a744f1 i965: Don't try to store gen6 (float) blend constant color in bytes.
Fixes glean/blendFunc
2010-12-07 19:33:47 -08:00
Ian Romanick
002cd2c8d4 linker: Fix regressions caused by previous commit
That's what I get for not running piglit before pushing.

Don't try to patch types of unsized arrays when linking fails.

Don't try to patch types of unsized arrays that are shared between
shader stages.
2010-12-07 19:00:44 -08:00
Ian Romanick
6f53921c4b linker: Ensure that unsized arrays have a size after linking
Fixes piglit test case glsl-vec-array (bugzilla #31908).

NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.
2010-12-07 18:32:16 -08:00
Eric Anholt
b2167a6c01 i965: Fix flipped value of the not-embedded-in-if on gen6.
Fixes:
glean/glsl1-! (not) operator (1, fail)
glean/glsl1-! (not) operator (1, pass)
2010-12-07 17:46:47 -08:00
Ian Romanick
b0fc5103cb glsl: Inherrit type of declared variable from initializer
Types of declared variables and their initializer must match excatly
except for unsized arrays.  Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms.  Now that type
is explicitly copied unconditionally.

Fixes piglit test array-compare-04.vert (bugzilla #32035) and
glsl-array-uniform-length (bugzilla #31985).

NOTE: This is a candidate for the 7.9 branch.
2010-12-07 16:36:44 -08:00
Eric Anholt
7ca7e9b626 i965: Work around gen6 ignoring source modifiers on math instructions.
With the change of extended math from having the arguments moved into
mrfs and handed off through message passing to being directly hooked
up to the EU, it looks like the piece for doing source modifiers
(negate and abs) was left out.

Fixes:
fog-modes
glean/fp1-ARB_fog_exp test
glean/fp1-ARB_fog_exp2 test
glean/fp1-Computed fog exp test
glean/fp1-Computed fog exp2 test
ext_fog_coord-modes
2010-12-07 15:11:27 -08:00
Eric Anholt
2d7dfb8446 i965: Add disabled debug code for dumping out the WM constant payload.
This can significantly ease thinking about the asm.
2010-12-07 15:11:27 -08:00
Ian Romanick
6848e27e14 i965: Correctly emit constants for aggregate types (array, matrix, struct)
Previously the code only handled scalars and vectors.  This new code
is modeled somewhat after similar code in ir_to_mesa.

Reviewed-by: Eric Anholt <eric@anholt.net>
2010-12-07 15:03:14 -08:00
Jerome Glisse
b7617346dc r600g: fix userspace fence against lastest kernel
R6XX GPU doesn't like to have two partial flush writting
back to memory in row without a prior flush of the pipeline.
Add PS_PARTIAL_FLUSH to flush all work between the CP and
the ES, GS, VS, PS shaders.

Thanks a lot to Alban Browaeys (prahal on irc) for investigating
this issue.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 17:54:56 -05:00
Jerome Glisse
69251fc4cd r600g: remove dead code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 16:14:18 -05:00
Eric Anholt
fa0d5a2c5b i965: Always hand the absolute value to RSQ.
gen6 builtin RSQ apparently clamps negative values to 0 instead of
returning the RSQ of the absolute value like ARB_fragment_program
desires and pre-gen6 apparently does.

Fixes:
glean/fp1-RSQ test 2 (reciprocal square root of negative value)
glean/vp1-RSQ test 2 (reciprocal square root of negative value)
2010-12-07 13:13:27 -08:00
Ian Romanick
6d36be508f glsl: Ensure that equality comparisons don't return a NULL IR tree
This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.

NOTE: This is a candidate for the 7.9 branch.
2010-12-07 12:50:38 -08:00
Eric Anholt
72845d206e i965: Handle saturates on gen6 math instructions.
We get saturate as an argument to brw_math() instead of as compile
state, since that's how the pre-gen6 send instructions work.  Fixes
fp-ex2-sat.
2010-12-07 12:21:08 -08:00
Eric Anholt
ed492e9544 i965: Fix comment about gen6_wm_constants.
This is the push constant buffer, not the pull constants.
2010-12-07 12:21:08 -08:00
Kenneth Graunke
bd74101aeb Refresh autogenerated glcpp parser. 2010-12-07 10:52:59 -08:00
Kenneth Graunke
800eed6765 glcpp: Don't emit SPACE tokens in conditional_tokens production.
Fixes glslparsertest defined-01.vert.

Reported-by: José Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2010-12-07 10:52:36 -08:00
Marek Olšák
d8b861987d r300g: also revalidate the SWTCL vertex buffer after its reallocation 2010-12-07 19:26:28 +01:00
Zhenyu Wang
27609a8267 i965: upload WM state for _NEW_POLYGON on sandybridge
Be sure polygon stipple mode is updated. This fixes 'gamma' demo.
2010-12-07 17:05:02 +08:00
Vinson Lee
6ee415cc6d r200: Silence uninitialized variable warning.
Fixes this GCC warning.
r200_maos_arrays.c: In function 'r200EmitArrays':
r200_maos_arrays.c:113: warning: 'emitsize' may be used uninitialized in this function
2010-12-07 00:58:54 -08:00
Xiang, Haihao
5ff6ed2b97 i965: set minimum/maximum Point Width on Sandybridge
It is used for point width on vertex. This fixes mesa demo spriteblast and pointblast.
2010-12-07 16:43:24 +08:00
Vinson Lee
dda3ccba8c mesa: Clean up header file inclusion in viewport.h. 2010-12-07 00:37:48 -08:00
Vinson Lee
dbd3f72662 mesa: Clean up header file inclusion in varray.h. 2010-12-07 00:33:36 -08:00
Vinson Lee
2aa36f78dc mesa: Clean up header file inclusion in transformfeedback.h. 2010-12-07 00:28:57 -08:00
Vinson Lee
8cc3d411ed mesa: Clean up header file inclusion in texrender.h. 2010-12-07 00:19:06 -08:00
Marek Olšák
4953ba6a71 r300g: validate buffers only if any of bound buffers is changed
This prevents needless buffer validation (CS space checking).
2010-12-07 08:46:18 +01:00
Marek Olšák
78068a5fbf r300g: cache packet dwords of 3D_LOAD_VBPNTR in a command buffer if possible
It's not always possible to preprocess the content of 3D_LOAD_VBPNTR
in a command buffer, because the offset to all vertex buffers (which
the packet depends on) is derived from the "start" parameter of draw_arrays
and the "indexBias" parameter of draw_elements, but we can at least lazily
make a command buffer for the case when offset == 0, which should occur
most of the time.
2010-12-07 06:42:05 +01:00
Marek Olšák
857d107bfe u_blitter: use util_is_format_compatible in the assert 2010-12-07 06:22:38 +01:00
Brian Paul
d0b2b8da7d mesa: consolidate glTexImage1/2/3D() code
Something similar could be done for glCopyTex[Sub]Image() and the
compressed texture image functions as well.
2010-12-06 17:10:05 -07:00
Brian Paul
6dca66b620 mesa: set gl_texture_object::_Complete=FALSE in incomplete() 2010-12-06 17:10:05 -07:00
Brian Paul
ecb7cc3319 mesa: test for cube map completeness in glGenerateMipmap()
The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.
2010-12-06 17:10:05 -07:00
Kenneth Graunke
c17c790387 glsl: Properly add functions during lazy built-in prototype importing.
The original lazy built-in importing patch did not add the newly created
function to the symbol table, nor actually emit it into the IR stream.

Adding it to the symbol table is non-trivial since importing occurs when
generating some ir_call in a nested scope.  A new add_global_function
method, backed by new symbol_table code in the previous patch, handles
this.

Fixes bug #32030.
2010-12-06 13:43:22 -08:00
Kenneth Graunke
a8f52647b0 symbol_table: Add support for adding a symbol at top-level/global scope. 2010-12-06 13:43:22 -08:00
Kenneth Graunke
6fae1e4c4d glsl: Factor out code which emits a new function into the IR stream.
A future commit will use the newly created function in a second place.
2010-12-06 13:43:22 -08:00
Jakob Bornecrantz
d72cb9c94d st/mesa: Unbind all constant buffers 2010-12-06 22:10:49 +01:00
Jerome Glisse
e0d554ab78 r600g: remove useless flush map
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Jerome Glisse
afc56b1861 r600g: avoid useless shader rebuild at draw call
Avoid rebuilding constant shader state at each draw call,
factor out spi update that might change at each draw call.
Best would be to update spi only when revealent states
change (likely only flat shading & sprite point).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Jerome Glisse
fa86fc564a r600g: build fetch shader from vertex elements
Vertex elements change are less frequent than draw call, those to
avoid rebuilding fetch shader to often build the fetch shader along
vertex elements. This also allow to move vertex buffer setup out
of draw path and make update to it less frequent.

Shader update can still be improved to only update SPI regs (based
on some rasterizer state like flat shading or point sprite ...).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
José Fonseca
a9fa0f3a2f mesa: Bump the number of bits in the register index.
More than 1023 temporaries were being used for a Cinebench shader before
doing temporary optimization, causing the index value to wrap around to
-1024.
2010-12-06 20:03:51 +00:00
Brian Paul
cae2bb76c1 st/mesa: fix mipmap generation bug
In st_finalize_texture() we were looking at the st_texture_object::
lastLevel field instead of the pipe_resource::last_level field to
determine which resource to store the mipmap in.

Then, in st_generate_mipmap() we need to call st_finalize_texture() to
make sure the destination resource is properly allocated.

These changes fix the broken piglit fbo-generatemipmap-formats test.
2010-12-06 11:01:21 -07:00
Brian Paul
c1095f0b0c mesa/llvm: use llvm-config --cppflags
Use --cppflags instead of --cflags so that we get the -I and -D flags
we want, but not compiler options like -O3.

A similar change should probably be made for autoconf.
2010-12-06 10:11:00 -07:00
Brian Paul
4fc62a074c gallium/util: minor formatting fixes 2010-12-06 09:46:45 -07:00
Brian Paul
b89a731ff2 mesa: add error margin to clip mask debug/check code
When X or Y or Z is close to W the outcome of the floating point clip
test comparision may be different between the C and x86 asm paths.
That's OK; don't report an error.

See fd.o bug 32093
2010-12-06 09:46:01 -07:00
Eric Anholt
4538ce915b i965: Remove INTEL_DEBUG=glsl_force now that there's no brw_wm_glsl.c 2010-12-06 00:14:23 -08:00
Eric Anholt
5ba517baa2 i965: Nuke brw_wm_glsl.c.
It was only used for gen6 fragment programs (not GLSL shaders) at this
point, and it was clearly unsuited to the task -- missing opcodes,
corrupted texturing, and assertion failures hit various applications
of all sorts.  It was easier to patch up the non-glsl for remaining
gen6 changes than to make brw_wm_glsl.c complete.

Bug #30530
2010-12-06 00:14:23 -08:00
Eric Anholt
245662f308 i965: Add support for the instruction compression bits on gen6.
Since the 8-wide first-quarter and 16-wide first-half have the same
bit encoding, we now need to track "do you want instruction
compression" in the compile state.
2010-12-06 00:14:23 -08:00
Eric Anholt
3f8bcb0d99 i965: Align gen6 push constant size to dispatch width.
The FS backend is fine with register level granularity.  But for the
brw_wm_emit.c backend, it expects pairs of regs to be used for the
constants, because the whole world is pairs of regs.  If an odd number
got used, we went looking for interpolation in the wrong place.
2010-12-06 00:14:23 -08:00
Eric Anholt
237aa33c67 i965: Make the sampler's implied move on gen6 be a raw move.
We were accidentally doing a float-to-uint conversion.
2010-12-06 00:14:23 -08:00
Eric Anholt
5340dd8cca i965: Fix up gen6 samplers for their usage by brw_wm_emit.c
We were trying to do the implied move even when we'd already manually
moved the real header in place.
2010-12-06 00:14:22 -08:00
Eric Anholt
ad29e79850 i965: Fix gen6 interpolation setup for 16-wide.
In the SF and brw_fs.cpp fixes to set up interpolation sanely on gen6,
the setup for 16-wide interpolation was left behind.  This brings
relative sanity to that path too.
2010-12-06 00:14:22 -08:00
Eric Anholt
ae0df25ab4 i965: Don't smash a group of coordinates doing gen6 16-wide sampler headers. 2010-12-06 00:14:22 -08:00
Eric Anholt
d1ead22d1b i965: Fix up 16-wide gen6 FB writes after various refactoring. 2010-12-06 00:14:22 -08:00
Eric Anholt
ad35528944 i965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.
Fixes many assertion failures in that path.
2010-12-06 00:14:22 -08:00
Eric Anholt
16f8c82389 i965: Move payload reg setup to compile, not lookup time.
Payload reg setup on gen6 depends more on the dispatch width as well
as the uses_depth, computes_depth, and other flags.  That's something
we want to decide at compile time, not at cache lookup.  As a bonus,
the fragment shader program cache lookup should be cheaper now that
there's less to compute for the hash key.
2010-12-06 00:14:22 -08:00
Chia-I Wu
8f2a974cf2 mapi: Rewrite mapi_abi.py to get rid of preprocessor magic.
The preprocessor magic in mapi was nothing but obfuscation.  Rewrite
mapi_abi.py to generate real C code.

This commit removes the hack added in
43121f2086.
2010-12-06 15:40:37 +08:00
Chia-I Wu
5ae4b6693a egl: _eglFilterArray should not allocate.
Otherwise, when it is called from within a driver, the caller cannot
free the returned data (on Windows).
2010-12-06 15:40:37 +08:00
Zhenyu Wang
2b1469340b i965: Fix GS state uploading on Sandybridge
Need to check the required primitive type for GS on Sandybridge,
and when GS is disabled, the new state has to be issued too, instead
of only updating URB state with no GS entry, that caused hang on Sandybridge.

This fixes hang issue during conformance suite testing.
2010-12-06 15:20:48 +08:00
Xiang, Haihao
08be8d6450 i965: fix for flat shading on Sandybridge
use constant interpolation instead of linear interpolation for
attributes COL0,COL1 if GL_FLAT is used. This fixes mesa demo bounce.
2010-12-06 09:42:28 +08:00
Henri Verbeet
4409435614 r600g: Cleanup fetch shader resources in r600_pipe_shader_destroy(). 2010-12-05 18:44:44 +01:00
Henri Verbeet
308cfb80f5 r600g: Cleanup block bo references in r600_context_fini(). 2010-12-05 18:44:44 +01:00
Marek Olšák
c0c929cdac st/mesa: initialize key in st_vp_varient
This fixes endless vertex shader recompilations in find_translated_vp
if the shader contains an edge flag output.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by Brian Paul <brianp@vmware.com>
2010-12-05 17:38:19 +01:00
Xavier Chantry
ccacabe86c gallium/trace: check bind_vertex_sampler_states and set_vertex_sampler_views
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-12-05 12:12:25 +01:00
Xavier Chantry
e3256ccb04 init ps->context with util_surfaces_get and do_get
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-12-05 12:09:38 +01:00
Xavier Chantry
af5345d937 nvfx: fixes after array textures merge
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-12-05 12:08:00 +01:00
Marek Olšák
66d45567b4 r300g: optimize looping over atoms
This also removes DBG_STATS (the stats can be obtained with valgrind instead).
2010-12-05 05:52:25 +01:00
Marek Olšák
6947e52548 r300g: cleanup winsys 2010-12-05 05:47:10 +01:00
Dave Airlie
c1365606c5 r300g: try and use all of vertex constant space
Finished up by Marek Olšák.

We can set the constant space to use a different area per-call to the shader,
we can avoid flushing the PVS as often as we do by spreading out the constants
across the whole constant space.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-12-05 05:47:03 +01:00
Marek Olšák
1774273bde r300g: do not use the index parameter in set_constant_buffer
It appears to be a constant buffer index (in case there are more constant
buffers explicitly used by a shader), i.e. something that Gallium currently
does not use. We treated it incorrectly as the offset to a constant buffer.
2010-12-05 05:46:56 +01:00
Vinson Lee
e72651dc5d gallium/noop: Add prototype for noop_init_state_functions.
Silences this GCC warning.
noop_state.c:247: warning: no previous prototype for
'noop_init_state_functions'
2010-12-04 17:30:08 -08:00
Eric Anholt
afb80c5315 i965: Fix compile warning about missing opcodes. 2010-12-04 16:27:57 -08:00
Eric Anholt
8f23039f00 i965: Update gen6 SF state on fragment program change too.
SF state depends on what inputs there are to the fragment program, not
just the outputs of the VS.
2010-12-04 16:26:55 -08:00
Eric Anholt
65570d0482 i965: Update gen6 WM state on compiled program change, not just FP change. 2010-12-04 16:26:55 -08:00
Eric Anholt
4ac2f09e20 intel: Add an env var override to execute for a different GPU revision.
Sometimes I'm on the train and want to just read what's generated
under INTEL_DEBUG=vs,wm for some code on another generation.  Or, for
the next gen enablement we'll want to dump aub files before we have
the actual hardware.  This will let us do that.
2010-12-04 16:26:55 -08:00
Chia-I Wu
859106f196 st/vega: Fix pipe blend state for various blend modes.
rgb_src_factor and rgb_dst_factor should be PIPE_BLENDFACTOR_ONE for
VG_BLEND_SRC_IN and VG_BLEND_DST_IN respectively.  VG_BLEND_SRC_OVER can
be supported only when the fb has no alpha channel.  VG_BLEND_DST_OVER
and VG_BLEND_ADDITIVE have to be supported with a shader.

Note that Porter-Duff blending rules assume premultiplied alpha.
2010-12-04 23:46:38 +08:00
Chia-I Wu
0ee73edecc st/vega: Add blend shaders for all blend modes. 2010-12-04 23:41:35 +08:00
Chia-I Wu
5d24411140 st/vega: Fix VG_BLEND_MULTIPLY.
TEMP[1].w will be needed for OUT.w just below.  Use TEMP[0] to store the
intermediate value.
2010-12-04 23:41:30 +08:00
Vinson Lee
09fba30fde mesa: Clean up header file inclusion in texobj.h. 2010-12-04 01:29:50 -08:00
Vinson Lee
f657ac951d mesa: Clean up header file inclusion in texgetimage.h. 2010-12-04 01:20:28 -08:00
Vinson Lee
0ed245bd57 mesa: Clean up header file inclusion in texformat.h. 2010-12-04 01:11:33 -08:00
Vinson Lee
f8a9f5458b mesa: Clean up header file inclusion in texenvprogram.h. 2010-12-04 01:03:52 -08:00
Vinson Lee
f618f4549a mesa: Clean up header file inclusion in texcompress_s3tc.h. 2010-12-04 01:00:21 -08:00
Vinson Lee
8aa4cd0e50 st/vega: Silence uninitialized variable warning.
Fixes this GCC warning.
api_filters.c: In function 'execute_filter':
api_filters.c:184: warning: 'tex_wrap' may be used uninitialized in this function
2010-12-04 00:53:44 -08:00
Vinson Lee
3132591a4d mesa: Clean up header file inclusion in texcompress.h. 2010-12-04 00:52:14 -08:00
Chia-I Wu
e87a0cd260 st/vega: Blending should use premultiplied alpha.
Convert color values to and back from premultiplied form for blending.
Finally the rendering result of the blend demo looks much closer to that
of the reference implementation.
2010-12-04 15:44:40 +08:00
Chia-I Wu
e8ff3931f8 st/vega: Add support for per-channel alpha.
Drawing an image in VG_DRAW_IMAGE_STENCIL mode produces per-channel
alpha for use in blending.  Add a new shader stage to produce and save
it in TEMP[1].

For other modes that do not need per-channel alpha, the stage does

  MOV TEMP[1], TEMP[0].wwww
2010-12-04 13:20:38 +08:00
Chia-I Wu
a19eaaa6c1 st/vega: Move masking after blending.
Masking should happen after blending.  The shader is not entirely
correct, but leave it as is for now.
2010-12-04 13:20:38 +08:00
Chia-I Wu
3b4c888653 st/vega: Refactor blend shaders.
Add a helper function, blend_generic, that supports all blend modes and
per-channel alpha.  Make other blend generators a wrapper to it.

Both the old and new code expects premultiplied colors, yet the input is
non-premultiplied.  Per-channel alpha is also not used for stencil
image.  They still need to be fixed.
2010-12-04 13:20:32 +08:00
Chia-I Wu
a09baf1668 st/vega: Add some comments to pipeline shaders. 2010-12-04 13:19:29 +08:00
Brian Paul
6c33e820d5 st/mesa: new comment about updating state vars 2010-12-03 17:07:16 -07:00
Brian Paul
64244dfd39 mesa: update comments, remove dead code 2010-12-03 16:45:44 -07:00
Brian Paul
6f851e6642 mesa: remove unneeded cast 2010-12-03 16:40:36 -07:00
Brian Paul
503983b09e mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM
In find_value() check if we've hit the 0th/invalid entry before checking
if the pname matches.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31987

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 16:04:26 -07:00
Brian Paul
40ee69b4f3 swrast: restructure some glReadPixels() code 2010-12-03 15:26:31 -07:00
Brian Paul
5fc2548fae swrast: accept GL_RG in glReadPixels()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32088
2010-12-03 15:26:31 -07:00
Kenneth Graunke
b7acf538af ir_print_visitor: Print out constant structure values.
In the form (constant type ((field1 value) (field2 value) ...))
2010-12-03 13:59:21 -08:00
Brian Paul
8d6a0dc7f3 swrast: fix indentation 2010-12-03 14:49:19 -07:00
Brian Paul
75746e3779 swrast: allow GL_RG format in glDrawPixels()
Restructure the switch statement to avoid having to add additional
color formats in the future.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32086
2010-12-03 14:48:03 -07:00
Brian Paul
b87369e863 mesa: consolidate some compiler -D flags
-D__STDC_CONSTANT_MACROS and -D__STDC_LIMIT_MACROS are only needed for
LLVM build.
2010-12-03 13:52:59 -07:00
Marek Olšák
9f7f093090 r300g: one more r500_index_bias_supported leftover 2010-12-03 20:59:55 +01:00
Marek Olšák
536d527020 r300g: add capability bit index_bias_supported
.. instead of calling r500_index_bias_supported(..) every draw call.
2010-12-03 20:34:56 +01:00
Jerome Glisse
edda44e0dc r600g: more indentation fix + warning silencing + dead code removal
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 13:06:53 -05:00
Jerome Glisse
119f00659c r600g: indentation fix
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 12:56:51 -05:00
Jerome Glisse
0b841b0349 r600g: update polygon offset only when rasterizer or zbuffer change
Aim is to build as little state as possible in draw functions.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 12:45:19 -05:00
Brian Paul
dbf996f308 llvmpipe: fix broken stencil writemask
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32070
2010-12-03 09:44:30 -07:00
Fabian Bieler
cd431a12bf r600g: set address of pop instructions to next instruction 2010-12-03 11:35:44 -05:00
Jerome Glisse
833f3a488a r600g: dump raw shader output for debugging
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 11:35:36 -05:00
Brian Paul
6d13ec7dc0 mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type
If querying the default/window-system FBO's attachment type, return
GL_FRAMEBUFFER_DEFAULT (per the GL_ARB_framebuffer_object spec).

See http://bugs.freedesktop.org/show_bug.cgi?id=31947

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 08:32:29 -07:00
Brian Paul
20cf1851d8 mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query
Return 0 instead of generating an error.

See http://bugs.freedesktop.org/show_bug.cgi?id=30993

Note that piglit fbo-getframebufferattachmentparameter-01 still does
not pass.  But Mesa behaves the same as the NVIDIA driver in this case.
Perhaps the test is incorrect.

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 08:24:51 -07:00
Brian Paul
14746b1d4f gallivm: fix null builder pointers 2010-12-03 07:38:02 -07:00
Chia-I Wu
5be631ce83 st/vega: Add a missing break. 2010-12-03 14:55:29 +08:00
Chia-I Wu
a84a1e344f st/vega: Move vertex transformation to shader.
It was done in path-to-polygon conversion.  That meant that the
results were invalidated when the transformation was modified, and CPU
had to recreate the vertex buffer with new vertices.  It could be a
performance hit for apps that animate.
2010-12-03 14:23:04 +08:00
Chia-I Wu
29bea39fde st/vega: Set pipe_resource::array_size to 1. 2010-12-03 14:22:32 +08:00
Chia-I Wu
9028f24b8a st/egl: Set pipe_resource::array_size to 1. 2010-12-03 14:22:32 +08:00
Marek Olšák
a60a5b850b r300g: do not remove unused constants if we are not near the limit 2010-12-03 06:32:10 +01:00
Marek Olšák
b088b255ec r300g: fix pointer arithmetic with void* in transfer_inline_write 2010-12-03 06:08:50 +01:00
Marek Olšák
d531f9c2f5 mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium
gl_FragCoord.y needs to be flipped upside down if a FBO is bound.

This fixes:
- piglit/fbo-fragcoord
- https://bugs.freedesktop.org/show_bug.cgi?id=29420

Here I add a new program state STATE_FB_WPOS_Y_TRANSFORM, which is set based
on whether a FBO is bound. The state contains a pair of transformations.
It can be either (XY=identity, ZW=transformY) if a FBO is bound,
or (XY=transformY, ZW=identity) otherwise, where identity = (1, 0),
transformY = (-1, height-1).

A classic driver (or st/mesa) may, based on some other state, choose whether
to use XY or ZW, thus negate the conditional "if (is a FBO bound) ...".
The reason for this is that a Gallium driver is allowed to only support WPOS
relative to either the lower left or the upper left corner, so we must flip
the Y axis accordingly again. (the "invert" parameter in emit_wpos_inversion)

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-03 05:56:40 +01:00
Marek Olšák
6a46fce14f r300g: implement simple transfer_inline_write for buffers
r600g might need something like that as well. This speeds up constant buffer
upload a bit.
2010-12-03 05:44:47 +01:00
Marek Olšák
3ba8843307 r300g: use internal BO handle for add_buffer and write_reloc
Small perf improvement in ipers.

radeon_drm_get_cs_handle is exactly what this commit tries to avoid
in every write_reloc.
2010-12-03 04:40:22 +01:00
Brian Paul
6299f241e9 gallivm/llvmpipe: remove lp_build_context::builder
The field was redundant.  Use the gallivm->builder value instead.
2010-12-02 18:11:16 -07:00
Brian Paul
36b09b5ded mesa: replace more MAX_WIDTH stack allocations with heap allocations 2010-12-02 18:07:03 -07:00
Marek Olšák
0c9a63db09 r300g: fix build 2010-12-03 00:54:41 +01:00
nobled
39c436a1a2 r300g: Drop unnecessary cast 2010-12-03 00:50:58 +01:00
nobled
7ed65f462a r300g: Abort if draw_create() fails
The other drivers need to be updated to do this, too.
2010-12-03 00:50:58 +01:00
nobled
d5bf231806 r300g: Abort if atom allocations fail 2010-12-03 00:50:58 +01:00
Ben Skeggs
a25cea19f2 nv50: silence some unknown get_param warnings
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 08:23:44 +10:00
Brian Paul
77ea102735 st/mesa: avoid large stack allocations in readpixels code 2010-12-02 14:29:07 -07:00
Brian Paul
aa28efe60d swrast: avoid large stack allocations in tex combine code 2010-12-02 14:29:07 -07:00
Brian Paul
25662f878e swrast: avoid large stack allocations in blend code 2010-12-02 14:29:07 -07:00
Brian Paul
2addcb7b50 mesa: replace large/MAX_WIDTH stack allocations with heap allocations 2010-12-02 14:29:01 -07:00
Brian Paul
896a08bde6 mesa: replace large/MAX_WIDTH stack allocations with heap allocations 2010-12-02 14:26:55 -07:00
Alex Deucher
fae7cb8ed8 r600g: bump texture/cb limits appropriately for evergreen 2010-12-02 16:11:08 -05:00
Alex Deucher
a3dc947057 r600c: bump texture limits to hw limits 2010-12-02 16:11:07 -05:00
Zack Rusin
e737b9294a gallium/util: add states relevant to geometry shaders 2010-12-02 15:50:15 -05:00
José Fonseca
64da9a1a04 mesa: Temporary hack to prevent stack overflow on windows
e.g. st_readpixels is trying to alloca() an huge ammount of memory from
the stack.
2010-12-02 20:30:59 +00:00
José Fonseca
63df5a464e wgl: Fix visual's buffer_mask configuration. 2010-12-02 20:21:39 +00:00
José Fonseca
43121f2086 mapi: Hack to avoid vgCreateFont being generated as vgCreateFontA.
Right fix is probably stop C-preprocessor abuse and stick 100% with
scripted code generation.
2010-12-02 19:39:55 +00:00
Eric Anholt
43491adc44 mesa: Add getters for ARB_copy_buffer's attachment points.
Fixes more complaints by oglconform.
2010-12-02 10:28:55 -08:00
Eric Anholt
7cba339375 mesa: Add getters for the rest of the supported draw buffers.
MAX_DRAW_BUFFERS is 8, so allow all 8 GL_DRAW_BUFFER# to be retrieved.
Fixes complaints by oglconform.
2010-12-02 10:28:52 -08:00
Eric Anholt
b381eff141 glsl: Fix flipped return of has_value() for array constants.
Fixes glsl-array-uniform.
2010-12-02 10:28:51 -08:00
José Fonseca
e3659329e0 WIN32_THREADS -> WIN32
Fixes nasty bug where some parts of the code didn't define WIN32_THREADS
and were using the integer mutex implementation, causing even confusion
to the debuggers.

And there is little interest of other thread implemenation on Win32
besides Win32 threads.
2010-12-02 17:35:03 +00:00
Brian Paul
af4f75c8fe softpipe: increase max texture size to 16K 2010-12-02 10:10:05 -07:00
Brian Paul
4b08f35487 mesa: raise max texture sizes to 16K
This allows 16K x 16K 2D textures, for example, but we don't want to
allow that for 3D textures.  The new gl_constants::MaxTextureMBytes
field is used to prevent allocating too large of texture image.
This allows a 16K x 32 x 32 3D texture, for example, but prevents 16K^3.
Drivers can override this limit.  The default is currently 1GB.

Apps should use the proxy texture mechanism to determine the actual
max texture size.
2010-12-02 10:09:03 -07:00
Marek Olšák
23390e2f5c r300/compiler: disable the swizzle lowering pass in vertex shaders
It was a no-op because all swizzles are native there.
2010-12-02 17:48:08 +01:00
José Fonseca
14e2dc9c66 wgl: Unreference the current framebuffer after the make_current call.
To prevent a dangling pointer dereference.
2010-12-02 16:28:36 +00:00
José Fonseca
63c05c96e7 util: Don't try to use imagehlp on mingw. 2010-12-02 15:14:58 +00:00
José Fonseca
50a52ba67e util: __builtin_frame_address() doesn't work on mingw. 2010-12-02 15:14:58 +00:00
José Fonseca
744ef8721b util: Plug leaks in util_destroy_gen_mipmap. 2010-12-02 15:14:58 +00:00
José Fonseca
e5ffa9aa47 wgl: Fix double free. Remove dead code. 2010-12-02 15:14:58 +00:00
Marek Olšák
f3021c688f r300g: fix up cubemap texture offset computation
Broken since 4c70014626.
2010-12-02 14:44:28 +01:00
José Fonseca
431c478df9 util: C++ safe. 2010-12-02 12:26:55 +00:00
José Fonseca
27ba2eb33b retrace: Some fixes. 2010-12-02 12:17:07 +00:00
Chia-I Wu
cb2791213a st/vega: polygon_array requires a deep free.
A polygon array is an array of pointers to polygons.  The polygons
should be freed with the array.
2010-12-02 17:54:23 +08:00
Chia-I Wu
b950d6fa5d st/vega: Destroy the pipe context with vg_context. 2010-12-02 17:27:38 +08:00
Chad Versace
7528f143df glsl: Fix linker bug in cross_validate_globals()
Cause linking to fail if a global has mismatching invariant qualifiers.

See https://bugs.freedesktop.org/show_bug.cgi?id=30261
2010-12-01 20:40:07 -08:00
Roland Scheidegger
4c70014626 gallium: support for array textures and related changes
resources have a array_size parameter now.
get_tex_surface and tex_surface_destroy have been renamed to create_surface
and surface_destroy and moved to context, similar to sampler views (and
create_surface now uses a template just like create_sampler_view). Surfaces
now really should only be used for rendering. In particular they shouldn't be
used as some kind of 2d abstraction for sharing a texture. offset/layout fields
don't make sense any longer and have been removed, width/height should go too.
surfaces and sampler views now specify a layer range (for texture resources),
layer is either array slice, depth slice or cube face.
pipe_subresource is gone array slices (or cube faces) are now treated the same
as depth slices in transfers etc. (that is, they use the z coord of the
respective functions).

Squashed commit of the following:

commit a45bd509014743d21a532194d7b658a1aeb00cb7
Merge: 1aeca28 32e1e59
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 04:32:06 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_resource_texture.c
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/drivers/i915/i915_surface.c

commit 1aeca287a827f29206078fa1204715a477072c08
Merge: 912f042 6f7c8c3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 00:37:11 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/state_trackers/vega/api_filters.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/mask.c
    	src/gallium/state_trackers/vega/paint.c
    	src/gallium/state_trackers/vega/renderer.c
    	src/gallium/state_trackers/vega/st_inlines.h
    	src/gallium/state_trackers/vega/vg_context.c
    	src/gallium/state_trackers/vega/vg_manager.c

commit 912f042e1d439de17b36be9a740358c876fcd144
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 03:01:55 2010 +0100

    gallium: even more compile fixes after merge

commit 6fc95a58866d2a291def333608ba9c10c3f07e82
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 00:22:26 2010 +0100

    gallium: some fixes after merge

commit a8d5ffaeb5397ffaa12fb422e4e7efdf0494c3e2
Merge: f7a202f 2da02e7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 30 23:41:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/vg_context.c

commit f7a202fde2aea2ec78ef58830f945a5e214e56ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 19:19:32 2010 +0100

    gallium: even more fixes/cleanups after merge

commit 6895a7f969ed7f9fa8ceb788810df8dbcf04c4c9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 03:07:36 2010 +0100

    gallium: more compile fixes after merge

commit af0501a5103b9756bc4d79167bd81051ad6e8670
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 19:24:45 2010 +0100

    gallium: lots of compile fixes after merge

commit 0332003c2feb60f2a20e9a40368180c4ecd33e6b
Merge: 26c6346 b6b91fa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 17:02:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/gallivm/lp_bld_sample.c
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/auxiliary/util/u_inlines.h
    	src/gallium/auxiliary/util/u_surface.c
    	src/gallium/auxiliary/util/u_surfaces.c
    	src/gallium/docs/source/context.rst
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/nv50/nv50_state_validate.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.h
    	src/gallium/drivers/nvfx/nvfx_buffer.c
    	src/gallium/drivers/nvfx/nvfx_miptree.c
    	src/gallium/drivers/nvfx/nvfx_resource.c
    	src/gallium/drivers/nvfx/nvfx_resource.h
    	src/gallium/drivers/nvfx/nvfx_state_fb.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_buffer.c
    	src/gallium/drivers/r600/r600_context.h
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/include/pipe/p_defines.h
    	src/gallium/state_trackers/egl/common/egl_g3d_api.c
    	src/gallium/state_trackers/glx/xlib/xm_st.c
    	src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c
    	src/gallium/targets/libgl-gdi/libgl_gdi.c
    	src/gallium/tests/graw/tri.c
    	src/mesa/state_tracker/st_cb_blit.c
    	src/mesa/state_tracker/st_cb_readpixels.c

commit 26c6346b385929fba94775f33838d0cceaaf1127
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:37:21 2010 +0200

    fix more merge breakage

commit b30d87c6025eefe7f6979ffa8e369bbe755d5c1d
Merge: 9461bf3 1f1928d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:15:38 2010 +0200

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_rast_priv.h
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_screen_buffer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_texture.h
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/drivers/r600/r600_texture.h
    	src/gallium/state_trackers/dri/common/dri1_helper.c
    	src/gallium/state_trackers/dri/sw/drisw.c
    	src/gallium/state_trackers/xorg/xorg_exa.c

commit 9461bf3cfb647d2301364ae29fc3084fff52862a
Merge: 17492d7 0eaccb3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 15 20:13:45 2010 +0200

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_surface.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/tests/trivial/quad-tex.c

commit 17492d705e7b7f607b71db045c3bf344cb6842b3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Jun 18 10:58:08 2010 +0100

    gallium: rename element_offset/width fields in views to first/last_element

    This is much more consistent with the other fields used there
    (first/last level, first/last layer).
    Actually thinking about removing the ugly union/structs again and
    rename first/last_layer to something even more generic which could also
    be used for buffers (like first/last_member) without inducing headaches.

commit 1b717a289299f942de834dcccafbab91361e20ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 14:46:09 2010 +0100

    gallium: remove PIPE_SURFACE_LAYOUT_LINEAR definition

    This was only used by the layout field of pipe_surface, but this
    driver internal stuff is gone so there's no need for this driver independent
    layout definition neither.

commit 10cb644b31b3ef47e6c7b55e514ad24bb891fac4
Merge: 5691db9 c85971d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 12:20:41 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/docs/source/glossary.rst
    	src/gallium/tests/graw/fs-test.c
    	src/gallium/tests/graw/gs-test.c

commit 5691db960ca3d525ce7d6c32d9c7a28f5e907f3b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 11:29:03 2010 +0100

    st/wgl: fix interface changes bugs

commit 2303ec32143d363b46e59e4b7c91b0ebd34a16b2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:32 2010 +0100

    gallium: adapt code to interface changes...

commit dcae4f586f0d0885b72674a355e5d56d47afe77d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:05 2010 +0100

    gallium: separate depth0 and array_size in the resource itself.

    These fields are still mutually exclusive (since no 3d array textures exist)
    but it ultimately seemed to error-prone to adapt all code accept the new
    meaning of depth0 (drivers stick that into hardware regs, calculate mipmap
    sizes etc.). And it isn't really cleaner anyway.
    So, array textures will have depth0 of 1, but instead use array_size,
    3D textures will continue to use depth0 (and have array_size of 1). Cube
    maps also will use array_size to indicate their 6 faces, but since all drivers
    should just be fine by inferring this themselves from the fact it's a cube map
    as they always used to nothing should break.

commit 621737a638d187d208712250fc19a91978fdea6b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:47:38 2010 +0100

    gallium: adapt code to interface changes

    There are still usages of pipe_surface where pipe_resource should be used,
    which should eventually be fixed.

commit 2d17f5efe166b2c3d51957c76294165ab30b8ae2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:46:14 2010 +0100

    gallium: more interface changes

    In particular to enable usage of buffers in views, and ability to use a
    different pipe_format in pipe_surface.
    Get rid of layout and offset parameter in pipe_surface - the former was
    not used in any (public) code anyway, and the latter should either be computed
    on-demand or driver can use subclass of pipe_surface.
    Also make create_surface() use a template to be more consistent with
    other functions.

commit 71f885ee16aa5cf2742c44bfaf0dc5b8734b9901
Merge: 3232d11 8ad410d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 14:19:51 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_box.h
    	src/gallium/drivers/nv50/nv50_surface.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/include/pipe/p_state.h

commit 3232d11fe3ebf7686286013c357b404714853984
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:40:04 2010 +0100

    mesa/st: adapt to interface changes

    still need to fix pipe_surface sharing
    (as that is now per-context).
    Also broken is depth0 handling - half the code assumes
    this is also used for array textures (and hence by extension
    of that cube maps would have depth 6), half the code does not...

commit f433b7f7f552720e5eade0b4078db94590ee85e1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:35:52 2010 +0100

    gallium: fix a couple of bugs in interface chnage fixes

commit 818366b28ea18f514dc791646248ce6f08d9bbcf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:42:11 2010 +0200

    targets: adapt to interface changes

    Yes even that needs adjustments...

commit 66c511ab1682c9918e0200902039247793acb41e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:41:13 2010 +0200

    tests: adapt to interface changes

    Everything needs to be fixed :-(.

commit 6b494635d9dbdaa7605bc87b1ebf682b138c5808
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:39:50 2010 +0200

    st: adapt non-rendering state trackers to interface changes

    might not be quite right in all places, but they really don't want
    to use pipe_surface.

commit 00c4289a35d86e4fe85919ec32aa9f5ffe69d16d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:38:48 2010 +0200

    winsys: adapt to interface changes

commit 39d858554dc9ed5dbc795626fec3ef9deae552a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:54 2010 +0200

    st/python: adapt to interface changes

    don't think that will work, sorry.

commit 6e9336bc49b32139cec4e683857d0958000e15e3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:07 2010 +0200

    st/vega: adapt to interface changes

commit e07f2ae9aaf8842757d5d50865f76f8276245e11
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:25:56 2010 +0200

    st/xorg: adapt to interface changes

commit 05531c10a74a4358103e30d3b38a5eceb25c947f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:53 2010 +0200

    nv50: adapt to interface changes

commit 97704f388d7042121c6d496ba8c003afa3ea2bf3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:45 2010 +0200

    nvfx: adapt to interface changes

commit a8a9c93d703af6e8f5c12e1cea9ec665add1abe0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:01 2010 +0200

    i965g: adapt to interface changes

commit 0dde209589872d20cc34ed0b237e3ed7ae0e2de3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:22:38 2010 +0200

    i915g: adapt to interface changes

commit 5cac9beede69d12f5807ee1a247a4c864652799e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:58 2010 +0200

    svga: adapt to interface changes

    resource_copy_region still looking fishy.
    Was not very suited to unified zslice/face approach...

commit 08b5a6af4b963a3e4c75fc336bf6c0772dce5150
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:01 2010 +0200

    rbug: adapt to interface changes

    Not sure if that won't need changes elsewhere?

commit c9fd24b1f586bcef2e0a6e76b68e40fca3408964
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:31 2010 +0200

    trace: adapt to interface changes

commit ed84e010afc5635a1a47390b32247a266f65b8d1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:21 2010 +0200

    failover: adapt to interface changes

commit a1d4b4a293da933276908e3393435ec4b43cf201
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:12 2010 +0200

    identity: adapt to interface changes

commit a8dd73e2c56c7d95ffcf174408f38f4f35fd2f4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:55 2010 +0200

    softpipe: adapt to interface changes

commit a886085893e461e8473978e8206ec2312b7077ff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:44 2010 +0200

    llvmpipe: adapt to interface changes

commit 70523f6d567d8b7cfda682157556370fd3c43460
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:14 2010 +0200

    r600g: adapt to interface changes

commit 3f4bc72bd80994865eb9f6b8dfd11e2b97060d19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:05 2010 +0200

    r300g: adapt to interface changes

commit 5d353b55ee14db0ac0515b5a3cf9389430832c19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:17:37 2010 +0200

    cell: adapt to interface changes

    not even compile tested

commit cf5d03601322c2dcb12d7a9c2f1745e2b2a35eb4
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:14:59 2010 +0200

    util: adapt to interface changes

    amazing how much code changes just due to some subtle interface changes?

commit dc98d713c6937c0e177fc2caf23020402cc7ea7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:12:40 2010 +0200

    gallium: more interface fail, docs

    this also changes flush_frontbuffer to use a pipe_resource instead of
    a pipe_surface - pipe_surface is not meant to be (or at least no longer)
    an abstraction for standalone 2d images which get passed around.
    (This has also implications for the non-rendering state-trackers.)

commit 08436d27ddd59857c22827c609b692aa0c407b7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 10 17:42:52 2010 +0200

    gallium: fix array texture interface changes bugs, docs

commit 4a4d927609b62b4d7fb9dffa35158afe282f277b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 3 22:02:44 2010 +0200

    gallium: interface changes for array textures and related cleanups

    This patch introduces array textures to gallium (note they are not immediately
    usable without the associated changes to the shader side).
    Also, this abandons pipe_subresource in favor of using level and layer
    parameters since the distinction between several faces (which was part of
    pipe_subresource for cube textures) and several z slices (which were not part
    of pipe_subresource but instead part of pipe_box where appropriate for 3d
    textures) is gone at the resource level.
    Textures, be it array, cube, or 3d, now use a "unified" set of parameters,
    there is no distinction between array members, cube faces, or 3d zslices.
    This is unlike d3d10, whose subresource index includes layer information for
    array textures, but which considers all z slices of a 3d texture to be part
    of the same subresource.
    In contrast to d3d10, OpenGL though reuses old 2d and 3d function entry points
    for 1d and 2d array textures, respectively, which also implies that for instance
    it is possible to specify all layers of a 2d array texture at once (note that
    this is not possible for cube maps, which use the 2d entry points, although
    it is possible for cube map arrays, which aren't supported yet in gallium).
    This should possibly make drivers a bit simpler, and also get rid of mutually
    exclusive parameters in some functions (as z and face were exclusive), one
    potential downside would be that 3d array textures could not easily be supported
    without reverting this, but those are nowhere to be seen.

    Also along with adjusting to new parameters, rename get_tex_surface /
    tex_surface_destroy to create_surface / surface_destroy and move them from
    screen to context, which reflects much better what those do (they are analogous
    to create_sampler_view / sampler_view_destroy).

    PIPE_CAP_ARRAY_TEXTURES is used to indicate if a driver supports all of this
    functionality (that is, both sampling from array texture as well as use a range
    of layers as a render target, with selecting the layer from the geometry shader).
2010-12-02 04:33:43 +01:00
Xiang, Haihao
32e1e59146 i965: add support for polygon mode on Sandybridge.
This fixes some mesa demos such as fslight/engine in wireframe mode.
2010-12-02 09:54:35 +08:00
Jakob Bornecrantz
de3ff5af49 i915g: Make sure that new vbo gets updated
Malloc likes to reuse old address as soon as possible this would cause the
new vbo buffer to get the same address as the old. So make sure we set it to
NULL when we allocate a new one. This fixes ipers which will fill up a couple
of VBO buffers per frame.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Jakob Bornecrantz
442e567aa0 i915g: Improve debug printing for textures
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Chris Wilson
f6476822a0 i915g: Fix closure of full batch buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: incorporate comments by Dr_Jakob]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter
600454084b i915g: track TODO items
Just as a reminder for all things currently broken with i915g.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter
0246b2bf27 i915g: assert(depth_surface->offset == 0)
Shouldn't happen and not supported, anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter
1a47a25d2c i915g: enable x-tiling for render targets
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
8af684e37e i915g: switch rendering to mipmapped textures to (x,y) offsets
Byte offsets simply don't work with tiled render targets when using
tiling bits. Luckily we can cox the hw into doing the right thing
with the DRAWING_RECT command by disabling the drawing rect offset
for the depth buffer.

Minor fixes by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
9493fe85d1 i915g: enable X-tiling for textures
Tiling is rather fragile in general and results in pure blackness when
unlucky.  Hence add a new option to disable tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
32345610cc i915g: don't pot-align stride for tiled buffers
libdrm will do this for us, if it's required (i.e. if tiling is
possible).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
6ae6e0c6fe i915g: postpone mipmap/face offset calculation
libdrm-intel can refuse to tile buffers for various reasons. For
potentially tiled buffers the stride is therefore only known after
the iws->buffer_create_tiled call. Unconditionally rounding up to whatever
tiling requires wastes space, so rework the code to not use tex->stride
in the layout code.

Luckily only the mimap/face offset calculation uses it which can easily
be solved by storing an (x, y) coordinate pair. Furthermore this will
be usefull later for properly supporting rendering into the different
levels of tiled mipmap textures.

v2: switch to nblocks(x|y): More in line with gallium and better
suited for rendering into mipmap textures.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
f34fd58ec9 i915g: implement unfenced relocs for textures using tiling bits
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
a95e694eaf i915g: implement unfenced color&depth buffer using tiling bits
v2: Clarify tiling bit calculation as suggested by Chris Wilson.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
2ff0879a63 i915g: return tiling in iws->buffer_from_handle
This is needed to properly implement tiling flags. And the gem
implemention fo buffer_from_handle already calls get_tiling, so
it's for free.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
135b083461 i915g: prepare winsys/batchbuffer for execbuf2
Wire up a fenced parameter, switch all relocations to _FENCED

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
1c60840338 i915g: switch to tiled allocations, kill set_fence
This way relaxed fencing is handled by libdrm. And buffers _can't_
ever change their tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter
4a666488c4 i915g: add winsys function to create tiled buffers
Different kernels have different restrictions for tiled buffers.
Hence use the libdrm abstraction to calculate the necessary
stride and height alignment requirements.

Not yet used.

v2: Incorporate review comments from Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Daniel Vetter
c62f5c7e7b i915g: drop alignment parameter from iws->buffer_create
It's unnecessary. The kernel gem ignores it totally and we can't
run on the old userspace fake bo manager due to lack of dri2.

Also drop the redundant name string from the sw winsys as suggested
by Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Eric Anholt
b4f585665c glsl: Mark the array access for whole-array comparisons.
By not doing so, the uniform contents of
glsl-uniform-non-uniform-array-compare.shader_test was getting thrown
out since nobody was recorded as dereferencing the array.
2010-12-01 16:14:34 -08:00
Eric Anholt
f361f8a8a9 i965: Add support for loops in the VS.
This follows the changes done for the FS alongside the EU emit code.
2010-12-01 16:14:34 -08:00
Eric Anholt
251d15d888 i965: Enable IF statements in the VS.
While the actual IF instructions were fixed by Zhenyu, we were still
flattening them to conditional moves.
2010-12-01 16:14:34 -08:00
Eric Anholt
843a6a308e i965: Add support for gen6 CONTINUE instruction emit.
At this point, piglit tests for fragment shader loops are working.
2010-12-01 16:14:34 -08:00
Eric Anholt
00e5a743e2 i965: Add support for gen6 BREAK ISA emit.
There are now two targets: the hop-to-end-of-block target, and the
target for where to resume execution for active channels.
2010-12-01 16:14:33 -08:00
Eric Anholt
4890e0f09c i965: Add support for gen6 DO/WHILE ISA emit.
There's no more DO since there's no more mask stack, and WHILE has
been shuffled like IF was.
2010-12-01 16:14:31 -08:00
Eric Anholt
a9f62881a3 i965: Dump the WHILE jump distance on gen6. 2010-12-01 15:22:59 -08:00
Marek Olšák
fcf6b353bf r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only
r3xx cannot swizzle compressed textures. r4xx+ is unaffected.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 22:54:05 +01:00
Marek Olšák
6478a4de14 r300g: fix texture swizzling with compressed textures on r400-r500
This fixes all S3TC piglit/texwrap tests.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 22:29:09 +01:00
Ian Romanick
c92550be64 i915: Correctly generate unconditional KIL instructions
Fixes piglit test glsl-fs-discard-03.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 12:01:13 -08:00
Ian Romanick
b6dbc06742 i915: Request that POW instructions be lowered 2010-12-01 12:01:13 -08:00
Ian Romanick
c4285be9a5 glsl: Lower ir_binop_pow to a sequence of EXP2 and LOG2 2010-12-01 12:01:13 -08:00
Ian Romanick
da61afa738 glsl: Use M_LOG2E constant instead of calling log2 2010-12-01 12:01:12 -08:00
Kenneth Graunke
d2d7a273c5 glsl: Add comments to lower_jumps (from the commit message).
This is essentially Luca's commit message, but placed at the top of the
file.
2010-12-01 11:52:43 -08:00
Kenneth Graunke
1802cb9baf glsl: Remove "discard" support from lower_jumps.
The new lower_discard and opt_discard_simplification passes should
handle all the necessary transformations, so lower_jumps doesn't need to
support it.

Also, lower_jumps incorrectly handled conditional discards - it would
unconditionally truncate all code after the discard.  Rather than fixing
the bug, simply remove the code.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 11:52:43 -08:00
Kenneth Graunke
940df10100 glsl: Add a lowering pass to move discards out of if-statements.
This should allow lower_if_to_cond_assign to work in the presence of
discards, fixing bug #31690 and likely #31983.

NOTE: This is a candidate for the 7.9 branch.
2010-12-01 11:52:43 -08:00
Kenneth Graunke
9a1d063c6d glsl: Add an optimization pass to simplify discards.
NOTE: This is a candidate for the 7.9 branch.
2010-12-01 11:52:43 -08:00
Marek Olšák
ead2ea89f4 ir_to_mesa: Add support for conditional discards.
NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-12-01 11:52:36 -08:00
Alex Deucher
2ca9256911 r600c: fix some opcodes on evergreen
There were a few places where we were using the wrong opcodes
on evergreen.  arl still needs to be fixed on evergreen; see
r600g for reference.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-01 13:26:02 -05:00
Marek Olšák
e6d798948e r300/compiler: implement and lower OPCODE_CLAMP
Needed for st/vega.
2010-12-01 18:29:50 +01:00
José Fonseca
6f7c8c3cbf vega: Remove extraneous ; 2010-12-01 12:31:21 +00:00
José Fonseca
792caebced scons: Move MSVS_VERSION option to common module. 2010-12-01 12:23:12 +00:00
José Fonseca
2aa3203660 svga: Silence debug printf. 2010-12-01 12:23:12 +00:00
Chia-I Wu
0dadc0b808 st/vega: Avoid unnecessary constant bufer upload.
Remember the last uploaded data and avoid re-uploading.
2010-12-01 18:36:27 +08:00
Chia-I Wu
d7a6901cac st/vega: Initialize pipe states with renderer.
Initialize vertex elements, rasterizer, stencil ref, and vertex shader
with renderer_create.  Remove RASTERIZER_DIRTY and VS_DIRTY flags.
2010-12-01 18:07:00 +08:00
Chia-I Wu
c91c386012 st/vega: Create drawing surface mask as needed.
As the blend texture, a drawing surface mask is used when masking is
enabled.  It should be created as needed.

s/alpha_mask/surface_mask/ to follow OpenVG 1.1 naming.
2010-12-01 18:03:06 +08:00
Chia-I Wu
04f342b417 st/vega: Delay blend texture creation until needed.
It is used for more advanced blending or mask update.  It might not be
ever needed for some applications.
2010-12-01 17:46:34 +08:00
Chia-I Wu
f8e0dd246b st/vega: Remove st_inlines.h.
Per b0427bedde.
2010-12-01 17:00:22 +08:00
Chia-I Wu
2bb788ccc6 st/vega: Simplify radial gradient.
Eight less instructions with comments.
2010-12-01 16:46:01 +08:00
Chia-I Wu
d7aa03b4fe st/vega: Fix degenerate paints.
Fix the case that the two points of a linear gradient coincide, or the
case that the radius of a radial gradient is equal to or less than 0.
2010-12-01 16:46:01 +08:00
Zhenyu Wang
c530fd3f8a i965: also using align1 mode for math2 on sandybridge
Like Eric's workaround patch of commit 490c23ee6b.
This forces to align1 mode for math2 too.
2010-12-01 15:04:18 +08:00
Chia-I Wu
06e7a55028 st/vega: Fix negated logic in image_draw.
A typo from last commit.
2010-12-01 11:39:33 +08:00
Chia-I Wu
b06de80843 st/vega: Fix paint coordinates transformations.
Depending on whether vgDrawPath(mode), vgDrawImage, or vgDrawGlyph[s] is
called, different paint-to-user and user-to-surface matrices should be
used to derive the sample points for the paint.

This fixes "paint" demo.
2010-12-01 11:31:00 +08:00
Chia-I Wu
ca8bc9c05b st/vega: Bump version to 1.1. 2010-12-01 11:23:53 +08:00
Chia-I Wu
e360f91f15 st/vega: Add color transformation support.
Per OpenVG 1.1.  A new shader stage is added.  It uses the first two
constants of the fragment shader for color transformation parameters.
2010-12-01 11:23:52 +08:00
Chia-I Wu
213e288e78 st/vega: More flexible shader selection.
Divide bits of VegaShaderType into 6 groups: paint, image, mask, fill,
premultiply, and bw.  Each group represents a stage.  At most one shader
from each group will be selected when constructing the final fragment
shader.
2010-12-01 11:23:52 +08:00
Chia-I Wu
30cab4b6cb st/vega: Revive mask layer support. 2010-12-01 11:23:52 +08:00
Chia-I Wu
5d64a06a63 st/vega: Add primitive text support.
Optional features such as auth-hinting are not implemented.  There is no
anti-aliasing, and no effort is done to keep the glyph origin integral.
So the text quality is poor.
2010-12-01 11:23:52 +08:00
Chia-I Wu
34f466d4e6 st/vega: Make image_draw take a matrix. 2010-12-01 11:23:52 +08:00
Chia-I Wu
165cb19abc st/vega: Make path_render and path_stroke take a matrix. 2010-12-01 11:23:51 +08:00
Chia-I Wu
d873f1f5b6 st/vega: Fix image sampler views for alpha-only formats.
For alpha-only VG formats, R = G = B = 1.0.
2010-12-01 11:23:51 +08:00
Chia-I Wu
56f02cedfa st/vega: Update to latest headers. 2010-12-01 11:23:51 +08:00
Chia-I Wu
20ce148c30 st/vega: Get rid of renderer_copy_texture. 2010-12-01 11:23:51 +08:00
Chia-I Wu
33ca973e7a st/vega: vg_copy_texture and vg_copy_surface should share code. 2010-12-01 11:23:51 +08:00
Chia-I Wu
4690cdfe07 st/vega: Clean up renderer fields and functions. 2010-12-01 11:23:50 +08:00
Chia-I Wu
ace4539e88 st/vega: Clean up vg_context fields and functions. 2010-12-01 11:23:50 +08:00
Chia-I Wu
635fe3e192 st/vega: vg_manager should care about only the color buffer.
Move depth/stencil buffer, blend texture view, and alpha mask view
creation to vg_context.c.
2010-12-01 11:23:50 +08:00
Chia-I Wu
ee0f1ab923 st/vega: Make shader_bind call into the renderer.
With this commit, the pipe states are entirely managed by the renderer.
The rest of the code interfaces with the renderer instead of
manipulating the states directly.
2010-12-01 11:23:50 +08:00
Chia-I Wu
b730f0fc52 st/vega: Move g3d states to renderer.
Let vg_context focus on OpenVG states and renderer focus on gallium
states.
2010-12-01 11:23:50 +08:00
Chia-I Wu
96c6637a13 st/vega: Use st_framebuffer for fb width/height.
This allows us to eventually make g3d states opaque.
2010-12-01 11:23:50 +08:00
Chia-I Wu
438359597c st/vega: Delay fb state update to vg_validate_state.
vg_manager_validate_framebuffer should mark the fb dirty and have
vg_validate_state call cso_set_framebuffer.  Rename VIEWPORT_DIRTY to
FRAMEBUFFER_DIRTY.
2010-12-01 11:23:49 +08:00
Chia-I Wu
3b71cb6ad6 st/vega: Add POLYGON_STENCIL and POLYGON_FILL renderer state.
The states are designated for polygon filling.  Polygon filling is a
two-pass process utilizing the stencil buffer.  polygon_fill and
polygon_array_fill functions are updated to make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
b23f732075 st/vega: Use the renderer for vgMask.
vgMask renders to the alpha mask with special fragment shaders.  The
operation can be supported by switching the renderer to FILTER state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
e5968a5355 st/vega: Add FILTER renderer state for image filtering.
The state is designated to perform image filtering.  execute_filter is
updated to make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
6b241f532a st/vega: Add CLEAR renderer state for vgClear.
This state provides the ability to clear rectangles of the framebuffer
to the specified color, honoring scissoring.  vegaClear is updated to
make use of the state.
2010-12-01 11:23:49 +08:00
Chia-I Wu
54cb382ea5 st/vega: Add SCISSOR renderer state.
The state can be used to set rectangles of the depth buffer to 0.0f.
update_clip_state is changed to use the state for scissor update.
2010-12-01 11:23:49 +08:00
Chia-I Wu
e31a04ea3b st/vega: Add DRAWTEX renderer state.
This state provides glDrawTex-like function.  It can be used for
vgSetPixels.

Rather than modifying every user of the renderer, this commit instead
modifies renderer_copy_surface to use DRAWTEX or COPY state internally
depending on whether the destination is the framebuffer.
2010-12-01 11:23:48 +08:00
Chia-I Wu
59309337e4 st/vega: Overhaul renderer with renderer states.
Renderer states are high-level states to perform specific tasks.  The
renderer is initially in INIT state.  In that state, the renderer is
used for OpenVG pipeline.

This commit adds a new COPY state to the renderer.  The state is used
for copying between two pipe resources using textured drawing.  It can
be used for vgCopyImage, for example.

Rather than modifying every user of the renderer, this commit instead
modifies renderer_copy_texture to use the COPY state internally.
2010-12-01 11:23:48 +08:00
Chia-I Wu
709e57ae4f llvmpipe: Fix build errors on x86.
The errors were introduced by
efc82aef35.
2010-12-01 11:23:48 +08:00
Kristian Høgsberg
7db49853f0 docs: Fix MESA_drm_image typo 2010-11-30 21:14:50 -05:00
Brian Paul
efc82aef35 gallivm/llvmpipe: squash merge of the llvm-context branch
This branch defines a gallivm_state structure which contains the
LLVMBuilderRef, LLVMContextRef, etc.  All data structures built with
this object can be periodically freed during a "garbage collection"
operation.

The gallivm_state object has to be passed to most of the builder
functions where LLVMBuilderRef used to be used.

Conflicts:
	src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
	src/gallium/drivers/llvmpipe/lp_state_setup.c
2010-11-30 16:35:12 -07:00
Marek Olšák
1f1375d4d8 r300g: fix texture border color once again
I made the texwrap test be more thorough and realized that this driver code
had not been quite right. This commit fixes the border color for depth
textures, compressed textures, and 16-bits-per-channel textures
with up to 2 channels (R16, RG16).

NOTE: This is a candidate for the 7.9 branch.
2010-11-30 23:31:16 +01:00
Kenneth Graunke
2da02e75b1 glsl/linker: Free any IR discarded by optimization passes.
Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.

Now, IR is allocated out of a temporary context, and any -live- IR is
reparented/stolen to (effectively) the gl_shader.  Any remaining IR can
be freed.

NOTE: This is a candidate for the 7.9 branch.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
ff994eeff8 glsl: Remove anti-built-in hacks from the print visitor.
Now that we only import built-in signatures that are actually used,
printing them is reasonable.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
f5692f452f glsl: Lazily import built-in function prototypes.
This makes a very simple 1.30 shader go from 196k of memory to 9k.

NOTE: This -may- be a candidate for the 7.9 branch, as the benefit is
substantial.  However, it's not a simple change, so it may be wiser to
wait for 7.10.
2010-11-30 13:48:28 -08:00
Kenneth Graunke
01a25bb64e glsl: Refactor out cloning of function prototypes.
This allows us to reuse some code and will be useful later.
2010-11-30 13:48:28 -08:00
Aras Pranckevicius
4ce084c707 glsl: fix matrix type check in ir_algebraic
Fixes glsl-mat-mul-1.
2010-11-30 13:32:00 -08:00
Eric Anholt
d56c97413e glsl: Quiet unreachable no-return-from-function warning. 2010-11-30 13:29:28 -08:00
Zack Rusin
b22d65e9fc scons: add alias for identity 2010-11-30 16:13:11 -05:00
Eric Anholt
ff79633d9f glsl: Fix structure and array comparisions.
We were trying to emit a single ir_expression to compare the whole
thing.  The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass).  Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.

Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
2010-11-30 11:42:42 -08:00
Eric Anholt
6b937465d4 glsl: Add a helper constructor for expressions that works out result type.
This doesn't cover all expressions or all operand types, but it will
complain if you overreach and it allows for much greater slack on the
programmer's part.
2010-11-30 11:23:24 -08:00
Keith Whitwell
68a4f63247 llvmpipe: shortcircuit some calls to set_scene_state 2010-11-30 12:01:29 +00:00
Keith Whitwell
d9169364d4 llvmpipe: remove misleading debug string 2010-11-30 12:01:29 +00:00
Keith Whitwell
2d31f048ce llvmpipe: raise dirty flag on transfers to bound constbuf
Need this to trigger the scene to update its shadow of the constant
state.
2010-11-30 12:01:29 +00:00
José Fonseca
31aeac5bf9 wgl: More complete WGL_ARB_pbuffer support. 2010-11-30 10:49:08 +00:00
José Fonseca
c4a43873c5 wgl: Stub WGL_ARB_pbuffer support.
See http://www.opengl.org/registry/specs/ARB/wgl_pbuffer.txt
2010-11-30 10:47:49 +00:00
José Fonseca
af6407a500 scons: Alias for svga 2010-11-30 10:47:26 +00:00
José Fonseca
7bbf675b88 svga: Use consistent hexadecimal representation on debug output. 2010-11-30 10:45:31 +00:00
Marek Olšák
80f24c1575 util: rename u_mempool -> u_slab 2010-11-30 10:12:26 +01:00
Zack Rusin
5572805423 gallivm: fix storing of the addr register
we store into the index specified by the register index, not an
indirect register.
2010-11-30 02:01:43 -05:00
Eric Anholt
001eee52d4 glsl: Make the symbol table's add_variable just use the variable's name. 2010-11-29 17:08:27 -08:00
Eric Anholt
e8f5ebf313 glsl: Make the symbol table's add_function just use the function's name. 2010-11-29 17:08:27 -08:00
Eric Anholt
2927b6c212 i965: Fix type of gl_FragData[] dereference for FB write.
Fixes glsl-fs-fragdata-1, and hopefully Eve Online where I noticed
this bug in the generated shader.  Bug #31952.
2010-11-29 17:08:26 -08:00
Adam Jackson
1ccef926be drivers/x11: unifdef XFree86Server
This code was for the old GLcore build of the software rasteriser.  The
X server switched to a DRI driver for software indirect GLX long ago.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-29 17:37:54 -05:00
Marek Olšák
e5aa69f6a6 st/mesa: fix texture border color for RED and RG base formats
The spec says the border color should be consistent with the internal
format.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-29 17:26:40 +01:00
pontus lidman
b1097607db mesa: check for posix_memalign() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-29 09:20:41 -07:00
Dave Airlie
a7cb673aa1 r600g: it looks like r600 can handle dword offsets in the indices.
Tested with piglit + ut2004 still seems to render okay (and it
definitely does this)
2010-11-29 11:38:24 +10:00
Marek Olšák
5d4d8b6205 u_blitter: interpolate clear color using a GENERIC varying instead of COLOR
There are also some u_simple_shaders changes.

On r300, the TGSI_SEMANTIC_COLOR varying is a fixed-point number clamped
to the range [0,1] and limited to 12 bits of precision. Therefore we can't
use it for passing through a clear color in order to clear high precision
texture formats.

This also makes u_blitter use only one vertex shader instead of two.
2010-11-28 17:45:39 +01:00
Henri Verbeet
c6ea4c0e8a r600g: Fix the PIPE_FORMAT_A8_UNORM color swap for Evergreen as well. 2010-11-27 17:40:47 +01:00
Henri Verbeet
7a4599c6f5 r600g: Fix the PIPE_FORMAT_L8A8_UNORM color swaps. 2010-11-27 17:40:47 +01:00
Mathias Fröhlich
c3602ff5ed st/mesa: Set PIPE_TRANSFER_DISCARD for GL_MAP_INVALIDATE_RANGE/BUFFFER_BIT
Signed-off-by: Brian Paul <brianp@vmware.com>

Note: this is a candidate for the 7.9 branch.
2010-11-26 14:03:42 -07:00
Brian Paul
97ae4dad1c st/mesa: fix mapping of zero-sized buffer objects
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31934
2010-11-26 13:48:49 -07:00
Thomas Hellstrom
5822484510 xorg/vmwgfx: Don't clip video to viewport
Since the viewport is not updated on RandR12 mode switches anymore,
clipping to viewport may incorrectly clip away the video.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-26 10:28:01 +01:00
Thomas Hellstrom
28ee7561f9 xorg/vmwgfx: Flush even if we don't autopaint the color key
This may help paint the colorkey before overlay updates in some
situations where the app paints the color key (mainly xine).

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-26 10:27:54 +01:00
Marek Olšák
e6e6fcd3a6 r300/compiler: move util functions to radeon_compiler_util
The compiler seriously needs a cleanup as far as the arrangement of functions
is concerned. It's hard to know whether some function was implemented or not
because there are so many places to search in and it can be anywhere and
named anyhow.
2010-11-26 02:23:13 +01:00
Marek Olšák
ea2f56b490 r300/compiler: add a function for swizzling a mask 2010-11-26 02:23:13 +01:00
Marek Olšák
7c29446232 r300/compiler: remove duplicate function rc_mask_to_swz 2010-11-26 02:23:13 +01:00
Marek Olšák
ae3e58d973 r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction
It looks like the function was originally written for ARB_fragment_program.

NOTE: This is a candidate for the 7.9 branch.
2010-11-26 02:22:59 +01:00
Marek Olšák
2c1de07ddf u_blitter: use PIPE_TRANSFER_DISCARD to prevent cpu/gpu stall
But the driver must be smart here and follow PIPE_TRANSFER_DISCARD,
as it should.
2010-11-25 20:25:53 +01:00
Xavier Chantry
c14a261eb9 nvfx: reset nvfx->hw_zeta
If nvfx_framebuffer prepare and validate were called successively with
fb->zsbuf not NULL and then NULL, nvfx->hw_zeta would contain garbage and
this would cause failures in nvfx_framebuffer_relocate/OUT_RELOC(hw_zeta).

This was triggered by piglit/texwrap 2D GL_DEPTH_COMPONENT24 and caused
first a 'write to user buffer!!' error in libdrm and then worse things.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-25 17:04:29 +01:00
Xavier Chantry
049065cdfa nvfx: fb->nr_cbufs <= 1 on nv30
7e1bf94631 changed
PIPE_CAP_MAX_RENDER_TARGETS to 1 on nv30.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-25 17:04:02 +01:00
Kenneth Graunke
1eb7a81f2e glsl: Add a virtual as_discard() method.
NOTE: This is candidate for the 7.9 branch.
2010-11-25 03:26:55 -08:00
Kenneth Graunke
a82592de92 glsl: Use do_common_optimization in the standalone compiler.
NOTE: This is a candidate for the 7.9 branch.
2010-11-25 01:21:05 -08:00
Kenneth Graunke
e8a24c65bc glsl: Don't inline function prototypes.
Currently, the standalone compiler tries to do function inlining before
linking shaders (including linking against the built-in functions).
This resulted in the built-in function _prototypes_ being inlined rather
than the actual function definition.

This is only known to fix a bug in the standalone compiler; most
programs should be unaffected.  Still, it seems like a good idea.

NOTE: This is a candidate for the 7.9 branch.
2010-11-25 01:19:53 -08:00
Vinson Lee
2cc79acc1a r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_regalloc.c: In function ‘compute_live_intervals’:
radeon_pair_regalloc.c:222: warning: ISO C90 forbids mixed declarations and code
2010-11-24 23:03:26 -08:00
Vinson Lee
995de71550 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_regalloc.c: In function ‘compute_live_intervals’:
radeon_pair_regalloc.c:221: warning: ISO C90 forbids mixed declarations and code
2010-11-24 23:00:03 -08:00
Chia-I Wu
ba1128db45 st/vega: Fix a typo in EXTENDED_BLENDER_OVER_FUNC.
The typo was introduced by commit
231d5457b2.
2010-11-25 13:34:24 +08:00
Chia-I Wu
c9fb8c3bcf st/vega: No flipping in vg_prepare_blend_surface.
The blend sampler view is addressed with unnormalized coordinates in the
fragment shader.  It should have the same orientation as the surface
does.
2010-11-25 13:33:59 +08:00
Chia-I Wu
37ec090ac9 st/vega: Masks and surfaces should share orientation.
The alpha mask is addressed with unnormalized coordinates in the
fragment shader.  It should have the same orientation as the surface
does.

This fixes "mask" OpenVG demo.
2010-11-25 13:33:59 +08:00
Chia-I Wu
9ea4936a36 st/vega: Fix a crash with empty paths. 2010-11-25 13:32:03 +08:00
Chia-I Wu
3965051dff auxiliary: util_blit_pixels_tex should restore the viewport.
Viewport state should be saved/restored.
2010-11-25 13:32:03 +08:00
Dave Airlie
3b5a3fd8d1 r300g/r600g: bump cache manager timeouts to 1s
On lightsmark on my r500 this drop the bufmgr allocations of the sysprof.
2010-11-25 09:18:19 +10:00
Kenneth Graunke
1197393faa mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.
Previously, the get table listed all three as having custom locations,
yet find_custom_value did not have cases to handle them.

MAX_VARYING_VECTORS does not need a custom location since MaxVaryings is
already stored as float[4] (or vec4).  MaxUniformComponents is stored as
the number of floats, however, so a custom implementation that divides
by 4 is necessary.

Fixes bugs.freedesktop.org #31495.
2010-11-24 14:09:32 -08:00
Peter Clifton
ee88727df8 meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear
This fixes incorrect behaviour when the stencil clear value exceeds
the size of the stencil buffer, for example, when set with:

glClearStencil (~1); /* Set a bit pattern of 111...11111110 */
glClear (GL_STENCIL_BUFFER_BIT);

The clear value needs to be masked by the value 2^m - 1, where m is the
number of bits in the stencil buffer. Previously, we passed the value
masked with 0x7fffffff to _mesa_StencilFuncSeparate which then clamps,
NOT masks the value to the range 0 to 2^m - 1.

The result would be clearing the stencil buffer to 0xff, rather than 0xfe.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-24 12:14:54 -07:00
Brian Paul
03a4f97a68 x11: remove test_proxy_teximage() function
This was really just for testing purposes.
2010-11-24 12:11:23 -07:00
Brian Paul
74c324fdba mesa: added _mesa_format_image_size64() 2010-11-24 12:11:23 -07:00
Brian Paul
7bfbd88d2c mesa: add assertion and update comment in _mesa_format_image_size() 2010-11-24 12:11:23 -07:00
Kristian Høgsberg
a889f9ee5c i965: Don't write mrf assignment for pointsize output
https://bugs.freedesktop.org/show_bug.cgi?id=31894
2010-11-24 11:27:43 -05:00
Thomas Hellstrom
f20a219e9e gallium/targets/xorg-vmwgfx: Xv fixes
Make sure regions are properly updated and that the colorkey painting is
flushed before we update the HW overlay.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-24 15:23:10 +01:00
Thomas Hellstrom
0b1c0460a0 st/xorg: Add a function to flush pending rendering and damage
This is needed to properly sync with host side rendering. For example,
make sure we flush colorkey painting before updating the overlay.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-24 15:23:10 +01:00
Chia-I Wu
1f4c55128b egl_dri2: Fix one context, multiple surfaces.
When a context was made current to another surface, the old code did
this

  dri2_dpy->core->bindContext(cctx, ddraw, rdraw);
  dri2_dpy->core->unbindContext(old_cctx);

and there will be no current context due to the second line.

unbindContext should be called only when bindContext is not.  This fixes
a regression since d19afc57.  Thanks to Neil Roberts for noticing the
issue and creating a test case.
2010-11-24 14:06:30 +08:00
Ian Romanick
78a340fd48 i915: Disallow alpha, red, RG, and sRGB as render targets
Fixes bugzilla #31832

NOTE: This is a candidate for the 7.9 branch.
2010-11-23 18:42:04 -08:00
Brian Paul
903ead0b26 glsl: start restoring some geometry shader code 2010-11-23 17:23:42 -07:00
Brian Paul
6162773ea4 glsl: better handling of linker failures
Upon link error, exit translation loop, free program instructions.
Check for null pointers in calling code.
2010-11-23 17:18:48 -07:00
Brian Paul
2900e56f9d mesa: use gl_shader_type enum 2010-11-23 17:00:08 -07:00
Brian Paul
c628fd743e mesa: replace #defines with new gl_shader_type enum 2010-11-23 15:52:43 -07:00
Brian Paul
512f840702 mesa: _mesa_valid_register_index() to validate register indexes 2010-11-23 15:52:43 -07:00
Brian Paul
b8dacaf174 mesa: rename, make _mesa_register_file_name() non-static
Plus remove unused parameter.
2010-11-23 15:52:42 -07:00
Brian Paul
caf974c525 glsl: use gl_register_file in a few places 2010-11-23 15:52:42 -07:00
Brian Paul
50fd99d172 glsl: fix off by one in register index assertion 2010-11-23 15:52:42 -07:00
Alex Deucher
ed8b5fb24e gallium/egl: fix r300 vs r600 loading
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=31841
2010-11-23 15:18:31 -05:00
Eric Anholt
df24450bac i965: Use the new embedded compare in SEL on gen6 for VS MIN and MAX opcodes.
Cuts the extra CMP instruction that used to precede SEL.
2010-11-23 09:23:30 -08:00
Eric Anholt
8a7cf99457 i965: Don't upload line smooth params unless we're line smoothing. 2010-11-23 09:23:30 -08:00
Eric Anholt
008fd3779b i965: Don't upload line stipple pattern unless we're stippling. 2010-11-23 09:23:30 -08:00
Eric Anholt
e29e3c32d9 i965: Don't upload polygon stipple unless required. 2010-11-23 09:23:30 -08:00
Eric Anholt
7720bfffa3 i965: Move gen4 blend constant color to the gen4 blending file. 2010-11-23 09:23:29 -08:00
Tilman Sauerbeck
3688301c59 r600g: Removed duplicated call to tgsi_split_literal_constant().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-23 09:20:54 +01:00
Tom Stellard
4265c2f819 r300/compiler: Don't allow presubtract sources to be remapped twice
https://bugs.freedesktop.org/show_bug.cgi?id=31193

NOTE: This is a candidate for the 7.9 branch.
2010-11-23 00:02:03 -08:00
Mathias Fröhlich
07e0424a17 r600g: Only compare active vertex elements
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-23 08:39:43 +01:00
Vinson Lee
f44d96e1af mesa: Clean up header file inclusion in syncobj.h. 2010-11-22 21:51:49 -08:00
Vinson Lee
37195b7f70 llvmpipe: Remove unnecessary headers. 2010-11-22 21:39:14 -08:00
Xiang, Haihao
93102b4cd8 mesa: fix regression from b4bb668020
Pending commands to the previous context aren't flushed since commit b4bb668

Reported-by: Oleksiy Krivoshey <oleksiyk@gmail.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-23 08:59:44 +08:00
Alex Deucher
cb7a36b651 r600c: fix VC flush on cedar and palm 2010-11-22 19:27:58 -05:00
Alex Deucher
0e4c5f63b9 r600g: add support for ontario APUs
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-22 18:01:26 -05:00
Alex Deucher
072f2cbf29 r600c: add Ontario Fusion APU support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-22 18:01:25 -05:00
Mathias Fröhlich
8d1ad3b21c r300g: Avoid returning values in a static array, fixing a potential race
(Marek: added the initializion of "vec" in the default statement)

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-11-22 23:56:41 +01:00
Alex Deucher
271b7b5914 r600g: fix some winsys functions to deal properly with evergreen
Are these functions actually used anywhere?
2010-11-22 17:39:54 -05:00
Alex Deucher
bf9c80976f r600g: fix additional EVENT_WRITE packet
Add explicit EVENT_TYPE field
2010-11-22 17:39:16 -05:00
Marek Olšák
e7c74a7dfa st/mesa: set MaxUniformComponents
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-22 21:44:35 +01:00
Brian Paul
6a0255122a swrast: init alpha value to 1.0 in opt_sample_rgb_2d() 2010-11-22 09:04:13 -07:00
Marek Olšák
9aa089eac0 gallium: add PIPE_SHADER_CAP_SUBROUTINES
This fixes piglit/glsl-vs-main-return and glsl-fs-main-return for the drivers
which don't support RET (i915g, r300g, r600g, svga).

ir_to_mesa does not currently generate subroutines, but it's a matter of time
till it's added. It would then break all the drivers which don't implement
them, so this CAP makes sense.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-11-22 12:41:22 +01:00
Keith Whitwell
b2ddb93ff3 Merge branch 'lp-offset-twoside' 2010-11-22 10:36:01 +00:00
Dave Airlie
d5aadf0d80 r600g: pick correct color swap for A8 fbos.
This fixes fdo bug 31810.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-11-22 16:05:44 +10:00
Tom Stellard
1b6ed80972 r300/compiler: Add a more efficient version of rc_find_free_temporary() 2010-11-21 18:48:31 -08:00
Tom Stellard
8833f53e65 r300/compiler: Enable rename_reg pass for r500 cards
In addition, the rename_reg pass has been rewritten to use
rc_get_readers().
2010-11-21 18:48:31 -08:00
Tom Stellard
bbe49bc585 r300/compiler: Use presubtract operations as much as possible
Previously, presubtract operations where only being used by instructions
with less than three source source registers.
2010-11-21 18:48:31 -08:00
Tom Stellard
ddceededf8 r300/compiler: Convert RGB to alpha in the scheduler 2010-11-21 18:48:31 -08:00
Tom Stellard
681f56af80 r300/compiler: Track readers through branches in rc_get_readers() 2010-11-21 18:48:31 -08:00
Tom Stellard
255860113f r300/compiler: Handle BREAK and CONTINUE in rc_get_readers() 2010-11-21 18:48:31 -08:00
Tom Stellard
96f9580160 r300/compiler: Add rc_get_readers() 2010-11-21 18:48:31 -08:00
Tom Stellard
23f577dbd4 r300/compiler: Ignore alpha dest register when replicating the result
When the result of the alpha instruction is being replicated to the RGB
destination register, we do not need to use alpha's destination register.
This fixes an invalid "Too many hardware temporaries used" error in
the case where a transcendent operation writes to a temporary register
greater than max_temp_regs.

NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
d668659003 r300/compiler: Use zero as the register index for unused sources
This fixes an invalid "Too many hardware temporaries used" error in the
case where a source reads from a temporary register with an index greater
than max_temp_regs and then the source is marked as unused before the
register allocation pass.

NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
3e5f9789d6 r300/compiler: Fix instruction scheduling within IF blocks
Reads of registers that where not written to within the same block were
not being tracked.  So in a situations like this:
0: IF
1: ADD t0, t1, t2
2: MOV t2, t1

Instruction 2 didn't know that instruction 1 read from t2, so
in some cases instruction 2 was being scheduled before instruction 1.

NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
e2301b45c2 r300/compiler: Fix register allocator's handling of loops
NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Tom Stellard
412803b5cd r300/compiler: Make sure presubtract sources use supported swizzles
NOTE: This is a candidate for the 7.9 branch.
2010-11-21 18:48:31 -08:00
Vinson Lee
9d08902457 r600: Remove unnecessary header. 2010-11-21 15:03:27 -08:00
Marek Olšák
2892c8bdbc docs: add GL 4.1 status 2010-11-21 23:03:58 +01:00
Marek Olšák
e40a58b7f8 st/mesa: enable ARB_explicit_attrib_location and EXT_separate_shader_objects
Gallium drivers pass all piglit tests for the two (there are 12 tests
for separate_shader_objects and 5 tests for explicit_attrib_location),
and I was told the extensions don't need any driver-specific code.

I made them dependent on PIPE_CAP_GLSL.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-21 19:33:45 +01:00
Brian Paul
5e3733fadf mesa: fix get_texture_dimensions() for texture array targets
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31779
2010-11-21 10:05:51 -07:00
Brian Paul
0ec0f1025d docs: update some GL 3.0 status 2010-11-21 09:40:28 -07:00
Brian Paul
5ed51e950f mesa: hook up GL 3.x entrypoints
Fix up some details in the xml files and regenerate dispatch files.
2010-11-21 09:20:44 -07:00
Brian Paul
81c347ef79 glapi: rename GL3.xml to GL3x.xml as it covers all GL 3.x versions 2010-11-21 09:20:43 -07:00
Brian Paul
197b1d7898 mesa: fix error msg typo 2010-11-21 09:20:43 -07:00
Daniel Vetter
c8fca58d9d i915g: kill idws->pool
The drm winsys only ever handles one gem memory manager. Rip out
the unnecessary complication.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
e182618853 i915g: kill buf->map_gtt
Not using the gtt is considered harmful for performance. And for
partial uploads there's always drm_intel_bo_subdata.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
d54d67499c i915g: kill RGBA/X formats
It's intel, so always little endian!

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
8624fe7a49 i915g: add pineview pci ids
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter
aba728eb25 i915g: s/hw_tiled/tiling
More in line with other intel drivers.

Change to use enum by Jakob Bornecrantz.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:18 +01:00
Daniel Vetter
f77a2690b4 i915g: rip out ->sw_tiled
It looks like this was meant to facilitate unfenced access to textures/
color/renderbuffers. It's totally incomplete and fundamentally broken
on a few levels:
- broken: The kernel needs to about every tiled bo to fix up bit17
  swizzling on swap-in.
- unflexible: fenced/unfenced relocs from execbuffer2 do the same, much
  simpler.
- unneeded: with relaxed fencing tiled gem bos are as memory-efficient
  as this trick.

Hence kill it.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:18 +01:00
Joakim Sindholt
bf10055cff r300g: silence guard band cap errors
Somebody should find out what these are. It can be found on Windows
getting a D3DCAPS9 from IDirect3D9::GetCaps() and reading the
GuardBand* values.
2010-11-21 15:45:20 +01:00
Chia-I Wu
b8f6cb3809 st/vega: Fix vgReadPixels with a subrectangle.
Fix a crash when the subrectangle is not inside the fb.  Fix wrong
pipe transfer when sx > 0 or sy + height != fb->height.

This fixes "readpixels" demo.
2010-11-21 19:32:22 +08:00
Chia-I Wu
e8bbaff22e st/vega: Set wrap_r for mask and blend samplers.
These two samplers use non-normalized texture coordinates.  wrap_r
cannot be PIPE_TEX_WRAP_REPEAT (the default).

This fixes

  sp_tex_sample.c:1790:get_linear_unorm_wrap: Assertion `0' failed

assertion failure.
2010-11-21 19:32:10 +08:00
Chia-I Wu
daa265e53c st/vega: vegaLookupSingle should validate the state.
Fix "lookup" demo crash.
2010-11-21 19:26:33 +08:00
Chia-I Wu
f90524a01b tgsi: Add STENCIL to text parser.
Fix OpenVG "filter" demo

  Program received signal SIGSEGV, Segmentation fault.
  0xb7153dc9 in str_match_no_case (pcur=0xbfffe564, str=0x0) at
  tgsi/tgsi_text.c:86
  86         while (*str != '\0' && *str == uprcase( *cur )) {
2010-11-21 19:26:29 +08:00
Vinson Lee
8bea7776a3 mesa: Clean up header file inclusion in stencil.h. 2010-11-20 22:44:33 -08:00
Vinson Lee
9732a93f40 mesa: Clean up header file inclusion in shared.h. 2010-11-20 22:30:27 -08:00
Vinson Lee
20f041952c mesa: Clean up header file inclusion in shaderapi.h. 2010-11-20 22:17:28 -08:00
Vinson Lee
baa0471597 mesa: Clean up header file inclusion in scissor.h. 2010-11-20 22:01:30 -08:00
Vinson Lee
27e96655c7 mesa: Clean up header file inclusion in renderbuffer.h. 2010-11-20 21:32:07 -08:00
Vinson Lee
b6215d18b5 mesa: Clean up header file inclusion in readpix.h. 2010-11-20 21:23:35 -08:00
Vinson Lee
bab188d22f mesa: Clean up header file inclusion in rastpos.h. 2010-11-20 21:14:06 -08:00
Vinson Lee
9b66305b8d mesa: Clean up header file inclusion in polygon.h. 2010-11-20 21:06:09 -08:00
Vinson Lee
f5cbe04b69 intel: Remove unnecessary header. 2010-11-20 20:13:50 -08:00
Vinson Lee
84f5229119 r600: Remove unnecesary header. 2010-11-20 19:04:30 -08:00
Vinson Lee
b59f3dd8ca swrast: Remove unnecessary header. 2010-11-20 19:00:18 -08:00
Vinson Lee
1310806872 st/mesa: Remove unnecessary headers. 2010-11-20 18:48:09 -08:00
Chia-I Wu
bb045d339b scons: Define IN_DRI_DRIVER.
The define is required for DRI drivers.  It is not needed for
libgl-xlib, but the overhead it introduces should be minor.
2010-11-20 17:47:11 -08:00
Xavier Chantry
7e1bf94631 nvfx: only expose one rt on nv30
We do not know how to use more, GL_ARB_draw_buffers is not exposed on blob.
2010-11-20 23:29:12 +01:00
Owen W. Taylor
c63a86e1e5 r600g: Fix location for clip plane registers
The stride between the different clip plane registers was incorrect.

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

agd5f: fix evergreen as well.
2010-11-20 12:18:56 -05:00
Marek Olšák
ffb732d8bd r300g: fix rendering with no vertex elements
Fixes glsl-vs-point-size, although I meant to fix glsl-novertexdata.
Since swrast fails glsl-novertexdata too, I guess it's a core issue.
2010-11-20 16:20:48 +01:00
Eric Anholt
b6b91fa029 i965: Remove duplicate MRF writes in the FS backend.
This is quite common for multitexture sampling, and not only cuts down
on the second and later set of MOVs, but typically also allows
compute-to-MRF on the first set.

No statistically siginficant performance difference in nexuiz (n=3),
but it reduces instruction count in one of its shaders and seems like
a good idea.
2010-11-19 20:05:56 -08:00
Eric Anholt
47b1aac1cf i965: Improve compute-to-mrf.
We were skipping it if the instruction producing the value we were
going to compute-to-mrf used its result reg as a source reg.  This
meant that the typical "write interpolated color to fragment color" or
"texture from interpolated texcoord" shader didn't compute-to-MRF.
Just don't check for the interference cases until after we've checked
if this is the instruction we wanted to compute-to-MRF.

Improves nexuiz high-settings performance on my laptop 0.48% +- 0.08%
(n=3).
2010-11-19 19:54:11 -08:00
Eric Anholt
ac89a90401 ir_to_mesa: Detect and emit MOV_SATs for saturate constructs.
The goal here is to avoid regressing performance on ir_to_mesa drivers
for fixed function fragment shaders requiring saturates.
2010-11-19 19:09:32 -08:00
Eric Anholt
19631fab35 i965: Recognize saturates and turn them into a saturated mov.
On pre-gen6, this turns 4 instructions into 1.  We could still do
better by folding the saturate into the instruction generating the
value if nobody else uses it, but that should be a separate pass.
2010-11-19 19:09:31 -08:00
Eric Anholt
02939d643f glsl: Add a helper function for determining if an rvalue could be a saturate.
Hardware pretty commonly has saturate modifiers on instructions, and
this can be used in codegen to produce those, without everyone else
needing to understand clamping other than min and max.
2010-11-19 19:09:18 -08:00
Eric Anholt
602ae2441a i965: Fold constants into the second arg of BRW_SEL as well.
This hits a common case with min/max operations.
2010-11-19 17:42:07 -08:00
Eric Anholt
f9b420d3bd i965: Remove extra \n at the end of every instruction in INTEL_DEBUG=wm. 2010-11-19 17:42:07 -08:00
Eric Anholt
5944cda6ed i965: Just use memset() to clear most members in FS constructors.
This should make it a lot harder to forget to zero things.
2010-11-19 17:42:07 -08:00
Eric Anholt
61126278a3 i965: Fix compute_to_mrf to not move a MRF write up into another live range.
Fixes glsl-fs-copy-propagation-texcoords-1.
2010-11-19 17:42:06 -08:00
Eric Anholt
6b1d7dd781 mesa: Include C++ files in the makedepend of DRI drivers. 2010-11-19 17:42:06 -08:00
Vinson Lee
a172368ef1 glsl: Fix type of label 'default' in switch statement. 2010-11-19 17:28:22 -08:00
Vinson Lee
7aebe181f3 glsl: Add lower_vector.cpp to SConscript. 2010-11-19 17:23:07 -08:00
Ian Romanick
bb756bb0a6 glsl: Fix matrix constructors with vector parameters
When the semantics of write masks in assignments were changed, this
code was not correctly updated.

Fixes piglit test glsl-mat-from-vec-ctor-01.
2010-11-19 17:17:25 -08:00
Kenneth Graunke
63684a9ae7 glsl: Combine many instruction lowering passes into one.
This should save on the overhead of tree-walking and provide a
convenient place to add more instruction lowering in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-11-19 15:56:28 -08:00
Kenneth Graunke
b943fb94bf glsl: Simplify a type check by using type->is_integer(). 2010-11-19 15:06:58 -08:00
Ian Romanick
11d6f1c698 glsl: Add ir_quadop_vector expression
The vector operator collects 2, 3, or 4 scalar components into a
vector.  Doing this has several advantages.  First, it will make
ud-chain tracking for components of vectors much easier.  Second, a
later optimization pass could collect scalars into vectors to allow
generation of SWZ instructions (or similar as operands to other
instructions on R200 and i915).  It also enables an easy way to
generate IR for SWZ instructions in the ARB_vertex_program assembler.
2010-11-19 15:00:26 -08:00
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
Keith Whitwell
546c5ffa11 llvmpipe: twoside for specular color also 2010-11-19 16:17:36 +00:00
Keith Whitwell
081ce2680e llvmpipe: fix up twoside after recent changes
Fix my slot/attr confusion.
2010-11-19 16:16:30 +00:00
Hui Qi Tay
d4b5cf6c05 llvmpipe: fix such that offset/twoside function only does in-place modification 2010-11-19 15:12:19 +00: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
Brian Paul
3c59febf05 mesa: 80-column wrapping 2010-11-16 20:12:34 -07:00
Brian Paul
76114d23d1 mesa: whitespace cleanups 2010-11-16 20:12:34 -07:00
Brian Paul
78527154bd mesa: fix error messages and minor reindenting 2010-11-16 20:12:34 -07:00
Kenneth Graunke
bee901a1cf Refresh autogenerated glcpp parser. 2010-11-16 16:22:13 -08:00
Kenneth Graunke
3fb83038a0 glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.
Per section 4.5.4 of the GLSL 1.30 specification.
2010-11-16 16:22:12 -08:00
Henri Verbeet
6bbe637c13 r600g: Synchronize supported color formats between Evergreen and r600/r700. 2010-11-17 00:41:42 +01:00
Henri Verbeet
7d0f45563d r600g: Swizzle vertex data only once.
Vertex data swizzles are already done in the vertex shader. Doing them twice
breaks BGRA vertex arrays for example.
2010-11-17 00:41:42 +01:00
Marek Olšák
b6e2c32626 r300g: remove the hack with OPCODE_RET
RET was interpreted as END, which was wrong. Instead, if a shader contains RET
in the main function, it will fail to compile with an error message
from now on.

The hack is from early days.
2010-11-16 22:39:27 +01:00
Ian Romanick
2d2d6a80c1 glsl: Simplify generation of swizzle for vector constructors 2010-11-16 12:11:02 -08:00
Ian Romanick
38e55153af glsl: Refactor is_vec_{zero,one} to be methods of ir_constant
These predicates will be used in other places soon.
2010-11-16 12:11:02 -08:00
José Fonseca
4f84a3aa32 libgl-gdi: Allow to pick softpipe/llvmpipe on runtime. 2010-11-16 18:56:39 +00:00
Vinson Lee
063c6b8f74 mesa: Add definitions for inverse hyperbolic function on MSVC. 2010-11-15 22:00:32 -08:00
Vinson Lee
1935bdca44 glsl: Add ir_constant_expression.cpp to SConscript.
This was accidentally removed in commit 32aaf89823.

Fixes SCons builds.
2010-11-15 20:56:11 -08:00
Brian Paul
9b4b70e7e2 glsl: remove opt_constant_expression.cpp from SConscript
And alphabetize the opt_* files.
2010-11-15 18:59:45 -07:00
Brian Paul
c1928c7f10 mesa: add more work-arounds for acoshf(), asinhf(), atahf() 2010-11-15 18:50:58 -07:00
Brian Paul
88f482a839 glsl: fix assorted MSVC warnings 2010-11-15 18:48:43 -07:00
Brian Paul
20c2debce8 st/mesa: fix glDrawPixels(depth/stencil) bugs
When drawing GL_DEPTH_COMPONENT the usual fragment pipeline steps apply
so don't override the depth state.

When drawing GL_STENCIL_INDEX (or GL_DEPTH_STENCIL) the fragment pipeline
does not apply (only the stencil and Z writemasks apply) so disable writes
to the color buffers.

Fixes some regressions from commit ef8bb7ada9
2010-11-15 18:40:32 -07:00
Kenneth Graunke
32aaf89823 glsl: Rename various ir_* files to lower_* and opt_*.
This helps distinguish between lowering passes, optimization passes, and
other compiler code.
2010-11-15 16:34:20 -08:00
Kenneth Graunke
46b80d6469 glsl: Remove unused and out of date Makefile.am.
This was from when glsl2 lived in a separate repository and used
automake.
2010-11-15 14:47:15 -08:00
Kenneth Graunke
3108095198 glsl: Add constant expression handling for asinh, acosh, and atanh. 2010-11-15 14:08:58 -08:00
Kenneth Graunke
91181c7dd4 glsl: Refresh autogenerated file builtin_function.cpp. 2010-11-15 14:02:52 -08:00
Kenneth Graunke
db9b8c062f glsl: Implement the asinh, acosh, and atanh built-in functions. 2010-11-15 14:02:52 -08:00
Kenneth Graunke
096d36872f generate_builtins.py: Fix inconsistent use of tabs and spaces warning. 2010-11-15 14:02:52 -08:00
Kenneth Graunke
0d082c0e06 glsl: Refresh autogenerated lexer and parser files.
For the last three commits.
2010-11-15 13:33:58 -08:00
Kenneth Graunke
7279feeb19 glsl: Add support for the 'u' and 'U' unsigned integer suffixes. 2010-11-15 13:33:58 -08:00
Kenneth Graunke
2b6c1a0b7c glsl: Add new keywords and reserved words for GLSL 1.30. 2010-11-15 13:33:58 -08:00
Kenneth Graunke
285036fbb0 glsl: Rework reserved word/keyword handling in the lexer.
This consolidates the TOKEN_OR_IDENTIFIER and RESERVED_WORD macros into
a single KEYWORD macro.

The old TOKEN_OR_IDENTIFIER macros handled the case of a word going from
an identifier to a keyword; the RESERVED_WORD macro handled a word going
from a reserved word to a language keyword.  However, neither could
properly handle samplerBuffer (for example), which is an identifier in
1.10 and 1.20, a reserved word in 1.30, and a keyword in 1.40 and on.

Furthermore, the existing macros didn't properly handle reserved words
in GLSL ES 1.00.  The best they could do was return a token (rather than
an identifier), resulting in an obtuse parser error, rather than a
user-friendly "you used a reserved word" error message.
2010-11-15 13:33:57 -08:00
Kenneth Graunke
5dc74e9c77 glsl: Convert glsl_type::base_type from #define'd constants to an enum.
This is nice because printing type->base_type in GDB will now give you a
readable name instead of a number.
2010-11-15 13:33:57 -08:00
Kenneth Graunke
ee36f14fa5 glsl: Remove GLSL_TYPE_FUNCTION define.
Functions are not first class objects in GLSL, so there is never a value
of function type.  No code actually used this except for one function
which asserted it shouldn't occur.  One comment mentioned it, but was
incorrect.  So we may as well remove it entirely.
2010-11-15 13:33:57 -08:00
Henri Verbeet
62fe9c4efc r600g: Add PIPE_FORMAT_L8A8_UNORM for Evergreen as well. 2010-11-15 22:20:12 +01:00
Henri Verbeet
228d0d1153 r600: Evergreen has two extra frac_bits for the sampler LOD state.
Note: this is a candidate for the 7.9 branch.
2010-11-15 22:20:12 +01:00
Henri Verbeet
aa3113ae20 r600g: Evergreen has two extra frac_bits for the sampler LOD state.
The (piglit) mipmap_limits test shows the issue very clearly.
2010-11-15 22:20:12 +01:00
Henri Verbeet
da8c877733 r600g: Cleanup the fenced_bo list in r600_context_fini(). 2010-11-15 22:20:12 +01:00
Jerome Glisse
5da246944a gallium/noop: no operation gallium driver
This driver is a fake swdri driver that perform no operations
beside allocation gallium structure and buffer for upper layer
usage.

It's purpose is to help profiling core mesa/gallium without
having pipe driver overhead hidding hot spot of core code.

scons file are likely inadequate i am unfamiliar with this
build system.

To use it simply rename is to swrast_dri.so and properly set
LIBGL_DRIVERS_PATH env variable.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-15 14:56:40 -05:00
Hui Qi Tay
e3f106b5fe llvmpipe: clean up polygon offset function in lp setup code 2010-11-15 17:21:35 +00:00
Francisco Jerez
88850b3e4f dri/nouveau: Kill a bunch of ternary operators. 2010-11-15 17:42:08 +01:00
Francisco Jerez
aceb5b3277 dri/nouveau: Fix typo. 2010-11-15 17:42:08 +01:00
Viktor Novotný
8c94c7138e dri/nouveau: Remove nouveau_class.h, finishing switch to rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:07 +01:00
Viktor Novotný
69f54d2a7e dri/nouveau nv20: Use rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:07 +01:00
Viktor Novotný
f4efc256fd dri/nouveau: nv10: Use rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:07 +01:00
Viktor Novotný
8983855012 dri/nouveau: nv04: Use rules-ng-ng headers
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:06 +01:00
Viktor Novotný
dfc2bf818b dri/nouveau: Import headers from rules-ng-ng
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-15 17:42:06 +01:00
Brian Paul
3e910faed5 evergreen: set gl_texture_image::TexFormat field in evergreenSetTexBuffer()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.
2010-11-15 09:31:33 -07:00
Brian Paul
f2f1c61950 r300: set gl_texture_image::TexFormat field in r300SetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch
2010-11-15 09:31:27 -07:00
Brian Paul
401f1efd3a r200: set gl_texture_image::TexFormat field in r200SetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.
2010-11-15 09:31:21 -07:00
Brian Paul
0ef3b298e6 r600: set gl_texture_image::TexFormat field in r600SetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.
2010-11-15 09:18:47 -07:00
Brian Paul
86abc1f104 radeon: set gl_texture_image::TexFormat field in radeonSetTexBuffer2()
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch
2010-11-15 09:18:40 -07:00
Julien Cristau
e86b4c9194 Makefile: don't include the same files twice in the tarball
src/mesa/drivers/dri/*/*/*.[chS] is a superset of
src/mesa/drivers/dri/*/server/*.[ch] and
src/mesa/drivers/dri/common/xmlpool/*.[ch].
include/GL/internal/glcore.h is already in MAIN_FILES, no need for it in
DRI_FILES too.  src/glx/Makefile was listed twice.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-15 08:46:22 -07:00
Daniel Lichtenberger
ef0720758e radeon: fix potential segfault in renderbuffer update
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31617

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-15 01:32:42 -05:00
Marek Olšák
9cf25b3d1c r300g: return shader caps from Draw for SWTCL vertex shaders 2010-11-14 23:04:18 +01:00
Marek Olšák
ed7cb289b3 r300g: clean up redundancy in draw functions 2010-11-14 19:28:04 +01:00
Eric Anholt
3b337f5cd9 i965: Fix gl_FragCoord inversion when drawing to an FBO.
This showed up as cairo-gl gradients being inverted on everyone but
Intel, where I'd apparently tweaked the transformation to work around
the bug.  Fixes piglit fbo-fragcoord.
2010-11-14 22:35:17 +08:00
Vinson Lee
d11db2a857 i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_fs.cpp: In member function 'void fs_visitor::split_virtual_grfs()':
brw_fs.cpp:2516: warning: unused variable 'reg'
2010-11-13 21:19:59 -08:00
Marek Olšák
7e2256688a r300g: fix texture border color for all texture formats
This fixes 8 texwrap format tests.
The code should handle arbitrary formats now and is cleaner.

NOTE: This is a candidate for the 7.9 branch.
2010-11-13 16:43:20 +01:00
Vinson Lee
3f6b1756f8 mesa: Clean up header file inclusion in points.h. 2010-11-13 01:16:12 -08:00
Brian Paul
56b4819932 mesa: consolidate assertions in teximage code 2010-11-12 07:21:29 -07:00
Marek Olšák
93edd15178 svga: fill out CAPs for indirect addressing
As per the ps_3_0 and vs_3_0 documentation.
The aL register in D3D9 is quite tricky to use, though.
2010-11-12 03:13:23 +01:00
Marek Olšák
5c7127c07c r600g: fill out CAPs for indirect addressing 2010-11-12 03:13:23 +01:00
Marek Olšák
d279902b40 r300g: fill out CAPs for indirect addressing
To match shader model 2.0 (it's impossible to fully implement ARL
with shader model 3.0 relative addressing).
2010-11-12 03:13:22 +01:00
Marek Olšák
abe2c0d3b0 nvfx: fill out CAPs for indirect addressing
To match shader model 2.0.
2010-11-12 03:13:22 +01:00
Marek Olšák
3c6309e2f7 nv50: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
04bafb2b55 i965g: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
5bf7d668ac i915g: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
53b7ec91ca tgsi: fill out CAPs for indirect addressing 2010-11-12 03:13:22 +01:00
Marek Olšák
cbfdf262cc gallium: add CAPs for indirect addressing and lower it in st/mesa when needed
Required because ATI and NVIDIA DX9 GPUs do not support indirect addressing
of temps, inputs, outputs, and consts (FS-only) or the hw support is so
limited that we cannot use it.

This should make r300g and possibly nvfx more feature complete.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-11-12 03:13:22 +01:00
Brian Paul
d18df9e336 tdfx: s/Format/_BaseFormat/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31560
2010-11-11 16:56:45 -07:00
Eric Anholt
6929cdd14b glsl: Free the loop state context when we free the loop state.
Since this was talloced off of NULL instead of the compile state, it
was a real leak over the course of the program.  Noticed with
valgrind --leak-check=full --show-reachable=yes.  We should really
change these passes to generally get the compile context as an argument
so simple mistakes like this stop mattering.
2010-11-11 15:12:37 -08:00
Brian Paul
78587ea012 mesa: fix glDeleteBuffers() regression
This fixes a regression (failed assertion) from commit
c552f273f5 which was hit if glDeleteBuffers()
was called on a buffer that was never bound.

NOTE: this is a candidate for the 7.9 branch.
2010-11-11 15:31:36 -07:00
Brian Paul
c552f273f5 mesa: make glIsBuffer() return false for never bound buffers
Use a dummy buffer object as we do for frame/renderbuffer objects.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31514

Note: this is a candidate for the 7.9 branch.
2010-11-11 14:49:53 -07:00
Aras Pranckevicius
d67df5dd9d glsl: fix crash in loop analysis when some controls can't be determined
Fixes loop-07.frag.
2010-11-11 10:49:37 -08:00
Keith Whitwell
7fb16423cc r600g: enforce minimum stride on render target texture images
Fixes piglit/fbo_readpixels since staging upload changes.
2010-11-11 16:20:24 +00:00
Keith Whitwell
8a3c181e9c r600g: do not try to use staging resource for depth textures
Currently r600_resource_copy_region() will turn these copies into
transfers + memcpys, so to avoid recursion we must not turn those
transfers back into blits.
2010-11-11 15:43:31 +00:00
Brian Paul
b3b6476695 mesa: handle more pixel types in mipmap generation code
NOTE: This is a candidate for the 7.9 branch.
2010-11-11 08:33:42 -07:00
Brian Paul
79c65410c1 mesa: add missing formats in _mesa_format_to_type_and_comps()
NOTE: this is a candidate for the 7.9 branch
2010-11-11 08:31:21 -07:00
Brian Paul
c9126d66fa mesa: improve error message 2010-11-11 07:43:46 -07:00
Brian Paul
624661cae4 mesa: #include mfeatures.h in enums.h 2010-11-11 07:43:46 -07:00
Keith Whitwell
6baad55f15 r600g: guard experimental s3tc code with R600_ENABLE_S3TC 2010-11-11 14:30:09 +00:00
Lucas Stach
089056a5f3 nvfx: fill PIPE_CAP_PRIMITIVE_RESTART and PIPE_CAP_SHADER_STENCIL_EXPORT
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-11-11 14:55:46 +01:00
Francisco Jerez
cdb38b5d3d dri/nouveau: Split hardware/software TNL instantiation more cleanly. 2010-11-11 14:50:50 +01:00
Vinson Lee
dc524adee2 mesa: Fix printf format warnings. 2010-11-10 17:30:59 -08:00
Ian Romanick
bcef51c3b8 mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample
Previously queries of MAX_SAMPLES were only allowed with
ARB_framebuffer_object, but EXT_framebuffer_multisample also enables
this query.  This seems to only effect the i915.  All other drivers
support both extensions or neither extension.

This patch is based on a patch that Kenneth sent along with the report.

NOTE: this is a candidate for the 7.9 branch.

Reported-by: Kenneth Waters <kwaters@chromium.org>
2010-11-10 16:00:03 -08:00
Jakob Bornecrantz
0faa7ada84 libgl-xlib: Use sw helper instead of roll your own 2010-11-10 23:40:18 +00:00
Jakob Bornecrantz
89deebb1af graw: Use inline sw helper instead of roll your own loader 2010-11-10 23:05:17 +00:00
Jakob Bornecrantz
d4c60575f8 galahad: Correct the name of the scons library 2010-11-10 23:05:17 +00:00
Jerome Glisse
8e0230a85c r600g: allow driver to work without submitting cmd to GPU
For driver performance analysis it usefull to be able to
disable as much as possible the GPU interaction so that
one can profile the userspace only.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-10 16:49:50 -05:00
Robert Hooker
e8b2d36723 intel: Add a new B43 pci id.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
2010-11-10 13:37:47 -08:00
Eric Anholt
9effc1adf1 i965: re-enable gen6 IF statements in the fragment shader.
IF statements were getting flattened while they were broken.  With
Zhenyu's last fix for ENDIF's type, everything appears to have lined
up to actually work.

This regresses two tests:
glsl1-! (not) operator (1, fail)
glsl1-! (not) operator (1, pass)

but fixes tests that couldn't work before because the IFs couldn't be
flattened:
glsl-fs-discard-01
occlusion-query-discard

(and, naturally, this should be a performance improvement for apps
that actually use IF statements to avoid executing a bunch of code).
2010-11-10 13:33:27 -08:00
Eric Anholt
490c23ee6b i965: Work around strangeness in swizzling/masking of gen6 math.
Sometimes we swizzled in a different channel it looked like, and
sometimes we swizzled in zero.  Or something.

Having looked at the output of another code generator for this chip,
this is approximately what they do, too: use align1 math on
temporaries, and then move the results into place.

Fixes:
glean/vp1-EX2 test
glean/vp1-EXP test
glean/vp1-LG2 test
glean/vp1-RCP test (reciprocal)
glean/vp1-RSQ test 1 (reciprocal square root)
shaders/glsl-cos
shaders/glsl-sin
shaders/glsl-vs-masked-cos
shaders/vpfp-generic/vp-exp-alias
2010-11-10 12:36:23 -08:00
Francisco Jerez
47c471f281 meta: Handle bitmaps with alpha test enabled.
Acked-by: Brian Paul <brianp@vmware.com>
2010-11-10 21:24:31 +01:00
Zack Rusin
f623d0c1c2 gallivm: implement indirect addressing over inputs
Instead of messing with the callers simply copy our inputs into a
alloca array at the beginning of the function and then use it.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2010-11-10 13:00:35 -05:00
Roland Scheidegger
aad65fa112 mesa: remove unneeded DD_POINT_SIZE and DD_LINE_WIDTH tricaps
DD_POINT_SIZE was broken for quite some time, and the only driver (r200) relying
on this no longer needs it.
Both DD_POINT_SIZE and DD_LINE_WIDTH have no users left outside of debugging
output, hence instead of fixing DD_POINT_SIZE setting just drop both of them -
there was a plan to remove tricaps flags entirely at some point.
2010-11-10 17:24:42 +01:00
Roland Scheidegger
c7192ab11f r200: fix r200 large points
DD_POINT_SIZE got never set for some time now (as it was set only in ifdefed
out code), which caused the r200 driver to use the point primitive mistakenly
in some cases which can only do size 1 instead of point sprite. Since the
logic to use point instead of point sprite prim is flaky at best anyway (can't
work correctly for per-vertex point size), just drop this and always emit point
sprites (except for AA points) - reasons why the driver tried to use points for
size 1.0 are unknown though it is possible they are faster or more conformant.
Note that we can't emit point sprites without point sprite cntl as that might
result in undefined point sizes, hence need drm version check (which was
unnecessary before as it should always have selected points). An
alternative would be to rely on the RE point size clamp controls which could
clamp the size to 1.0 min/max even if the SE point size is undefined, but currently
always use 0 for min clamp. (As a side note, this also means the driver does
not honor the gl spec which mandates points, but not point sprites, with zero size
to be rendered as size 1.)
This should fix recent reports of https://bugs.freedesktop.org/show_bug.cgi?id=702.
This is a candidate for the mesa 7.9 branch.
2010-11-10 17:24:41 +01:00
Chia-I Wu
aa139a14ba egl_dri2: Fix __DRI_DRI2 version 1 support.
Correctly set __DRI_API_OPENGL flag.
2010-11-10 23:57:50 +08:00
Marek Olšák
93c04749be r300g: turn magic numbers into names in the hyperz code 2010-11-10 15:14:25 +01:00
Marek Olšák
1d28936dea r300g: rename has_hyperz -> can_hyperz 2010-11-10 15:14:25 +01:00
Marek Olšák
88ddfc57e4 r300g: mention ATI in the renderer string 2010-11-10 15:14:25 +01:00
Keith Whitwell
9a04eca2f8 ws/r600: match bo_busy shared/fence logic in bo_wait
Fixes crash in piglit depthrange-clear.
2010-11-10 11:04:38 +00:00
Vinson Lee
5b8ed2f6d2 mesa: Clean up header file inclusion in pixelstore.h. 2010-11-10 00:49:53 -08:00
Vinson Lee
700add5707 mesa: Clean up header file inclusion in pixel.h. 2010-11-10 00:46:27 -08:00
Zhenyu Wang
65972f992f Revert "i965: VS use SPF mode on sandybridge for now"
This reverts commit 9c39a9fcb2.

Remove VS SPF mode, conditional instruction works for VS now.
2010-11-10 08:17:45 -05:00
Zhenyu Wang
9249af17b8 i965: fix dest type of 'endif' on sandybridge
That should also be immediate value for type W.
2010-11-10 08:17:29 -05:00
Eric Anholt
f289dcd849 i965: Add support for math on constants in gen6 brw_wm_glsl.c path.
Fixes 10 piglit cases that were assertion failing.
2010-11-09 20:20:00 -08:00
Ian Romanick
ad8cb131d8 ir_to_mesa: Refactor code for emitting DP instructions 2010-11-09 18:09:41 -08:00
Eric Anholt
f00929cbdd i965: Allow OPCODE_SWZ to put immediates in the first arg.
Fixes assertion failure with texture swizzling in the GLSL path when
it's triggered (such as gen6 FF or ARB_fp shadow comparisons).

Fixes:
texdepth
texSwizzle
fp1-DST test
fp1-LIT test 3
2010-11-09 17:18:52 -08:00
Kenneth Graunke
afb6fb9a92 glsl: Remove unnecessary "unused variable" warning suppression.
The "instructions" variable -is- used, so the cast to void can go away.
2010-11-09 15:55:40 -08:00
Peter Clifton
efb0417040 intel: Add assert check for blitting alignment.
Also fixup code comment to reflect that the GPU requires DWORD
alignment, but in this case does not actually pass the value "in
DWORDs" as I previously stated.
2010-11-09 14:35:28 -08:00
Eric Anholt
00391c7941 Revert "intel: Fix the client-side swapbuffers throttling."
This reverts commit 76360d6abc.  On
second thought, it turned out that sync objects also used the
wait_rendering API like this, and would need the same treatment, and
so wait_rendering itself is fixed in libdrm now.
2010-11-09 14:03:04 -08:00
Eric Anholt
76360d6abc intel: Fix the client-side swapbuffers throttling.
We were asking for a wait to GTT read (all GPU rendering to it
complete), instead of asking for all GPU reading from it to be
complete.  Prevents swapbuffers-based apps from running away with
rendering, and produces a better input experience.
2010-11-09 13:30:27 -08:00
Ian Romanick
956ae44dcf glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow
NOTE: this is a candidate for the 7.9 branch.
2010-11-09 13:05:07 -08:00
José Fonseca
10740acf46 gallivm: Allocate TEMP/OUT arrays only once. 2010-11-09 20:36:28 +00:00
Zack Rusin
528c3cd241 gallivm: implement indirect addressing of the output registers 2010-11-09 20:36:28 +00:00
Vinson Lee
520140a6c9 winsys/xlib: Add cygwin to SConscript.
Fixes SCons NameError exception on Cygwin.
2010-11-09 12:31:11 -08:00
Keith Whitwell
63c3e3a3dc r600: fix my pessimism about PIPE_TRANSFER_x flags
For some reason I though we needed the _DISCARD flag to avoid
readbacks, which isn't true at all.  Now write operations should
pipeline properly, gives a good speedup to demos/tunnel.
2010-11-09 20:12:46 +00:00
Keith Whitwell
9f7ec103e2 r600g: translate ARR instruction 2010-11-09 20:12:46 +00:00
Keith Whitwell
c2c55547dc r600g: attempt to turn on DXTn formats
Seems to sort-of work for non-mipmapped textures.  Better than just
black anyway.
2010-11-09 20:12:46 +00:00
Keith Whitwell
e3ea4aec03 r600g: avoid recursion with staged uploads
Don't use an intermediate for formats which don't support hardware
blits under u_blitter.c, as these will recursively attempt to create a
transfer.
2010-11-09 20:12:46 +00:00
Brian Paul
6e2e136428 mesa: no-op glBufferSubData() on size==0
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31439

NOTE: this is a candidate for the 7.9 branch
2010-11-09 12:24:51 -07:00
Brian Paul
61ea76c8da softpipe: can't no-op depth test stage when occlusion query is enabled
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31479
2010-11-09 11:44:34 -07:00
Chia-I Wu
5b6ec5a553 st/dri: Add support for surfaceless current contexts.
Tested with Wayland.
2010-11-10 02:01:04 +08:00
Chia-I Wu
3418f74a94 docs: Update egl docs. 2010-11-10 01:31:38 +08:00
Chia-I Wu
dbacbb8219 autoconf: Add --enable-gallium-egl.
This option comes handy when we want to build gallium DRI drivers but
not st/egl.
2010-11-10 00:57:49 +08:00
Vinson Lee
3e6a05b1aa mesa: Clean up header file inclusion in nvprogram.h. 2010-11-09 06:22:25 -08:00
Vinson Lee
0c123679fc mesa: Clean up header file inclusion in multisample.h. 2010-11-09 06:08:29 -08:00
Vinson Lee
c509bf91ec mesa: Clean up header file inclusion in matrix.h. 2010-11-09 06:00:01 -08:00
Vinson Lee
e09800432b mesa: Clean up header file inclusion in lines.h. 2010-11-09 05:47:17 -08:00
Vinson Lee
a20e440c65 mesa: Clean up header file inclusion in light.h. 2010-11-09 05:35:24 -08:00
Vinson Lee
934fc80b06 mesa: Add missing header and forward declarations in dd.h. 2010-11-09 05:13:48 -08:00
Vinson Lee
90394b2d96 mesa: Clean up header file inclusion in image.h. 2010-11-09 05:00:44 -08:00
Thomas Hellstrom
24c6c41bd0 gallium/targets: Trivial crosscompiling fix
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:50:12 +01:00
Thomas Hellstrom
0d5b4b320c svga/drm: Optionally resolve calls to powf during link-time
When linked with certain builds of libstdc++, it appears like powf is resolved
by a symbol in that library. Other builds of libstdc++ doesn't contain that
symbol resulting in a linker / loader error. Optionally
resolve that symbol and replace it with calls to logf and expf.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:25 +01:00
Thomas Hellstrom
8e630fad72 st/egl: Fix build for include files in nonstandard places
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:24 +01:00
Thomas Hellstrom
6af2a7fe2c mesa: Add talloc includes for gles
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:24 +01:00
Thomas Hellstrom
675aec8178 egl: Add an include for size_t
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-09 12:31:24 +01:00
Zack Rusin
9d9df964c4 scons: build the xorg state trackers only when env includes drm 2010-11-09 10:41:59 +00:00
Vinson Lee
d79d942b2e mesa: Clean up header file inclusion in histogram.h. 2010-11-09 01:14:55 -08:00
Vinson Lee
5b3d6bd39e mesa: Clean up header file inclusion in hint.h. 2010-11-09 01:12:34 -08:00
Vinson Lee
63f1740a5d mesa: Clean up header file inclusion in framebuffer.h. 2010-11-09 01:04:22 -08:00
Vinson Lee
b35d3b33e7 mesa: Clean up header file inclusion in fog.h. 2010-11-09 00:58:46 -08:00
Vinson Lee
08354667a3 mesa: Clean up header file inclusion in ffvertex_prog.h. 2010-11-09 00:56:02 -08:00
Vinson Lee
6121730e74 mesa: Clean up header file inclusion in fbobject.h. 2010-11-09 00:52:49 -08:00
Chad Versace
b62c1c4595 glsl: Fix ir_expression::constant_expression_value()
When the type of the ir_expression is error_type, return NULL.
This fixes bug 31371.
2010-11-09 00:50:54 -08:00
Johann Rudloff
d7855ee332 radeon: Implement GL_OES_EGL_image
agd5f: add support to radeon/r200/r300 as well
2010-11-08 19:59:53 -05:00
Johann Rudloff
b42e562a11 radeon: Implement __DRI_IMAGE and EGL_MESA_image_drm 2010-11-08 19:59:53 -05:00
Alex Deucher
4990b771de egl_dri2: Add radeon chip ids 2010-11-08 19:59:53 -05:00
Johann Rudloff
f9b5201dbd radeon: Implement EGL_MESA_no_surface_extension 2010-11-08 19:59:53 -05:00
Kenneth Graunke
a457ca7844 ir_dead_functions: Actually free dead functions and signatures.
This makes linked shaders use around 36k less memory since the
built-in prototypes are now freed.
2010-11-08 16:22:15 -08:00
Vinson Lee
ef6967ddc2 graw: Add struct pipe_surface forward declaration.
Fixes this GCC warning.
graw.h:93: warning: 'struct pipe_surface' declared inside parameter list
graw.h:93: warning: its scope is only this definition or declaration,
which is probably not what you want
2010-11-08 11:55:30 -08:00
Mario Kleiner
d8eef5196f mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.
A call to radeon_prepare_render() at the beginning of draw
operations was placed too deep in the call chain,
inside r300RunRenderPrimitive(), instead of
r300DrawPrims() where it belongs. This leads to
emission of stale target color renderbuffer into the cs if
bufferswaps via page-flipping are used, and thereby causes
massive rendering corruption due to unsynchronized
rendering into the active frontbuffer.

This patch fixes such problems for use with the
upcoming radeon page-flipping patches.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-11-08 13:53:23 -05:00
Benjamin Franzke
46c1970067 r600g: implement texture_get_handle (needed for eglExportDRMImageMESA) 2010-11-08 13:44:54 -05:00
Peter Clifton
10b9e018ca intel: Fix emit_linear_blit to use DWORD aligned width blits
The width of the 2D blits used to copy the data is defined as a 16-bit
signed integer, but the pitch must be DWORD aligned. Limit to an integral
number of DWORDs, (1 << 15 - 4) rather than (1 << 15 -1).

Fixes corruption to data uploaded with glBufferSubData.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
2010-11-08 10:14:17 -08:00
Alex Deucher
5b15b5f4a8 r600c: properly align mipmaps to group size
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31400
2010-11-08 12:06:15 -05:00
Michal Krol
136ff67ce8 graw: Export graw_save_surface_to_file().
Allows applications to dump surfaces to file without
referencing gallium/auxiliary entry points statically.

Existing test apps have been modified such that
they save the contents of the fronbuffer only
when the `-o' option's specified.
2010-11-08 17:24:11 +01:00
Michal Krol
9e7132b52d os: Open file streams in binary mode.
Otherwise we'll get garbled data on Windows.
2010-11-08 17:24:11 +01:00
Vinson Lee
962967d080 mesa: Clean up header file inclusion in extensions.h. 2010-11-07 21:15:45 -08:00
Vinson Lee
0be44c9406 mesa: Clean up header file inclusion in enable.h. 2010-11-07 21:09:32 -08:00
Vinson Lee
82cc8261d3 mesa: Clean up header file inclusion in drawtex.h. 2010-11-07 21:05:01 -08:00
Vinson Lee
5c2558884f mesa: Clean up header file inclusion in drawpix.h. 2010-11-07 21:02:31 -08:00
Vinson Lee
5953eac7ac mesa: Clean up header file inclusion in depthstencil.h. 2010-11-07 20:57:32 -08:00
Vinson Lee
e0bbb8e5a4 mesa: Clean up header file inclusion in depth.h. 2010-11-07 20:54:33 -08:00
Vinson Lee
76a5fed501 mesa: Clean up header file inclusion in debug.h. 2010-11-07 20:47:10 -08:00
Vinson Lee
a408dbeb37 mesa: Clean up header file inclusion in convolve.h. 2010-11-07 20:39:54 -08:00
Vinson Lee
cc0c45e7c5 mesa: Clean up header file inclusion in colortab.h. 2010-11-07 20:23:15 -08:00
Vinson Lee
fdf3174007 mesa: Clean up header file inclusion in buffers.h. 2010-11-07 20:00:32 -08:00
Vinson Lee
f26565f221 mesa: Clean up header file inclusion in blend.h. 2010-11-07 19:54:00 -08:00
Vinson Lee
42a8af9239 mesa: Clean up header file inclusion in attrib.h. 2010-11-07 19:49:12 -08:00
Vinson Lee
908272b183 mesa: Clean up header file inclusion in atifragshader.h. 2010-11-07 19:41:42 -08:00
Brian Paul
11dd228415 mesa: make fixed-pt and byte-valued arrays a runtime feature
These ES1 features were only tested for in the vertex array code.
Checking the ctx->API field at runtime is cleaner than the #ifdef
stuff and supports choosing the API at runtime.
2010-11-07 18:35:35 -07:00
Brian Paul
802bd6b705 mesa: remove stray GL_FLOAT case in _mesa_is_legal_format_and_type() 2010-11-07 18:33:53 -07:00
Brian Paul
dd28b4c1fc mesa: implement uint texstore code
We used float temporary images before which could lose precision for
uint-valued texture images.
2010-11-07 18:33:42 -07:00
Brian Paul
90c52c26d8 mesa: rename vars in pixel pack/unpack code 2010-11-07 18:33:20 -07:00
Brian Paul
e54d5a9d68 mesa: consolidate pixel packing/unpacking code 2010-11-07 18:33:07 -07:00
Vinson Lee
3a223c3098 mesa: Clean up header file inclusion in arrayobj.h. 2010-11-07 14:29:21 -08:00
Henri Verbeet
9f06411645 r600g: Mention AMD in the renderer string. 2010-11-07 18:40:12 +01:00
Vinson Lee
6bf0ac0916 mesa: Include mfeatures.h in api_validate.c for FEATURE_* symbols. 2010-11-06 21:13:40 -07:00
Vinson Lee
d421149cc8 mesa: Include mfeatures.h in api_loopback for FEATURE_beginend. 2010-11-06 21:05:16 -07:00
Vinson Lee
fb83400f6b mesa: Clean up header file inclusion in api_validate.h. 2010-11-06 20:56:15 -07:00
Vinson Lee
af12de279e mesa: Clean up header file inclusion in api_loopback.h. 2010-11-06 20:50:13 -07:00
Vinson Lee
31bdc53057 mesa: Clean up header file inclusion in version.h. 2010-11-06 20:40:13 -07:00
Vinson Lee
7a33b1c0a9 mesa: Clean up header file inclusion in accum.h. 2010-11-06 20:27:45 -07:00
Eric Anholt
d348b0c72d mesa: Fix delayed state flagging for EXT_sso-related program changes.
Flushing the vertices after having already updated the state doesn't
do any good.  Fixes useshaderprogram-flushverts-1.  As a side effect,
by moving it to the right place we end up skipping no-op state changes
for traditional glUseProgram.
2010-11-06 11:44:32 -07:00
Francisco Jerez
8eaa97592a meta: Don't try to disable cube maps if the driver doesn't expose the extension.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-06 02:40:21 +01:00
Francisco Jerez
2e64c2209e vbo: Avoid unnecessary copy to/from current in vertex format upgrade.
Rebuilding the vertex format from scratch every time we see a new
vertex attribute is rather costly, new attributes can be appended at
the end avoiding a copy to current and then back again, and the full
attr pointer recalculation.

In the not so likely case of an already existing attribute having its
size increased the old behavior is preserved, this could be optimized
more, not sure if it's worth it.

It's a modest improvement in FlightGear (that game punishes the VBO
module pretty hard in general, framerate goes from some 46 FPS to 50
FPS with the nouveau classic driver).

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-06 01:59:59 +01:00
Jakob Bornecrantz
f1600d3a97 scons: Unify state tracker SConscripts 2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
7e9f5eab4e scons: Move dependancy checks to the main gallium scons file 2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
c0db7854d5 scons: Check for libdrm_[intel|radeon] as well
And run SConscripts if they are present.
Also make dri depend on both drm and x11.
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
98d6ed8742 scons: Check for pkg-config before trying to use it
Silences warning about missing packages
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
b4ac0adb75 scons: Detabify
Drivers scons files for a later time
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz
834cde5844 scons: Remove old pipebuffer SConscript 2010-11-05 20:58:49 +00:00
Brian Paul
e82fddfcd3 softpipe: disable vertex texturing with draw/llvm
This is a temporary work around to prevent crashes with glean/glsl1
(for example) which try to do vertex shader texturing.
2010-11-05 14:41:40 -06:00
Brian Paul
55c5408ad0 gallivm: add const qualifiers, fix comment string 2010-11-05 08:51:53 -06:00
Brian Paul
e8d6b2793f gallivm: alloca() was called too often for temporary arrays
Need to increment the array index to point to the last value.
Before, we were calling lp_build_array_alloca() over and over for
no reason.
2010-11-05 08:49:57 -06:00
Vinson Lee
3168c6ff1a i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_wm_fp.c: In function 'brw_wm_pass_fp':
brw_wm_fp.c:966: warning: 'last_inst' may be used uninitialized in this function
brw_wm_fp.c:966: note: 'last_inst' was declared here
2010-11-04 17:42:00 -07:00
Vinson Lee
03577f8250 i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_wm_fp.c: In function 'precalc_tex':
brw_wm_fp.c:666: warning: 'tmpcoord.Index' may be used uninitialized in this function
2010-11-04 17:39:17 -07:00
Vinson Lee
eba2ad6de2 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_dataflow.c: In function 'get_readers_normal_read_callback':
radeon_dataflow.c:472: warning: ISO C90 forbids mixed declarations and code
2010-11-04 17:25:16 -07:00
Brian Paul
c8f1687ce7 llvmpipe: added some debug assertions, but disabled 2010-11-04 18:21:45 -06:00
Vinson Lee
86559ce2d8 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_schedule.c: In function 'merge_presub_sources':
radeon_pair_schedule.c:312: warning: ISO C90 forbids mixed declarations and code
2010-11-04 17:18:46 -07:00
Francisco Jerez
7831994868 meta: Fix incorrect rendering of the bitmap alpha component.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-04 13:58:54 -06:00
Francisco Jerez
d846362389 meta: Don't leak alpha function/reference value changes.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-04 13:58:02 -06:00
Brian Paul
ef6b7e0a30 tgsi: remove unused function 2010-11-04 13:35:20 -06:00
Tilman Sauerbeck
646a8b7e1d st/mesa: Reset the constant buffers before destroying the pipe context.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-04 20:01:25 +01:00
Brian Paul
e7f5d19a11 gallivm: implement execution mask for scatter stores 2010-11-04 10:01:28 -06:00
Brian Paul
fb94747b66 gallivm: added lp_elem_type() 2010-11-04 10:00:58 -06:00
Brian Paul
ede232e989 gallivm: add pixel offsets in scatter stores
We want to do the scatter store to sequential locations in memory
for the vector of pixels we're processing in SOA format.
2010-11-04 09:31:59 -06:00
Brian Paul
5b294a5d17 gallivm: added debug code to dump temp registers 2010-11-04 09:28:06 -06:00
Michal Krol
5d28d2f9d4 graw/gdi: Fix window dimensions.
The requested window size is of the client area,
so account for surrounding borders and bars when
creating the window.
2010-11-04 15:12:47 +01:00
Michal Krol
c69979f243 scons: Hook-up graw-gdi target. 2010-11-04 14:34:27 +01:00
Michal Krol
29beaed6dc graw/gdi: Initial commit. 2010-11-04 14:34:27 +01:00
Guillermo S. Romero
560ad7e599 r300g: Do not use buf param before checking for NULL.
Commit 8dfafbf086 forgot to update r300g.
There is a buf == NULL check, but buf is used before for var init.

Tested-by: Guillermo S. Romero <gsromero@infernal-iceberg.com>
2010-11-04 13:26:24 +00:00
Hui Qi Tay
315f8daab1 llvmpipe: added llvm offset setup code 2010-11-04 12:57:30 +00:00
Michal Krol
420400f67f tgsi/build: Reduce interface clutter.
Make private those functions that are used internally only.
2010-11-04 12:20:14 +01:00
Michal Krol
f93d6f929f tgsi/exec: Get rid of obsolete condition codes. 2010-11-04 11:51:10 +01:00
Michal Krol
ee9366ab36 tgsi/exec: Cleanup the remaining arithmetic instructions.
As a result remove some nasty macros.
2010-11-04 11:37:24 +01:00
Vinson Lee
d3fcadf840 dri/nouveau: Silence uninitialized variable warning.
Fixes this GCC warning.
nouveau_vbo_t.c: In function 'nv10_vbo_render_prims':
nouveau_render_t.c:161: warning: 'max_out' may be used uninitialized in this function
nouveau_render_t.c:161: note: 'max_out' was declared here
2010-11-03 18:20:22 -07:00
Brian Paul
3ded3e98ff gallivm: add some LLVM var labels 2010-11-03 17:34:07 -06:00
Brian Paul
2fefbc79ac gallivm: implement scatter stores into temp register file
Something is not quite right, however.  The piglit tests mentioned in
fd.o bug 31226 still don't pass.
2010-11-03 17:34:07 -06:00
Kenneth Graunke
c180e95d26 ir_reader: Fix some potential NULL pointer dereferences.
Found by inspection.
2010-11-03 13:39:42 -07:00
Kenneth Graunke
e751ce39bf ir_reader: Remove useless error check.
It's already been determined that length == 3, so clearly swiz->next is
a valid S-Expression.
2010-11-03 13:39:42 -07:00
Kenneth Graunke
0fd665ca63 ir_reader: Return a specific ir_dereference variant.
There's really no reason to return the base class when we have more
specific information about what type it is.
2010-11-03 13:39:42 -07:00
Kenneth Graunke
d2c23ac82a glsl: Don't print a useless space at the end of an S-Expression list.
We really only want to print spaces -between- elements, not after each
element.  This cleans up error messages from IR reader, making them
(mildly) easier to read.
2010-11-03 13:39:41 -07:00
Kenneth Graunke
6c4a83ca3e Refresh autogenerated file builtin_function.cpp. 2010-11-03 13:39:41 -07:00
Kenneth Graunke
91b72864b0 glsl/builtins: Clean up some ugly autogenerated code in atan.
In particular, calling the abs function is silly, since there's already
an expression opcode for that.  Also, assigning to temporaries then
assigning those to the final location is rather redundant.
2010-11-03 13:39:41 -07:00
Kenneth Graunke
84566c770a glsl/builtins: Rename 'x' to 'y_over_x' in atan(float) implementation.
For consistency with the vec2/vec3/vec4 variants.
2010-11-03 13:39:41 -07:00
José Fonseca
01b39b053b r600g: Swap the util_blitter_destroy call order.
Trivial change that avoids a segmentation fault when the blitter state
happens to be bound when the context is destroyed.

The free calls should probably removed altogether in the future -- the
responsibility to destroy the state atoms lies with whoever created it,
and the safest thing for the pipe driver is to not touch any bound state
in its destructor.
2010-11-03 20:25:13 +00:00
Brian Paul
b29ca2a561 mesa: code to unpack RGBA as uints 2010-11-03 11:18:52 -06:00
José Fonseca
54f2116877 xorg/vmwgfx: Link libkms when available. 2010-11-03 15:41:06 +00:00
José Fonseca
d49dfe66cf st/xorg: Detect libkms with scons too. 2010-11-03 15:21:51 +00:00
José Fonseca
12376d8ea3 st/xorg: Add missing \n to error message. 2010-11-03 15:14:29 +00:00
José Fonseca
ab2305b586 xorg/vmwgfx: Add missing source file to SConscript. 2010-11-03 14:02:40 +00:00
Eric Anholt
2aa738bf26 intel: Remove leftover dri1 locking fields in the context. 2010-11-03 06:08:27 -07:00
Eric Anholt
5716ad2425 intel: Remove duplicated teximage miptree to object miptree promotion.
intel_finalize_mipmap_tree() does this optimization too, just more
aggressively.
2010-11-03 06:08:27 -07:00
Eric Anholt
0300c9ab54 intel: Avoid taking logbase2 of several things that we max.
logbase2(max(width, height, depth)) ==
max(logbase2(width), logbase2(height), logbase2(depth)), but in 60
bytes less code.
2010-11-03 06:08:27 -07:00
Eric Anholt
e42ce160b1 i965: Remove dead intel_structs.h file. 2010-11-03 06:08:27 -07:00
Eric Anholt
6ad0283f48 intel: Remove the magic unaligned memcpy code.
In testing on Ironlake, the histogram of clocks/pixel results for the
system memcpy and magic unaligned memcpy show no noticeable difference
(and no statistically significant difference with the 5510 samples
taken, though the stddev is large due to what looks like the cache
effects from the different texture sizes used).
2010-11-03 06:08:27 -07:00
Eric Anholt
bb15408350 intel: Annotate debug printout checks with unlikely().
This provides the optimizer with hints about code hotness, which we're
quite certain about for debug printouts (or, rather, while we
developers often hit the checks for debug printouts, we don't care
about performance while doing so).
2010-11-03 06:08:27 -07:00
Brian Paul
b19b858060 egl/gdi: fix typo: xsurf->gsurf 2010-11-03 07:04:42 -06:00
Keith Whitwell
32bb65217e evergreeng: set hardware pixelcenters according to gl_rasterization_rules 2010-11-03 11:16:04 +00:00
Keith Whitwell
d6b6a0bc17 evergreeng: respect linewidth state, use integer widths only
Discard fractional bits from linewidth.  This matches the nvidia
closed drivers, my reading of the OpenGL SI and current llvmpipe
behaviour.

It looks a lot nicer & avoids ugliness where lines alternate between n
and n+1 pixels in width along their length.

Also fix up r600g to match.
2010-11-03 10:55:22 +00:00
Keith Whitwell
ee07e0e39a r600g: don't call debug_get_bool_option for tiling more than once 2010-11-03 10:55:22 +00:00
Keith Whitwell
b3462601cb evergreeng: protect against null constant buffers
Should do better than this and actually unbind the buffer, but haven't
yet gotten it to work.
2010-11-03 10:55:22 +00:00
Chia-I Wu
3f7876d76f st/egl: Use native_display_buffer for EGL_MESA_drm_image.
native_display_buffer is just a wrapper to resource_{from,get}_handle
for drm backend.
2010-11-03 17:50:25 +08:00
Chia-I Wu
af977b5382 st/egl: Add native_display_buffer interface.
The interface is a wrapper to pipe_screen::resource_from_handle and
pipe_screen::resource_get_handle.  A winsys handle is
platform-dependent.
2010-11-03 17:47:08 +08:00
Chia-I Wu
a5f4338fc4 st/egl: Add extern "C" wrapper to native.h.
This allows a backend to be written in C++.
2010-11-03 17:47:08 +08:00
Keith Whitwell
c3974dc837 r600g: set hardware pixel centers according to gl_rasterization_rules
These were previously being left in the default (D3D) mode.  This mean
that triangles were drawn slightly incorrectly, but also because this
state is relied on by the u_blitter code, all blits were half a pixel
off.
2010-11-03 09:36:01 +00:00
Keith Whitwell
7b120ceac8 r600g: remove unused flink, domain fields from r600_resource
These were being set but not used anywhere.
2010-11-03 09:36:01 +00:00
Keith Whitwell
d4fab99c1c r600g: use a buffer in GTT as intermediate on texture up and downloads
Generalize the existing tiled_buffer path in texture transfers for use
in some non-tiled up and downloads.

Use a staging buffer, which the winsys will restrict to GTT memory.

GTT buffers have the major advantage when they are mapped, they are
cachable, which is a very nice property for downloads, usually the CPU
will want to do look at the data it downloaded.
2010-11-03 09:36:01 +00:00
Keith Whitwell
29c4a15bf6 r600g: propogate resource usage flags to winsys, use to choose bo domains
This opens the question of what interface the winsys layer should
really have for talking about these concepts.

For now I'm using the existing gallium resource usage concept, but
there is no reason not use terms closer to what the hardware
understands - eg. the domains themselves.
2010-11-03 09:36:01 +00:00
Keith Whitwell
14c0bbf469 r600g: propagate usage flags in texture transfers 2010-11-03 09:36:01 +00:00
Chia-I Wu
04ae53ca8a st/egl: Add support for EGL_MATCH_NATIVE_PIXMAP.
Added for completeness.  It makes sense to have such mechanism, but I am
not aware of any user of that..
2010-11-03 17:17:29 +08:00
Chia-I Wu
b8cb14209a st/egl: Add support for swap interval and swap behavior.
The value of EGL_MAX_SWAP_INTERVAL and whether
EGL_SWAP_BEHAVIOR_PRESERVED_BIT is set will depend on the native
backend used.
2010-11-03 16:26:57 +08:00
Chia-I Wu
828d944fd6 st/egl: Remove flush_frontbuffer and swap_buffers.
They are deprecated by native_surface::present and there is no user of
them.
2010-11-03 16:08:47 +08:00
Chia-I Wu
250d81da25 d3d1x: Use native_surface::present.
Replace native_surface::flush_frontbuffer and
native_surface::swap_buffers calls by native_surface::present calls.
2010-11-03 16:08:44 +08:00
Chia-I Wu
0ae4b23c53 st/egl: Use native_surface::present callback.
Replace native_surface::flush_frontbuffer and
native_surface::swap_buffers calls by native_surface::present calls.
2010-11-03 16:08:23 +08:00
Chia-I Wu
94bf657b23 st/egl: Add native_surface::present callback.
The callback presents the given attachment to the native engine.  It
allows the swap behavior and interval to be controlled.  It will replace
native_surface::flush_frontbuffer and native_surface::swap_buffers
shortly.
2010-11-03 16:04:59 +08:00
Chia-I Wu
c9186bd588 egl: Set up the pthread key even TLS is used.
We have to rely on the pthread key destructor to free the current thread
info when a thread exits.
2010-11-03 13:34:17 +08:00
Vinson Lee
93a7e6d94e st/vega: Remove unnecessary headers. 2010-11-02 17:13:44 -07:00
Brian Paul
61f25216e3 mesa: silence new warnings in texobj.c
Silences warning such as:
main/texobj.c:442:40: warning: ISO C99 requires rest arguments to be used
main/texobj.c:498:58: warning: ISO C99 requires rest arguments to be used
2010-11-02 17:41:00 -06:00
Vinson Lee
6f90a7cbff savage: Remove unnecessary header. 2010-11-02 16:23:30 -07:00
Eric Anholt
689def8bbc intel: For batch, use GTT mapping instead of writing to a malloc and copying.
No measurable performance difference on cairo-perf-trace, but
simplifies the code and should have cache benefit in general.
2010-11-02 14:24:42 -07:00
Eric Anholt
1210aa7551 mesa: Don't compute an unused texture completeness debug string.
This showed up at about 1% on cairo-gl firefox-talos-gfx, where
glClear() is called while a texture is incomplete.
2010-11-02 14:24:42 -07:00
Tilman Sauerbeck
965c8a3f1d st/mesa: Reset the index buffer before destroying the pipe context.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:40 +01:00
Tilman Sauerbeck
52ba68d0b0 r600g: Destroy the winsys in r600_destroy_screen().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
907efeea18 r600g: Fixed two memory leaks in winsys.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
ecb1b8b98f r600g: Delete custom_dsa_flush on shutdown.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
c49dcaef65 r600g: We don't support PIPE_CAP_PRIMITIVE_RESTART.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
86778dadc5 r600g: Made radeon_bo::map_count signed.
That way assert(map_count >= 0) can actually fail when we screwed up.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck
34e75b0ca8 r600g: Fixed unmap condition in radeon_bo_pb_destroy().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck
b675266f0e r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
This ensures that we increase bo->map_count when radeon_bo_map_internal()
returns successfully, which in turn makes sure we don't decrement
bo->map_count below zero later.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck
4e34393162 r600g: Removed unused 'ptr' argument from radeon_bo().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Jakob Bornecrantz
1318b0ef9e graw: Tidy graw xlib scons file a bit 2010-11-02 18:20:30 +00:00
Brian Paul
2996ce72b1 llvmpipe: add a cast 2010-11-02 11:53:14 -06:00
Brian Paul
9fbf744389 llvmpipe: assign context's frag shader pointer before using it
The call to draw_bind_fragment_shader() was using the old fragment
shader.  This bug would have really only effected the draw module's
use of the fragment shader in the wide point stage.
2010-11-02 11:50:37 -06:00
Chad Versace
223568fbcd mesa: Fix C++ includes in sampler.cpp
Some C++ header files were included in an extern "C" block. When building with
Clang, this caused the build to fail due to namespace errors. (GCC did not
report any errors.)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2010-11-02 10:36:20 -07:00
Keith Whitwell
8dfafbf086 st/mesa: unbind constant buffer when not in use
Important as more constant buffers per shader start to get used.

Fix up r600 (tested) and nv50 (untested) to cope with this.  Drivers
previously didn't see unbinds of constant buffers often or ever, so
this isn't always dealt with cleanly.

For r600 just return and keep the reference.  Will try to do better in
a followup change.
2010-11-02 16:57:24 +00:00
Keith Whitwell
debcb43489 llvmpipe: guard against NULL task->query pointer
This doesn't seem like it should be possible, but some test suites
manage to hit this case.  Avoid crashing release builds under those
circumstances.
2010-11-02 16:48:10 +00:00
Keith Whitwell
98445b4307 llvmpipe: avoid generating tri_16 for tris which extend past tile bounds
Don't trim triangle bounding box to scissor/draw-region until after
the logic for emitting tri_16.  Don't generate tri_16 commands for
triangles with untrimmed bounding boxes outside the current tile.

This is important as the tri-16 itself can extend past tile bounds and
we don't want to add code to it to check against tile bounds (slow) or
restrict it to locations within a tile (pessimistic).
2010-11-02 16:48:10 +00:00
Brian Paul
fc70c05dbd mesa: fix aux/accum comment and error message mixups 2010-11-02 09:56:04 -06:00
Brian Paul
4a9ce9b299 mesa: remove always-false conditional in check_compatible()
The two gl_config pointers can never be equal.
2010-11-02 09:40:57 -06:00
Brian Paul
670207e6d0 dri/util: add a bunch of comments 2010-11-02 09:33:23 -06:00
Brian Paul
0fefafb2e4 mesa: move the gl_config struct declaration
It was in the middle of the lighting-related structures before.
Also add some info about field sizes in this structure.
2010-11-02 09:33:17 -06:00
Brian Paul
ee1f047c81 mesa: use GLubyte for edge flag arrays
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31310
2010-11-02 08:23:24 -06:00
José Fonseca
265b53983e scons: Propagate installation targets.
Fixes libgl-xlib target.
2010-11-02 14:20:12 +00:00
José Fonseca
45f4b85d58 scons: i915 can't build on MSVC either.
I thought I had singled it out before, but apparently not.
2010-11-02 13:49:35 +00:00
José Fonseca
3ae04dd910 scons: Add aliases for several pipe drivers. 2010-11-02 12:35:52 +00:00
José Fonseca
4f8dbd2f5e r600g: List recently added files in SConscript. 2010-11-02 12:35:52 +00:00
Zhenyu Wang
aedc270966 i965: refresh wm push constant also for BRW_NEW_FRAMENT_PROGRAM on gen6
Fix compiz crash.

https://bugs.freedesktop.org/show_bug.cgi?id=31124
2010-11-02 16:06:13 +08:00
Chia-I Wu
16ee7a55ae mesa: Allow contexts of different APIs to coexist.
This effectively redoes 1741ddb747 in a
way that allows contexts of different APIs to coexist.

First, the changes to the remap table are reverted.  The remap table
(driDispatchRemapTable) is always initialized in the same way regardless
of the context API.

es_generator.py is updated to use a local remap table, whose sole
purpose is to help initialize its dispatch table.  The local remap table
and the global one are always different, as they use different
glapidispatch.h.  But the dispatch tables initialized by both remap
tables are always compatible with glapi (libGL.so).

Finally, the semantics of one_time_init are changed to per-api one-time
initialization.
2010-11-02 14:43:35 +08:00
Chia-I Wu
fdede1efaa mesa: Select FEATURE_remap_table when multiple APIs are enabled.
Core mesa should query glapi for the positions of the functions in
_glapi_table when multiple APIs are supported.  It does not know which
glapitable.h glapi used.
2010-11-02 14:17:56 +08:00
Tom Stellard
6b999c89ce r300/compiler: Don't track readers into an IF block.
This makes rc_get_readers_normal() more conservative than it needs to be,
but it fixes some incorrect behavior in the optimization passes.
2010-11-01 22:06:20 -07:00
Chia-I Wu
ad00a92ee7 egl: Rework _eglGetSearchPath.
So that the directory part of EGL_DRIVER, if exists, is prepended to the
search path.  This commit also adds a sanity check to _eglLog.
2010-11-02 01:37:16 +08:00
José Fonseca
583e41855b scons: Disable python state tracker when swig is not present. 2010-11-01 15:27:34 +00:00
José Fonseca
0fd41d236f scons: Restore x11 tool behavior for backwards compatability. 2010-11-01 14:37:18 +00:00
José Fonseca
ab9ca6caa8 scons: Some pipe drivers are not portable for MSVC 2010-11-01 14:24:08 +00:00
Hui Qi Tay
7f0dc5ea1b llvmpipe: Moved draw pipeline twoside function to llvm setup code 2010-11-01 14:14:55 +00:00
José Fonseca
f9156ebcc4 scons: Fix MinGW cross-compilation. 2010-11-01 13:56:16 +00:00
José Fonseca
601498ae73 scons: Revamp how to specify targets to build.
Use scons target and dependency system instead of ad-hoc options.

Now is simply a matter of naming what to build. For example:

  scons libgl-xlib

  scons libgl-gdi

  scons graw-progs

  scons llvmpipe

and so on. And there is also the possibility of scepcified subdirs, e.g.

  scons src/gallium/drivers

If nothing is specified then everything will be build.

There might be some rough corners over the next days. Please bare with me.
2010-11-01 13:30:22 +00:00
Francisco Jerez
a84bd587c6 dri/nouveau: Re-emit the BO state when coming back from a software fallback. 2010-10-31 22:07:38 +01:00
Francisco Jerez
4a282629c2 dri/nouveau: Validate the framebuffer state on read buffer changes. 2010-10-31 22:07:26 +01:00
Francisco Jerez
453b718552 dri/nouveau: Fix type promotion issue on 32bit platforms.
Fixes some VTX protection errors introduced by e89af20926.
2010-10-31 22:07:10 +01:00
Benjamin Franzke
6102683b19 st/egl image: multiply drm buf-stride with blocksize
[olv: formatted for 80-column wrapping]
2010-11-01 01:03:53 +08:00
Chia-I Wu
52ef148923 targets/egl: Fix a warning with --disable-opengl build.
API_DEFINES is the defines for libmesagallium.a.  Append it to
egl_CPPFLAGS only when st_GL.so, which uses libmesagallium.a, is built.
2010-10-31 21:22:26 +08:00
Chia-I Wu
1230050363 autoconf: Tidy configure output for EGL.
Prefix EGL driver names by "egl_".  Make it clear that EGL_CLIENT_APIS
is only used by egl_gallium.
2010-10-31 21:22:26 +08:00
Tom Stellard
a15cf3cd0b r300/compiler: Don't clobber presubtract sources during optimizations
https://bugs.freedesktop.org/show_bug.cgi?id=28294
2010-10-30 22:26:19 -07:00
Francisco Jerez
088145f950 dri/nouveau: Pipeline glTexSubImage texture transfers. 2010-10-31 02:02:33 +01:00
Francisco Jerez
f67fa52293 dri/nouveau: Keep small DYNAMIC_DRAW vertex buffers in system ram. 2010-10-31 02:01:24 +01:00
Francisco Jerez
e89af20926 dri/nouveau: Optimize VBO binding re-emission. 2010-10-31 02:50:44 +02:00
Francisco Jerez
57382e71ef dri/nouveau: Split out array handling to its own file. 2010-10-31 02:50:04 +02:00
Francisco Jerez
9d1f1fcf13 dri/nouveau: Use a macro to iterate over the bound vertex attributes. 2010-10-31 02:45:38 +02:00
Francisco Jerez
dbe1eae785 dri/nouveau: Avoid recursion in nouveau_bo_context_reset(). 2010-10-31 02:45:31 +02:00
Francisco Jerez
f2098e0fef dri/nouveau: Split out the scratch helpers to a separate file. 2010-10-31 02:44:45 +02:00
Francisco Jerez
6daaf45359 dri/nouveau: Tell the vbo module we want real hardware BOs. 2010-10-31 02:44:35 +02:00
Francisco Jerez
6ee9cd482a dri/nouveau: Honor the access flags in nouveau_bufferobj_map_range. 2010-10-31 02:43:14 +02:00
Francisco Jerez
f102c5220c dri/nouveau: Call _mesa_update_state() after framebuffer invalidation.
Previously nouveau_state_emit() was being called directly, sometimes
that doesn't work because it doesn't update the derived GL context.
2010-10-30 19:25:33 +02:00
Francisco Jerez
e3c0b7ba41 dri/nv25: Bind a hierarchical depth buffer. 2010-10-30 19:25:32 +02:00
Francisco Jerez
c5ca972c07 dri/nouveau: Don't assert(0) on compressed internal formats. 2010-10-30 19:25:32 +02:00
Francisco Jerez
920481d387 dri/nv20: Clear with the 3D engine. 2010-10-30 19:25:31 +02:00
Chia-I Wu
cfc81d93f7 st/mesa: Unreference the sampler view in st_bind_surface.
Without this, update_textures may not pick up the new pipe_resource.

It is actually update_textures that should check
stObj->sampler_view->texture != stObj->pt, but let's follow st_TexImage
and others for now.
2010-10-31 01:18:59 +08:00
Brian Paul
9c2b4814d0 osmesa: fix renderbuffer memleak in OSMesaMakeCurrent()
Fixes fd.o bug 31128.
2010-10-30 10:11:37 -06:00
Chia-I Wu
156e955c25 autoconf: st/vega requires --enable-openvg.
Make it a warning for now to smooth the transition.
2010-10-30 14:41:17 +08:00
Kenneth Graunke
cff1aeea10 glsl: Remove unused ARRAY_SIZE macro.
It's also equivalent to Elements(...) which is already used elsewhere.
2010-10-29 11:43:30 -07:00
Eric Anholt
a974949f3b mesa: Make metaops use program refcounts instead of names.
Fixes failure on restoring state when the program was active but
deleted, and the name no longer exists.

Bug #31194
2010-10-29 11:28:38 -07:00
Brian Paul
34e8801b9c mesa: remove dead code 2010-10-29 08:13:31 -06:00
José Fonseca
d070edd4f0 mesa: Fix windows build (uint -> GLuint). 2010-10-29 13:05:31 +01:00
Chia-I Wu
bdd8838631 targets: Add missing quotes to Makefile.xorg.
Fix

  $ make CC="ccache gcc"
2010-10-29 13:00:12 +08:00
Chia-I Wu
9de5c6a1cb Merge branch 'glapi-reorg'
Conflicts:
	src/mapi/glapi/glapi_sparc.S
	src/mapi/glapi/glapi_x86.S
	src/mapi/glapi/glapidispatch.h
	src/mapi/glapi/glapioffsets.h
	src/mapi/glapi/glprocs.h
2010-10-29 12:46:59 +08:00
Chia-I Wu
815faa448c autoconf: Update configuration info.
Output API info first.  Move GLU/GLw/GLUT and EGL near driver info.
2010-10-29 12:42:24 +08:00
Chia-I Wu
c6320c5eb2 docs: Update egl and openvg docs. 2010-10-29 12:11:49 +08:00
Chia-I Wu
be5f34a053 autoconf: Better client API selection.
Make autoconf decide the client APIs enabled first.  Then when OpenGL
and OpenGL ES are disabled, there is no need to build src/mesa/;  when
OpenGL is disabled, no $mesa_driver should be built.  Finally, add
--enable-openvg to enable OpenVG.

With these changes, an OpenVG only build can be configured with

  $ ./configure --disable-opengl --enable-openvg

src/mesa, src/glsl, and src/glx will be skipped, which saves a great
deal of compilation time.

And an OpenGL ES only build can be configured with

  $ ./configure --disable-opengl --enable-gles-overlay
2010-10-29 12:10:46 +08:00
Brian Paul
bdba4608df mesa: pixel transfer ops do not apply to integer-valued textures 2010-10-28 21:17:42 -06:00
Brian Paul
0a3566cec0 mesa: additional integer formats in _mesa_bytes_per_pixel() 2010-10-28 21:17:42 -06:00
Brian Paul
7faf521fad mesa: add const qualifier to _mesa_is_legal_format_and_type() 2010-10-28 21:17:42 -06:00
Brian Paul
113c1832b1 mesa: fix integer cases in _mesa_is_legal_format_and_type()
Some integer formats work with some packed datatypes.
2010-10-28 21:17:42 -06:00
Brian Paul
9fc7fa0a4c mesa: fix incorrect type in _mesa_texstore_rgba_int16() 2010-10-28 21:17:42 -06:00
Brian Paul
b44f9c7e0a mesa: remove obsolete comment 2010-10-28 21:17:42 -06:00
Brian Paul
22c7a69d7b mesa: add extension table entry for GL_EXT_gpu_shader4 2010-10-28 21:17:42 -06:00
Brian Paul
55dc971ded mesa: clean-up array element code
Remove unnecessary GLAPIENTRY keywords, update comments, re-indent.
2010-10-28 21:17:42 -06:00
Brian Paul
d916d81582 mesa: glArrayElement support for integer-valued arrays 2010-10-28 21:17:42 -06:00
Brian Paul
3b82ceec67 mesa: state/queries for GL_MIN/MAX_PROGRAM_TEXEL_OFFSET_EXT 2010-10-28 21:17:42 -06:00
Brian Paul
433e5e6def mesa: consolidate glVertex/Color/etcPointer() code
This removes a bunch of similar error checking code in all the vertex
pointer functions and puts nearly all the error checking in update_array().
2010-10-28 21:17:42 -06:00
Brian Paul
d1184d26bb mesa: add gl_client_array::Integer field and related vertex array state code 2010-10-28 21:17:41 -06:00
Brian Paul
ca2618f4b6 mesa: implement integer-valued vertex attribute functions
The integers still get converted to floats.  That'll have to change someday.
2010-10-28 21:17:41 -06:00
Brian Paul
e2b8c65723 mesa: add new GLvertexformat entries for integer-valued attributes 2010-10-28 21:17:41 -06:00
Brian Paul
ba9995953c mesa: plug in more GL_EXT_gpu_shader4 functions 2010-10-28 21:17:41 -06:00
Brian Paul
9c61ca90ea mesa: add glGetUniformuiv(), plug in uint glUniform funcs 2010-10-28 21:17:41 -06:00
Brian Paul
53eca8d216 mesa: plug in stubs for glBindFragDataLocation(), glGetFragDataLocation() 2010-10-28 21:17:41 -06:00
Brian Paul
a6fb2acfdb glapi: regenerated API files 2010-10-28 21:17:41 -06:00
Brian Paul
20371d40b8 glapi: include EXT_gpu_shader4.xml 2010-10-28 21:17:41 -06:00
Brian Paul
a52dbaa99a glapi: xml spec file for GL_EXT_gpu_shader4 2010-10-28 21:17:41 -06:00
Brian Paul
beea704be2 vbo: re-indent file 2010-10-28 21:17:41 -06:00
Brian Paul
25efd558a3 mesa: remove 'normalized' parameter from _mesa_VertexAttribIPointer() 2010-10-28 21:17:41 -06:00
Eric Anholt
9d45c7d1ce i965: Update the gen6 stencil ref state when stencil state changes.
Fixes 6 piglit tests about stencil operations.
2010-10-28 16:28:42 -07:00
Eric Anholt
b271445e37 i965: Upload required gen6 VS push constants even when using pull constants.
Matches pre-gen6, and fixes glsl-vs-large-uniform-array.
2010-10-28 15:38:38 -07:00
Eric Anholt
c5114c7eab i965: Update gen6 SF state when point state (sprite or attenuation) changes. 2010-10-28 15:38:38 -07:00
Eric Anholt
e30a3e7aa0 i965: Add user clip planes support to gen6.
Fixes piglit user-clip, and compiz desktop switching when dragging a
window and using just 2 desktops.  Bug #30446.
2010-10-28 14:45:11 -07:00
José Fonseca
85a08f8fc7 gallivm: Remove the EMMS opcodes.
Unnecessary now that lp_set_target_options() successful disables MMX code
emission.
2010-10-28 20:42:02 +01:00
José Fonseca
8d364221e9 gallivm: always enable LLVMAddInstructionCombiningPass() 2010-10-28 20:40:34 +01:00
José Fonseca
5479fa34d9 gallium: Avoid using __doc__ in python scripts. 2010-10-28 17:38:18 +01:00
Vinson Lee
a54ab4960b st/mesa: Silence uninitialized variable warning.
Fixes this GCC warning.
state_tracker/st_program.c: In function 'st_print_shaders':
state_tracker/st_program.c:735: warning: 'sh' may be used uninitialized in this function
2010-10-28 06:08:19 -07:00
Tom Stellard
aa43176ebd r300/compiler: Use rc_get_readers_normal() for presubtract optimizations 2010-10-27 22:49:50 -07:00
Kenneth Graunke
cbc966b57b i965: Add bit operation support to the fragment shader backend. 2010-10-27 13:55:30 -07:00
Eric Anholt
9e3641bd0d i965: Make FS uniforms be the actual type of the uniform at upload time.
This fixes some insanity that would otherwise be required for GLSL
1.30 bit ops or gen6 integer uniform operations in general, at the
cost of upload-time pain.  Given that we only have that pain because
mesa's mangling our integer uniforms to be floats, this something that
should be fixed outside of the shader codegen.
2010-10-27 13:54:35 -07:00
Ian Romanick
502943049a docs: add GL_EXT_separate_shader_objects to release notes 2010-10-27 13:45:29 -07:00
Ian Romanick
817ed68710 intel: Enable GL_EXT_separate_shader_objects in Intel drivers 2010-10-27 13:35:53 -07:00
Ian Romanick
f48915ec52 swrast: Enable GL_EXT_separate_shader_objects in software paths 2010-10-27 13:35:53 -07:00
Ian Romanick
84eba3ef71 Track separate programs for each stage
The assumption is that all stages are the same program or that
varyings are passed between stages using built-in varyings.
2010-10-27 13:35:53 -07:00
Ian Romanick
75c6f47288 mesa: Track an ActiveProgram distinct from CurrentProgram
ActiveProgram is the GL_EXT_separate_shader_objects state variable
used for glUniform calls.  glUseProgram also sets this.
2010-10-27 13:35:53 -07:00
Ian Romanick
01abcf3b79 mesa: Add display list support for GL_EXT_separate_shader_objects functions 2010-10-27 13:35:53 -07:00
Ian Romanick
c72aa7fa58 mesa: Skeletal support for GL_EXT_separate_shader_objects
Really just filling in the entry points.  None of them do anything
other than validate their inputs.
2010-10-27 13:35:53 -07:00
Ian Romanick
b97794c041 mesa: Add infrastructure to track GL_EXT_separate_shader_objects 2010-10-27 13:35:53 -07:00
Ian Romanick
44f6e17ebb glapi: Commit files changed by previous commit 2010-10-27 13:35:53 -07:00
Ian Romanick
206e904f3c glapi: Add GL_EXT_separate_shader_objects 2010-10-27 13:35:52 -07:00
Kenneth Graunke
3acc826520 Fix build on systems where "python" is python 3.
First, it changes autoconf to use a "python2" binary when available,
rather than plain "python" (which is ambiguous).  Secondly, it changes
the Makefiles to use $(PYTHON) $(PYTHON_FLAGS) rather than calling
python directly.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Matthew William Cox <matt@mattcox.ca>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-10-27 12:49:53 -07:00
Marek Olšák
676c3f08bd r300g: add a default channel ordering of texture border for unhandled formats
It should fix the texture border for compressed textures.
Broken since 8449a4772a.
2010-10-27 21:21:23 +02:00
Alex Deucher
8ff7885e8f r600c: add missing radeon_prepare_render() call on evergreen 2010-10-27 14:30:50 -04:00
Alex Deucher
b194b9b238 r100: revalidate after radeon_update_renderbuffers
This is a port of 603741a86d
to r100.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-10-27 13:53:29 -04:00
Vinson Lee
80adc8ac3b swrast: Print out format on unexpected failure in _swrast_ReadPixels. 2010-10-27 10:16:18 -07:00
Vinson Lee
1b92eb1a4b egl: Remove unnecessary headers. 2010-10-27 09:51:11 -07:00
Vinson Lee
e7343cd704 mesa: Remove unnecessary header. 2010-10-27 09:38:33 -07:00
Vinson Lee
21ce44374a st/mesa: Remove unnecessary header. 2010-10-27 09:33:13 -07:00
Vinson Lee
d674ee2a4d r600g: Silence uninitialized variable warnings. 2010-10-27 09:26:27 -07:00
Vinson Lee
d4cdd2fab0 mesa: Remove unnecessary headers. 2010-10-27 09:09:47 -07:00
Vinson Lee
3c8106402f r300g: Silence uninitialized variable warning.
Fixes this GCC warning.
r300_state_derived.c: In function 'r300_update_derived_state':
r300_state_derived.c:593: warning: 'r' may be used uninitialized in this function
r300_state_derived.c:593: note: 'r' was declared here
2010-10-27 09:02:00 -07:00
Tilman Sauerbeck
8ad9d83fdf r600g: Destroy the blitter.
This fix got lost in the state rework merge.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-10-27 08:44:47 +02:00
Tilman Sauerbeck
c6b10cd986 r600g: In radeon_bo(), call LIST_INITHEAD early.
radeon_bo_destroy() will want to read the list field. Without this patch,
we'd end up evaluating the list pointers before they have been properly
set up when we destroyed the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-10-27 08:44:35 +02:00
Chia-I Wu
b762db62c2 mesa: Remove unnecessary glapitable.h includes.
With 07b85457d9, glapitable.h is included
by core mesa only to know the size of _glapi_table.  It is not necessary
as the same info is given by _gloffset_COUNT.

This change makes _glapi_table opaque to core mesa.  All operations on
it are supposed to go through one of the SET/GET/CALL macros.
2010-10-27 11:11:11 +08:00
Chia-I Wu
aefd4f76ea vbo: Use CALL_* macros.
Use macros to access _glapi_table consistently.  There is no functional
change.
2010-10-27 11:09:40 +08:00
Chia-I Wu
07b85457d9 glapi: Merge glapioffsets.h into glapidispath.h.
Move defines in glapioffsets.h to glapidispatch.h.  Rename
_gloffset_FIRST_DYNAMIC to _gloffset_COUNT, which is equal to the number
of entries in _glapi_table.

Consistently use SET_by_offset, GET_by_offset, CALL_by_offset, and
_gloffset_* to recursively define all SET/GET/CALL macros.
2010-10-27 11:07:29 +08:00
Chia-I Wu
e4dbfa44ed glapi: Do not use glapioffsets.h.
glapioffsets.h exists for the same reason as glapidispatch.h does.  It
is of no use to glapi.  This commit also drops the use of glapioffsets.h
in glx as glx is considered an extension to glapi when it comes to
defining public GL entries.
2010-10-27 10:49:33 +08:00
Brian Paul
412b960883 mesa: rename function to _mesa_is_format_integer_color()
Be a bit more clear about its operation.
2010-10-26 20:30:42 -06:00
Brian Paul
ab50148fda mesa: fix bug in _mesa_is_format_integer()
We only want to return true if it's an integer _color_ format, not a
depth and/or stencil format.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31143
2010-10-26 20:25:23 -06:00
Chia-I Wu
e213968f2b glapi: Move glapidispatch.h to core mesa.
It is a core mesa header, not a glapi header.
2010-10-27 10:08:27 +08:00
Chia-I Wu
b5022ad035 glapi: Do not use glapidispatch.h.
glapidispatch.h exists so that core mesa (libmesa.a) can be built for
DRI drivers or for non-DRI drivers as a compile time decision (whether
IN_DRI_DRIVER is defined).  It is of no use to glapi.  This commit also
drops the use of glapidispatch.h in glx and libgl-xlib as they are
considered extensions to glapi when it comes to defining public GL
entries.
2010-10-27 10:06:25 +08:00
Brian Paul
9b3c4d3e67 mesa: remove the unused _mesa_is_fragment_shader_active() function
This reverts commit 013d5ffeec.
2010-10-26 18:05:37 -06:00
Brian Paul
ccef2110ed mesa: call _mesa_valid_to_render() in glDrawPixels, glCopyPixels, glBitmap
This lets us simplify and consolidate some state checking code.

This implements the GL_INVALID_OPERATION check for all drawing commands
required by GL_EXT_texture_integer.
2010-10-26 18:05:37 -06:00
Brian Paul
705978e283 mesa: do integer FB / shader validation check in _mesa_valid_to_render() 2010-10-26 18:05:37 -06:00
Eric Anholt
bb4f12f538 i965: Disable register spilling on gen6 until it's fixed.
Avoids GPU hang on glsl-fs-convolution-1.
2010-10-26 15:07:25 -07:00
Eric Anholt
00bfdac5b8 i965: Fix VS URB entry sizing.
I'm trying to clamp to a minimum of 1 URB row, not a maximum of 1.

Fixes:
glsl-kwin-blur
glsl-max-varying
glsl-routing
2010-10-26 15:07:10 -07:00
Eric Anholt
88087ba1bf i965: Drop the eot argument to read messages, which can never be set. 2010-10-26 13:46:09 -07:00
Eric Anholt
3ee5d68075 i965: Add support for constant buffer loads on gen6.
Fixes glsl-fs-uniform-array-5.
2010-10-26 13:17:54 -07:00
Eric Anholt
519835de04 i965: Set up the constant buffer on gen6 when it's needed.
This was slightly confused because gen6_wm_constants does the push
constant buffer, while brw_wm_constants does pull constants.
2010-10-26 13:15:01 -07:00
Eric Anholt
6488cf46f5 i965: Fix typo in comment about state flags. 2010-10-26 12:19:46 -07:00
Eric Anholt
33c4b2370f i965: Handle new ir_unop_round_even in channel expression splitting. 2010-10-26 11:23:27 -07:00
Eric Anholt
62452e7d94 i965: Add support for discard instructions on gen6.
It's a little more painful than before because we don't have the handy
mask register any more, and have to make do with cooking up a value
out of the flag register.
2010-10-26 11:21:44 -07:00
Eric Anholt
9b1d26f78f i965: Add disasm for the flag register. 2010-10-26 11:21:44 -07:00
Eric Anholt
0e8c834ffa i965: Clear some undefined fields of g0 when using them for gen6 FB writes.
This doesn't appear to help any testcases I'm looking at, but it looks
like it's required.
2010-10-26 10:34:14 -07:00
Eric Anholt
1732a8bc72 i965: Use SENDC on the first render target write on gen6.
This is apparently required, as the thread will be initiated while it
still has dependencies, and this is what waits for those to be
resolved before writing color.
2010-10-26 10:34:10 -07:00
Eric Anholt
748f3744be i965: Clarify an XXX comment in FB writes with real info. 2010-10-26 10:34:10 -07:00
Eric Anholt
3789d5025a i965: Add EU code for dword scattered reads (constant buffer array indexing). 2010-10-26 10:34:10 -07:00
Chia-I Wu
547e7619aa egl_dri2: Fix a typo that make glFlush be called at wrong time.
We want to call glFlush when there is a current context.  That is,
old_ctx.  This is a regression introduced by
d19afc57fe.
2010-10-26 15:04:28 +08:00
Dave Airlie
d1acb92016 r600g: add assembler support for all the kcache fields. 2010-10-26 12:08:00 +10:00
Brian Paul
326b981d3f mesa: additional teximage error checks for GL_EXT_texture_integer 2010-10-25 19:21:55 -06:00
Brian Paul
862bb1b0ff mesa: additional switch cases for GL_EXT_texture_integer 2010-10-25 19:21:55 -06:00
Brian Paul
751e10fc01 mesa: additional glReadPixels error checks for GL_EXT_texture_integer 2010-10-25 19:21:55 -06:00
Dave Airlie
2d2bafdb30 r600g: fix magic 0x1 ->flat shade ena 2010-10-26 09:47:02 +10:00
Kenneth Graunke
ba2382f50d glsl: Fix constant component count in vector constructor emitting.
Fixes freedesktop.org bug #31101 as well as piglit test cases
assignment-type-mismatch.vert and constructor-28.vert.
2010-10-25 12:56:47 -07:00
Chad Versace
6e00627384 glsl: Fix ast-to-hir for ARB_fragment_coord_conventions
Function ast_declarator_list::hir(), when processing keywords added by
extension ARB_fragment_coord_conventions, made the mistake of checking only if
the extension was __supported by the driver__. The correct behavior is to check
if the extensi0n is __enabled in the parse state__.

NOTE: this is a candidate for the 7.9 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-25 10:10:58 -07:00
Brian Paul
af03c14d4c translate: remove unused prototypes 2010-10-25 10:34:44 -06:00
Brian Paul
81d5afbbec translate: use function typedefs, casts to silence warnings 2010-10-25 10:31:56 -06:00
Marek Olšák
64276cffcb st/mesa: support RGBA16 and use it for RGBA12 as well
Tested with r300g.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-10-25 18:21:12 +02:00
Brian Paul
1686db70d6 rtasm: use pointer_to_func() to silence warning 2010-10-25 09:18:07 -06:00
Brian Paul
e1e7843d03 util: use pointer_to_func() to silence warning 2010-10-25 09:17:40 -06:00
Brian Paul
da580dbbe8 xlib: silence unused var warning 2010-10-25 09:17:09 -06:00
Brian Paul
2701eb342b mesa: fix uninitialized var warning
http://bugs.freedesktop.org/show_bug.cgi?id=31067
2010-10-25 09:11:26 -06:00
Brian Paul
f72e4b306b mesa: silence enum comparison warning
http://bugs.freedesktop.org/show_bug.cgi?id=31069
2010-10-25 09:10:36 -06:00
Marek Olšák
8449a4772a r300g: fix texture border for 16-bits-per-channel formats
This is kinda hacky, but it's hard to come up with a generic solution for
all formats when only a few are used in practice (I mostly get B8G8R8*8).
2010-10-24 23:43:13 +02:00
Marek Olšák
6e61853590 mesa: allow FBO attachments of formats LUMINANCE, LUMINANCE_ALPHA, and INTENSITY
As per the GL_ARB_framebuffer_object specification.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-10-24 23:14:01 +02:00
Jon TURNEY
70f60c9c89 Ensure -L$(TOP)/$(LIB_DIR) appears in link line before any -L in $LDFLAGS
Ensure -L$(TOP)/$(LIB_DIR) (the staging dir for build products), appears
in the link line before any -L in $LDFLAGS, so that we link driver we are
building with libEGL we have just built, and not an installed version

[olv: make a similar change to targets/egl]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-24 23:13:49 +08:00
Dave Airlie
a20c2347a0 r600g: drop more common state handling code 2010-10-24 13:04:44 +10:00
Tilman Sauerbeck
f4a2c62af5 r600g: Also clear bc data when we're destroying a shader.
[airlied: remove unused vars]

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-24 12:56:35 +10:00
Tilman Sauerbeck
ccb9be1056 r600g: Added r600_pipe_shader_destroy().
Not yet complete.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-24 12:55:18 +10:00
Dave Airlie
9612b482e2 r600g: merge more of the common r600/evergreen state handling 2010-10-24 12:53:50 +10:00
Tilman Sauerbeck
9f9d24c89a r600g: Fixed r600_vertex_element leak.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-24 12:44:56 +10:00
Brian Paul
d8740b77ac softpipe: remove >32bpp color restriction
The comment was out of date.  The tile cache does handle >32-bit colors.
2010-10-23 10:27:21 -06:00
Brian Paul
e6ac8d5353 st/mesa: be smarter choosing texture format for glDrawPixels()
This lets us get an integer texture format for integer pixel formats.
2010-10-23 10:23:08 -06:00
Brian Paul
efd9e24312 mesa: display list support for GL_EXT_texture_integer 2010-10-23 10:19:31 -06:00
Brian Paul
98bb70ac84 mesa: plug in GL_EXT_texture_integer functions 2010-10-23 10:19:31 -06:00
Brian Paul
01e13a7d75 mesa: regenerated API files for GL_EXT_texture_integer 2010-10-23 10:19:31 -06:00
Brian Paul
fd6f17c21a glapi: include/build EXT_texture_integer.xml 2010-10-23 10:19:31 -06:00
Brian Paul
9d73c4a9d5 glapi: GL_EXT_texture_integer API 2010-10-23 10:19:31 -06:00
Brian Paul
646afcc340 mesa: simplify target_can_be_compressed() function 2010-10-23 10:19:31 -06:00
Brian Paul
77ca2044a0 st/mesa: add format selection for signed/unsigned integer formats 2010-10-23 10:19:30 -06:00
Brian Paul
d72bf5e79d mesa: added cases for GL_EXT_texture_integer 2010-10-23 10:19:30 -06:00
Brian Paul
7a60512f84 mesa: added cases for GL_EXT_texture_integer formats 2010-10-23 10:19:30 -06:00
Brian Paul
c7d18374dd mesa: compute _IntegerColor field in _mesa_test_framebuffer_completeness() 2010-10-23 10:19:30 -06:00
Brian Paul
9968a3960f mesa: added glGet query for GL_RGBA_INTEGER_MODE_EXT 2010-10-23 10:19:30 -06:00
Brian Paul
f681ea4741 mesa: added new gl_framebuffer::_IntegerColor field 2010-10-23 10:19:30 -06:00
Brian Paul
9ee07a0a27 mesa: added new gl_extensions::EXT_gpu_shader4 field 2010-10-23 10:19:30 -06:00
Brian Paul
4250882ccf softpipe: added some texture sample debug code (disabled) 2010-10-23 10:19:30 -06:00
Brian Paul
2502ee6738 mesa: new glDrawPixels error check for integer formats 2010-10-23 10:19:30 -06:00
Brian Paul
013d5ffeec mesa: added _mesa_is_fragment_shader_active() helper 2010-10-23 10:19:30 -06:00
Brian Paul
f1e97dc264 mesa: minor reformatting, clean-ups 2010-10-23 10:19:30 -06:00
Brian Paul
f5ed39e7e6 mesa: _mesa_is_format_integer() function 2010-10-23 10:19:29 -06:00
Brian Paul
a0bc8eeb32 mesa: _mesa_ClearColorIuiEXT() and _mesa_ClearColorIiEXT()
For GL_EXT_texture_integer.
2010-10-23 10:19:29 -06:00
Brian Paul
f6dbb693d2 mesa: add pixel packing for unscaled integer types
And add some missing GL_RG cases.
2010-10-23 10:19:29 -06:00
Brian Paul
1c131752c3 mesa: split up the image.c file
New files:
pack.c - image/row packing/unpacking functions
pixeltransfer.c - pixel scale/bias/lookup functions
2010-10-23 10:19:29 -06:00
Brian Paul
e67f6ee96e mesa: simplify fbo format checking code 2010-10-23 10:19:29 -06:00
Brian Paul
f9288540ec mesa: 80-column wrapping 2010-10-23 10:19:29 -06:00
Brian Paul
b4c013307b docs: updated GL3 status for primitive restart 2010-10-23 10:19:29 -06:00
Chia-I Wu
6c13fdf60e st/egl: Use resource reference count for egl_g3d_sync. 2010-10-23 17:28:56 +08:00
Chia-I Wu
0d43cbed2f egl: Fix a false negative check in _eglCheckMakeCurrent.
This call sequence

  eglMakeCurrent(dpy, surf, surf, ctx1);
  eglMakeCurrent(dpy, surf, surf, ctx2);

should be valid if ctx1 and ctx2 have the same client API and are not
current in another thread.
2010-10-23 16:58:38 +08:00
Chia-I Wu
d19afc57fe egl: Use reference counting to replace IsLinked or IsBound.
Remove all _egl<Res>IsLinked and _egl<Res>IsBound.  Update
_eglBindContext and drivers to do reference counting.
2010-10-23 15:26:28 +08:00
Chia-I Wu
dc4f845c37 egl: Add reference count for resources.
This is a really simple mechanism.  There is no atomicity and the caller
is expected to hold the display lock.
2010-10-23 15:19:34 +08:00
Chia-I Wu
662e098b56 st/egl: Fix native_mode refresh mode.
Define the unit to match _EGLMode's.
2010-10-23 11:32:06 +08:00
Chia-I Wu
e32ac5b8a9 egl: Fix _eglModeLookup.
Internally a mode belongs to a screen.  But functions like
eglGetModeAttribMESA treat a mode as a display resource: a mode can be
looked up without a screen.  Considering how KMS works, it is better to
stick to the current implementation.

To properly support looking up a mode without a screen, this commit
assigns each mode (of all screens) a unique ID.
2010-10-23 11:20:41 +08:00
Chia-I Wu
37213ceacc egl: Minor changes to the _EGLScreen interface.
Make _eglInitScreen take a display and rename _eglAddScreen to
_eglLinkScreen.  Remove unused functions.
2010-10-23 11:20:41 +08:00
Chia-I Wu
8a6bdf3979 egl: Minor changes to the _EGLConfig interface.
Mainly to rename _eglAddConfig to _eglLinkConfig, along with a few clean
ups.
2010-10-23 11:20:40 +08:00
Chia-I Wu
4ce33ec606 egl: Drop dpy argument from the link functions.
All display resources are already initialized with a display.  Linking
simply links a resource to its display.
2010-10-23 11:20:40 +08:00
Eric Anholt
07cd8f46ac i965: Add support for pull constants to the new FS backend.
Fixes glsl-fs-uniform-array-5, but not 6 which fails in ir_to_mesa.
2010-10-22 14:53:21 -07:00
Eric Anholt
ff622d5528 i965: Move the FS disasm/annotation printout to codegen time.
This makes it a lot easier to track down where we failed when some
code emit triggers an assert.  Plus, less memory allocation for
codegen.
2010-10-22 14:53:21 -07:00
Dave Airlie
39c742fe2a r600g: not fatal if we can't get tiling info from kernel 2010-10-23 07:45:59 +10:00
Marek Olšák
469907d597 r300g: say no to PIPE_CAP_STREAM_OUTPUT and PIPE_CAP_PRIMITIVE_RESTART 2010-10-22 20:34:28 +02:00
Marek Olšák
1d96ad67bc r300g: do not print get_param errors in non-debug build 2010-10-22 20:34:27 +02:00
Keith Whitwell
a1ca5ac7c2 llvmpipe: turn off draw offset/twoside when we can handle it 2010-10-22 18:58:36 +01:00
Brian Paul
dd2499b484 mesa: move declaration before code 2010-10-22 08:59:06 -06:00
Brian Paul
67f6a4a8c4 galahad: silence warnings 2010-10-22 08:58:35 -06:00
Francisco Jerez
a00eec5295 dri/nouveau: Force a "slow" Z clear if we're getting a new depth buffer. 2010-10-22 13:43:57 +02:00
Chia-I Wu
25328509c9 egl: Move fallback routines to eglfallbacks.c.
We do not want them to be all over the places.
2010-10-22 18:38:30 +08:00
Chia-I Wu
5664a98386 egl: Parse image attributes with _eglParseImageAttribList.
Avoid code duplications.
2010-10-22 18:35:09 +08:00
Chia-I Wu
713c8734f4 egl: Move attributes in _EGLImage to _EGLImageAttribs.
The opaque nature of EGLImage implies that extensions almost always
define their own attributes.  Move attributes in _EGLImage to
_EGLImageAttribs and add a helper function to parse attribute lists.
2010-10-22 17:15:45 +08:00
Chia-I Wu
ecca5571b6 egl_glx: Fix borken driver.
The driver was broken since 6eda3f311b.
All configs fail to pass _eglValidateConfig.
2010-10-22 16:26:25 +08:00
Chia-I Wu
0ed96efc1b egl_glx: Drop the use of [SG]ET_CONFIG_ATTRIB.
_EGLConfig can be directly dereferenced now.  Since egl_glx is the last
user of the macros, drop the macros too.
2010-10-22 16:26:25 +08:00
Chia-I Wu
b67f7295b7 egl_dri2: Drop the use of _egl[SG]etConfigKey.
_EGLConfig can be directly dereferenced now.
2010-10-22 16:26:25 +08:00
Brian Paul
aa86c7657c winsys/xlib: rename xm->xlib
Move away from the old Mesa-oriented names.
2010-10-21 19:55:03 -06:00
Brian Paul
3bc6fe371c winsys/xlib: fix up allocation/dealloction of XImage
Fixes a crash upon exit when using remote display.
2010-10-21 19:49:34 -06:00
Brian Paul
4d24f01cb3 winsys/xlib: use Bool type for shm field 2010-10-21 19:37:11 -06:00
Brian Paul
e3298eaf52 winsys/xlib: formatting fixes 2010-10-21 19:17:44 -06:00
Brian Paul
69a07be3e5 Merge branch 'primitive-restart-cleanup'
Conflicts:
	docs/relnotes-7.10.html

This branch is a re-do of the primitive-restart branch with all
the intermediate/temporary stuff cleaned out.
2010-10-21 19:05:47 -06:00
Brian Paul
b2d4dfe5cc docs: added GL_NV_primitive_restart extension 2010-10-21 19:03:39 -06:00
Brian Paul
6692ed6f03 llvmpipe: enable primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
27d3bab055 softpipe: enable primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
0eaaceb218 draw: implement primitive splitting for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
053875a8b1 st/mesa: support for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
adf35e80d3 gallium: new CAP, state for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
be45255ab1 vbo: support for primitive restart
We handle splitting of glDrawArrays() calls into two primitives here
so that drivers don't have to worry about it.
2010-10-21 19:03:38 -06:00
Brian Paul
b3de6e703d mesa: plug in primitive restart function 2010-10-21 19:03:38 -06:00
Brian Paul
4f495ec20e mesa: regenerated files with primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
1cae8b5448 mesa: API spec for primitive restart 2010-10-21 19:03:38 -06:00
Brian Paul
7f26ad80ba mesa: set/get primitive restart state 2010-10-21 19:03:38 -06:00
Brian Paul
a80afbd99e mesa: driver hook for primitive restart 2010-10-21 19:03:38 -06:00
Eric Anholt
1d91f8d916 i965: Be more aggressive in tracking live/dead intervals within loops.
Fixes glsl-fs-convolution-2, which was blowing up due to the array
access insanity getting at the uniform values within the loop.  Each
temporary was considered live across the whole loop.
2010-10-21 16:55:26 -07:00
Brian Paul
13cd611f56 docs: add GL_ARB_texture_rg to release notes 2010-10-21 17:05:36 -06:00
Brian Paul
9ad4589e7e docs: update texture red/green support in GL3.txt 2010-10-21 17:05:35 -06:00
Brian Paul
b66a92de8c st/mesa: added cases for GL_COMPRESSED_RED/RG in st_choose_format() 2010-10-21 17:05:35 -06:00
Brian Paul
d4a296caaa mesa: add missing cases for packing red/green images 2010-10-21 17:05:35 -06:00
Brian Paul
d4c1bcce44 mesa: add GL_RG case to _mesa_source_buffer_exists()
Fixes failure with glReadPixels(format=GL_RG)
2010-10-21 17:05:35 -06:00
Brian Paul
154d91cad9 draw: fix typo in comment 2010-10-21 17:05:35 -06:00
Eric Anholt
4e72525109 i965: Correct scratch space allocation.
One, it was allocating increments of 1kb, but per thread scratch space
is a power of two.  Two, the new FS wasn't getting total_scratch set
at all, so everyone thought they had 1kb and writes beyond 1kb would
go stomping on a neighbor thread.

With this plus the previous register spilling for the new FS,
glsl-fs-convolution-1 passes.
2010-10-21 15:21:28 -07:00
Eric Anholt
0b77d57394 i965: Don't emit register spill offsets directly into g0.
g0 is used by others, and is expected to be left exactly as it was
dispatched to us.  So manually move g0 into our message reg when
spilling/unspilling and update the offset in the MRF.  Fixes failures
in texture sampling after having spilled a register.
2010-10-21 15:21:28 -07:00
Eric Anholt
99b2c8570e i965: Add support for register spilling.
It can be tested with if (0) replaced with if (1) to force spilling for all
virtual GRFs.  Some simple tests work, but large texturing tests fail.
2010-10-21 15:21:01 -07:00
Eric Anholt
7a3f113e79 i965: Fix gl_FrontFacing emit on pre-gen6.
It's amazing this code worked.  Basically, we would get lucky in
register allocation and the tests using frontfacing would happen to
allocate gl_FrontFacing storage and the instructions generating
gl_FrontFacing but pointing at another register to the same hardware
register.  Noticed during register spilling debug, when suddenly they
didn't get allocatd the same storage.
2010-10-21 15:20:01 -07:00
Eric Anholt
5ac6c4ecfe i965: Split register allocation out of the ever-growing brw_fs.cpp. 2010-10-21 15:20:01 -07:00
Kenneth Graunke
3f5fde5c45 Refresh autogenerated file builtin_function.cpp.
Since this is just generated by python, it's questionable whether this
should continue to live in the repository - Mesa already has other
things generated from python as part of the build process.
2010-10-21 11:46:08 -07:00
Kenneth Graunke
2cacaf6e7b generate_builtins.py: Output large strings as arrays of characters.
This works around MSVC's 65535 byte limit, unfortunately at the expense
of any semblance of readability and much larger file size.  Hopefully I
can implement a better solution later, but for now this fixes the build.
2010-10-21 11:45:38 -07:00
Vinson Lee
50095ac87c gallivm: Silence uninitialized variable warning.
Fixes this GCC warning.
gallivm/lp_bld_tgsi_aos.c: In function 'lp_build_tgsi_aos':
gallivm/lp_bld_tgsi_aos.c:516: warning: 'dst0' may be used uninitialized in this function
gallivm/lp_bld_tgsi_aos.c:516: note: 'dst0' was declared here
2010-10-21 11:27:35 -07:00
Vinson Lee
fc59790b87 gallivm: Silence uninitialized variable warnings.
Fixes these GCC warnings.
gallivm/lp_bld_sample_aos.c: In function 'lp_build_sample_image_nearest':
gallivm/lp_bld_sample_aos.c:271: warning: 't_ipart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:271: warning: 'r_ipart' may be used uninitialized in this function
2010-10-21 11:21:03 -07:00
Vinson Lee
0a5666148b gallivm: Silence uninitialized variable warnings.
Fixes these GCC warnings.
gallivm/lp_bld_sample_aos.c: In function 'lp_build_sample_image_linear':
gallivm/lp_bld_sample_aos.c:439: warning: 'r_ipart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_ipart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_fpart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:439: warning: 'r_fpart' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_fpart_hi' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:438: warning: 't_fpart_lo' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:439: warning: 'r_fpart_hi' may be used uninitialized in this function
gallivm/lp_bld_sample_aos.c:439: warning: 'r_fpart_lo' may be used uninitialized in this function
2010-10-21 11:10:15 -07:00
Chia-I Wu
16333e1fc4 mesa: Remove unused vtxfmt_tmp.h.
It was used by the "neutral" tnl module that was dropped in
81ccb3e2ce.
2010-10-21 22:03:34 +08:00
Dave Airlie
f39e6c9c81 r600g: start splitting out common code from eg/r600.
no point duplicating code that doesn't touch hw, also make it easier
to spot mistakes
2010-10-21 19:58:09 +10:00
Dave Airlie
e68c83a5a0 r600g: initial translate state support 2010-10-21 19:58:08 +10:00
Vinson Lee
3a54195679 draw: Remove unnecessary header. 2010-10-21 01:47:52 -07:00
Vinson Lee
abc5435f22 llvmpipe: Remove unnecessary header. 2010-10-21 01:44:48 -07:00
Kenneth Graunke
cc04347b8d glsl: Refresh autogenerated file builtin_function.cpp. 2010-10-21 00:14:38 -07:00
Kenneth Graunke
574c53f551 glsl: Add support for GLSL 1.30's modf built-in. 2010-10-21 00:14:37 -07:00
Kenneth Graunke
94a36faed7 glcpp: Refresh autogenerated lexer file. 2010-10-21 00:13:33 -07:00
Kenneth Graunke
bd55ba568b glcpp: Return NEWLINE token for newlines inside multi-line comments.
This is necessary for the main compiler to get correct line numbers.
2010-10-21 00:13:33 -07:00
Dave Airlie
089aa0ba24 r600g: add texture tiling enable under a debug option.
At the moment you need kernel patches to have texture tiling work
with the kernel CS checker, so once they are upstream and the drm version
is bumped we can make this enable flip the other way most likely.
2010-10-21 13:40:45 +10:00
Dave Airlie
cdd14668b6 r600g: add texture tiling alignment support.
this sets things up to align stride/height with tile sizes,
it also adds support for the 2D/1D array mode cross over point.
2010-10-21 13:37:54 +10:00
Dave Airlie
92ed84d115 r600g: introduce a per-driver resource flag for transfers.
this is to be used to decide not to tile a surface being used for transfers.
2010-10-21 13:36:01 +10:00
Dave Airlie
91e513044d r600g: add r600 surface to store the aligned height.
we need to know the aligned height when binding the surface to cb/zb,
not the gallium surface height.
2010-10-21 13:33:00 +10:00
Dave Airlie
388ce31baa r600g: start adding hooks for aligning width/height for tiles. 2010-10-21 13:32:08 +10:00
Dave Airlie
ea5aab85fd r600g: move to per-miplevel array mode.
Since the hw transitions from 2D->1D sampling below the 2D macrotile
size we need to keep track of the array mode per level so we can
render to it using the CB.
2010-10-21 13:32:08 +10:00
Dave Airlie
206fbd9640 r600g: all non-0 mipmap levels need to be w/h aligned to POT.
this adds a new minify function to the driver to ensure this.
2010-10-21 13:20:14 +10:00
Vinson Lee
2e5764ccf4 swrast: Print out format on unexpected failure in _swrast_DrawPixels. 2010-10-20 15:27:48 -07:00
Kenneth Graunke
b970da4d24 mesa: Remove FEATURE_ARB_shading_language_120 macro.
Everything should be able to support 1.20 at this point.
2010-10-20 15:07:47 -07:00
Kenneth Graunke
a75da2c0e8 glsl: Remove useless ir_shader enumeration value. 2010-10-20 15:07:47 -07:00
Vinson Lee
460da0db4a glsl: Add assert for unhandled ir_shader case.
Silences this GCC warning.
ast_to_hir.cpp: In function 'void apply_type_qualifier_to_variable(const
ast_type_qualifier*, ir_variable*, _mesa_glsl_parse_state*, YYLTYPE*)'
ast_to_hir.cpp:1768: warning: enumeration value 'ir_shader' not handled
in switch
2010-10-20 14:10:26 -07:00
Brian Paul
c492066071 draw: use float version of LLVM Mul/Add instructions
LLVM 2.8 is pickier about int vs float instructions and operands.
2010-10-20 14:56:42 -06:00
Brian Paul
f36346c116 llvmpipe/draw: always enable LLVMAddInstructionCombiningPass()
We were working around an LLVM 2.5 bug but we're using LLVM 2.6 or later now.
This basically reverts commit baddcbc522.
This fixes the piglit bug/tri-tex-crash.c failure.
2010-10-20 14:49:07 -06:00
Orion Poplawski
5a3ac74ad5 osmesa: link against libtalloc
Otherwise consumers have to, and that's lame.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-20 15:54:57 -04:00
Vinson Lee
89c26866f0 r600g: Ensure r600_src is initialized in tgsi_exp function.
Silences these GCC warnings.
r600_shader.c: In function 'tgsi_exp':
r600_shader.c:2339: warning: 'r600_src[0].rel' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].abs' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].neg' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].chan' is used uninitialized in this function
r600_shader.c:2339: warning: 'r600_src[0].sel' is used uninitialized in this function
2010-10-20 12:44:08 -07:00
Vinson Lee
289900439f draw: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-10-19 23:48:59 -07:00
Keith Whitwell
05921fd4e5 draw: make sure viewport gets updated in draw llvm shader
The viewport state was being baked in at compile time (oops...)
2010-10-19 22:11:49 -07:00
Keith Whitwell
cd6a31cd4a Merge branch 'llvm-cliptest-viewport' 2010-10-19 21:41:28 -07:00
Hui Qi Tay
ab2e1edd1f draw: corrections to allow for different cliptest cases 2010-10-19 21:34:42 -07:00
Eric Anholt
ae5698e604 i965: Use the new style of IF statement with embedded comparison on gen6.
"Everyone else" does it this way, so follow suit.  It's fewer
instructions, anyway.
2010-10-19 21:17:55 -07:00
Eric Anholt
6ea108e7db i965: Set the source operand types for gen6 if/else/endif to integer.
I don't think this should matter, but I'm not sure, and it's
recommended by a kernel checker in fulsim.
2010-10-19 21:17:55 -07:00
Eric Anholt
d0c87b90a8 i965: Add EU emit support for gen6's new IF instruction with comparison. 2010-10-19 21:17:55 -07:00
Ian Romanick
cc90e62d70 linker: Improve handling of unread/unwritten shader inputs/outputs
Previously some shader input or outputs that hadn't received location
assignments could slip through.  This could happen when a shader
contained user-defined varyings and was used with either
fixed-function or assembly shaders.

See the piglit tests glsl-[fv]s-user-varying-ff and
sso-user-varying-0[12].

NOTE: this is a candidate for the 7.9 branch.
2010-10-19 18:12:32 -07:00
Chad Versace
974fb466f2 glsl: Commit generated file glsl_lexer.cpp
Changes are due to commit "glsl: Fix lexer rule for ^=".
2010-10-19 13:17:33 -07:00
Chad Versace
cba9062d58 glsl: Fix lexer rule for ^=
The caret is a special character, and needs to be quoted or escaped.
2010-10-19 13:17:33 -07:00
Chad Versace
d03ac0f8d8 glsl: Implement ast-to-hir for bit-logic ops
Implement by adding to ast_expression::hir() the following cases:
    - ast_and_assign
    - ast_or_assign
    - ast_xor_assign
2010-10-19 13:17:33 -07:00
Chad Versace
cfdbf8bc84 glsl: Define bit_logic_result_type() in ast_to_hir.cpp
This function type checks the operands of and returns the result type of
bit-logic operations.  It replaces the type checking performed in the
following cases of ast_expression::hir() :
    - ast_bit_and
    - ast_bit_or
    - ast_bit_xor
2010-10-19 13:17:33 -07:00
Chad Versace
338ed6ec29 glsl: Implement ast-to-hir for bit-shift-assignment
Implement by adding to ast_expression::hir() these cases:
    - ast_ls_assign
    - ast_rs_assign
2010-10-19 13:17:33 -07:00
Chad Versace
c0197ab0af glsl: Define shift_result_type() in ast_to_hir.cpp
This function type checks the operands of and returns the result type of
bit-shift operations. It replaces the type checking performed in the following
cases of ast_expression::hir() :
    - ast_lshift
    - ast_rshift
2010-10-19 13:17:33 -07:00
Eric Anholt
f30de69640 i965: Disable thread dispatch when the FS doesn't do any work.
This should reduce the cost of generating shadow maps, for example.
No performance difference measured in nexuiz, though it does trigger
this path.
2010-10-19 10:49:20 -07:00
Eric Anholt
2595589f1d i965: Remove the gen6 emit_mi_flushes I sprinkled around the driver.
These were for debugging in bringup.  Now that relatively complicated
apps are working, they haven't helped debug anything in quite a while.
2010-10-19 10:49:19 -07:00
Eric Anholt
32573792de i965: Tell the shader compiler when we expect depth writes for gen6.
This fixes hangs in some Z-writes-in-shaders tests, though other
pieces don't come out correctly.

Bug #30392: hang in fbo-fblit-d24s8. (still fails with bad color drawn
to some targets)
2010-10-19 10:48:56 -07:00
Vinson Lee
36dde032a4 llvmpipe: Initialize variable. 2010-10-19 10:14:11 -07:00
Vinson Lee
22725eb3e8 llvmpipe: Initialize state variable in debug_bin function. 2010-10-19 10:02:28 -07:00
Vinson Lee
a143b6d5d8 st/xorg: Fix memory leak on error path. 2010-10-19 09:49:15 -07:00
Brian Paul
ec2824cd86 gallivm: fix incorrect type for zero vector in emit_kilp()
http://bugs.freedesktop.org/show_bug.cgi?id=30974
2010-10-19 09:14:19 -06:00
Brian Paul
988b246c47 mesa: fix mesa version string construction
Now that MESA_MINOR=10, we no longer need the extra '0' in the
version string.
2010-10-19 08:59:27 -06:00
Thomas Hellstrom
f82d984352 mesa: Make sure we have the talloc cflags when using the talloc headers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 14:18:20 +02:00
Thomas Hellstrom
9e96b695b0 st/xorg: Fix compilation for Xservers >= 1.10
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:08:06 +02:00
Thomas Hellstrom
543136d5bd xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:28:24 +02:00
Thomas Hellstrom
2ab7a8a3eb st/xorg: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:28:18 +02:00
Thomas Hellstrom
0301c9ac62 st/xorg: Fix compilation errors for Xservers compiled without Composite
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:28:08 +02:00
Thomas Hellstrom
0d0a6e9096 st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 11:27:54 +02:00
Vinson Lee
f36a642030 r300/compiler: Remove unused variable. 2010-10-19 00:07:22 -07:00
Tom Stellard
f822cc22f2 r300g: Add new debug option for logging vertex/fragment program stats 2010-10-18 20:51:05 -07:00
Tom Stellard
9d2ab6cb00 r300/compiler: Add a new function for more efficient dataflow analysis
rc_get_readers_normal() supplies a list of readers for a given
instruction.  This function is now being used by the copy propagate
optimization and will eventually be used by most other optimization
passes as well.
2010-10-18 20:51:05 -07:00
Tom Stellard
3cdff41d92 r300/compiler: Clear empty registers after constant folding 2010-10-18 20:51:05 -07:00
Tom Stellard
75734d0a37 r300/compiler: Fix incorrect assumption
It is possible for a single pair instruction arg to select from both an
RGB and an Alpha source.
2010-10-18 20:51:05 -07:00
Tom Stellard
ad683577b2 r300/compiler: Create a helper function for merging presubtract sources 2010-10-18 20:51:05 -07:00
Kenneth Graunke
80c9f756b2 i965: Remove unused variable. 2010-10-18 18:44:19 -07:00
Kenneth Graunke
9c80fa824c glsl: Regenerate parser files. 2010-10-18 17:40:09 -07:00
Kenneth Graunke
0eb0b44647 glsl: Fix copy and paste error in ast_bit_and node creation.
All & operations were incorrectly being generated as ast_bit_or.
2010-10-18 17:40:09 -07:00
Eric Anholt
4af2937416 i965: Avoid blits in BufferCopySubdata on gen6.
Fixes glean/bufferObject.
2010-10-18 14:14:06 -07:00
Eric Anholt
641028debf i965: Fix scissor-offscreen on gen6 like we did pre-gen6. 2010-10-18 13:11:29 -07:00
Eric Anholt
022531209d i965: Assert out on gen6 VS constant buffer reads that hang the GPU for now. 2010-10-18 12:56:44 -07:00
Eric Anholt
66800a04e5 i965: Fix assertion failure on gen6 BufferSubData to busy BO.
Fixes fbo-blit and probably several other tests.
2010-10-18 12:56:44 -07:00
Eric Anholt
746e68c50b i965: Fix a weirdness in NOT handling.
XOR makes much more sense.  Note that the previous code would have
failed for not(not(x)), but that gets optimized out.
2010-10-18 12:56:44 -07:00
Eric Anholt
ea213417f1 i965: Disable the debug printf I added for FS disasm. 2010-10-18 12:56:44 -07:00
Kenneth Graunke
65d4234c23 i965: Add missing "break" statement.
Otherwise, it would try to handle arrays as structures, use
uninitialized memory, and crash.
2010-10-18 12:21:20 -07:00
José Fonseca
f37b114dc3 llvmpipe: Don't test rounding of x.5 numbers.
SSE4.1 has different rules, and so far this doesn't seem to cause any
problems with conformance test suites.
2010-10-18 09:35:21 -07:00
José Fonseca
ac17c62ece gallivm: Add a note about SSE4.1's nearest mode rounding. 2010-10-18 09:32:35 -07:00
Brian Rogers
746b602fbd mesa: Add missing else in do_row_3D
This fixes erroneous "bad format in do_row()" messages

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-10-18 08:11:04 -06:00
Brian Paul
01e0aaefcc llvmpipe: remove lp_setup_coef*.c files from Makefile 2010-10-18 07:59:02 -06:00
Victor Tseng
e19187e1be egl/i965: include inline_wrapper_sw_helper.h
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-10-18 07:55:52 -06:00
Kenneth Graunke
b8276e46f5 glsl: Don't return NULL IR for erroneous bit-shift operators.
Existing code relies on IR being generated (possibly with error type)
rather than returning NULL.  So, don't break - go ahead and generate the
operation.  As long as an error is flagged, things will work out.

Fixes fd.o bug #30914.
2010-10-18 00:26:14 -07:00
Dave Airlie
8a74f7422b r600g: retrieve tiling info from kernel for shared buffers.
we need to know if the back is tiled so we can blit from it properly.
2010-10-18 13:46:42 +10:00
Dave Airlie
375613afe3 r600g: fix transfer function for tiling.
this makes readback with tiled back work better.
2010-10-18 13:46:42 +10:00
Dave Airlie
c61b97d504 r600g: attempt to cleanup depth blit
cleanup what I'm nearly sure is unnecessary work in the depth blit code.
2010-10-18 13:46:25 +10:00
Dave Airlie
21c6459dfb r600g: depth needs to bound to ds 2010-10-18 13:39:55 +10:00
Dave Airlie
69f8eebe72 r600g: fix typo in tiling setup cb code. 2010-10-18 13:39:55 +10:00
Dave Airlie
a1b7333c07 r600g: do proper tracking of views/samplers.
we need to do pretty much what r300g does in for this, this fixes some
issues seen while working on tiling.
2010-10-18 13:39:54 +10:00
Keith Whitwell
9da17fed2e llvmpipe: remove unused arg from jit_setup_tri function 2010-10-17 19:23:40 -07:00
Keith Whitwell
75799b8d02 llvmpipe: remove unused file 2010-10-17 19:11:47 -07:00
Keith Whitwell
0072acd447 Merge remote branch 'origin/master' into lp-setup-llvm
Conflicts:
	src/gallium/drivers/llvmpipe/lp_setup_coef.c
	src/gallium/drivers/llvmpipe/lp_setup_coef.h
	src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c
	src/gallium/drivers/llvmpipe/lp_setup_point.c
	src/gallium/drivers/llvmpipe/lp_setup_tri.c
	src/gallium/drivers/llvmpipe/lp_state_derived.c
	src/gallium/drivers/llvmpipe/lp_state_fs.h
2010-10-17 19:09:42 -07:00
Keith Whitwell
ca2b2ac131 llvmpipe: fail cleanly on malloc failure in lp_setup_alloc_triangle 2010-10-17 18:48:11 -07:00
Keith Whitwell
543fb77dde llvmpipe: remove setup fallback path 2010-10-17 18:29:28 -07:00
José Fonseca
4dfb43c6a6 gallivm: Comment lp_build_insert_new_block(). 2010-10-17 18:23:18 -07:00
Keith Whitwell
b5236f3da4 llvmpipe: clean up fields in draw_llvm_variant_key 2010-10-17 17:53:29 -07:00
Dave Airlie
5b966f58e3 r600g: set tiling bits in hw state 2010-10-18 09:25:22 +10:00
Dave Airlie
7b3fa03883 r600g: get tiling info from kernel 2010-10-18 09:25:22 +10:00
Dave Airlie
e8e20313af r600g: add defines for tiling 2010-10-18 09:25:22 +10:00
Dave Airlie
82114ac02a r600g: switch to a common formats.h file since they are in different regs 2010-10-18 09:13:46 +10:00
Vinson Lee
c9d297162a llvmpipe: Return non-zero exit code for lp_test_round failures. 2010-10-17 14:09:53 -07:00
Hui Qi Tay
c1d6b31866 draw: corrections for w coordinate 2010-10-17 10:57:43 -07:00
José Fonseca
4afad7d3ed llvmpipe: Initialize bld ctx via lp_build_context_init instead of ad-hoc and broken code. 2010-10-17 10:15:15 -07:00
José Fonseca
a0add0446c llvmpipe: Fix bad refactoring.
'i' and 'chan' have random values here, which could cause a buffer
overflow in debug builds, if chan > 4.
2010-10-17 09:58:04 -07:00
José Fonseca
dc5bdbe0f9 gallivm: Fix SoA cubemap derivative computation.
Derivatives are now scalar.

Broken since 17dbd41cf2.
2010-10-17 09:43:18 -07:00
José Fonseca
709699d2e2 llvmpipe: Ensure z_shift and z_width is initialized. 2010-10-17 07:45:08 -07:00
José Fonseca
914b0d34e8 llvmpipe: Fix depth-stencil regression.
If stencil is enabled then we need to load the z_dst, even if depth
testing is disabled.

This fixes reflect mesa demo.
2010-10-17 07:22:34 -07:00
Dave Airlie
98b3f27439 r600g: add evergreen ARL support.
Thanks to Alex Deucher for pointing out the FLT to int conversion is necessary
and writing an initial patch, this brings about 20 piglits, and I think this
is the last piece to make evergreen and r600 equal in terms of features.
2010-10-17 16:48:30 +10:00
Brian Paul
46c2ee4fad gallivm: use util_snprintf() 2010-10-15 17:32:23 -06:00
Brian Paul
81c27dbfb9 st/mesa: update function name, comments 2010-10-15 17:24:43 -06:00
Brian Paul
fa5309f0b0 st/mesa: use GLuint to avoid problem w/ uint not defined on mingw32 2010-10-15 17:18:39 -06:00
Brian Paul
cba65f7e0e st/mesa: reformatting in st_cb_drawpixels.c 2010-10-15 17:01:56 -06:00
Brian Paul
61a467e515 st/mesa: fix regressions in glDrawPixels(GL_STENCIL_INDEX)
We need to keep track of three different fragment shaders: Z-only, stencil-
only, and Z+stencil.  Before, we were only keeping track of the first one
we encountered.
2010-10-15 16:54:03 -06:00
Brian Paul
b2578ef873 glsl: add ir_unop_round_even case to silence unhandled enum warning 2010-10-15 15:44:01 -06:00
Brian Paul
fb8f3d7711 gallivm: added lp_build_load_volatile()
There's no LLVM C LLVMBuildLoadVolatile() function so roll our own.
Not used anywhere at this time but can come in handy during debugging.
2010-10-15 15:40:33 -06:00
Brian Paul
991f0c2763 gallivm: added lp_build_print_vec4() 2010-10-15 15:40:33 -06:00
Eric Anholt
81d0a1fb3f i965: Set the type of the null register to fix gen6 FS comparisons.
We often use reg_null as the destination when setting up the flag
regs.  However, on gen6 there aren't general implicit conversions to
destination types from src types, so the comparison to produce the
flag regs would be done on the integer result interpreted as a float.
Hilarity ensued.

Fixes 20 piglit cases.
2010-10-15 13:13:56 -07:00
Ian Romanick
20b39c7760 i965: Fix indentation after commit 3322fbaf 2010-10-15 12:11:03 -07:00
Ian Romanick
f29ff6efa6 linker: Trivial indention fix 2010-10-15 12:11:03 -07:00
Jakob Bornecrantz
eb7cf3d2a6 target-helpers: Remove per target software wrapper check
Instead of having a NAME_SOFTWARE check just use the GALLIUM_DRIVER
instead but set the default to native which is the same as not wrapped.
2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
af729571eb egl: Remove unnecessary headers 2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
44207ff71b wrapper: Add a way to dewrap a pipe screen without destroying it 2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
f8f3baa43a wrapper: Fix spelling 2010-10-15 19:13:00 +01:00
Jakob Bornecrantz
992e7c7279 llvmpipe: Move makefile include to before targets
Or plain make inside of the directory wont build libllvmpipe.a
2010-10-15 19:13:00 +01:00
Xavier Chantry
9c439e3c7a nv50: apply layout_mask to tile_flags
The tile_flags now store more than just nv50 page table entry bits.
2010-10-15 15:54:02 +02:00
Keith Whitwell
ac98519c4e llvmpipe: validate color outputs against key->nr_cbufs 2010-10-15 14:49:13 +01:00
Keith Whitwell
ffab84c9a2 llvmpipe: check shader outputs are non-null before using 2010-10-15 14:49:13 +01:00
Vinson Lee
a14376218e mesa: Add missing header to shaderobj.h.
Include compiler.h for ASSERT symbol.
2010-10-15 06:13:18 -07:00
Keith Whitwell
39185efd3a llvmpipe: fix non-sse build after recent changes 2010-10-15 14:11:22 +01:00
Keith Whitwell
392b0954c2 llvmpipe: use aligned loads/stores for plane values 2010-10-15 13:52:00 +01:00
Keith Whitwell
9f9a17eba8 llvmpipe: do plane calculations with intrinsics
This is a step towards moving this code into the rasterizer.
2010-10-15 13:38:06 +01:00
Keith Whitwell
15f4e3a8b9 gallium: move some intrinsics helpers to u_sse.h 2010-10-15 13:29:56 +01:00
Keith Whitwell
8965f042b3 llvmpipe: don't store plane.ei value in binned data
Further reduce the size of a binned triangle.
2010-10-15 13:27:47 +01:00
Keith Whitwell
9bf8a55c4b llvmpipe: slightly shrink the size of a binned triangle 2010-10-15 13:27:47 +01:00
Keith Whitwell
0a1c900103 llvmpipe: don't pass frontfacing as a float 2010-10-15 13:27:47 +01:00
Keith Whitwell
4195febeec llvmpipe: reintroduce SET_STATE binner command
But bin lazily only into bins which are receiving geometry.
2010-10-15 13:27:47 +01:00
Chad Versace
e2c1fe3eb0 glsl: Fix ir validation for bit logic ops
In ir_validate::visit_leave(), the cases for
    - ir_binop_bit_and
    - ir_binop_bit_xor
    - ir_binop_bit_or
were incorrect. It was incorrectly asserted that both operands must be the
same type, when in fact one may be scalar and the other a vector. It was also
incorrectly asserted that the resultant type was the type of the left operand,
which in fact does not hold when the left operand is a scalar and the right
operand is a vector.
2010-10-15 00:20:18 -07:00
Chad Versace
4761d0d22b glsl: Implement constant expr evaluation for bitwise logic ops
Implement by adding the following cases to
ir_exporession::constant_expression_value():
    - ir_binop_bit_and
    - ir_binop_bit_or
    - ir_binop_bit_xor
2010-10-15 00:20:18 -07:00
Chad Versace
adea8150a7 glsl: Implement constant expr evaluation for bit-shift ops
Implement by adding the following cases to
ir_expression::constant_expression_value():
    - ir_binop_lshfit
    - ir_binop_rshfit
2010-10-15 00:20:18 -07:00
Chad Versace
90a8b792c0 glsl: Implement constant expr evaluation for bitwise-not
Implement by adding a case to ir_expression::constant_expression_value()
for ir_unop_bit_not.
2010-10-15 00:20:18 -07:00
Chad Versace
5c4c36f7f3 glsl: Implement ast-to-hir for binary shifts in GLSL 1.30
Implement by adding the following cases to ast_expression::hir():
    - ast_lshift
    - ast_rshift
Also, implement ir validation for the new operators by adding the following
cases to ir_validate::visit_leave():
    - ir_binop_lshift
    - ir_binop_rshift
2010-10-15 00:20:18 -07:00
Chad Versace
f88b4eaa8f glsl: Change generated file glsl_lexer.cpp 2010-10-15 00:20:18 -07:00
Chad Versace
7abdc71afa glsl: Add lexer rules for << and >> in GLSL 1.30
Commit for generated file glsl_lexer.cpp follows this commit.
2010-10-15 00:20:18 -07:00
Dave Airlie
fc6caef4cb r600g: evergreen interpolation support.
On evergreen, interpolation has moved into the fragment shader,
with the interpolation parmaters being passed via GPRs and LDS entries.

This works out the number of interps required and reserves GPR/LDS
storage for them, it also correctly routes face/position values which
aren't interpolated from the vertex shader.

Also if we noticed nothing is to be interpolated we always setup perspective
interpolation for one value otherwise the GPU appears to lockup.

This fixes about 15 piglit tests on evergreen.
2010-10-15 14:59:17 +10:00
Dave Airlie
07a30e3d18 tgsi: add scanner support for centroid inputs 2010-10-15 14:59:17 +10:00
Ian Romanick
3322fbaf3b glsl: Slightly change the semantic of _LinkedShaders
Previously _LinkedShaders was a compact array of the linked shaders
for each shader stage.  Now it is arranged such that each slot,
indexed by the MESA_SHADER_* defines, refers to a specific shader
stage.  As a result, some slots will be NULL.  This makes things a
little more complex in the linker, but it simplifies things in other
places.

As a side effect _NumLinkedShaders is removed.

NOTE: This may be a candidate for the 7.9 branch.  If there are other
patches that get backported to 7.9 that use _LinkedShader, this patch
should be cherry picked also.
2010-10-14 17:16:59 -07:00
Eric Anholt
4b4284c9c9 i965: Fix texturing on pre-gen5.
I broke it in 06fd639c51 by only testing
2 generations of hardware :(
2010-10-14 17:13:19 -07:00
Brian Paul
3d7479d705 llvmpipe: code to dump bytecode to file (disabled) 2010-10-14 17:28:24 -06:00
Brian Paul
62450b3c49 gallivm: add compile-time option to emit inst addrs and/or line numbers
Disabling address printing is helpful for diffing.
2010-10-14 17:28:24 -06:00
Brian Paul
8fb49554d9 mesa: remove post-convolution width/height vars
These were left-over bits from when convolution was removed.
2010-10-14 17:28:24 -06:00
Kenneth Graunke
2bc704d543 glsl: Refresh autogenerated file builtin_function.cpp. 2010-10-14 15:59:47 -07:00
Kenneth Graunke
27ced5c5ff glsl: Add support for the 1.30 round() built-in.
This implements round() via the ir_unop_round_even opcode, rather than
adding a new opcode.  We may wish to add one in the future, since it
might enable a small performance increase on some hardware, but for now,
this should suffice.
2010-10-14 15:59:47 -07:00
Kenneth Graunke
f157812bbb i965: Add support for ir_unop_round_even via the RNDE instruction. 2010-10-14 15:59:47 -07:00
Kenneth Graunke
6dc204c5dc glsl: Add front-end support for GLSL 1.30's roundEven built-in.
Implemented using the op-code introduced in the previous commit.
2010-10-14 15:59:47 -07:00
Kenneth Graunke
d85d25dd1f glsl: Add a new ir_unop_round_even opcode for GLSL 1.30's roundEven.
Also, update ir_to_mesa's "1.30 is unsupported" case to "handle" it.
2010-10-14 15:59:47 -07:00
Dave Airlie
510c503762 r300g: clean up warning due to unknown cap. 2010-10-15 08:46:16 +10:00
Keith Whitwell
8260ab9346 r600g: handle absolute modifier in shader translator
This was being classed as unsupported in one place but used in others.
Enabling it seems to work fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:50 +10:00
Keith Whitwell
c28f764572 r600g: emit hardware linewidth
Tested with demos/pixeltest - line rasterization doesn't seem to be
set up for GL conventions yet, but at least width is respected now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:25 +10:00
Keith Whitwell
cbf2fb5543 r600/drm: fix segfaults in winsys create failure path
Would try to destroy radeon->cman, radeon->kman both which were still
NULL.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:00 +10:00
Hui Qi Tay
26ff7523b6 draw: sanitize llvm variant key
Fixes recompilation, but seems to be broken with llvm 2.8.
2010-10-14 22:34:10 +01:00
Kenneth Graunke
4bab22bca3 i965: Clean up a warning in the old fragment backend.
Hopefully this code can just go away soon.
2010-10-14 13:19:23 -07:00
Eric Anholt
a81d423d93 i965: Enable the new FS backend on pre-gen6 as well.
It is now to the point where we have no regressing piglit tests.  It
also fixes Yo Frankie! and Humus DynamicBranching, probably due to the
piglit bias tests that work that didn't on the Mesa IR backend.

As a downside, performance takes about a 5-10% performance hit at the
moment (e.g. nexuiz 19.8fps -> 18.8fps), which I plan to resolve by
reintroducing 16-wide fragment shaders where possible.  It is a win,
though, for fragment shaders using flow control.
2010-10-14 12:40:50 -07:00
Kenneth Graunke
897f6d3c7d i965: Correctly emit the RNDZ instruction.
Simply using RNDU, RNDZ, or RNDE does not produce the desired result.
Rather, the RND* instructions place a value in the destination register
that may be 1 less than the correct answer.  They can also set per-channel
"increment bits" in a flag register, which, if set, mean dest needs to
be incremented by 1.  A second instruction - a predicated add -
completes the job.

Notably, RNDD always produces the correct answer in a single
instruction.

Fixes piglit test glsl-fs-trunc.
2010-10-14 12:40:16 -07:00
Kenneth Graunke
f541b685aa i965: Use RNDZ for ir_unop_trunc in the new FS.
The existing code used RNDD, which rounds down, rather than toward zero.
2010-10-14 12:40:16 -07:00
Kenneth Graunke
f9bd4c6c26 glsl: Refresh autogenerated file builtin_function.cpp. 2010-10-14 12:40:16 -07:00
Kenneth Graunke
090dd4fcc5 glsl: Add front-end support for the "trunc" built-in. 2010-10-14 12:40:16 -07:00
Kenneth Graunke
c4226142f3 i965: Use logical-not when emitting ir_unop_ceil.
Fixes piglit test glsl-fs-ceil.
2010-10-14 12:40:16 -07:00
Eric Anholt
5dd07b442e i965: Add peepholing of conditional mod generation from expressions.
This cuts usually 2 out of 3 instructions for flag reg generation (if
statements, conditional assignment) by producing the conditional mod
in the expression representing the boolean value.

Fixes glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined (register
allocation no longer fails for the conditional generation
proliferation)
2010-10-14 12:02:54 -07:00
Eric Anholt
d5599c0b6a i965: Add a function for handling the move of boolean values to flag regs.
This will be a place to peephole comparisions directly to the flag
regs, and for now avoids using MOV with conditional mod on gen6, which
is now illegal.
2010-10-14 12:02:54 -07:00
Kristian Høgsberg
1d33e940d2 Only install vtxfmt tables for OpenGL
GLES1 and GLES2 install their own exec pointers and don't need the
Save table.  Also, the SET_* macros use different indices for the different
APIs so the offsets used in vtxfmt.c are actually wrong for the ES APIs.
2010-10-14 15:00:22 -04:00
Eric Anholt
4f88550ba0 i965: Add a pass to the FS to split virtual GRFs to float channels.
Improves nexuiz performance 0.91% (+/- 0.54%, n=8)
2010-10-14 10:42:55 -07:00
Eric Anholt
b8613d70da i965: Update the live interval when coalescing regs. 2010-10-14 10:42:55 -07:00
Eric Anholt
0c6752026c i965: Set class_sizes[] for the aligned reg pair class.
So far, I've only seen this be a valgrind warning and not a real failure.
2010-10-14 10:42:55 -07:00
Keith Whitwell
f0bd76f28d llvmpipe: don't try to emit non-existent color outputs 2010-10-14 14:08:20 +01:00
Kristian Høgsberg
81ccb3e2ce Drop the "neutral" tnl module
Just always check for FLUSH_UPDATE_CURRENT and call Driver.BeginVertices
when necessary.  By using the unlikely() macros, this ends up as
a 10% performance improvement (for isosurf, anyway) over the old,
complicated function pointer swapping.
2010-10-14 08:53:59 -04:00
Chia-I Wu
d6de1f44a0 st/egl: Do not finish a fence that is NULL.
i915g would dereference the NULL pointer.
2010-10-14 17:16:14 +08:00
Chia-I Wu
c97c77d869 st/egl: Access _EGLConfig directly.
Drop the use of SET_CONFIG_ATTRIB.  Fix the value of EGL_SAMPLE_BUFFERS
along the way.
2010-10-14 17:16:14 +08:00
Chia-I Wu
3fa21881b1 egl: Access config attributes directly.
Replace SET_CONFIG_ATTRIB/GET_CONFIG_ATTRIB by direct dereferences.
2010-10-14 17:16:14 +08:00
Chia-I Wu
282e514240 egl: Use attribute names as the _EGLConfig member names.
This makes _EGLConfig more accessible and scales better when new
attributes are added.
2010-10-14 17:14:44 +08:00
Dave Airlie
68014c8d19 r600g: select linear interpolate if tgsi input requests it 2010-10-14 14:27:34 +10:00
Dave Airlie
0637044add r600g: fixup typo in macro name 2010-10-14 14:19:37 +10:00
Dave Airlie
1e82c28fcf r600g: fixup pos/face ena/address properly 2010-10-14 14:15:15 +10:00
Dave Airlie
8a9f02c5d5 r600g: only pick centroid coordinate when asked.
TGSI tells us when to use this, its not hooked up from GLSL to MESA to TGSI yet though.
2010-10-14 14:15:15 +10:00
Zhenyu Wang
338b3f0b90 Revert "i965: fallback lineloop on sandybridge for now"
This reverts commit 73dab75b41.
2010-10-14 11:24:49 +08:00
Zhenyu Wang
e8e79c1d7e i965: Fix GS hang on Sandybridge
Don't use r0 for FF_SYNC dest reg on Sandybridge, which would
smash FFID field in GS payload, that cause later URB write fail.
Also not use r0 in any URB write requiring allocate.
2010-10-14 11:24:42 +08:00
Eric Anholt
a57ef244fc i965: Add support for rescaling GL_TEXTURE_RECTANGLE coords to new FS. 2010-10-13 17:07:43 -07:00
Fredrik Höglund
a21a2748be r600g: Fix texture sampling with swizzled coords
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-14 09:25:29 +10:00
Dave Airlie
26dacce2c0 r600g: drop unused context members 2010-10-14 09:10:16 +10:00
Ian Romanick
7d8ba5f78f mesa: Clean up various 'unused parameter' warnings in shaderapi 2010-10-13 15:35:23 -07:00
Ian Romanick
ccc1c4c6d9 mesa: Clean up two 'comparison between signed and unsigned' warnings 2010-10-13 15:35:23 -07:00
Ian Romanick
5cb24c4a75 mesa: Refactor validation of shader targets
Actually validate that the implementation supports the particular
shader target as well.  Previously if a driver only supported vertex
shaders, for example, glCreateShaderObjectARB would gladly create a
fragment shader.

NOTE: this is a candidate for the 7.9 branch.
2010-10-13 15:35:18 -07:00
Ian Romanick
babe20b9d1 mesa: Silence unused variable warning 2010-10-13 15:30:20 -07:00
Ian Romanick
4a45595cf3 linker: Reject shaders that have unresolved function calls
This really amounts to just using the return value from
link_function_calls.  All the work was being done, but the result was
being ignored.

Fixes piglit test link-unresolved-funciton.

NOTE: this is a candidate for the 7.9 branch.
2010-10-13 15:30:19 -07:00
Vinson Lee
720bdfbceb glsl: Initialize variable in ir_derefence_array::constant_expression_value
Completely initialize data passed to ir_constant constructor.

Fixes piglit glsl-mat-from-int-ctor-03 valgrind uninitialized value
error on softpipe.
2010-10-13 14:21:08 -07:00
José Fonseca
ae00e34e4b llvmpipe: Generalize the x8z24 fast path to all depth formats.
Together with the previous commit, this generalize the benefits of
d2cf757f44 to all depth formats, in
particular:
- simpler float -> 24unorm conversion
- avoid unsigned comparisons (not directly supported on SSE) by aligning
to the least significant bit
- avoid unecessary/repeated mask ANDing

Verified with trivial/tri-z that the exact same assembly is produced for
X8Z24.
2010-10-13 20:25:57 +01:00
José Fonseca
60c5d4735d gallivm: More accurate float -> 24bit & 32bit unorm conversion. 2010-10-13 20:25:57 +01:00
Brian Paul
e487b665aa gallivm: work-around trilinear mipmap filtering regression with LLVM 2.8
The bug only happens on the AOS / fixed-pt path.
2010-10-13 12:37:42 -06:00
Vinson Lee
bee22ed6b9 gallivm: Remove unnecessary header. 2010-10-13 11:18:40 -07:00
Brian Paul
c3ed27ec76 x11: fix breakage from gl_config::visualType removal 2010-10-13 08:32:08 -06:00
José Fonseca
95c18abb03 llvmpipe: Unbreak Z32_FLOAT.
Z32_FLOAT uses <4 x float> as intermediate/destination type,
instead of <4 x i32>.

The necessary bitcasts got removed with commit
5b7eb868fd

Also use depth/stencil type and build contexts consistently, and
make the depth pointer argument a ordinary <i8 *>, to catch this
sort of issues in the future (and also to pave way for Z16 and
Z32_FLOAT_S8_X24 support).
2010-10-13 15:25:15 +01:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Kristian Høgsberg
31aca27c08 Drop GLframebuffer typedef and just use struct gl_framebuffer 2010-10-13 09:43:24 -04:00
Kristian Høgsberg
d3491e775f Rename GLvisual and __GLcontextModes to struct gl_config 2010-10-13 09:43:24 -04:00
Kristian Høgsberg
705e142dda gl: Remove unused GLcontextModes fields 2010-10-13 09:43:24 -04:00
Kristian Høgsberg
e3c1c5377c Get rid of GL/internal/glcore.h
__GLcontextModes is always only used as an implementation internal struct
at this point and we shouldn't install glcore.h anymore.  Anything that
needs __GLcontextModes should just include the struct in its headers files
directly.
2010-10-13 09:43:24 -04:00
Roland Scheidegger
d838e4f66d gallivm: only use lp_build_conv 4x4f -> 1x16 ub fastpath with sse2
This is relying on lp_build_pack2 using the sse2 pack intrinsics which
handle clamping.
(Alternatively could have make it use lp_build_packs2 but it might
not even produce more efficient code than not using the fastpath
in the first place.)
2010-10-13 15:26:37 +02:00
Dave Airlie
ff4b397517 r600g: fix stencil export for evergreen harder 2010-10-13 18:50:37 +10:00
Stephan Schmid
40cc5bfcd7 r600g: fix relative addressing when splitting constant accesses
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 18:49:27 +10:00
Dave Airlie
6da8129b3c r600g: add missing eg reg definition 2010-10-13 17:45:10 +10:00
Dave Airlie
92e729bba5 r600g: evergreen add stencil export bit 2010-10-13 17:40:32 +10:00
Dave Airlie
88c1b32c62 r600g: use blitter for hw copy region
at the moment depth copies are failing (piglit depth-level-clamp)
so use the fallback for now until get some time to investigate.
2010-10-13 15:55:49 +10:00
Dave Airlie
f8778eeb40 r600g: drop all use of unsigned long
this changes size on 32/64 bit so is definitely no what you want to use here.
2010-10-13 15:55:48 +10:00
Dave Airlie
e9acf9a3bb r600g: fix transfer stride.
fixes segfaults
2010-10-13 15:55:48 +10:00
Dave Airlie
e3b089126c r600g: remove bpt and start using pitch_in_bytes/pixels.
this mirror changes in r300g, bpt is kinda useless when it comes to some
of the non-simple texture formats.
2010-10-13 15:55:48 +10:00
Dave Airlie
fa797f12b3 r600g: rename pitch in texture to pitch_in_bytes 2010-10-13 15:55:47 +10:00
Dave Airlie
6a0066a69f r600g: use common texture object create function 2010-10-13 15:55:47 +10:00
Dave Airlie
771dd89881 r600g: split out miptree setup like r300g
just a cleanup step towards tiling
2010-10-13 15:55:47 +10:00
Dave Airlie
9979d60c0e r600g: add copy into tiled texture 2010-10-13 15:55:46 +10:00
Dave Airlie
5604276670 r600g: the vs/ps const arrays weren't actually being used.
completely removed them.
2010-10-13 15:56:12 +10:00
Dave Airlie
d59498b780 r600g: reduce size of context structure.
this thing will be in the cache a lot, so having massive big struct
arrays inside it won't be helping anyone.
2010-10-13 15:25:00 +10:00
Vinson Lee
8c107e6ca6 tdfx: Silence unused variable warning on non-debug builds.
Fixes this GCC warning.
tdfx_texman.c: In function 'tdfxTMMoveOutTM_NoLock':
tdfx_texman.c:897: warning: unused variable 'shared'
2010-10-12 22:23:21 -07:00
Dave Airlie
c8d4108fbe r600g: store samplers/views across blit when we need to modify them
also fixup framebuffer state copies to avoid bad state.
2010-10-13 15:11:30 +10:00
Dave Airlie
a8d1d7253e r600g: fix scissor/cliprect confusion
gallium calls them scissors, but r600 hw like r300 is better off using
cliprects to implement them as we can turn them on/off a lot easier.
2010-10-13 15:11:30 +10:00
Dave Airlie
833b4fc11e r600g: fix depth0 setting 2010-10-13 15:11:30 +10:00
Vinson Lee
71fa3f8fe2 r300: Silence uninitialized variable warning.
Fixes this GCC warning.
r300_state.c: In function 'r300InvalidateState':
r300_state.c:2247: warning: 'hw_format' may be used uninitialized in this function
r300_state.c:2247: note: 'hw_format' was declared here
2010-10-12 22:02:27 -07:00
Brian Paul
39de9251c4 mesa: reformatting, comments, code movement 2010-10-12 19:04:05 -06:00
Brian Paul
048a90c1cb draw/llvmpipe: replace DRAW_MAX_TEXTURE_LEVELS with PIPE_MAX_TEXTURE_LEVELS
There's no apparent reason for the former to exist.  And they didn't
even have the same value.
2010-10-12 19:04:05 -06:00
Brian Paul
50f221a01b gallivm: remove newlines 2010-10-12 19:04:05 -06:00
Roland Scheidegger
c1549729ce gallivm: fix different handling of [non]normalized coords in linear soa path
There seems to be no reason for it, so do same math for both
(except the scale mul, of course).
2010-10-13 02:35:05 +02:00
Brian Paul
1ca5f7cc31 mesa: remove assertion w/ undeclared variable texelBytes 2010-10-12 18:32:06 -06:00
Dave Airlie
5f612f5c00 st/mesa: enable stencil shader export extension if supported 2010-10-13 09:30:05 +10:00
Dave Airlie
d9671863ea glsl: add support for shader stencil export
This adds proper support for the GL_ARB_shader_stencil_export extension
to the GLSL compiler. Thanks to Ian for pointing out where I need to add things.
2010-10-13 09:30:05 +10:00
Dave Airlie
39d1feb51e r600g: add shader stencil export support. 2010-10-13 09:30:05 +10:00
Dave Airlie
40acb109de r600g: add support for S8, X24S8 and S8X24 sampler formats. 2010-10-13 09:30:04 +10:00
Dave Airlie
ef8bb7ada9 st/mesa: use shader stencil export to accelerate shader drawpixels.
If the pipe driver has shader stencil export we can accelerate DrawPixels
using it. It tries to pick an S8 texture and works its way to X24S8 and S8X24
if that isn't supported.
2010-10-13 09:30:04 +10:00
Dave Airlie
06642c6175 st/mesa: add option to choose a texture format that we won't render to.
We need a texture to put the drawpixels stuff into, an S8 texture is less
memory/bandwidth than the 32-bit X24S8, but we might not be able to render
directly to an S8, so this lets us specify we won't be rendering to this
texture.
2010-10-13 09:30:04 +10:00
Dave Airlie
d8f6ef4565 softpipe: add support for shader stencil export capability
this allows softpipe to be used to test shader stencil ref exporting.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:04 +10:00
Dave Airlie
c79e681a68 mesa: improve texstore for 8/24 formats and add texstore for S8.
this improves mesa texstore for 8/24 so it can create S24X8/X24S8 variants
by keeping the depth bits static.

it also adds a texstore for S8 so we can write out an S8 texture to use
in the sampler for accel draw pixels to save memory bw.

The logic seems sound here, I've worked it out a few times on paper, though
it would be good to have some review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:04 +10:00
Dave Airlie
bec341d00c mesa: add support for FRAG_RESULT_STENCIL.
this is needed to add support for stencil shader export.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:03 +10:00
Dave Airlie
d02993c9dc gallium/util: add S8 tile sampling support. 2010-10-13 09:30:03 +10:00
Dave Airlie
67e71429f1 gallium/format: add X32_S8X24_USCALED format.
Has similiar use cases to the S8X24 and X24S8 formats.
2010-10-13 09:30:03 +10:00
Dave Airlie
66a0d1e4b9 gallium/format: add support for X24S8 and S8X24 formats.
these formats are needed for hw that can sample and write stencil values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:03 +10:00
Dave Airlie
4ecb2c105d gallium/tgsi: add support for stencil writes.
this adds the capability + a stencil semantic id, + tgsi scan support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-13 09:30:02 +10:00
Eric Anholt
43873b53c4 i965: Don't rebase the index buffer to min 0 if any arrays are in VBOs.
There was a check to only do the rebase if we didn't have everything
in VBOs, but nexuiz apparently hands us a mix of VBOs and arrays,
resulting in blocking on the GPU to do a rebase.

Improves nexuiz 800x600, high-settings performance on my Ironlake 41%
(+/- 1.3%), from 14.0fps to 19.7fps.
2010-10-12 15:17:35 -07:00
Eric Anholt
3316a54205 intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.
The format selection of the CopyTexSubImage is pretty bogus still, but
this at least avoids software fallbacks in nexuiz, bringing
performance from 7.5fps to 12.8fps on my machine.
2010-10-12 14:08:00 -07:00
Eric Anholt
080e7aface i965: Fix missing "break;" in i2b/f2b, and missing AND of CMP result.
Fixes glsl-fs-i2b.
2010-10-12 13:07:40 -07:00
Ian Romanick
9fea9e5e21 glsl: Fix incorrect assertion
This assertion was added in commit f1c1ee11, but it did not notice
that the array is accessed with 'size-1' instead of 'size'.  As a
result, the assertion was off by one.  This caused failures in at
least glsl-orangebook-ch06-bump.
2010-10-12 12:50:29 -07:00
Ian Romanick
b2b9b22c10 mesa: Validate assembly shaders when GLSL shaders are used
If an GLSL shader is used that does not provide all stages and
assembly shaders are provided for the missing stages, validate the
assembly shaders.

Fixes bugzilla #30787 and piglit tests glsl-invalid-asm0[12].

NOTE: this is a candidate for the 7.9 branch.
2010-10-12 10:54:28 -07:00
Keith Whitwell
7533c37457 llvmpipe: make sure intrinsics code is guarded with PIPE_ARCH_SSE 2010-10-12 18:28:12 +01:00
Thomas Hellstrom
893620e52e st/xorg: Fix typo
Pointed out by Jakob Bornecrantz.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 18:26:05 +02:00
Brian Paul
f1c1ee11d3 ir_to_mesa: assorted clean-ups, const qualifiers, new comments 2010-10-12 09:26:54 -06:00
José Fonseca
6fbd4faf97 gallivm: Name anonymous union. 2010-10-12 16:08:09 +01:00
Brian Paul
0ad9d8b538 st/xlib: add some comments 2010-10-12 08:54:54 -06:00
Brian Paul
3633e1f538 glsl2: fix signed/unsigned comparison warning 2010-10-12 08:54:16 -06:00
José Fonseca
e3ec0fdd54 llmvpipe: improve mm_mullo_epi32
Apply Jose's suggestions for a small but measurable improvement in
isosurf.
2010-10-12 14:17:21 +01:00
Thomas Hellstrom
b6b7ce84e5 st/xorg: Don't try to remove invalid fbs
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:05 +02:00
Thomas Hellstrom
201c3d3669 xorg/vmwgfx: Don't hide HW cursors when updating them
Gets rid of annoying cursor flicker

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:05 +02:00
Thomas Hellstrom
bfd065c71e st/xorg: Add a customizer option to get rid of annoying cursor update flicker
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:05 +02:00
Thomas Hellstrom
f0bbf130f9 xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:04 +02:00
Thomas Hellstrom
ec08047a80 st/xorg: Don't try to use option values before processing options
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 15:09:04 +02:00
Keith Whitwell
0ca0382d1b Revert "llvmpipe: try to keep plane c values small"
This reverts commit 9773722c2b.

Looks like there are some floor/rounding issues here that need
to be better understood.
2010-10-12 13:20:39 +01:00
Keith Whitwell
22ec25e2bf gallivm: don't branch on KILLs near end of shader 2010-10-12 13:14:51 +01:00
Keith Whitwell
d0eb854f58 r600g: add missing file to sconscript 2010-10-12 13:08:34 +01:00
Keith Whitwell
1a574afabc gallium: move sse intrinsics debug helpers to u_sse.h 2010-10-12 13:02:28 +01:00
José Fonseca
39331be44e llvmpipe: Fix MSVC build.
MSVC doesn't accept more than 3 __m128i arguments.
2010-10-12 12:27:55 +01:00
Keith Whitwell
b4277bc584 llvmpipe: fix typo in last commit 2010-10-12 11:52:39 +01:00
Keith Whitwell
9773722c2b llvmpipe: try to keep plane c values small
Avoid accumulating more and more fixed point bits.
2010-10-12 11:50:14 +01:00
Keith Whitwell
9d59e148f8 llvmpipe: add debug helpers for epi32 etc 2010-10-12 11:50:13 +01:00
Keith Whitwell
2cf98d5a6d llvmpipe: try to do more of rast_tri_3_16 with intrinsics
There was actually a large quantity of scalar code in these functions
previously.  This tries to move more into intrinsics.

Introduce an sse2 mm_mullo_epi32 replacement to avoid sse4 dependency
in the new rasterization code.
2010-10-12 11:50:07 +01:00
José Fonseca
4cb3b4ced8 llvmpipe: Do not dispose the execution engine.
The engine is a global owned by gallivm module.
2010-10-12 08:36:51 +01:00
Francisco Jerez
c25fcf5aa5 nouveau: Get larger push buffers.
Useful to amortize the command submission/reloc overhead (e.g. etracer
goes from 72 to 109 FPS on nv4b).
2010-10-12 04:13:22 +02:00
Francisco Jerez
70828aa246 dri/nouveau: Initialize tile_flags when allocating a render target. 2010-10-12 04:12:56 +02:00
Dave Airlie
965f69cb0c r600g: fix typo in vertex sampling on r600
fixes https://bugs.freedesktop.org/show_bug.cgi?id=30771

Reported-by: Kevin DeKorte
2010-10-12 09:45:22 +10:00
Eric Anholt
bcec03d527 i965: Always use the new FS backend on gen6.
It's now much more correct for gen6 than the old backend, with just 2
regressions I've found (one of which is common with pre-gen6 and will
be fixed by an array splitting IR pass).

This does leave the old Mesa IR backend getting used still when we
don't have GLSL IR, but the plan is to get GLSL IR input to the driver
for the ARB programs and fixed function by the next release.
2010-10-11 15:32:41 -07:00
Eric Anholt
0cadd32b6d i965: Fix gen6 pixel_[xy] setup to avoid mixing int and float src operands.
Pre-gen6, you could mix int and float just fine.  Now, you get goofy
results.

Fixes:
glsl-arb-fragment-coord-conventions
glsl-fs-fragcoord
glsl-fs-if-greater
glsl-fs-if-greater-equal
glsl-fs-if-less
glsl-fs-if-less-equal
2010-10-11 15:26:59 -07:00
Eric Anholt
17306c60ad i965: Don't compute-to-MRF in gen6 VS math.
There was code to do this for pre-gen6 already, this just enables it
for gen6 as well.
2010-10-11 15:26:59 -07:00
Eric Anholt
720ed3c906 i965: Expand uniform args to gen6 math to full registers to get hstride == 1.
This is a hw requirement in math args.  This also is inefficient, as
we're calculating the same result 8 times, but then we've been doing
that on pre-gen6 as well.  If we're doing math on uniforms, though,
we'd probably be better served by having some sort of mechanism for
precalculating those results into another uniform value to use.

Fixes 7 piglit math tests.
2010-10-11 15:26:58 -07:00
Eric Anholt
317dbf4613 i965: Don't compute-to-MRF in gen6 math instructions. 2010-10-11 15:26:58 -07:00
Eric Anholt
7b5bc38c44 i965: Add a couple of checks for gen6 math instruction limits. 2010-10-11 15:26:58 -07:00
Eric Anholt
25cf241540 i965: Don't consider gen6 math instructions to write to MRFs.
This was leftover from the pre-gen6 cleanups.  One tests regresses
where compute-to-MRF now occurs.
2010-10-11 15:26:58 -07:00
Chad Versace
41c2079855 glsl: Changes in generated file glsl_lexer.cpp
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:53 -07:00
Chad Versace
0c9fef6111 glsl: Add lexer rules for uint and uvecN (N=2..4)
Commit for generated file glsl_lexer.cpp follows this commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:48 -07:00
Chad Versace
fc99a3beb9 glsl: Add glsl_type::uvecN_type for N=2,3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:44 -07:00
Chad Versace
a34817917b intel_extensions: Add ability to set GLSL version via environment
Add ability to set the GLSL version used by the GLcontext by setting the
environment variable INTEL_GLSL_VERSION. For example,
    env INTEL_GLSL_VERSION=130 prog args
If the environment variable is missing, the GLSL versions defaults to 120.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11 14:25:30 -07:00
Daniel Vetter
603741a86d r200: revalidate after radeon_update_renderbuffers
By calling radeon_draw_buffers (which sets the necessary flags
in radeon->NewGLState) and revalidating if NewGLState is non-zero
in r200TclPrimitive. This fixes an assert in libdrm (the color-/
depthbuffer was changed but not yet validated) and and stops the
kernel cs checker from complaining about them (when they're too
small).

Thanks to Mario Kleiner for the hint to call radeon_draw_buffer
(instead of my half-broken hack).

v2: Also fix the swtcl r200 path.

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-10-11 15:16:44 -04:00
Eric Anholt
c6dbf253d2 i965: Compute to MRF in the new FS backend.
This didn't produce a statistically significant performance difference
in my demo (n=4) or nexuiz (n=3), but it still seems like a good idea
and is recommended by the HW team.
2010-10-11 12:08:13 -07:00
Eric Anholt
06fd639c51 i965: Give the FB write and texture opcodes the info on base MRF, like math. 2010-10-11 12:07:33 -07:00
Eric Anholt
0cd6cea8a3 i965: Give the math opcodes information on base mrf/mrf len.
This is progress towards enabling a compute-to-MRF pass.
2010-10-11 12:03:34 -07:00
Eric Anholt
37758fb1cb i965: Move FS backend structures to a header.
It's time to start splitting some of this up.
2010-10-11 11:52:02 -07:00
Eric Anholt
251fe27854 i965: Reduce register interference checks for changed FS_OPCODE_DISCARD.
While I don't know of any performance changes from this (once extra
reg available out of 128), it makes the generated asm a lot cleaner
looking.
2010-10-11 11:52:01 -07:00
Eric Anholt
90c4022040 i965: Split FS_OPCODE_DISCARD into two steps.
Having the single opcode write then read the reg meant that single
instruction opcodes had to consider their source regs to interfere
with their dest regs.
2010-10-11 11:52:01 -07:00
José Fonseca
986cb9d5cf llvmpipe: Use lp_tgsi_info. 2010-10-11 13:06:25 +01:00
José Fonseca
7c1b5772a8 gallivm: More detailed analysis of tgsi shaders.
To allow more optimizations, in particular for direct textures.
2010-10-11 13:05:32 +01:00
José Fonseca
11dad21718 tgsi: Export some names for some tgsi enums.
Useful to give human legible names in other cases.
2010-10-11 13:05:31 +01:00
José Fonseca
6c1aa4fd49 gallium: Define C99 restrict keyword where absent. 2010-10-11 13:05:31 +01:00
José Fonseca
e1003336f0 gallivm: Eliminate unsigned integer arithmetic from texture coordinates.
SSE support for 32bit and 16bit unsigned arithmetic is not complete, and
can easily result in inefficient code.

In most cases signed/unsigned doesn't make a difference, such as for
integer texture coordinates.

So remove uint_coord_type and uint_coord_bld to avoid inefficient
operations to sneak in the future.
2010-10-11 08:14:09 +01:00
José Fonseca
b18fecbd0e llvmpipe: Remove outdated comment about stencil testing. 2010-10-11 08:14:09 +01:00
Dave Airlie
3322416de4 r600g: don't run with scissors.
This could probably be done much nicer, I've spent a day chasing
a coherency problem in the kernel, that turned out to be incorrect
scissor setup.
2010-10-11 16:23:23 +10:00
Dave Airlie
ef2702fb20 r600g: add TXL opcode support.
fixes glsl1-2D Texture lookup with explicit lod (Vertex shader)
2010-10-11 12:18:05 +10:00
Dave Airlie
ea1d818b58 r600g: enable vertex samplers.
We need to move the texture sampler resources out of the range of the vertex attribs.

We could probably improve this using an allocator but this is the simple answer for now.

makes mesa-demos/src/glsl/vert-tex work.
2010-10-11 11:59:53 +10:00
Dave Airlie
2c47f302af r600g: evergreen has no request size bit in texture word4 2010-10-11 11:59:53 +10:00
Dave Airlie
bd89da79a1 r600g: fix input/output Z export mixup for evergreen. 2010-10-11 11:59:53 +10:00
José Fonseca
17dbd41cf2 gallivm: Pass texture coords derivates as scalars.
We end up treating them as scalars in the end, and it saves some
instructions.
2010-10-10 19:51:35 +01:00
José Fonseca
693667bf88 gallivm: Use variables instead of Phis in loops.
With this commit all explicit Phi emission is now gone.
2010-10-10 19:05:05 +01:00
José Fonseca
48003f3567 gallivm: Allow to disable bri-linear filtering with GALLIVM_DEBUG=no_brilinear runtime option 2010-10-10 18:48:02 +01:00
José Fonseca
124adf253c gallivm: Fix a long standing bug with nested if-then-else emission.
We can't patch true-block at end-if time, as there is no guarantee that
the block at the beginning of the true stanza is the same at the end of
the true stanza -- other control flow elements may have been emitted half
way the true stanza.

Although this bug surfaced recently with the commit to skip mip filtering
when lod is an integer the bug was always there, although probably it
was avoided until now: e.g., cubemap selection nests if-then-else on the
else stanza, which does not suffer from the same problem.
2010-10-10 18:48:02 +01:00
delphi
08f890d4c3 draw: some changes to allow for runtime changes to userclip planes 2010-10-10 08:40:11 +01:00
Francisco Jerez
e2acc7be26 dri/nv10: Fake fast Z clears for pre-nv17 cards. 2010-10-10 04:14:34 +02:00
Francisco Jerez
35a1893fd1 dri/nouveau: Minor cleanup. 2010-10-10 01:48:01 +02:00
José Fonseca
307df6a858 gallivm: Cleanup the rest of the flow module. 2010-10-09 21:39:14 +01:00
José Fonseca
d0ea464159 gallivm: Simplify if/then/else implementation.
No need for for a flow stack anymore.
2010-10-09 21:14:05 +01:00
José Fonseca
1949f8c315 gallivm: Factor out the SI->FP texture size conversion for SoA path too 2010-10-09 20:26:11 +01:00
José Fonseca
d45c379027 gallivm: Remove support for Phi generation.
Simply rely on mem2reg pass. It's easier and more reliable.
2010-10-09 20:14:03 +01:00
José Fonseca
ea7b49028b gallivm: Use varilables instead of Phis for cubemap selection. 2010-10-09 19:53:21 +01:00
José Fonseca
cc40abad51 gallivm: Don't generate Phis for execution mask. 2010-10-09 12:55:31 +01:00
José Fonseca
679dd26623 gallivm: Special bri-linear computation path for unmodified rho. 2010-10-09 12:13:00 +01:00
José Fonseca
81a09c8a97 gallivm: Less code duplication in log computation. 2010-10-09 12:12:59 +01:00
José Fonseca
52427f0ba7 util: Defined M_SQRT2 when not available. 2010-10-09 12:12:59 +01:00
José Fonseca
53d7f5e107 gallivm: Handle code have ret correctly.
Stop disassembling on unconditional backwards jumps.
2010-10-09 12:12:59 +01:00
José Fonseca
edba53024f llvmpipe: Fix MSVC build. Enable the new SSE2 code on non SSE3 systems. 2010-10-09 12:12:58 +01:00
Keith Whitwell
2de720dc8f llvmpipe: simplified SSE2 swz/unswz routines
We've been using these in the linear path for a while now.  Based on
Chris's SSSE3 code, but using only sse2 opcodes.  Speed seems to be
identical, but code is simpler & removes dependency on SSE3.

Should be easier to extend to other rgba8 formats.
2010-10-09 12:12:58 +01:00
Keith Whitwell
5b7eb868fd llvmpipe: clean up shader pre/postamble, try to catch more early-z
Specifically, can do early-depth-test even when alpahtest or
kill-pixel are active, providing we defer the actual z write until the
final mask is avaialable.

Improves demos/fire.c especially in the case where you get close to
the trees.
2010-10-09 11:44:45 +01:00
Keith Whitwell
aa4cb5e2d8 llvmpipe: try to be sensible about whether to branch after mask updates
Don't branch more than once in quick succession.  Don't branch at the
end of the shader.
2010-10-09 11:44:45 +01:00
Keith Whitwell
2ef6f75ab4 gallivm: simpler uint8->float conversions
LLVM seems to finds it easier to reason about these than our
mantissa-manipulation code.
2010-10-09 11:44:45 +01:00
Keith Whitwell
c79f162367 gallivm: prefer blendvb for integer arguments 2010-10-09 11:44:45 +01:00
Keith Whitwell
d2cf757f44 gallivm: specialized x8z24 depthtest path
Avoid unnecessary masking of non-existant stencil component.
2010-10-09 11:44:09 +01:00
Keith Whitwell
954965366f llvmpipe: dump fragment shader ir and asm when LP_DEBUG=fs
Better than GALLIVM_DEBUG if you're only interested in fragment shaders.
2010-10-09 11:43:23 +01:00
Keith Whitwell
6da29f3611 llvmpipe: store zero into all alloca'd values
Fixes slowdown in isosurf with earlier versions of llvm.
2010-10-09 11:43:23 +01:00
Keith Whitwell
40d7be5261 llvmpipe: use alloca for fs color outputs
Don't try to emit our own phi's, let llvm mem2reg do it for us.
2010-10-09 11:43:23 +01:00
Keith Whitwell
8009886b00 llvmpipe: defer attribute interpolation until after mask and ztest
Don't calculate 1/w for quads which aren't visible...
2010-10-09 11:42:48 +01:00
José Fonseca
d0bfb3c514 llvmpipe: Prevent z > 1.0
The current interpolation schemes causes precision loss.

Changing the operation order helps, but does not completely avoid the
problem.

The only short term solution is to clamp z to 1.0.

This is unfortunate, but probably unavoidable until interpolation is
improved.
2010-10-09 09:35:41 +01:00
José Fonseca
34c11c87e4 gallivm: Do size computations simultanously for all dimensions (AoS).
Operate simultanouesly on <width, height, depth> vector as much as possible,
instead of doing the operations on vectors with broadcasted scalars.

Also do the 24.8 fixed point scalar with integer shift of the texture size,
for unnormalized coordinates.

AoS path only for now -- the same thing can be done for SoA.
2010-10-09 09:34:31 +01:00
Zack Rusin
6316d54056 llvmpipe: fix rasterization of vertical lines on pixel boundaries 2010-10-09 08:19:21 +01:00
Vinson Lee
e7843363a5 i965: Initialize member variables.
Fixes these GCC warnings.
brw_wm_fp.c: In function 'search_or_add_const4f':
brw_wm_fp.c:92: warning: 'reg.Index2' is used uninitialized in this function
brw_wm_fp.c:84: note: 'reg.Index2' was declared here
brw_wm_fp.c:92: warning: 'reg.RelAddr2' is used uninitialized in this function
brw_wm_fp.c:84: note: 'reg.RelAddr2' was declared here
2010-10-08 16:40:29 -07:00
Vinson Lee
5abd498c47 i965: Silence unused variable warning on non-debug builds.
Fixes this GCC warning.
brw_vs.c: In function 'do_vs_prog':
brw_vs.c:46: warning: unused variable 'ctx'
2010-10-08 16:30:59 -07:00
Vinson Lee
978ffa1d61 i965: Silence unused variable warning on non-debug builds.
Fixes this GCC warning.
brw_eu_emit.c: In function 'brw_math2':
brw_eu_emit.c:1189: warning: unused variable 'intel'
2010-10-08 16:02:59 -07:00
Vinson Lee
220c0834a4 i915: Silence unused variable warning in non-debug builds.
Fixes this GCC warning.
i915_vtbl.c: In function 'i915_assert_not_dirty':
i915_vtbl.c:670: warning: unused variable 'dirty'
2010-10-08 15:49:02 -07:00
Roland Scheidegger
ff72c79924 gallivm: make use of new iround code in lp_bld_conv.
Only requires sse2 now.
2010-10-09 00:36:38 +02:00
Roland Scheidegger
175cdfd491 gallivm: optimize soa linear clamp to edge wrap mode a bit
Clamp against 0 instead of -0.5, which simplifies things.
The former version would have resulted in both int coords being zero
(in case of coord being smaller than 0) and some "unused" weight value,
whereas now the int coords will be 0 and 1, but weight will be 0, hence the
lerp should produce the same value.
Still not happy about differences between normalized and non-normalized...
2010-10-09 00:36:38 +02:00
Roland Scheidegger
2cc6da85d6 gallivm: avoid unnecessary URem in linear wrap repeat case
Haven't looked at what code this exactly generates but URem can't be fast.
Instead of using two URem only use one and replace the second one with
select/add (this is what the corresponding aos code already does).
2010-10-09 00:36:38 +02:00
Roland Scheidegger
318bb080b0 gallivm: more linear tex wrap mode calculation simplification
Rearrange order of operations a bit to make some clamps easier.
All calculations should be equivalent.
Note there seems to be some inconsistency in the clamp to edge case
wrt normalized/non-normalized coords, could potentially simplify this too.
2010-10-09 00:36:38 +02:00
Roland Scheidegger
99ade19e6e gallivm: optimize some tex wrap mode calculations a bit
Sometimes coords are clamped to positive numbers before doing conversion
to int, or clamped to 0 afterwards, in this case can use itrunc
instead of ifloor which is easier. This is only the case for nearest
calculations unfortunately, except linear MIRROR_CLAMP_TO_EDGE which
for the same reason can use a unsigned float build context so the
ifloor_fract helper can reduce this to itrunc in the ifloor helper itself.
2010-10-09 00:36:38 +02:00
Roland Scheidegger
1e17e0c4ff gallivm: replace sub/floor/ifloor combo with ifloor_fract 2010-10-09 00:36:37 +02:00
Roland Scheidegger
cb3af2b434 gallivm: faster iround implementation for sse2
sse2 supports round to nearest directly (or rather, assuming default nearest
rounding mode in MXCSR). Use intrinsic to use this rather than round (sse41)
or bit manipulation whenever possible.
2010-10-09 00:36:37 +02:00
Roland Scheidegger
0ed8c56bfe gallivm: fix trunc/itrunc comment
trunc of -1.5 is -1.0 not 1.0...
2010-10-09 00:36:37 +02:00
Vinson Lee
0f4984a0fb i915: Silence unused variable warning in non-debug builds.
Fixes this GCC warning.
i830_vtbl.c: In function 'i830_assert_not_dirty':
i830_vtbl.c:704: warning: unused variable 'i830'
2010-10-08 15:35:35 -07:00
Ian Romanick
48156b87bc docs: Update status of GL 3.x related extensions 2010-10-08 14:55:27 -07:00
Ian Romanick
1d3027b507 docs: skeleton for 7.10 release notes 2010-10-08 14:50:34 -07:00
Ian Romanick
0ea8b99332 glsl: Remove const decoration from inlined function parameters
The constness of the function parameter gets inlined with the rest of
the function.  However, there is also an assignment to the parameter.
If this occurs inside a loop the loop analysis code will get confused
by the assignment to a read-only variable.

Fixes bugzilla #30552.

NOTE: this is a candidate for the 7.9 branch.
2010-10-08 14:29:11 -07:00
Ian Romanick
dc459f8756 intel: Enable GL_ARB_explicit_attrib_location 2010-10-08 14:21:23 -07:00
Ian Romanick
dbc6c9672d main: Enable GL_ARB_explicit_attrib_location for swrast 2010-10-08 14:21:23 -07:00
Ian Romanick
68a4fc9d5a glsl: Add linker support for explicit attribute locations 2010-10-08 14:21:23 -07:00
Ian Romanick
eee68d3631 glsl: Track explicit location in AST to IR translation 2010-10-08 14:21:23 -07:00
Ian Romanick
2b45ba8bce glsl: Regenerate files changes by previous commit 2010-10-08 14:21:23 -07:00
Ian Romanick
7f68cbdc4d glsl: Add parser support for GL_ARB_explicit_attrib_location layouts
Only layout(location=#) is supported.  Setting the index requires GLSL
1.30 and GL_ARB_blend_func_extended.
2010-10-08 14:21:22 -07:00
Ian Romanick
eafebed5bd glcpp: Regenerate files changes by previous commit 2010-10-08 14:21:22 -07:00
Ian Romanick
e0c9f67be5 glcpp: Add the define for ARB_explicit_attrib_location when present 2010-10-08 14:21:22 -07:00
Ian Romanick
5ed6610d11 glsl: Regenerate files modified by previous commits 2010-10-08 14:21:22 -07:00
Ian Romanick
e24d35a5b5 glsl: Wrap ast_type_qualifier contents in a struct in a union
This will ease adding non-bit fields in the near future.
2010-10-08 14:21:22 -07:00
Ian Romanick
5ff4cfb788 glsl: Clear type_qualifier using memset 2010-10-08 14:21:22 -07:00
Ian Romanick
fd2aa7d313 glsl: Slight refactor of error / warning checking for ARB_fcc layout 2010-10-08 14:21:22 -07:00
Ian Romanick
dd93035a4d glsl: Refactor 'layout' grammar to match GLSL 1.60 spec grammar 2010-10-08 14:21:22 -07:00
Ian Romanick
4b5489dd6f glsl: Fail linking if assign_attribute_locations fails 2010-10-08 14:21:22 -07:00
Vinson Lee
3b16c591a4 r600g: Silence uninitialized variable warning. 2010-10-08 14:17:14 -07:00
Vinson Lee
36b65a373a r600g: Silence uninitialized variable warning. 2010-10-08 14:14:16 -07:00
Vinson Lee
131485efae r600g: Silence uninitialized variable warning. 2010-10-08 14:08:50 -07:00
Vinson Lee
5e90971475 gallivm: Remove unnecessary header. 2010-10-08 14:03:10 -07:00
Eric Anholt
c52a0b5c7d i965: Add register coalescing to the new FS backend.
Improves performance of my GLSL demo 14.3% (+/- 4%, n=4) by
eliminating the moves used in ir_assignment and ir_swizzle handling.
Still 16.5% to go to catch up to the Mesa IR backend, presumably
because instructions are almost perfectly mis-scheduled now.
2010-10-08 13:22:27 -07:00
Eric Anholt
80c0077a6f i965: Enable attribute swizzling (repositioning) in the gen6 SF.
We were trying to remap a fully-filled array down to only handing the
WM the components it uses.  This is called attribute swizzling, and if
you don't enable it you just get 1:1 mappings of inputs to outputs.

This almost fixes glsl-routing, except for the highest gl_TexCoord[]
indices.
2010-10-08 12:00:04 -07:00
Eric Anholt
cac04a9397 i965: Fix new FS gen6 interpolation for sparsely-populated arrays.
We'd overwrite the same element twice.
2010-10-08 11:59:19 -07:00
Eric Anholt
624ce6f61b i965: Fix gen6 WM push constants updates.
We would compute a new buffer, but never point the hardware at the new
buffer.  This partially fixes glsl-routing, as now it get the updated
uniform for which attribute to draw.
2010-10-08 11:59:19 -07:00
José Fonseca
3fde8167a5 gallivm: Help for combined extraction and broadcasting.
Doesn't change generated code quality, but saves some typing.
2010-10-08 19:48:16 +01:00
José Fonseca
438390418d llvmpipe: First minify the texture size, then broadcast. 2010-10-08 19:11:52 +01:00
José Fonseca
f5b5fb32d3 gallivm: Move into the as much of the second level code as possible.
Also, pass more stuff trhough the sample build context, instead of
arguments.
2010-10-08 19:11:52 +01:00
Eric Anholt
5b24d69fcd i965: Handle swizzles in the addition of YUV texture constants.
If someone happened to land a set in a different swizzle order, we
would have assertion failed.
2010-10-08 10:24:30 -07:00
Eric Anholt
0534e958c9 i965: Drop the check for YUV constants in the param list.
_mesa_add_unnamed_constant() already does that.
2010-10-08 10:24:29 -07:00
Eric Anholt
fa8aba9da4 i965: Drop the check for duplicate _mesa_add_state_reference.
_mesa_add_state_reference does that check for us anyway.
2010-10-08 10:24:29 -07:00
Eric Anholt
e310c22bb7 mesa: Simplify a bit of _mesa_add_state_reference using memcmp. 2010-10-08 10:24:29 -07:00
José Fonseca
6b0c79e058 gallivm: Warn when doing inefficient integer comparisons. 2010-10-08 17:43:15 +01:00
José Fonseca
d5ef59d8b0 gallivm: Avoid control flow for two-sided stencil test. 2010-10-08 17:43:15 +01:00
Keith Whitwell
ef3407672e llvmpipe: fix off-by-one in tri_16 2010-10-08 17:30:08 +01:00
Keith Whitwell
0ff132e5a6 llvmpipe: add rast_tri_4_16 for small lines and points 2010-10-08 17:30:08 +01:00
Keith Whitwell
eeb13e2352 llvmpipe: clean up setup_tri a little 2010-10-08 17:30:08 +01:00
Keith Whitwell
e191bf4a85 gallivm: round rather than truncate in new 4x4f->1x16ub conversion path 2010-10-08 17:30:08 +01:00
José Fonseca
f91b4266c6 gallivm: Use the wrappers for SSE pack intrinsics.
Fixes assertion failures on LLVM 2.6.
2010-10-08 17:30:08 +01:00
Keith Whitwell
607e3c542c gallivm: special case conversion 4x4f to 1x16ub
Nice reduction in the number of operations required for final color
output in many shaders.
2010-10-08 17:30:08 +01:00
Keith Whitwell
29d6a1483d llvmpipe: avoid overflow in triangle culling
Avoid multiplying fixed-point values.  Calculate triangle area in
floating point use that for culling.

Lift area calculations up a level as we are already doing this in the
triangle_both() case.

Would like to share the calculated area with attribute interpolation,
but the way the code is structured makes this difficult.
2010-10-08 17:30:08 +01:00
Keith Whitwell
ad6730fadb llvmpipe: fail gracefully on oom in scene creation 2010-10-08 17:26:29 +01:00
José Fonseca
eb605701aa gallivm: Implement brilinear filtering. 2010-10-08 15:50:28 +01:00
José Fonseca
c8179ef5e8 gallivm: Fix copy'n'paste typo in previous commit. 2010-10-08 14:09:22 +01:00
José Fonseca
df7a2451b1 gallivm: Clamp mipmap level and zero mip weight simultaneously. 2010-10-08 14:06:38 +01:00
José Fonseca
0d84b64a4f gallivm: Use lp_build_ifloor_fract for lod computation.
Forgot this one before.
2010-10-08 14:06:38 +01:00
José Fonseca
4f2e2ca4e3 gallivm: Don't compute the second mipmap level when frac(lod) == 0 2010-10-08 14:06:37 +01:00
José Fonseca
05fe33b71c gallivm: Simplify lp_build_mipmap_level_sizes' interface. 2010-10-08 14:06:37 +01:00
José Fonseca
4eb222a3e6 gallivm: Do not do mipfiltering when magnifying.
If lod < 0, then invariably follows that ilevel0 == ilevel1 == 0.
2010-10-08 14:06:37 +01:00
Vinson Lee
1f01f5cfcf r600g: Remove unnecessary header. 2010-10-08 04:56:49 -07:00
Dave Airlie
8d6a38d7b3 r600g: drop width/height per level storage.
these aren't used anywhere, so just waste memory.
2010-10-08 19:55:05 +10:00
Eric Anholt
bbb840049e i965: Normalize cubemap coordinates like is done in the Mesa IR path.
Fixes glsl-fs-texturecube-2-*
2010-10-07 16:41:13 -07:00
Eric Anholt
4d202da7a4 i965: Disable emitting if () statements on gen6 until we really fix them. 2010-10-07 16:41:13 -07:00
Dave Airlie
1ae5cc2e67 r600g: add some RG texture format support. 2010-10-08 09:37:02 +10:00
Kristian Høgsberg
1d595c7cd4 gles2: Add GL_EXT_texture_format_BGRA8888 support 2010-10-07 17:08:50 -04:00
José Fonseca
321ec1a224 gallivm: Vectorize the rho computation. 2010-10-07 22:08:42 +01:00
Dave Airlie
51f9cc4759 r600g: fix Z export enable bits.
we should be checking output array not input to decide.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-07 15:32:05 +10:00
Dave Airlie
97eea87bde r600g: use format from the sampler view not from the texture.
we want to use the format from the sampler view which isn't always the
same as the texture format when creating sampler views.
2010-10-07 15:17:28 +10:00
Andre Maasikas
84457701b0 r600g: fix evergreen interpolation setup
interp data is stored in gpr0 so first interp overwrote it
and subsequent ones got wrong values

reserve register 0 so it's not used for attribs.
alternative is to interpolate attrib0 last (reverse, as r600c does)
2010-10-07 07:51:32 +03:00
Chia-I Wu
b2c0ef8b51 st/vega: Fix version check in context creation.
This fixes a regression since 4531356817.
2010-10-07 12:15:31 +08:00
Chia-I Wu
da495ee870 targets/egl: Fix linking with libdrm. 2010-10-07 12:06:59 +08:00
Eric Anholt
d3163912c1 i965: Fix gen6 pointsize handling to match pre-gen6.
Fixes point-line-no-cull.
Bug #30532
2010-10-06 17:29:29 -07:00
Eric Anholt
b380531fd4 i965: Don't assume that WPOS is always provided on gen6 in the new FS.
We sensibly only provide it if the FS asks for it.  We could actually
skip WPOS unless the FS needed WPOS.zw, but that's something for
later.

Fixes: glsl-texture2d and probably many others.
2010-10-06 12:13:08 -07:00
Eric Anholt
1fdc8c007e i965: Add support for gl_FrontFacing on gen6.
Fixes glsl1-gl_FrontFacing var (2) with new FS.
2010-10-06 12:13:08 -07:00
Eric Anholt
a760b5b509 i965: Refactor gl_FrontFacing setup out of general variable setup. 2010-10-06 12:13:08 -07:00
Eric Anholt
75270f705f i965: Gen6's sampler messages are the same as Ironlake.
This should fix texturing in the new FS backend.
2010-10-06 12:13:08 -07:00
Eric Anholt
fe6efc25ed i965: Don't do 1/w multiplication in new FS for gen6
Not needed now that we're doing barycentric.
2010-10-06 12:13:08 -07:00
Eric Anholt
5d99b01501 i965: Add some clarification of the WECtrl field. 2010-10-06 12:13:08 -07:00
Eric Anholt
5eeaf3671e i965: Fix botch in the header_present case in the new FS.
I only set it on the color_regions == 0 case, missing the important
case, causing GPU hangs on pre-gen6.
2010-10-06 12:13:08 -07:00
José Fonseca
9fe510ef35 llvmpipe: Cleanup depth-stencil clears.
Only cosmetic changes. No actual practical difference.
2010-10-06 19:08:21 +01:00
José Fonseca
33f88b3492 util: Cleanup util_pack_z_stencil and friends.
- Handle PIPE_FORMAT_Z32_FLOAT packing correctly.

- In the integer version z shouldn't be passed as as double.

- Make it clear that the integer versions should only be used for masks.

- Make integer type sizes explicit (uint32_t for now, although
  uint64_t will be necessary later to encode f32_s8_x24).
2010-10-06 19:08:18 +01:00
José Fonseca
87dd859b34 gallivm: Compute lod as integer whenever possible.
More accurate/faster results for PIPE_TEX_MIPFILTER_NEAREST. Less
FP <-> SI conversion overall.
2010-10-06 18:51:25 +01:00
José Fonseca
1c32583581 gallivm: Only apply min/max_lod when necessary. 2010-10-06 18:50:57 +01:00
Keith Whitwell
5849a6ab64 gallivm: don't apply zero lod_bias 2010-10-06 18:49:32 +01:00
José Fonseca
af05f61576 gallivm: Combined ifloor & fract helper.
The only way to ensure we don't do redundant FP <-> SI conversions.
2010-10-06 18:47:01 +01:00
José Fonseca
012d57737b gallivm: Fast implementation of iround(log2(x))
Not tested yet, but should be correct.
2010-10-06 18:46:59 +01:00
José Fonseca
4648846bd6 gallivm: Use a faster (and less accurate) log2 in lod computation. 2010-10-06 18:46:29 +01:00
José Fonseca
df3505b193 gallivm: Take the type signedness in consideration in round/ceil/floor. 2010-10-06 18:46:08 +01:00
Eric Anholt
feca660939 i965: Fix up IF/ELSE/ENDIF for gen6.
The jump delta is now in the part of the instruction where the
destination fields used to be, and the src args are ignored (or not,
for the new non-predicated IF that we don't use yet).
2010-10-06 10:09:45 -07:00
Eric Anholt
f7cb28fad9 i965: Gen6 no longer has the IFF instruction; always use IF. 2010-10-06 10:09:45 -07:00
Eric Anholt
3c97c00e38 i965: Add back gen6 headerless FB writes to the new FS backend.
It's not that hard to detect when we need the header.
2010-10-06 10:09:44 -07:00
Jerome Glisse
3fabd218a0 r600g: fix dirty state handling
Avoid having object ending up in dead list of dirty object.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-06 13:01:31 -04:00
Eric Anholt
634abbf7b2 i965: Also do constant propagation for the second operand of CMP.
We could do the first operand as well by flipping the comparison, but
this covered several CMPs in code I was looking at.
2010-10-06 09:33:26 -07:00
Eric Anholt
dcd0261aff i965: Enable the constant propagation code.
A debug disable had slipped in.
2010-10-06 09:33:26 -07:00
Jerome Glisse
1644bb0f40 r600g: avoid segfault due to unintialized list pointer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-06 09:41:19 -04:00
José Fonseca
06472ad7e8 llvmpipe: Fix sprite coord perspective interpolation of Q.
Q coordinate's coefficients also need to be multiplied by w, otherwise
it will have 1/w, causing problems with TXP.
2010-10-06 11:46:41 +01:00
José Fonseca
e74955eba3 llvmpipe: Fix perspective interpolation for point sprites.
Once a fragment is generated with LP_INTERP_PERSPECTIVE set for an input,
it will do a divide by w for that input. Therefore it's not OK to treat LP_INTERP_PERSPECTIVE as
LP_INTERP_LINEAR or vice-versa, even if the attribute is known to not
vary.

A better strategy would be to take the primitive in consideration when
generating the fragment shader key, and therefore avoid the per-fragment
perspective divide.
2010-10-06 11:44:59 +01:00
José Fonseca
446dbb9217 llvmpipe: Dump a few missing shader key flags. 2010-10-06 11:41:08 +01:00
Keith Whitwell
591e1bc34f llvmpipe: make debug_fs_variant respect variant->nr_samplers 2010-10-06 11:40:30 +01:00
José Fonseca
5661e51c01 retrace: Handle clear_render_target and clear_depth_stencil. 2010-10-06 11:37:49 +01:00
Dave Airlie
9528fc2107 r600g: add evergreen stencil support.
this sets the stencil up for evergreen properly.
2010-10-06 09:21:16 +10:00
Jerome Glisse
ea5a74fb58 r600g: userspace fence to avoid kernel call for testing bo busy status
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 17:04:25 -04:00
Brian Paul
3d6eec0a87 st/mesa: replace assertion w/ conditional in framebuffer invalidation
https://bugs.freedesktop.org/show_bug.cgi?id=30632

NOTE: this is a candidate for the 7.9 branch.
2010-10-05 14:33:17 -06:00
Jerome Glisse
2cf3199ee3 r600g: simplify block relocation
Since flush rework there could be only one relocation per
register in a block.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 15:23:07 -04:00
Bas Nieuwenhuizen
ac8a1ebe55 r600g: use dirty list to track dirty blocks
Got a speed up by tracking the dirty blocks in a seperate list instead of looping through all blocks. This version should work with block that get their dirty state disabled again and I added a dirty check during the flush as some blocks were already dirty.
2010-10-05 15:16:06 -04:00
Ian Romanick
b2e52cdf83 docs: added news item for 7.9 release
Also fix link to release notes in 7.9-rc1 news item.
2010-10-05 10:07:16 -07:00
Ian Romanick
cdf29c44ed docs: Import news updates from 7.9 branch
Partially cherry-picked from commit 61653b488d
2010-10-05 10:05:04 -07:00
Ian Romanick
8f32c64bd1 docs: Update mailing lines from sf.net to freedesktop.org
(cherry picked from commit c19bc5de96)
2010-10-05 10:02:30 -07:00
Ian Romanick
13a90e8900 docs: download.html does not need to be updated for each release
(cherry picked from commit 41e371e351)
2010-10-05 10:02:10 -07:00
Ian Romanick
d0981675cc docs: Import 7.8.x release notes from 7.8 branch. 2010-10-05 10:01:34 -07:00
Ian Romanick
792b0308fc docs: Import 7.9 release notes from 7.9 branch. 2010-10-05 09:54:41 -07:00
Nicolas Kaiser
71fd35d1ad nv50: fix always true conditional in shader optimization 2010-10-05 18:53:15 +02:00
Jerome Glisse
585e4098aa r600g: improve bo flushing
Flush read cache before writting register. Track flushing inside
of a same cs and avoid reflushing same bo if not necessary. Allmost
properly force flush if bo rendered too and then use as a texture
in same cs (missing pipeline flush dunno if it's needed or not).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 10:43:23 -04:00
Jerome Glisse
12d16e5f14 r600g: store reloc information in bo structure
Allow fast lookup of relocation information & id which
was a CPU time consumming operation.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 10:42:56 -04:00
Dave Airlie
bf21b7006c pb: fix numDelayed accounting
we weren't decreasing when removing from the list.
2010-10-05 19:08:41 +10:00
Dave Airlie
12be1568d0 r600g: avoid unneeded bo wait
if we know the bo has gone not busy, no need to add another bo wait

thanks to Andre (taiu) on irc for pointing this out.
2010-10-05 16:00:48 +10:00
Dave Airlie
d2c06b5037 r600g: drop use_mem_constant.
since we plan on using dx10 constant buffers everywhere.
2010-10-05 16:00:23 +10:00
Dave Airlie
46997d4fc2 r600g: drop mman allocator
we don't use this since constant buffers are now being used on all gpus.
2010-10-05 15:57:57 +10:00
Dave Airlie
05813ad5f4 r600g: add bo busy backoff.
When we go to do a lot of bos in one draw like constant bufs we need
to avoid bouncing off the busy ioctl, this mitigates by backing off
on busy bos for a short amount of times.
2010-10-05 15:51:38 +10:00
Dave Airlie
49866c8f34 pb: don't keep checking buffers after first busy
If we assume busy buffers are added to the list in order its unlikely
we'd fine one after the first busy one that isn't busy.
2010-10-05 15:50:58 +10:00
Dave Airlie
3c38e4f138 r600g: add bo fenced list.
this just keeps a list of bos submitted together, and uses them to decide
bo busy state for the whole group.
2010-10-05 15:35:52 +10:00
Brian Paul
fb5e6f88fc swrast: fix choose_depth_texture_level() to respect mipmap filtering state
NOTE: this is a candidate for the 7.9 branch.
2010-10-04 19:59:46 -06:00
Marek Olšák
d0408cf55d r300g: fix microtiling for 16-bits-per-channel formats
These texture formats (like R16G16B16A16_UNORM) were untested until now
because st/mesa doesn't use them. I am testing this with a hacked st/mesa
here.
2010-10-05 02:57:00 +02:00
Marek Olšák
57b7300804 update release notes for Gallium
I am trying to be exhaustive, but still I might have missed tons of other
changes to Gallium.
(cherry picked from commit 968a9ec76e)

Conflicts:

	docs/relnotes-7.9.html
2010-10-05 02:56:59 +02:00
Ian Romanick
4d435c400d docs: Add list of bugs fixed in 7.9 2010-10-04 17:39:48 -07:00
Eric Anholt
ea909be58d i965: Add support for gen6 FB writes to the new FS.
This uses message headers for now, since we'll need it for MRT.  We
can cut out the header later.
2010-10-04 16:08:17 -07:00
Eric Anholt
739aec39bd i965: In disasm, gen6 fb writes don't put msg reg # in destreg_conditionalmod.
It instead sensibly appears in the src0 slot.
2010-10-04 16:08:17 -07:00
Eric Anholt
3bf8774e9c i965: Add initial folding of constants into operand immediate slots.
We could try to detect this in expression handling and do it
proactively there, but it seems like less logic to do it in one
optional pass at the end.
2010-10-04 16:08:17 -07:00
Eric Anholt
e27c88d8e6 i965: Add trivial dead code elimination in the new FS backend.
The glsl core should be handling most dead code issues for us, but we
generate some things in codegen that may not get used, like the 1/w
value or pixel deltas.  It seems a lot easier this way than trying to
work out up front whether we're going to use those values or not.
2010-10-04 16:08:17 -07:00
Eric Anholt
9faf64bc32 i965: Be more conservative on live interval calculation.
This also means that our intervals now highlight dead code.
2010-10-04 16:08:17 -07:00
Vinson Lee
a0a8e24385 r600g: Fix SCons build. 2010-10-04 15:56:55 -07:00
Jerome Glisse
b25c52201b r600g: remove dead label & fix indentation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
243d6ea609 r600g: rename radeon_ws_bo to r600_bo
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
674452faf9 r600g: use r600_bo for relocation argument, simplify code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
d22a1247d8 r600g: allow r600_bo to be a sub allocation of a big bo
Add bo offset everywhere needed if r600_bo is ever a sub bo
of a bigger bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
294c9fce1b r600g: rename radeon_ws_bo to r600_bo
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
delphi
25bb05fef0 draw: added userclip planes and updated variant_key 2010-10-04 22:08:16 +01:00
Krzysztof Smiechowicz
68c7994ab5 nvfx: Pair os_malloc_aligned() with os_free_aligned().
From AROS.
2010-10-04 11:43:29 -07:00
Dave Airlie
3d45d57044 r600g: TODO domain management
no wonder it was slow, the code is deliberately forcing stuff into GTT,
we used to have domain management but it seems to have disappeared.
2010-10-04 16:41:49 +10:00
Dave Airlie
1c2b3cb1e9 r600g: fix wwarning in bo_map function 2010-10-04 16:26:46 +10:00
Dave Airlie
6dc051557d r600g: the code to check whether a new vertex shader is needed was wrong
this code was memcmp'ing two structs, but refcounting one of them afterwards,
so any subsequent memcmp was never going to work.

again this stops unnecessary uploads of vertex program,
2010-10-04 16:24:59 +10:00
Dave Airlie
92aba9c1f5 r600g: break out of search for reloc bo after finding it.
this function was taking quite a lot of pointless CPU.
2010-10-04 15:58:39 +10:00
Eric Anholt
14bf92ba19 i965: Fix glean/texSwizzle regression in previous commit.
Easy enough patch, who needs a full test run.  Oh, that's right.  Me.
2010-10-03 00:24:09 -07:00
Eric Anholt
a7fa00dfc5 i965: Set up swizzling of shadow compare results for GL_DEPTH_TEXTURE_MODE.
The brw_wm_surface_state.c handling of GL_DEPTH_TEXTURE_MODE doesn't
apply to shadow compares, which always return an intensity value.  The
texture swizzles can do the job for us.

Fixes:
glsl1-shadow2D(): 1
glsl1-shadow2D(): 3
2010-10-02 23:48:14 -07:00
Eric Anholt
4fb0c92c69 i965: Add support for EXT_texture_swizzle to the new FS backend. 2010-10-02 23:44:44 -07:00
Marek Olšák
8f7177e0de r300g: add support for L8A8 colorbuffers
Blending with DST_ALPHA is undefined. SRC_ALPHA works, though.
I bet some other formats have similar limitations too.
2010-10-02 23:19:38 +02:00
Marek Olšák
e75bce026c r300g: add support for R8G8 colorbuffers
The hw swizzles have been obtained by a brute force approach,
and only C0 and C2 are stored in UV88, the other channels are
ignored.

R16G16 is going to be a lot trickier.
2010-10-02 21:42:22 +02:00
Dave Airlie
71a079fb4e mesa/st: initial attempt at RG support for gallium drivers
passes all piglit RG tests with softpipe.
2010-10-02 17:03:15 +10:00
Kenneth Graunke
f317713432 i965: Fix incorrect batchbuffer size in gen6 clip state command.
FORCE_ZERO_RTAINDEX should be in the fourth (and final) dword.
2010-10-01 21:53:28 -07:00
Eric Anholt
64a9fc3fc1 i965: Don't try to emit code if we failed register allocation. 2010-10-01 17:19:04 -07:00
Eric Anholt
6397addd61 i965: Fix off-by-ones in handling the last members of register classes.
Luckily, one of them would result in failing out register allocation
when the other bugs were encountered.  Applies to
glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined, which still
fails register allocation, but now legitimately.
2010-10-01 17:19:04 -07:00
Eric Anholt
afb64311e3 i965: Add a sanity check for register allocation sizes. 2010-10-01 17:19:03 -07:00
Eric Anholt
5ee0941316 i965: When producing a single channel swizzle, don't make a temporary.
This quickly cuts 8% of the instructions in my glsl demo.
2010-10-01 17:19:03 -07:00
Eric Anholt
a0799725f5 i965: Restore the forcing of aligned pairs for delta_xy on chips with PLN.
By doing so using the register allocator now, we avoid wasting a
register to make the alignment happen.
2010-10-01 17:19:03 -07:00
Alex Deucher
fb0eed84ca r600c: fix segfault in evergreen stencil code
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=30551
2010-10-01 20:14:25 -04:00
Vinson Lee
7af2a22d1f r600g: Remove unnecessary headers. 2010-10-01 17:06:33 -07:00
Vinson Lee
20846a8ce1 r600g: Remove unused variable.
Fixes this GCC warning.
r600_shader.c: In function 'tgsi_split_literal_constant':
r600_shader.c:818: warning: unused variable 'index'
2010-10-01 17:02:01 -07:00
Ian Romanick
1ca6cbec1b rgtc: Detect RGTC formats as color formats and as compressed formats 2010-10-01 16:55:35 -07:00
Ian Romanick
5ebbabc5cc mesa: Trivial correction to comment 2010-10-01 16:55:35 -07:00
Ian Romanick
69c78bf2c2 mesa: Fix misplaced #endif
If FEATURE_texture_s3tc is not defined, FXT1 formats would erroneously
fall through to the MESA_FORMAT_RGBA_FLOAT32 case.
2010-10-01 16:55:35 -07:00
Ian Romanick
7c6147014a ARB_texture_rg: Add GL_COMPRESSED_{RED,RG} cases in _mesa_is_color_format 2010-10-01 16:55:35 -07:00
Ian Romanick
e2a054b70c mesa: Add ARB_texture_compression_rgtc as an alias for EXT_texture_compression_rgtc
Change the name in the extension tracking structure to ARB (from EXT).
2010-10-01 16:55:35 -07:00
Vinson Lee
e5fd15199d savage: Remove unnecessary header. 2010-10-01 16:57:19 -07:00
Vinson Lee
841503fddf glsl: Remove unnecessary header. 2010-10-01 16:27:58 -07:00
Ian Romanick
c77cd9ec10 i965: Enable GL_ARB_texture_rg 2010-10-01 15:49:13 -07:00
Ian Romanick
9ef390dc14 mesa: Enable GL_ARB_texture_rg in software paths 2010-10-01 15:49:13 -07:00
Ian Romanick
421f4d8dc1 ARB_texture_rg: Allow RED and RG textures as FBO color buffer attachments 2010-10-01 15:49:13 -07:00
Ian Romanick
5d1387b2da ARB_texture_rg: Add R8, R16, RG88, and RG1616 internal formats 2010-10-01 15:49:13 -07:00
Ian Romanick
214a33f610 ARB_texture_rg: Handle RED and RG the same as RGB for tex env 2010-10-01 15:49:13 -07:00
Ian Romanick
cd5dea6401 ARB_texture_rg: Add GL_RED as a valid GL_DEPTH_TEXTURE_MODE 2010-10-01 15:49:13 -07:00
Ian Romanick
cc6f13def5 ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support 2010-10-01 15:49:12 -07:00
Ian Romanick
3ebbc176f9 ARB_texture_rg: Correct some errors in RED / RG internal format handling
Fixes several problems:

The half-float, float, and integer internal formats depend on
ARB_texture_rg and other extensions.

RG_INTEGER is not a valid internal format.

Generic compressed formats depend on ARB_texture_rg, not
EXT_texture_compression_rgtc.

Use GL_RED instead of GL_R.
2010-10-01 15:49:12 -07:00
Ian Romanick
bb45ab0a96 ARB_texture_rg: Add GLX protocol support 2010-10-01 15:49:12 -07:00
Nicolas Kaiser
96efa8a923 i965g: use Elements macro instead of manual sizeofs
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-10-01 16:41:13 -06:00
Eric Anholt
e9bcc83289 i965: Fix up copy'n'pasteo from moving coordinate setup around for gen4. 2010-10-01 14:09:00 -07:00
Eric Anholt
bfd9715c3c i965: Add real support for pre-gen5 texture sampling to the new FS.
Fixes 36 testcases, including glsl-fs-shadow2d*-bias which fail on the
Mesa IR backend.
2010-10-01 14:02:48 -07:00
richard
92eb07a281 evergreen : fix z format setting, enable stencil. 2010-10-01 16:10:02 -04:00
Eric Anholt
8f63a44636 i965: Pre-gen6, map VS outputs (not FS inputs) to URB setup in the new FS.
We should fix the SF to actually give us just the data we need, but
this fixes regressions in the new FS until then.

Fixes:
glsl-kwin-blur
glsl-routing
2010-10-01 12:21:51 -07:00
Eric Anholt
ff5ce9289b i965: Also increment attribute location when skipping unused slots.
Fixes glsl1-texcoord varying.
2010-10-01 12:19:21 -07:00
Eric Anholt
354c40a624 i965: Fix the gen6 jump size for BREAK/CONT in new FS.
Since gen5, jumps are in increments of 64 bits instead of increments
of 128-bit instructions.
2010-10-01 12:19:21 -07:00
Eric Anholt
efc4a6f790 i965: Add gen6 attribute interpolation to new FS backend.
Untested, since my hardware is not booting at the moment.
2010-10-01 12:19:21 -07:00
Jerome Glisse
29b491bd03 r600g: indentation fixes
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-01 10:26:58 -04:00
Dave Airlie
738aa29289 r600g: setup basic loop consts on r600 + evergreen.
this sets up a single loop constant like r600c does.
2010-10-01 16:06:31 +10:00
Dave Airlie
7777c997e0 r600g: only set the Z export if shader exports it. 2010-10-01 16:06:30 +10:00
Alex Deucher
0c39a53aa6 r600c: pull over 6xx/7xx vertex fixes for evergreen 2010-10-01 00:51:37 -04:00
Dave Airlie
539a2978ed r600g: flush SH cache on constant change on evergreen 2010-10-01 14:43:02 +10:00
Dave Airlie
b67aa5311f r600g: fix evergreen draw-buffers
just a typo in the register headers.
2010-10-01 14:24:14 +10:00
Dave Airlie
14c95bb4ee r600g: add cb flushing for extra buffers + depth buffer on r600/evergreen 2010-10-01 14:05:02 +10:00
Dave Airlie
ac225c76a6 r600g: sync vertex/texture cache on resources on evergreen
this gets rid of lots of the instability on evergreen,
which isn't surprising since it really broken not to flush caches.
2010-10-01 14:04:32 +10:00
Dave Airlie
d662195f00 r600g: fixup vertex format picking.
there are some vertex formats defined in r600c not in the docs.
2010-10-01 13:36:56 +10:00
Dave Airlie
e973221538 r600g: add assembler support for other vtx fetch fields.
this shouldn't change behaviour, just push the choice of what
to do out to the shader.
2010-10-01 13:36:56 +10:00
Eric Anholt
1d073cb2d9 i965: Split the gen4 and gen5 sampler handling apart.
Trying to track the insanity of the different argument layouts for
normal/shadow crossed with normal/lod/bias one generation at a time is
enough.

Fixes: glsl1-texture2D() with bias.
(first test passing in this code that doesn't pass without it!)
2010-09-30 20:23:40 -07:00
Eric Anholt
5f237a1ccb i965: Use the lowering pass for texture projection.
We should end up with the same code, but anyone else with this issue
could share the handling (which I got wrong for shadow comparisons in
the driver before).
2010-09-30 20:23:40 -07:00
Eric Anholt
aae338104f glsl: Add a lowering pass for texture projection. 2010-09-30 20:23:36 -07:00
Dave Airlie
35cfe286d6 r600g: realign evergreen code with r600 code.
fixes segfault in depth-tex-modes-glsl and OA startup.
2010-10-01 11:15:13 +10:00
Alex Deucher
a3e9998614 r600c: add reloc for CB_COLOR0_ATTRIB
We'll need a reloc for tiling eventually,
so add it now.
2010-09-30 20:55:54 -04:00
Dave Airlie
5eccdc62b9 r600g: add reloc for evergreen color attrib
we'll need this for color tiling on evergreen.
2010-10-01 10:52:09 +10:00
Dave Airlie
40ccb235d6 r600g: drop depth quirk on evergreen
none of the EG cards need the quirk.
2010-10-01 10:30:17 +10:00
Dave Airlie
05d1d86907 r600g: add winsys support for CTL constants.
These need to be emitted, we also need them to do proper vtx start,
instead of abusing index offset.
2010-10-01 10:30:16 +10:00
Dave Airlie
084c29baed r600g: fix evergreen depth flushing.
although evergreen can apparantly sample direct from 24-bit,
just make it work with the current method for now.
2010-10-01 10:17:20 +10:00
Dave Airlie
7ae4da8056 r600g: use Elements macro instead of manual sizeofs 2010-10-01 10:17:20 +10:00
Brian Paul
66992463ac draw: check for null sampler pointers
http://bugs.freedesktop.org/show_bug.cgi?id=30516
2010-09-30 16:42:17 -06:00
Brian Paul
542d6cb1b8 gallivm: added some comments 2010-09-30 16:42:17 -06:00
John Doe
40181aef60 r600g: keep a mapping around for each bo
Save a lot of call into the kernel and thus improve performances.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 17:53:36 -04:00
John Doe
dde1391cc9 r600g: don't double count dirty block
This avoid to overcount the number of dwords we need and
thus avoid maximazation of cs buffer use.

Signed-off-by: Jerome Glisse <jglisse@redhat.com
2010-09-30 17:38:18 -04:00
Jerome Glisse
113f1cdfce evergreeng: avoid overlapping border color btw VS & PS
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 17:07:28 -04:00
Eric Anholt
c6960e4471 i965: Fix new FS handling of builtin uniforms with packed scalars in structs.
We were pointing each element at the .x channel of the
ParameterValues.

Fixes glsl1-linear fog.
2010-09-30 13:45:42 -07:00
Eric Anholt
a7cddd7de3 mesa: Don't reference a W component in setting up a vec3 uniform component.
The 965 driver would try to set up storage for the W component, and
the offsets would get mixed up.
2010-09-30 13:45:42 -07:00
Eric Anholt
6f6542a483 i965: Fix whole-structure/array assignment in new FS.
We need to walk the type tree to get the right register types for
structure components.  Fixes glsl-fs-statevar-call.
2010-09-30 13:45:42 -07:00
Tom Fogal
3661f757ee Revert "Prefer intrinsics to handrolled atomic ops."
This reverts commit 5f66b340aa, quickly
fixing 30514.
2010-09-30 14:41:53 -06:00
Jerome Glisse
9d4ae914e2 r600g: fix constant & literal src splitting, also fix mplayer gl2 shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 16:33:12 -04:00
Tom Fogal
5f66b340aa Prefer intrinsics to handrolled atomic ops. 2010-09-30 13:20:57 -06:00
Tom Fogal
76a60faf52 Implement x86_64 atomics for compilers w/o intrinsics.
Really old gcc's (3.3, at least) don't have support for the
intrinsics we need.  This implements a fallback for that case.
2010-09-30 13:20:51 -06:00
Adam Jackson
0c86e1f294 i965: Update renderer strings for sandybridge
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-30 14:08:35 -04:00
Jerome Glisse
153105cfbf r600g: use constant buffer instead of register for constant
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 13:47:29 -04:00
Brian Paul
874f3a57ce gallivm: check for level=0 case in lp_build_minify()
This lets us avoid the shift and max() operations.
2010-09-30 10:53:30 -06:00
José Fonseca
4e6f5e8d43 gallivm: More comprehensive border usage logic. 2010-09-30 17:42:01 +01:00
Chia-I Wu
e2b51b7c5b st/egl: Drop context argument from egl_g3d_get_egl_image.
Fix a regression since 17eace581d.
2010-09-30 23:45:27 +08:00
Nicolas Kaiser
4160d947d2 st: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Nicolas Kaiser
bad10b961a math: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Nicolas Kaiser
9674929bce main: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Nicolas Kaiser
8c92a80b62 dri/savage: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
1663e6da2f dri/radeon: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
a7670be8a1 dri/r600: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
223c4b4188 dri/r300: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:30 -06:00
Nicolas Kaiser
705d98deb8 dri/r128: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:29 -06:00
Nicolas Kaiser
f094b35207 dri/mga: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:29 -06:00
Nicolas Kaiser
1a98a46304 dri/intel: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:29 -06:00
Nicolas Kaiser
c24144f41f dri/i965: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
f831212eab dri/i915: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
b958dabe16 dri/i810: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
c24e062fdb dri/common: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:24 -06:00
Nicolas Kaiser
7eed3dba58 glx: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
3f28dbd9bb gallium/winsys: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
218d973786 gallium/st: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
6f136094f4 gallium/softpipe: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
d2149f6f22 gallium/llvmpipe: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Nicolas Kaiser
3e472bee2d gallium/i915: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:22 -06:00
Nicolas Kaiser
b719c91c82 gallium/util: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Nicolas Kaiser
237fa8a81c gallium/rtasm: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Nicolas Kaiser
3b7b1db661 egl: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Nicolas Kaiser
7d0b89fda0 swrast: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:20 -06:00
Francisco Jerez
065163bcd2 dri/nv10: Use fast Z clears. 2010-09-30 16:48:28 +02:00
Francisco Jerez
bdd19da218 dri/nouveau: Remove unnecessary flush. 2010-09-30 16:48:20 +02:00
Francisco Jerez
6f39280ba9 dri/nouveau: Have a smaller amount of larger scratch buffers.
Larger VBOs avoid many kernel trips to get them in sync with the GPU.
2010-09-30 16:46:46 +02:00
Chia-I Wu
ebeb4a7e8a mapi: Fix compiler warnings.
Do not use "void *" in arithmetics.
2010-09-30 17:09:59 +08:00
Chia-I Wu
d63b2622f1 st/egl: Skip single-buffered configs in EGL.
Let DRI2 report single-buffered configs and skip them in EGL.  This is
based on the patch by Luca Barbieri.
2010-09-30 17:04:56 +08:00
Chia-I Wu
6b2f1561ad egl: Check extensions.
Do not call into the driver if the extension for the called function is
not enabled.
2010-09-30 16:55:07 +08:00
Zhenyu Wang
72b368ae69 i965: always set tiling for fbo depth buffer on sandybridge
Sandybridge requires depth buffer must be tiling.

Fix 'fbo_firecube' demo.
2010-09-30 10:51:26 +08:00
Marek Olšák
83278d384e r300g: fix conditional rendering in non-wait path
NOTE: This is a candidate for the 7.9 branch.
2010-09-30 02:44:30 +02:00
Eric Anholt
ad1506c5ac i965: Remove my "safety counter" code from loops.
I've screwed this up enough times that I don't think it's worth it.
This time, it was that I was doing it once per top-level body
instruction instead of just once at the end of the loop body.
2010-09-29 16:40:31 -07:00
Eric Anholt
b90c7d1713 i965: Add live interval analysis and hook it up to the register allocator.
Fixes 13 piglit cases that failed at register allocation before.
2010-09-29 16:40:31 -07:00
Eric Anholt
e1261d3c49 i965: First cut at register allocation using graph coloring.
The interference is totally bogus (maximal), so this is equivalent to
our trivial register assignment before.  As in, passes the same set of
piglit tests.
2010-09-29 16:40:31 -07:00
Eric Anholt
9ff90b7230 ra: First cut at a graph-coloring register allocator for mesa.
Notably missing is choice of registers to spill.
2010-09-29 16:40:31 -07:00
Eric Anholt
21148e1c0a i965: Clean up the virtual GRF handling.
Now, virtual GRFs are consecutive integers, rather than offsetting the
next one by the size.  We need the size information to still be around
for real register allocation, anyway.
2010-09-29 16:40:31 -07:00
Dave Airlie
4378c17c88 r600g: return string for chip family
use same strings as r600c.
2010-09-30 09:17:20 +10:00
Dave Airlie
dbcd652602 r600g: clean up some code from move to new paths.
mainly remove 2 suffix from function names
2010-09-30 09:12:57 +10:00
Dave Airlie
2bc9d3f498 r600g: add L8A8 unorm.
fixes texEnv warnings.
2010-09-30 09:04:50 +10:00
Dave Airlie
534f7d5749 r600g: port r300g fix for X* formats in texformat code 2010-09-30 09:04:50 +10:00
Eric Anholt
0efea25c4b i956: Make new FS discard do its work in a temp, not the null reg!
Fixes:
glsl-fs-discard-02 (GPU hang)
glsl1-discard statement (2)
2010-09-29 15:52:36 -07:00
Eric Anholt
3da98c1ca5 i965: Fix use of undefined mem_ctx in vector splitting. 2010-09-29 15:51:05 -07:00
José Fonseca
e3ccfd4e03 gallivm: Use SSE4.1's ROUNDSS/ROUNDSD for scalar rounding. 2010-09-29 22:29:23 +01:00
José Fonseca
21f392c971 python/retrace: Handle set_index_buffer and draw_vbo. 2010-09-29 22:29:22 +01:00
José Fonseca
c7f33624f9 trace: Fix set_index_buffer and draw_vbo tracing. 2010-09-29 22:29:22 +01:00
Vinson Lee
02b8fb3ed5 r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
r3xx_vertprog.c: In function ‘ei_if’:
r3xx_vertprog.c:396: warning: ISO C90 forbids mixed declarations and code
2010-09-29 14:22:20 -07:00
Vinson Lee
7c7fdef3b1 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r500_fragprog_emit.c: In function ‘emit_paired’:
r500_fragprog_emit.c:237: warning: ISO C90 forbids mixed declarations and code
r500_fragprog_emit.c: In function ‘emit_tex’:
r500_fragprog_emit.c:367: warning: ISO C90 forbids mixed declarations and code
r500_fragprog_emit.c: In function ‘emit_flowcontrol’:
r500_fragprog_emit.c:415: warning: ISO C90 forbids mixed declarations and code
r500_fragprog_emit.c: In function ‘r500BuildFragmentProgramHwCode’:
r500_fragprog_emit.c:633: warning: ISO C90 forbids mixed declarations and code
2010-09-29 14:13:49 -07:00
Vinson Lee
ae664daa25 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r500_fragprog.c: In function ‘r500_transform_IF’:
r500_fragprog.c:45: warning: ISO C90 forbids mixed declarations and code
r500_fragprog.c: In function ‘r500FragmentProgramDump’:
r500_fragprog.c:256: warning: ISO C90 forbids mixed declarations and code
2010-09-29 14:04:06 -07:00
Vinson Lee
a4f296d618 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r300_fragprog_emit.c: In function ‘emit_alu’:
r300_fragprog_emit.c:143: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_emit.c:156: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_emit.c: In function ‘finish_node’:
r300_fragprog_emit.c:271: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_emit.c: In function ‘emit_tex’:
r300_fragprog_emit.c:344: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:56:27 -07:00
Vinson Lee
b96a391d14 r300/compiler: Remove declaration before code.
Fixes these GCC warnings on linux-x86 build.
r300_fragprog_swizzle.c: In function ‘r300_swizzle_is_native’:
r300_fragprog_swizzle.c:120: warning: ISO C90 forbids mixed declarations and code
r300_fragprog_swizzle.c: In function ‘r300_swizzle_split’:
r300_fragprog_swizzle.c:159: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:44:10 -07:00
Vinson Lee
dafbf480db r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_rename_regs.c: In function ‘rc_rename_regs’:
radeon_rename_regs.c:112: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:40:45 -07:00
Vinson Lee
0d0273142a r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_remove_constants.c: In function ‘rc_remove_unused_constants’:
radeon_remove_constants.c💯 warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:34:56 -07:00
Vinson Lee
4cd4fd37aa r300/compiler: Move declaration before code.
Fixes these GCC warning on linux-x86 build.
radeon_optimize.c: In function ‘constant_folding’:
radeon_optimize.c:419: warning: ISO C90 forbids mixed declarations and code
radeon_optimize.c:425: warning: ISO C90 forbids mixed declarations and code
radeon_optimize.c:432: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:30:34 -07:00
Vinson Lee
38c31de445 r600g: Fix SCons build. 2010-09-29 13:14:34 -07:00
Vinson Lee
07a38505c6 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_dataflow_deadcode.c: In function ‘push_branch’:
radeon_dataflow_deadcode.c:112: warning: ISO C90 forbids mixed declarations and code
radeon_dataflow_deadcode.c: In function ‘update_instruction’:
radeon_dataflow_deadcode.c:183: warning: ISO C90 forbids mixed declarations and code
radeon_dataflow_deadcode.c: In function ‘rc_dataflow_deadcode’:
radeon_dataflow_deadcode.c:352: warning: ISO C90 forbids mixed declarations and code
radeon_dataflow_deadcode.c:379: warning: ISO C90 forbids mixed declarations and code
2010-09-29 13:13:09 -07:00
Jerome Glisse
6abd7771c6 r600g: more cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 15:40:32 -04:00
Vinson Lee
7e536371f9 r600g: Update SConscript.
Fixes SCons build.
2010-09-29 12:16:39 -07:00
Vinson Lee
a9d5808232 r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_pair_regalloc.c: In function ‘rc_pair_regalloc_inputs_only’:
radeon_pair_regalloc.c:330: warning: ISO C90 forbids mixed declarations and code
2010-09-29 12:15:14 -07:00
Vinson Lee
22c06a08e7 r600g: Update SConscript.
Fixes SCons build.
2010-09-29 12:09:21 -07:00
Vinson Lee
4f80a2d170 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_pair_schedule.c: In function ‘emit_all_tex’:
radeon_pair_schedule.c:244: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘destructive_merge_instructions’:
radeon_pair_schedule.c:291: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c:438: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘scan_read’:
radeon_pair_schedule.c:619: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘scan_write’:
radeon_pair_schedule.c:645: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘schedule_block’:
radeon_pair_schedule.c:673: warning: ISO C90 forbids mixed declarations and code
radeon_pair_schedule.c: In function ‘rc_pair_schedule’:
radeon_pair_schedule.c:730: warning: ISO C90 forbids mixed declarations and code
2010-09-29 12:02:02 -07:00
Jerome Glisse
1235becaa1 r600g: cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 15:06:04 -04:00
Vinson Lee
845bda34d0 r600g: Update SConscript.
This is a follow-up to commit 9c284b5cae.

Fixes SCons build.
2010-09-29 11:52:55 -07:00
Marek Olšák
94e9ab975c r300g: add support for formats beginning with X, like X8R8G8B8
This is actually a format translator fix.
2010-09-29 20:43:44 +02:00
Vinson Lee
4e07aadabb r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_pair_translate.c: In function ‘set_pair_instruction’:
radeon_pair_translate.c:153: warning: ISO C90 forbids mixed declarations and code
radeon_pair_translate.c:170: warning: ISO C90 forbids mixed declarations and code
radeon_pair_translate.c: In function ‘rc_pair_translate’:
radeon_pair_translate.c:336: warning: ISO C90 forbids mixed declarations and code
radeon_pair_translate.c:341: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:41:14 -07:00
Vinson Lee
45d22a9b20 r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
radeon_program_alu.c: In function ‘r300_transform_trig_simple’:
radeon_program_alu.c:882: warning: ISO C90 forbids mixed declarations and code
radeon_program_alu.c:932: warning: ISO C90 forbids mixed declarations and code
radeon_program_alu.c: In function ‘radeonTransformTrigScale’:
radeon_program_alu.c:996: warning: ISO C90 forbids mixed declarations and code
radeon_program_alu.c: In function ‘r300_transform_trig_scale_vertex’:
radeon_program_alu.c:1033: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:32:11 -07:00
Jerome Glisse
9c284b5cae r600g: delete old path
Lot of clean can now happen.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 14:28:48 -04:00
Vinson Lee
483971e649 r300/compiler: Move declaration before code.
Fixes this GCC warning on linux-x86 build.
radeon_emulate_loops.c: In function ‘rc_emulate_loops’:
radeon_emulate_loops.c:517: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:19:55 -07:00
Vinson Lee
760d7c5d7d r300/compiler: Move declaration before code.
Fixes these GCC warnings with linux-x86 build.
radeon_emulate_branches.c: In function ‘handle_if’:
radeon_emulate_branches.c:65: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c:71: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘handle_else’:
radeon_emulate_branches.c:94: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘handle_endif’:
radeon_emulate_branches.c:201: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘fix_output_writes’:
radeon_emulate_branches.c:267: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c:284: warning: ISO C90 forbids mixed declarations and code
radeon_emulate_branches.c: In function ‘rc_emulate_branches’:
radeon_emulate_branches.c:307: warning: ISO C90 forbids mixed declarations and code
2010-09-29 11:10:08 -07:00
Vinson Lee
aa62416ae1 mesa: Fix printf format warning.
Fixes this GCC warning.
math/m_debug_xform.c: In function '_math_test_all_transform_functions':
math/m_debug_xform.c:320: warning: format not a string literal and no format arguments
2010-09-29 10:46:46 -07:00
Vinson Lee
9c841abebc mesa: Fix printf format warning.
Fixes this GCC warning.
math/m_debug_norm.c: In function '_math_test_all_normal_transform_functions':
math/m_debug_norm.c:365: warning: format not a string literal and no format arguments
2010-09-29 10:44:17 -07:00
Vinson Lee
ae0cd81189 mesa: Fix printf format warning.
Fixes this GCC warning.
math/m_debug_clip.c: In function '_math_test_all_cliptest_functions':
math/m_debug_clip.c:363: warning: format not a string literal and no format arguments
2010-09-29 10:30:04 -07:00
Jerome Glisse
5646964b13 r600g: use a hash table instead of group
Instead of creating group of register use a hash table
to lookup into which block each register belongs. This
simplify code a bit.

Signed-off-by: Jerome Glisse <jglisse@redhat.com
2010-09-29 12:44:32 -04:00
Brian Paul
0cb545a7f2 draw: pass sampler state down to llvm jit state
Fixes a regression caused from the change to make min/max lod dynamic
state.

https://bugs.freedesktop.org/show_bug.cgi?id=30437
2010-09-29 10:34:43 -06:00
Marek Olšák
698893889a Makefile: ensure Gallium's Makefile.xorg and SConscript.dri are in the tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-29 09:51:55 -06:00
José Fonseca
e3a3a5378e scons: New build= option, with support for checked builds.
Where checked build is compiler optimizations plus debugging checks --
ideal for testing CPU bound loads and running test automation loads.
2010-09-29 14:24:52 +01:00
José Fonseca
67450f0644 scons: New build= option, with support for checked builds.
Where checked build is compiler optimizations plus debugging checks --
ideal for testing CPU bound loads and running test automation loads.
2010-09-29 14:17:26 +01:00
José Fonseca
fdcc168a16 llvmpipe: Decouple sampler view and sampler state updates.
Fixes glean pbo crash.

It would be possible to avoid crashing without decoupling, but given
that state trackers give no guarantee that number of views is consistent,
that would likely cause too many state updates (or miss some).
2010-09-29 14:16:35 +01:00
Kristian Høgsberg
4b70fe8421 glx: Only remove drawables from the hash when we actually delete them
https://bugs.freedesktop.org/show_bug.cgi?id=30457
2010-09-29 08:32:29 -04:00
Dave Airlie
08839c4055 Revert "r600g: add initial vertex translate support."
This reverts commit 914b669b08.

I didn't mean to commit this yet, will redo in new state system once
we clean it up.
2010-09-29 20:04:00 +10:00
Hui Qi Tay
3744d1c7d3 draw: added viewport and cliptest flags
Corrections in store_clip to store clip coordinates in AoS form.
Viewport & cliptest flag options based on variant key.
Put back draw_pt_post_vs and now 2 paths based on whether clipping
occurs or not.
2010-09-29 10:11:59 +01:00
Hui Qi Tay
94f65d095a draw: cliptest and viewport done in a single loop in vertex shader
Cliptesting now done at the end of vs in draw_llvm instead of
draw_pt_post_vs.

Added viewport mapping transformation and further cliptesting to
vertex shader in draw_llvm.c

Alternative path where vertex header setup, clip coordinates store,
cliptesting and viewport mapping are done earlier in the vertex
shader.

Still need to hook this up properly according to the return value of
"draw_llvm_shader" function.
2010-09-29 10:10:09 +01:00
Zhenyu Wang
d4da253b29 Revert "i965: Always set tiling for depth buffer on sandybridge"
This reverts commit 0a1910c267.

oops, shouldn't apply tiling depth buffer for other chips as well.
2010-09-29 15:18:37 +08:00
Tom Stellard
b27a809266 r300/compiler: Don't merge instructions that write output regs and ALU result
https://bugs.freedesktop.org/show_bug.cgi?id=30415

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 23:52:41 -07:00
Tom Stellard
1b76dde0cd r300/compiler: Don't use rc_error() unless the error is unrecoverable
https://bugs.freedesktop.org/show_bug.cgi?id=30416

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 23:52:41 -07:00
Tom Stellard
d40ff5510c r300/compiler: Fix segfault in error path
https://bugs.freedesktop.org/show_bug.cgi?id=30415

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 23:52:41 -07:00
Zhenyu Wang
73dab75b41 i965: fallback lineloop on sandybridge for now
Until we fixed GS hang issue.
2010-09-29 14:35:19 +08:00
Zhenyu Wang
0a1910c267 i965: Always set tiling for depth buffer on sandybridge
Sandybridge only support tiling depth buffer, always set tiling bit.

Fix 'fbo_firecube' demo.
2010-09-29 14:02:37 +08:00
Dave Airlie
28b57c56e2 r600g: remove old assert from new codepath
this fixes draw-elements-base-vertex
2010-09-29 14:52:39 +10:00
Dave Airlie
914b669b08 r600g: add initial vertex translate support. 2010-09-29 14:41:16 +10:00
Kenneth Graunke
565ff67688 glsl: "Copyright", not "Constantright"
Clearly this started out as ir_copy_propagation.cpp, but the search and
replace was a bit overzealous.
2010-09-28 21:17:33 -07:00
Eric Anholt
1747aa6755 i965: Add support for builtin uniforms to the new FS backend.
Fixes 8 piglit tests.
2010-09-28 16:31:10 -07:00
Eric Anholt
daacaac3c8 mesa: Move the list of builtin uniform info from ir_to_mesa to shared code.
I'm still not pleased with how builtin uniforms are handled, but as
long as we're relying on the prog_statevar stuff this seems about as
good as it'll get.
2010-09-28 16:26:58 -07:00
Eric Anholt
9ac910cfcd i965: Clean up obsolete FINISHME comment. 2010-09-28 16:26:58 -07:00
Eric Anholt
ff0eb45f47 i965: Fix array indexing of arrays of matrices.
The deleted code was meant to be handling indexing of a matrix, which
would have been a noop if it had been correct.
2010-09-28 16:26:49 -07:00
Dave Airlie
301ab49605 r600g: move radeon.h members around to add back map flushing. 2010-09-29 09:19:22 +10:00
Dave Airlie
53b3933ce6 r600g: add evergreen texture border support to new path 2010-09-29 09:19:22 +10:00
Dave Airlie
23be883c9b r600g: add back evergreen name. 2010-09-29 09:19:22 +10:00
Eric Anholt
17f3b8097d i965: Don't try to emit interpolation for unused varying slots.
Fixes:
glsl-fs-varying-array
glsl-texcoord-array
glsl-texcoord-array-2
glsl-vs-varying-array
2010-09-28 14:53:36 -07:00
Eric Anholt
5272c6a7a2 i965: Do interpolation for varying matrices and arrays in the FS backend.
Fixes:
glsl-array-varying-01
glsl-vs-mat-add-1
glsl-vs-mat-div-1
glsl-vs-mat-div-2
glsl-vs-mat-mul-2
glsl-vs-mat-mul-3
2010-09-28 14:50:59 -07:00
Eric Anholt
586b4b500f glsl: Also update implicit sizes of varyings at link time.
Otherwise, we'll often end up with gl_TexCoord being 0 length, for
example.  With ir_to_mesa, things ended up working out anyway, as long
as multiple implicitly-sized arrays weren't involved.
2010-09-28 14:37:26 -07:00
Eric Anholt
b9a59f0358 i965: Add support for ARB_fragment_coord_conventions to the new FS backend.
Fixes:
glsl-arb-frag-coord-conventions
glsl-fs-fragcoord
2010-09-28 13:42:52 -07:00
Eric Anholt
701c5f11c9 i965: Add support for ir_loop counters to the new FS backend.
Fixes:
glsl1-discard statement in for loop
glsl-fs-loop-two-counter-02
glsl-fs-loop-two-counter-04
2010-09-28 13:31:01 -07:00
Tilman Sauerbeck
35f94b1942 r600g: Cleaned up index buffer reference handling in the draw module.
This fixes a buffer leak.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-28 22:12:23 +02:00
Eric Anholt
89f6783d17 i965: Add support for MRT to the new FS backend.
Fixes these tests using gl_FragData or just gl_FragDepth:
glsl1-Preprocessor test (extension test 1)
glsl1-Preprocessor test (extension test 2)
glsl-bug-22603
2010-09-28 12:37:21 -07:00
Eric Anholt
86fd11262c i965: Add support for non-color render target write data to new FS backend.
This is the first time these payload bits have made sense to me,
outside of brw_wm_pass* structure.

Fixes: glsl1-gl_FragDepth writing
2010-09-28 12:37:21 -07:00
Vinson Lee
f46a61554f scons: Add program/sampler.cpp to SCons build.
This is a follow-up to commit a32893221c.

Fixes MinGW SCons build.
2010-09-28 12:03:45 -07:00
Eric Anholt
2999a44968 i965: Set up sampler numbers in the FS backend.
+10 piglits
2010-09-28 11:37:08 -07:00
Eric Anholt
a32893221c mesa: Pull ir_to_mesa's sampler number fetcher out to shared code. 2010-09-28 11:37:08 -07:00
Jerome Glisse
723a655ed3 r600g: avoid rebuilding the vertex shader if no change to input format
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 14:34:25 -04:00
Jerome Glisse
fe790a3c34 r600g: suspend/resume occlusion query around clear/copy
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 14:24:18 -04:00
Marek Olšák
11eb422a16 configure.ac: do not build xorg-r300g by default
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 19:38:40 +02:00
Marek Olšák
a1aec2e2be configure.ac: look for libdrm_radeon before building gallium/r300,r600
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 19:38:39 +02:00
Eric Anholt
9e96c737f8 i965: Subtract instead of adding when computing y delta in new FS backend.
Fixes 7 piglit cases.
2010-09-28 10:19:54 -07:00
Eric Anholt
5f7bd68149 i965: Add support for gl_FrontFacing to the new FS backend.
Fixes:
glsl1-gl_FrontFacing var (1)
glsl1-gl_FrontFacing var (2)
2010-09-28 10:10:44 -07:00
Eric Anholt
ef8e002c75 i965: Fix up part of my Sandybridge attributes support patch.
I confused the array sizing for number of files for the number of regs
in a file.
2010-09-28 10:10:42 -07:00
Eric Anholt
f1dba03056 i965: Fix all non-snb regression in the snb attribute interpolation commit.
This apparently had never been tested elsewhere before being merged to
master.
2010-09-28 10:10:42 -07:00
Eric Anholt
6bf12c8b73 i965: Add support for struct, array, and matrix uniforms to FS backend.
Fixes 16 piglit cases.
2010-09-28 09:33:31 -07:00
Eric Anholt
ba481f2046 i965: Add support for dereferencing structs to the new FS backend.
Fixes: glsl1-struct(2)
2010-09-28 09:33:31 -07:00
Eric Anholt
07fc8eed8f i965: Set the variable type when dereferencing an array.
We don't set the type on the array virtual reg as a whole, so here's
the right place.

Fixes:
glsl1-GLSL 1.20 arrays
glsl1-temp array with constant indexing, fragment shader
glsl1-temp array with swizzled variable indexing
2010-09-28 09:33:31 -07:00
Eric Anholt
719f84d9ab i965: Fix up the FS backend for the variable array indexing pass.
We need to re-run channel expressions afterwards as it generates new
vector expressions, and we need to successfully support conditional
assignment (brw_CMP takes 2 operands, not 1).
2010-09-28 09:33:30 -07:00
Eric Anholt
57edd7c5c1 i965: Fix valgrind complaint about base_ir for new FS debugging. 2010-09-28 09:33:30 -07:00
Eric Anholt
1723fdb3f0 i965: Apply the same set of lowering passes to new FS as to Mesa IR.
While much of this we will want to support natively, this should make
the task of reaching the Mesa IR backend's quality easier.

Fixes:
glsl-fs-main-return.
2010-09-28 09:33:30 -07:00
Eric Anholt
e10508812a i965: Actually track the "if" depth in loop in the new FS backend.
Fixes:
glsl-fs-if-nested-loop.
2010-09-28 09:33:30 -07:00
Eric Anholt
fceb78e3cc i965: Fix negation in the new FS backend.
Fixes:
glsl1-Negation
glsl1-Negation2
2010-09-28 09:33:30 -07:00
Jerome Glisse
7ee8fa0421 r600g: switch to new design
New design seems to be on parity according to piglit,
make it default to get more exposure and see if there
is any show stopper in the coming days.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 11:37:30 -04:00
Jerome Glisse
b534eb16a2 r600g: fix remaining piglit issue in new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 11:12:03 -04:00
Jerome Glisse
5a38cec7c8 r600g: use ptr for blit depth uncompress function
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 09:51:08 -04:00
Christoph Bumiller
e0b93c5beb nv50: fix GP state bind and validate 2010-09-28 11:22:59 +02:00
Dave Airlie
175261a1f1 r600g: on evergreen the centroid isn't set in this register. 2010-09-28 19:02:46 +10:00
Zhenyu Wang
45b37c4b12 i965: fallback bitmap operation on sandybridge
Need to bring back correct fb write with header to set pixel
write mask. Fallback for now.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
3074b61f64 i965: fix occlusion query on sandybridge
Fix pipe control command for depth stall and PS_DEPTH_COUNT write.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
ec99833e92 i965: fix point sprite on sandybridge
Need to set point sprite function in fixed SF state now on sandybridge.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
4b6b0bf24a i965: fix scissor state on sandybridge
Fix incorrect scissor rect struct and missed scissor state pointer
setting for sandybridge.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
3f3059fcc0 i965: enable polygon offset on sandybridge
Depth offset function is moved to SF stage on sandybridge.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
15a8e7ec90 i965: fix pixel w interpolation on sandybridge 2010-09-28 15:58:21 +08:00
Zhenyu Wang
85fa900b93 i965: don't do calculation for delta_xy on sandybridge
Sandybridge doesn't have Xstart/Ystart in payload header.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
c58bf2cee5 i965: only allow SIMD8 kernel on sandybridge now
Until we fixed SIMD16 kernel, force to SIMD8 on sandybridge now.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
18c3b754f9 i965: sandybridge pipe control workaround before write cache flush
Must issue a pipe control with any non-zero post sync op before
write cache flush = 1 pipe control.
2010-09-28 15:58:21 +08:00
Zhenyu Wang
c8033f1b1e i965: Add all device ids for sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
81aae67e58 i965: fix const register count for sandybridge
Sandybridge's PS constant buffer payload size is decided from
push const buffer command, incorrect size would cause wrong data
in payload for position and vertex attributes. This fixes coefficients
for tex2d/tex3d.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
956f866030 i965: Fix sampler on sandybridge
Sandybridge has not much change on texture sampler with Ironlake.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
c5a3b25bb9 i965: fix jump count on sandybridge
Jump count is for 64bit long each, so one instruction requires 2
like on Ironlake.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
9c39a9fcb2 i965: VS use SPF mode on sandybridge for now
Until conditional instructions were fixed, use SPF mode instead for now.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
7401a98e29 i965: add sandybridge viewport state bo into validation list 2010-09-28 15:58:20 +08:00
Zhenyu Wang
a0b1d7b2b8 i965: ignore quads for GS kernel on sandybridge
Sandybridge's VF would convert quads to polygon which not required
for GS then. Current GS state still would cause hang on lineloop.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
67dafa4b56 i965: ff sync message change for sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
fa589770e8 i965: fix point size setting in header on sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
03218a0093 i965: force zero in clipper to ignore RTAIndex on sandybridge 2010-09-28 15:58:20 +08:00
Zhenyu Wang
41c31c2ebd i965: Fix color interpolation on sandybridge
Don't double store position in vertex attribute. This makes color
interpolation right by using barycentric coordinates.
2010-09-28 15:58:20 +08:00
Zhenyu Wang
8c31a4c3cf i965: enable accumulator update in PS kernel too on sandybridge
Accumulator update flag must be set for implicit update on sandybridge.
2010-09-28 15:58:19 +08:00
Zhenyu Wang
b016a78b98 i965: new state dump for sandybridge
Dump new state object on sandybridge for cc viewport, clip viewport,
depth stencil, cc and blend state.
2010-09-28 15:58:19 +08:00
Zhenyu Wang
bf60f35934 i965: disasm quarter and write enable instruction control on sandybridge 2010-09-28 15:58:19 +08:00
Eric Anholt
fe2d4a5ea0 i965: Add support for POW in gen6 FS.
Fixes glsl-algebraic-pow-2 in brw_wm_glsl.c mode.
2010-09-28 15:58:19 +08:00
Eric Anholt
2f914053bc i965: Set up inputs to the fragment shader according to FP InputsRead.
Sending down data that doesn't get read doesn't make any sense, and
would make handling things like gl_FrontFacing and gl_PointCoord
harder.
2010-09-28 15:58:19 +08:00
Eric Anholt
a66e9a4d86 i965: Add support for attribute interpolation on Sandybridge.
Things are simpler these days thanks to barycentric interpolation
parameters being handed in in the payload.
2010-09-28 15:58:19 +08:00
Vinson Lee
79d5657770 dri: Add GET_PROGRAM_NAME definition for Mac OS X. 2010-09-28 00:27:31 -07:00
Tom Stellard
b3e95dc45c r300/compiler: Use rc_for_all_reads_src() in "dead constants" pass 2010-09-27 23:17:11 -07:00
Tom Stellard
40d256295c r300/compiler: radeon_remove_constants.c: fix indentation 2010-09-27 23:17:11 -07:00
Tom Stellard
a716952184 r300/compiler: Print immediate values after "dead constants" pass 2010-09-27 23:17:11 -07:00
Tom Stellard
798355d429 r300/compiler: Add more helper functions for iterating through sources
rc_for_all_reads_src() and rc_pair_for_all_reads_arg() pass references to
instruction sources to the callback so they can be modified directly.
2010-09-27 23:17:11 -07:00
Dave Airlie
34dba5f05a r600g: fix db flush breaking config state 2010-09-28 14:32:13 +10:00
Marek Olšák
e4fd65e9d7 r300g: fix swizzling of texture border color
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
13359e6a4b r300g: add support for 3D NPOT textures without mipmapping
The driver actually creates a 3D texture aligned to POT and does all
the magic with texture coordinates in the fragment shader. It first
emulates REPEAT and MIRRORED wrap modes in the fragment shader to get
the coordinates into the range [0, 1]. (already done for 2D NPOT)
Then it scales them to get the coordinates of the NPOT subtexture.

NPOT textures are now less of a lie and we can at least display
something meaningful even for the 3D ones.

Supported wrap modes:
- REPEAT
- MIRRORED_REPEAT
- CLAMP_TO_EDGE (NEAREST filtering only)
- MIRROR_CLAMP_TO_EDGE (NEAREST filtering only)
- The behavior of other CLAMP modes is undefined on borders, but they usually
  give results very close to CLAMP_TO_EDGE with mirroring working perfectly.

This fixes:
- piglit/fbo-3d
- piglit/tex3d-npot
2010-09-28 05:34:51 +02:00
Marek Olšák
7128e1625b r300/compiler: fix shadow sampling with swizzled coords
Taking the W component from coords directly ignores swizzling. Instead,
take the component which is mapped to W in the TEX instruction parameter.
The same for Z.

NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
c2ea7ffb0a r300/compiler: do not use copy propagation if SaturateMode is used
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
6f747567ec r300/compiler: fix projective mapping of 2D NPOT textures
NOTE: This is a candidate for the 7.9 branch.
2010-09-28 05:34:51 +02:00
Marek Olšák
82f8e43bfa r300g: code cleanups
Some random stuff I had here.

1) Fixed some misleading comments.
2) Removed fake_npot, since it's redundant.
3) lower_texture_rect -> scale_texcoords
4) Reordered and reindented some TEX transform code.
2010-09-28 05:34:51 +02:00
Eric Anholt
94d44c33c0 i965: Add support for dFdx()/dFdy() to the FS backend.
Fixes:
glsl-fwidth
glsl-derivs-swizzle
2010-09-27 18:31:53 -07:00
Eric Anholt
3610e0c1a0 i965: Fix vector splitting RHS channel selection with sparse writemasks.
Fixes:
glsl-fs-all-02
glsl-fs-dot-vec2
2010-09-27 18:29:15 -07:00
Eric Anholt
169ff0cc9d i965: Handle all_equal/any_nequal in the new FS.
These are generated for scalar operands instead of plain equal/nequal.
But for scalars, they're the same anyway.  +30 piglits.
2010-09-27 16:12:18 -07:00
Eric Anholt
a5c6c8a31b i965: Remove swizzling of assignment to vector-splitting single-channel LHS.
We'd end up reading some non-x component of the float RHS.  +53 piglits.
2010-09-27 16:09:50 -07:00
Eric Anholt
11ba8bafdb i965: Fix up writemasked assignments in the new FS.
Not sure how I managed to get tests to succeed without this.  +54 piglits.
2010-09-27 16:07:42 -07:00
Eric Anholt
5e8ed7a79b glsl: Add validation that a swizzle only references valid channels.
Caught the bug in the previous commit.
2010-09-27 15:52:56 -07:00
Eric Anholt
668cdbe129 glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.
It's trying to get an int smeared across all channels, not trying to
get a 1:1 mapping of a subset of a vector's channels.  This usually
ended up not mattering with ir_to_mesa, since it just smears floats
into every chan of a vec4.

Fixes:
glsl1-temp array with swizzled variable indexing
2010-09-27 15:52:56 -07:00
Ian Romanick
8b2d5f431f Remove unnescessary initializations of UpdateTexturePalette
This is already NULL'ed in _mesa_init_driver_functions.
2010-09-27 15:23:14 -07:00
Ian Romanick
78db8c8b66 Regenerate files changed by previous commit 2010-09-27 15:23:14 -07:00
Ian Romanick
02984e3536 Remove GL_EXT_cull_vertex
This is only used in the i915 driver where it provides little benefit
for very few applications that use it with fixed function TNL.
2010-09-27 15:23:14 -07:00
Ian Romanick
4b1f98241f Remove GL_MESA_packed_depth_stencil
This extension was never enabled in any driver.
2010-09-27 15:23:14 -07:00
Ian Romanick
7f11d471e6 mesa: Force GL_SGIS_generate_mipmap to always be enabled
As per discussions at XDS.
2010-09-27 15:23:13 -07:00
Ian Romanick
4da5f1b7c5 mesa: Force GL_ARB_copy_buffer to always be enabled
As per discussions at XDS.
2010-09-27 15:23:13 -07:00
Luca Barbieri
a73c6ce67b d3d1x: work around crash in widl 2010-09-28 00:18:25 +02:00
Luca Barbieri
9126826594 d3d11: fix reference counting so devices get freed 2010-09-27 23:43:53 +02:00
Ian Romanick
923c3334fb dri: Ensure that DRI driver cpp files are in tarballs 2010-09-27 14:16:16 -07:00
Brian Paul
de2dfce0d9 softpipe: fix swizzling of texture border color
We ask the texture tile cache to swizzle the color for us since that's
where the view/swizzling info is available.
2010-09-27 15:06:23 -06:00
Brian Paul
3446af0179 llvmpipe: fix swizzling of texture border color
The pipe_sampler_view's swizzle terms also apply to the texture border
color.  Simply move the apply_sampler_swizzle() call after we fetch
the border color.

Fixes many piglit texwrap failures.
2010-09-27 15:06:23 -06:00
Jerome Glisse
0282682e98 r600g: fix occlusion query after change to block structure
block->reg point to register value not block->pm4 which point
to packet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 17:00:07 -04:00
Brian Paul
029c099b54 softpipe: allocate tile data on demand
Changes in v2:
- Invalidate last_tile_addr on any change, fixing regressions
- Correct coding style

Currently softpipe ends up allocating more than 200 MB of memory
for each context due to the tile caches.

Even worse, this memory is all explicitly cleared, which means that the
kernel must actually back it with physical RAM right away.

This change allocates tile memory on demand.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-27 14:32:05 -06:00
Luca Barbieri
a359eb80c5 d3d1x: fix Map 2010-09-27 22:20:53 +02:00
Luca Barbieri
f976cd0c9e d3d1x: rework DXGI for occlusion testing and default width/height 2010-09-27 22:20:53 +02:00
Luca Barbieri
e01e2e1883 d3d1x: put proper calling convention in headers, fixes 64-bit builds 2010-09-27 22:20:53 +02:00
Luca Barbieri
b821fdd563 d3d1x: properly support specifying MipLevels as 0 2010-09-27 22:20:53 +02:00
Luca Barbieri
db6f1d0436 d3d1x: support centroid interpolation 2010-09-27 22:20:53 +02:00
Luca Barbieri
ff531c5b05 ureg: support centroid interpolation 2010-09-27 22:20:52 +02:00
Luca Barbieri
94c2be73f4 d3d1x: link to libdrm for X11 platform too
Thanks to Xavier Chantry.
2010-09-27 22:20:52 +02:00
Luca Barbieri
f1afa8794e d3d11: ignore StructureByteStride
D3D11 applications are allowed to pass a random value if the buffer
is not structured
2010-09-27 22:20:52 +02:00
Luca Barbieri
dfc546c047 d3d11: advertise IDXGIDevice1, not just IDXGIDevice
Fixes failure to create device in DirectX SDK samples.
2010-09-27 22:20:52 +02:00
Vinson Lee
a6e642be5c scons: Add MinGW-w64 prefixes for MinGW build. 2010-09-27 13:13:25 -07:00
Hui Qi Tay
75d22e71a8 llvmpipe: minor changes in llvm coefficient calcs 2010-09-27 20:46:46 +01:00
Jerome Glisse
5e07483ed9 r600g: fix routing btw vertex & pixel shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 15:13:14 -04:00
Jerome Glisse
1617daaf49 r600g: fix pointsprite & resource unbinding
When asking to bind NULL resource assume it's unbinding
so free resource and unreference assoicated buffer.
Also fix pointsprite parameter.

Fix glsl-fs-pointcoord & fp-fragment-position

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 15:00:17 -04:00
Jerome Glisse
99c422ef5a r600g: build packet header once
Build packet header once and allow to add fake register support so
we can handle things like indexed set of register (evergreen sampler
border registers for instance.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 11:53:34 -04:00
Jerome Glisse
58a31758e3 r600g: fix index buffer drawing
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 09:59:52 -04:00
Luca Barbieri
99486bfc5b d3d1x: link progs with CXXFLAGS 2010-09-27 14:26:12 +02:00
Luca Barbieri
31d8f64f3f d3d1x: fix progs linking if not all EGL platforms are enabled 2010-09-27 14:24:33 +02:00
Luca Barbieri
9ba4b30eae d3d1x: add private gitignore file 2010-09-27 14:24:33 +02:00
Luca Barbieri
8d0ed47d94 d3d1x: fix parallel build 2010-09-27 14:11:12 +02:00
Luca Barbieri
e507e4ec05 gallium: add $(PROGS_DEPS) as dependencies for $(PROGS)
Commit 80ee3a440c added a PROGS_DEPS
definition, but no uses, even though it seems clearly intended
to be a set of additional dependencies for $(PROGS).

Correct this.
2010-09-27 14:11:12 +02:00
Luca Barbieri
f762f7b85d mesa: make makedepend an hard requirement
Currently makedepend is used by the Mesa Makefile-based build system,
but not required.

Unfortunately, not having it makes dependency resolution non-existent,
which is a source of subtle bugs, and is a rarely tested
configuration, since all Mesa developers likely have it installed.

Furthermore some idioms require dependency resolution to work at all,
such as making headers depend on generated files.
2010-09-27 14:10:18 +02:00
Tilman Sauerbeck
4c6344f569 r600g: Fixed two texture surface leaks in r600_blit_uncompress_depth().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-27 08:37:12 +02:00
Dave Airlie
7eab5ef425 r600g: add evergreen texture resource properly.
adding sampler border looks impossible with current design, another day, another corner case not worked out.
2010-09-27 14:35:41 +10:00
Vinson Lee
84b2773f00 r600g: Silence uninitialized variable warnings.
Fixes these GCC warnings.
r600_shader.c: In function 'tgsi_tex':
r600_shader.c:1611: warning: 'src2_chan' may be used uninitialized in this function
r600_shader.c:1611: warning: 'src_chan' may be used uninitialized in this function
2010-09-26 14:34:05 -07:00
Marek Olšák
311ab3d468 r300g: fix macrotiling on R350
MACRO_SWITCH on R350 appears to use the RV350 mode by default. Who knew?

NOTE: This is a candidate for the 7.9 branch.
2010-09-26 22:38:52 +02:00
Jerome Glisse
d2f24c4d75 r600g: use depth decompression in new path
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 16:29:33 -04:00
Jerome Glisse
4ca1a92b7f r600g: move around variables to share depth uncompression code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 16:29:33 -04:00
Joakim Sindholt
16baa465a2 radeong: fix leaks 2010-09-26 19:39:05 +02:00
Joakim Sindholt
b51f6e7c23 util/u_blitter: fix leak 2010-09-26 19:03:02 +02:00
Bas Nieuwenhuizen
bc8b8d06b6 r600g: set ENABLE_KILL on evergreen too 2010-09-26 12:23:41 -04:00
Bas Nieuwenhuizen
c622174f73 r600g: set ENABLE_KILL in the shader state in the new design 2010-09-26 12:21:02 -04:00
Jerome Glisse
a852615946 r600g: disable early cull optimization when occlusion query running
When occlusion query are running we want to have accurate
fragment count thus disable any early culling optimization
GPU has.

Based on work from Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 12:06:46 -04:00
Vinson Lee
6f16e497af r600g: Include p_compiler.h instead of malloc.h. 2010-09-26 03:23:31 -07:00
Vinson Lee
15f16328be r600g: Remove unused variables.
Fixes these GCC warnings.
radeon.c: In function 'radeon_new':
radeon.c:59: warning: unused variable 'k'
radeon.c:59: warning: unused variable 'j'
radeon.c:59: warning: unused variable 'id'
radeon.c:59: warning: unused variable 'i'
2010-09-26 03:18:12 -07:00
Vinson Lee
51bfd4e34a r600g: Don't return a value in function returning void.
Fixes this GCC warning.
radeon_state.c: In function 'radeon_state_fini':
radeon_state.c:140: warning: 'return' with a value, in function returning void
2010-09-26 03:10:58 -07:00
Vinson Lee
4743c7fbe7 r300g: Remove unused variable.
Fixes this GCC warning.
r300_state.c: In function 'r300_create_rs_state':
r300_state.c:925: warning: unused variable 'i'
2010-09-26 03:08:14 -07:00
Dave Airlie
81b7de5bf0 r300g: fix glsl-fs-pointcoord
Move GB_ENABLE to derived rs state, and find sprite coord for the correct
generic and enable the tex coord for that generic.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-26 18:07:07 +10:00
Vinson Lee
048bda175b r600g: Remove unused variable.
Fixes this GCC warning.
radeon_bo_pb.c: In function 'radeon_bo_pb_create_buffer':
radeon_bo_pb.c:178: warning: unused variable 'domain'
2010-09-25 15:19:29 -07:00
Tom Stellard
522e994a22 r300/compiler: Fix two mistakes in the presubtract optimization pass.
1. We can't turn an instruction into a presubtract operation if it
writes to one of the registers it reads from.
2. If we turn an instruction into a presubtract operation, we can't
remove that intruction unless all readers can use the presubtract
operation.

This fixes fdo bug 30337.
This is a candidate for the 7.9 branch.
2010-09-25 14:53:25 -07:00
Brian Paul
1e35f6472d softpipe: minor asst. clean-ups 2010-09-25 14:25:40 -06:00
Brian Paul
63a5b7d7cc softpipe: make clip state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
5b2406c0b9 softpipe: make stream out state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
bd13a0d282 softpipe: make rasterizer state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
eed4509b08 softpipe: make vertex state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
c5dd2e40e2 softpipe: make sampler state functions static 2010-09-25 14:25:40 -06:00
Brian Paul
2739692a6e softpipe: make blend/stencil/depth functions static 2010-09-25 14:25:40 -06:00
Brian Paul
279b368dc3 softpipe: make shader-related functions static 2010-09-25 14:25:40 -06:00
Brian Paul
72c6d16f8f softpipe: rename sp_state_fs.c -> sp_state_shader.c 2010-09-25 14:25:40 -06:00
Vinson Lee
f8ee415e3c st/dri: Remove unnecessary header. 2010-09-25 12:39:08 -07:00
Brian Paul
5ba62cd413 swrast: update comments for REMAINDER() macro 2010-09-25 13:37:05 -06:00
Brian Paul
4e2f53bacb gallivm: fix repeat() function for NPOT textures
The trick of casting the coord to an unsigned value only works for POT
textures.  Add a bias instead.  This fixes a few piglit texwrap failures.
2010-09-25 13:37:05 -06:00
Brian Paul
e31f0f9965 softpipe: fix repeat() function for NPOT textures
The trick of casting the coord to an unsigned value only works for POT
textures.  Add a bias instead.  This fixes a few piglit texwrap failures.
2010-09-25 13:37:05 -06:00
Vinson Lee
f3e6a0faa9 intel: Remove unnecessary header. 2010-09-25 12:33:28 -07:00
Vinson Lee
1fa50412f1 r600g: Disable unused variables.
The variables are used only in currently disabled code.

Fixes this GCC warning.
r600_context.c: In function 'r600_flush':
r600_context.c:76: warning: unused variable 'dname'
r600_context.c:75: warning: unused variable 'dc'
2010-09-25 12:28:47 -07:00
Vinson Lee
d7065908e4 r600g: Remove unused variable.
Fixes this GCC warning.
r600_draw.c: In function 'r600_draw_common':
r600_draw.c:71: warning: unused variable 'format'
2010-09-25 12:25:44 -07:00
Vinson Lee
60ec71e8b9 r600g: Remove unused variable.
Fixes this GCC warning.
r600_screen.c: In function 'r600_screen_create':
r600_screen.c:239: warning: unused variable 'family'
2010-09-25 12:21:10 -07:00
Christoph Bumiller
86cddfb110 nv50: fix/handle a few more PIPE_CAPs 2010-09-25 19:37:09 +02:00
Christoph Bumiller
2ef1d759b3 nv50: use CLEAR_BUFFERS for surface fills
The 2D engine's fill doesn't seem suited for RGBA32F or ZS buffers.
2010-09-25 19:37:09 +02:00
Christoph Bumiller
583bbfb3ae nv50: use formats table in nv50_surface.c 2010-09-25 19:37:09 +02:00
Jerome Glisse
58c243905b r600g: fix vertex resource & polygon offset
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-25 09:26:01 -04:00
Dave Airlie
b6469a8dc7 r600g: add eg db count control register. 2010-09-25 22:14:08 +10:00
Dave Airlie
ebca23149a r600g: make index bias fix for evergreen 2010-09-25 22:14:08 +10:00
José Fonseca
a69a96d85e gallivm: Remove dead experimental code. 2010-09-25 12:40:01 +01:00
Keith Whitwell
7225838778 llvmpipe: handle up to 8 planes in triangle binner 2010-09-25 12:22:09 +01:00
Keith Whitwell
60a45b03c3 llvmpipe: handle FACING interpolants in line and point setup 2010-09-25 12:21:55 +01:00
José Fonseca
2a8d1fd3ce gallivm: Fetch the lod from the dynamic state when min_lod == max_lod. 2010-09-25 12:21:19 +01:00
José Fonseca
998cf11e13 draw: Fullfil the new min_lod/max_lod/lod_bias/border_color dynamic state 2010-09-25 12:21:16 +01:00
Roland Scheidegger
049a8cce76 gallivm: optimize yuv decoding
this is more a proof to show vector shifts on x86 with per-element shift count
are evil. Since we can avoid the shift with a single compare/select, use that
instead. Replaces more than 20 instructions (and slow ones at that) with about 3,
and cuts compiled shader size with mesa's yuvsqure demo by over 10%
(no performance measurements done - but selection is blazing fast).
Might want to revisit that for future cpus - unfortunately AVX won't have vector
shifts neither, but AMD's XOP will, but even in that case using selection here
is probably not slower.
2010-09-25 12:19:31 +01:00
Roland Scheidegger
46d05d4ef9 gallivm: don't use URem/UDiv when calculating offsets for blocks
While it's true that llvm can and will indeed replace this with bit
arithmetic (since block height/width is POT), it does so (llvm 2.7) by element
and hence extracts/shifts/reinserts each element individually.
This costs about 16 instructions (and extract is not really fast) vs. 1...
2010-09-25 12:19:31 +01:00
Roland Scheidegger
26dc60d0a3 gallivm: fix copy&paste bug
looks like pot_depth should be used, not pot_height
(found by accident, not verified)
2010-09-25 12:19:31 +01:00
Dave Airlie
16a457bba6 r600g: add eg poly mode code. 2010-09-25 19:16:36 +10:00
Dave Airlie
865cf77503 mesa/mipmap: fix warning since 1acadebd62
1acadebd62 fixed the pointer but not the cast.
2010-09-25 18:51:24 +10:00
Vinson Lee
53e6eb8dbe r600g: Silence 'control reaches end of non-void function' warning.
Fixes this GCC warning.
r600_hw_states.c: In function 'r600_translate_fill':
r600_state_inlines.h:136: warning: control reaches end of non-void function
2010-09-24 23:48:05 -07:00
Vinson Lee
95cb6d30ae r600g: Remove unused variable.
Fixes this GCC warning.
eg_hw_states.c: In function 'eg_resource':
eg_hw_states.c:525: warning: unused variable 'r'
2010-09-24 23:17:55 -07:00
Vinson Lee
68fdd5f0d9 r600g: Disable unused variables.
The variables are only used in currently disabled code.

Fixes this GCC warning.
r600_state2.c: In function 'r600_flush2':
r600_state2.c:613: warning: unused variable 'dname'
r600_state2.c:612: warning: unused variable 'dc'
2010-09-24 23:08:08 -07:00
Vinson Lee
207481fa53 r600g: Remove unused variable.
Fixes this GCC warning.
r600_buffer.c: In function 'r600_buffer_transfer_map':
r600_buffer.c:141: warning: unused variable 'rctx'
2010-09-24 22:59:46 -07:00
Vinson Lee
365da88a71 intel: Remove unnecessary headers. 2010-09-24 22:55:04 -07:00
Vinson Lee
f07ac801b9 unichrome: Remove unnecessary header. 2010-09-24 22:53:40 -07:00
Vinson Lee
80ac94af72 r600g: Remove unnecessary header. 2010-09-24 22:48:46 -07:00
Vinson Lee
c510f8eeb4 mesa: Remove unnecessary headers. 2010-09-24 22:46:14 -07:00
Vinson Lee
ef1e1261df intel: Fix implicit declaration of function '_mesa_meta_Bitmap' warning.
Fix this GCC warning.
intel_pixel_bitmap.c: In function 'intelBitmap':
intel_pixel_bitmap.c:343: warning: implicit declaration of function '_mesa_meta_Bitmap'
2010-09-24 22:20:43 -07:00
Vinson Lee
5c77b75316 r300g: Silence uninitialized variable warning.
Silence this GCC warning.
r300_state_derived.c: In function 'r300_update_derived_state':
r300_state_derived.c:578: warning: 'r' may be used uninitialized in this function
r300_state_derived.c:578: note: 'r' was declared here
2010-09-24 19:33:43 -07:00
Eric Anholt
1acadebd62 mesa: Fix type typo in glGenerateMipmap handling of GL_UNSIGNED_INT data.
Fixes ARB_depth_texture/fbo-generatemipmap-formats.
2010-09-24 18:40:24 -07:00
Eric Anholt
b917691bc0 intel: Improve some of the miptree debugging. 2010-09-24 18:25:42 -07:00
Eric Anholt
86ad797be4 intel: More reverting of the sw fallback for depth texture border color.
The rest was done with 9aec1288ee
2010-09-24 18:19:08 -07:00
Eric Anholt
2e3d22b074 intel: Add fallback debug to glGenerateMipmap. 2010-09-24 18:03:28 -07:00
Eric Anholt
934fde4f5a intel: Fix segfault on INTEL_DEBUG=fbo with unsupported framebuffers. 2010-09-24 18:03:28 -07:00
Marek Olšák
8619495790 util: fix util_pack_color for B4G4R4A4
NOTE: This is a candidate for the 7.9 branch.
2010-09-25 01:52:33 +02:00
Eric Anholt
1946b81e70 i965: Add support for rendering to SARGB8 FBOs.
Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb.  The test
still fails on SLA8, though.
2010-09-24 16:12:50 -07:00
Eric Anholt
836803df79 intel: Corresponding FinishRenderTexture debug to BeginRenderTexture. 2010-09-24 16:12:50 -07:00
Jerome Glisse
6613605d79 r600g: bring over fix from old path to new path
Up to 2010-09-19:
r600g: fix tiling support for ddx supplied buffers
9b146eae25

user buffer seems to be broken... new to fix that.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 17:33:30 -04:00
Jerome Glisse
3ad4486bfe r600g: fix evergreen new path
glxgears seems to work, had somelockup but now they seems to have vanish.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 16:17:28 -04:00
Jerome Glisse
49111213e4 r600g: fix reg definition
Doesn't bother fixing old path code, just disable that reg.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 16:09:05 -04:00
Jerome Glisse
ba7e6ccc95 r600g: fix evergreen new path
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 15:02:33 -04:00
Jerome Glisse
b43480fabb r600g: fixup some evergreen register definitions
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 15:02:33 -04:00
Ian Romanick
e4bd50c232 egl: Fix several 'comparison between signed and unsigned integer' warnings
I hate GCC for requiring the (int) cast on sizeof.
2010-09-24 10:55:38 -07:00
Ian Romanick
66c9ac76ad egl_glx: Silence piles of 'unused variable' warnings 2010-09-24 10:55:38 -07:00
Eric Anholt
e7c8832c7f intel: Dead comment removal. 2010-09-24 10:32:57 -07:00
Alex Deucher
15861e0074 r600c: fix mipmap stride on evergreen
taken from Dave's r600g fix
2010-09-24 13:20:58 -04:00
Ian Romanick
137fce247f EGL DRI2: Silence 'missing initializer' warnings 2010-09-24 09:40:06 -07:00
Ian Romanick
eade946cbf EGL DRI2: Silence piles of 'unused variable' warnings 2010-09-24 09:40:06 -07:00
Brian Paul
d1a4dd4217 llvmpipe: make texture border_color dynamic state 2010-09-24 09:48:32 -06:00
Brian Paul
61b7da074e llvmpipe: make min/max lod and lod bias dynamic state
Before, changing any of these sampler values triggered generation
of new JIT code.  Added a new flag for the special case of
min_lod == max_lod which is hit during auto mipmap generation.
2010-09-24 09:47:37 -06:00
Jerome Glisse
7967b46e65 r600g: fix compilation after change to evergreend.h
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:43:57 -04:00
Jerome Glisse
eff1af65af r600g: evergreen fix for new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Jerome Glisse
cb3aed80db r600g: move use_mem_constants flags for new designs structure alignment
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Jerome Glisse
3672bc14af r600g: fix typo in evergreen define (resource are in [0x30000;0x34000] range)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Brian Paul
f5c810c42f st/mesa: use the wrapped renderbuffer in CopyPixels()
Fixes assertion failures when copying stencil pixels.

NOTE: this is a candidate for the 7.9 branch.
2010-09-24 08:27:06 -06:00
Brian Paul
10dcc989ab st/mesa: add missing MESA_FORMAT_S8 case in st_mesa_format_to_pipe_format()
NOTE: this is a candidate for the 7.9 branch.
2010-09-24 08:24:43 -06:00
Brian Paul
9f7c8053e0 mesa: fix assertions to handle srgb formats
http://bugs.freedesktop.org/show_bug.cgi?id=30333

NOTE: This is a candidate for the 7.9 branch.
2010-09-24 07:55:49 -06:00
Luca Barbieri
1154765429 d3d1x: CRLF -> LF in progs 2010-09-24 15:12:20 +02:00
Luca Barbieri
7e81c67c8b d3d1x: stop using GLX in demos, just use the default visual 2010-09-24 15:12:19 +02:00
Luca Barbieri
db1fbb1efc d3d1x: assert if X visual is not among enumerated visuals 2010-09-24 15:12:19 +02:00
Luca Barbieri
f1063cfee2 d3d1x: don't crash on drivers not supporting vertex or geometry sampling 2010-09-24 15:12:19 +02:00
Luca Barbieri
b632d9fce3 nvfx: add RGB framebuffer format support in addition to BGR 2010-09-24 15:12:19 +02:00
Luca Barbieri
d0ee833dee nvfx: allow setting NULL constant buffers 2010-09-24 15:12:19 +02:00
Andre Maasikas
8b63ed4e6c r600g: break alu clause earlier
we still have constants to add and next int may need also 6 slots
2010-09-24 13:26:19 +03:00
Luca Barbieri
c7a064b4d5 d3d1x: fix linking of dxbc2tgsi 2010-09-24 09:51:15 +02:00
Luca Barbieri
54ee7721a1 d3d1x: draw to the correct buffer 2010-09-24 09:15:49 +02:00
Luca Barbieri
0f4ec3f72c d3d1x: fix CheckMultisampleQualityLevels 2010-09-24 09:15:49 +02:00
Luca Barbieri
0e40b41cee d3d1x: don't assert on unsupported resource types 2010-09-24 09:15:49 +02:00
Luca Barbieri
4babdc7844 d3d1x: add untested support for geometry shader translation 2010-09-24 09:15:49 +02:00
Luca Barbieri
f71f8c7d18 d3d1x: add shader dumping 2010-09-24 09:15:49 +02:00
Dave Airlie
11cd1612a1 r600g: fix polygon mode
this fixes glean'pointSprite test.
2010-09-24 18:58:16 +10:00
Dave Airlie
efa111a6cb r600g: fixup sprite coord enable.
this fixes piglit glsl-fs-pointcoord
2010-09-24 16:36:54 +10:00
Dave Airlie
428b101af9 r600g: fix typo in r700 alu emit 2010-09-24 16:12:02 +10:00
Dave Airlie
59276b8541 r600g: fixup VP->FP output->input routing.
We need to map the TGSI semantics to each other using the hw semantic ids.

this fixes glsl-kwin-blur and glsl-routing.
2010-09-24 14:59:19 +10:00
Dave Airlie
e74d26d82a r600g: fixup tex wrapping.
the clamp edge/clamp cases were reversed.
2010-09-24 13:51:54 +10:00
Dave Airlie
4e27e935ca r600g: drop index_offset parameter to index buffer translate.
r600 doesn't need this as we always have working index bias
2010-09-24 12:38:14 +10:00
Dave Airlie
cf0162be13 r600g: fix draw-elements and draw-elements-base-vertex 2010-09-24 12:34:43 +10:00
Dave Airlie
95e04c3d74 r600g: some more vertex formats 2010-09-24 12:34:43 +10:00
Dave Airlie
b7ab9ee84e r600g: add some more vertex format support.
adds the sscaled formats, this passes some more of the draw-vertices tests.
2010-09-24 12:34:43 +10:00
Dave Airlie
4388087f19 r600g: add vert support for 16/16 and 16/16/16 floats.
makes draw-vertices-half-float pass
2010-09-24 12:34:43 +10:00
Marek Olšák
85a45dcd5d Build r300g by default
NOTE: This will go to 7.9 as well.
2010-09-24 02:58:50 +02:00
Marek Olšák
9f35dcd24c r300g: fix the border color for every format other than PIPE_FORMAT_B8G8R8A8
TX_BORDER_COLOR should be formatted according to the texture format.
Also the interaction with ARB_texture_swizzle should be fixed too.

NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:57:36 +02:00
Marek Olšák
7d28ec8500 r300g: fix a copy-paste typo for logging 2010-09-24 02:33:34 +02:00
Marek Olšák
a333485386 r300g: make accessing map_list and buffer_handles thread-safe
NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:29:05 +02:00
Marek Olšák
206d92912c r300g: fixup long-lived BO maps being incorrectly unmapped when flushing
Based on commit 3ddc714b20 by Dave Airlie.

NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:29:04 +02:00
Marek Olšák
68afbe89c7 util: make calling remove_from_list multiple times in a row safe
This commit fixes an infinite loop in foreach_s if remove_from_list is used
more than once on the same item with other list operations in between.

NOTE: This is a candidate for the 7.9 branch because the commit
"r300g: fixup long-lived BO maps being incorrectly unmapped when flushing"
depends on it.
2010-09-24 02:29:04 +02:00
Eric Anholt
f46523e0bc i915: Remove a dead if (0) block. 2010-09-23 16:34:10 -07:00
Eric Anholt
64ff468d6f intel: Remove dead intelIsTextureResident().
It always returned 1 (GL_TRUE), which is the same thing that happens when
the driver hook isn't present.
2010-09-23 16:30:58 -07:00
Eric Anholt
f9e6f401e1 unichrome: Mostly revert my convolution removal changes.
For this driver, the minimum pitch alignment stuff does appear to be
necessary, so leave the separate munged width/height variable in
place.
2010-09-23 16:20:33 -07:00
Eric Anholt
1c0646a826 radeon: Remove copied minimum pitch alignment code.
This is already covered by radeon_mipmap_tree.c, and my convolution
cleanups broke in the presence of this code.  Thanks to Marek Olšák
for tracking down the relevant miptree code for me.
2010-09-23 16:20:25 -07:00
Eric Anholt
fae1855946 intel: Replace my intel_texture_bitmap code with _mesa_meta_Bitmap.
The meta code is more general than mine, and appears to pass the same
sets of tests (piglit + some oglconform).
2010-09-23 16:04:55 -07:00
Eric Anholt
2337f364b1 intel: Remove unnecessary minimum pitch alignment to 32 bytes.
This broke with the cleanup I did in convolution removal.  It's
unnecessary anyway since region_alloc_tiled adjusts pitches for us (64
byte alignment)
2010-09-23 16:04:55 -07:00
Tom Stellard
92762842a0 r300g: Always try to build libr300compiler.a
Make libr300compiler.a a PHONY target so that this library will always be
built.  This fixes the problem of libr300compiler.a not being updated
when r300g is being built and r300c is not.

This is a candidate for the Mesa 7.9 branch.
2010-09-23 15:04:35 -07:00
Eric Anholt
d26211e499 intel: Remove disabled stencil drawpixels acceleration.
We still retain the fallback override for GL_STENCIL_INDEX, because
the metaops version fails at oglconform.
2010-09-23 14:58:37 -07:00
Dave Airlie
c0c0c4b96b r300g: fix point sprite coord.
handled elsewhere now.

thanks to Droste on irc for pointing out the fix
2010-09-24 07:46:59 +10:00
Jerome Glisse
b360c050b6 r600g: initial evergreen support in new path
This doesn't work yet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-23 17:10:28 -04:00
Tilman Sauerbeck
ce8c71817b r600g: Destroy the blitter.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-23 22:36:00 +02:00
Eric Anholt
a62efdf82c mesa: Remove EXT_convolution.
More optional code.
2010-09-23 13:25:45 -07:00
Eric Anholt
73578ba9c4 mesa: Remove SGI_color_matrix.
Another optional ARB_imaging subset extension.
2010-09-23 13:25:45 -07:00
Eric Anholt
6c227e57e6 mesa: Remove SGI_color_table.
Another optional ARB_imaging subset extension.
2010-09-23 13:25:45 -07:00
Eric Anholt
7126e38d90 mesa: Remove EXT_histogram.
This has always been optional, and not useful.
2010-09-23 13:25:45 -07:00
Eric Anholt
907a6734fc mesa: Remove the non-required ARB_imaging extension.
Many of the EXT_ extensions in the subset have significant code
overhead with no users.  It is not a required part of GL -- though
text describing the extension is part of the core spec since 1.2, it
is always conditional on the ARB_imaging extension.
2010-09-23 13:25:45 -07:00
Luca Barbieri
96da9b28c8 d3d1x: obliterate IDL parameter names from d3d10.idl from Wine too 2010-09-23 16:29:29 +02:00
Luca Barbieri
bccd4eb824 d3d1x: add autogenerated files as prerequisites, so make builds them 2010-09-23 16:21:14 +02:00
Luca Barbieri
36a64bfe54 d3d1x: fix build without system EGL/egl.h 2010-09-23 16:18:52 +02:00
Luca Barbieri
eaf8fe8461 d3d1x: add missing guid.cpp 2010-09-23 16:17:36 +02:00
Luca Barbieri
1734a78538 d3d1x: flush properly 2010-09-23 16:08:37 +02:00
Luca Barbieri
206c4cc878 d3d1x: remove another include specstrings.h 2010-09-23 16:07:33 +02:00
Luca Barbieri
681f87e09b d3d1x: flush the pipe context when presenting 2010-09-23 16:06:03 +02:00
Luca Barbieri
9a97b9af68 d3d1x: remove specstrings.h include 2010-09-23 16:06:03 +02:00
Luca Barbieri
b6b3fbcdb1 d3d11: obliterate IDL parameter names 2010-09-23 16:06:03 +02:00
Luca Barbieri
0525384c11 d3d1x: rename parameters in dxgi 2010-09-23 16:06:03 +02:00
Luca Barbieri
9cd0e624b4 d3d1x: rename params in misc and objects 2010-09-23 16:06:03 +02:00
Luca Barbieri
4f700d23fd d3d11: rename screen params 2010-09-23 16:06:03 +02:00
Luca Barbieri
3e0f57b640 d3d1x: rename context params 2010-09-23 16:06:03 +02:00
Luca Barbieri
6b485d8518 d3d1x: minifix 2010-09-23 16:06:02 +02:00
Luca Barbieri
8224256946 d3d1x: remove specstrings 2010-09-23 16:06:02 +02:00
Luca Barbieri
6c598c78bd d3d1x: normalize whitespace 2010-09-23 16:06:02 +02:00
Luca Barbieri
e5ae4588d1 d3d1x: s/tpf/sm4/g 2010-09-23 16:06:02 +02:00
Luca Barbieri
75c29fe1c8 d3d1x: autogenerate shader enums and text from def files
This avoids the duplication in tpf.h and tpf_text.cpp
2010-09-23 16:06:02 +02:00
Luca Barbieri
22762012d1 d3d1x: initialize the mutex 2010-09-23 16:06:02 +02:00
José Fonseca
440129521c draw: Prevent clipped vertices overflow.
Some pathological triangles cause a theoritically impossible number of
clipped vertices.

The clipper will still assert, but at least release builds will not
crash, while this problem is further investigated.
2010-09-23 16:47:36 +01:00
Keith Whitwell
8b597b4ea4 draw: don't apply flatshading to clipped tris with <3 verts
If a triangle was completely culled by clipping, we would still try to
fix up its provoking vertex.
2010-09-23 16:11:17 +01:00
Luca Barbieri
1b15a3cafd d3d1x: bind NULL CSOs before destroying default CSOs on context dtor
Otherwise softpipe and llvmpipe assert.
2010-09-23 11:23:08 +02:00
Luca Barbieri
17ad9972f4 d3d1x: fix deadlocks on non-recursive mutex 2010-09-23 11:23:08 +02:00
Dave Airlie
ada1d91c15 egl: fix build since 17eace581d
looks like mesa st didn't get updated.
2010-09-23 16:12:23 +10:00
Dave Airlie
6547a82df1 r600g: fix warnings since last commit. 2010-09-23 16:02:54 +10:00
Dave Airlie
2f8453eea3 r600g: use blitter to do db->cb flushing.
use the blitter + custom stage to avoid doing a whole lot of state
setup by hand. This makes life a lot easier for doing this on evergreen
it also keeps all the state setup in one place.

We setup a custom context state at the start with a flag to denote
its for the flush, when it gets generated we generate the correct state
for the flush and no longer have to do it all by hand.

this should also make adding texture *to* depth easier.
2010-09-23 16:00:16 +10:00
Dave Airlie
c262c4a2ff u_blitter: add a custom blitter call passing a dsa cso
reimplement the flush stage added for r300 to allow a custom DSA stage
to be used in the pipeline, this allows for r600 hw DB->CB flushes.
2010-09-23 16:00:16 +10:00
Luca Barbieri
881c05aa1e d3d1x: properly reference count the backend 2010-09-23 03:13:52 +02:00
Kristian Høgsberg
17eace581d dri: Pass the __DRIscreen and the __DRIscreen private back to image lookup
We will typically have a current context when we need to lookup the image,
but the lookup implementation don't need it so drop it.
2010-09-22 22:02:05 -04:00
Zack Rusin
1c2423999e rbug: fix rbug when contexts are being destroyed 2010-09-22 20:41:23 -04:00
Dave Airlie
fa11c400d0 r600g: fix typo in evergreen register list
pointed out by glisse on irc.
2010-09-23 10:30:35 +10:00
Dave Airlie
8078e58795 r600g: fix depth readback on rv610 and other quirky variants.
at least zreaddraw works for me here now on my rv610
2010-09-23 10:20:56 +10:00
Dave Airlie
fb5ef05dc5 r600g: use floats instead of hex for blit vbo
once I go past 0x3f80000, I can't translate hex to float in-brain anymore.
2010-09-23 10:01:48 +10:00
Eric Anholt
03923ff95e i965: Warning fix for vector result any_nequal/all_equal change. 2010-09-22 14:58:29 -07:00
Eric Anholt
bb70bd5559 i965: Update expression splitting for the vector-result change to compares.
Fixes:
glsl1-precision exp2
glsl1-precision log2
2010-09-22 14:55:58 -07:00
Eric Anholt
ac3d5beb0b i965: When splitting vector variable assignment, ignore unset channels.
The new checks for sanity in ir_assignment creation got angry about
this write_mask == 0.  Fixes:
glsl-fs-dot-vec2.
glsl-fs-atan-2
glsl-fs-dot-vec2
2010-09-22 14:55:58 -07:00
Kristian Høgsberg
86a1938aa5 glx: Invalidate buffers after binding a drawable
If the server doesn't send invalidate events, we may miss a
resize before the rendering starts.  Invalidate the buffers now
so the driver will recheck before rendering starts.

https://bugs.freedesktop.org/show_bug.cgi?id=29984
https://bugs.freedesktop.org/show_bug.cgi?id=30155
2010-09-22 17:36:19 -04:00
Eric Anholt
d74bab1fb6 i965: Fix the vector/expression splitting for the write_mask change.
+113 piglits.
2010-09-22 14:15:27 -07:00
Jakob Bornecrantz
4bb42a4f7e tgsi: Fix missing test before check
As introduced with commit d21301675c

NOTE: This is a candidate for the 7.9 branch.
2010-09-22 22:56:54 +02:00
Eric Anholt
eaa6bf59db ir_to_mesa: Only compare vector_elements present for any_nequal/all_equal
Fixes: glsl-mat-from-int-ctor-03
2010-09-22 13:09:51 -07:00
Eric Anholt
3ffab36768 glsl: Fix copy'n'wasted ir_noop_swizzle conditions.
It considered .xyyy a noop for vec4 instead of .xyzw, and similar for vec3.
2010-09-22 13:09:51 -07:00
Eric Anholt
b39e6f33b6 glsl: Rework assignments with write_masks to have LHS chan count match RHS.
It turns out that most people new to this IR are surprised when an
assignment to (say) 3 components on the LHS takes 4 components on the
RHS.  It also makes for quite strange IR output:

(assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) ))
(assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) ))
(assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) ))

But even worse, even we get it wrong, as shown by this line of our
current step(float, vec4):

(assign (constant bool (1)) (w)
	(var_ref t)
	(expression float b2f (expression bool >=
		    (swiz w (var_ref x))(var_ref edge))))

where we try to assign a float to the writemasked-out x channel and
don't supply anything for the actual w channel we're writing.  Drivers
right now just get lucky since ir_to_mesa spams the float value across
all the source channels of a vec4.

Instead, the RHS will now have a number of components equal to the
number of components actually being written.  Hopefully this confuses
everyone less, and it also makes codegen for a scalar target simpler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-22 13:09:51 -07:00
Luca Barbieri
38da5c9cb6 d3d1x: add Wine dlls (tri, tex working, but no other testing) 2010-09-22 19:59:14 +02:00
Luca Barbieri
ab5e9a726d d3d1x: define GUIDs in the normal way 2010-09-22 19:44:58 +02:00
Luca Barbieri
3d4a15dfab d3d1x: fix API name 2010-09-22 19:44:57 +02:00
Luca Barbieri
e7624e23a3 d3d1x: redesign the HWND resolver interface
This one should be powerful enough to hook up Wine.
2010-09-22 19:44:57 +02:00
Luca Barbieri
4f8e38dab8 d3d1x: fix GUID declarations 2010-09-22 19:36:27 +02:00
Luca Barbieri
6ce098631a d3d1x: destroy native_display on adapter destruction 2010-09-22 19:36:27 +02:00
Kristian Høgsberg
9ec0b2a45e dri2: Make createImageFromName() take a __DRIscreen instead of __DRIcontext
We can't expect to have a context when this is called, and we don't need one
so just require a __DRIscreen instead.

Reported by Yu Dai <yu.dai@intel.com>
2010-09-22 15:08:22 -04:00
Jerome Glisse
f060ae9ab6 r600g: fix multiple occlusion query on same id
When calling query begin using same query id we need to discard
previous query results.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 14:59:09 -04:00
Jerome Glisse
b8835a3992 r600g: disable shader rebuild optimization & account cb flush packet
Shader rebuild should be more clever, we should store along each
shader all the value that change shader program rather than using
flags in context (ie change sequence like : change vs buffer, draw,
change vs buffer, switch shader will trigger useless shader rebuild).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 14:19:05 -04:00
Brian Paul
516ac2bd50 llvmpipe: fix sprite texcoord setup for non-projective texturing
Normally the Mesa state tracker uses TXP instructions for texturing.
But if a fragment shader uses texture2D() that's a TEX instruction.
In that case we were incorrectly computing the texcoord coefficients
in the point sprite setup code.  Some new comments in the code explain
things.
2010-09-22 11:25:18 -06:00
Brian Paul
bd6b8107ad configs: remove egl-swrast target from linux-dri config 2010-09-22 09:30:16 -06:00
Kristian Høgsberg
b91dba49e0 intel: Fix GL_ARB_shading_language_120 commit
Fix commit e7087175f8.  Move the reference to
GL_VERSION_2_1_functions to intel_extensions.c where it's available,
don't try to enable a non-existing extension and advertise 1.20 for all
intel chipsets, not just GEN4 and up.
2010-09-22 11:01:45 -04:00
Jerome Glisse
1abe48afbe r600g: flush color buffer after draw command
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 10:35:14 -04:00
José Fonseca
87267c71f6 llvmpipe: Make rgb/alpha bland func/factors match, when there is no alpha.
Makes AoS blending easier, and state more canonical.
2010-09-22 15:02:39 +01:00
José Fonseca
9a8e9f4595 llvmpipe: Special case complementary and identify blend factors in SoA.
One multiplication instead of two.

Also fix floating point random number generation and verification.

TODO: Do the same for AoS blending.
2010-09-22 15:02:39 +01:00
José Fonseca
162b0efff6 gallivm: Add unorm support to lp_build_lerp()
Unfortunately this can cause segfault with LLVM 2.6, if x is a constant.
2010-09-22 15:02:39 +01:00
José Fonseca
256b9d99fb util: Flush stdout on util_format. 2010-09-22 15:02:39 +01:00
Luca Barbieri
cac1565b98 d3d1x: fix segfault when hashing 2010-09-22 13:54:07 +02:00
Luca Barbieri
d83b7a69a0 d3d1x: fix warning 2010-09-22 13:25:45 +02:00
Luca Barbieri
1aed6f42e9 d3d1x: fix cf analysis 2010-09-22 13:24:55 +02:00
Luca Barbieri
12044e4c99 d3d1x: link with CXXFLAGS
Otherwise, -m32 doesn't make it there.
2010-09-22 13:22:00 +02:00
Luca Barbieri
d092c0c60d d3d1x: add missing memory barrier 2010-09-22 13:21:13 +02:00
Luca Barbieri
6d0c39ce36 d3d1x: don't build progs automatically
progs requires winsys, which hasn't yet been built by the time we
go into state_trackers.

It may be a good idea to also move it into tests.

After a normal build, run make in src/gallium/state_trackers/d3d1x/progs
to build them.
2010-09-22 11:36:35 +02:00
Luca Barbieri
feb9c8c510 winsys: automatically build sw winsys needed by EGL and d3d1x
A cleaner solution would be preferable, but this does no harm and works.
2010-09-22 09:37:23 +02:00
Luca Barbieri
a0e5103200 glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x build
The Gallium EGL state tracker reuses dri2.c but not the GLX code.

Currently there is a bit of code in dri2.c that is incorrectly tied
to GLX: instead, make it call an helper that both GLX and Gallium EGL
implement, like dri2InvalidateBuffers.

This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId
is undefined.

Note that we might want to move the whole event translation elsewhere,
and probably stop using non-XCB DRI2 altogether, but this seems to be
the minimal fix.
2010-09-22 08:01:49 +02:00
Luca Barbieri
e1e7c8df7f nvfx: remove gl_PointCoord hack
Now Gallium has the proper fix, thanks to Brian Paul.
2010-09-22 08:00:20 +02:00
Luca Barbieri
86bb64f889 d3d1x: attempt to fix/workaround bug #30322
This may just be hiding some other bug though, since the types are supposed
to be the same (and it compiles for me).

Anyway, this interface will likely need to changed, since it seems Wine needs
a more powerful one capable of expressing window subregions and called at
every Present.
2010-09-22 08:00:19 +02:00
Dave Airlie
2b1ea90342 r600g: disable dirty handling on texture from depth code.
nothing was every dirtying the object again, the mesa-demos
reflect test was just stalling.

this fixes glean readPixSanity.
2010-09-22 14:27:58 +10:00
Dave Airlie
d18f3accb0 r600g: make stencil readback work
need to write two components to get stencil components as well
2010-09-22 14:19:16 +10:00
Dave Airlie
41ef78c5af r600g: cleanup some of the DB blit code
add cb/db flush states to the blit code.
add support for the rv6xx that need special treatment.
according to R6xx_7xx_3D.pdf

set r700 CB_SHADER_CONTROL reg in blit code
docs say dual export should be disabled for DB->CB
2010-09-22 13:33:57 +10:00
Dave Airlie
6e901e330a r600g: fix typo in struct member name 2010-09-22 12:57:08 +10:00
Jerome Glisse
ca35292a44 r600g: occlusion query for new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 20:25:39 -04:00
Brian Paul
e7087175f8 mesa: don't advertise bogus GL_ARB_shading_language_120 extension
Instead of using the invalid GL_ARB_shading_language_120 extension to
determine the GLSL version, use a new ctx->Const.GLSLVersion field.
Updated the intel and r600 drivers, but untested.

See fd.o bug 29910

NOTE: This is a candidate for the 7.9 branch (but let's wait and see if
there's any regressions).
2010-09-21 18:13:04 -06:00
Vinson Lee
3642ca2f66 glut: Define eventParser for non-Windows only.
Fixes this GCC warning on MinGW build.
glut_input.c:295: warning: 'eventParser' defined but not used
2010-09-21 15:17:52 -07:00
Vinson Lee
13cd131b0f glut: Define markWindowHidden for non-Windows only.
Fixes this GCC warning on MinGW build.
glut_event.c:255: warning: 'markWindowHidden' defined but not used
2010-09-21 15:11:00 -07:00
Brian Paul
9e8d9f456f softpipe: add missing calls to set draw vertex samplers/views
Part of the fix for running softpipe w/ LLVM-enabled draw module.
2010-09-21 15:31:33 -06:00
Brian Paul
ffa2d203fb gallivm: fix lp_build_sample_compare()
The old code didn't really make sense.  We only need to compare the
X channel of the texture (depth) against the texcoord.

For (bi)linear sampling we should move the calls to this function
and compute the final result as (s1+s2+s3+s4) * 0.25.  Someday.

This fixes the glean glsl1 shadow2D() tests.  See fd.o bug 29307.
2010-09-21 15:31:32 -06:00
Luca Barbieri
83ea4878db d3d1x: ignore errors while building docs
Some versions of dot apparently lack pdf output.
2010-09-21 23:26:47 +02:00
Jerome Glisse
45d10c7d59 r600g: fix multi buffer rendering
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 16:57:55 -04:00
Brian Paul
2b95525429 glsl2: fix typo in error msg 2010-09-21 14:57:10 -06:00
Luca Barbieri
c02bf81629 d3d1x: fix GCC 4.1/4.2 build 2010-09-21 22:47:09 +02:00
Luca Barbieri
b4b2091655 d3d1x: add template parameters to base class ctor calls for GCC 4.4
GCC 4.5 is fine without them, but GCC 4.4 requires them.
Should fully fix the build on GCC 4.4
2010-09-21 22:35:01 +02:00
Luca Barbieri
82c346673a d3d1x: fix build with compilers other than GCC 4.5
There was some libstdc++-specific code that would only build with GCC 4.5
Now it should be much more compatible, at the price of reimplementing
the generic hash function.
2010-09-21 22:16:52 +02:00
Tilman Sauerbeck
1bcdc504d1 gallium/docs: The RET opcode may appear anywhere in a subroutine.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-21 21:59:57 +02:00
Eric Anholt
dd9a88f4dd i965: Track the windowizer's dispatch for kill pixel, promoted, and OQ
Looks like the problem was we weren't passing the depth to the render
target as expected, so the chip would wedge.  Fixes GPU hang in
occlusion-query-discard.

Bug #30097
2010-09-21 12:29:57 -07:00
Eric Anholt
4a0bc4716d i965: Also enable CC statistics when doing OQs.
This is required by the spec, so respect that.
2010-09-21 12:29:57 -07:00
Eric Anholt
23c507f135 i965: Share the KIL_NV implementation between glsl and non-glsl. 2010-09-21 12:29:57 -07:00
Jerome Glisse
6048be8969 r600g: directly allocate bo for user buffer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 14:37:38 -04:00
Eric Anholt
b5bb215629 glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.
Fixes glsl2/builtin-texturematrix.
Bug #30196.
2010-09-21 10:09:46 -07:00
José Fonseca
b556bb7c44 llvmpipe: When failing free fs shader too. 2010-09-21 17:51:29 +01:00
José Fonseca
388c94195a llvmpipe: Describe how to profile llvmpipe. 2010-09-21 17:51:29 +01:00
Brian Paul
b3a647276e draw: new draw_fs.[ch] files 2010-09-21 10:07:52 -06:00
Brian Paul
d49f153ab3 Merge branch 'sprite-coord' 2010-09-21 09:57:25 -06:00
Kristian Høgsberg
441344ba7e glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
2010-09-21 10:20:23 -04:00
Luca Barbieri
bb26272bea d3d1x: actually enable and fix blob apis 2010-09-21 16:01:26 +02:00
Luca Barbieri
f815b57b88 d3d1x: add missing file 2010-09-21 15:51:02 +02:00
Luca Barbieri
cb7cc36fff d3d1x: fix compilation with recent Wine versions installed
Recent Wine versions provide a d3d11shader.h, which is however empty
and was getting used instead of our non-empty one.

Correct the include path order to fix this.
2010-09-21 15:44:41 +02:00
Luca Barbieri
70fed0b0ec d3d1x: add blob and signature extraction APIs
NOTE: untested, needs a testing tool!
2010-09-21 15:44:41 +02:00
Keith Whitwell
2ec86793bd llvmpipe: fix flatshading in new line code
Calculate interpolants before rearranging the vertices.
2010-09-21 14:36:55 +01:00
Luca Barbieri
92617aeac1 d3d1x: add new Direct3D 10/11 COM state tracker for Gallium
This is a new implementation of the Direct3D 11 COM API for Gallium.

Direct3D 10 and 10.1 implementations are also provided, which are
automatically generated with s/D3D11/D3D10/g plus a bunch of #ifs.

While this is an initial version, most of the code is there (limited
to what Gallium can express), and tri, gears and texturing demos
are working.

The primary goal is to realize Gallium's promise of multiple API
support, and provide an API that can be easily implemented with just
a very thin wrapper over Gallium, instead of the enormous amount of
complex code needed for OpenGL.

The secondary goal is to run Windows Direct3D 10/11 games on Linux
using Wine.
Wine dlls are currently not provided, but adding them should be
quite easy.

Fglrx and nvidia drivers can also be supported by writing a Gallium
driver that talks to them using OpenGL, which is a relatively easy
task.
Thanks to the great design of Direct3D 10/11 and closeness to Gallium,
this approach should not result in detectable overhead, and is the
most maintainable way to do it, providing a path to switch to the
open Gallium drivers once they are on par with the proprietary ones.

Currently Wine has a very limited Direct3D 10 implementation, and
completely lacks a Direct3D 11 implementation.

Note that Direct3D 10/11 are completely different from Direct3D 9
and earlier, and thus warrant a fully separate implementation.

The third goal is to provide a superior alternative to OpenGL for
graphics programming on non-Windows systems, particularly Linux
and other free and open systems.

Thanks to a very clean and well-though design done from scratch,
the Direct3D 10/11 APIs are vastly better than OpenGL and can be
supported with orders of magnitude less code and development time,
as you can see by comparing the lines of code of this commit and
those in the existing Mesa OpenGL implementation.

This would have been true for the Longs Peak proposal as well, but
unfortunately it was abandoned by Khronos, leaving the OpenGL
ecosystem without a graphics API with a modern design.

A binding of Direct3D 10/11 to EGL would solve this issue in the
most economical way possible, and this would be great to provide
in Mesa, since DXGI, the API used to bind Direct3D 10/11 to Windows,
is a bit suboptimal, especially on non-Windows platforms.

Finally, a mature Direct3D 10/11 implementation is intrinsically going
to be faster and more reliable than an OpenGL implementation, thanks
to the dramatically smaller API and the segregation of all nontrivial
work to object creation that the application must perform ahead of
time.

Currently, this commit contains:
- Independently created headers for Direct3D 10, 10.1, 11 and DXGI 1.1,
  partially based on the existing Wine headers for D3D10 and DXGI 1.0
- A parser for Direct3D 10/11 DXBC and TokenizedProgramFormat (TPF)
- A shader translator from TokenizedProgramFormat to TGSI
- Implementation of the Direct3D 11 core interfaces
- Automatically generated implementation of Direct3D 10 and 10.1
- Implementation of DXGI using the "native" framework of the EGL st
- Demos, usable either on Windows or on this implementation
  - d3d11tri, a clone of tri
  - d3d11tex, a (multi)texturing demo
  - d3d11gears, an improved version of glxgears
  - d3d11spikysphere, a D3D11 tessellation demo (currently Windows-only)
- A downloader for the Microsoft HLSL compiler, needed to recompile
  the shaders (compiled shader bytecode is also included)

To compile this, configure at least with these options:
--with-state-trackers=egl,d3d1x --with-egl-platforms=x11
plus some gallium drivers (such as softpipe with --enable-gallium-swrast)

The Wine headers (usually from a wine-dev or wine-devel package) must
be installed.
Only x86-32 has been tested.

You may need to run "make" in the subdirectories of src/gallium/winsys/sw
and you may need to manually run "sudo make install" in
src/gallium/targets/egl

To test it, run the demos in the "progs" directory.
Windows binaries are included to find out how demos should work, and to
test Wine integration when it will be done.

Enjoy, and let me know if you manage to compile and run this, or
which issues you are facing if not.

Using softpipe is recommended for now, and your mileage with hardware
drivers may vary.
However, getting this to work on hardware drivers is also obviously very
important.

Note that currently llvmpipe is buggy and causes all 3 gears to be
drawn with the same color.
Use export GALLIUM_DRIVER=softpipe to avoid this.

Thanks to all the Gallium contributors and especially the VMware
team, whose work made it possible to implement Direct3D 10/11 much
more easily than it would have been otherwise.
2010-09-21 10:58:17 +02:00
Tilman Sauerbeck
894a307a91 r600g: Removed debug code.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-21 08:13:35 +02:00
Dave Airlie
8893427377 r600g: fix eg texture borders.
texture border regs are indexed on evergreen.
2010-09-21 20:53:09 +10:00
Dave Airlie
b6ced8ee7b r600g: fixup evergreen miptree setup.
eg seems to have a higher pitch aligmment requirement and uses r700 cube setup

this fixes a couple of piglit tests here.
2010-09-21 20:53:09 +10:00
Tom Stellard
610aed81db r300/compiler: Refactor the pair instruction data structures
Use rc_pair_ prefix for all pair instruction structs

Create a named struct for pair instruction args

Replace structs radeon_pair_instruction_{rgb,alpha} with struct
radeon_pair_sub_instruction.  These two structs were nearly identical
and were creating a lot of cut and paste code.  These changes are the
first step towards removing some of that code.
2010-09-20 18:48:47 -07:00
Dave Airlie
84997cd566 r600g: set back to correct codepaths.
Jerome please use git diff and git show before pushing.
2010-09-21 11:32:15 +10:00
Dave Airlie
8e8b60588b r600g: deal with overflow of VTX/TEX CF clauses.
running piglit's texrect-many caused the vtx to overflow.
2010-09-21 11:26:01 +10:00
Vinson Lee
2491258436 tgsi: Remove duplicate case value. 2010-09-20 18:20:04 -07:00
Francisco Jerez
bf8f24c1c8 dri/nouveau: Fix software mipmap generation on 1x1 textures. 2010-09-21 03:04:04 +02:00
Francisco Jerez
98add55fff dri/nv10-nv20: Fix texturing in some cases after a base level change. 2010-09-21 03:03:39 +02:00
Francisco Jerez
22c83ac47a dri/nouveau: Cleanup more references to old FBOs and VBOs. 2010-09-21 03:03:01 +02:00
Francisco Jerez
13c246bcea dri/nouveau: Remove unnecessary assertion. 2010-09-21 02:43:12 +02:00
Francisco Jerez
72e5fd5c02 dri/nv04: Use nvgl_wrap_mode(). 2010-09-21 02:43:11 +02:00
Jakob Bornecrantz
d21301675c tgsi: Actually care what check_soa_dependencies says
Thanks to José for the more complete list of supported opcodes.

NOTE: This is a candidate for the 7.9 branch.
2010-09-21 02:19:09 +02:00
José Fonseca
c66f0c4629 tgsi: Don't ignore indirect registers in tgsi_check_soa_dependencies
NOTE: This is a candidate for the 7.9 branch.
2010-09-21 02:18:43 +02:00
Timo Wiren
99907303f6 Fix typos in comments and debug output strings.
Bug #30208.
2010-09-20 15:28:32 -07:00
Brian Paul
77af109554 draw: check bitshift against PIPE_MAX_SHADER_OUTPUS 2010-09-20 15:34:02 -06:00
Brian Paul
1662c31703 llvmpipe: check bitshift against PIPE_MAX_SHADER_OUTPUTS 2010-09-20 15:33:49 -06:00
Jerome Glisse
4fc5050f82 r600g: add back reference check when mapping buffer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 17:21:37 -04:00
Brian Paul
a7ea4d11fb draw: fix test for using the wide-point stage
As it was, we weren't obeying the draw->pipeline.point_sprite state.
Fixes point sprites in llvmpipe driver.
2010-09-20 14:07:41 -06:00
Jerome Glisse
0f099f2906 r600g: use pipe context for flushing inside map
This allow to share code path btw old & new, also
remove check on reference this might make things
a little slower but new design doesn't use reference
stuff.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 16:02:13 -04:00
Brian Paul
61fcd9aaa2 llvmpipe: implement sprite coord origin modes 2010-09-20 13:48:02 -06:00
Tilman Sauerbeck
021e68b2cd python/tests: Fixed tri.py for API and TGSI syntax changes.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:43:01 +02:00
Brian Paul
c3982c6bcd llvmpipe: rename sprite field, add sprite_coord_origin 2010-09-20 13:37:39 -06:00
Tilman Sauerbeck
ef419599d9 r600g: Implemented the Z and W component write for the SCS opcode.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:27:59 +02:00
Brian Paul
b7a5eac1f3 llvmpipe: clean-up, comments in setup_point_coefficient() 2010-09-20 13:26:27 -06:00
Tilman Sauerbeck
57bf96b43b r600g: Honour destination operand's writemask in the SCS implementation.
If we are not going to write to the X or Y components of the destination
vector we also don't need to prepare to compute SIN or COS.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:22:48 +02:00
Brian Paul
924c18da95 llvmpipe: reformatting, remove trailing whitespace, etc 2010-09-20 13:18:41 -06:00
Brian Paul
ebba92875a llvmpipe: indentation fix 2010-09-20 13:18:41 -06:00
Brian Paul
955d76c3d2 llvmpipe: maintain fragment shader state for draw module 2010-09-20 12:52:16 -06:00
Luca Barbieri
86d5ec70d1 softpipe: fix whitespace 2010-09-20 20:49:48 +02:00
Luca Barbieri
de71e7a4c9 tgsi: add switch/case opcodes to tgsi_opcode_tmp.h 2010-09-20 20:23:35 +02:00
Luca Barbieri
2e7d1c2c86 softpipe: make z/s test always pass if no zsbuf, instead of crashing
D3D10 specifies this.
2010-09-20 20:23:35 +02:00
Luca Barbieri
6d0b695fa7 gallium: avoid the C++ keyword "template" in sw_winsys.h 2010-09-20 20:23:34 +02:00
Brian Paul
b2ad8b5c22 gallivm: remove debug code 2010-09-20 11:21:44 -06:00
Brian Paul
7888a2f822 llvmpipe: fix query bug when no there's no scene 2010-09-20 10:50:35 -06:00
Marek Olšák
168554904b st/mesa: fix assertion failure in GetTexImage for cubemaps
Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.
2010-09-20 18:14:23 +02:00
Jerome Glisse
363dfb83f1 r600g: move chip class to radeon common structure
So texture code can be shared btw new state design
& old one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 11:59:20 -04:00
Kenneth Graunke
6ea16b6c51 glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.
2010-09-20 17:33:13 +02:00
Kenneth Graunke
14eea26828 glsl: Add comments to clarify the types of comparison binops. 2010-09-20 17:31:16 +02:00
Brian Paul
0bc3e1f4f4 docs: mark as obsolete, remove dead links 2010-09-20 08:59:04 -06:00
Brian Paul
a8fde1ba4d docs: remove old broken link 2010-09-20 08:59:01 -06:00
Brian Paul
1739124159 glsl2: silence compiler warnings in printf() calls
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"
2010-09-20 08:22:54 -06:00
Brian Paul
5522887842 mesa: don't call valid_texture_object() in non-debug builds
This reverts commit c32bac57ed
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.
2010-09-20 08:21:00 -06:00
Ian Romanick
e053d62aa5 glsl: Add doxygen comments 2010-09-20 07:09:03 -07:00
Jakob Bornecrantz
208f1f3810 i915g: Link with wrapper sw winsys with scons 2010-09-20 15:33:20 +02:00
Michal Krol
279492386f svga: Integer constant register file has a separate namespace.
Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.
2010-09-20 09:26:49 +01:00
Michal Krol
0742e0b376 svga: Fix relative addressing translation for pixel shaders.
Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.
2010-09-20 09:26:17 +01:00
Corbin Simpson
0d53dfa3c5 r600g: Cleanup viewport floats. 2010-09-19 23:05:02 -07:00
Corbin Simpson
e98062673e r600g: Clean up PS setup.
I didn't do r600d according to the docs; I split EXPORT_MODE to be a bit more
useful and obvious. Hope this is okay.
2010-09-19 23:05:02 -07:00
Dave Airlie
f4020c66fd r600g: only flush for the correct colorbuffer, not all of them. 2010-09-20 15:39:03 +10:00
Dave Airlie
7e5173d065 r600g: add missing BC_INST wrapper for evergreen 2010-09-20 15:38:40 +10:00
Dave Airlie
b110ddd9a9 r600g: fixup r700 CB_SHADER_CONTROL register.
r600c emits this with a mask of each written output.
2010-09-20 15:36:52 +10:00
Dave Airlie
d172ef3138 r600g: fix r700 cube map sizing.
this fixes fbo-cubemap on r700.
2010-09-20 15:30:52 +10:00
Dave Airlie
3a1defa5e8 r600g: add color/texture support for more depth formats. 2010-09-20 12:21:35 +10:00
Dave Airlie
2cabbb290f r600g: add z16 to color setup 2010-09-20 12:04:52 +10:00
Dave Airlie
9b146eae25 r600g: fix tiling support for ddx supplied buffers
needed to emit some more relocs to the kernel.
2010-09-20 11:40:33 +10:00
Corbin Simpson
c2ba729321 r600g: "tmp" is such a bad name for a texture. 2010-09-19 18:25:02 -07:00
Corbin Simpson
07b9e22a1f r600g: Fix false and true. 2010-09-19 18:25:02 -07:00
Corbin Simpson
eb347c7ef0 r600g: Clean up some indentation and |= vs. | usage. 2010-09-19 18:25:01 -07:00
Corbin Simpson
7ee9b0b951 r600g: Deobfuscate and comment a few more functions in r600_hw_states. 2010-09-19 18:25:01 -07:00
Corbin Simpson
f76b81423e r600g: Trivially deobfuscate r600_hw_states. 2010-09-19 18:25:01 -07:00
Corbin Simpson
5f5bf25af5 r600g: Use align() instead of handrolled code. 2010-09-19 18:25:01 -07:00
Dave Airlie
8d1ec80319 r600g: drop debugging that snuck in 2010-09-20 10:45:18 +10:00
Dave Airlie
040411de26 r600g: clean up valgrind issues on maxtargets test. 2010-09-20 10:44:44 +10:00
Dave Airlie
4af55364cc r600g: fix fbo-drawbuffers-maxtargets
we were leaking buffers since the flush code was added, it wasn't dropping references.
move setting up flush to the set_framebuffer_state.
clean up the flush state object.
make more space in the BOs array for flushing.
2010-09-20 10:35:38 +10:00
Dave Airlie
3d12c207d7 r600g: send correct surface base update for multi-cbufs 2010-09-20 10:15:26 +10:00
Dave Airlie
f59fe9671f r600g: modify index buffers for sizes the hw can't deal with.
this just uses the common code from r300g now in util to do translations on r600g.
2010-09-20 09:57:47 +10:00
Dave Airlie
91b70d8408 util/r300g: split the r300 index buffer modifier functions out to util
These can be used by other drivers, like r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-20 09:38:18 +10:00
Henri Verbeet
f1cf04dbc0 r600g: fix exports_ps to export a number not a mask. 2010-09-20 09:30:21 +10:00
Jakob Bornecrantz
b83156d42f scons: Link against talloc in the Gallium DRI drivers 2010-09-20 00:03:58 +02:00
Jakob Bornecrantz
00272e9e09 rbug: Add function to get opcode name string 2010-09-20 00:03:58 +02:00
Jakob Bornecrantz
7faa37adf8 rbug: Cast opcode to corrent int size 2010-09-20 00:03:58 +02:00
Henri Verbeet
1934ade183 Revert "r600g: Flush upload buffers before draws instead of before flushes."
This reverts commit a1d9a58b82.
Flushing the upload buffers on draw is wrong, uploads aren't supposed to
cause flushes in the first place. The real issue was
radeon_bo_pb_map_internal() not respecting PB_USAGE_UNSYNCHRONIZED.
2010-09-19 23:03:03 +02:00
Henri Verbeet
0f9181811f r600g: Respect PB_USAGE_UNSYNCHRONIZED in radeon_bo_pb_map_internal(). 2010-09-19 23:03:03 +02:00
Tilman Sauerbeck
d323118c3e gallium/docs: Fixed a typo in the SCS opcode description.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-19 22:13:42 +02:00
Luca Barbieri
a01578c84f auxiliary: fix depth-only and stencil-only clears
Depth-only and stencil-only clears should mask out depth/stencil from the
output, mask out stencil/input from input, and OR or ADD them together.

However, due to a typo they were being ANDed, resulting in zeroing the buffer.
2010-09-19 21:52:02 +02:00
Henri Verbeet
affd46cc2b r600g: Buffer object maps imply a wait.
Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.
2010-09-19 19:43:05 +02:00
Henri Verbeet
de9c8015eb r600g: Remove a redundant flush in r600_texture_transfer_map().
radeon_ws_bo_map() will already take care of that if needed.
2010-09-19 19:43:05 +02:00
Henri Verbeet
b68030e9f8 r600g: Check for other references before checking for existing mappings in radeon_bo_pb_map_internal().
Having a non-NULL data pointer doesn't imply it's safe to reuse that mapping,
it may have been unmapped but not flushed yet.
2010-09-19 19:43:05 +02:00
Henri Verbeet
a1d9a58b82 r600g: Flush upload buffers before draws instead of before flushes.
If a upload buffer is used by a previous draw that's still in the CS,
accessing it would need a context flush. However, doing a context flush when
mapping the upload buffer would then flush/destroy the same buffer we're trying
to map there. Flushing the upload buffers before a draw avoids both the CS
flush and the upload buffer going away while it's being used. Note that
u_upload_data() could e.g. use a pool of buffers instead of allocating new
ones all the time if that turns out to be a significant issue.
2010-09-19 19:43:05 +02:00
Chia-I Wu
2a910b3396 egl: Enable drm platform by default.
This enables EGL_MESA_drm_display for st/egl in the default setup.
2010-09-19 17:35:04 +08:00
Chia-I Wu
e4513e7fb9 st/egl: s/kms/drm/ on the drm backend.
s/kms/drm/, s/kdpy/drmdpy/, and so forth.
2010-09-19 17:19:40 +08:00
Chia-I Wu
e7424d7240 st/egl: Rename kms backend to drm.
The main use of the backend is to support EGL_MESA_drm_display.  drm
should be a better name.
2010-09-19 17:19:03 +08:00
Chia-I Wu
c7c2e7d0ce st/egl: Split modeset code support to modeset.c.
The modeset code supports now obsolete EGL_MESA_screen_surface.  Move it
to a file of its own.
2010-09-19 16:37:48 +08:00
Dave Airlie
ed4f740127 r600g: only emit uses waterfall on r6xx hw. 2010-09-19 17:25:50 +10:00
Dave Airlie
c5edfcc410 r600g; add uses waterfall to asm cf for r6xx.
On r6xx if an MOVA instruction is emitted we should set this bit.
2010-09-19 17:20:15 +10:00
Tilman Sauerbeck
8861727c91 r600g: Added support for TGSI_SEMANTIC_FACE.
This makes the 'glsl1-gl_FrontFacing var (1)' piglit test pass.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-19 09:21:41 +02:00
Vinson Lee
fa10561908 nv50: Remove dead initialization. 2010-09-18 23:07:41 -07:00
Vinson Lee
03cf572598 nv50: Remove dead initialization. 2010-09-18 23:06:29 -07:00
Vinson Lee
ef715b866b nv50: Silence missing initializer warning.
Fixes this GCC warning.
nv50_state_validate.c:336: warning: missing initializer
nv50_state_validate.c:336: error: (near initialization for 'validate_list[20].func')
2010-09-18 15:59:00 -07:00
Christoph Bumiller
613c3901c3 nv50: fix typo in fifo packet length limit 2010-09-18 20:53:53 +02:00
Kenneth Graunke
dbd2480507 glsl/builtins: Switch comparison functions to just return an expression. 2010-09-18 16:23:48 +02:00
Kenneth Graunke
52f9156e88 glsl/builtins: Fix equal and notEqual builtins.
Commit 309cd4115b incorrectly converted
these to all_equal and any_nequal, which is the wrong operation.
2010-09-18 16:23:48 +02:00
Christoph Bumiller
4c1e7d931d nv50: emit constbuf relocs before uploading constants 2010-09-18 15:22:05 +02:00
Christoph Bumiller
275a81af13 nv50: add relocs for stack and local mem buffers 2010-09-18 15:21:59 +02:00
Kenneth Graunke
ca92ae2699 glsl: Properly handle nested structure types.
Fixes piglit test CorrectFull.frag.
2010-09-18 11:21:34 +02:00
Keith Whitwell
7ef3d171a0 graw: add frag-face shader 2010-09-18 09:15:14 +01:00
Vinson Lee
cef42f925c r600g: Remove unused variable. 2010-09-18 00:59:16 -07:00
Vinson Lee
b1a5c63467 nvfx: Silence uninitialized variable warnings. 2010-09-18 00:51:07 -07:00
Vinson Lee
013e4cca9f nvfx: Remove const qualifer from nvfx_vertprog_translate.
Silences this GCC warning.
nvfx_vertprog.c: In function 'nvfx_vertprog_translate':
nvfx_vertprog.c:998: warning: assignment discards qualifiers from pointer target type
2010-09-18 00:47:36 -07:00
Keith Whitwell
5b4c43d985 llvmpipe: use llvm for attribute interpolant calculation
Basically no change relative to hard-coded version, but this will
be useful for other changes later.
2010-09-18 08:40:17 +01:00
Tilman Sauerbeck
3894fddccc glsl2: Fixed cloning of ir_call error instructions.
Those have the callee field set to the null pointer, so
calling the public constructor will segfault.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-18 09:19:57 +02:00
Vinson Lee
a822ae3f1a glsl: Fix 'control reaches end of non-void function' warning.
Fixes this GCC warning.

lower_variable_index_to_cond_assign.cpp:
In member function
'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const':

lower_variable_index_to_cond_assign.cpp:261:
warning: control reaches end of non-void function
2010-09-18 00:14:20 -07:00
Vinson Lee
9ea2a3af9c x86: Silence unused variable warning on Mac OS X.
Silences the following GCC warning on Mac OS X.
x86/common_x86.c:58: warning: 'detection_debug' defined but not used
2010-09-17 23:59:23 -07:00
Vinson Lee
c32bac57ed mesa: Silence "'valid_texture_object' defined but not used" warning. 2010-09-17 23:43:38 -07:00
Vinson Lee
ff78d6dcc0 ir_to_mesa: Remove unused member array_indexed from struct statevar_element.
Fixes this GCC warning.
warning: missing initializer for member 'statevar_element::array_indexed'
2010-09-17 23:35:09 -07:00
Vinson Lee
3c9653c3a0 mesa: bump version to 7.10 2010-09-17 17:52:13 -07:00
Brian Paul
f964f92bcc gallium/docs: added new pipeline.txt diagram
This diagram shows the rendering pipeline with an emphasis on
the inputs/outputs for each stage.  Some stages emit new vertex
attributes and others consume some attributes.
2010-09-17 18:50:47 -06:00
Brian Paul
e22e3927b0 gallium: rework handling of sprite_coord_enable state
Implement the pipe_rasterizer_state::sprite_coord_enable field
in the draw module (and softpipe) according to what's specified
in the documentation.

The draw module can now add any number of extra vertex attributes
to a post-transformed vertex and generate texcoords for those
attributes per sprite_coord_enable.  Auto-generated texcoords
for sprites only worked for one texcoord unit before.

The frag shader gl_PointCoord input is now implemented like any
other generic/texcoord attribute.

The draw module now needs to be informed about fragment shaders
since we need to look at the fragment shader's inputs to know
which ones need auto-generated texcoords.

Only softpipe has been updated so far.
2010-09-17 18:45:13 -06:00
Brian Paul
49cb978aa4 gallium: better docs for pipe_rasterizer_state::sprite_coord_enable 2010-09-17 18:41:05 -06:00
Tilman Sauerbeck
19f8f32a96 glsl2: Empty functions can be inlined.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-18 01:28:47 +02:00
Vinson Lee
da3db66c08 r600g: Silence unused variable warnings.
The variables are used in code that is currently ifdef'ed out.
2010-09-17 14:27:39 -07:00
Vinson Lee
d74a8da2cb r600g: Silence uninitialized variable warning. 2010-09-17 14:21:32 -07:00
Vinson Lee
2da4694955 r600g: Fix memory leak on error path. 2010-09-17 14:17:26 -07:00
Vinson Lee
d56e46577e r600g: Fix implicit declaration warning.
Fixes this GCC warning.
r600_state2.c: In function 'r600_context_flush':
r600_state2.c:946: error: implicit declaration of function 'drmCommandWriteRead'
2010-09-17 14:06:23 -07:00
Vinson Lee
36033a6446 r600g: Remove unnecessary headers. 2010-09-17 12:40:54 -07:00
Vinson Lee
694b1883ee r600g: Remove unnecessary header. 2010-09-17 12:38:29 -07:00
José Fonseca
65822eba94 llvmpipe: Default to no threading on single processor systems. 2010-09-17 19:18:43 +01:00
José Fonseca
903a66abaf util: linearized sRGB values don't fit into 8bits
Fixes glean texture_srgb test.
2010-09-17 19:18:42 +01:00
Brian Paul
c70d539e24 gallivm: added missing case for PIPE_TEXTURE_RECT
Fixes fd.o bug 30245
2010-09-17 12:16:45 -06:00
Jerome Glisse
fd266ec62c r600g: alternative command stream building from context
Winsys context build a list of register block a register block is
a set of consecutive register that will be emited together in the
same pm4 packet (the various r600_block* are there to provide basic
grouping that try to take advantage of states that are linked together)
Some consecutive register are emited each in a different block,
for instance the various cb[0-7]_base. At winsys context creation,
the list of block is created & an index into the list of block. So
to find into which block a register is in you simply use the register
offset and lookup the block index. Block are grouped together into
group which are the various pkt3 group of config, context, resource,

Pipe state build a list of register each state want to modify,
beside register value it also give a register mask so only subpart
of a register can be updated by a given pipe state (the oring is
in the winsys) There is no prebuild register list or define for
each pipe state. Once pipe state are built they are bound to
the winsys context.

Each of this functions will go through the list of register and
will find into which block each reg falls and will update the
value of the block with proper masking (vs/ps resource/constant
are specialized variant with somewhat limited capabilities).

Each block modified by r600_context_pipe_state_set* is marked as
dirty and we update a count of dwords needed to emit all dirty
state so far.

r600_context_pipe_state_set* should be call only when pipe context
change some of the state (thus when pipe bind state or set state)

Then to draw primitive you make a call to r600_context_draw
void r600_context_draw(struct r600_context *ctx, struct r600_draw *draw)
It will check if there is enough dwords in current cs buffer and
if not will flush. Once there is enough room it will copy packet
from dirty block and then add the draw packet3 to initiate the draw.

The flush will send the current cs, reset the count of dwords to
0 and remark all states that are enabled as dirty and recompute
the number of dwords needed to send the current context.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-17 10:49:05 -04:00
Tilman Sauerbeck
d80bed1566 r600g: Fixed the shift in S_02880C_KILL_ENABLE.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 14:08:54 +02:00
Tilman Sauerbeck
54d688f148 r600g: Enable PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:49:51 +02:00
Tilman Sauerbeck
70a85c39a9 r600g: Only set PA_SC_EDGERULE on rv770 and greater.
This is what xf86-video-ati and r600c do.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:17:48 +02:00
Tilman Sauerbeck
5f97d0a218 r600g: Added DB_SHADER_CONTROL defines.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:06:07 +02:00
Tilman Sauerbeck
5edb778c1b r600g: Formatting fixes.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-17 12:06:07 +02:00
Ian Romanick
a6ecd1c372 glsl2: Add flags to enable variable index lowering 2010-09-17 11:00:24 +02:00
Ian Romanick
6e4fe39da2 glsl2: Refactor testing for whether a deref is of a matrix or array 2010-09-17 11:00:24 +02:00
Luca Barbieri
a47539c7a1 glsl: add pass to lower variable array indexing to conditional assignments
Currenly GLSL happily generates indirect addressing of any kind of
arrays.

Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in
general.

This pass fixes that by lowering such constructs to a binary search on the
values, followed at the end by vectorized generation of equality masks, and
4 conditional assignments for each mask generation.

Note that this requires the ir_binop_equal change so that we can emit SEQ
to generate the boolean masks.

Unfortunately, ir_structure_splitting is too dumb to turn the resulting
constant array references to individual variables, so this will need to
be added too before this pass can actually be effective for temps.

Several patches in the glsl2-lower-variable-indexing were squashed
into this commit.  These patches fix bugs in Luca's original
implementation, and the individual patches can be seen in that branch.
This was done to aid bisecting in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-17 10:58:58 +02:00
Dave Airlie
dab2a7660a r600g: oops got the use_mem_constant the wrong way around.
this fixes evergreen gears again.
2010-09-18 00:28:06 +10:00
Dave Airlie
d0502297e0 r600g: use calloc for ctx bo allocations
since the reference code relies on these being NULL.
2010-09-17 15:29:32 +10:00
Dave Airlie
3ddc714b20 r600g: fixup map flushing.
long lived maps were getting removed when they shouldn't this
tries to avoid that problem by only adding to the flush list
on unmap.
2010-09-17 15:29:32 +10:00
Dave Airlie
0d76bb5d4c r600g: add upload manager support.
this add support for the upload manager for uploading user vbo/index buffers.

this provides a considerable speedup in q3 type games.
2010-09-17 15:29:31 +10:00
Dave Airlie
a927d0477a r600g: add winsys bo caching.
this adds the bo caching layer and uses it for vertex/index/constant bos.

ctx needs to take references on hw bos so the flushing works okay, also
needs to flush the maps.
2010-09-17 15:29:31 +10:00
Dave Airlie
da96313afe r600g: add support for kernel bo
this moves to using a pb bufmgr instead of kernel bos directly.
2010-09-17 15:29:31 +10:00
Dave Airlie
189a597513 r600g: use malloc bufmgr for constant buffers 2010-09-17 15:29:31 +10:00
Dave Airlie
7c1fcc41be r600g: move constant buffer creation behind winsys abstraction.
this paves the way for moving to pb bufmgrs now.
2010-09-17 15:29:31 +10:00
Chia-I Wu
0dbcf3b014 libgl-xlib: Remove unused st_api_create_OpenGL.
st/egl no longer relies on libGL for OpenGL support.
2010-09-17 12:54:26 +08:00
Chia-I Wu
cadc4ad963 targets/egl: Use C++ compiler to link GL/ES state trackers.
Otherwise, applications compiled with C compiler might have trouble
using them.
2010-09-17 12:54:03 +08:00
Francisco Jerez
82c4af33b0 dri/nv10: Fix the CLAMP texture wrap mode. 2010-09-17 05:34:32 +02:00
Brian Paul
4b27c614cf tgsi/sse: fix aos_to_soa() loop to handle num_inputs==0
Basically, change the loop from:
  do {...} while (--num_inputs != 0)
into:
  while (num_inputs != 0) { ... --num_inputs; }

Fixes fd.o bug 29987.
2010-09-16 19:05:09 -06:00
Dave Airlie
f70f79f6f6 r600g: attempt to abstract kernel bos from pipe driver.
introduce an abstraction layer between kernel bos and the winsys BOs.

this is to allow plugging in pb manager with minimal disruption to pipe driver.
2010-09-17 10:57:49 +10:00
Dave Airlie
ec9d838aa5 r600g: hide radeon_ctx inside winsys.
no need for this info to be exported to pipe driver.
2010-09-17 10:57:44 +10:00
Vinson Lee
b54d10b62e gallivm: Remove unnecessary header. 2010-09-16 15:34:24 -07:00
Brian Paul
7aadd5ecb5 gallivm: fix wrong return value in bitwise functions 2010-09-16 20:20:49 +01:00
José Fonseca
6d173da5c8 gallivm: Clamp indirect register indices to file_max.
Prevents crashes with bogus data, or bad shader translation.
2010-09-16 20:20:49 +01:00
José Fonseca
795eb3d64a gallivm: Start collecting bitwise arithmetic helpers in a new module. 2010-09-16 20:20:49 +01:00
José Fonseca
3d5b9c1f2d gallivm: Fix address register swizzle.
We're actually doing a double swizzling:

  indirect_reg->Swizzle[indirect_reg->SwizzleX]

instead of simply

  indirect_reg->SwizzleX
2010-09-16 20:20:49 +01:00
Francisco Jerez
50ac56bf98 meta: Don't bind the created texture object in init_temp_texture().
This function is executed outside _mesa_meta_begin/end(), that means
that e.g. _mesa_meta_Bitmap() clobbers the texturing state because it
changes the currently active texture object.

There's no need to bind the new texture when it's created, it's done
again later anyway (from setup_drawpix/copypix_texture()).

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-16 13:00:57 -06:00
Brian Paul
3a6f9d0f47 mesa: include mfeatures.h in formats.c
Otherwise, FEATURE_EXT_texture_sRGB was undefined.
This is (part of?) the fix for fd.o bug 30177.
2010-09-16 12:41:51 -06:00
Marek Olšák
d4b2de13bc r300g/swtcl: fix CS overrun
https://bugs.freedesktop.org/show_bug.cgi?id=29901
2010-09-16 20:33:43 +02:00
Francisco Jerez
db94a2a5be dri/nouveau: Cleanup references to the old FBOs on glMakeCurrent(). 2010-09-16 19:44:22 +02:00
Francisco Jerez
d4d81ed02e dri/nouveau: Don't reemit the BO state in nouveau_state_emit(). 2010-09-16 19:44:22 +02:00
Francisco Jerez
bfc7518ab9 dri/nouveau: Don't request a fake front unnecessarily. 2010-09-16 19:44:22 +02:00
Francisco Jerez
39658f32ea dri/nouveau: Fix glRenderbufferStorage with DEPTH_COMPONENT as internal format. 2010-09-16 19:44:22 +02:00
Francisco Jerez
cbe0dd0f5a dri/nouveau: Add some more extensions. 2010-09-16 19:44:22 +02:00
Francisco Jerez
aad06c8524 dri/nouveau: Update nouveau_class.h. 2010-09-16 19:44:21 +02:00
Francisco Jerez
8f1051dca2 dri/nv04: Fix provoking vertex. 2010-09-16 19:44:21 +02:00
Francisco Jerez
286d8f2877 dri/nv04: Fix maximum texture size. 2010-09-16 19:44:21 +02:00
Francisco Jerez
7b06fdbd33 dri/nv04: Fix up color mask. 2010-09-16 19:44:21 +02:00
Francisco Jerez
0a6cfa1668 dri/nv04: Align SIFM transfer dimensions. 2010-09-16 19:44:21 +02:00
Francisco Jerez
bec626ff63 dri/nv04: Mipmapping fixes. 2010-09-16 19:44:21 +02:00
Francisco Jerez
aa317a40ce dri/nv04: Fix PGRAPH_ERRORs when running OA. 2010-09-16 19:44:21 +02:00
Andrew Randrianasulu
c344f27539 dri/nv04: Enable eng3dm for A8/L8 textures.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-09-16 19:44:20 +02:00
Andrew Randrianasulu
a27bfb991c dri/nv04: Don't expose ARB_texture_env_combine/dot3.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-09-16 19:44:20 +02:00
Keith Whitwell
0986355425 llvmpipe: add DEBUG_FS to dump variant information 2010-09-16 17:34:58 +01:00
Keith Whitwell
5f00819cb3 llvmpipe: add LP_PERF flag to disable various aspects of rasterization
Allows disabling various operations (mainly texture-related, but
will grow) to try & identify bottlenecks.

Unlike LP_DEBUG, this is active even in release builds - which is
necessary for performance investigation.
2010-09-16 17:34:19 +01:00
Keith Whitwell
045ee46011 gallivm: make lp_build_sample_nop public 2010-09-16 17:04:01 +01:00
Brian Paul
7640151c3d gallivm: move i32_vec_type inside the #ifdef 2010-09-16 09:00:54 -06:00
Brian Paul
3c9f4c7b75 gallivm: fix incorrect vector shuffle datatype
The permutation vector must always be a vector of int32 values.
2010-09-16 08:56:34 -06:00
Christoph Bumiller
3a62365f40 nv50: get shader fixups/relocations into working state 2010-09-16 14:49:23 +02:00
Christoph Bumiller
e0aa7e0438 nv50: don't segfault on shaders with 0 instructions 2010-09-16 14:49:20 +02:00
Kenneth Graunke
8fbe968a62 glsl: Don't print blank (function ...) headers for built-ins.
Fixes a regression caused when I added my GLSL ES support.
2010-09-16 03:09:25 -07:00
Kenneth Graunke
81f0339398 glsl: Change from has_builtin_signature to has_user_signature.
The print visitor needs this, and the only existing user can work with
has_user_signature just as well.
2010-09-16 02:52:25 -07:00
Tilman Sauerbeck
df62338c49 r600g: Use clamped math for RCP and RSQ.
This is likely only correct for OpenGL and not other state trackers.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-16 11:08:00 +02:00
Tilman Sauerbeck
2108caac25 r600g: Fixed a bo leak in r600_blit_state_ps_shader().
We would leak the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-16 11:07:32 +02:00
Chia-I Wu
03224f492d st/xlib: Notify the context when the front/back buffers are swapped.
The current context should be notified when the the front/back buffers
of the current drawable are swapped.  The notification was skipped when
xmesa_strict_invalidate is false (the default).

This fixes fdo bug #29774.
2010-09-16 13:09:48 +08:00
Chia-I Wu
9ca59b2427 mesa: Update ES APIspec.xml.
Enable some extensions now that the needed tokens are defined in
GLES/glext.h and GLES2/glext.h.  Update the prototype of MultiDrawArrays
now that the prototype of _mesa_MultiDrawArraysEXT has been updated.
2010-09-16 13:09:01 +08:00
Dave Airlie
ef2808f56f r600g: fix texture bos and avoid doing depth blit on evergreen
since the depth blit code is hardcoded hex yay \o/
2010-09-16 21:48:02 +10:00
Dave Airlie
9a589961a2 r600g: fixup texture state on evergreen.
This whole set of state just seems wrong, another cut-n-paste nightmare.
2010-09-16 21:29:08 +10:00
Vinson Lee
9f7f7b3ff8 mesa/st: Silence uninitialized variable warning. 2010-09-15 18:47:17 -07:00
Vinson Lee
0d2561a562 nv50: Fix 'control reaches end of non-void function' warning. 2010-09-15 18:26:06 -07:00
Vinson Lee
b09af4c391 nv50: Silence uninitialized variable warnings. 2010-09-15 18:24:28 -07:00
Vinson Lee
00118c4077 draw: Remove unnecessary header. 2010-09-15 18:17:51 -07:00
Vinson Lee
d94c7841b2 gallivm: Remove unnecessary headers. 2010-09-15 18:14:18 -07:00
Vinson Lee
84e41b738b nv50: Silence uninitialized variable warning. 2010-09-15 17:27:50 -07:00
Vinson Lee
b533bb7d86 nv50: Silence uninitialized variable warning. 2010-09-15 17:24:50 -07:00
Vinson Lee
cbc6748795 nv50: Silence uninitialized variable warning. 2010-09-15 17:09:59 -07:00
Vinson Lee
4d4278675e nv50: Remove unnecessary headers. 2010-09-15 16:51:39 -07:00
Vinson Lee
a64e3d2e6c nv50: Update files in SConscript to match Makefile. 2010-09-15 16:46:04 -07:00
Dave Airlie
1a20aae581 r600g: add vgt dma src defines 2010-09-16 09:41:43 +10:00
Dave Airlie
3ead528bbb r600g: use index min/max + index buffer offset.
more prep work for fixing up buffer handling
2010-09-16 09:40:42 +10:00
Dave Airlie
05433f20b6 r600g: pull r600_draw struct out into header
we need this for future buffer rework, it also makes the vtbl easier
2010-09-16 09:40:42 +10:00
Brian Paul
0a7824862e gallivm: expand AoS sampling to cover all filtering modes
...and all texture targets (1D/2D/3D/CUBE).
2010-09-15 17:04:31 -06:00
Brian Paul
95254bbd2d tgsi: fix incorrect usage_mask for shadow tex instructions
The shadow versions of the texture targets use an extra component
(Z) to express distance from light source to the fragment.
Fixes the shadowtex demo with llvmpipe.
2010-09-15 13:56:02 -06:00
Brian Paul
68cfc8e996 nv50: use unsigned int for bitfields to silence warnings 2010-09-15 12:51:09 -06:00
Brian Paul
3085efabb1 llvmpipe: s/boolean/unsigned/ in bitfield to silence warning
Using non-int types for bitfields is a gcc extension.
The size of the struct is not effected by this change.
2010-09-15 12:49:13 -06:00
Brian Paul
29289b43b7 llvmpipe: cast to silence warning 2010-09-15 12:48:29 -06:00
Brian Paul
7545514fb6 glsl2: fix signed/unsigned comparison warning 2010-09-15 12:47:32 -06:00
John Doe
e0b6df4fcc r600g: misc cleanup
Avoid using r600_screen structure to get ptr to radeon
winsys structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-15 11:48:34 -04:00
Christoph Bumiller
26fe16a99b Merge remote branch 'origin/nv50-compiler'
Conflicts:
	src/gallium/drivers/nouveau/nouveau_class.h
	src/gallium/drivers/nv50/nv50_screen.c
2010-09-15 17:34:40 +02:00
Keith Whitwell
59ca1ae84b llvmpipe: return zero from floor_pot(zero) 2010-09-15 16:28:49 +01:00
Christoph Bumiller
84d170bbce nv50: put low limit on REG_ALLOC_TEMP and FP_RESULT_COUNT 2010-09-15 15:35:14 +02:00
Christoph Bumiller
c46e7a05e5 nv50: improve and fix modifier folding optimization
Execute before folding loads, because we don't check if it's legal
in lower_mods.
Ensure that a value's insn pointer is updated when transferring it
to a different instruction.
2010-09-15 15:35:14 +02:00
Christoph Bumiller
16d8f5fee5 nv50: consider address register in reload elimination 2010-09-15 15:35:14 +02:00
Keith Whitwell
be2fb11f10 llvmpipe: remove duplicate code
Bad rebase presumably.
2010-09-15 14:30:01 +01:00
Keith Whitwell
cc2ed02c0a llvmpipe: brackets around macro arg 2010-09-15 14:30:01 +01:00
Chia-I Wu
e3c46cf586 glapi: Fix ES build errors again.
This fixes an error in GLAPI ES.  My build is ok with or without this
patch, and the error affects others' setups.

[Patch from Francesco Marella]
2010-09-15 21:19:44 +08:00
Vinson Lee
efab1c8642 r600g: Silence unused variable warning.
The code that uses dname is currently ifdef'ed out.
2010-09-15 06:14:02 -07:00
Vinson Lee
1ce4f86803 r600g: Silence uninitialized variable warning. 2010-09-15 06:09:28 -07:00
Vinson Lee
a712e193a3 r600g: Silence uninitialized variable warning. 2010-09-15 05:52:16 -07:00
Vinson Lee
76c0576101 r600g: Silence uninitialized variable warning. 2010-09-15 05:46:34 -07:00
Vinson Lee
66a146dd05 nvfx: Silence uninitialized variable warnings. 2010-09-15 05:43:50 -07:00
Vinson Lee
9aee4be5e0 r600g: Silence uninitialized variable warning. 2010-09-15 05:34:29 -07:00
Vinson Lee
7290c5982c r600g: Silence uninitialized variable warning. 2010-09-15 05:31:31 -07:00
Vinson Lee
f20f2cc330 glsl: Fix 'format not a string literal and no format arguments' warning.
Fix the following GCC warning.
loop_controls.cpp: In function 'int calculate_iterations(ir_rvalue*, ir_rvalue*, ir_rvalue*, ir_expression_operation)':
loop_controls.cpp:88: warning: format not a string literal and no format arguments
2010-09-15 05:17:57 -07:00
Dave Airlie
09ef8e9283 r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb

test run glxgears, resize.
2010-09-15 13:26:04 +02:00
Chia-I Wu
cad87ebc3a glapi: Fix build errors for ES.
The latest glext.h defines GL_FIXED.  Test GL_OES_fixed_point instead to
decide whether to define GLfixed and GLclampx.

This fixes fdo bug #30205.
2010-09-15 17:45:26 +08:00
Andre Maasikas
84f7b5d974 r600c: fix buffer height setting in dri2 case
fbHeight is 0 in this case

uncovered by changes in b0bc026c and should fix kernel rejecting command
streams after that commit
2010-09-15 11:32:18 +03:00
Marek Olšák
0b9eb5c9bb 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.
2010-09-15 04:29:18 +02:00
Vinson Lee
fd7f70af48 mesa: Include missing header in program.h.
Include compiler.h for ASSERT symbol.
2010-09-14 17:54:46 -07:00
Vinson Lee
6a8a506158 r600g: Remove unnecessary headers. 2010-09-14 17:42:47 -07:00
Luca Barbieri
ccb5e65bc9 auxiliary: fix unintended fallthrough 2010-09-14 21:45:01 +02:00
Vinson Lee
cdf74a1ab9 llvmpipe: Remove unnecessary header. 2010-09-14 14:23:17 -07:00
Brian Paul
4cd751bcc4 glx: add const qualifiers to __indirect_glMultiDrawArraysEXT() 2010-09-14 11:01:03 -06:00
Christoph Bumiller
60f34e9f60 nv50: fix TXP depth comparison value 2010-09-13 17:26:41 +02:00
Christoph Bumiller
0b8170103c nv50: fix indirect CONST access with large or negative offsets 2010-09-13 17:26:41 +02:00
Christoph Bumiller
3b3c20744f nv50: MOV TEMP[0], -CONST[0] must be float32 negation 2010-09-13 17:26:41 +02:00
Christoph Bumiller
1f1411f2cc nv50: interp cannot write flags reg 2010-09-13 17:26:41 +02:00
Christoph Bumiller
cca3906a9b nv50: check for immediates when turning MUL ADD into MAD 2010-09-13 17:26:41 +02:00
Christoph Bumiller
98c87c382d nv50: handle TGSI EXP and LOG again 2010-09-13 17:26:41 +02:00
Christoph Bumiller
1fa812d84a nv50: match TEMP limit with nv50 ir builder
Mesa doesn't respect it anyway, but this makes it assert rather
than threads access areas of l[] that don't belong to them.
2010-09-12 11:41:57 +02:00
Christoph Bumiller
fdb00ac1ef nv50: newlines in shader bincode printing 2010-09-12 11:41:57 +02:00
Christoph Bumiller
d4fd11a628 nv50: cannot move from local mem to output reg directly 2010-09-12 11:41:57 +02:00
Xavier Chantry
9b39fb1b61 nv50: fix size of outputs_written array 2010-09-12 00:59:50 +02:00
Christoph Bumiller
fc31a25afa nv50: minor compiler fixes and cleanups 2010-09-12 00:59:49 +02:00
Christoph Bumiller
7a4a537be1 nv50: reduce bb_reachable_by runtime from pot to linear
As a by-product, remove the memory leak of nv_basic_blocks.
2010-09-12 00:59:49 +02:00
Christoph Bumiller
6997da9f3c nv50: fix can_load check for 3rd source 2010-09-09 19:21:35 +02:00
Christoph Bumiller
6b14a3eb19 nv50: address regs are 16 bit 2010-09-09 19:21:34 +02:00
Christoph Bumiller
246ebd7df1 nv50: duplicate interps in load_proj_tex_coords
Otherwise we might clobber the origin interpolation result or
use the result of the RCP before its definition.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
9cc80e25db nv50: create value references with the right type
Since atm our OPs aren't typed but instead values are, we need to
take care if they're used as different types (e.g. a load makes a
value u32 by default).

Maybe this should be changed (also to match TGSI), but it should
work as well if done properly.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
f30810cb68 nv50: use actual loads/stores if TEMPs are accessed indirectly 2010-09-09 19:21:34 +02:00
Christoph Bumiller
d8dcff7970 nv50: don't parse again in tgsi_2_nc 2010-09-09 19:21:34 +02:00
Christoph Bumiller
d91b8865ec nv50: prepare for having multiple functions
At some point we'll want to support real subroutines instead of
just inlining them into the main shader.

Since recursive calls are forbidden, we can just save all used
registers to a fixed local memory region and restore them on a
return, no need for a stack pointer.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
217542a061 nv50: save tgsi instructions 2010-09-09 19:21:34 +02:00
Christoph Bumiller
9e4901402c nv50: load address register before using it, not after 2010-09-03 14:27:23 +02:00
Christoph Bumiller
222d2f2ac2 Merge remote branch 'origin/master' into nv50-compiler
Conflicts:
	src/gallium/drivers/nv50/nv50_program.c
2010-09-02 18:31:49 +02:00
Christoph Bumiller
443abc80db nv50: fix build-predicate function 2010-09-02 18:28:47 +02:00
Christoph Bumiller
9f9ae4eee1 nv50: fix find_dom_frontier 2010-09-02 18:28:39 +02:00
Christoph Bumiller
a79da61a4b nv50: fix XPD, was negated 2010-09-01 18:02:51 +02:00
Christoph Bumiller
8e6ba3c8cc nv50: must join SELECT inputs before MOV inputs 2010-09-01 18:02:50 +02:00
Christoph Bumiller
e08f70a41d nv50: make use of TGSI immediate type 2010-09-01 18:02:50 +02:00
Christoph Bumiller
6f9978050e nv50: re-add proper TEXBIAS sequence 2010-09-01 18:02:50 +02:00
Christoph Bumiller
07fe7c2f02 nv50: make FrontFacing -1 or +1 2010-09-01 18:02:50 +02:00
Christoph Bumiller
917c79b384 nv50: SSG 2010-09-01 18:02:50 +02:00
Ben Skeggs
e02c63bc10 nv50: DPH 2010-09-01 18:02:50 +02:00
Ben Skeggs
7145ab214f nv50: DST 2010-09-01 18:02:50 +02:00
Christoph Bumiller
0a8292e096 nv50: attempt at making more complicated loops work
Nested loops, and loops with multiple exits (BREAK, CONT).
2010-09-01 18:02:50 +02:00
Christoph Bumiller
d90502b2b4 nv50: turn off verbose debug output by default 2010-09-01 18:02:50 +02:00
Christoph Bumiller
3844c36594 nv50: set the FragDepth output index 2010-09-01 18:02:50 +02:00
Christoph Bumiller
db1874272c nv50: handle TEXTURE_SWIZZLE and GEOMETRY_SHADER4 caps
GP support will probably be re-added soon.
2010-09-01 18:02:50 +02:00
Christoph Bumiller
bae181f78d nv50: fix check for sprite/point coord enable 2010-08-23 14:25:57 +02:00
Christoph Bumiller
0df5e84b01 nv50: yet another case we need a nop.exit 2010-08-23 14:25:53 +02:00
Christoph Bumiller
33f45c5a8a nv50: DP2, fix ARL 2010-08-23 14:25:51 +02:00
Christoph Bumiller
3e54d63429 Merge remote branch 'origin/master' into nv50-compiler 2010-08-18 14:37:47 +02:00
Christoph Bumiller
eaab764578 nv50: emit predicate for interp 2010-08-18 14:37:10 +02:00
Christoph Bumiller
1bbbc8e0c8 nv50: initialize edgeflag input index 2010-08-17 19:03:48 +02:00
Christoph Bumiller
3e27785f3e nv50: check dst compatibility in CSE 2010-08-17 15:30:35 +02:00
Christoph Bumiller
cb75082768 nv50: fix PSIZ and PRIMID mapping
Initializing map to 0x40 (0x80) instead of 0 now, so need to clear
it first.
2010-08-17 13:08:59 +02:00
Christoph Bumiller
ce1629564d nv50: more TGSI opcodes (SIN, SCS, ARL, RET, KILP) 2010-08-17 13:08:52 +02:00
Christoph Bumiller
62f933a6f6 nv50: generate JOINs for outermost IF clauses 2010-08-17 00:47:47 +02:00
Christoph Bumiller
6c5c55723d nv50: fix thinko in store to output reg possible check 2010-08-17 00:47:47 +02:00
Christoph Bumiller
e7a0bfa69a nv50: flatten simple IF/ELSE/ENDIF constructs
Less branching means less instructions and less thread divergence.
2010-08-17 00:47:46 +02:00
Christoph Bumiller
4de293bb9a nv50: loops part 2
At least the mesa demo glsl/mandelbrot should work now.
2010-08-15 21:40:00 +02:00
Christoph Bumiller
34e0db4c50 nv50: more constant folding 2010-08-15 21:39:57 +02:00
Christoph Bumiller
3a68fcfb6b nv50: begin implementing loops 2010-08-10 17:36:25 +02:00
Christoph Bumiller
fc1d72d15d nv50: fix reg count 2010-08-10 17:35:26 +02:00
Christoph Bumiller
aaa8802a22 nv50: build proper phi functions in the first place 2010-08-05 00:50:00 +02:00
Christoph Bumiller
720e0c430d nv50: fix constbuf validation
We only uploaded up to the highest offset a program would use,
and if the constant buffer isn't changed when a new program is
used, the new program is missing the rest of them.

Might want to introduce a "fill state" for user mem constbufs.
2010-08-05 00:50:00 +02:00
Christoph Bumiller
2c695d38e6 nv50: don't eliminate loads to dedicated values 2010-08-05 00:50:00 +02:00
Christoph Bumiller
fa67cabe7a nv50: fixes for nested IFs 2010-07-31 18:32:35 +02:00
Christoph Bumiller
5705b45b6a nv50: explicitly set src type for SET ops
Need to do this more nicely for all ops.
2010-07-31 18:32:35 +02:00
Christoph Bumiller
5de5e4fd5c nv50: insert MOVs also for PHI sources from dominating block
Otherwise we get live range conflicts for operands that are written
only in e.g. an ELSE block but not the IF block.
2010-07-31 18:32:35 +02:00
Christoph Bumiller
582311ca97 nv50: fix for empty BBs 2010-07-31 18:32:34 +02:00
Christoph Bumiller
28ded2585c nv50: add signed RGTC1 to format table, allow 2_10_10_10 for vbufs 2010-07-31 18:32:34 +02:00
Christoph Bumiller
7d34e79e44 nv50: add missing 2nd source for POW multiplication 2010-07-26 11:21:05 +02:00
Christoph Bumiller
e1ad3bd2f2 nv50: permit usage of undefined TGSI TEMPs 2010-07-26 11:20:52 +02:00
Christoph Bumiller
a3ba99b303 nv50: fix constant_operand opt mul by 2 case 2010-07-26 11:20:39 +02:00
Christoph Bumiller
5811c69264 nv50: simple reload elimination and local CSE 2010-07-26 11:20:28 +02:00
Christoph Bumiller
bb9d634730 nv50: add/fix some license headers 2010-07-24 22:16:40 +02:00
Christoph Bumiller
4baaf1d4c3 nv50: change back accidentally swapped UNORM,SNORM vertex type 2010-07-24 21:20:46 +02:00
Christoph Bumiller
1d1bb20612 nv50: don't produce MOV immediate to output reg in store opt 2010-07-24 21:20:40 +02:00
Christoph Bumiller
d7aac107e6 nv50: introduce the big formats table 2010-07-24 14:48:19 +02:00
Christoph Bumiller
f3af1201c5 nouveau: update nouveau_class.h
Adds nvc0, new vertex formats, and dual source blending values.
2010-07-24 14:48:15 +02:00
Christoph Bumiller
633f5ac612 nv50: import new compiler 2010-07-23 21:35:00 +02:00
2089 changed files with 166163 additions and 102447 deletions

View File

@@ -180,7 +180,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.9-devel
VERSION=7.10.3
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -197,6 +197,9 @@ MAIN_FILES = \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/install-sh \
@@ -209,7 +212,6 @@ MAIN_FILES = \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
@@ -224,6 +226,7 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
@@ -233,7 +236,9 @@ MAIN_FILES = \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
@@ -259,6 +264,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
$(DIRECTORY)/src/mesa/vf/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/Makefile \
$(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
@@ -271,6 +277,9 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/SConscript \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
@@ -307,9 +316,9 @@ MAPI_FILES = \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in \
$(DIRECTORY)/src/mapi/vgapi/*.h
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
@@ -320,6 +329,7 @@ EGL_FILES = \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
@@ -329,6 +339,8 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
@@ -342,25 +354,34 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch] \
$(DIRECTORY)/src/glx/apple/*.tcl \
$(DIRECTORY)/src/glx/apple/apple_exports.list \
$(DIRECTORY)/src/glx/apple/GL_aliases \
$(DIRECTORY)/src/glx/apple/GL_extensions \
$(DIRECTORY)/src/glx/apple/GL_noop \
$(DIRECTORY)/src/glx/apple/GL_promoted \
$(DIRECTORY)/src/glx/apple/specs/*.spec \
$(DIRECTORY)/src/glx/apple/specs/*.tm
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
@@ -396,6 +417,7 @@ GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \

View File

@@ -3,14 +3,14 @@
#
# For example, invoke scons as
#
# scons debug=1 dri=0 machine=x86
# scons build=debug llvm=yes machine=x86
#
# to set configuration variables. Or you can write those options to a file
# named config.py:
#
# # config.py
# debug=1
# dri=0
# build='debug'
# llvm=True
# machine='x86'
#
# Invoke
@@ -30,55 +30,8 @@ import common
#######################################################################
# Configuration options
default_statetrackers = 'mesa'
default_targets = 'graw-null'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_drivers = 'softpipe,galahad,failover,svga,i915,i965,trace,identity,llvmpipe'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_drivers = 'softpipe,svga,i915,i965,trace,identity'
default_winsys = 'all'
elif common.default_platform in ('embedded',):
default_drivers = 'softpipe,llvmpipe'
default_winsys = 'xlib'
else:
default_drivers = 'all'
default_winsys = 'all'
opts = Variables('config.py')
common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg', 'egl']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'galahad', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'r600', 'identity', 'llvmpipe', 'nouveau', 'nv50', 'nvfx']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'vmware', 'i915', 'i965', 'gdi', 'radeon', 'r600', 'graw-xlib']))
opts.Add(ListVariable('targets', 'driver targets to build', default_targets,
['dri-i915',
'dri-i965',
'dri-nouveau',
'dri-radeong',
'dri-swrast',
'dri-vmwgfx',
'egl-i915',
'egl-i965',
'egl-nouveau',
'egl-radeon',
'egl-swrast',
'egl-vmwgfx',
'graw-xlib',
'graw-null',
'libgl-gdi',
'libgl-xlib',
'xorg-i915',
'xorg-i965',
'xorg-nouveau',
'xorg-radeon',
'xorg-vmwgfx']))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
env = Environment(
options = opts,
@@ -87,61 +40,26 @@ env = Environment(
ENV = os.environ,
)
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
except KeyError:
pass
else:
targets = targets.split(',')
print 'scons: warning: targets option is deprecated; pass the targets on their own such as'
print
print ' scons %s' % ' '.join(targets)
print
COMMAND_LINE_TARGETS.append(targets)
Help(opts.GenerateHelpText(env))
# replicate options values in local variables
debug = env['debug']
dri = env['dri']
machine = env['machine']
platform = env['platform']
# derived options
x86 = machine == 'x86'
ppc = machine == 'ppc'
gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded')
msvc = platform in ('windows', 'winddk')
Export([
'debug',
'x86',
'ppc',
'dri',
'platform',
'gcc',
'msvc',
])
#######################################################################
# Environment setup
# Always build trace, rbug, identity, softpipe, and llvmpipe (where possible)
if 'trace' not in env['drivers']:
env['drivers'].append('trace')
if 'rbug' not in env['drivers']:
env['drivers'].append('rbug')
if 'galahad' not in env['drivers']:
env['drivers'].append('galahad')
if 'identity' not in env['drivers']:
env['drivers'].append('identity')
if 'softpipe' not in env['drivers']:
env['drivers'].append('softpipe')
if env['llvm'] and 'llvmpipe' not in env['drivers']:
env['drivers'].append('llvmpipe')
if 'sw' not in env['drivers']:
env['drivers'].append('sw')
# Includes
env.Prepend(CPPPATH = [
'#/include',
@@ -157,7 +75,7 @@ if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# Embedded
if platform == 'embedded':
if env['platform'] == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
@@ -174,7 +92,7 @@ if platform == 'embedded':
])
# Posix
if platform in ('posix', 'linux', 'freebsd', 'darwin'):
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
@@ -184,9 +102,9 @@ if platform in ('posix', 'linux', 'freebsd', 'darwin'):
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if gcc:
if env['gcc']:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if platform == 'darwin':
if env['platform'] == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(LIBS = [
'm',
@@ -208,9 +126,7 @@ Export('env')
SConscript(
'src/SConscript',
variant_dir = env['build'],
variant_dir = env['build_dir'],
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env.Default('src')

View File

@@ -8,6 +8,8 @@ import subprocess
import sys
import platform as _platform
import SCons.Script.SConscript
#######################################################################
# Defaults
@@ -20,6 +22,15 @@ _platform_map = {
default_platform = sys.platform
default_platform = _platform_map.get(default_platform, default_platform)
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
if 'platform' in SCons.Script.ARGUMENTS:
selected_platform = SCons.Script.ARGUMENTS['platform']
else:
selected_platform = default_platform
cross_compiling = selected_platform != default_platform
_machine_map = {
'x86': 'x86',
'i386': 'x86',
@@ -37,38 +48,26 @@ if 'PROCESSOR_ARCHITECTURE' in os.environ:
else:
default_machine = _platform.machine()
default_machine = _machine_map.get(default_machine, 'generic')
default_toolchain = 'default'
if selected_platform == 'windows' and cross_compiling:
default_machine = 'x86'
default_toolchain = 'crossmingw'
# find default_llvm value
if 'LLVM' in os.environ:
default_llvm = 'yes'
else:
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
platform = default_platform
pattern = re.compile("(platform=)(.*)")
for arg in sys.argv:
m = pattern.match(arg)
if m:
platform = m.group(2)
default_llvm = 'no'
try:
if platform != 'windows' and subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
if selected_platform != 'windows' and \
subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
default_llvm = 'yes'
except:
pass
# find default_dri value
if default_platform in ('linux', 'freebsd'):
default_dri = 'yes'
elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
default_dri = 'no'
else:
default_dri = 'no'
#######################################################################
# Common options
@@ -81,13 +80,15 @@ def AddOptions(opts):
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
except ImportError:
from SCons.Options.EnumOption import EnumOption
opts.Add(BoolOption('debug', 'debug build', 'yes'))
opts.Add(BoolOption('profile', 'profile build', 'no'))
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
opts.Add('toolchain', 'compiler toolchain', 'default')
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -34,9 +34,6 @@ LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
TALLOC_LIBS = @TALLOC_LIBS@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
@@ -53,9 +50,13 @@ MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
# Python and flags (generally only needed by the developers)
PYTHON2 = python
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU

View File

@@ -31,21 +31,23 @@ CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
@@ -57,3 +59,5 @@ GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -9,8 +9,8 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=9
MESA_TINY=0
MESA_MINOR=10
MESA_TINY=3
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
@@ -37,6 +37,8 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
@@ -82,9 +84,6 @@ GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
TALLOC_LIBS = `pkg-config --libs talloc`
TALLOC_CFLAGS = `pkg-config --cflags talloc`
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -119,7 +118,7 @@ EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread $(TALLOC_LIBS)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm

View File

@@ -45,7 +45,7 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc $(LIBDRM_LIB)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
@@ -58,7 +58,7 @@ EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS = egl-swrast
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \

View File

@@ -15,7 +15,7 @@ ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DHAVE_UDIS86
# override -std=c99
CFLAGS += -std=gnu99 -D__STDC_CONSTANT_MACROS
CFLAGS += -std=gnu99
LLVM_VERSION := $(shell llvm-config --version)
@@ -30,7 +30,7 @@ else
endif
ifeq ($(MESA_LLVM),1)
# LLVM_CFLAGS=`llvm-config --cflags`
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
@@ -41,4 +41,4 @@ else
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc -lstdc++ -ludis86
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++ -ludis86

View File

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR([bin])
AC_CANONICAL_HOST
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.15
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.17
DRI2PROTO_REQUIRED=2.1
GLPROTO_REQUIRED=1.4.11
@@ -30,9 +30,20 @@ AC_PROG_CPP
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROGS([MAKE], [gmake make])
AC_CHECK_PROGS([PYTHON2], [python2 python])
AC_PATH_PROG([MKDEP], [makedepend])
AC_PATH_PROG([SED], [sed])
if test "x$MKDEP" = "x"; then
AC_MSG_ERROR([makedepend is required to build Mesa])
fi
AC_PATH_PROG([FLEX], [flex])
test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
AC_PATH_PROG([BISON], [bison])
test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
dnl Our fallback install-sh is a symlink to minstall. Use the existing
dnl configuration in that case.
AC_PROG_INSTALL
@@ -460,6 +471,71 @@ if test "x$enable_selinux" = "xyes"; then
DEFINES="$DEFINES -DMESA_SELINUX"
fi
dnl Determine which APIs to support
AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl],
[disable support for standard OpenGL API @<:@default=no@:>@])],
[enable_opengl="$enableval"],
[enable_opengl=yes])
AC_ARG_ENABLE([gles1],
[AS_HELP_STRING([--enable-gles1],
[enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
[enable_gles1="$enableval"],
[enable_gles1=no])
AC_ARG_ENABLE([gles2],
[AS_HELP_STRING([--enable-gles2],
[enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
[enable_gles2="$enableval"],
[enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[build separate OpenGL ES only libraries @<:@default=no@:>@])],
[enable_gles_overlay="$enableval"],
[enable_gles_overlay=no])
AC_ARG_ENABLE([openvg],
[AS_HELP_STRING([--enable-openvg],
[enable support for OpenVG API @<:@default=no@:>@])],
[enable_openvg="$enableval"],
[enable_openvg=no])
dnl smooth the transition; should be removed eventually
if test "x$enable_openvg" = xno; then
case "x$with_state_trackers" in
x*vega*)
AC_MSG_WARN([vega state tracker is enabled without --enable-openvg])
enable_openvg=yes
;;
esac
fi
if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \
"x$enable_gles_overlay" = xno -a \
"x$enable_openvg" = xno; then
AC_MSG_ERROR([at least one API should be enabled])
fi
API_DEFINES=""
GLES_OVERLAY=0
if test "x$enable_opengl" = xno; then
API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
else
API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
fi
if test "x$enable_gles1" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
fi
if test "x$enable_gles2" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
fi
if test "x$enable_gles_overlay" = xyes; then
GLES_OVERLAY=1
fi
AC_SUBST([API_DEFINES])
AC_SUBST([GLES_OVERLAY])
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
dnl More later: fbdev, ...
@@ -479,6 +555,10 @@ linux*)
;;
esac
if test "x$enable_opengl" = xno; then
default_driver="no"
fi
AC_ARG_WITH([driver],
[AS_HELP_STRING([--with-driver=DRIVER],
[driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
@@ -487,22 +567,23 @@ AC_ARG_WITH([driver],
dnl Check for valid option
case "x$mesa_driver" in
xxlib|xdri|xosmesa)
if test "x$enable_opengl" = xno; then
AC_MSG_ERROR([Driver '$mesa_driver' requires OpenGL enabled])
fi
;;
xno)
;;
*)
AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
;;
esac
PKG_CHECK_MODULES([TALLOC], [talloc])
AC_SUBST([TALLOC_LIBS])
AC_SUBST([TALLOC_CFLAGS])
dnl
dnl Driver specific build directories
dnl
dnl this variable will be prepended to SRC_DIRS and is not exported
CORE_DIRS="mapi/glapi glsl mesa"
CORE_DIRS=""
SRC_DIRS=""
GLU_DIRS="sgi"
@@ -512,6 +593,30 @@ GALLIUM_WINSYS_DIRS="sw"
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity"
GALLIUM_STATE_TRACKERS_DIRS=""
# build glapi if OpenGL is enabled
if test "x$enable_opengl" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/glapi"
fi
# build es1api and es2api if OpenGL ES is enabled
case "x$enable_gles1$enable_gles2$enable_gles_overlay" in
x*yes*)
CORE_DIRS="$CORE_DIRS mapi/es1api mapi/es2api"
;;
esac
# build vgapi if OpenVG is enabled
if test "x$enable_openvg" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/vgapi"
fi
# build glsl and mesa if OpenGL or OpenGL ES is enabled
case "x$enable_opengl$enable_gles1$enable_gles2$enable_gles_overlay" in
x*yes*)
CORE_DIRS="$CORE_DIRS glsl mesa"
;;
esac
case "$mesa_driver" in
xlib)
DRIVER_DIRS="x11"
@@ -526,6 +631,9 @@ dri)
osmesa)
DRIVER_DIRS="osmesa"
;;
no)
DRIVER_DRIS=""
;;
esac
AC_SUBST([SRC_DIRS])
AC_SUBST([GLU_DIRS])
@@ -608,8 +716,8 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $TALLOC_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $TALLOC_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
@@ -618,7 +726,7 @@ xlib)
GL_LIB_DEPS=""
fi
;;
dri)
dri|no) # these checks are still desired when there is no mesa_driver
# DRI must be shared, I think
if test "$enable_static" = yes; then
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
@@ -692,6 +800,11 @@ AC_SUBST([GLESv2_PC_LIB_PRIV])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
dnl
dnl More X11 setup
dnl
@@ -738,51 +851,6 @@ if test "x$with_dri_drivers" = x; then
with_dri_drivers=no
fi
dnl Determine which APIs to support
AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl],
[disable support for standard OpenGL API @<:@default=no@:>@])],
[enable_opengl="$enableval"],
[enable_opengl=yes])
AC_ARG_ENABLE([gles1],
[AS_HELP_STRING([--enable-gles1],
[enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
[enable_gles1="$enableval"],
[enable_gles1=no])
AC_ARG_ENABLE([gles2],
[AS_HELP_STRING([--enable-gles2],
[enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
[enable_gles2="$enableval"],
[enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[build separate OpenGL ES only libraries @<:@default=no@:>@])],
[enable_gles_overlay="$enableval"],
[enable_gles_overlay=no])
API_DEFINES=""
GLES_OVERLAY=0
if test "x$enable_opengl" = xno; then
API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
else
API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
fi
if test "x$enable_gles1" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
fi
if test "x$enable_gles2" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
fi
if test "x$enable_gles_overlay" = xyes -o \
"x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
if test "x$enable_gles_overlay" = xyes; then
GLES_OVERLAY=1
fi
fi
AC_SUBST([API_DEFINES])
AC_SUBST([GLES_OVERLAY])
dnl If $with_dri_drivers is yes, directories will be added through
dnl platform checks
DRI_DIRS=""
@@ -803,7 +871,7 @@ yes)
esac
dnl Set DRI_DIRS, DEFINES and LIB_DEPS
if test "$mesa_driver" = dri; then
if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
# Use TLS in GLX?
if test "x$GLX_USE_TLS" = xyes; then
DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
@@ -881,22 +949,24 @@ if test "$mesa_driver" = dri; then
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
# Check for expat
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
if test "$mesa_driver" = dri; then
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
fi
# put all the necessary libs together
DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS $TALLOC_LIBS"
DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
fi
AC_SUBST([DRI_DIRS])
AC_SUBST([EXPAT_INCLUDES])
@@ -910,12 +980,7 @@ esac
case $DRI_DIRS in
*radeon*|*r200*|*r300*|*r600*)
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
if test "$HAVE_LIBDRM_RADEON" = yes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
fi
@@ -939,6 +1004,9 @@ AC_ARG_ENABLE([gl-osmesa],
[gl_osmesa="$enableval"],
[gl_osmesa="$default_gl_osmesa"])
if test "x$gl_osmesa" = xyes; then
if test "x$enable_opengl" = xno; then
AC_MSG_ERROR([OpenGL is not available for OSMesa driver])
fi
if test "$mesa_driver" = osmesa; then
AC_MSG_ERROR([libGL is not available for OSMesa driver])
else
@@ -974,12 +1042,12 @@ case "$DRIVER_DIRS" in
*osmesa*)
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS $TALLOC_LIBS"
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
else
OSMESA_LIB_DEPS=""
fi
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS $TALLOC_LIBS"
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
;;
esac
AC_SUBST([OSMESA_LIB_DEPS])
@@ -995,13 +1063,21 @@ AC_ARG_ENABLE([egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
if test "x$enable_egl" = xno; then
if test "x$mesa_driver" = xno; then
AC_MSG_ERROR([cannot disable EGL when there is no mesa driver])
fi
if test "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without EGL])
fi
fi
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
EGL_DRIVERS_DIRS=""
if test "$enable_static" != yes; then
# build egl_glx when libGL is built
if test "$mesa_driver" != osmesa; then
if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
EGL_DRIVERS_DIRS="glx"
fi
@@ -1035,6 +1111,12 @@ AC_ARG_ENABLE([glu],
[enable OpenGL Utility library @<:@default=enabled@:>@])],
[enable_glu="$enableval"],
[enable_glu=yes])
if test "x$enable_glu" = xyes -a "x$mesa_driver" = xno; then
AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
enable_glu=no
fi
if test "x$enable_glu" = xyes; then
SRC_DIRS="$SRC_DIRS glu"
@@ -1084,9 +1166,13 @@ AC_ARG_ENABLE([glw],
[enable_glw="$enableval"],
[enable_glw=yes])
dnl Don't build GLw on osmesa
if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
enable_glw=no
if test "x$enable_glw" = xyes; then
case "$mesa_driver" in
osmesa|no)
AC_MSG_NOTICE([Disabling GLw since there is no OpenGL driver])
enable_glw=no
;;
esac
fi
AC_ARG_ENABLE([motif],
[AS_HELP_STRING([--enable-motif],
@@ -1160,16 +1246,20 @@ AC_ARG_ENABLE([glut],
[enable_glut="$enableval"],
[enable_glut="$default_glut"])
dnl Don't build glut on osmesa
if test "x$enable_glut" = xyes; then
case "$mesa_driver" in
osmesa|no)
AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver])
enable_glut=no
;;
esac
fi
dnl Can't build glut if GLU not available
if test "x$enable_glu$enable_glut" = xnoyes; then
AC_MSG_WARN([Disabling glut since GLU is disabled])
enable_glut=no
fi
dnl Don't build glut on osmesa
if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
AC_MSG_WARN([Disabling glut since the driver is OSMesa])
enable_glut=no
fi
if test "x$enable_glut" = xyes; then
SRC_DIRS="$SRC_DIRS glut/glx"
@@ -1234,6 +1324,9 @@ AC_ARG_ENABLE([gallium],
[build gallium @<:@default=enabled@:>@])],
[enable_gallium="$enableval"],
[enable_gallium=yes])
if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
fi
if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"],
@@ -1246,15 +1339,30 @@ AC_SUBST([LLVM_LIBS])
AC_SUBST([LLVM_LDFLAGS])
AC_SUBST([LLVM_VERSION])
VG_LIB_DEPS=""
EGL_CLIENT_APIS='$(GL_LIB)'
if test "x$enable_gles_overlay" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
dnl
dnl Gallium state trackers configuration
dnl
AC_ARG_ENABLE([gallium-egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable gallium EGL state tracker @<:@default=auto@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=auto])
if test "x$enable_gallium_egl" = xauto; then
case "$mesa_driver" in
dri|no)
enable_gallium_egl=$enable_egl
;;
*)
enable_gallium_egl=$enable_openvg
;;
esac
fi
case "x$enable_egl$enable_gallium_egl" in
xnoyes)
AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL])
esac
AC_ARG_WITH([state-trackers],
[AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
[comma delimited state_trackers list, e.g.
@@ -1275,16 +1383,24 @@ yes)
dri)
GALLIUM_STATE_TRACKERS_DIRS="dri"
HAVE_ST_DRI="yes"
if test "x$enable_egl" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
HAVE_ST_EGL="yes"
fi
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_ST_XORG="no")
;;
esac
if test "x$enable_egl" = xyes; then
if test "$enable_openvg" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega"
st_egl="yes"
fi
if test "$enable_gallium_egl" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
HAVE_ST_EGL="yes"
fi
fi
;;
*)
# verify the requested state tracker exist
@@ -1310,22 +1426,10 @@ yes)
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
HAVE_ST_XORG="yes"
;;
es)
AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
if test "x$enable_gles_overlay" != xyes; then
if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
fi
GLES_OVERLAY=1
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
tracker=""
;;
vega)
CORE_DIRS="$CORE_DIRS mapi/vgapi"
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
if test "x$enable_openvg" != xyes; then
AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
fi
;;
esac
@@ -1343,15 +1447,28 @@ yes)
;;
esac
EGL_CLIENT_APIS=""
VG_LIB_DEPS=""
case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*)
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
;;
esac
if test "x$enable_gles_overlay" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
if test "x$enable_openvg" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
fi
AC_SUBST([VG_LIB_DEPS])
AC_SUBST([EGL_CLIENT_APIS])
if test "x$HAVE_ST_EGL" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
# define GLX_DIRECT_RENDERING even when the driver is not dri
if test "x$mesa_driver" != xdri -a "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
fi
if test "x$HAVE_ST_XORG" = xyes; then
@@ -1363,7 +1480,7 @@ fi
AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g.
"x11,kms" @<:@default=auto@:>@])],
"x11,drm" @<:@default=auto@:>@])],
[with_egl_platforms="$withval"],
[with_egl_platforms=yes])
AC_ARG_WITH([egl-displays],
@@ -1376,6 +1493,9 @@ case "$with_egl_platforms" in
yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
EGL_PLATFORMS="x11"
if test "$mesa_driver" = dri; then
EGL_PLATFORMS="$EGL_PLATFORMS drm"
fi
fi
;;
*)
@@ -1436,7 +1556,7 @@ AC_ARG_ENABLE([gallium-llvm],
if test "x$enable_gallium_llvm" = xyes; then
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cflags`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
LLVM_LIBS="`$LLVM_CONFIG --libs jit interpreter nativecodegen bitwriter` -lstdc++"
if test "x$HAS_UDIS86" != xno; then
@@ -1518,18 +1638,28 @@ elif test "x$enable_gallium_i965" = xauto; then
fi
dnl
dnl Gallium Radeon configuration
dnl Gallium Radeon r300g configuration
dnl
AC_ARG_ENABLE([gallium-radeon],
[AS_HELP_STRING([--enable-gallium-radeon],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_radeon="$enableval"],
[enable_gallium_radeon=auto])
if test "x$enable_gallium_radeon" = xauto; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
else
AC_MSG_WARN([libdrm_radeon is missing, not building gallium-radeon (r300)])
fi
fi
if test "x$enable_gallium_radeon" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
elif test "x$enable_gallium_radeon" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-radeon (r300)])
fi
fi
dnl
@@ -1541,8 +1671,12 @@ AC_ARG_ENABLE([gallium-r600],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-r600])
fi
fi
dnl
@@ -1572,6 +1706,19 @@ if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xau
fi
fi
dnl
dnl Gallium noop configuration
dnl
AC_ARG_ENABLE([gallium-noop],
[AS_HELP_STRING([--enable-gallium-noop],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_noop="$enableval"],
[enable_gallium_noop=auto])
if test "x$enable_gallium_noop" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS noop"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-noop"
fi
dnl prepend CORE_DIRS to SRC_DIRS
SRC_DIRS="$CORE_DIRS $SRC_DIRS"
@@ -1601,25 +1748,56 @@ echo " exec_prefix: $exec_prefix"
echo " libdir: $libdir"
echo " includedir: $includedir"
dnl API info
echo ""
echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
echo " GLES overlay: $enable_gles_overlay"
echo " OpenVG: $enable_openvg"
dnl Driver info
echo ""
echo " Driver: $mesa_driver"
if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
echo " OSMesa: lib$OSMESA_LIB"
else
echo " OSMesa: no"
if test "$mesa_driver" != no; then
if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
echo " OSMesa: lib$OSMESA_LIB"
else
echo " OSMesa: no"
fi
if test "$mesa_driver" = dri; then
# cleanup the drivers var
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
if test "x$DRI_DIRS" = x; then
echo " DRI drivers: no"
else
echo " DRI drivers: $dri_dirs"
fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
echo " Use XCB: $enable_xcb"
fi
fi
if test "$mesa_driver" = dri; then
# cleanup the drivers var
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
if test "x$DRI_DIRS" = x; then
echo " DRI drivers: no"
else
echo " DRI drivers: $dri_dirs"
echo ""
echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl EGL
echo ""
echo " EGL: $enable_egl"
if test "$enable_egl" = yes; then
echo " EGL platforms: $EGL_PLATFORMS"
egl_drivers=""
for d in $EGL_DRIVERS_DIRS; do
egl_drivers="$egl_drivers egl_$d"
done
if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then
echo " EGL drivers: ${egl_drivers} egl_gallium"
echo " EGL Gallium STs:$EGL_CLIENT_APIS"
else
echo " EGL drivers: $egl_drivers"
fi
fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
fi
echo " Use XCB: $enable_xcb"
echo ""
if test "x$MESA_LLVM" = x1; then
@@ -1638,9 +1816,6 @@ if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
if test "x$HAVE_ST_EGL" = xyes; then
echo " EGL client APIs: $EGL_CLIENT_APIS"
fi
else
echo " Gallium: no"
fi
@@ -1649,15 +1824,6 @@ dnl Libraries
echo ""
echo " Shared libs: $enable_shared"
echo " Static libs: $enable_static"
if test "$enable_egl" = yes; then
echo " EGL: $EGL_DRIVERS_DIRS"
echo " EGL platforms: $EGL_PLATFORMS"
else
echo " EGL: no"
fi
echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl Compiler options
# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
@@ -1670,6 +1836,8 @@ echo ""
echo " CFLAGS: $cflags"
echo " CXXFLAGS: $cxxflags"
echo " Macros: $defines"
echo ""
echo " PYTHON2: $PYTHON2"
echo ""
echo " Run '${MAKE-make}' to build Mesa"

View File

@@ -20,21 +20,22 @@ Float textures, renderbuffers some infrastructure done
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float some infrastructure done
Multisample blit DONE
Non-normalized Integer texture/framebuffer formats not started
Non-normalized Integer texture/framebuffer formats ~50% done
1D/2D Texture arrays core Mesa, swrast done
Packed depth/stencil formats DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
GL_EXT_texture_compression_rgtc not started
Red and red/green texture formats Ian?
Red and red/green texture formats DONE (swrast, i965, gallium)
Transform feedback (GL_EXT_transform_feedback) ~50% done
glBindFragDataLocation, glGetFragDataLocation,
glBindBufferRange, glBindBufferBase commands
Vertex array objects (GL_APPLE_vertex_array_object) DONE
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started
glClearBuffer commands DONE, except for dispatch
glGetStringi command DONE, except for dispatch
glTexParameterI, glGetTexParameterI commands DONE, except for dispatch
glVertexAttribI commands not started
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE (but converts int
values to floats)
GL 3.1:
@@ -42,9 +43,9 @@ GL 3.1:
GLSL 1.30 and 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) ~50% done
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) not started
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
16 vertex texture image units not started
Texture buffer objs (GL_ARB_textur_buffer_object) not started
Texture buffer objs (GL_ARB_texture_buffer_object) not started
Rectangular textures (GL_ARB_texture_rectangle) DONE
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Signed normalized texture formats ~50% done
@@ -69,7 +70,7 @@ GL 3.3:
GLSL 3.30 not started
GL_ARB_blend_func_extended not started
GL_ARB_explicit_attrib_location not started
GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
GL_ARB_occlusion_query2 not started
GL_ARB_sampler_objects not started
GL_ARB_texture_rgb10_a2ui not started
@@ -93,6 +94,18 @@ GL_ARB_texture_buffer_object_rgb32 not started
GL_ARB_texture_cube_map_array not started
GL_ARB_texture_gather not started
GL_ARB_transform_feedback2 not started
GL_ARB_transform_feedback3 not started
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility not started
GL_ARB_get_program_binary not started
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started
GL_ARB_vertex_attrib_64bit not started
GL_ARB_viewport_array not started

View File

@@ -83,7 +83,7 @@ Additions to the EGL 1.4 Specification:
EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
const EGLint *attrib_list);
In the attribute list, pass EGL_WIDTH, EGL_EIGHT and format and
In the attribute list, pass EGL_WIDTH, EGL_HEIGHT and format and
use in the attrib list using EGL_DRM_BUFFER_FORMAT_MESA and
EGL_DRM_BUFFER_USE_MESA. The only format specified by this
extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel

View File

@@ -62,6 +62,7 @@ a:visited {
<LI><A HREF="perf.html" target="MainFrame">Performance Tips</A>
<LI><A HREF="extensions.html" target="MainFrame">Mesa Extensions</A>
<LI><A HREF="mangling.html" target="MainFrame">Function Name Mangling</A>
<LI><A href="llvmpipe.html" target="MainFrame">Gallium llvmpipe driver</A>
</ul>
<b>Developer Topics</b>

View File

@@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
Update docs/news.html.
</p>
<p>
@@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
<p>
Make an announcement on the mailing lists:
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
and
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
</p>

View File

@@ -21,76 +21,52 @@ When a new release is coming, release candidates (betas) may be found
<p>
Mesa is distributed in several parts:
The Mesa package is named MesaLib-x.y.z.{tar.bz2, tar.gz, zip} where x.y.z
is the version. There are three types of compressed archives.
</p>
<ul>
<li><b>MesaLib-x.y.z</b> - the main Mesa library source code, drivers
and documentation.
</li>
<li><b>MesaDemos-x.y.z</b> - OpenGL demonstration and test programs.
Most of the programs require GLUT (either the
<a href="http://www.opengl.org/resources/libraries/glut"
target="_parent">original GLUT by Mark Kilgard</a> or
<a href="http://freeglut.sourceforge.net" target="_parent">freeglut</a> or
<a href="http://openglut.sourceforge.net" target="_parent">OpenGLUT</a>).
</li>
<li><b>MesaGLUT-x.y.z</b> - Mark Kilgard's GLUT, easily compiled and used
with Mesa. Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc.
</li>
</ul>
<p>
If you're not interested in running the demos, you'll only need the first
package.
There's also the MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
contain Mark Kilgard's GLUT library.
This is optional.
Most Linux distributions include an implementation of GLUT (such as freeglut).
</p>
<p>
In the past, the Mesa demos collection was distributed as
MesaDemos-x.y.z.{tar.bz2, tar.gz, zip}.
Now, the
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/" target="_parent">
Mesa demos</a> are distributed separately.
</p>
<p>
If you're new to this and not sure what you're doing, grab all three packages.
</p>
<p>
The packages are available in .tar.gz, .tar.bz2 and .zip formats.
Other sites might offer additional package formats.
</p>
<H1>Unpacking</H1>
<p>
All the packages should be in the same directory prior to unpacking.
To unpack .tar.gz files:
</p>
<ul>
<li>To unpack .tar.gz files:
<pre>
tar zxf MesaLib-X.Y.tar.gz
tar zxf MesaDemos-X.Y.tar.gz
tar zxf MesaGLUT-X.Y.tar.gz
tar zxf MesaLib-x.y.z.tar.gz
</pre>
or
<pre>
gzcat MesaLib-X.Y.tar.gz | tar xf -
gzcat MesaDemos-X.Y.tar.gz | tar xf -
gzcat MesaGLUT-X.Y.tar.gz | tar xf -
gzcat MesaLib-x.y.z.tar.gz | tar xf -
</pre>
or
<pre>
gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar
gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar
gunzip MesaLib-x.y.z.tar.gz ; tar xf MesaLib-x.y.z.tar
</pre>
<li>To unpack .tar.bz2 files:
<p>
To unpack .tar.bz2 files:
</p>
<pre>
bunzip2 -c MesaLib-X.Y.tar.gz | tar xf -
bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf -
bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf -
bunzip2 -c MesaLib-x.y.z.tar.gz | tar xf -
</pre>
<li>To unpack .zip files:
<p>
To unpack .zip files:
</p>
<pre>
unzip MesaLib-X.Y.zip
unzip MesaDemos-X.Y.zip
unzip MesaGLUT-X.Y.zip
unzip MesaLib-x.y.z.zip
</pre>
</ul>
<h1>Contents</h1>
@@ -106,22 +82,13 @@ bin/ - shell scripts for making shared libraries, etc
docs/ - documentation
src/ - source code for libraries
src/mesa - sources for the main Mesa library and device drivers
src/gallium - sources for Gallium and Gallium drivers
src/glu - libGLU source code
src/glx - sources for building libGL with full GLX and DRI support
src/glw - Xt/Motif/OpenGL widget code
</pre>
If you downloaded and unpacked the MesaDemos.X.Y package:
<pre>
progs/demos - original Mesa demos
progs/xdemos - GLX OpenGL/Mesa demos
progs/redbook - examples from the OpenGL Programming Guide
progs/samples - examples from SGI
progs/images/ - image files
</pre>
If you downloaded and unpacked the MesaGLUT.X.Y package:
If you downloaded and unpacked the MesaGLUT.x.y.z package:
<pre>
src/glut - GLUT library source code
</pre>

View File

@@ -19,27 +19,23 @@ API entry points and helper functions for use by the drivers. Drivers are
dynamically loaded by the main library and most of the EGL API calls are
directly dispatched to the drivers.</p>
<p>The driver in use decides the window system to support. For drivers that
support hardware rendering, there are usually multiple drivers supporting the
same window system. Each one of of them supports a certain range of graphics
cards.</p>
<p>The driver in use decides the window system to support.</p>
<h2>Build EGL</h2>
<ol>
<li>
<p>Run <code>configure</code> with the desired state trackers and enable
the Gallium driver for your hardware. For example</p>
<p>Run <code>configure</code> with the desired client APIs and enable
the driver for your hardware. For example</p>
<pre>
$ ./configure --enable-gles-overlay --with-state-trackers=egl,vega --enable-gallium-intel
$ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
</pre>
<p>The main library and OpenGL is enabled by default. The first option enables
<a href="opengles.html">OpenGL ES 1.x and 2.x</a>. The <code>egl</code> state
tracker is needed by a number of EGL drivers. EGL drivers will be covered
later. The <a href="openvg.html">vega state tracker</a> provides OpenVG
1.x.</p>
<p>The main library and OpenGL is enabled by default. The first option above
enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
<a href="openvg.html">OpenVG</a>.</p>
</li>
<li>Build and install Mesa as usual.</li>
@@ -72,39 +68,46 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
<li><code>--with-egl-platforms</code>
<p>List the platforms (window systems) to support. Its argument is a comma
seprated string such as <code>--with-egl-platforms=x11,kms</code>. It decides
seprated string such as <code>--with-egl-platforms=x11,drm</code>. It decides
the platforms a driver may support. The first listed platform is also used by
the main library to decide the native platform: the platform the EGL native
types such as <code>EGLNativeDisplayType</code> or
<code>EGLNativeWindowType</code> defined for.</p>
<p>The available platforms are <code>x11</code>, <code>kms</code>,
<p>The available platforms are <code>x11</code>, <code>drm</code>,
<code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> platform can
only be built with SCons.</p>
</li>
<li><code>--with-state-trackers</code>
<p>The argument is a comma separated string. It is usually used to specify the
rendering APIs, such as OpenVG, to build. But it is also used to specify
<code>egl</code> state tracker that <code>egl_gallium</code> depends on.</p>
</li>
<li><code>--enable-gles-overlay</code>
<p>OpenGL and OpenGL ES are not controlled by
<code>--with-state-trackers</code>. OpenGL is always built. To build OpenGL
ES, this option must be explicitly given.</p>
only be built with SCons. Unless for special needs, the build system should
select the right platforms automatically.</p>
</li>
<li><code>--enable-gles1</code> and <code>--enable-gles2</code>
<p>Unlike <code>--enable-gles-overlay</code>, which builds one library for each
rendering API, these options enable OpenGL ES support in OpenGL. The result is
one big library that supports multiple APIs.</p>
<p>These options enable OpenGL ES support in OpenGL. The result is one big
internal library that supports multiple APIs.</p>
</li>
<li><code>--enable-gles-overlay</code>
<p>This option enables OpenGL ES as separate internal libraries. This is an
alternative approach to enable OpenGL ES.</p>
<p>This is only supported by <code>egl_gallium</code>. For systems using DRI
drivers, <code>--enable-gles1</code> and <code>--enable-gles2</code> are
suggested instead as all drivers will benefit.</p>
</li>
<li><code>--enable-openvg</code>
<p>OpenVG must be explicitly enabled by this option.</p>
</li>
<li><code>--enable-gallium-egl</code>
<p>Explicitly enable or disable <code>egl_gallium</code>.</p>
</li>
@@ -131,6 +134,16 @@ colon-separated directories where the main library will look for drivers, in
addition to the default directory. This variable is ignored for setuid/setgid
binaries.</p>
<p>This variable is usually set to test an uninstalled build. For example, one
may set</p>
<pre>
$ export LD_LIBRARY_PATH=$mesa/lib
$ export EGL_DRIVERS_PATH=$mesa/lib/egl
</pre>
<p>to test a build without installation</p>
</li>
<li><code>EGL_DRIVER</code>
@@ -139,10 +152,6 @@ binaries.</p>
specified EGL driver to be loaded. It comes in handy when one wants to test a
specific driver. This variable is ignored for setuid/setgid binaries.</p>
<p><code>egl_gallium</code> dynamically loads hardware drivers and client API
modules found in <code>EGL_DRIVERS_PATH</code>. Thus, specifying this variable
alone is not sufficient for <code>egl_gallium</code> for uninstalled build.</p>
</li>
<li><code>EGL_PLATFORM</code>
@@ -150,7 +159,12 @@ alone is not sufficient for <code>egl_gallium</code> for uninstalled build.</p>
<p>This variable specifies the native platform. The valid values are the same
as those for <code>--with-egl-platforms</code>. When the variable is not set,
the main library uses the first platform listed in
<code>--with-egl-platforms</code> as the native platform</p>
<code>--with-egl-platforms</code> as the native platform.</p>
<p>Extensions like <code>EGL_MESA_drm_display</code> define new functions to
create displays for non-native platforms. These extensions are usually used by
applications that support non-native platforms. Setting this variable is
probably required only for some of the demos found in mesa/demo repository.</p>
</li>
@@ -173,11 +187,25 @@ variable to true forces the use of software rendering.</p>
<h2>EGL Drivers</h2>
<ul>
<li><code>egl_dri2</code>
<p>This driver supports both <code>x11</code> and <code>drm</code> platforms.
It functions as a DRI driver loader. For <code>x11</code> support, it talks to
the X server directly using (XCB-)DRI2 protocol.</p>
<p>This driver can share DRI drivers with <code>libGL</code>.</p>
</li>
<li><code>egl_gallium</code>
<p>This driver is based on Gallium3D. It supports all rendering APIs and
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
The supported platforms are X11, KMS, FBDEV, and GDI.</p>
The supported platforms are X11, DRM, FBDEV, and GDI.</p>
<p>This driver comes with its own hardware drivers
(<code>pipe_&lt;hw&gt;</code>) and client API modules
(<code>st_&lt;api&gt;</code>).</p>
</li>
@@ -187,26 +215,24 @@ The supported platforms are X11, KMS, FBDEV, and GDI.</p>
the EGL API. It supports both direct and indirect rendering when the GLX does.
It is accelerated when the GLX is. As such, it cannot provide functions that
is not available in GLX or GLX extensions.</p>
</li>
<li><code>egl_dri2</code>
<p>This driver supports the X Window System as its window system. It functions
as a DRI2 driver loader. Unlike <code>egl_glx</code>, it has no dependency on
<code>libGL</code>. It talks to the X server directly using DRI2 protocol.</p>
</li>
<li><code>egl_dri</code>
<p>This driver lacks maintenance and does <em>not</em> build. It is similiar
to <code>egl_dri2</code> in that it functions as a DRI(1) driver loader. But
unlike <code>egl_dri2</code>, it supports Linux framebuffer devices as its
window system and supports EGL_MESA_screen_surface extension. As DRI1 drivers
are phasing out, it might eventually be replaced by <code>egl_dri2</code>.</p>
</li>
</ul>
<h2>Packaging</h2>
<p>The ABI between the main library and its drivers are not stable. Nor is
there a plan to stabilize it at the moment. Of the EGL drivers,
<code>egl_gallium</code> has its own hardware drivers and client API modules.
They are considered internal to <code>egl_gallium</code> and there is also no
stable ABI between them. These should be kept in mind when packaging for
distribution.</p>
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
may either be disabled with <code>--disable-gallium-egl</code> or packaged
separately.</p>
<h2>Developers</h2>
<p>The sources of the main library and the classic drivers can be found at
@@ -295,7 +321,6 @@ should as well lock the display before using it.
<ul>
<li>Pass the conformance tests</li>
<li>Reference counting in main library?</li>
<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported. But
which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
<code>libGLESv2.so</code> should an application link to? Bad things may happen

View File

@@ -9,16 +9,38 @@
<H1>Environment Variables</H1>
<p>
Mesa supports the following environment variables:
Normally, no environment variables need to be set. Most of the environment
variables used by Mesa/Gallium are for debugging purposes, but they can
sometimes be useful for debugging end-user issues.
</p>
<H2>LibGL environment variables</H2>
<ul>
<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
If set to 'verbose' additional information will be printed.
<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
</ul>
<H2>Core Mesa environment variables</H2>
<ul>
<li>MESA_NO_ASM - if set, disables all assembly language optimizations
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr.
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
generate exceptions.
<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
if the application generates a GL_INVALID_ENUM error, a corresponding error
message indicating where the error occured, and possibly why, will be
printed to stderr.<br>
If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
generate exceptions.
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
fragment programs (intended for developers only)
@@ -28,11 +50,14 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
</ul>
<H2>Mesa Xlib driver environment variables</H2>
<p>
The following are only applicable to the Xlib software driver.
The following are only applicable to the Mesa Xlib software driver.
See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</p>
<ul>
@@ -51,9 +76,8 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</ul>
<p>
These environment variables are for the Intel i945/i965 drivers:
</p>
<h2>i945/i965 driver environment variables (non-Gallium)</h2>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
@@ -62,17 +86,71 @@ These environment variables are for the Intel i945/i965 drivers:
</ul>
<p>
These environment variables are for the Radeon R300 driver:
</p>
<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
<ul>
<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
</ul>
<h2>EGL environment variables</h2>
<p>
Mesa EGL supports different sets of environment variables. See the
<a href="egl.html">Mesa EGL</a> page for the details.
</p>
<h2>Gallium environment variables</h2>
<ul>
<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
variables which are used, and their current values.
<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
shader execution
<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
shader execution
<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
print any errors to stderr.
<LI>DRAW_FSE - ???
<LI>DRAW_NO_FSE - ???
<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
shaders, vertex fetch, etc.
</ul>
<h3>Softpipe driver environment variables</h3>
<ul>
<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
to stderr
<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
to stderr
<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
</ul>
<h3>LLVMpipe driver environment variables</h3>
<ul>
<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
source code for details.
<li>LP_PERF - a comma-separated list of options to selectively no-op various
parts of the driver. See the source code for details.
<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
Zero turns of threading completely. The default value is the number of CPU
cores present.
</ul>
<p>
Other Gallium drivers have their own environment variables. These may change
frequently so the source code should be consulted for details.
</p>
<br>
<br>
</BODY>
</HTML>

View File

@@ -9,6 +9,9 @@
<center><h1>Mesa fbdev/DRI Drivers</h1></center>
<br>
<h1><center>NOTE: this information is obsolete and will be removed at
a future date</center></h1>
<h1>1. Introduction</h1>
<p>
@@ -22,7 +25,7 @@ Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
<p>
Applications in the fbdev/DRI environment use
the <a href="http://www.nabble.com/file/p15480666/MiniGXL.html"> MiniGLX</a> interface to choose pixel
the MiniGLX interface to choose pixel
formats, create rendering contexts, etc. It's a subset of the GLX and
Xlib interfaces allowing some degree of application portability between
the X and X-less environments.
@@ -315,8 +318,7 @@ It means that the sample_server process is not running.
<h1>5.0 Programming Information</h1>
<p>
OpenGL/Mesa is interfaced to fbdev via the <a href="http://www.nabble.com/file/p15480666/MiniGLX.html">MiniGLX</a>
interface.
OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface.
MiniGLX is a subset of Xlib and GLX API functions which provides just
enough functionality to setup OpenGL rendering and respond to simple
input events.
@@ -332,7 +334,7 @@ This allows some degree of flexibility for software development and testing.
However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
Some of the structures are different and some macros/functions work
differently.
See the <code>GL/miniglx.h</code> header file for details.
See the GL/miniglx.h header file for details.
</p>

View File

@@ -12,16 +12,16 @@
<ol>
<li><a href="#unix-x11">Unix / X11</a>
<ul>
<li><a href="#prereq">Prerequisites for DRI and hardware acceleration</a>
<li><a href="#prereq-general">General prerequisites for building</a>
<li><a href="#prereq-dri">Prerequisites for DRI and hardware acceleration</a>
<li><a href="#autoconf">Building with autoconf</a>
<li><a href="#traditional">Building with traditional Makefiles</a>
<li><a href="#libs">The Libraries</a>
<li><a href="#demos">Running the demos
<li><a href="#install">Installing the header and library files
<li><a href="#pkg-config">Building OpenGL programs with pkg-config
</ul>
<li><a href="#windows">Windows</a>
<li><a href="#scons">SCons</a>
<li><a href="#scons">Building with SCons</a>
<li><a href="#other">Other</a>
</ol>
<br>
@@ -31,8 +31,22 @@
<H2>1. Unix/X11 Compilation and Installation</H1>
<a name="prereq">
<h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
<a name="prereq-general">
<h3>1.1 General prerequisites for building</h3>
<ul>
<li>lex / yacc - for building the GLSL compiler.
On Linux systems, flex and bison are used.
Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
</li>
<li>python - Python is needed for building the Gallium components.
Version 2.6.4 or later should work.
</li>
</ul>
<a name="prereq-dri">
<h3>1.2 Prerequisites for DRI and hardware acceleration</h3>
<p>
The following are required for DRI-based hardware acceleration with Mesa:
@@ -49,7 +63,7 @@ version 2.4.15 or later
<a name="autoconf">
<h3>1.2 Building with Autoconf</h3>
<h3>1.3 Building with Autoconf</h3>
<p>
Mesa may be <a href="autoconf.html">built using autoconf</a>.
@@ -59,7 +73,7 @@ If that fails the traditional Mesa build system is available.
<a name="traditional">
<h3>1.3 Building with traditional Makefiles</h3>
<h3>1.4 Building with traditional Makefiles</h3>
<p>
The traditional Mesa build system is based on a collection of pre-defined
@@ -126,7 +140,7 @@ Later, if you want to rebuild for a different configuration run
<a name="libs">
<h3>1.4 The libraries</h3>
<h3>1.5 The libraries</h3>
<p>
When compilation has finished, look in the top-level <code>lib/</code>
@@ -185,81 +199,11 @@ If you built the DRI hardware drivers, you'll also see the DRI drivers:
-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
</pre>
<a name="demos">
<h3>1.5 Running the demos</h3>
<p>
If you downloaded/unpacked the MesaDemos-x.y.z.tar.gz archive or
obtained Mesa from CVS, the <b>progs/</b> directory will contain a
bunch of demonstration programs.
If you built with Gallium support, look in lib/gallium/ for Gallium-based
versions of libGL and device drivers.
</p>
<p>
Before running a demo, you'll probably have to set two environment variables
to indicate where the libraries are located. For example:
<p>
<blockquote>
<b>cd lib/</b>
<br>
<b>export LD_LIBRARY_PATH=${PWD}</b>
<br>
<b>export LIBGL_DRIVERS_PATH=${PWD}</b> (if using DRI drivers)
</blockquote>
<p>
Next, change to the Mesa/demos/ directory:
</p>
<blockquote>
<b>cd ../progs/demos</b>
</blockquote>
<p>
Run a demo such as gears:
</p>
<blockquote>
<b>./gears</b>
</blockquote>
<p>
If this doesn't work, try the <b>Mesa/progs/xdemos/glxinfo</b> program
and see that it prints the expected Mesa version number.
</p>
<p>
If you're using Linux or a similar OS, verify that the demo program is
being linked with the proper library files:
</p>
<blockquote>
<b>ldd gears</b>
</blockquote>
<p>
You should see something like this:
</p>
<pre>
libglut.so.3 => /home/brian/Mesa/lib/libglut.so.3 (0x40013000)
libGLU.so.1 => /home/brian/Mesa/lib/libGLU.so.1 (0x40051000)
libGL.so.1 => /home/brian/Mesa/lib/libGL.so.1 (0x400e0000)
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
libm.so.6 => /lib/i686/libm.so.6 (0x403da000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403fc000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x404da000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404f1000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40543000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4054b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405fd000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40605000)
libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40613000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libdl.so.2 => /lib/libdl.so.2 (0x40644000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40647000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40650000)
</pre>
<p>
Retrace your steps if this doesn't look right.
</p>
<a name="install">

204
docs/llvmpipe.html Normal file
View File

@@ -0,0 +1,204 @@
<HTML>
<TITLE>llvmpipe</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<H1>Introduction</H1>
<p>
The Gallium llvmpipe driver is a software rasterizer that uses LLVM to
do runtime code generation.
Shaders, point/line/triangle rasterization and vertex processing are
implemented with LLVM IR which is translated to x86 or x86-64 machine
code.
Also, the driver is multithreaded to take advantage of multiple CPU cores
(up to 8 at this time).
It's the fastest software rasterizer for Mesa.
</p>
<h1>Requirements</h1>
<dl>
<dt>An x86 or amd64 processor. 64-bit mode is preferred.</dt>
<dd>
<p>
Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will
yield the most efficient code. The less features the CPU has the more
likely is that you ran into underperforming, buggy, or incomplete code.
</p>
<p>
See /proc/cpuinfo to know what your CPU supports.
</p>
</dd>
<dt>LLVM. Version 2.8 recommended. 2.6 or later required.</dt>
<dd>
<p>
<b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
</p>
<p>
For Linux, on a recent Debian based distribution do:
</p>
<pre>
aptitude install llvm-dev
</pre>
For a RPM-based distribution do:
</p>
<pre>
yum install llvm-devel
</pre>
<p>
For Windows download pre-built MSVC 9.0 or MinGW binaries from
http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment
variable to the extracted path.
</p>
<p>
For MSVC there are two set of binaries: llvm-x.x-msvc32mt.7z and
llvm-x.x-msvc32mtd.7z .
</p>
<p>
You have to set the LLVM=/path/to/llvm-x.x-msvc32mtd env var when passing
debug=yes to scons, and LLVM=/path/to/llvm-x.x-msvc32mt when building with
debug=no. This is necessary as LLVM builds as static library so the chosen
MS CRT must match.
</p>
</dd>
<dt>scons (optional)</dt>
</dl>
<h1>Building</h1>
To build everything on Linux invoke scons as:
<pre>
scons build=debug libgl-xlib
</pre>
Alternatively, you can build it with GNU make, if you prefer, by invoking it as
<pre>
make linux-llvm
</pre>
but the rest of these instructions assume that scons is used.
For windows is everything the except except the winsys:
<pre>
scons build=debug libgl-gdi
</pre>
<h1>Using</h1>
On Linux, building will create a drop-in alternative for libGL.so into
<pre>
build/foo/gallium/targets/libgl-xlib/libGL.so
</pre>
or
<pre>
lib/gallium/libGL.so
</pre>
To use it set the LD_LIBRARY_PATH environment variable accordingly.
For performance evaluation pass debug=no to scons, and use the corresponding
lib directory without the "-debug" suffix.
On Windows, building will create a drop-in alternative for opengl32.dll. To use
it put it in the same directory as the application. It can also be used by
replacing the native ICD driver, but it's quite an advanced usage, so if you
need to ask, don't even try it.
<h1>Profiling</h1>
To profile llvmpipe you should pass the options
<pre>
scons build=profile <same-as-before>
</pre>
This will ensure that frame pointers are used both in C and JIT functions, and
that no tail call optimizations are done by gcc.
To better profile JIT code you'll need to build LLVM with oprofile integration.
<pre>
./configure \
--prefix=$install_dir \
--enable-optimized \
--disable-profiling \
--enable-targets=host-only \
--with-oprofile
make -C "$build_dir"
make -C "$build_dir" install
find "$install_dir/lib" -iname '*.a' -print0 | xargs -0 strip --strip-debug
</pre>
The you should define
<pre>
export LLVM=/path/to/llvm-2.6-profile
</pre>
and rebuild.
<h1>Unit testing</h1>
<p>
Building will also create several unit tests in
build/linux-???-debug/gallium/drivers/llvmpipe:
</p>
</ul>
<li> lp_test_blend: blending
<li> lp_test_conv: SIMD vector conversion
<li> lp_test_format: pixel unpacking/packing
</ul>
<p>
Some of this tests can output results and benchmarks to a tab-separated-file
for posterior analysis, e.g.:
</p>
<pre>
build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
</pre>
<h1>Development Notes</h1>
<ul>
<li>
When looking to this code by the first time start in lp_state_fs.c, and
then skim through the lp_bld_* functions called in there, and the comments
at the top of the lp_bld_*.c functions.
</li>
<li>
The driver-independent parts of the LLVM / Gallium code are found in
src/gallium/auxiliary/gallivm/. The filenames and function prefixes
need to be renamed from "lp_bld_" to something else though.
</li>
<li>
We use LLVM-C bindings for now. They are not documented, but follow the C++
interfaces very closely, and appear to be complete enough for code
generation. See
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
for a stand-alone example. See the llvm-c/Core.h file for reference.
</li>
</ul>

View File

@@ -11,6 +11,62 @@
<H1>News</H1>
<h2>June 13, 2011</h2>
<p>
<a href="relnotes-7.10.3.html">Mesa 7.10.3</a> is released. This is a bug
fix release.
</p>
<h2>April 6, 2011</h2>
<p>
<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
fix release.
</p>
<h2>March 2, 2011</h2>
<p>
<a href="relnotes-7.10.1.html">Mesa 7.10.1</a> is released. This is a bug
fix release.
</p>
<p>
Also, <a href="relnotes-7.9.2.html">Mesa 7.9.2</a> is released.
This is a bug fix release.
</p>
<h2>January 7, 2011</h2>
<p>
<a href="relnotes-7.10.html">Mesa 7.10</a> (final) is released. This is a new
development release.
</p>
<p>
Also, <a href="relnotes-7.9.1.html">Mesa 7.9.1</a> (final) is released.
This is a bug fix release.
</p>
<h2>October 4, 2010</h2>
<p>
<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
development release.
</p>
<h2>September 27, 2010</h2>
<p>
<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
release candidate for the 7.9 development release.
</p>
<h2>June 16, 2010</h2>
<p>
@@ -1277,7 +1333,6 @@ grateful.
<p>
</p><h2>March 18, 1999</h2>
<p>The new webpages are now online. Enjoy, and let me know if you find any errors.
For an eye-candy free version you can use <a href="http://www.mesa3d.org/txt/">http://www.mesa3d.org/txt/</a>.</p>
<p>
</p><h2>February 16, 1999</h2>
<p><a href="http://www.sgi.com/">SGI</a> releases its <a href="http://www.sgi.com/software/opensource/glx/">GLX

View File

@@ -26,36 +26,27 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
<h2>Building the library</h2>
<ol>
<li>Build Mesa3D with Gallium3D. Any build that builds Gallium3D libraries, EGL, and Gallium EGL drivers will suffice</li>
<li>cd src/gallium/state_trackers/vega; make</li>
<li>The last step will build libOpenVG library. You can add the libdir to LD_LIBRARY_PATH or install libOpenVG</li>
<li>Run <code>configure</code> with <code>--enable-openvg</code>. If you do
not need OpenGL, you can add <code>--disable-opengl</code> to save the
compilation time.</li>
<li>Build and install Mesa as usual.</li>
</ol>
<h3>Sample build</h3>
A sample build looks as follows:
<pre>
$ ./configure --with-state-trackers=egl,vega --enable-gallium-intel
$ ./configure --disable-opengl --enable-openvg
$ make
$ make install
</pre>
<p>It will install <code>libOpenVG.so</code>, <code>libEGL.so</code>, and one
or more EGL drivers.</p>
<h2>OpenVG Demos</h2>
<p>
To build the OpenVG demos:
</p>
<pre>
cd progs/openvg
make
</pre>
<p>
To run a demo:
</p>
<pre>
cd openvg/demos
./lion
</pre>
<p>OpenVG demos can be found in mesa/demos repository.</p>
</body>
</html>

380
docs/relnotes-7.10.1.html Normal file
View File

@@ -0,0 +1,380 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.1 Release Notes / March 2, 2011</H1>
<p>
Mesa 7.10.1 is a bug fix release which fixes bugs found since the 7.10 release.
</p>
<p>
Mesa 7.10.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
4b4cee19f3bf16eb78bd4cc278ccf812 MesaLib-7.10.1.tar.gz
efe8da4d80c2a5d32a800770b8ce5dfa MesaLib-7.10.1.tar.bz2
0fd2b1a025934de3f8cecf9fb9b57f4c MesaLib-7.10.1.zip
42beb0f5188d544476c19496f725fa67 MesaGLUT-7.10.1.tar.gz
637bb8a20fdad89f7382b4ea83f896e3 MesaGLUT-7.10.1.tar.bz2
bdbf3ffb2606d6aa8afabb6c6243b91b MesaGLUT-7.10.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34030">Bug 34030</a> - [bisected] Starcraft 2: some effects are corrupted or too big</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34179">Bug 34179</a> - Nouveau 3D driver: nv50_pc_emit.c:863 assertion error kills Compiz</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10..mesa-7.10.1
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (21):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>docs: add links to 7.9.1 and 7.10 release notes</li>
<li>docs: added news item for 7.9.1 and 7.10 release</li>
<li>gallivm: work around LLVM 2.6 bug when calling C functions</li>
<li>gallivm: fix copy&amp;paste error from previous commit</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: fix incorrect glCopyPixels position on fallback path</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add link to 7.10.1 release notes</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (20):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>mesa: Refactor handling of extension strings</li>
<li>mesa: Add/remove extensions in extension string</li>
<li>mesa: Change dependencies of some OES extension strings</li>
<li>mesa: Change OES_point_sprite to depend on ARB_point_sprite</li>
<li>mesa: Change OES_standard_derivatives to be stand-alone extension</li>
<li>i915: Disable extension OES_standard_derivatives</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Christoph Bumiller (1):
<ul>
<li>nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (3):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: calculate complete texture state inside TFP function</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (16):
<ul>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>i965/fs: When producing ir_unop_abs of an operand, strip negate.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>i965/fs: Do flat shading when appropriate.</li>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>i965: Fix dead pointers to fp-&gt;Parameters-&gt;ParameterValues[] after realloc.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
<li>i965: Fix a bug in i965 compute-to-MRF.</li>
<li>i965/fs: Add a helper function for detecting math opcodes.</li>
</ul></p>
<p>Fredrik Höglund (1):
<ul>
<li>st/mesa: fix a regression from cae2bb76</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.10 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial bits of 7.10.1 release notes</li>
<li>mesa: bump version to 7.10.1-devel</li>
<li>doc: Update 7.10.1 release notes</li>
<li>glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'</li>
<li>docs: Update 7.10.1 release notes</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.10.1 release notes</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>docs: Update 7.10.1 release notes</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>docs: update 7.10.1 release notes with Ian's recent cherry picks</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.10.1 with (hopefully) the last of the cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.10.1 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (20):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>i965/fs: Apply source modifier workarounds to POW as well.</li>
<li>i965: Fix shaders that write to gl_PointSize on Sandybridge.</li>
<li>i965/fs: Avoid register coalescing away gen6 MATH workarounds.</li>
<li>i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.</li>
<li>i965: Increase Sandybridge point size clamp.</li>
<li>i965/fs: Refactor control flow stack handling.</li>
<li>i965: Increase Sandybridge point size clamp in the clip state.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
<li>Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."</li>
</ul></p>
<p>Marek Olšák (4):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.10</li>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Tom Fogal (1):
<ul>
<li>Regenerate gl_mangle.h.</li>
</ul></p>
<p>Tom Stellard (2):
<ul>
<li>r300/compiler: Disable register rename pass on r500</li>
<li>r300/compiler: Don't erase sources when converting RGB-&gt;Alpha</li>
</ul></p>
<p>Vinson Lee (3):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
<li>mesa: Move declaration before code in extensions.c.</li>
<li>mesa: Move loop variable declarations outside for loop in extensions.c.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

206
docs/relnotes-7.10.2.html Normal file
View File

@@ -0,0 +1,206 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.2 Release Notes / April 6, 2011</H1>
<p>
Mesa 7.10.2 is a bug fix release which fixes bugs found since the 7.10 release.
</p>
<p>
Mesa 7.10.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
2f9f444265534a2cfd9a99d1a8291089 MesaLib-7.10.2.tar.gz
f5de82852f1243f42cc004039e10b771 MesaLib-7.10.2.tar.bz2
47836e37bab6fcafe3ac90c9544ba0e9 MesaLib-7.10.2.zip
175120325828f313621cc5bc6c504803 MesaGLUT-7.10.2.tar.gz
8c71d273f5f8d6c5eda4ffc39e0fe03e MesaGLUT-7.10.2.tar.bz2
03036c8efe7b791a90fa0f2c41b43f43 MesaGLUT-7.10.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29172">Bug 29172</a> - Arrandale - Pill Popper Pops Pills</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31159">Bug 31159</a> - shadow problem in 0ad game</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32688">Bug 32688</a> - [RADEON:KMS:R300G] some games have a wireframe or outline visible</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32949">Bug 32949</a> - [glsl wine] Need for Speed renders incorrectly with GLSL enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34203">Bug 34203</a> - [GLSL] fail to call long chains across shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34376">Bug 34376</a> - [GLSL] allowing assignment to unsized array
<ul>
<li>The commit message incorrectly
lists <a href="https://bugs.freedesktop.org/show_bug.cgi?id=34367">bug
34367</a>.</li>
</ul>
</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34370">Bug 34370</a> - [GLSL] "i&lt;5 &amp;&amp; i&lt;4" in for loop fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34374">Bug 34374</a> - [GLSL] fail to redeclare an array using initializer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35073">Bug 35073</a> - [GM45] Alpha test is broken when rendering to FBO with no color attachment</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35483">Bug 35483</a> - util_blit_pixels_writemask: crash in line 322 of src/gallium/auxiliary/util/u_blit.c</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10.1..mesa-7.10.2
</pre>
<p><em>Note:</em> Reverted commits and the reverts are not included in this list.</p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new ontario pci ids</li>
<li>r600g: add some additional ontario pci ids</li>
</ul></p>
<p>Benjamin Franzke (1):
<ul>
<li>st/dri: Fix surfaceless gl using contexts with previous bound surfaces</li>
</ul></p>
<p>Brian Paul (9):
<ul>
<li>docs: pull 7.9.2 release notes into 7.10 branch</li>
<li>docs: update news.html with 7.10.1 and 7.9.2 releases</li>
<li>docs: fill in 7.10.1 release data</li>
<li>docs: add, fix release notes links</li>
<li>docs: update info about Mesa packaging/contents</li>
<li>docs: update prerequisites, remove old demo info</li>
<li>mesa: Guard against null pointer deref in fbo validation</li>
<li>st/mesa: Apply LOD bias from correct texture unit</li>
<li>glsl: silence warning in printf() with a cast</li>
</ul></p>
<p>Chad Versace (1):
<ul>
<li>i965: Fix tex_swizzle when depth mode is GL_RED</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r600: don't close fd on failed load</li>
</ul></p>
<p>Eric Anholt (2):
<ul>
<li>i965: Apply a workaround for the Ironlake "vertex flashing".</li>
<li>i965: Fix alpha testing when there is no color buffer in the FBO.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>st/mesa: Apply LOD from texture object</li>
</ul></p>
<p>Henri Verbeet (1):
<ul>
<li>st/mesa: Validate state before doing blits.</li>
</ul></p>
<p>Ian Romanick (13):
<ul>
<li>docs: Add 7.10.1 md5sums</li>
<li>glsl: Refactor AST-to-HIR code handling variable initializers</li>
<li>glsl: Refactor AST-to-HIR code handling variable redeclarations</li>
<li>glsl: Process redeclarations before initializers</li>
<li>glsl: Function signatures cannot have NULL return type</li>
<li>glsl: Add several function / call related validations</li>
<li>linker: Add imported functions to the linked IR</li>
<li>glsl: Use insert_before for lists instead of open coding it</li>
<li>glsl: Only allow unsized array assignment in an initializer</li>
<li>glcpp: Refresh autogenerated lexer files</li>
<li>docs: Initial bits of 7.10.2 release notes</li>
<li>mesa: set version string to 7.10.2</li>
<li>mesa: Remove nonexistant files from _FILES lists</li>
</ul></p>
<p>Jerome Glisse (1):
<ul>
<li>r600g: move user fence into base radeon structure</li>
</ul></p>
<p>José Fonseca (2):
<ul>
<li>mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*).</li>
<li>mesa: More glGet* fixes.</li>
</ul></p>
<p>Kenneth Graunke (4):
<ul>
<li>glcpp: Rework lexer to use a SKIP state rather than REJECT.</li>
<li>glcpp: Remove trailing contexts from #if rules.</li>
<li>i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.</li>
<li>glsl: Accept precision qualifiers on sampler types, but only in ES.</li>
</ul></p>
<p>Marek Olšák (15):
<ul>
<li>st/mesa: fix crash when DrawBuffer-&gt;_ColorDrawBuffers[0] is NULL</li>
<li>st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails</li>
<li>r300/compiler: fix the saturate modifier when applied to TEX instructions</li>
<li>r300/compiler: fix translating the src negate bits in pair_translate</li>
<li>r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)</li>
<li>r300/compiler: TEX instructions don't support negation on source arguments</li>
<li>r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500</li>
<li>r300/compiler: saturate Z before the shadow comparison</li>
<li>r300/compiler: fix equal and notequal shadow compare functions</li>
<li>r300/compiler: remove unused variables</li>
<li>st/mesa: fix crash when using both user and vbo buffers with the same stride</li>
<li>r300g: fix alpha-test with no colorbuffer</li>
<li>r300g: tell the GLSL compiler to lower the continue opcode</li>
<li>r300/compiler: propagate SaturateMode down to the result of shadow comparison</li>
<li>r300/compiler: apply the texture swizzle to shadow pass and fail values too</li>
</ul></p>
<p>Michel Dänzer (1):
<ul>
<li>Use proper source row stride when getting depth/stencil texels.</li>
</ul></p>
<p>Tom Stellard (4):
<ul>
<li>r300/compiler: Use a 4-bit writemask in pair instructions</li>
<li>prog_optimize: Fix reallocating registers for shaders with loops</li>
<li>r300/compiler: Fix vertex shader MAD instructions with constant swizzles</li>
<li>r300/compiler: Don't try to convert RGB to Alpha in full instructions</li>
</ul></p>
</body>
</html>

303
docs/relnotes-7.10.3.html Normal file
View File

@@ -0,0 +1,303 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.3 Release Notes / June 13, 2011</H1>
<p>
Mesa 7.10.3 is a bug fix release which fixes bugs found since the 7.10.2 release.
</p>
<p>
Mesa 7.10.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
8c38fe8266be8e1ed1d84076ba5a703b MesaLib-7.10.3.tar.bz2
614d063ecd170940d9ae7b355d365d59 MesaLib-7.10.3.zip
8768fd562ede7ed763d92b2d22232d7a MesaGLUT-7.10.3.tar.gz
1496415b89da9549f0f3b34d9622e2e2 MesaGLUT-7.10.3.tar.bz2
1f29d0e7398fd3bf9f36f5db02941198 MesaGLUT-7.10.3.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31590">Bug 31590</a> - Black space between colors on mole hill example</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32395">Bug 32395</a> - [glsl] Incorrect code generation for shadow2DProj() with bias</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32564">Bug 32564</a> - [llvmpipe] prog: Unknown command line argument '-disable-mmx'. Try: 'prog -help' with llvm-2.9svn</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32835">Bug 32835</a> - [glsl] recursive #define results in infinite stack recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33303">Bug 33303</a> - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33314">Bug 33314</a> - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33512">Bug 33512</a> - [SNB] case ogles2conform/GL/gl_FragCoord/gl_FragCoord_xy_frag.test and gl_FragCoord_w_frag.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34280">Bug 34280</a> - r200 mesa-7.10 font distortion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34321">Bug 34321</a> - The ARB_fragment_program subset of ARB_draw_buffers not implemented</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35603">Bug 35603</a> - GLSL compiler freezes compiling shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36173">Bug 36173</a> - struct renderbuffer's 'format' field never set when using FBO</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36238">Bug 36238</a> - Mesa release files don't contain scons control files</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36410">Bug 36410</a> - [SNB] Rendering errors in 3DMMES subtest taiji</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36527">Bug 36527</a> - [wine] Wolfenstein: Failed to translate rgb instruction.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36651">Bug 36651</a> - mesa requires bison and flex to build but configure does not check for them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36738">Bug 36738</a> - Openarena crash with r300g, swrastg + llvm &gt; 2.8</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37648">Bug 37648</a> - Logic error in mesa/main/teximage.c:texsubimage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37739">Bug 37739</a> - Color clear of FBO without color buffer crashes</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10.2..mesa-7.10.3
</pre>
<p>Alan Hourihane (1):
<ul>
<li>Check for out of memory when creating fence</li>
</ul></p>
<p>Alex Buell (1):
<ul>
<li>configure: bump LIBDRM_REQUIRED to 2.4.24</li>
</ul></p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new pci ids</li>
<li>r600g: add new pci ids</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>docs: add link to 7.10.2 release notes</li>
<li>scons: remove dangling reference to state_trackers/python/SConscript</li>
<li>Makefile: add missing Scons files</li>
<li>llvmpipe: document issue with LLVM 2.8 and earlier with AVX</li>
<li>docs: replace llvmpipe/README with docs/llvmpipe.html</li>
<li>glsl: add static qualifier to silence warning</li>
<li>glsl: add cast to silence signed/unsigned comparison warning</li>
<li>mesa: s/height/depth/ in texsubimage()</li>
<li>mesa: fix void pointer arithmetic warnings</li>
<li>mesa: add some missing GLAPIENTRY keywords</li>
<li>mesa: check that flex/bison are installed</li>
<li>st/mesa: fix incorrect texture level/face/slice accesses</li>
<li>draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)</li>
<li>vbo: check array indexes to prevent negative indexing</li>
<li>vbo: remove node-&gt;count &gt; 0 test in vbo_save_playback_vertex_list()</li>
<li>st/mesa: fix software accum buffer format bug</li>
<li>mesa: add include/c99/inttypes.h include/c99/stdbool.h include/c99/stdint.h files to tarballs</li>
<li>docs: 7.10.3 release notes skeleton file, links</li>
<li>mesa: bump version to 7.10.3</li>
</ul></p>
<p>Carl Worth (2):
<ul>
<li>glcpp: Simplify calling convention of parser's active_list functions</li>
<li>glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>st/mesa: fix compressed mipmap generation.</li>
</ul></p>
<p>Eric Anholt (19):
<ul>
<li>i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.</li>
<li>glsl: Avoid cascading errors when looking for a scalar boolean and failing.</li>
<li>glsl: Semantically check the RHS of `&amp;&amp;' even when short-circuiting.</li>
<li>glsl: Semantically check the RHS of `||' even when short-circuiting.</li>
<li>glsl: When we've emitted a semantic error for ==, return a bool constant.</li>
<li>glsl: Perform type checking on "^^" operands.</li>
<li>intel: Use _mesa_base_tex_format for FBO texture attachments.</li>
<li>swrast: Don't assert against glReadPixels of GL_RED and GL_RG.</li>
<li>mesa: Add a gl_renderbuffer.RowStride field like textures have.</li>
<li>mesa: Add a function to set up the default renderbuffer accessors.</li>
<li>intel: Use Mesa core's renderbuffer accessors for depth.</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*</li>
<li>mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.</li>
<li>swrast: Don't try to adjust_colors for &lt8bpc when handling R16, RG1616.</li>
<li>intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.</li>
<li>Revert "intel: Add spans code for the ARB_texture_rg support."</li>
<li>mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.</li>
<li>mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.</li>
</ul></p>
<p>Hans de Goede (1):
<ul>
<li>texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616</li>
</ul></p>
<p>Henri Verbeet (3):
<ul>
<li>mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.</li>
<li>glx: Destroy dri2Hash on DRI2 display destruction.</li>
<li>glx: Only remove the glx_display from the list after it's destroyed.</li>
</ul></p>
<p>Ian Romanick (9):
<ul>
<li>docs: Add 7.10.2 md5sums</li>
<li>glsl: Fix off-by-one error setting max_array_access for non-constant indexing</li>
<li>ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly</li>
<li>intel: Fix ROUND_DOWN_TO macro</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>i965: Remove hint_gs_always and resulting dead code</li>
<li>mesa: Don't try to clear a NULL renderbuffer</li>
<li>mesa: Ignore blits to/from missing buffers</li>
<li>docs: Add list of bugs fixed in 7.10.3 release</li>
</ul></p>
<p>Jeremy Huddleston (18):
<ul>
<li>apple: Update GL specs</li>
<li>apple: Rename glcontextmodes.[ch] to glxconfig.[ch]</li>
<li>apple: Rename __GLcontextModes to struct glx_config</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Re-add driContext and do_destroy</li>
<li>apple: Rename _gl_context_modes_find_visual to glx_config_find_visual</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Change from XExtDisplayInfo to struct glx_display</li>
<li>apple: ifdef out come glapi-foo on darwin</li>
<li>glx: Dead code removal</li>
<li>apple: Build darwin using applegl rather than indirect</li>
<li>apple: Fix build failures in applegl_glx.c</li>
<li>darwin: Define GALLIUM_DRIVERS_DIRS in darwin config</li>
<li>apple: Package applegl source into MesaLib tarball</li>
<li>darwin: Set VG_LIB_{NAME,GLOB} to fix make install</li>
<li>darwin: Don't link against libGL when building libOSMesa</li>
<li>darwin: Fix VG_LIB_GLOB to also match the unversioned symlink</li>
<li>osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.</li>
</ul></p>
<p>José Fonseca (13):
<ul>
<li>llvmpipe: Update readme.</li>
<li>mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean.</li>
<li>mesa: Fix GetVertexAttrib* inside display lists.</li>
<li>draw: Fix draw_variant_output::format's type.</li>
<li>gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.</li>
<li>gallivm: Fix for dynamically linked LLVM 2.8 library.</li>
<li>st/wgl: Adjust the pbuffer invisible window size.</li>
<li>st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().</li>
<li>st/wgl: Prevent spurious framebuffer sizes when the window is minimized.</li>
<li>st/wgl: Cope with zero width/height windows.</li>
<li>st/wgl: Allow to create pbuffers bigger than the desktop.</li>
<li>st/wgl: Remove buggy assertion.</li>
<li>wgl: Don't hold on to user supplied HDC.</li>
</ul></p>
<p>Kenneth Graunke (10):
<ul>
<li>i965/fs: Switch W and 1/W in Sandybridge interpolation setup.</li>
<li>i965: Refactor Sandybridge implied move handling.</li>
<li>i965: Resolve implied moves in brw_dp_READ_4_vs_relative.</li>
<li>intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.</li>
<li>i965: Allocate the whole URB to the VS and fix calculations for Gen6.</li>
<li>intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.</li>
<li>glsl: Fix memory error when creating the supported version string.</li>
<li>glsl: Regenerate autogenerated file builtin_function.cpp.</li>
<li>i965: Rename various gen6 #defines to match the documentation.</li>
<li>i965: Never enable the GS on Gen6.</li>
</ul></p>
<p>Kostas Georgiou (1):
<ul>
<li>r600c/g: Add pci id for FirePro 2270</li>
</ul></p>
<p>Marek Olšák (18):
<ul>
<li>tgsi/ureg: bump the limit of immediates</li>
<li>st/mesa: fix changing internal format via RenderbufferStorage</li>
<li>st/mesa: GenerateMipmap should not be killed by conditional rendering</li>
<li>swrast: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering</li>
<li>st/mesa: conditional rendering should not kill texture decompression via blit</li>
<li>mesa: forbid UseProgram to be called inside Begin/End</li>
<li>mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End</li>
<li>mesa: queries of non-existent FBO attachments should return INVALID_OPERATION</li>
<li>r300g: fix draw_vbo splitting on r3xx-r4xx</li>
<li>r300g: fix texturing with non-3D textures and wrap R mode set to sample border</li>
<li>r300g: fix occlusion queries when depth test is disabled or zbuffer is missing</li>
<li>r300g: clear can be killed by render condition</li>
<li>st/mesa: remove asserts in st_texture_image_copy</li>
<li>mesa: fix up assertion in _mesa_source_buffer_exists</li>
<li>mesa: invalidate framebuffer if internal format of renderbuffer is changed</li>
<li>mesa: return after invalidating renderbuffer</li>
</ul></p>
<p>Matt Turner (1):
<ul>
<li>r300/compiler: align memory allocations to 8-bytes</li>
</ul></p>
<p>Tom Stellard (3):
<ul>
<li>r300/compiler: Fix incorrect presubtract conversion</li>
<li>r300/compiler: Fix dataflow analysis bug with ELSE blocks</li>
<li>r300/compiler: Limit instructions to 3 source selects</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>gallivm: Disable MMX-disabling code on llvm-2.9.</li>
</ul></p>
<p>Zou Nan hai (1):
<ul>
<li>i965: Align interleaved URB write length to 2</li>
</ul></p>
<p>pepp (1):
<ul>
<li>st/mesa: assign renderbuffer's format field when allocating storage</li>
</ul></p>
</body>
</html>

2795
docs/relnotes-7.10.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
c89b63d253605ed40e8ac370d25a833c MesaLib-7.8.2.tar.gz
6be2d343a0089bfd395ce02aaf8adb57 MesaLib-7.8.2.tar.bz2
a04ad3b06ac5ff3969a003fa7bbf7d5b MesaLib-7.8.2.zip
7c213f92efeb471f0331670d5079d4c0 MesaDemos-7.8.2.tar.gz
757d9e2e06f48b1a52848be9b0307ced MesaDemos-7.8.2.tar.bz2
8d0e5cfe68b8ebf90265d350ae2c48b1 MesaDemos-7.8.2.zip
b74482e3f44f35ed395c4aada4fd8240 MesaGLUT-7.8.2.tar.gz
a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
9f190268c42be582ef66e47365ee61e3 MesaGLUT-7.8.2.zip
</pre>
@@ -44,10 +52,95 @@ tbd
<ul>
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
<li>Fixed Gallium Cell driver to buildable, runable state
<li>Fixed bad error checking for glFramebufferRenderbuffer(attachment=GL_DEPTH_STENCIL_ATTACHMENT).
<li>Fixed incorrect Z coordinate handling in "meta" glDraw/CopyPixels.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">Bug
#23670</a>.</li>
<li>Assorted i965 driver fixes.
Including but not limited to:
<ul>
<li>Fix scissoring when width or height is
0. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27643">Bug
#27643</a>.
<li>Fix bit allocation for number of color regions for
ARB_draw_buffers.</li>
<li>Set the correct provoking vertex for clipped first-mode
trifans. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24470">Bug
#24470</a>.</li>
<li>Use <code>R16G16B16A16_FLOAT</code> for 3-component half-float.</li>
<li>Fix assertion for surface tile offset usage on Ironlake.</li>
<li>Fix cube map layouts on Ironlake.</li>
<li>When an RB gets a new region, clear the old from the state
cache. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24119">Bug
#24119</a>.</li>
<li>Reject shaders with uninlined function calls instead of hanging.</li>
</ul>
</li>
<li>Assorted i915 driver fixes. Including but not limited to:
<ul>
<li>Fixed texture LOD clamping in i915 driver.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=24846">Bug
#24846</a>.</li>
<li>Fix off-by-one for drawing rectangle.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27408">Bug
#27408</a>.</li>
</ul>
</li>
<li>Fixed hangs in etracer on 830 and 845
chipsets. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26557">Bug
#26557</a>.</li>
<li>Fixed tiling of small textures on all Intel drivers.</li>
<li>Fixed crash in Savage driver when using <code>_mesa_CopyTexImage2D</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27652">Bug
#27652</a>.</li>
<li>Assorted GLX fixes. Including but not limited to:
<ul>
<li>Fixed <code>__glXInitializeVisualConfigFromTags</code>'s handling of
unrecognized fbconfig tags.</li>
<li>Fixed regression with <code>GLX_USE_GL</code>.
<li>Fixed config chooser logic for 'mask' matching.</li>
<li>Report swap events correctly in direct rendered case (DRI2)</li>
<li>Fixed build with dri2proto which doesn't define
<code>X_DRI2SwapInterval</code>.</li>
<li>Get <code>GLX_SCREEN</code> first in <code>__glXQueryContextInfo</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=14245">Bug
#14245</a>.</li>
</ul>
</li>
<li>Assorted GLSL fixes. Including but not limited to:
<ul>
<li>Change variable declared assertion into conditional in GLSL
compiler. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27921">Bug
#27921</a>.</li>
<li>Fix instruction indexing
bugs. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27566">Bug
#27566</a>.</li>
<li>Updated uniform location / offset encoding to be more like
other implementations.</li>
<li>Don't overwrite a driver's shader infolog with generic failure
message.</li>
</ul>
</li>
<li>Fixed OSMesa build for 16 and 32-bit color channel depth.
<li>Fixed OSMesa build with hidden symbol visibility. libOSMesa no longer links to libGL.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28305">Bug
#28305</a>.
<li>Fixed handling of multiple render targets in fixed-function
texture envrionmnent programs.</li>
<li>Fixed conversion errors in <code>signed_rgba8888[rev]</code> texel
fetch.</li>
<li>Don't set srcLevel on <code>GL_TEXTURE_RECTANGLE_ARB</code> targets.</li>
<li>Various build fixes for OpenBSD.</li>
<li>Various build fixes for OS X.</li>
<li>Various build fixes for GCC 3.3.</li>
</ul>
<h2>Changes</h2>
<p>None.</p>
</body>
</html>

89
docs/relnotes-7.8.3.html Normal file
View File

@@ -0,0 +1,89 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.3 Release Notes / (date tbd)</H1>
<p>
Mesa 7.8.3 is a bug fix release which fixes bugs found since the 7.8.2 release.
</p>
<p>
Mesa 7.8.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
x MesaLib-7.8.3.tar.gz
x MesaLib-7.8.3.tar.bz2
x MesaLib-7.8.3.zip
x MesaDemos-7.8.3.tar.gz
x MesaDemos-7.8.3.tar.bz2
x MesaDemos-7.8.3.zip
x MesaGLUT-7.8.3.tar.gz
x MesaGLUT-7.8.3.tar.bz2
x MesaGLUT-7.8.3.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Changes</h2>
<ul>
<li>The radeon driver should use less memory when searching for a valid mip
image.</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fix unsupported FB with D24S8 (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">29116</a>)</li>
<li>Fix ReadPixels crash when reading depth/stencil from an FBO</li>
<li>Fixed a bug rendering to 16-bit buffers using swrast.</li>
<li>Fixed a state tracker/TGSI bug that caused crashes when using Windows'
memory debugging features.</li>
<li>Fixed an issue rendering to 32-bit channels with swrast (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29487">29487</a>)</li>
<li>GLSL: fix indirect <TT>gl_TextureMatrix</TT> addressing (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">28967</a>)</li>
<li>GLSL: fix for bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">27216</a></li>
<li>GLSL: fix zw fragcoord entries in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29183">29183</a>)</li>
<li>Fix texture env generation in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28169">28169</a>)</li>
<li>osmesa: a fix for calling <TT>OSMesaMakeCurrent</TT> twice was applied (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=10966">10966</a></li>
<li>A bug was fixed which could cause Mesa to ignore the
<TT>MESA_EXTENSION_OVERRIDE</TT> environment variable.</li>
<li>A bug related to specular highlights on backfaces was fixed.</li>
<li>A radeon-specific issue with <TT>glCopyTex(Sub)Image</TT> was
corrected.</li>
<li>radeon/wine: flush command stream in more cases, fixing wine d3d9
tests.</li>
<li>r600: fix sin+cos normalization.</li>
<li>r600: (properly) ignore <TT>GL_COORD_REPLACE</TT> when point sprites are
disabled.</li>
<li>radeon: avoid flushing when the context is not current.</li>
<li>r300c: a bug affecting unaligned BOs was fixed.</li>
<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
</ul>
</body>
</html>

406
docs/relnotes-7.9.1.html Normal file
View File

@@ -0,0 +1,406 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.1 Release Notes / January 7, 2011</H1>
<p>
Mesa 7.9.1 is a bug fix release which fixes bugs found since the 7.9 release.
</p>
<p>
Mesa 7.9.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
78422843ea875ad4eac35b9b8584032b MesaLib-7.9.1.tar.gz
07dc6cfb5928840b8b9df5bd1b3ae434 MesaLib-7.9.1.tar.bz2
c8eaea5b3c3d6dee784bd8c2db91c80f MesaLib-7.9.1.zip
ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
41fc477d524e7dc5c84da8ef22422bea MesaGLUT-7.9.1.tar.bz2
90b287229afdf19317aa989d19462e7a MesaGLUT-7.9.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28800">Bug 28800</a> - [r300c, r300g] Texture corruption with World of Warcraft</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29420">Bug 29420</a> - Amnesia / HPL2 RendererFeatTest - not rendering correctly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29946">Bug 29946</a> - [swrast] piglit valgrind glsl-array-bounds-04 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30261">Bug 30261</a> - [GLSL 1.20] allowing inconsistent invariant declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30632">Bug 30632</a> - [softpipe] state_tracker/st_manager.c:489: st_context_notify_invalid_framebuffer: Assertion `stfb &amp;&amp; stfb-&gt;iface == stfbi' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30694">Bug 30694</a> - wincopy will crash on Gallium drivers when going to front buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30787">Bug 30787</a> - Invalid asm shader does not generate draw-time error when used with GLSL shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30993">Bug 30993</a> - getFramebufferAttachmentParameteriv wrongly generates error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31101">Bug 31101</a> - [glsl2] abort() in ir_validate::visit_enter(ir_assignment *ir)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31193">Bug 31193</a> - [regression] aa43176e break water reflections</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31194">Bug 31194</a> - The mesa meta save/restore code doesn't ref the current GLSL program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31371">Bug 31371</a> - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type &gt;= 0) &amp;&amp; (type->base_type &lt;= 3)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31439">Bug 31439</a> - Crash in glBufferSubData() with size == 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31495">Bug 31495</a> - [i965 gles2c bisected] OpenGL ES 2.0 conformance GL2Tests_GetBIFD_input.run regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31514">Bug 31514</a> - isBuffer returns true for unbound buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31560">Bug 31560</a> - [tdfx] tdfx_tex.c:702: error: const struct gl_color_table has no member named Format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31617">Bug 31617</a> - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31648">Bug 31648</a> - [GLSL] array-struct-array gets assertion: `(size &gt;= 1) && (size &lt;= 4)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31650">Bug 31650</a> - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31673">Bug 31673</a> - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31690">Bug 31690</a> - i915 shader compiler fails to flatten if in Aquarium webgl demo.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31832">Bug 31832</a> - [i915] Bad renderbuffer format: 21</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31841">Bug 31841</a> - [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31894">Bug 31894</a> - Writing to gl_PointSize with GLES2 corrupts other varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31909">Bug 31909</a> - [i965] brw_fs.cpp:1461: void fs_visitor::emit_bool_to_cond_code(ir_rvalue*): Assertion `expr-&gt;operands[i]-&gt;type-&gt;is_scalar()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31934">Bug 31934</a> - [gallium] Mapping empty buffer object causes SIGSEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31983">Bug 31983</a> - [i915 gles2] "if (expression with builtin/varying variables) discard" breaks linkage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31985">Bug 31985</a> - [GLSL 1.20] initialized uniform array considered as "unsized"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31987">Bug 31987</a> - [gles2] if input a wrong pname(GL_NONE) to glGetBoolean, it will not case GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32035">Bug 32035</a> - [GLSL bisected] comparing unsized array gets segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32070">Bug 32070</a> - llvmpipe renders stencil demo incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32273">Bug 32273</a> - assertion fails when starting vdrift 2010 release with shaders enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32287">Bug 32287</a> - [bisected GLSL] float-int failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32311">Bug 32311</a> - [965 bisected] Array look-ups broken on GM45</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32520">Bug 32520</a> - [gles2] glBlendFunc(GL_ZERO, GL_DST_COLOR) will result in GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32825">Bug 32825</a> - egl_glx driver completely broken in 7.9 branch [fix in master]</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9..mesa-7.9.1
</pre>
<p>Alex Deucher (5):
<ul>
<li>r100: revalidate after radeon_update_renderbuffers</li>
<li>r600c: add missing radeon_prepare_render() call on evergreen</li>
<li>r600c: properly align mipmaps to group size</li>
<li>gallium/egl: fix r300 vs r600 loading</li>
<li>r600c: fix some opcodes on evergreen</li>
</ul></p>
<p>Aras Pranckevicius (2):
<ul>
<li>glsl: fix crash in loop analysis when some controls can't be determined</li>
<li>glsl: fix matrix type check in ir_algebraic</li>
</ul></p>
<p>Brian Paul (27):
<ul>
<li>swrast: fix choose_depth_texture_level() to respect mipmap filtering state</li>
<li>st/mesa: replace assertion w/ conditional in framebuffer invalidation</li>
<li>egl/i965: include inline_wrapper_sw_helper.h</li>
<li>mesa: Add missing else in do_row_3D</li>
<li>mesa: add missing formats in _mesa_format_to_type_and_comps()</li>
<li>mesa: handle more pixel types in mipmap generation code</li>
<li>mesa: make glIsBuffer() return false for never bound buffers</li>
<li>mesa: fix glDeleteBuffers() regression</li>
<li>swrast: init alpha value to 1.0 in opt_sample_rgb_2d()</li>
<li>meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear</li>
<li>st/mesa: fix mapping of zero-sized buffer objects</li>
<li>mesa: check for posix_memalign() errors</li>
<li>llvmpipe: fix broken stencil writemask</li>
<li>mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query</li>
<li>mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type</li>
<li>mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM</li>
<li>mesa: test for cube map completeness in glGenerateMipmap()</li>
<li>tnl: Initialize gl_program_machine memory in run_vp.</li>
<li>tnl: a better way to initialize the gl_program_machine memory</li>
<li>mesa, st/mesa: disable GL_ARB_geometry_shader4</li>
<li>glsl: fix off by one in register index assertion</li>
<li>st/mesa: fix mipmap generation bug</li>
<li>glsl: new glsl_strtod() wrapper to fix decimal point interpretation</li>
<li>mesa: no-op glBufferSubData() on size==0</li>
<li>tdfx: s/Format/_BaseFormat/</li>
<li>st/mesa: fix renderbuffer pointer check in st_Clear()</li>
<li>mesa: Bump the number of bits in the register index.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Fix lexer rule for ^=</li>
<li>glsl: Fix ast-to-hir for ARB_fragment_coord_conventions</li>
<li>glsl: Fix ir_expression::constant_expression_value()</li>
<li>glsl: Fix erroneous cast in ast_jump_statement::hir()</li>
<li>glsl: Fix linker bug in cross_validate_globals()</li>
</ul></p>
<p>Chia-I Wu (10):
<ul>
<li>targets/egl: Fix linking with libdrm.</li>
<li>st/vega: Fix version check in context creation.</li>
<li>st/egl: Do not finish a fence that is NULL.</li>
<li>egl: Fix a false negative check in _eglCheckMakeCurrent.</li>
<li>st/mesa: Unreference the sampler view in st_bind_surface.</li>
<li>egl_dri2: Fix __DRI_DRI2 version 1 support.</li>
<li>st/vega: Do not wait NULL fences.</li>
<li>mesa: Do not advertise GL_OES_texture_3D.</li>
<li>egl_glx: Fix borken driver.</li>
<li>egl: Check extensions.</li>
</ul></p>
<p>Daniel Lichtenberger (1):
<ul>
<li>radeon: fix potential segfault in renderbuffer update</li>
</ul></p>
<p>Daniel Vetter (1):
<ul>
<li>r200: revalidate after radeon_update_renderbuffers</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r300g: fixup rs690 tiling stride alignment calculations.</li>
</ul></p>
<p>Eric Anholt (13):
<ul>
<li>intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.</li>
<li>glsl: Free the loop state context when we free the loop state.</li>
<li>i965: Allow OPCODE_SWZ to put immediates in the first arg.</li>
<li>i965: Add support for rendering to SARGB8 FBOs.</li>
<li>glsl: Add a helper constructor for expressions that works out result type.</li>
<li>glsl: Fix structure and array comparisions.</li>
<li>glsl: Quiet unreachable no-return-from-function warning.</li>
<li>glsl: Mark the array access for whole-array comparisons.</li>
<li>glsl: Fix flipped return of has_value() for array constants.</li>
<li>mesa: Add getters for the rest of the supported draw buffers.</li>
<li>mesa: Add getters for ARB_copy_buffer's attachment points.</li>
<li>i965: Correct the dp_read message descriptor setup on g4x.</li>
<li>glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>glsl: fix lowering conditional returns in subroutines</li>
</ul></p>
<p>Francisco Jerez (3):
<ul>
<li>meta: Don't leak alpha function/reference value changes.</li>
<li>meta: Fix incorrect rendering of the bitmap alpha component.</li>
<li>meta: Don't try to disable cube maps if the driver doesn't expose the extension.</li>
</ul></p>
<p>Henri Verbeet (2):
<ul>
<li>r600: Evergreen has two extra frac_bits for the sampler LOD state.</li>
<li>st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().</li>
</ul></p>
<p>Ian Romanick (33):
<ul>
<li>Add 7.9 md5sums</li>
<li>docs: Import 7.8.x release notes from 7.8 branch.</li>
<li>docs: download.html does not need to be updated for each release</li>
<li>docs: Update mailing lines from sf.net to freedesktop.org</li>
<li>docs: added news item for 7.9 release</li>
<li>mesa: Validate assembly shaders when GLSL shaders are used</li>
<li>linker: Reject shaders that have unresolved function calls</li>
<li>mesa: Refactor validation of shader targets</li>
<li>glsl: Slightly change the semantic of _LinkedShaders</li>
<li>linker: Improve handling of unread/unwritten shader inputs/outputs</li>
<li>glsl: Commit lexer files changed by previous cherry picking</li>
<li>mesa: Make metaops use program refcounts instead of names.</li>
<li>glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow</li>
<li>mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample</li>
<li>glsl: better handling of linker failures</li>
<li>mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.</li>
<li>i915: Disallow alpha, red, RG, and sRGB as render targets</li>
<li>glsl/linker: Free any IR discarded by optimization passes.</li>
<li>glsl: Add an optimization pass to simplify discards.</li>
<li>glsl: Add a lowering pass to move discards out of if-statements.</li>
<li>i915: Correctly generate unconditional KIL instructions</li>
<li>glsl: Add unary ir_expression constructor</li>
<li>glsl: Ensure that equality comparisons don't return a NULL IR tree</li>
<li>glcpp: Commit changes in generated files cause by previous commit</li>
<li>glsl: Inherrit type of declared variable from initializer</li>
<li>glsl: Inherrit type of declared variable from initializer after processing assignment</li>
<li>linker: Ensure that unsized arrays have a size after linking</li>
<li>linker: Fix regressions caused by previous commit</li>
<li>linker: Allow built-in arrays to have different sizes between shader stages</li>
<li>ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors</li>
<li>Refresh autogenerated file builtin_function.cpp.</li>
<li>docs: Initial set of release notes for 7.9.1</li>
<li>mesa: set version string to 7.9.1</li>
</ul></p>
<p>Julien Cristau (1):
<ul>
<li>Makefile: don't include the same files twice in the tarball</li>
</ul></p>
<p>Kenneth Graunke (19):
<ul>
<li>glcpp: Return NEWLINE token for newlines inside multi-line comments.</li>
<li>generate_builtins.py: Output large strings as arrays of characters.</li>
<li>glsl: Fix constant component count in vector constructor emitting.</li>
<li>ir_dead_functions: Actually free dead functions and signatures.</li>
<li>glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version &gt;= 1.30.</li>
<li>glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.</li>
<li>glsl: Fix constant expression handling for &lt, &gt;, &lt=, &gt;= on vectors.</li>
<li>glsl: Use do_common_optimization in the standalone compiler.</li>
<li>glsl: Don't inline function prototypes.</li>
<li>glsl: Add a virtual as_discard() method.</li>
<li>glsl: Remove "discard" support from lower_jumps.</li>
<li>glsl: Refactor get_num_operands.</li>
<li>glcpp: Don't emit SPACE tokens in conditional_tokens production.</li>
<li>glsl: Clean up code by adding a new is_break() function.</li>
<li>glsl: Consider the "else" branch when looking for loop breaks.</li>
<li>Remove OES_compressed_paletted_texture from the ES2 extension list.</li>
<li>glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).</li>
<li>Fix build on systems where "python" is python 3.</li>
<li>i965: Internally enable GL_NV_blend_square on ES2.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>i965: Don't write mrf assignment for pointsize output</li>
</ul></p>
<p>Luca Barbieri (1):
<ul>
<li>glsl: Unroll loops with conditional breaks anywhere (not just the end)</li>
</ul></p>
<p>Marek Olšák (17):
<ul>
<li>r300g: fix microtiling for 16-bits-per-channel formats</li>
<li>r300g: fix texture border for 16-bits-per-channel formats</li>
<li>r300g: add a default channel ordering of texture border for unhandled formats</li>
<li>r300g: fix texture border color for all texture formats</li>
<li>r300g: fix rendering with no vertex elements</li>
<li>r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction</li>
<li>r300g: fix texture border color once again</li>
<li>r300g: fix texture swizzling with compressed textures on r400-r500</li>
<li>r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only</li>
<li>mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium</li>
<li>st/mesa: initialize key in st_vp_varient</li>
<li>r300/compiler: fix swizzle lowering with a presubtract source operand</li>
<li>r300g: fix rendering with a vertex attrib having a zero stride</li>
<li>ir_to_mesa: Add support for conditional discards.</li>
<li>r300g: finally fix the texture corruption on r3xx-r4xx</li>
<li>mesa: fix texel store functions for some float formats</li>
<li>r300/compiler: disable the rename_regs pass for loops</li>
</ul></p>
<p>Mario Kleiner (1):
<ul>
<li>mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.</li>
</ul></p>
<p>Peter Clifton (1):
<ul>
<li>intel: Fix emit_linear_blit to use DWORD aligned width blits</li>
</ul></p>
<p>Robert Hooker (2):
<ul>
<li>intel: Add a new B43 pci id.</li>
<li>egl_dri2: Add missing intel chip ids.</li>
</ul></p>
<p>Roland Scheidegger (1):
<ul>
<li>r200: fix r200 large points</li>
</ul></p>
<p>Thomas Hellstrom (17):
<ul>
<li>st/xorg: Don't try to use option values before processing options</li>
<li>xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers</li>
<li>st/xorg: Add a customizer option to get rid of annoying cursor update flicker</li>
<li>xorg/vmwgfx: Don't hide HW cursors when updating them</li>
<li>st/xorg: Don't try to remove invalid fbs</li>
<li>st/xorg: Fix typo</li>
<li>st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments</li>
<li>st/xorg: Fix compilation errors for Xservers compiled without Composite</li>
<li>st/xorg: Don't use deprecated x*alloc / xfree functions</li>
<li>xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions</li>
<li>st/xorg: Fix compilation for Xservers &gt;= 1.10</li>
<li>mesa: Make sure we have the talloc cflags when using the talloc headers</li>
<li>egl: Add an include for size_t</li>
<li>mesa: Add talloc includes for gles</li>
<li>st/egl: Fix build for include files in nonstandard places</li>
<li>svga/drm: Optionally resolve calls to powf during link-time</li>
<li>gallium/targets: Trivial crosscompiling fix</li>
</ul></p>
<p>Tom Stellard (7):
<ul>
<li>r300/compiler: Make sure presubtract sources use supported swizzles</li>
<li>r300/compiler: Fix register allocator's handling of loops</li>
<li>r300/compiler: Fix instruction scheduling within IF blocks</li>
<li>r300/compiler: Use zero as the register index for unused sources</li>
<li>r300/compiler: Ignore alpha dest register when replicating the result</li>
<li>r300/compiler: Use correct swizzles for all presubtract sources</li>
<li>r300/compiler: Don't allow presubtract sources to be remapped twice</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>glsl: Fix 'control reaches end of non-void function' warning.</li>
</ul></p>
<p>richard (1):
<ul>
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul></p>
</body>
</html>

336
docs/relnotes-7.9.2.html Normal file
View File

@@ -0,0 +1,336 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.2 Release Notes / March 2, 2011</H1>
<p>
Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9.1 release.
</p>
<p>
Mesa 7.9.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
eb4ab8c1a03386def3ea34b1358e9cda MesaLib-7.9.2.tar.gz
8f6d1474912787ce13bd35f3bae9938a MesaLib-7.9.2.tar.bz2
427a81dd43ac97603768dc5c6af3df26 MesaLib-7.9.2.zip
aacb8f4db997e346db40c6066942140a MesaGLUT-7.9.2.tar.gz
18abe6cff4fad8ad4752c7b7ab548e5d MesaGLUT-7.9.2.tar.bz2
3189e5732d636c71baf3d8bc23ce7b11 MesaGLUT-7.9.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 GPU hang in GLSL shaders that contain an unconditional <tt>discard</tt> statement.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9.1..mesa-7.9.2
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add links to 7.9.1 and 7.9.2 release notes</li>
<li>mesa: include compiler.h for ASSERT macro</li>
<li>glsl: add ir_shader case in switch stmt to silence warning</li>
<li>glsl2: fix signed/unsigned comparison warning</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (14):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>intel: Check for unsupported texture when finishing using as a render target</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (2):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (11):
<ul>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.9.1 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial set of release notes for 7.9.2</li>
<li>mesa: bump version to 7.9.2-devel</li>
<li>docs: Update 7.9.2 release notes</li>
<li>i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>mesa: Remove unsupported OES extensions</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glcpp: Regenerate files from recent cherry picks</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.9.2 release notes for recent cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.9.2 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
</ul></p>
<p>Marek Olšák (3):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.9 Release Notes / date TBD</H1>
<H1>Mesa 7.9 Release Notes / October 4, 2010</H1>
<p>
Mesa 7.9 is a new development release.
@@ -28,7 +28,12 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
ed65ab425b25895c7f473d0a5e6e64f8 MesaLib-7.9.tar.gz
82c740c49d572baa6da2b1a1eee90bca MesaLib-7.9.tar.bz2
cd2b6ecec759b0457475e94bbb38fedb MesaLib-7.9.zip
7b54af9fb9b1f6a1a65db2520f50848f MesaGLUT-7.9.tar.gz
20d07419d1929f833fdb36bced290ad5 MesaGLUT-7.9.tar.bz2
62a7edecd7c92675cd6029b05217eb0a MesaGLUT-7.9.zip
</pre>
@@ -37,16 +42,85 @@ tbd
<li>New, improved GLSL compiler written by Intel.
See the <a href="shading.html"> Shading Language</a> page for
more information.
<li>GL_EXT_timer_query extension (i965 driver only)
<li>New, very experimental Gallium driver for R600-R700 Radeons.
<li>Support for AMD Evergreen-based Radeons (HD 5xxx)
<li>GL_EXT_timer_query extension (i965 driver and softpipe only)
<li>GL_EXT_framebuffer_multisample extension (intel drivers, MAX_SAMPLES = 1)
<li>GL_ARB_texture_swizzle extension (alias of GL_EXT_texture_swizzle)
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow
and GL_EXT_draw_buffers2 in Gallium drivers
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow,
GL_ARB_window_pos, GL_EXT_gpu_program_parameters,
GL_ATI_texture_env_combine3, GL_MESA_pack_invert, and GL_OES_EGL_image
extensions in Gallium drivers
<li>GL_ARB_depth_clamp and GL_NV_depth_clamp extensions (in nv50 and r600
Gallium drivers)
<li>GL_ARB_half_float_vertex extension (in nvfx, r300, r600, softpipe,
and llvmpipe Gallium drivers)
<li>GL_EXT_draw_buffers2 (in nv50, r600, softpipe, and llvmpipe Gallium
drivers)
<li>GL_EXT_texture_swizzle (in nvfx, r300, r600, softpipe, and llvmpipe
Gallium drivers)
<li>GL_ATI_texture_mirror_once (in nvfx, nv50, r300, r600, softpipe, and
llvmpipe Gallium drivers)
<li>GL_NV_conditional_render (in r300 Gallium driver)
<li>Initial "signs of life" support for Sandybridge hardware in i965 DRI
driver.
</ul>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Massive improvements to the Gallium driver for R300-R500 Radeons; this
driver is now considered stable for use as a DRI (OpenGL) driver.
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=10908">Bug 10908</a> - GLSL: gl_FogParamaters gl_Fog built-in uniform not functioning</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=13753">Bug 13753</a> - Numerous bugs in GLSL uniform handling</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16854">Bug 16854</a> - GLSL function call at global scope causes SEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16856">Bug 16856</a> - GLSL indexing of unsized array results in assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=18659">Bug 18659</a> - Crash in shader/slang/slang_codegen.c _slang_gen_function_call_name()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=19089">Bug 19089</a> - [GLSL] glsl1/shadow2D() cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=22622">Bug 22622</a> - [GM965 GLSL] noise*() cause GPU lockup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=23743">Bug 23743</a> - For loop from 0 to 0 not optimized out</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=24553">Bug 24553</a> - shader compilation times explode when using more () pairs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25664">Bug 25664</a> - [GLSL] re-declaring an empty array fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25769">Bug 25769</a> - [GLSL] "float" can be implicitly converted to "int"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25808">Bug 25808</a> - [GLSL] const variable is modified successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25826">Bug 25826</a> - [GLSL] declaring an unsized array then re-declaring with a size fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25827">Bug 25827</a> - [GLSL] vector constructor accepts too many arguments successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25829">Bug 25829</a> - [GLSL] allowing non-void function without returning value</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25830">Bug 25830</a> - [GLSL] allowing non-constant-expression as const declaration initializer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25877">Bug 25877</a> - [GLSL 1.10] implicit conversion from "int" to "float" should not be allowed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25878">Bug 25878</a> - [GLSL] sampler is converted to int successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25994">Bug 25994</a> - [GM45][GLSL] 'return' statement in vertex shader unsupported</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25999">Bug 25999</a> - [GLSL] embedded structure constructor fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26000">Bug 26000</a> - [GLSL] allowing different parameter qualifier between the function definition and declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26001">Bug 26001</a> - [GLSL 1.10] constructing matrix from matrix succeeds</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26224">Bug 26224</a> - [GLSL] Cannot get location of a uniform struct member</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26990">Bug 26990</a> - [GLSL] variable declaration in "while" fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27004">Bug 27004</a> - [GLSL] allowing macro redefinition</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27060">Bug 27060</a> - [965] piglit glsl-fs-raytrace failure due to lack of function calls.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">Bug 27216</a> - Assignment with a function call in an if statement causes an assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27261">Bug 27261</a> - GLSL Compiler fails on the following vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27265">Bug 27265</a> - GLSL Compiler doesnt link the attached vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27388">Bug 27388</a> - [i965] piglit glsl-vs-arrays failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27403">Bug 27403</a> - GLSL struct causing "Invalid src register file ..." error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27914">Bug 27914</a> - GLSL compiler uses MUL+ADD where it could use MAD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28055">Bug 28055</a> - glsl-texcoord-array fails GLSL compilation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28374">Bug 28374</a> - SIGSEGV shader/slang/slang_typeinfo.c:534</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28748">Bug 28748</a> - [i965] uninlined function calls support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28833">Bug 28833</a> - piglit/shaders/glsl-texcoord-array fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28834">Bug 28834</a> - Add support for system fpclassify to GL_OES_query_matrix function for OpenBSD / NetBSD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28837">Bug 28837</a> - varying vec4 index support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28845">Bug 28845</a> - The GLU tesselator code has some warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28889">Bug 28889</a> - [regression] wine game crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28894">Bug 28894</a> - slang build fails if absolute path contains spaces</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28913">Bug 28913</a> - [GLSL] allowing two version statements</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28931">Bug 28931</a> - Floating Point Exception in Warzone2100 Trunk version</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28966">Bug 28966</a> - [r300g] Dynamic branching 3 demo does not run</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">Bug 28967</a> - slang/slang_emit.c:350: storage_to_src_reg: Assertion `index &gt;= 0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29013">Bug 29013</a> - [r300g] translate_rgb_op: unknown opcode ILLEGAL OPCODE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29020">Bug 29020</a> - [r300g] Wine d3d9 tests hardlock</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29910">Bug 29910</a> - Mesa advertises bogus GL_ARB_shading_language_120</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30196">Bug 30196</a> - [GLSL] gl_TextureMatrix{Inverse,Transpose,InverseTranspose} unsupported</li>
</ul>

View File

@@ -13,7 +13,14 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.10.3.html">7.10.3 release notes</A>
<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>

View File

@@ -167,7 +167,7 @@ Here's an example of using the compiler to compile a vertex shader and
emit GL_ARB_vertex_program-style instructions:
</p>
<pre>
src/glsl/glslcompiler --dump-ast myshader.vert
src/glsl/glsl_compiler --dump-ast myshader.vert
</pre>
Options include

View File

@@ -23,6 +23,7 @@ each directory.
<ul>
<li><b>docs</b> - EGL documentation
<li><b>drivers</b> - EGL drivers
<li><b>glsl</b> - the GLSL compiler
<li><b>main</b> - main EGL library implementation. This is where all
the EGL API functions are implemented, like eglCreateContext().
</ul>

View File

@@ -31,6 +31,7 @@
#define glAccum MANGLE(Accum)
#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
#define glActiveShaderProgram MANGLE(ActiveShaderProgram)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glActiveTexture MANGLE(ActiveTexture)
@@ -56,6 +57,7 @@
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginPerfMonitorAMD MANGLE(BeginPerfMonitorAMD)
#define glBeginQueryARB MANGLE(BeginQueryARB)
#define glBeginQueryIndexed MANGLE(BeginQueryIndexed)
#define glBeginQuery MANGLE(BeginQuery)
#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
@@ -75,22 +77,27 @@
#define glBindBufferRange MANGLE(BindBufferRange)
#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
#define glBindFragDataLocationIndexed MANGLE(BindFragDataLocationIndexed)
#define glBindFragDataLocation MANGLE(BindFragDataLocation)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
#define glBindFramebuffer MANGLE(BindFramebuffer)
#define glBindImageTextureEXT MANGLE(BindImageTextureEXT)
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT)
#define glBindParameterEXT MANGLE(BindParameterEXT)
#define glBindProgramARB MANGLE(BindProgramARB)
#define glBindProgramNV MANGLE(BindProgramNV)
#define glBindProgramPipeline MANGLE(BindProgramPipeline)
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
#define glBindRenderbuffer MANGLE(BindRenderbuffer)
#define glBindSampler MANGLE(BindSampler)
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
#define glBindTextureEXT MANGLE(BindTextureEXT)
#define glBindTexture MANGLE(BindTexture)
#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
#define glBindTransformFeedback MANGLE(BindTransformFeedback)
#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
#define glBindVertexArray MANGLE(BindVertexArray)
@@ -112,18 +119,22 @@
#define glBlendColorEXT MANGLE(BlendColorEXT)
#define glBlendColor MANGLE(BlendColor)
#define glBlendEquationEXT MANGLE(BlendEquationEXT)
#define glBlendEquationiARB MANGLE(BlendEquationiARB)
#define glBlendEquationi MANGLE(BlendEquationi)
#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
#define glBlendEquation MANGLE(BlendEquation)
#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
#define glBlendEquationSeparateiARB MANGLE(BlendEquationSeparateiARB)
#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
#define glBlendFunciARB MANGLE(BlendFunciARB)
#define glBlendFunci MANGLE(BlendFunci)
#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
#define glBlendFunc MANGLE(BlendFunc)
#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
#define glBlendFuncSeparateiARB MANGLE(BlendFuncSeparateiARB)
#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
@@ -153,6 +164,7 @@
#define glClearColor MANGLE(ClearColor)
#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
#define glClearDepthdNV MANGLE(ClearDepthdNV)
#define glClearDepthf MANGLE(ClearDepthf)
#define glClearDepth MANGLE(ClearDepth)
#define glClearIndex MANGLE(ClearIndex)
#define glClear MANGLE(Clear)
@@ -215,6 +227,10 @@
#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
#define glColorMask MANGLE(ColorMask)
#define glColorMaterial MANGLE(ColorMaterial)
#define glColorP3ui MANGLE(ColorP3ui)
#define glColorP3uiv MANGLE(ColorP3uiv)
#define glColorP4ui MANGLE(ColorP4ui)
#define glColorP4uiv MANGLE(ColorP4uiv)
#define glColorPointerEXT MANGLE(ColorPointerEXT)
#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
#define glColorPointer MANGLE(ColorPointer)
@@ -236,6 +252,7 @@
#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
#define glCompileShaderARB MANGLE(CompileShaderARB)
#define glCompileShaderIncludeARB MANGLE(CompileShaderIncludeARB)
#define glCompileShader MANGLE(CompileShader)
#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
@@ -310,10 +327,18 @@
#define glCreateShader MANGLE(CreateShader)
#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
#define glCreateShaderProgramv MANGLE(CreateShaderProgramv)
#define glCreateSyncFromCLeventARB MANGLE(CreateSyncFromCLeventARB)
#define glCullFace MANGLE(CullFace)
#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
#define glDebugMessageCallbackAMD MANGLE(DebugMessageCallbackAMD)
#define glDebugMessageCallbackARB MANGLE(DebugMessageCallbackARB)
#define glDebugMessageControlARB MANGLE(DebugMessageControlARB)
#define glDebugMessageEnableAMD MANGLE(DebugMessageEnableAMD)
#define glDebugMessageInsertAMD MANGLE(DebugMessageInsertAMD)
#define glDebugMessageInsertARB MANGLE(DebugMessageInsertARB)
#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
#define glDeformSGIX MANGLE(DeformSGIX)
@@ -326,20 +351,25 @@
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
#define glDeleteLists MANGLE(DeleteLists)
#define glDeleteNamedStringARB MANGLE(DeleteNamedStringARB)
#define glDeleteNamesAMD MANGLE(DeleteNamesAMD)
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
#define glDeletePerfMonitorsAMD MANGLE(DeletePerfMonitorsAMD)
#define glDeleteProgram MANGLE(DeleteProgram)
#define glDeleteProgramPipelines MANGLE(DeleteProgramPipelines)
#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
#define glDeleteQueries MANGLE(DeleteQueries)
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteSamplers MANGLE(DeleteSamplers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteSync MANGLE(DeleteSync)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTransformFeedbacks MANGLE(DeleteTransformFeedbacks)
#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
@@ -348,7 +378,10 @@
#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
#define glDepthFunc MANGLE(DepthFunc)
#define glDepthMask MANGLE(DepthMask)
#define glDepthRangeArrayv MANGLE(DepthRangeArrayv)
#define glDepthRangedNV MANGLE(DepthRangedNV)
#define glDepthRangef MANGLE(DepthRangef)
#define glDepthRangeIndexed MANGLE(DepthRangeIndexed)
#define glDepthRange MANGLE(DepthRange)
#define glDetachObjectARB MANGLE(DetachObjectARB)
#define glDetachShader MANGLE(DetachShader)
@@ -363,6 +396,7 @@
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
#define glDrawArraysIndirect MANGLE(DrawArraysIndirect)
#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
#define glDrawArraysInstanced MANGLE(DrawArraysInstanced)
@@ -374,6 +408,7 @@
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
#define glDrawElementsIndirect MANGLE(DrawElementsIndirect)
#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
@@ -386,7 +421,9 @@
#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedback MANGLE(DrawTransformFeedback)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
#define glDrawTransformFeedbackStream MANGLE(DrawTransformFeedbackStream)
#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
#define glEdgeFlag MANGLE(EdgeFlag)
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
@@ -414,6 +451,7 @@
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndPerfMonitorAMD MANGLE(EndPerfMonitorAMD)
#define glEndQueryARB MANGLE(EndQueryARB)
#define glEndQueryIndexed MANGLE(EndQueryIndexed)
#define glEndQuery MANGLE(EndQuery)
#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
#define glEndTransformFeedback MANGLE(EndTransformFeedback)
@@ -447,6 +485,7 @@
#define glFlush MANGLE(Flush)
#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
#define glFlushMappedNamedBufferRangeEXT MANGLE(FlushMappedNamedBufferRangeEXT)
#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
@@ -498,7 +537,6 @@
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureFace MANGLE(FramebufferTextureFace)
#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
@@ -521,23 +559,30 @@
#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
#define glGenFramebuffers MANGLE(GenFramebuffers)
#define glGenLists MANGLE(GenLists)
#define glGenNamesAMD MANGLE(GenNamesAMD)
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
#define glGenPerfMonitorsAMD MANGLE(GenPerfMonitorsAMD)
#define glGenProgramPipelines MANGLE(GenProgramPipelines)
#define glGenProgramsARB MANGLE(GenProgramsARB)
#define glGenProgramsNV MANGLE(GenProgramsNV)
#define glGenQueriesARB MANGLE(GenQueriesARB)
#define glGenQueries MANGLE(GenQueries)
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
#define glGenRenderbuffers MANGLE(GenRenderbuffers)
#define glGenSamplers MANGLE(GenSamplers)
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
#define glGenTextures MANGLE(GenTextures)
#define glGenTransformFeedbacks MANGLE(GenTransformFeedbacks)
#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
#define glGenVertexArrays MANGLE(GenVertexArrays)
#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
#define glGetActiveAttrib MANGLE(GetActiveAttrib)
#define glGetActiveSubroutineName MANGLE(GetActiveSubroutineName)
#define glGetActiveSubroutineUniformiv MANGLE(GetActiveSubroutineUniformiv)
#define glGetActiveSubroutineUniformName MANGLE(GetActiveSubroutineUniformName)
#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
#define glGetActiveUniformBlockiv MANGLE(GetActiveUniformBlockiv)
#define glGetActiveUniformBlockName MANGLE(GetActiveUniformBlockName)
@@ -589,16 +634,21 @@
#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
#define glGetDebugMessageLogAMD MANGLE(GetDebugMessageLogAMD)
#define glGetDebugMessageLogARB MANGLE(GetDebugMessageLogARB)
#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT)
#define glGetDoublei_v MANGLE(GetDoublei_v)
#define glGetDoublev MANGLE(GetDoublev)
#define glGetError MANGLE(GetError)
#define glGetFenceivNV MANGLE(GetFenceivNV)
#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
#define glGetFloati_v MANGLE(GetFloati_v)
#define glGetFloatv MANGLE(GetFloatv)
#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
#define glGetFragDataIndex MANGLE(GetFragDataIndex)
#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
#define glGetFragDataLocation MANGLE(GetFragDataLocation)
#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
@@ -608,6 +658,7 @@
#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv)
#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
#define glGetGraphicsResetStatusARB MANGLE(GetGraphicsResetStatusARB)
#define glGetHandleARB MANGLE(GetHandleARB)
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
#define glGetHistogram MANGLE(GetHistogram)
@@ -678,6 +729,26 @@
#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
#define glGetNamedStringARB MANGLE(GetNamedStringARB)
#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
#define glGetnColorTableARB MANGLE(GetnColorTableARB)
#define glGetnCompressedTexImageARB MANGLE(GetnCompressedTexImageARB)
#define glGetnConvolutionFilterARB MANGLE(GetnConvolutionFilterARB)
#define glGetnHistogramARB MANGLE(GetnHistogramARB)
#define glGetnMapdvARB MANGLE(GetnMapdvARB)
#define glGetnMapfvARB MANGLE(GetnMapfvARB)
#define glGetnMapivARB MANGLE(GetnMapivARB)
#define glGetnMinmaxARB MANGLE(GetnMinmaxARB)
#define glGetnPixelMapfvARB MANGLE(GetnPixelMapfvARB)
#define glGetnPixelMapuivARB MANGLE(GetnPixelMapuivARB)
#define glGetnPixelMapusvARB MANGLE(GetnPixelMapusvARB)
#define glGetnPolygonStippleARB MANGLE(GetnPolygonStippleARB)
#define glGetnSeparableFilterARB MANGLE(GetnSeparableFilterARB)
#define glGetnTexImageARB MANGLE(GetnTexImageARB)
#define glGetnUniformdvARB MANGLE(GetnUniformdvARB)
#define glGetnUniformfvARB MANGLE(GetnUniformfvARB)
#define glGetnUniformivARB MANGLE(GetnUniformivARB)
#define glGetnUniformuivARB MANGLE(GetnUniformuivARB)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
@@ -700,6 +771,7 @@
#define glGetPointervEXT MANGLE(GetPointervEXT)
#define glGetPointerv MANGLE(GetPointerv)
#define glGetPolygonStipple MANGLE(GetPolygonStipple)
#define glGetProgramBinary MANGLE(GetProgramBinary)
#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
@@ -716,28 +788,42 @@
#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
#define glGetProgramPipelineInfoLog MANGLE(GetProgramPipelineInfoLog)
#define glGetProgramPipelineiv MANGLE(GetProgramPipelineiv)
#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
#define glGetProgramStageiv MANGLE(GetProgramStageiv)
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
#define glGetProgramSubroutineParameteruivNV MANGLE(GetProgramSubroutineParameteruivNV)
#define glGetQueryIndexediv MANGLE(GetQueryIndexediv)
#define glGetQueryivARB MANGLE(GetQueryivARB)
#define glGetQueryiv MANGLE(GetQueryiv)
#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
#define glGetQueryObjecti64v MANGLE(GetQueryObjecti64v)
#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
#define glGetQueryObjectui64v MANGLE(GetQueryObjectui64v)
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
#define glGetSamplerParameterfv MANGLE(GetSamplerParameterfv)
#define glGetSamplerParameterIiv MANGLE(GetSamplerParameterIiv)
#define glGetSamplerParameterIuiv MANGLE(GetSamplerParameterIuiv)
#define glGetSamplerParameteriv MANGLE(GetSamplerParameteriv)
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
#define glGetShaderiv MANGLE(GetShaderiv)
#define glGetShaderPrecisionFormat MANGLE(GetShaderPrecisionFormat)
#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
#define glGetShaderSource MANGLE(GetShaderSource)
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetSubroutineIndex MANGLE(GetSubroutineIndex)
#define glGetSubroutineUniformLocation MANGLE(GetSubroutineUniformLocation)
#define glGetSynciv MANGLE(GetSynciv)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
@@ -770,14 +856,17 @@
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
#define glGetUniformdv MANGLE(GetUniformdv)
#define glGetUniformfvARB MANGLE(GetUniformfvARB)
#define glGetUniformfv MANGLE(GetUniformfv)
#define glGetUniformi64vNV MANGLE(GetUniformi64vNV)
#define glGetUniformIndices MANGLE(GetUniformIndices)
#define glGetUniformivARB MANGLE(GetUniformivARB)
#define glGetUniformiv MANGLE(GetUniformiv)
#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformSubroutineuiv MANGLE(GetUniformSubroutineuiv)
#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
#define glGetUniformuiv MANGLE(GetUniformuiv)
@@ -803,6 +892,10 @@
#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
#define glGetVertexAttribLdvEXT MANGLE(GetVertexAttribLdvEXT)
#define glGetVertexAttribLdv MANGLE(GetVertexAttribLdv)
#define glGetVertexAttribLi64vNV MANGLE(GetVertexAttribLi64vNV)
#define glGetVertexAttribLui64vNV MANGLE(GetVertexAttribLui64vNV)
#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
@@ -864,20 +957,25 @@
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
#define glIsFramebuffer MANGLE(IsFramebuffer)
#define glIsList MANGLE(IsList)
#define glIsNameAMD MANGLE(IsNameAMD)
#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
#define glIsNamedStringARB MANGLE(IsNamedStringARB)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
#define glIsProgramARB MANGLE(IsProgramARB)
#define glIsProgram MANGLE(IsProgram)
#define glIsProgramNV MANGLE(IsProgramNV)
#define glIsProgramPipeline MANGLE(IsProgramPipeline)
#define glIsQueryARB MANGLE(IsQueryARB)
#define glIsQuery MANGLE(IsQuery)
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsSampler MANGLE(IsSampler)
#define glIsShader MANGLE(IsShader)
#define glIsSync MANGLE(IsSync)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
#define glIsTransformFeedback MANGLE(IsTransformFeedback)
#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
@@ -915,6 +1013,8 @@
#define glLogicOp MANGLE(LogicOp)
#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
#define glMakeNamedBufferNonResidentNV MANGLE(MakeNamedBufferNonResidentNV)
#define glMakeNamedBufferResidentNV MANGLE(MakeNamedBufferResidentNV)
#define glMap1d MANGLE(Map1d)
#define glMap1f MANGLE(Map1f)
#define glMap2d MANGLE(Map2d)
@@ -928,6 +1028,7 @@
#define glMapGrid2d MANGLE(MapGrid2d)
#define glMapGrid2f MANGLE(MapGrid2f)
#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
#define glMapNamedBufferRangeEXT MANGLE(MapNamedBufferRangeEXT)
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
@@ -963,8 +1064,10 @@
#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMemoryBarrierEXT MANGLE(MemoryBarrierEXT)
#define glMinmaxEXT MANGLE(MinmaxEXT)
#define glMinmax MANGLE(Minmax)
#define glMinSampleShadingARB MANGLE(MinSampleShadingARB)
#define glMinSampleShading MANGLE(MinSampleShading)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawArrays MANGLE(MultiDrawArrays)
@@ -1048,6 +1151,14 @@
#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
#define glMultiTexCoordP1ui MANGLE(MultiTexCoordP1ui)
#define glMultiTexCoordP1uiv MANGLE(MultiTexCoordP1uiv)
#define glMultiTexCoordP2ui MANGLE(MultiTexCoordP2ui)
#define glMultiTexCoordP2uiv MANGLE(MultiTexCoordP2uiv)
#define glMultiTexCoordP3ui MANGLE(MultiTexCoordP3ui)
#define glMultiTexCoordP3uiv MANGLE(MultiTexCoordP3uiv)
#define glMultiTexCoordP4ui MANGLE(MultiTexCoordP4ui)
#define glMultiTexCoordP4uiv MANGLE(MultiTexCoordP4uiv)
#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
@@ -1080,6 +1191,7 @@
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
#define glNamedCopyBufferSubDataEXT MANGLE(NamedCopyBufferSubDataEXT)
#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
@@ -1087,8 +1199,6 @@
#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
#define glNamedMakeBufferNonResidentNV MANGLE(NamedMakeBufferNonResidentNV)
#define glNamedMakeBufferResidentNV MANGLE(NamedMakeBufferResidentNV)
#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
@@ -1104,6 +1214,7 @@
#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
#define glNamedStringARB MANGLE(NamedStringARB)
#define glNewList MANGLE(NewList)
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
#define glNormal3b MANGLE(Normal3b)
@@ -1121,6 +1232,8 @@
#define glNormal3s MANGLE(Normal3s)
#define glNormal3sv MANGLE(Normal3sv)
#define glNormalFormatNV MANGLE(NormalFormatNV)
#define glNormalP3ui MANGLE(NormalP3ui)
#define glNormalP3uiv MANGLE(NormalP3uiv)
#define glNormalPointerEXT MANGLE(NormalPointerEXT)
#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
#define glNormalPointer MANGLE(NormalPointer)
@@ -1140,6 +1253,9 @@
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
#define glPatchParameterfv MANGLE(PatchParameterfv)
#define glPatchParameteri MANGLE(PatchParameteri)
#define glPauseTransformFeedback MANGLE(PauseTransformFeedback)
#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
#define glPixelMapfv MANGLE(PixelMapfv)
@@ -1191,6 +1307,7 @@
#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
#define glProgramBinary MANGLE(ProgramBinary)
#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
@@ -1231,39 +1348,123 @@
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glProgramSubroutineParametersuivNV MANGLE(ProgramSubroutineParametersuivNV)
#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
#define glProgramUniform1d MANGLE(ProgramUniform1d)
#define glProgramUniform1dvEXT MANGLE(ProgramUniform1dvEXT)
#define glProgramUniform1dv MANGLE(ProgramUniform1dv)
#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
#define glProgramUniform1f MANGLE(ProgramUniform1f)
#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
#define glProgramUniform1fv MANGLE(ProgramUniform1fv)
#define glProgramUniform1i64NV MANGLE(ProgramUniform1i64NV)
#define glProgramUniform1i64vNV MANGLE(ProgramUniform1i64vNV)
#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
#define glProgramUniform1i MANGLE(ProgramUniform1i)
#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
#define glProgramUniform1iv MANGLE(ProgramUniform1iv)
#define glProgramUniform1ui64NV MANGLE(ProgramUniform1ui64NV)
#define glProgramUniform1ui64vNV MANGLE(ProgramUniform1ui64vNV)
#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
#define glProgramUniform1ui MANGLE(ProgramUniform1ui)
#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
#define glProgramUniform1uiv MANGLE(ProgramUniform1uiv)
#define glProgramUniform2dEXT MANGLE(ProgramUniform2dEXT)
#define glProgramUniform2d MANGLE(ProgramUniform2d)
#define glProgramUniform2dvEXT MANGLE(ProgramUniform2dvEXT)
#define glProgramUniform2dv MANGLE(ProgramUniform2dv)
#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
#define glProgramUniform2f MANGLE(ProgramUniform2f)
#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
#define glProgramUniform2fv MANGLE(ProgramUniform2fv)
#define glProgramUniform2i64NV MANGLE(ProgramUniform2i64NV)
#define glProgramUniform2i64vNV MANGLE(ProgramUniform2i64vNV)
#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
#define glProgramUniform2i MANGLE(ProgramUniform2i)
#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
#define glProgramUniform2iv MANGLE(ProgramUniform2iv)
#define glProgramUniform2ui64NV MANGLE(ProgramUniform2ui64NV)
#define glProgramUniform2ui64vNV MANGLE(ProgramUniform2ui64vNV)
#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
#define glProgramUniform2ui MANGLE(ProgramUniform2ui)
#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
#define glProgramUniform2uiv MANGLE(ProgramUniform2uiv)
#define glProgramUniform3dEXT MANGLE(ProgramUniform3dEXT)
#define glProgramUniform3d MANGLE(ProgramUniform3d)
#define glProgramUniform3dvEXT MANGLE(ProgramUniform3dvEXT)
#define glProgramUniform3dv MANGLE(ProgramUniform3dv)
#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
#define glProgramUniform3f MANGLE(ProgramUniform3f)
#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
#define glProgramUniform3fv MANGLE(ProgramUniform3fv)
#define glProgramUniform3i64NV MANGLE(ProgramUniform3i64NV)
#define glProgramUniform3i64vNV MANGLE(ProgramUniform3i64vNV)
#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
#define glProgramUniform3i MANGLE(ProgramUniform3i)
#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
#define glProgramUniform3iv MANGLE(ProgramUniform3iv)
#define glProgramUniform3ui64NV MANGLE(ProgramUniform3ui64NV)
#define glProgramUniform3ui64vNV MANGLE(ProgramUniform3ui64vNV)
#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
#define glProgramUniform3ui MANGLE(ProgramUniform3ui)
#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
#define glProgramUniform3uiv MANGLE(ProgramUniform3uiv)
#define glProgramUniform4dEXT MANGLE(ProgramUniform4dEXT)
#define glProgramUniform4d MANGLE(ProgramUniform4d)
#define glProgramUniform4dvEXT MANGLE(ProgramUniform4dvEXT)
#define glProgramUniform4dv MANGLE(ProgramUniform4dv)
#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
#define glProgramUniform4f MANGLE(ProgramUniform4f)
#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
#define glProgramUniform4fv MANGLE(ProgramUniform4fv)
#define glProgramUniform4i64NV MANGLE(ProgramUniform4i64NV)
#define glProgramUniform4i64vNV MANGLE(ProgramUniform4i64vNV)
#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
#define glProgramUniform4i MANGLE(ProgramUniform4i)
#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
#define glProgramUniform4iv MANGLE(ProgramUniform4iv)
#define glProgramUniform4ui64NV MANGLE(ProgramUniform4ui64NV)
#define glProgramUniform4ui64vNV MANGLE(ProgramUniform4ui64vNV)
#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
#define glProgramUniform4ui MANGLE(ProgramUniform4ui)
#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
#define glProgramUniform4uiv MANGLE(ProgramUniform4uiv)
#define glProgramUniformMatrix2dvEXT MANGLE(ProgramUniformMatrix2dvEXT)
#define glProgramUniformMatrix2dv MANGLE(ProgramUniformMatrix2dv)
#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
#define glProgramUniformMatrix2fv MANGLE(ProgramUniformMatrix2fv)
#define glProgramUniformMatrix2x3dvEXT MANGLE(ProgramUniformMatrix2x3dvEXT)
#define glProgramUniformMatrix2x3dv MANGLE(ProgramUniformMatrix2x3dv)
#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
#define glProgramUniformMatrix2x3fv MANGLE(ProgramUniformMatrix2x3fv)
#define glProgramUniformMatrix2x4dvEXT MANGLE(ProgramUniformMatrix2x4dvEXT)
#define glProgramUniformMatrix2x4dv MANGLE(ProgramUniformMatrix2x4dv)
#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
#define glProgramUniformMatrix2x4fv MANGLE(ProgramUniformMatrix2x4fv)
#define glProgramUniformMatrix3dvEXT MANGLE(ProgramUniformMatrix3dvEXT)
#define glProgramUniformMatrix3dv MANGLE(ProgramUniformMatrix3dv)
#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
#define glProgramUniformMatrix3fv MANGLE(ProgramUniformMatrix3fv)
#define glProgramUniformMatrix3x2dvEXT MANGLE(ProgramUniformMatrix3x2dvEXT)
#define glProgramUniformMatrix3x2dv MANGLE(ProgramUniformMatrix3x2dv)
#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
#define glProgramUniformMatrix3x2fv MANGLE(ProgramUniformMatrix3x2fv)
#define glProgramUniformMatrix3x4dvEXT MANGLE(ProgramUniformMatrix3x4dvEXT)
#define glProgramUniformMatrix3x4dv MANGLE(ProgramUniformMatrix3x4dv)
#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
#define glProgramUniformMatrix3x4fv MANGLE(ProgramUniformMatrix3x4fv)
#define glProgramUniformMatrix4dvEXT MANGLE(ProgramUniformMatrix4dvEXT)
#define glProgramUniformMatrix4dv MANGLE(ProgramUniformMatrix4dv)
#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
#define glProgramUniformMatrix4fv MANGLE(ProgramUniformMatrix4fv)
#define glProgramUniformMatrix4x2dvEXT MANGLE(ProgramUniformMatrix4x2dvEXT)
#define glProgramUniformMatrix4x2dv MANGLE(ProgramUniformMatrix4x2dv)
#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
#define glProgramUniformMatrix4x2fv MANGLE(ProgramUniformMatrix4x2fv)
#define glProgramUniformMatrix4x3dvEXT MANGLE(ProgramUniformMatrix4x3dvEXT)
#define glProgramUniformMatrix4x3dv MANGLE(ProgramUniformMatrix4x3dv)
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramUniformMatrix4x3fv MANGLE(ProgramUniformMatrix4x3fv)
#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
@@ -1274,6 +1475,7 @@
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
#define glPushName MANGLE(PushName)
#define glQueryCounter MANGLE(QueryCounter)
#define glRasterPos2d MANGLE(RasterPos2d)
#define glRasterPos2dv MANGLE(RasterPos2dv)
#define glRasterPos2f MANGLE(RasterPos2f)
@@ -1300,6 +1502,7 @@
#define glRasterPos4sv MANGLE(RasterPos4sv)
#define glReadBuffer MANGLE(ReadBuffer)
#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
#define glReadnPixelsARB MANGLE(ReadnPixelsARB)
#define glReadPixels MANGLE(ReadPixels)
#define glRectd MANGLE(Rectd)
#define glRectdv MANGLE(Rectdv)
@@ -1310,6 +1513,7 @@
#define glRects MANGLE(Rects)
#define glRectsv MANGLE(Rectsv)
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
#define glReleaseShaderCompiler MANGLE(ReleaseShaderCompiler)
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
#define glRenderbufferStorage MANGLE(RenderbufferStorage)
#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
@@ -1345,6 +1549,7 @@
#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
#define glResetMinmax MANGLE(ResetMinmax)
#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
#define glResumeTransformFeedback MANGLE(ResumeTransformFeedback)
#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
#define glRotated MANGLE(Rotated)
#define glRotatef MANGLE(Rotatef)
@@ -1357,8 +1562,17 @@
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
#define glSamplerParameterf MANGLE(SamplerParameterf)
#define glSamplerParameterfv MANGLE(SamplerParameterfv)
#define glSamplerParameterIiv MANGLE(SamplerParameterIiv)
#define glSamplerParameteri MANGLE(SamplerParameteri)
#define glSamplerParameterIuiv MANGLE(SamplerParameterIuiv)
#define glSamplerParameteriv MANGLE(SamplerParameteriv)
#define glScaled MANGLE(Scaled)
#define glScalef MANGLE(Scalef)
#define glScissorArrayv MANGLE(ScissorArrayv)
#define glScissorIndexed MANGLE(ScissorIndexed)
#define glScissorIndexedv MANGLE(ScissorIndexedv)
#define glScissor MANGLE(Scissor)
#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
#define glSecondaryColor3b MANGLE(SecondaryColor3b)
@@ -1395,6 +1609,8 @@
#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
#define glSecondaryColorP3ui MANGLE(SecondaryColorP3ui)
#define glSecondaryColorP3uiv MANGLE(SecondaryColorP3uiv)
#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
@@ -1408,6 +1624,7 @@
#define glSetInvariantEXT MANGLE(SetInvariantEXT)
#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
#define glShadeModel MANGLE(ShadeModel)
#define glShaderBinary MANGLE(ShaderBinary)
#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
@@ -1509,6 +1726,14 @@
#define glTexCoord4s MANGLE(TexCoord4s)
#define glTexCoord4sv MANGLE(TexCoord4sv)
#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
#define glTexCoordP1ui MANGLE(TexCoordP1ui)
#define glTexCoordP1uiv MANGLE(TexCoordP1uiv)
#define glTexCoordP2ui MANGLE(TexCoordP2ui)
#define glTexCoordP2uiv MANGLE(TexCoordP2uiv)
#define glTexCoordP3ui MANGLE(TexCoordP3ui)
#define glTexCoordP3uiv MANGLE(TexCoordP3uiv)
#define glTexCoordP4ui MANGLE(TexCoordP4ui)
#define glTexCoordP4uiv MANGLE(TexCoordP4uiv)
#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
#define glTexCoordPointer MANGLE(TexCoordPointer)
@@ -1569,73 +1794,108 @@
#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
#define glTrackMatrixNV MANGLE(TrackMatrixNV)
#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
#define glTransformFeedbackStreamAttribsNV MANGLE(TransformFeedbackStreamAttribsNV)
#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
#define glTranslated MANGLE(Translated)
#define glTranslatef MANGLE(Translatef)
#define glUniform1d MANGLE(Uniform1d)
#define glUniform1dv MANGLE(Uniform1dv)
#define glUniform1fARB MANGLE(Uniform1fARB)
#define glUniform1f MANGLE(Uniform1f)
#define glUniform1fvARB MANGLE(Uniform1fvARB)
#define glUniform1fv MANGLE(Uniform1fv)
#define glUniform1i64NV MANGLE(Uniform1i64NV)
#define glUniform1i64vNV MANGLE(Uniform1i64vNV)
#define glUniform1iARB MANGLE(Uniform1iARB)
#define glUniform1i MANGLE(Uniform1i)
#define glUniform1ivARB MANGLE(Uniform1ivARB)
#define glUniform1iv MANGLE(Uniform1iv)
#define glUniform1ui64NV MANGLE(Uniform1ui64NV)
#define glUniform1ui64vNV MANGLE(Uniform1ui64vNV)
#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
#define glUniform1ui MANGLE(Uniform1ui)
#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
#define glUniform1uiv MANGLE(Uniform1uiv)
#define glUniform2d MANGLE(Uniform2d)
#define glUniform2dv MANGLE(Uniform2dv)
#define glUniform2fARB MANGLE(Uniform2fARB)
#define glUniform2f MANGLE(Uniform2f)
#define glUniform2fvARB MANGLE(Uniform2fvARB)
#define glUniform2fv MANGLE(Uniform2fv)
#define glUniform2i64NV MANGLE(Uniform2i64NV)
#define glUniform2i64vNV MANGLE(Uniform2i64vNV)
#define glUniform2iARB MANGLE(Uniform2iARB)
#define glUniform2i MANGLE(Uniform2i)
#define glUniform2ivARB MANGLE(Uniform2ivARB)
#define glUniform2iv MANGLE(Uniform2iv)
#define glUniform2ui64NV MANGLE(Uniform2ui64NV)
#define glUniform2ui64vNV MANGLE(Uniform2ui64vNV)
#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
#define glUniform2ui MANGLE(Uniform2ui)
#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
#define glUniform2uiv MANGLE(Uniform2uiv)
#define glUniform3d MANGLE(Uniform3d)
#define glUniform3dv MANGLE(Uniform3dv)
#define glUniform3fARB MANGLE(Uniform3fARB)
#define glUniform3f MANGLE(Uniform3f)
#define glUniform3fvARB MANGLE(Uniform3fvARB)
#define glUniform3fv MANGLE(Uniform3fv)
#define glUniform3i64NV MANGLE(Uniform3i64NV)
#define glUniform3i64vNV MANGLE(Uniform3i64vNV)
#define glUniform3iARB MANGLE(Uniform3iARB)
#define glUniform3i MANGLE(Uniform3i)
#define glUniform3ivARB MANGLE(Uniform3ivARB)
#define glUniform3iv MANGLE(Uniform3iv)
#define glUniform3ui64NV MANGLE(Uniform3ui64NV)
#define glUniform3ui64vNV MANGLE(Uniform3ui64vNV)
#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
#define glUniform3ui MANGLE(Uniform3ui)
#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
#define glUniform3uiv MANGLE(Uniform3uiv)
#define glUniform4d MANGLE(Uniform4d)
#define glUniform4dv MANGLE(Uniform4dv)
#define glUniform4fARB MANGLE(Uniform4fARB)
#define glUniform4f MANGLE(Uniform4f)
#define glUniform4fvARB MANGLE(Uniform4fvARB)
#define glUniform4fv MANGLE(Uniform4fv)
#define glUniform4i64NV MANGLE(Uniform4i64NV)
#define glUniform4i64vNV MANGLE(Uniform4i64vNV)
#define glUniform4iARB MANGLE(Uniform4iARB)
#define glUniform4i MANGLE(Uniform4i)
#define glUniform4ivARB MANGLE(Uniform4ivARB)
#define glUniform4iv MANGLE(Uniform4iv)
#define glUniform4ui64NV MANGLE(Uniform4ui64NV)
#define glUniform4ui64vNV MANGLE(Uniform4ui64vNV)
#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
#define glUniform4ui MANGLE(Uniform4ui)
#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
#define glUniform4uiv MANGLE(Uniform4uiv)
#define glUniformBlockBinding MANGLE(UniformBlockBinding)
#define glUniformBufferEXT MANGLE(UniformBufferEXT)
#define glUniformMatrix2dv MANGLE(UniformMatrix2dv)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
#define glUniformMatrix2x3dv MANGLE(UniformMatrix2x3dv)
#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
#define glUniformMatrix2x4dv MANGLE(UniformMatrix2x4dv)
#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
#define glUniformMatrix3dv MANGLE(UniformMatrix3dv)
#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
#define glUniformMatrix3x2dv MANGLE(UniformMatrix3x2dv)
#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
#define glUniformMatrix3x4dv MANGLE(UniformMatrix3x4dv)
#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
#define glUniformMatrix4dv MANGLE(UniformMatrix4dv)
#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
#define glUniformMatrix4x2dv MANGLE(UniformMatrix4x2dv)
#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
#define glUniformMatrix4x3dv MANGLE(UniformMatrix4x3dv)
#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
#define glUniformSubroutinesuiv MANGLE(UniformSubroutinesuiv)
#define glUniformui64NV MANGLE(Uniformui64NV)
#define glUniformui64vNV MANGLE(Uniformui64vNV)
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
@@ -1646,9 +1906,11 @@
#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
#define glUseProgram MANGLE(UseProgram)
#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
#define glUseProgramStages MANGLE(UseProgramStages)
#define glUseShaderProgramEXT MANGLE(UseShaderProgramEXT)
#define glValidateProgramARB MANGLE(ValidateProgramARB)
#define glValidateProgram MANGLE(ValidateProgram)
#define glValidateProgramPipeline MANGLE(ValidateProgramPipeline)
#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
#define glVariantbvEXT MANGLE(VariantbvEXT)
#define glVariantdvEXT MANGLE(VariantdvEXT)
@@ -1659,6 +1921,16 @@
#define glVariantubvEXT MANGLE(VariantubvEXT)
#define glVariantuivEXT MANGLE(VariantuivEXT)
#define glVariantusvEXT MANGLE(VariantusvEXT)
#define glVDPAUFiniNV MANGLE(VDPAUFiniNV)
#define glVDPAUGetSurfaceivNV MANGLE(VDPAUGetSurfaceivNV)
#define glVDPAUInitNV MANGLE(VDPAUInitNV)
#define glVDPAUIsSurfaceNV MANGLE(VDPAUIsSurfaceNV)
#define glVDPAUMapSurfacesNV MANGLE(VDPAUMapSurfacesNV)
#define glVDPAURegisterOutputSurfaceNV MANGLE(VDPAURegisterOutputSurfaceNV)
#define glVDPAURegisterVideoSurfaceNV MANGLE(VDPAURegisterVideoSurfaceNV)
#define glVDPAUSurfaceAccessNV MANGLE(VDPAUSurfaceAccessNV)
#define glVDPAUUnmapSurfacesNV MANGLE(VDPAUUnmapSurfacesNV)
#define glVDPAUUnregisterSurfaceNV MANGLE(VDPAUUnregisterSurfaceNV)
#define glVertex2d MANGLE(Vertex2d)
#define glVertex2dv MANGLE(Vertex2dv)
#define glVertex2f MANGLE(Vertex2f)
@@ -1692,6 +1964,7 @@
#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
#define glVertexArrayVertexAttribLOffsetEXT MANGLE(VertexArrayVertexAttribLOffsetEXT)
#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
#define glVertexAttrib1d MANGLE(VertexAttrib1d)
#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
@@ -1800,6 +2073,7 @@
#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
#define glVertexAttribDivisorARB MANGLE(VertexAttribDivisorARB)
#define glVertexAttribDivisor MANGLE(VertexAttribDivisor)
#define glVertexAttribFormatNV MANGLE(VertexAttribFormatNV)
#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
#define glVertexAttribI1i MANGLE(VertexAttribI1i)
@@ -1844,6 +2118,49 @@
#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
#define glVertexAttribL1dEXT MANGLE(VertexAttribL1dEXT)
#define glVertexAttribL1d MANGLE(VertexAttribL1d)
#define glVertexAttribL1dvEXT MANGLE(VertexAttribL1dvEXT)
#define glVertexAttribL1dv MANGLE(VertexAttribL1dv)
#define glVertexAttribL1i64NV MANGLE(VertexAttribL1i64NV)
#define glVertexAttribL1i64vNV MANGLE(VertexAttribL1i64vNV)
#define glVertexAttribL1ui64NV MANGLE(VertexAttribL1ui64NV)
#define glVertexAttribL1ui64vNV MANGLE(VertexAttribL1ui64vNV)
#define glVertexAttribL2dEXT MANGLE(VertexAttribL2dEXT)
#define glVertexAttribL2d MANGLE(VertexAttribL2d)
#define glVertexAttribL2dvEXT MANGLE(VertexAttribL2dvEXT)
#define glVertexAttribL2dv MANGLE(VertexAttribL2dv)
#define glVertexAttribL2i64NV MANGLE(VertexAttribL2i64NV)
#define glVertexAttribL2i64vNV MANGLE(VertexAttribL2i64vNV)
#define glVertexAttribL2ui64NV MANGLE(VertexAttribL2ui64NV)
#define glVertexAttribL2ui64vNV MANGLE(VertexAttribL2ui64vNV)
#define glVertexAttribL3dEXT MANGLE(VertexAttribL3dEXT)
#define glVertexAttribL3d MANGLE(VertexAttribL3d)
#define glVertexAttribL3dvEXT MANGLE(VertexAttribL3dvEXT)
#define glVertexAttribL3dv MANGLE(VertexAttribL3dv)
#define glVertexAttribL3i64NV MANGLE(VertexAttribL3i64NV)
#define glVertexAttribL3i64vNV MANGLE(VertexAttribL3i64vNV)
#define glVertexAttribL3ui64NV MANGLE(VertexAttribL3ui64NV)
#define glVertexAttribL3ui64vNV MANGLE(VertexAttribL3ui64vNV)
#define glVertexAttribL4dEXT MANGLE(VertexAttribL4dEXT)
#define glVertexAttribL4d MANGLE(VertexAttribL4d)
#define glVertexAttribL4dvEXT MANGLE(VertexAttribL4dvEXT)
#define glVertexAttribL4dv MANGLE(VertexAttribL4dv)
#define glVertexAttribL4i64NV MANGLE(VertexAttribL4i64NV)
#define glVertexAttribL4i64vNV MANGLE(VertexAttribL4i64vNV)
#define glVertexAttribL4ui64NV MANGLE(VertexAttribL4ui64NV)
#define glVertexAttribL4ui64vNV MANGLE(VertexAttribL4ui64vNV)
#define glVertexAttribLFormatNV MANGLE(VertexAttribLFormatNV)
#define glVertexAttribLPointerEXT MANGLE(VertexAttribLPointerEXT)
#define glVertexAttribLPointer MANGLE(VertexAttribLPointer)
#define glVertexAttribP1ui MANGLE(VertexAttribP1ui)
#define glVertexAttribP1uiv MANGLE(VertexAttribP1uiv)
#define glVertexAttribP2ui MANGLE(VertexAttribP2ui)
#define glVertexAttribP2uiv MANGLE(VertexAttribP2uiv)
#define glVertexAttribP3ui MANGLE(VertexAttribP3ui)
#define glVertexAttribP3uiv MANGLE(VertexAttribP3uiv)
#define glVertexAttribP4ui MANGLE(VertexAttribP4ui)
#define glVertexAttribP4uiv MANGLE(VertexAttribP4uiv)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointer MANGLE(VertexAttribPointer)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
@@ -1868,6 +2185,12 @@
#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
#define glVertexFormatNV MANGLE(VertexFormatNV)
#define glVertexP2ui MANGLE(VertexP2ui)
#define glVertexP2uiv MANGLE(VertexP2uiv)
#define glVertexP3ui MANGLE(VertexP3ui)
#define glVertexP3uiv MANGLE(VertexP3uiv)
#define glVertexP4ui MANGLE(VertexP4ui)
#define glVertexP4uiv MANGLE(VertexP4uiv)
#define glVertexPointerEXT MANGLE(VertexPointerEXT)
#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
#define glVertexPointer MANGLE(VertexPointer)
@@ -1913,6 +2236,9 @@
#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
#define glViewportArrayv MANGLE(ViewportArrayv)
#define glViewportIndexedf MANGLE(ViewportIndexedf)
#define glViewportIndexedfv MANGLE(ViewportIndexedfv)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)

View File

@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */
/* glext.h last updated $Date: 2010-11-03 18:59:30 -0700 (Wed, 03 Nov 2010) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 64
#define GL_GLEXT_VERSION 66
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -4840,7 +4840,7 @@ extern "C" {
#endif
#ifndef GL_AMD_seamless_cubemap_per_texture
/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */
/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
#endif
#ifndef GL_AMD_conservative_depth
@@ -4925,6 +4925,8 @@ extern "C" {
#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
#endif
@@ -5019,6 +5021,11 @@ extern "C" {
#ifndef GL_AMD_transform_feedback3_lines_triangles
#endif
#ifndef GL_AMD_depth_clamp_separate
#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
#endif
/*************************************************************/
@@ -8765,8 +8772,8 @@ GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdoubl
GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v);
GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v);
GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -8830,8 +8837,8 @@ typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint in
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -11020,6 +11027,10 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
#define GL_AMD_transform_feedback3_lines_triangles 1
#endif
#ifndef GL_AMD_depth_clamp_separate
#define GL_AMD_depth_clamp_separate 1
#endif
#ifdef __cplusplus
}

View File

@@ -805,7 +805,7 @@ typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
__DRIextension base;
__DRIimage *(*createImageFromName)(__DRIcontext *context,
__DRIimage *(*createImageFromName)(__DRIscreen *screen,
int width, int height, int format,
int name, int pitch,
void *loaderPrivate);
@@ -841,7 +841,7 @@ typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
struct __DRIimageLookupExtensionRec {
__DRIextension base;
__DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image,
__DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
void *loaderPrivate);
};

View File

@@ -1,8 +1,8 @@
/* $Revision: 6822 $ on $Date:: 2008-10-30 05:14:19 -0400 #$ */
/* $Revision: 9203 $ on $Date:: 2009-10-07 02:21:52 -0700 #$ */
/*------------------------------------------------------------------------
*
* OpenVG 1.0.1 Reference Implementation
* OpenVG 1.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
@@ -28,7 +28,7 @@
*
*//**
* \file
* \brief OpenVG 1.0.1 API.
* \brief OpenVG 1.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _OPENVG_H
@@ -42,6 +42,7 @@ extern "C" {
#define OPENVG_VERSION_1_0 1
#define OPENVG_VERSION_1_0_1 1
#define OPENVG_VERSION_1_1 2
#ifndef VG_MAXSHORT
#define VG_MAXSHORT 0x7FFF
@@ -55,10 +56,12 @@ extern "C" {
#define VG_MAX_ENUM 0x7FFFFFFF
#endif
typedef long VGHandle;
typedef VGuint VGHandle;
typedef VGHandle VGPath;
typedef VGHandle VGImage;
typedef VGHandle VGMaskLayer;
typedef VGHandle VGFont;
typedef VGHandle VGPaint;
#define VG_INVALID_HANDLE ((VGHandle)0)
@@ -96,6 +99,10 @@ typedef enum {
/* Scissoring rectangles */
VG_SCISSOR_RECTS = 0x1106,
/* Color Transformation */
VG_COLOR_TRANSFORM = 0x1170,
VG_COLOR_TRANSFORM_VALUES = 0x1171,
/* Stroke parameters */
VG_STROKE_LINE_WIDTH = 0x1110,
VG_STROKE_CAP_STYLE = 0x1111,
@@ -111,6 +118,9 @@ typedef enum {
/* Color for vgClear */
VG_CLEAR_COLOR = 0x1121,
/* Glyph origin */
VG_GLYPH_ORIGIN = 0x1122,
/* Enable/disable alpha masking and scissoring */
VG_MASKING = 0x1130,
VG_SCISSORING = 0x1131,
@@ -165,6 +175,7 @@ typedef enum {
VG_MATRIX_IMAGE_USER_TO_SURFACE = 0x1401,
VG_MATRIX_FILL_PAINT_TO_USER = 0x1402,
VG_MATRIX_STROKE_PAINT_TO_USER = 0x1403,
VG_MATRIX_GLYPH_USER_TO_SURFACE = 0x1404,
VG_MATRIX_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGMatrixMode;
@@ -365,6 +376,8 @@ typedef enum {
VG_lL_8 = 10,
VG_A_8 = 11,
VG_BW_1 = 12,
VG_A_1 = 13,
VG_A_4 = 14,
/* {A,X}RGB channel ordering */
VG_sXRGB_8888 = 0 | (1 << 6),
@@ -448,6 +461,12 @@ typedef enum {
VG_BLEND_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGBlendMode;
typedef enum {
VG_FONT_NUM_GLYPHS = 0x2F00,
VG_FONT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGFontParamType;
typedef enum {
VG_IMAGE_FORMAT_QUERY = 0x2100,
VG_PATH_DATATYPE_QUERY = 0x2101,
@@ -541,8 +560,22 @@ VG_API_CALL void VG_API_ENTRY vgShear(VGfloat shx, VGfloat shy) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgRotate(VGfloat angle) VG_API_EXIT;
/* Masking and Clearing */
VG_API_CALL void VG_API_ENTRY vgMask(VGImage mask, VGMaskOperation operation,
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgMask(VGHandle mask, VGMaskOperation operation,
VGint x, VGint y,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgRenderToMask(VGPath path,
VGbitfield paintModes,
VGMaskOperation operation) VG_API_EXIT;
VG_API_CALL VGMaskLayer VG_API_ENTRY vgCreateMaskLayer(VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyMaskLayer(VGMaskLayer maskLayer) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgFillMaskLayer(VGMaskLayer maskLayer,
VGint x, VGint y,
VGint width, VGint height,
VGfloat value) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgCopyMask(VGMaskLayer maskLayer,
VGint dx, VGint dy,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClear(VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
/* Paths */
@@ -636,6 +669,33 @@ VG_API_CALL void VG_API_ENTRY vgCopyPixels(VGint dx, VGint dy,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
/* Text */
VG_API_CALL VGFont VG_API_ENTRY vgCreateFont(VGint glyphCapacityHint) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyFont(VGFont font) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetGlyphToPath(VGFont font,
VGuint glyphIndex,
VGPath path,
VGboolean isHinted,
const VGfloat glyphOrigin [2],
const VGfloat escapement[2]) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetGlyphToImage(VGFont font,
VGuint glyphIndex,
VGImage image,
const VGfloat glyphOrigin [2],
const VGfloat escapement[2]) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClearGlyph(VGFont font,VGuint glyphIndex) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font,
VGuint glyphIndex,
VGbitfield paintModes,
VGboolean allowAutoHinting) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDrawGlyphs(VGFont font,
VGint glyphCount,
const VGuint *glyphIndices,
const VGfloat *adjustments_x,
const VGfloat *adjustments_y,
VGbitfield paintModes,
VGboolean allowAutoHinting) VG_API_EXIT;
/* Image Filters */
VG_API_CALL void VG_API_ENTRY vgColorMatrix(VGImage dst, VGImage src,
const VGfloat * matrix) VG_API_EXIT;

View File

@@ -1,233 +1,233 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VG extensions Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG extensions
*//*-------------------------------------------------------------------*/
#ifndef _VGEXT_H
#define _VGEXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#include <VG/vgu.h>
#ifndef VG_API_ENTRYP
# define VG_API_ENTRYP VG_API_ENTRY*
#endif
#ifndef VGU_API_ENTRYP
# define VGU_API_ENTRYP VGU_API_ENTRY*
#endif
/*-------------------------------------------------------------------------------
* KHR extensions
*------------------------------------------------------------------------------*/
typedef enum {
#ifndef VG_KHR_iterative_average_blur
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
#endif
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeKHR;
#ifndef VG_KHR_EGL_image
#define VG_KHR_EGL_image 1
/* VGEGLImageKHR is an opaque handle to an EGLImage */
typedef void* VGeglImageKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
#endif
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
#endif
#ifndef VG_KHR_iterative_average_blur
#define VG_KHR_iterative_average_blur 1
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
#ifndef VG_KHR_advanced_blending
#define VG_KHR_advanced_blending 1
typedef enum {
VG_BLEND_OVERLAY_KHR = 0x2010,
VG_BLEND_HARDLIGHT_KHR = 0x2011,
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
VG_BLEND_COLORDODGE_KHR = 0x2014,
VG_BLEND_COLORBURN_KHR = 0x2015,
VG_BLEND_DIFFERENCE_KHR = 0x2016,
VG_BLEND_SUBTRACT_KHR = 0x2017,
VG_BLEND_INVERT_KHR = 0x2018,
VG_BLEND_EXCLUSION_KHR = 0x2019,
VG_BLEND_LINEARDODGE_KHR = 0x201a,
VG_BLEND_LINEARBURN_KHR = 0x201b,
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
VG_BLEND_PINLIGHT_KHR = 0x201e,
VG_BLEND_HARDMIX_KHR = 0x201f,
VG_BLEND_CLEAR_KHR = 0x2020,
VG_BLEND_DST_KHR = 0x2021,
VG_BLEND_SRC_OUT_KHR = 0x2022,
VG_BLEND_DST_OUT_KHR = 0x2023,
VG_BLEND_SRC_ATOP_KHR = 0x2024,
VG_BLEND_DST_ATOP_KHR = 0x2025,
VG_BLEND_XOR_KHR = 0x2026,
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
} VGBlendModeKHR;
#endif
#ifndef VG_KHR_parametric_filter
#define VG_KHR_parametric_filter 1
typedef enum {
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
VG_PF_OUTER_FLAG_KHR = (1 << 2),
VG_PF_INNER_FLAG_KHR = (1 << 3),
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGPfTypeKHR;
typedef enum {
VGU_IMAGE_IN_USE_ERROR = 0xF010,
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCodeKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
/*-------------------------------------------------------------------------------
* NDS extensions
*------------------------------------------------------------------------------*/
#ifndef VG_NDS_paint_generation
#define VG_NDS_paint_generation 1
typedef enum {
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
VG_COLOR_MATRIX_NDS = 0x1A11,
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPaintParamTypeNds;
typedef enum {
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGImageModeNds;
#endif
#ifndef VG_NDS_projective_geometry
#define VG_NDS_projective_geometry 1
typedef enum {
VG_CLIP_MODE_NDS = 0x1180,
VG_CLIP_LINES_NDS = 0x1181,
VG_MAX_CLIP_LINES_NDS = 0x1182,
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeNds;
typedef enum {
VG_CLIPMODE_NONE_NDS = 0x3000,
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
VG_CLIPMODE_CULL_NDS = 0x3003,
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGClipModeNds;
typedef enum {
VG_RQUAD_TO_NDS = ( 13 << 1 ),
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathSegmentNds;
typedef enum {
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathCommandNds;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGEXT_H */
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
/*------------------------------------------------------------------------
*
* VG extensions Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG extensions
*//*-------------------------------------------------------------------*/
#ifndef _VGEXT_H
#define _VGEXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#include <VG/vgu.h>
#ifndef VG_API_ENTRYP
# define VG_API_ENTRYP VG_API_ENTRY*
#endif
#ifndef VGU_API_ENTRYP
# define VGU_API_ENTRYP VGU_API_ENTRY*
#endif
/*-------------------------------------------------------------------------------
* KHR extensions
*------------------------------------------------------------------------------*/
typedef enum {
#ifndef VG_KHR_iterative_average_blur
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
#endif
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeKHR;
#ifndef VG_KHR_EGL_image
#define VG_KHR_EGL_image 1
/* VGEGLImageKHR is an opaque handle to an EGLImage */
typedef void* VGeglImageKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
#endif
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
#endif
#ifndef VG_KHR_iterative_average_blur
#define VG_KHR_iterative_average_blur 1
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
#ifndef VG_KHR_advanced_blending
#define VG_KHR_advanced_blending 1
typedef enum {
VG_BLEND_OVERLAY_KHR = 0x2010,
VG_BLEND_HARDLIGHT_KHR = 0x2011,
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
VG_BLEND_COLORDODGE_KHR = 0x2014,
VG_BLEND_COLORBURN_KHR = 0x2015,
VG_BLEND_DIFFERENCE_KHR = 0x2016,
VG_BLEND_SUBTRACT_KHR = 0x2017,
VG_BLEND_INVERT_KHR = 0x2018,
VG_BLEND_EXCLUSION_KHR = 0x2019,
VG_BLEND_LINEARDODGE_KHR = 0x201a,
VG_BLEND_LINEARBURN_KHR = 0x201b,
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
VG_BLEND_PINLIGHT_KHR = 0x201e,
VG_BLEND_HARDMIX_KHR = 0x201f,
VG_BLEND_CLEAR_KHR = 0x2020,
VG_BLEND_DST_KHR = 0x2021,
VG_BLEND_SRC_OUT_KHR = 0x2022,
VG_BLEND_DST_OUT_KHR = 0x2023,
VG_BLEND_SRC_ATOP_KHR = 0x2024,
VG_BLEND_DST_ATOP_KHR = 0x2025,
VG_BLEND_XOR_KHR = 0x2026,
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
} VGBlendModeKHR;
#endif
#ifndef VG_KHR_parametric_filter
#define VG_KHR_parametric_filter 1
typedef enum {
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
VG_PF_OUTER_FLAG_KHR = (1 << 2),
VG_PF_INNER_FLAG_KHR = (1 << 3),
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGPfTypeKHR;
typedef enum {
VGU_IMAGE_IN_USE_ERROR = 0xF010,
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCodeKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
/*-------------------------------------------------------------------------------
* NDS extensions
*------------------------------------------------------------------------------*/
#ifndef VG_NDS_paint_generation
#define VG_NDS_paint_generation 1
typedef enum {
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
VG_COLOR_MATRIX_NDS = 0x1A11,
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPaintParamTypeNds;
typedef enum {
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGImageModeNds;
#endif
#ifndef VG_NDS_projective_geometry
#define VG_NDS_projective_geometry 1
typedef enum {
VG_CLIP_MODE_NDS = 0x1180,
VG_CLIP_LINES_NDS = 0x1181,
VG_MAX_CLIP_LINES_NDS = 0x1182,
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeNds;
typedef enum {
VG_CLIPMODE_NONE_NDS = 0x3000,
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
VG_CLIPMODE_CULL_NDS = 0x3003,
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGClipModeNds;
typedef enum {
VG_RQUAD_TO_NDS = ( 13 << 1 ),
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathSegmentNds;
typedef enum {
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathCommandNds;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGEXT_H */

View File

@@ -1,92 +1,92 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VG platform specific header Reference Implementation
* ----------------------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG platform specific header
*//*-------------------------------------------------------------------*/
#ifndef _VGPLATFORM_H
#define _VGPLATFORM_H
#include <KHR/khrplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef VG_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VG_API_CALL
#else
# define VG_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VG_API_CALL */
#ifndef VGU_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VGU_API_CALL
#else
# define VGU_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VGU_API_CALL */
#ifndef VG_API_ENTRY
#define VG_API_ENTRY
#endif
#ifndef VG_API_EXIT
#define VG_API_EXIT
#endif
#ifndef VGU_API_ENTRY
#define VGU_API_ENTRY
#endif
#ifndef VGU_API_EXIT
#define VGU_API_EXIT
#endif
typedef float VGfloat;
typedef signed char VGbyte;
typedef unsigned char VGubyte;
typedef signed short VGshort;
typedef signed int VGint;
typedef unsigned int VGuint;
typedef unsigned int VGbitfield;
#ifndef VG_VGEXT_PROTOTYPES
#define VG_VGEXT_PROTOTYPES
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGPLATFORM_H */
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
/*------------------------------------------------------------------------
*
* VG platform specific header Reference Implementation
* ----------------------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG platform specific header
*//*-------------------------------------------------------------------*/
#ifndef _VGPLATFORM_H
#define _VGPLATFORM_H
#include <KHR/khrplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef VG_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VG_API_CALL
#else
# define VG_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VG_API_CALL */
#ifndef VGU_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VGU_API_CALL
#else
# define VGU_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VGU_API_CALL */
#ifndef VG_API_ENTRY
#define VG_API_ENTRY
#endif
#ifndef VG_API_EXIT
#define VG_API_EXIT
#endif
#ifndef VGU_API_ENTRY
#define VGU_API_ENTRY
#endif
#ifndef VGU_API_EXIT
#define VGU_API_EXIT
#endif
typedef float VGfloat;
typedef signed char VGbyte;
typedef unsigned char VGubyte;
typedef signed short VGshort;
typedef signed int VGint;
typedef unsigned int VGuint;
typedef unsigned int VGbitfield;
#ifndef VG_VGEXT_PROTOTYPES
#define VG_VGEXT_PROTOTYPES
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGPLATFORM_H */

View File

@@ -1,130 +1,131 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VGU 1.0.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VGU 1.0.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _VGU_H
#define _VGU_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#define VGU_VERSION_1_0 1
#ifndef VGU_API_CALL
# error VGU_API_CALL must be defined
#endif
#ifndef VGU_API_ENTRY
# error VGU_API_ENTRY must be defined
#endif
#ifndef VGU_API_EXIT
# error VGU_API_EXIT must be defined
#endif
typedef enum {
VGU_NO_ERROR = 0,
VGU_BAD_HANDLE_ERROR = 0xF000,
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
VGU_PATH_CAPABILITY_ERROR = 0xF003,
VGU_BAD_WARP_ERROR = 0xF004,
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCode;
typedef enum {
VGU_ARC_OPEN = 0xF100,
VGU_ARC_CHORD = 0xF101,
VGU_ARC_PIE = 0xF102,
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGUArcType;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
VGfloat x0, VGfloat y0,
VGfloat x1, VGfloat y1) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
const VGfloat * points, VGint count,
VGboolean closed) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
VGfloat cx, VGfloat cy,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat startAngle, VGfloat angleExtent,
VGUArcType arcType) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* #ifndef _VGU_H */
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
/*------------------------------------------------------------------------
*
* VGU 1.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VGU 1.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _VGU_H
#define _VGU_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#define VGU_VERSION_1_0 1
#define VGU_VERSION_1_1 2
#ifndef VGU_API_CALL
# error VGU_API_CALL must be defined
#endif
#ifndef VGU_API_ENTRY
# error VGU_API_ENTRY must be defined
#endif
#ifndef VGU_API_EXIT
# error VGU_API_EXIT must be defined
#endif
typedef enum {
VGU_NO_ERROR = 0,
VGU_BAD_HANDLE_ERROR = 0xF000,
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
VGU_PATH_CAPABILITY_ERROR = 0xF003,
VGU_BAD_WARP_ERROR = 0xF004,
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCode;
typedef enum {
VGU_ARC_OPEN = 0xF100,
VGU_ARC_CHORD = 0xF101,
VGU_ARC_PIE = 0xF102,
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGUArcType;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
VGfloat x0, VGfloat y0,
VGfloat x1, VGfloat y1) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
const VGfloat * points, VGint count,
VGboolean closed) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
VGfloat cx, VGfloat cy,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat startAngle, VGfloat angleExtent,
VGUArcType arcType) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* #ifndef _VGU_H */

View File

@@ -54,11 +54,13 @@ prefixes32 = SCons.Util.Split("""
i586-mingw32msvc-
i686-mingw32msvc-
i686-pc-mingw32-
i686-w64-mingw32-
""")
prefixes64 = SCons.Util.Split("""
amd64-mingw32-
amd64-mingw32msvc-
amd64-pc-mingw32-
x86_64-w64-mingw32-
""")
def find(env):

View File

@@ -49,30 +49,35 @@ def symlink(target, source, env):
os.symlink(os.path.basename(source), target)
def install(env, source, subdir):
target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], subdir)
env.Install(target_dir, source)
target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'], subdir)
return env.Install(target_dir, source)
def install_program(env, source):
install(env, source, 'bin')
return install(env, source, 'bin')
def install_shared_library(env, sources, version = ()):
install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'])
targets = []
install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'])
version = tuple(map(str, version))
if env['SHLIBSUFFIX'] == '.dll':
dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX')
install(env, dlls, 'bin')
targets += install(env, dlls, 'bin')
libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX')
install(env, libs, 'lib')
targets += install(env, libs, 'lib')
else:
for source in sources:
target_dir = os.path.join(install_dir, 'lib')
target_name = '.'.join((str(source),) + version)
last = env.InstallAs(os.path.join(target_dir, target_name), source)
targets += last
while len(version):
version = version[:-1]
target_name = '.'.join((str(source),) + version)
action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE")
last = env.Command(os.path.join(target_dir, target_name), last, action)
targets += last
return targets
def createInstallMethods(env):
env.AddMethod(install_program, 'InstallProgram')
@@ -98,6 +103,41 @@ def num_jobs():
return 1
def pkg_config_modules(env, name, modules):
'''Simple wrapper for pkg-config.'''
env[name] = False
if env['platform'] == 'windows':
return
if not env.Detect('pkg-config'):
return
if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
return
# Put -I and -L flags directly into the environment, as these don't affect
# the compilation of targets that do not use them
try:
env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules))
except OSError:
return
# Other flags may affect the compilation of unrelated targets, so store
# them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
try:
flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules))
except OSError:
return
prefix = name.upper() + '_'
for flag_name, flag_value in flags.iteritems():
env[prefix + flag_name] = flag_value
env[name] = True
def generate(env):
"""Common environment generation code"""
@@ -110,27 +150,32 @@ def generate(env):
env['toolchain'] = 'wcesdk'
env.Tool(env['toolchain'])
if env['platform'] == 'embedded':
# Allow overriding compiler from environment
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
# Update CCVERSION to match
pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
stdin = 'devnull',
stderr = 'devnull',
stdout = subprocess.PIPE)
if pipe.wait() == 0:
line = pipe.stdout.readline()
match = re.search(r'[0-9]+(\.[0-9]+)+', line)
if match:
env['CCVERSION'] = match.group(0)
# Allow override compiler and specify additional flags from environment
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
# Update CCVERSION to match
pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
stdin = 'devnull',
stderr = 'devnull',
stdout = subprocess.PIPE)
if pipe.wait() == 0:
line = pipe.stdout.readline()
match = re.search(r'[0-9]+(\.[0-9]+)+', line)
if match:
env['CCVERSION'] = match.group(0)
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
# shortcuts
debug = env['debug']
machine = env['machine']
platform = env['platform']
x86 = env['machine'] == 'x86'
@@ -138,20 +183,48 @@ def generate(env):
gcc = env['gcc']
msvc = env['msvc']
# Backwards compatability with the debug= profile= options
if env['build'] == 'debug':
if not env['debug']:
print 'scons: warning: debug option is deprecated and will be removed eventually; use instead'
print
print ' scons build=release'
print
env['build'] = 'release'
if env['profile']:
print 'scons: warning: profile option is deprecated and will be removed eventually; use instead'
print
print ' scons build=profile'
print
env['build'] = 'profile'
if False:
# Enforce SConscripts to use the new build variable
env.popitem('debug')
env.popitem('profile')
else:
# Backwards portability with older sconscripts
if env['build'] in ('debug', 'checked'):
env['debug'] = True
env['profile'] = False
if env['build'] == 'profile':
env['debug'] = False
env['profile'] = True
if env['build'] == 'release':
env['debug'] = False
env['profile'] = False
# Put build output in a separate dir, which depends on the current
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
build_topdir = 'build'
build_subdir = env['platform']
if env['machine'] != 'generic':
build_subdir += '-' + env['machine']
if env['debug']:
build_subdir += "-debug"
if env['profile']:
build_subdir += "-profile"
if env['build'] != 'release':
build_subdir += '-' + env['build']
build_dir = os.path.join(build_topdir, build_subdir)
# Place the .sconsign file in the build dir too, to avoid issues with
# different scons versions building the same source file
env['build'] = build_dir
env['build_dir'] = build_dir
env.SConsignFile(os.path.join(build_dir, '.sconsign'))
if 'SCONS_CACHE_DIR' in os.environ:
print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],)
@@ -163,13 +236,16 @@ def generate(env):
if env.GetOption('num_jobs') <= 1:
env.SetOption('num_jobs', num_jobs())
env.Decider('MD5-timestamp')
env.SetOption('max_drift', 60)
# C preprocessor options
cppdefines = []
if debug:
if env['build'] in ('debug', 'checked'):
cppdefines += ['DEBUG']
else:
cppdefines += ['NDEBUG']
if env['profile']:
if env['build'] == 'profile':
cppdefines += ['PROFILE']
if platform == 'windows':
cppdefines += [
@@ -190,7 +266,7 @@ def generate(env):
'_SCL_SECURE_NO_WARNINGS',
'_SCL_SECURE_NO_DEPRECATE',
]
if debug:
if env['build'] in ('debug', 'checked'):
cppdefines += ['_DEBUG']
if env['toolchain'] == 'winddk':
# Mimic WINDDK's builtin flags. See also:
@@ -217,7 +293,7 @@ def generate(env):
('__BUILDMACHINE__', 'WinDDK'),
('FPO', '0'),
]
if debug:
if env['build'] in ('debug', 'checked'):
cppdefines += [('DBG', 1)]
if platform == 'wince':
cppdefines += [
@@ -253,15 +329,16 @@ def generate(env):
ccflags = [] # C & C++
if gcc:
ccversion = env['CCVERSION']
if debug:
ccflags += ['-O0', '-g3']
if env['build'] == 'debug':
ccflags += ['-O0']
elif ccversion.startswith('4.2.'):
# gcc 4.2.x optimizer is broken
print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations"
ccflags += ['-O0', '-g3']
ccflags += ['-O0']
else:
ccflags += ['-O3', '-g3']
if env['profile']:
ccflags += ['-O3']
ccflags += ['-g3']
if env['build'] in ('checked', 'profile'):
# See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
ccflags += [
'-fno-omit-frame-pointer',
@@ -320,7 +397,7 @@ def generate(env):
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# - cl /?
if debug:
if env['build'] == 'debug':
ccflags += [
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
@@ -389,7 +466,7 @@ def generate(env):
if env['platform'] == 'windows' and msvc:
# Choose the appropriate MSVC CRT
# http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
if env['debug']:
if env['build'] in ('debug', 'checked'):
env.Append(CCFLAGS = ['/MTd'])
env.Append(SHCCFLAGS = ['/LDd'])
else:
@@ -421,7 +498,7 @@ def generate(env):
else:
env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
if msvc:
if not env['debug']:
if env['build'] != 'debug':
# enable Link-time Code Generation
linkflags += ['/LTCG']
env.Append(ARFLAGS = ['/LTCG'])
@@ -460,7 +537,7 @@ def generate(env):
'/entry:DrvEnableDriver',
]
if env['debug'] or env['profile']:
if env['build'] != 'release':
linkflags += [
'/MAP', # http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
]
@@ -477,9 +554,19 @@ def generate(env):
# Default libs
env.Append(LIBS = [])
# Load LLVM
# Load tools
if env['llvm']:
env.Tool('llvm')
env.Tool('udis86')
pkg_config_modules(env, 'x11', ['x11', 'xext'])
pkg_config_modules(env, 'drm', ['libdrm'])
pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
pkg_config_modules(env, 'xorg', ['xorg-server'])
pkg_config_modules(env, 'kms', ['libkms'])
env['dri'] = env['x11'] and env['drm']
# Custom builders and methods
env.Tool('custom')

View File

@@ -38,6 +38,8 @@ import SCons.Util
def generate(env):
env['llvm'] = False
try:
llvm_dir = os.environ['LLVM']
except KeyError:
@@ -64,13 +66,13 @@ def generate(env):
# XXX: There is no llvm-config on Windows, so assume a standard layout
if llvm_dir is None:
print 'scons: LLVM environment variable must be specified when building for windows'
env.Exit(1)
return
# Try to determine the LLVM version from llvm/Config/config.h
llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h')
if not os.path.exists(llvm_config):
print 'scons: could not find %s' % llvm_config
env.Exit(1)
return
llvm_version_re = re.compile(r'^#define PACKAGE_VERSION "([^"]*)"')
llvm_version = None
for line in open(llvm_config, 'rt'):
@@ -81,7 +83,7 @@ def generate(env):
break
if llvm_version is None:
print 'scons: could not determine the LLVM version from %s' % llvm_config
env.Exit(1)
return
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
env.AppendUnique(CPPDEFINES = [
@@ -124,7 +126,7 @@ def generate(env):
# Some of the LLVM C headers use the inline keyword without
# defining it.
env.Append(CPPDEFINES = [('inline', '__inline')])
if env['debug']:
if env['build'] in ('debug', 'checked'):
# LLVM libraries are static, build with /MT, and they
# automatically link agains LIBCMT. When we're doing a
# debug build we'll be linking against LIBCMTD, so disable
@@ -133,7 +135,7 @@ def generate(env):
else:
if not env.Detect('llvm-config'):
print 'scons: llvm-config script not found' % llvm_version
env.Exit(1)
return
llvm_version = env.backtick('llvm-config --version').rstrip()
llvm_version = distutils.version.LooseVersion(llvm_version)
@@ -144,11 +146,12 @@ def generate(env):
env.ParseConfig('llvm-config --ldflags')
except OSError:
print 'scons: llvm-config version %s failed' % llvm_version
env.Exit(1)
return
else:
env['LINK'] = env['CXX']
assert llvm_version is not None
env['llvm'] = True
print 'scons: Found LLVM version %s' % llvm_version
env['LLVM_VERSION'] = llvm_version

View File

@@ -31,8 +31,10 @@ def generate(env):
conf = env.Configure()
if conf.CheckHeader('udis86.h'): # and conf.CheckLib('udis86'):
env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')])
env['UDIS86'] = True
env.Prepend(LIBS = ['udis86'])
else:
env['UDIS86'] = False
conf.Finish()

View File

@@ -122,7 +122,7 @@ def get_wce600_paths(env):
host_cpu = os.environ.get('_HOSTCPUTYPE', 'i386')
target_cpu = os.environ.get('_TGTCPU', 'x86')
if env['debug']:
if env['build'] == 'debug':
build = 'debug'
else:
build = 'retail'

View File

@@ -1,19 +1,16 @@
Import('*')
if 'egl' in env['statetrackers']:
SConscript('mapi/vgapi/SConscript')
SConscript('mapi/vgapi/SConscript')
if env['platform'] == 'windows':
SConscript('egl/main/SConscript')
if 'mesa' in env['statetrackers']:
if platform == 'windows':
SConscript('talloc/SConscript')
SConscript('glsl/SConscript')
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
SConscript('glsl/SConscript')
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
if platform != 'embedded':
SConscript('glut/glx/SConscript')
if env['platform'] != 'embedded':
SConscript('glut/glx/SConscript')
SConscript('gallium/SConscript')

View File

@@ -24,8 +24,8 @@ $(EGL_DRIVER_PATH): $(EGL_DRIVER)
$(EGL_DRIVER): $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -noprefix \
-linker '$(CC)' -ldflags '$(LDFLAGS)' \
-L$(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-linker '$(CC)' -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
$(MKLIB_OPTIONS) \
$(EGL_OBJECTS) $(EGL_LIBS) -l$(EGL_LIB)
.c.o:

File diff suppressed because it is too large Load Diff

View File

@@ -132,29 +132,38 @@ static const struct {
int egl_attr;
} fbconfig_attributes[] = {
/* table 3.1 of GLX 1.4 */
{ GLX_BUFFER_SIZE, EGL_BUFFER_SIZE },
{ GLX_LEVEL, EGL_LEVEL },
{ GLX_RED_SIZE, EGL_RED_SIZE },
{ GLX_GREEN_SIZE, EGL_GREEN_SIZE },
{ GLX_BLUE_SIZE, EGL_BLUE_SIZE },
{ GLX_ALPHA_SIZE, EGL_ALPHA_SIZE },
{ GLX_DEPTH_SIZE, EGL_DEPTH_SIZE },
{ GLX_STENCIL_SIZE, EGL_STENCIL_SIZE },
{ GLX_SAMPLE_BUFFERS, EGL_SAMPLE_BUFFERS },
{ GLX_SAMPLES, EGL_SAMPLES },
{ GLX_RENDER_TYPE, EGL_RENDERABLE_TYPE },
{ GLX_X_RENDERABLE, EGL_NATIVE_RENDERABLE },
{ GLX_X_VISUAL_TYPE, EGL_NATIVE_VISUAL_TYPE },
{ GLX_CONFIG_CAVEAT, EGL_CONFIG_CAVEAT },
{ GLX_TRANSPARENT_TYPE, EGL_TRANSPARENT_TYPE },
{ GLX_TRANSPARENT_RED_VALUE, EGL_TRANSPARENT_RED_VALUE },
{ GLX_TRANSPARENT_GREEN_VALUE, EGL_TRANSPARENT_GREEN_VALUE },
{ GLX_TRANSPARENT_BLUE_VALUE, EGL_TRANSPARENT_BLUE_VALUE },
{ GLX_MAX_PBUFFER_WIDTH, EGL_MAX_PBUFFER_WIDTH },
{ GLX_MAX_PBUFFER_HEIGHT, EGL_MAX_PBUFFER_HEIGHT },
{ GLX_MAX_PBUFFER_PIXELS, EGL_MAX_PBUFFER_PIXELS },
{ GLX_VISUAL_ID, EGL_NATIVE_VISUAL_ID },
{ GLX_X_VISUAL_TYPE, EGL_NATIVE_VISUAL_TYPE },
{ GLX_FBCONFIG_ID, 0 },
{ GLX_BUFFER_SIZE, EGL_BUFFER_SIZE },
{ GLX_LEVEL, EGL_LEVEL },
{ GLX_DOUBLEBUFFER, 0 },
{ GLX_STEREO, 0 },
{ GLX_AUX_BUFFERS, 0 },
{ GLX_RED_SIZE, EGL_RED_SIZE },
{ GLX_GREEN_SIZE, EGL_GREEN_SIZE },
{ GLX_BLUE_SIZE, EGL_BLUE_SIZE },
{ GLX_ALPHA_SIZE, EGL_ALPHA_SIZE },
{ GLX_DEPTH_SIZE, EGL_DEPTH_SIZE },
{ GLX_STENCIL_SIZE, EGL_STENCIL_SIZE },
{ GLX_ACCUM_RED_SIZE, 0 },
{ GLX_ACCUM_GREEN_SIZE, 0 },
{ GLX_ACCUM_BLUE_SIZE, 0 },
{ GLX_ACCUM_ALPHA_SIZE, 0 },
{ GLX_SAMPLE_BUFFERS, EGL_SAMPLE_BUFFERS },
{ GLX_SAMPLES, EGL_SAMPLES },
{ GLX_RENDER_TYPE, 0 },
{ GLX_DRAWABLE_TYPE, EGL_SURFACE_TYPE },
{ GLX_X_RENDERABLE, EGL_NATIVE_RENDERABLE },
{ GLX_X_VISUAL_TYPE, EGL_NATIVE_VISUAL_TYPE },
{ GLX_CONFIG_CAVEAT, EGL_CONFIG_CAVEAT },
{ GLX_TRANSPARENT_TYPE, EGL_TRANSPARENT_TYPE },
{ GLX_TRANSPARENT_INDEX_VALUE, 0 },
{ GLX_TRANSPARENT_RED_VALUE, EGL_TRANSPARENT_RED_VALUE },
{ GLX_TRANSPARENT_GREEN_VALUE, EGL_TRANSPARENT_GREEN_VALUE },
{ GLX_TRANSPARENT_BLUE_VALUE, EGL_TRANSPARENT_BLUE_VALUE },
{ GLX_MAX_PBUFFER_WIDTH, EGL_MAX_PBUFFER_WIDTH },
{ GLX_MAX_PBUFFER_HEIGHT, EGL_MAX_PBUFFER_HEIGHT },
{ GLX_MAX_PBUFFER_PIXELS, EGL_MAX_PBUFFER_PIXELS },
{ GLX_VISUAL_ID, EGL_NATIVE_VISUAL_ID }
};
@@ -162,12 +171,31 @@ static EGLBoolean
convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
struct GLX_egl_config *GLX_conf)
{
int err = 0, attr, egl_attr, val, i;
EGLint conformant, config_caveat, surface_type;
int err, attr, val;
unsigned i;
/* must have rgba bit */
err = glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &val);
if (err || !(val & GLX_RGBA_BIT))
return EGL_FALSE;
/* must know whether it is double-buffered */
err = glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &val);
if (err)
return EGL_FALSE;
GLX_conf->double_buffered = val;
GLX_conf->Base.RenderableType = EGL_OPENGL_BIT;
GLX_conf->Base.Conformant = EGL_OPENGL_BIT;
for (i = 0; i < ARRAY_SIZE(fbconfig_attributes); i++) {
EGLint egl_attr, egl_val;
attr = fbconfig_attributes[i].attr;
egl_attr = fbconfig_attributes[i].egl_attr;
if (!egl_attr)
continue;
err = glXGetFBConfigAttrib(dpy, fbconfig, attr, &val);
if (err) {
if (err == GLX_BAD_ATTRIBUTE) {
@@ -177,47 +205,71 @@ convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
break;
}
_eglSetConfigKey(&GLX_conf->Base, egl_attr, val);
switch (egl_attr) {
case EGL_SURFACE_TYPE:
egl_val = 0;
if (val & GLX_WINDOW_BIT)
egl_val |= EGL_WINDOW_BIT;
/* pixmap and pbuffer surfaces must be single-buffered in EGL */
if (!GLX_conf->double_buffered) {
if (val & GLX_PIXMAP_BIT)
egl_val |= EGL_PIXMAP_BIT;
if (val & GLX_PBUFFER_BIT)
egl_val |= EGL_PBUFFER_BIT;
}
break;
case EGL_NATIVE_VISUAL_TYPE:
switch (val) {
case GLX_TRUE_COLOR:
egl_val = TrueColor;
break;
case GLX_DIRECT_COLOR:
egl_val = DirectColor;
break;
case GLX_PSEUDO_COLOR:
egl_val = PseudoColor;
break;
case GLX_STATIC_COLOR:
egl_val = StaticColor;
break;
case GLX_GRAY_SCALE:
egl_val = GrayScale;
break;
case GLX_STATIC_GRAY:
egl_val = StaticGray;
break;
default:
egl_val = EGL_NONE;
break;
}
break;
case EGL_CONFIG_CAVEAT:
egl_val = EGL_NONE;
if (val == GLX_SLOW_CONFIG) {
egl_val = EGL_SLOW_CONFIG;
}
else if (val == GLX_NON_CONFORMANT_CONFIG) {
GLX_conf->Base.Conformant &= ~EGL_OPENGL_BIT;
egl_val = EGL_NONE;
}
break;
case EGL_TRANSPARENT_TYPE:
egl_val = (val == GLX_TRANSPARENT_RGB) ?
EGL_TRANSPARENT_RGB : EGL_NONE;
break;
default:
egl_val = val;
break;
}
_eglSetConfigKey(&GLX_conf->Base, egl_attr, egl_val);
}
if (err)
return EGL_FALSE;
/* must have rgba bit */
glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &val);
if (!(val & GLX_RGBA_BIT))
if (!GLX_conf->Base.SurfaceType)
return EGL_FALSE;
conformant = EGL_OPENGL_BIT;
glXGetFBConfigAttrib(dpy, fbconfig, GLX_CONFIG_CAVEAT, &val);
if (val == GLX_SLOW_CONFIG)
config_caveat = EGL_SLOW_CONFIG;
if (val == GLX_NON_CONFORMANT_CONFIG)
conformant &= ~EGL_OPENGL_BIT;
if (!(conformant & EGL_OPENGL_ES_BIT))
config_caveat = EGL_NON_CONFORMANT_CONFIG;
_eglSetConfigKey(&GLX_conf->Base, EGL_CONFIG_CAVEAT, config_caveat);
surface_type = 0;
glXGetFBConfigAttrib(dpy, fbconfig, GLX_DRAWABLE_TYPE, &val);
if (val & GLX_WINDOW_BIT)
surface_type |= EGL_WINDOW_BIT;
if (val & GLX_PIXMAP_BIT)
surface_type |= EGL_PIXMAP_BIT;
if (val & GLX_PBUFFER_BIT)
surface_type |= EGL_PBUFFER_BIT;
/* pixmap and pbuffer surfaces must be single-buffered in EGL */
glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &val);
GLX_conf->double_buffered = val;
if (GLX_conf->double_buffered) {
surface_type &= ~(EGL_PIXMAP_BIT | EGL_PBUFFER_BIT);
if (!surface_type)
return EGL_FALSE;
}
_eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
return EGL_TRUE;
}
@@ -226,34 +278,69 @@ static const struct {
int egl_attr;
} visual_attributes[] = {
/* table 3.7 of GLX 1.4 */
/* no GLX_USE_GL */
{ GLX_BUFFER_SIZE, EGL_BUFFER_SIZE },
{ GLX_LEVEL, EGL_LEVEL },
{ GLX_RED_SIZE, EGL_RED_SIZE },
{ GLX_GREEN_SIZE, EGL_GREEN_SIZE },
{ GLX_BLUE_SIZE, EGL_BLUE_SIZE },
{ GLX_ALPHA_SIZE, EGL_ALPHA_SIZE },
{ GLX_DEPTH_SIZE, EGL_DEPTH_SIZE },
{ GLX_STENCIL_SIZE, EGL_STENCIL_SIZE },
{ GLX_SAMPLE_BUFFERS, EGL_SAMPLE_BUFFERS },
{ GLX_SAMPLES, EGL_SAMPLES },
{ GLX_USE_GL, 0 },
{ GLX_BUFFER_SIZE, EGL_BUFFER_SIZE },
{ GLX_LEVEL, EGL_LEVEL },
{ GLX_RGBA, 0 },
{ GLX_DOUBLEBUFFER, 0 },
{ GLX_STEREO, 0 },
{ GLX_AUX_BUFFERS, 0 },
{ GLX_RED_SIZE, EGL_RED_SIZE },
{ GLX_GREEN_SIZE, EGL_GREEN_SIZE },
{ GLX_BLUE_SIZE, EGL_BLUE_SIZE },
{ GLX_ALPHA_SIZE, EGL_ALPHA_SIZE },
{ GLX_DEPTH_SIZE, EGL_DEPTH_SIZE },
{ GLX_STENCIL_SIZE, EGL_STENCIL_SIZE },
{ GLX_ACCUM_RED_SIZE, 0 },
{ GLX_ACCUM_GREEN_SIZE, 0 },
{ GLX_ACCUM_BLUE_SIZE, 0 },
{ GLX_ACCUM_ALPHA_SIZE, 0 },
{ GLX_SAMPLE_BUFFERS, EGL_SAMPLE_BUFFERS },
{ GLX_SAMPLES, EGL_SAMPLES },
{ GLX_FBCONFIG_ID, 0 },
/* GLX_EXT_visual_rating */
{ GLX_VISUAL_CAVEAT_EXT, EGL_CONFIG_CAVEAT }
};
static EGLBoolean
convert_visual(Display *dpy, XVisualInfo *vinfo,
struct GLX_egl_config *GLX_conf)
{
int err, attr, egl_attr, val, i;
EGLint conformant, config_caveat, surface_type;
int err, attr, val;
unsigned i;
/* the visual must support OpenGL */
/* the visual must support OpenGL and RGBA buffer */
err = glXGetConfig(dpy, vinfo, GLX_USE_GL, &val);
if (!err && val)
err = glXGetConfig(dpy, vinfo, GLX_RGBA, &val);
if (err || !val)
return EGL_FALSE;
/* must know whether it is double-buffered */
err = glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &val);
if (err)
return EGL_FALSE;
GLX_conf->double_buffered = val;
GLX_conf->Base.RenderableType = EGL_OPENGL_BIT;
GLX_conf->Base.Conformant = EGL_OPENGL_BIT;
GLX_conf->Base.SurfaceType = EGL_WINDOW_BIT;
/* pixmap surfaces must be single-buffered in EGL */
if (!GLX_conf->double_buffered)
GLX_conf->Base.SurfaceType |= EGL_PIXMAP_BIT;
GLX_conf->Base.NativeVisualID = vinfo->visualid;
GLX_conf->Base.NativeVisualType = vinfo->class;
GLX_conf->Base.NativeRenderable = EGL_TRUE;
for (i = 0; i < ARRAY_SIZE(visual_attributes); i++) {
EGLint egl_attr, egl_val;
attr = visual_attributes[i].attr;
egl_attr = fbconfig_attributes[i].egl_attr;
egl_attr = visual_attributes[i].egl_attr;
if (!egl_attr)
continue;
err = glXGetConfig(dpy, vinfo, attr, &val);
if (err) {
if (err == GLX_BAD_ATTRIBUTE) {
@@ -263,41 +350,26 @@ convert_visual(Display *dpy, XVisualInfo *vinfo,
break;
}
_eglSetConfigKey(&GLX_conf->Base, egl_attr, val);
switch (egl_attr) {
case EGL_CONFIG_CAVEAT:
egl_val = EGL_NONE;
if (val == GLX_SLOW_VISUAL_EXT) {
egl_val = EGL_SLOW_CONFIG;
}
else if (val == GLX_NON_CONFORMANT_VISUAL_EXT) {
GLX_conf->Base.Conformant &= ~EGL_OPENGL_BIT;
egl_val = EGL_NONE;
}
break;
break;
default:
egl_val = val;
break;
}
_eglSetConfigKey(&GLX_conf->Base, egl_attr, egl_val);
}
if (err)
return EGL_FALSE;
glXGetConfig(dpy, vinfo, GLX_RGBA, &val);
if (!val)
return EGL_FALSE;
conformant = EGL_OPENGL_BIT;
glXGetConfig(dpy, vinfo, GLX_VISUAL_CAVEAT_EXT, &val);
if (val == GLX_SLOW_CONFIG)
config_caveat = EGL_SLOW_CONFIG;
if (val == GLX_NON_CONFORMANT_CONFIG)
conformant &= ~EGL_OPENGL_BIT;
if (!(conformant & EGL_OPENGL_ES_BIT))
config_caveat = EGL_NON_CONFORMANT_CONFIG;
_eglSetConfigKey(&GLX_conf->Base, EGL_CONFIG_CAVEAT, config_caveat);
_eglSetConfigKey(&GLX_conf->Base, EGL_NATIVE_VISUAL_ID, vinfo->visualid);
_eglSetConfigKey(&GLX_conf->Base, EGL_NATIVE_VISUAL_TYPE, vinfo->class);
/* pixmap and pbuffer surfaces must be single-buffered in EGL */
glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &val);
GLX_conf->double_buffered = val;
surface_type = EGL_WINDOW_BIT;
/* pixmap surfaces must be single-buffered in EGL */
if (!GLX_conf->double_buffered)
surface_type |= EGL_PIXMAP_BIT;
_eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
_eglSetConfigKey(&GLX_conf->Base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
return EGL_TRUE;
return (err) ? EGL_FALSE : EGL_TRUE;
}
@@ -305,30 +377,31 @@ static void
fix_config(struct GLX_egl_display *GLX_dpy, struct GLX_egl_config *GLX_conf)
{
_EGLConfig *conf = &GLX_conf->Base;
EGLint surface_type, r, g, b, a;
surface_type = GET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE);
if (!GLX_conf->double_buffered && GLX_dpy->single_buffered_quirk) {
/* some GLX impls do not like single-buffered window surface */
surface_type &= ~EGL_WINDOW_BIT;
conf->SurfaceType &= ~EGL_WINDOW_BIT;
/* pbuffer bit is usually not set */
if (GLX_dpy->have_pbuffer)
surface_type |= EGL_PBUFFER_BIT;
SET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE, surface_type);
conf->SurfaceType |= EGL_PBUFFER_BIT;
}
/* no visual attribs unless window bit is set */
if (!(surface_type & EGL_WINDOW_BIT)) {
SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_ID, 0);
SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE, EGL_NONE);
if (!(conf->SurfaceType & EGL_WINDOW_BIT)) {
conf->NativeVisualID = 0;
conf->NativeVisualType = EGL_NONE;
}
if (conf->TransparentType != EGL_TRANSPARENT_RGB) {
/* some impls set them to -1 (GLX_DONT_CARE) */
conf->TransparentRedValue = 0;
conf->TransparentGreenValue = 0;
conf->TransparentBlueValue = 0;
}
/* make sure buffer size is set correctly */
r = GET_CONFIG_ATTRIB(conf, EGL_RED_SIZE);
g = GET_CONFIG_ATTRIB(conf, EGL_GREEN_SIZE);
b = GET_CONFIG_ATTRIB(conf, EGL_BLUE_SIZE);
a = GET_CONFIG_ATTRIB(conf, EGL_ALPHA_SIZE);
SET_CONFIG_ATTRIB(conf, EGL_BUFFER_SIZE, r + g + b + a);
conf->BufferSize =
conf->RedSize + conf->GreenSize + conf->BlueSize + conf->AlphaSize;
}
@@ -379,7 +452,7 @@ create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
memcpy(GLX_conf, &template, sizeof(template));
GLX_conf->index = i;
_eglAddConfig(dpy, &GLX_conf->Base);
_eglLinkConfig(&GLX_conf->Base);
id++;
}
}
@@ -457,6 +530,8 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
{
struct GLX_egl_display *GLX_dpy;
(void) drv;
if (disp->Platform != _EGL_PLATFORM_X11)
return EGL_FALSE;
@@ -541,6 +616,8 @@ GLX_eglCreateContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_context *GLX_ctx_shared = GLX_egl_context(share_list);
(void) drv;
if (!GLX_ctx) {
_eglError(EGL_BAD_ALLOC, "eglCreateContext");
return NULL;
@@ -600,12 +677,16 @@ GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
struct GLX_egl_surface *GLX_dsurf = GLX_egl_surface(dsurf);
struct GLX_egl_surface *GLX_rsurf = GLX_egl_surface(rsurf);
struct GLX_egl_context *GLX_ctx = GLX_egl_context(ctx);
_EGLContext *old_ctx;
_EGLSurface *old_dsurf, *old_rsurf;
GLXDrawable ddraw, rdraw;
GLXContext cctx;
EGLBoolean ret = EGL_FALSE;
/* bind the new context and return the "orphaned" one */
if (!_eglBindContext(&ctx, &dsurf, &rsurf))
(void) drv;
/* make new bindings */
if (!_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf))
return EGL_FALSE;
ddraw = (GLX_dsurf) ? GLX_dsurf->glx_drawable : None;
@@ -618,13 +699,27 @@ GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
ret = glXMakeCurrent(GLX_dpy->dpy, ddraw, cctx);
if (ret) {
if (dsurf && !_eglIsSurfaceLinked(dsurf))
destroy_surface(disp, dsurf);
if (rsurf && rsurf != dsurf && !_eglIsSurfaceLinked(rsurf))
destroy_surface(disp, rsurf);
if (_eglPutSurface(old_dsurf))
destroy_surface(disp, old_dsurf);
if (_eglPutSurface(old_rsurf))
destroy_surface(disp, old_rsurf);
/* no destroy? */
_eglPutContext(old_ctx);
}
else {
_eglBindContext(&ctx, &dsurf, &rsurf);
/* undo the previous _eglBindContext */
_eglBindContext(old_ctx, old_dsurf, old_rsurf, &ctx, &dsurf, &rsurf);
assert(&GLX_ctx->Base == ctx &&
&GLX_dsurf->Base == dsurf &&
&GLX_rsurf->Base == rsurf);
_eglPutSurface(dsurf);
_eglPutSurface(rsurf);
_eglPutContext(ctx);
_eglPutSurface(old_dsurf);
_eglPutSurface(old_rsurf);
_eglPutContext(old_ctx);
}
return ret;
@@ -656,6 +751,8 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
struct GLX_egl_surface *GLX_surf;
uint width, height;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreateWindowSurface");
@@ -702,6 +799,8 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
struct GLX_egl_surface *GLX_surf;
uint width, height;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePixmapSurface");
@@ -762,6 +861,8 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
int attribs[5];
int i;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface");
@@ -820,7 +921,9 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
static EGLBoolean
GLX_eglDestroySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
if (!_eglIsSurfaceBound(surf))
(void) drv;
if (_eglPutSurface(surf))
destroy_surface(disp, surf);
return EGL_TRUE;
@@ -833,6 +936,8 @@ GLX_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf = GLX_egl_surface(draw);
(void) drv;
glXSwapBuffers(GLX_dpy->dpy, GLX_surf->glx_drawable);
return EGL_TRUE;
@@ -844,12 +949,18 @@ GLX_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
static _EGLProc
GLX_eglGetProcAddress(_EGLDriver *drv, const char *procname)
{
(void) drv;
return (_EGLProc) glXGetProcAddress((const GLubyte *) procname);
}
static EGLBoolean
GLX_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
(void) drv;
(void) dpy;
(void) ctx;
glXWaitGL();
return EGL_TRUE;
}
@@ -857,6 +968,9 @@ GLX_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
static EGLBoolean
GLX_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine)
{
(void) drv;
(void) dpy;
if (engine != EGL_CORE_NATIVE_ENGINE)
return _eglError(EGL_BAD_PARAMETER, "eglWaitNative");
glXWaitX();
@@ -880,6 +994,8 @@ _eglMain(const char *args)
{
struct GLX_egl_driver *GLX_drv = CALLOC_STRUCT(GLX_egl_driver);
(void) args;
if (!GLX_drv)
return NULL;

View File

@@ -36,6 +36,7 @@ SOURCES = \
eglcurrent.c \
egldisplay.c \
egldriver.c \
eglfallbacks.c \
eglglobals.c \
eglimage.c \
egllog.c \
@@ -57,7 +58,7 @@ EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
ifeq ($(firstword $(EGL_PLATFORMS)),x11)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
endif
ifeq ($(firstword $(EGL_PLATFORMS)),kms)
ifeq ($(firstword $(EGL_PLATFORMS)),drm)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
endif
ifeq ($(firstword $(EGL_PLATFORMS)),fbdev)

View File

@@ -4,48 +4,49 @@
Import('*')
if env['platform'] != 'winddk':
env = env.Clone()
env = env.Clone()
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
env.Append(CPPPATH = [
'#/include',
])
env.Append(CPPPATH = [
'#/include',
])
egl_sources = [
'eglapi.c',
'eglarray.c',
'eglconfig.c',
'eglcontext.c',
'eglcurrent.c',
'egldisplay.c',
'egldriver.c',
'eglfallbacks.c',
'eglglobals.c',
'eglimage.c',
'egllog.c',
'eglmisc.c',
'eglmode.c',
'eglscreen.c',
'eglstring.c',
'eglsurface.c',
'eglsync.c',
]
egl_sources = [
'eglapi.c',
'eglarray.c',
'eglconfig.c',
'eglcontext.c',
'eglcurrent.c',
'egldisplay.c',
'egldriver.c',
'eglglobals.c',
'eglimage.c',
'egllog.c',
'eglmisc.c',
'eglmode.c',
'eglscreen.c',
'eglstring.c',
'eglsurface.c',
'eglsync.c',
]
egl = env.SharedLibrary(
target = 'libEGL',
source = egl_sources + ['egl.def'],
)
egl = env.SharedLibrary(
target = 'libEGL',
source = egl_sources + ['egl.def'],
)
installed_egl = env.InstallSharedLibrary(egl, version=(1, 4, 0))
env.InstallSharedLibrary(egl, version=(1, 4, 0))
env.Alias('egl', installed_egl)
egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')]
egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')]
Export('egl')
Export('egl')

View File

@@ -402,16 +402,21 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
_EGLContext *context;
EGLContext ret;
if (config)
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv);
else
_EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
_EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
if (!config) {
/* config may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_gles1 &&
!disp->Extensions.KHR_surfaceless_gles2 &&
!disp->Extensions.KHR_surfaceless_opengl)
RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
}
if (!share && share_list != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
context = drv->API.CreateContext(drv, disp, conf, share, attrib_list);
ret = (context) ? _eglLinkContext(context, disp) : EGL_NO_CONTEXT;
ret = (context) ? _eglLinkContext(context) : EGL_NO_CONTEXT;
RETURN_EGL_EVAL(disp, ret);
}
@@ -459,9 +464,19 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,
if (!context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
(!read_surf && read != EGL_NO_SURFACE))
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if (!draw_surf || !read_surf) {
/* surfaces may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_gles1 &&
!disp->Extensions.KHR_surfaceless_gles2 &&
!disp->Extensions.KHR_surfaceless_opengl)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
(!read_surf && read != EGL_NO_SURFACE))
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if (draw_surf || read_surf)
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
}
ret = drv->API.MakeCurrent(drv, disp, draw_surf, read_surf, context);
@@ -500,7 +515,7 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -521,7 +536,7 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -540,7 +555,7 @@ eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
surf = drv->API.CreatePbufferSurface(drv, disp, conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -633,11 +648,12 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval)
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
if (!ctx || !_eglIsContextLinked(ctx) || ctx->Resource.Display != disp)
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
ctx->Resource.Display != disp)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
surf = ctx->DrawSurface;
if (!_eglIsSurfaceLinked(surf))
if (_eglGetSurfaceHandle(surf) == EGL_NO_SURFACE)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
ret = drv->API.SwapInterval(drv, disp, surf, interval);
@@ -658,7 +674,8 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
/* surface must be bound to current context in EGL 1.4 */
if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface)
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
surf != ctx->DrawSurface)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
ret = drv->API.SwapBuffers(drv, disp, surf);
@@ -699,7 +716,8 @@ eglWaitClient(void)
_eglLockMutex(&disp->Mutex);
/* let bad current context imply bad current surface */
if (!_eglIsContextLinked(ctx) || !_eglIsSurfaceLinked(ctx->DrawSurface))
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
_eglGetSurfaceHandle(ctx->DrawSurface) == EGL_NO_SURFACE)
RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
/* a valid current context implies an initialized current display */
@@ -748,7 +766,8 @@ eglWaitNative(EGLint engine)
_eglLockMutex(&disp->Mutex);
/* let bad current context imply bad current surface */
if (!_eglIsContextLinked(ctx) || !_eglIsSurfaceLinked(ctx->DrawSurface))
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
_eglGetSurfaceHandle(ctx->DrawSurface) == EGL_NO_SURFACE)
RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
/* a valid current context implies an initialized current display */
@@ -1028,7 +1047,7 @@ eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
surf = drv->API.CreateScreenSurfaceMESA(drv, disp, conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1220,7 +1239,7 @@ eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer,
conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1276,12 +1295,14 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
EGLImageKHR ret;
_EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv);
if (!disp->Extensions.KHR_image_base)
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
if (!context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
img = drv->API.CreateImageKHR(drv,
disp, context, target, buffer, attr_list);
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR;
ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1296,6 +1317,8 @@ eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
if (!disp->Extensions.KHR_image_base)
RETURN_EGL_EVAL(disp, EGL_FALSE);
if (!img)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
@@ -1321,9 +1344,11 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
EGLSyncKHR ret;
_EGL_CHECK_DISPLAY(disp, EGL_NO_SYNC_KHR, drv);
if (!disp->Extensions.KHR_reusable_sync)
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
sync = drv->API.CreateSyncKHR(drv, disp, type, attrib_list);
ret = (sync) ? _eglLinkSync(sync, disp) : EGL_NO_SYNC_KHR;
ret = (sync) ? _eglLinkSync(sync) : EGL_NO_SYNC_KHR;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1338,6 +1363,8 @@ eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
EGLBoolean ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
_eglUnlinkSync(s);
ret = drv->API.DestroySyncKHR(drv, disp, s);
@@ -1354,6 +1381,7 @@ eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR t
EGLint ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
ret = drv->API.ClientWaitSyncKHR(drv, disp, s, flags, timeout);
RETURN_EGL_EVAL(disp, ret);
@@ -1369,6 +1397,7 @@ eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
EGLBoolean ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
ret = drv->API.SignalSyncKHR(drv, disp, s, mode);
RETURN_EGL_EVAL(disp, ret);
@@ -1384,6 +1413,7 @@ eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *v
EGLBoolean ret;
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_reusable_sync);
ret = drv->API.GetSyncAttribKHR(drv, disp, s, attribute, value);
RETURN_EGL_EVAL(disp, ret);
@@ -1407,14 +1437,15 @@ eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface,
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
if (!disp->Extensions.NOK_swap_region)
RETURN_EGL_EVAL(disp, EGL_FALSE);
/* surface must be bound to current context in EGL 1.4 */
if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface)
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
surf != ctx->DrawSurface)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if (drv->API.SwapBuffersRegionNOK)
ret = drv->API.SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
else
ret = drv->API.SwapBuffers(drv, disp, surf);
ret = drv->API.SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
RETURN_EGL_EVAL(disp, ret);
}
@@ -1433,9 +1464,11 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list)
EGLImageKHR ret;
_EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv);
if (!disp->Extensions.MESA_drm_image)
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
img = drv->API.CreateDRMImageMESA(drv, disp, attr_list);
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR;
ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1450,6 +1483,8 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.MESA_drm_image);
if (!img)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);

View File

@@ -118,38 +118,39 @@ _eglFindArray(_EGLArray *array, void *elem)
/**
* Filter an array and return the filtered data. The returned data pointer
* should be freed.
* Filter an array and return the number of filtered elements.
*/
void **
_eglFilterArray(_EGLArray *array, EGLint *size,
EGLint
_eglFilterArray(_EGLArray *array, void **data, EGLint size,
_EGLArrayForEach filter, void *filter_data)
{
void **data;
EGLint count = 0, i;
if (!array) {
*size = 0;
return malloc(0);
}
data = malloc(array->Size * sizeof(array->Elements[0]));
if (!data)
return NULL;
if (!array)
return 0;
if (filter) {
for (i = 0; i < array->Size; i++) {
if (filter(array->Elements[i], filter_data))
data[count++] = array->Elements[i];
if (filter(array->Elements[i], filter_data)) {
if (data && count < size)
data[count] = array->Elements[i];
count++;
}
if (data && count >= size)
break;
}
}
else {
memcpy(data, array->Elements, array->Size * sizeof(array->Elements[0]));
if (data) {
count = (size < array->Size) ? size : array->Size;
memcpy(data, array->Elements, count * sizeof(array->Elements[0]));
}
else {
count = array->Size;
}
}
*size = count;
return data;
return count;
}

View File

@@ -37,8 +37,8 @@ void *
_eglFindArray(_EGLArray *array, void *elem);
void **
_eglFilterArray(_EGLArray *array, EGLint *size,
PUBLIC EGLint
_eglFilterArray(_EGLArray *array, void **data, EGLint size,
_EGLArrayForEach filter, void *filter_data);

View File

@@ -24,34 +24,34 @@
* IDs are from 1 to N respectively.
*/
void
_eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id)
_eglInitConfig(_EGLConfig *conf, _EGLDisplay *dpy, EGLint id)
{
memset(config, 0, sizeof(*config));
memset(conf, 0, sizeof(*conf));
config->Display = dpy;
conf->Display = dpy;
/* some attributes take non-zero default values */
SET_CONFIG_ATTRIB(config, EGL_CONFIG_ID, id);
SET_CONFIG_ATTRIB(config, EGL_CONFIG_CAVEAT, EGL_NONE);
SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_TYPE, EGL_NONE);
SET_CONFIG_ATTRIB(config, EGL_NATIVE_VISUAL_TYPE, EGL_NONE);
#ifdef EGL_VERSION_1_2
SET_CONFIG_ATTRIB(config, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER);
#endif /* EGL_VERSION_1_2 */
conf->ConfigID = id;
conf->ConfigCaveat = EGL_NONE;
conf->TransparentType = EGL_NONE;
conf->NativeVisualType = EGL_NONE;
conf->ColorBufferType = EGL_RGB_BUFFER;
}
/**
* Link a config to a display and return the handle of the link.
* Link a config to its display and return the handle of the link.
* The handle can be passed to client directly.
*
* Note that we just save the ptr to the config (we don't copy the config).
*/
EGLConfig
_eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf)
PUBLIC EGLConfig
_eglLinkConfig(_EGLConfig *conf)
{
_EGLDisplay *dpy = conf->Display;
/* sanity check */
assert(GET_CONFIG_ATTRIB(conf, EGL_CONFIG_ID) > 0);
assert(dpy && conf->ConfigID > 0);
if (!dpy->Configs) {
dpy->Configs = _eglCreateArray("Config", 16);
@@ -59,23 +59,29 @@ _eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf)
return (EGLConfig) NULL;
}
conf->Display = dpy;
_eglAppendArray(dpy->Configs, (void *) conf);
return (EGLConfig) conf;
}
EGLBoolean
_eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy)
/**
* Lookup a handle to find the linked config.
* Return NULL if the handle has no corresponding linked config.
*/
_EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy)
{
_EGLConfig *conf;
if (!dpy)
return NULL;
conf = (_EGLConfig *) _eglFindArray(dpy->Configs, (void *) config);
if (conf)
assert(conf->Display == dpy);
return (conf != NULL);
return conf;
}
@@ -104,6 +110,7 @@ static const struct {
EGLint default_value;
} _eglValidationTable[] =
{
/* core */
{ EGL_BUFFER_SIZE, ATTRIB_TYPE_INTEGER,
ATTRIB_CRITERION_ATLEAST,
0 },
@@ -200,22 +207,13 @@ static const struct {
{ EGL_TRANSPARENT_BLUE_VALUE, ATTRIB_TYPE_INTEGER,
ATTRIB_CRITERION_EXACT,
EGL_DONT_CARE },
/* these are not real attributes */
{ EGL_MATCH_NATIVE_PIXMAP, ATTRIB_TYPE_PSEUDO,
ATTRIB_CRITERION_SPECIAL,
EGL_NONE },
/* there is a gap before EGL_SAMPLES */
{ 0x3030, ATTRIB_TYPE_PSEUDO,
ATTRIB_CRITERION_IGNORE,
0 },
{ EGL_NONE, ATTRIB_TYPE_PSEUDO,
ATTRIB_CRITERION_IGNORE,
0 },
/* extensions */
{ EGL_Y_INVERTED_NOK, ATTRIB_TYPE_BOOLEAN,
ATTRIB_CRITERION_EXACT,
EGL_DONT_CARE },
EGL_DONT_CARE }
};
@@ -232,18 +230,13 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
{
EGLint i, attr, val;
EGLBoolean valid = EGL_TRUE;
EGLint red_size = 0, green_size = 0, blue_size = 0, luminance_size = 0;
EGLint alpha_size = 0, buffer_size = 0;
/* all attributes should have been listed */
assert(ARRAY_SIZE(_eglValidationTable) == _EGL_CONFIG_NUM_ATTRIBS);
/* check attributes by their types */
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
EGLint mask;
attr = _eglValidationTable[i].attr;
val = GET_CONFIG_ATTRIB(conf, attr);
val = _eglGetConfigKey(conf, attr);
switch (_eglValidationTable[i].type) {
case ATTRIB_TYPE_INTEGER:
@@ -255,30 +248,14 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
break;
case EGL_SAMPLE_BUFFERS:
/* there can be at most 1 sample buffer */
if (val > 1)
if (val > 1 || val < 0)
valid = EGL_FALSE;
break;
case EGL_RED_SIZE:
red_size = val;
break;
case EGL_GREEN_SIZE:
green_size = val;
break;
case EGL_BLUE_SIZE:
blue_size = val;
break;
case EGL_LUMINANCE_SIZE:
luminance_size = val;
break;
case EGL_ALPHA_SIZE:
alpha_size = val;
break;
case EGL_BUFFER_SIZE:
buffer_size = val;
default:
if (val < 0)
valid = EGL_FALSE;
break;
}
if (val < 0)
valid = EGL_FALSE;
break;
case ATTRIB_TYPE_BOOLEAN:
if (val != EGL_TRUE && val != EGL_FALSE)
@@ -366,17 +343,18 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
/* now check for conflicting attribute values */
switch (GET_CONFIG_ATTRIB(conf, EGL_COLOR_BUFFER_TYPE)) {
switch (conf->ColorBufferType) {
case EGL_RGB_BUFFER:
if (luminance_size)
if (conf->LuminanceSize)
valid = EGL_FALSE;
if (red_size + green_size + blue_size + alpha_size != buffer_size)
if (conf->RedSize + conf->GreenSize +
conf->BlueSize + conf->AlphaSize != conf->BufferSize)
valid = EGL_FALSE;
break;
case EGL_LUMINANCE_BUFFER:
if (red_size || green_size || blue_size)
if (conf->RedSize || conf->GreenSize || conf->BlueSize)
valid = EGL_FALSE;
if (luminance_size + alpha_size != buffer_size)
if (conf->LuminanceSize + conf->AlphaSize != conf->BufferSize)
valid = EGL_FALSE;
break;
}
@@ -385,23 +363,19 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
return EGL_FALSE;
}
val = GET_CONFIG_ATTRIB(conf, EGL_SAMPLE_BUFFERS);
if (!val && GET_CONFIG_ATTRIB(conf, EGL_SAMPLES))
if (!conf->SampleBuffers && conf->Samples)
valid = EGL_FALSE;
if (!valid) {
_eglLog(_EGL_DEBUG, "conflicting samples and sample buffers");
return EGL_FALSE;
}
val = GET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE);
if (!(val & EGL_WINDOW_BIT)) {
if (GET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_ID) != 0 ||
GET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE) != EGL_NONE)
if (!(conf->SurfaceType & EGL_WINDOW_BIT)) {
if (conf->NativeVisualID != 0 || conf->NativeVisualType != EGL_NONE)
valid = EGL_FALSE;
}
if (!(val & EGL_PBUFFER_BIT)) {
if (GET_CONFIG_ATTRIB(conf, EGL_BIND_TO_TEXTURE_RGB) ||
GET_CONFIG_ATTRIB(conf, EGL_BIND_TO_TEXTURE_RGBA))
if (!(conf->SurfaceType & EGL_PBUFFER_BIT)) {
if (conf->BindToTextureRGB || conf->BindToTextureRGBA)
valid = EGL_FALSE;
}
if (!valid) {
@@ -433,11 +407,11 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria)
continue;
attr = _eglValidationTable[i].attr;
cmp = GET_CONFIG_ATTRIB(criteria, attr);
cmp = _eglGetConfigKey(criteria, attr);
if (cmp == EGL_DONT_CARE)
continue;
val = GET_CONFIG_ATTRIB(conf, attr);
val = _eglGetConfigKey(conf, attr);
switch (_eglValidationTable[i].criterion) {
case ATTRIB_CRITERION_EXACT:
if (val != cmp)
@@ -478,16 +452,11 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria)
static INLINE EGLBoolean
_eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
{
if (_eglIndexConfig(conf, attr) < 0)
if (_eglOffsetOfConfig(attr) < 0)
return EGL_FALSE;
/* there are some holes in the range */
switch (attr) {
case 0x3030 /* a gap before EGL_SAMPLES */:
case EGL_NONE:
#ifdef EGL_VERSION_1_4
case EGL_MATCH_NATIVE_PIXMAP:
#endif
return EGL_FALSE;
case EGL_Y_INVERTED_NOK:
return conf->Display->Extensions.NOK_texture_from_pixmap;
@@ -503,18 +472,18 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
* Return EGL_FALSE if any of the attribute is invalid.
*/
EGLBoolean
_eglParseConfigAttribList(_EGLConfig *conf, const EGLint *attrib_list)
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
const EGLint *attrib_list)
{
EGLint attr, val, i;
EGLint config_id = 0, level = 0;
EGLBoolean has_native_visual_type = EGL_FALSE;
EGLBoolean has_transparent_color = EGL_FALSE;
_eglInitConfig(conf, dpy, EGL_DONT_CARE);
/* reset to default values */
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
attr = _eglValidationTable[i].attr;
val = _eglValidationTable[i].default_value;
SET_CONFIG_ATTRIB(conf, attr, val);
_eglSetConfigKey(conf, attr, val);
}
/* parse the list */
@@ -524,59 +493,33 @@ _eglParseConfigAttribList(_EGLConfig *conf, const EGLint *attrib_list)
if (!_eglIsConfigAttribValid(conf, attr))
return EGL_FALSE;
SET_CONFIG_ATTRIB(conf, attr, val);
/* rememeber some attributes for post-processing */
switch (attr) {
case EGL_CONFIG_ID:
config_id = val;
break;
case EGL_LEVEL:
level = val;
break;
case EGL_NATIVE_VISUAL_TYPE:
has_native_visual_type = EGL_TRUE;
break;
case EGL_TRANSPARENT_RED_VALUE:
case EGL_TRANSPARENT_GREEN_VALUE:
case EGL_TRANSPARENT_BLUE_VALUE:
has_transparent_color = EGL_TRUE;
break;
default:
break;
}
_eglSetConfigKey(conf, attr, val);
}
if (!_eglValidateConfig(conf, EGL_TRUE))
return EGL_FALSE;
/* the spec says that EGL_LEVEL cannot be EGL_DONT_CARE */
if (level == EGL_DONT_CARE)
if (conf->Level == EGL_DONT_CARE)
return EGL_FALSE;
/* ignore other attributes when EGL_CONFIG_ID is given */
if (config_id > 0) {
_eglResetConfigKeys(conf, EGL_DONT_CARE);
SET_CONFIG_ATTRIB(conf, EGL_CONFIG_ID, config_id);
if (conf->ConfigID != EGL_DONT_CARE) {
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
attr = _eglValidationTable[i].attr;
if (attr != EGL_CONFIG_ID)
_eglSetConfigKey(conf, attr, EGL_DONT_CARE);
}
}
else {
if (has_native_visual_type) {
val = GET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE);
if (!(val & EGL_WINDOW_BIT))
SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE);
}
if (!(conf->SurfaceType & EGL_WINDOW_BIT))
conf->NativeVisualType = EGL_DONT_CARE;
if (has_transparent_color) {
val = GET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_TYPE);
if (val == EGL_NONE) {
SET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_RED_VALUE,
EGL_DONT_CARE);
SET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_GREEN_VALUE,
EGL_DONT_CARE);
SET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_BLUE_VALUE,
EGL_DONT_CARE);
}
if (conf->TransparentType == EGL_NONE) {
conf->TransparentRedValue = EGL_DONT_CARE;
conf->TransparentGreenValue = EGL_DONT_CARE;
conf->TransparentBlueValue = EGL_DONT_CARE;
}
}
@@ -610,7 +553,6 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
EGL_ALPHA_MASK_SIZE,
};
EGLint val1, val2;
EGLBoolean rgb_buffer;
EGLint i;
if (conf1 == conf2)
@@ -619,44 +561,41 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
/* the enum values have the desired ordering */
assert(EGL_NONE < EGL_SLOW_CONFIG);
assert(EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG);
val1 = GET_CONFIG_ATTRIB(conf1, EGL_CONFIG_CAVEAT);
val2 = GET_CONFIG_ATTRIB(conf2, EGL_CONFIG_CAVEAT);
if (val1 != val2)
return (val1 - val2);
val1 = conf1->ConfigCaveat - conf2->ConfigCaveat;
if (val1)
return val1;
/* the enum values have the desired ordering */
assert(EGL_RGB_BUFFER < EGL_LUMINANCE_BUFFER);
val1 = GET_CONFIG_ATTRIB(conf1, EGL_COLOR_BUFFER_TYPE);
val2 = GET_CONFIG_ATTRIB(conf2, EGL_COLOR_BUFFER_TYPE);
if (val1 != val2)
return (val1 - val2);
rgb_buffer = (val1 == EGL_RGB_BUFFER);
val1 = conf1->ColorBufferType - conf2->ColorBufferType;
if (val1)
return val1;
if (criteria) {
val1 = val2 = 0;
if (rgb_buffer) {
if (GET_CONFIG_ATTRIB(criteria, EGL_RED_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_RED_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_RED_SIZE);
if (conf1->ColorBufferType == EGL_RGB_BUFFER) {
if (criteria->RedSize > 0) {
val1 += conf1->RedSize;
val2 += conf2->RedSize;
}
if (GET_CONFIG_ATTRIB(criteria, EGL_GREEN_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_GREEN_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_GREEN_SIZE);
if (criteria->GreenSize > 0) {
val1 += conf1->GreenSize;
val2 += conf2->GreenSize;
}
if (GET_CONFIG_ATTRIB(criteria, EGL_BLUE_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_BLUE_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_BLUE_SIZE);
if (criteria->BlueSize > 0) {
val1 += conf1->BlueSize;
val2 += conf2->BlueSize;
}
}
else {
if (GET_CONFIG_ATTRIB(criteria, EGL_LUMINANCE_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_LUMINANCE_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_LUMINANCE_SIZE);
if (criteria->LuminanceSize > 0) {
val1 += conf1->LuminanceSize;
val2 += conf2->LuminanceSize;
}
}
if (GET_CONFIG_ATTRIB(criteria, EGL_ALPHA_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_ALPHA_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_ALPHA_SIZE);
if (criteria->AlphaSize > 0) {
val1 += conf1->AlphaSize;
val2 += conf2->AlphaSize;
}
}
else {
@@ -669,24 +608,15 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
return (val2 - val1);
for (i = 0; i < ARRAY_SIZE(compare_attribs); i++) {
val1 = GET_CONFIG_ATTRIB(conf1, compare_attribs[i]);
val2 = GET_CONFIG_ATTRIB(conf2, compare_attribs[i]);
val1 = _eglGetConfigKey(conf1, compare_attribs[i]);
val2 = _eglGetConfigKey(conf2, compare_attribs[i]);
if (val1 != val2)
return (val1 - val2);
}
/* EGL_NATIVE_VISUAL_TYPE cannot be compared here */
if (compare_id) {
val1 = GET_CONFIG_ATTRIB(conf1, EGL_CONFIG_ID);
val2 = GET_CONFIG_ATTRIB(conf2, EGL_CONFIG_ID);
assert(val1 != val2);
}
else {
val1 = val2 = 0;
}
return (val1 - val2);
return (compare_id) ? (conf1->ConfigID - conf2->ConfigID) : 0;
}
@@ -764,15 +694,25 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
if (!num_configs)
return _eglError(EGL_BAD_PARAMETER, "eglChooseConfigs");
_eglInitConfig(&criteria, disp, 0);
if (!_eglParseConfigAttribList(&criteria, attrib_list))
if (!_eglParseConfigAttribList(&criteria, disp, attrib_list))
return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
configList = (_EGLConfig **) _eglFilterArray(disp->Configs, &count,
/* get the number of matched configs */
count = _eglFilterArray(disp->Configs, NULL, 0,
(_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
if (!count) {
*num_configs = count;
return EGL_TRUE;
}
configList = malloc(sizeof(*configList) * count);
if (!configList)
return _eglError(EGL_BAD_ALLOC, "eglChooseConfig(out of memory)");
/* get the matched configs */
_eglFilterArray(disp->Configs, (void **) configList, count,
(_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
/* perform sorting of configs */
if (configs && count) {
_eglSortConfigs((const _EGLConfig **) configList, count,
@@ -802,7 +742,7 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
if (!value)
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");
*value = GET_CONFIG_ATTRIB(conf, attribute);
*value = _eglGetConfigKey(conf, attribute);
return EGL_TRUE;
}

View File

@@ -3,72 +3,107 @@
#include <assert.h>
#include <stddef.h>
#include "egltypedefs.h"
#define _EGL_CONFIG_FIRST_ATTRIB EGL_BUFFER_SIZE
#define _EGL_CONFIG_LAST_ATTRIB EGL_CONFORMANT
#define _EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS \
(_EGL_CONFIG_LAST_ATTRIB - _EGL_CONFIG_FIRST_ATTRIB + 1)
/* Attributes outside the contiguous block:
*
* EGL_Y_INVERTED_NOK
*/
#define _EGL_CONFIG_FIRST_EXTRA_ATTRIB _EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS
#define _EGL_CONFIG_NUM_EXTRA_ATTRIBS 1
#define _EGL_CONFIG_NUM_ATTRIBS \
_EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS + _EGL_CONFIG_NUM_EXTRA_ATTRIBS
/* update _eglValidationTable and _eglOffsetOfConfig before updating this
* struct */
struct _egl_config
{
_EGLDisplay *Display;
EGLint Storage[_EGL_CONFIG_NUM_ATTRIBS];
/* core */
EGLint BufferSize;
EGLint AlphaSize;
EGLint BlueSize;
EGLint GreenSize;
EGLint RedSize;
EGLint DepthSize;
EGLint StencilSize;
EGLint ConfigCaveat;
EGLint ConfigID;
EGLint Level;
EGLint MaxPbufferHeight;
EGLint MaxPbufferPixels;
EGLint MaxPbufferWidth;
EGLint NativeRenderable;
EGLint NativeVisualID;
EGLint NativeVisualType;
EGLint Samples;
EGLint SampleBuffers;
EGLint SurfaceType;
EGLint TransparentType;
EGLint TransparentBlueValue;
EGLint TransparentGreenValue;
EGLint TransparentRedValue;
EGLint BindToTextureRGB;
EGLint BindToTextureRGBA;
EGLint MinSwapInterval;
EGLint MaxSwapInterval;
EGLint LuminanceSize;
EGLint AlphaMaskSize;
EGLint ColorBufferType;
EGLint RenderableType;
EGLint MatchNativePixmap;
EGLint Conformant;
/* extensions */
EGLint YInvertedNOK;
};
/**
* Macros for source level compatibility.
*/
#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) _eglSetConfigKey(CONF, ATTR, VAL)
#define GET_CONFIG_ATTRIB(CONF, ATTR) _eglGetConfigKey(CONF, ATTR)
/**
* Given a key, return an index into the storage of the config.
* Return -1 if the key is invalid.
* Map an EGL attribute enum to the offset of the member in _EGLConfig.
*/
static INLINE EGLint
_eglIndexConfig(const _EGLConfig *conf, EGLint key)
_eglOffsetOfConfig(EGLint attr)
{
(void) conf;
if (key >= _EGL_CONFIG_FIRST_ATTRIB &&
key < _EGL_CONFIG_FIRST_ATTRIB + _EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS)
return key - _EGL_CONFIG_FIRST_ATTRIB;
switch (key) {
case EGL_Y_INVERTED_NOK:
return _EGL_CONFIG_FIRST_EXTRA_ATTRIB;
switch (attr) {
#define ATTRIB_MAP(attr, memb) case attr: return offsetof(_EGLConfig, memb)
/* core */
ATTRIB_MAP(EGL_BUFFER_SIZE, BufferSize);
ATTRIB_MAP(EGL_ALPHA_SIZE, AlphaSize);
ATTRIB_MAP(EGL_BLUE_SIZE, BlueSize);
ATTRIB_MAP(EGL_GREEN_SIZE, GreenSize);
ATTRIB_MAP(EGL_RED_SIZE, RedSize);
ATTRIB_MAP(EGL_DEPTH_SIZE, DepthSize);
ATTRIB_MAP(EGL_STENCIL_SIZE, StencilSize);
ATTRIB_MAP(EGL_CONFIG_CAVEAT, ConfigCaveat);
ATTRIB_MAP(EGL_CONFIG_ID, ConfigID);
ATTRIB_MAP(EGL_LEVEL, Level);
ATTRIB_MAP(EGL_MAX_PBUFFER_HEIGHT, MaxPbufferHeight);
ATTRIB_MAP(EGL_MAX_PBUFFER_PIXELS, MaxPbufferPixels);
ATTRIB_MAP(EGL_MAX_PBUFFER_WIDTH, MaxPbufferWidth);
ATTRIB_MAP(EGL_NATIVE_RENDERABLE, NativeRenderable);
ATTRIB_MAP(EGL_NATIVE_VISUAL_ID, NativeVisualID);
ATTRIB_MAP(EGL_NATIVE_VISUAL_TYPE, NativeVisualType);
ATTRIB_MAP(EGL_SAMPLES, Samples);
ATTRIB_MAP(EGL_SAMPLE_BUFFERS, SampleBuffers);
ATTRIB_MAP(EGL_SURFACE_TYPE, SurfaceType);
ATTRIB_MAP(EGL_TRANSPARENT_TYPE, TransparentType);
ATTRIB_MAP(EGL_TRANSPARENT_BLUE_VALUE, TransparentBlueValue);
ATTRIB_MAP(EGL_TRANSPARENT_GREEN_VALUE, TransparentGreenValue);
ATTRIB_MAP(EGL_TRANSPARENT_RED_VALUE, TransparentRedValue);
ATTRIB_MAP(EGL_BIND_TO_TEXTURE_RGB, BindToTextureRGB);
ATTRIB_MAP(EGL_BIND_TO_TEXTURE_RGBA, BindToTextureRGBA);
ATTRIB_MAP(EGL_MIN_SWAP_INTERVAL, MinSwapInterval);
ATTRIB_MAP(EGL_MAX_SWAP_INTERVAL, MaxSwapInterval);
ATTRIB_MAP(EGL_LUMINANCE_SIZE, LuminanceSize);
ATTRIB_MAP(EGL_ALPHA_MASK_SIZE, AlphaMaskSize);
ATTRIB_MAP(EGL_COLOR_BUFFER_TYPE, ColorBufferType);
ATTRIB_MAP(EGL_RENDERABLE_TYPE, RenderableType);
ATTRIB_MAP(EGL_MATCH_NATIVE_PIXMAP, MatchNativePixmap);
ATTRIB_MAP(EGL_CONFORMANT, Conformant);
/* extensions */
ATTRIB_MAP(EGL_Y_INVERTED_NOK, YInvertedNOK);
#undef ATTRIB_MAP
default:
return -1;
}
}
/**
* Reset all keys in the config to a given value.
*/
static INLINE void
_eglResetConfigKeys(_EGLConfig *conf, EGLint val)
{
EGLint i;
for (i = 0; i < _EGL_CONFIG_NUM_ATTRIBS; i++)
conf->Storage[i] = val;
}
/**
* Update a config for a given key.
*
@@ -79,9 +114,9 @@ _eglResetConfigKeys(_EGLConfig *conf, EGLint val)
static INLINE void
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
{
EGLint idx = _eglIndexConfig(conf, key);
assert(idx >= 0);
conf->Storage[idx] = val;
EGLint offset = _eglOffsetOfConfig(key);
assert(offset >= 0);
*((EGLint *) ((char *) conf + offset)) = val;
}
@@ -91,9 +126,9 @@ _eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
static INLINE EGLint
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
{
EGLint idx = _eglIndexConfig(conf, key);
assert(idx >= 0);
return conf->Storage[idx];
EGLint offset = _eglOffsetOfConfig(key);
assert(offset >= 0);
return *((EGLint *) ((char *) conf + offset));
}
@@ -102,34 +137,20 @@ _eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id);
PUBLIC EGLConfig
_eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf);
_eglLinkConfig(_EGLConfig *conf);
extern EGLBoolean
_eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy);
extern _EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy);
/**
* Lookup a handle to find the linked config.
* Return NULL if the handle has no corresponding linked config.
*/
static INLINE _EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy)
{
_EGLConfig *conf = (_EGLConfig *) config;
if (!dpy || !_eglCheckConfigHandle(config, dpy))
conf = NULL;
return conf;
}
/**
* Return the handle of a linked config, or NULL.
* Return the handle of a linked config.
*/
static INLINE EGLConfig
_eglGetConfigHandle(_EGLConfig *conf)
{
return (EGLConfig) ((conf && conf->Display) ? conf : NULL);
return (EGLConfig) conf;
}
@@ -142,7 +163,8 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria);
PUBLIC EGLBoolean
_eglParseConfigAttribList(_EGLConfig *conf, const EGLint *attrib_list);
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
const EGLint *attrib_list);
PUBLIC EGLint

View File

@@ -103,8 +103,7 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
return EGL_FALSE;
}
memset(ctx, 0, sizeof(_EGLContext));
ctx->Resource.Display = dpy;
_eglInitResource(&ctx->Resource, sizeof(*ctx), dpy);
ctx->ClientAPI = api;
ctx->Config = conf;
ctx->WindowRenderBuffer = EGL_NONE;
@@ -113,13 +112,12 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
err = _eglParseContextAttribList(ctx, attrib_list);
if (err == EGL_SUCCESS && ctx->Config) {
EGLint renderable_type, api_bit;
EGLint api_bit;
renderable_type = GET_CONFIG_ATTRIB(ctx->Config, EGL_RENDERABLE_TYPE);
api_bit = _eglGetContextAPIBit(ctx);
if (!(renderable_type & api_bit)) {
if (!(ctx->Config->RenderableType & api_bit)) {
_eglLog(_EGL_DEBUG, "context api is 0x%x while config supports 0x%x",
api_bit, renderable_type);
api_bit, ctx->Config->RenderableType);
err = EGL_BAD_CONFIG;
}
}
@@ -130,29 +128,6 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
}
/**
* Just a placeholder/demo function. Real driver will never use this!
*/
_EGLContext *
_eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
_EGLContext *share_list, const EGLint *attrib_list)
{
return NULL;
}
/**
* Default fallback routine - drivers should usually override this.
*/
EGLBoolean
_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
if (!_eglIsContextBound(ctx))
free(ctx);
return EGL_TRUE;
}
#ifdef EGL_VERSION_1_2
static EGLint
_eglQueryContextRenderBuffer(_EGLContext *ctx)
@@ -183,7 +158,9 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
switch (attribute) {
case EGL_CONFIG_ID:
*value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
if (!c->Config)
return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
*value = c->Config->ConfigID;
break;
case EGL_CONTEXT_CLIENT_VERSION:
*value = c->ClientVersion;
@@ -272,10 +249,6 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
if (!surfaceless && (draw == NULL || read == NULL))
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
/* context stealing from another thread is not allowed */
if (ctx->Binding && ctx->Binding != t)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
/*
* The spec says
*
@@ -283,16 +256,23 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
* bound to contexts in another thread, an EGL_BAD_ACCESS error is
* generated."
*
* But it also says
* and
*
* "at most one context may be bound to a particular surface at a given
* time"
*
* The latter is more restrictive so we can check only the latter case.
*/
if ((draw && draw->CurrentContext && draw->CurrentContext != ctx) ||
(read && read->CurrentContext && read->CurrentContext != ctx))
if (ctx->Binding && ctx->Binding != t)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
if (draw && draw->CurrentContext && draw->CurrentContext != ctx) {
if (draw->CurrentContext->Binding != t ||
draw->CurrentContext->ClientAPI != ctx->ClientAPI)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
}
if (read && read->CurrentContext && read->CurrentContext != ctx) {
if (read->CurrentContext->Binding != t ||
read->CurrentContext->ClientAPI != ctx->ClientAPI)
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
}
/* simply require the configs to be equal */
if ((draw && draw->Config != ctx->Config) ||
@@ -323,79 +303,65 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
/**
* Bind the context to the current thread and given surfaces. Return the
* "orphaned" context and surfaces. Each argument is both input and output.
* previous bound context and surfaces. The caller should unreference the
* returned context and surfaces.
*
* Making a second call with the resources returned by the first call
* unsurprisingly undoes the first call, except for the resouce reference
* counts.
*/
EGLBoolean
_eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read)
_eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read,
_EGLContext **old_ctx,
_EGLSurface **old_draw, _EGLSurface **old_read)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
_EGLContext *newCtx = *ctx, *oldCtx;
_EGLSurface *newDraw = *draw, *newRead = *read;
_EGLContext *prev_ctx;
_EGLSurface *prev_draw, *prev_read;
if (!_eglCheckMakeCurrent(newCtx, newDraw, newRead))
if (!_eglCheckMakeCurrent(ctx, draw, read))
return EGL_FALSE;
/* increment refcounts before binding */
_eglGetContext(ctx);
_eglGetSurface(draw);
_eglGetSurface(read);
/* bind the new context */
oldCtx = _eglBindContextToThread(newCtx, t);
prev_ctx = _eglBindContextToThread(ctx, t);
/* break old bindings */
if (oldCtx) {
*ctx = oldCtx;
*draw = oldCtx->DrawSurface;
*read = oldCtx->ReadSurface;
/* break previous bindings */
if (prev_ctx) {
prev_draw = prev_ctx->DrawSurface;
prev_read = prev_ctx->ReadSurface;
if (*draw)
(*draw)->CurrentContext = NULL;
if (*read)
(*read)->CurrentContext = NULL;
if (prev_draw)
prev_draw->CurrentContext = NULL;
if (prev_read)
prev_read->CurrentContext = NULL;
oldCtx->DrawSurface = NULL;
oldCtx->ReadSurface = NULL;
prev_ctx->DrawSurface = NULL;
prev_ctx->ReadSurface = NULL;
}
else {
prev_draw = prev_read = NULL;
}
/* establish new bindings */
if (newCtx) {
if (newDraw)
newDraw->CurrentContext = newCtx;
if (newRead)
newRead->CurrentContext = newCtx;
if (ctx) {
if (draw)
draw->CurrentContext = ctx;
if (read)
read->CurrentContext = ctx;
newCtx->DrawSurface = newDraw;
newCtx->ReadSurface = newRead;
ctx->DrawSurface = draw;
ctx->ReadSurface = read;
}
/* an old context or surface is not orphaned if it is still bound */
if (*ctx == newCtx)
*ctx = NULL;
if (*draw == newDraw || *draw == newRead)
*draw = NULL;
if (*read == newDraw || *read == newRead)
*read = NULL;
assert(old_ctx && old_draw && old_read);
*old_ctx = prev_ctx;
*old_draw = prev_draw;
*old_read = prev_read;
return EGL_TRUE;
}
/**
* Just a placeholder/demo function. Drivers should override this.
*/
EGLBoolean
_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw,
_EGLSurface *read, _EGLContext *ctx)
{
return EGL_FALSE;
}
/**
* This is defined by the EGL_MESA_copy_context extension.
*/
EGLBoolean
_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source,
EGLContext dest, EGLint mask)
{
/* This function will always have to be overridden/implemented in the
* device driver. If the driver is based on Mesa, use _mesa_copy_context().
*/
return EGL_FALSE;
}

View File

@@ -34,51 +34,46 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy,
_EGLConfig *config, const EGLint *attrib_list);
extern _EGLContext *
_eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, _EGLContext *share_list, const EGLint *attrib_list);
extern EGLBoolean
_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
extern EGLBoolean
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
PUBLIC EGLBoolean
_eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read);
extern EGLBoolean
_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw, _EGLSurface *read, _EGLContext *ctx);
extern EGLBoolean
_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
_eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read,
_EGLContext **old_ctx,
_EGLSurface **old_draw, _EGLSurface **old_read);
/**
* Return true if the context is bound to a thread.
*
* The binding is considered a reference to the context. Drivers should not
* destroy a context when it is bound.
* Increment reference count for the context.
*/
static INLINE EGLBoolean
_eglIsContextBound(_EGLContext *ctx)
static INLINE _EGLContext *
_eglGetContext(_EGLContext *ctx)
{
return (ctx->Binding != NULL);
if (ctx)
_eglGetResource(&ctx->Resource);
return ctx;
}
/**
* Link a context to a display and return the handle of the link.
* Decrement reference count for the context.
*/
static INLINE EGLBoolean
_eglPutContext(_EGLContext *ctx)
{
return (ctx) ? _eglPutResource(&ctx->Resource) : EGL_FALSE;
}
/**
* Link a context to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLContext
_eglLinkContext(_EGLContext *ctx, _EGLDisplay *dpy)
_eglLinkContext(_EGLContext *ctx)
{
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT, dpy);
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
return (EGLContext) ctx;
}
@@ -120,18 +115,4 @@ _eglGetContextHandle(_EGLContext *ctx)
}
/**
* Return true if the context is linked to a display.
*
* The link is considered a reference to the context (the display is owning the
* context). Drivers should not destroy a context when it is linked.
*/
static INLINE EGLBoolean
_eglIsContextLinked(_EGLContext *ctx)
{
_EGLResource *res = (_EGLResource *) ctx;
return (res && _eglIsResourceLinked(res));
}
#endif /* EGLCONTEXT_INCLUDED */

View File

@@ -14,33 +14,7 @@
static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
#ifdef GLX_USE_TLS
static __thread const _EGLThreadInfo *_egl_TSD
__attribute__ ((tls_model("initial-exec")));
static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
{
_egl_TSD = t;
}
static INLINE _EGLThreadInfo *_eglGetTSD(void)
{
return (_EGLThreadInfo *) _egl_TSD;
}
static INLINE void _eglFiniTSD(void)
{
}
static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
{
/* TODO destroy TSD */
(void) dtor;
(void) _eglFiniTSD;
return EGL_TRUE;
}
#elif PTHREADS
#if PTHREADS
#include <pthread.h>
static _EGL_DECLARE_MUTEX(_egl_TSDMutex);
@@ -48,14 +22,26 @@ static EGLBoolean _egl_TSDInitialized;
static pthread_key_t _egl_TSD;
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
#ifdef GLX_USE_TLS
static __thread const _EGLThreadInfo *_egl_TLS
__attribute__ ((tls_model("initial-exec")));
#endif
static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
{
pthread_setspecific(_egl_TSD, (const void *) t);
#ifdef GLX_USE_TLS
_egl_TLS = t;
#endif
}
static INLINE _EGLThreadInfo *_eglGetTSD(void)
{
#ifdef GLX_USE_TLS
return (_EGLThreadInfo *) _egl_TLS;
#else
return (_EGLThreadInfo *) pthread_getspecific(_egl_TSD);
#endif
}
static INLINE void _eglFiniTSD(void)

View File

@@ -27,7 +27,7 @@ _eglGetNativePlatformFromEnv(void)
} egl_platforms[_EGL_NUM_PLATFORMS] = {
{ _EGL_PLATFORM_WINDOWS, "gdi" },
{ _EGL_PLATFORM_X11, "x11" },
{ _EGL_PLATFORM_DRM, "kms" },
{ _EGL_PLATFORM_DRM, "drm" },
{ _EGL_PLATFORM_FBDEV, "fbdev" }
};
_EGLPlatformType plat = _EGL_INVALID_PLATFORM;
@@ -233,17 +233,53 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
/**
* Link a resource to a display.
* Initialize a display resource.
*/
void
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy)
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy)
{
assert(!res->Display || res->Display == dpy);
memset(res, 0, size);
res->Display = dpy;
res->RefCount = 1;
}
/**
* Increment reference count for the resource.
*/
void
_eglGetResource(_EGLResource *res)
{
assert(res && res->RefCount > 0);
/* hopefully a resource is always manipulated with its display locked */
res->RefCount++;
}
/**
* Decrement reference count for the resource.
*/
EGLBoolean
_eglPutResource(_EGLResource *res)
{
assert(res && res->RefCount > 0);
res->RefCount--;
return (!res->RefCount);
}
/**
* Link a resource to its display.
*/
void
_eglLinkResource(_EGLResource *res, _EGLResourceType type)
{
assert(res->Display);
res->IsLinked = EGL_TRUE;
res->Next = dpy->ResourceLists[type];
dpy->ResourceLists[type] = res;
res->Next = res->Display->ResourceLists[type];
res->Display->ResourceLists[type] = res;
_eglGetResource(res);
}
@@ -270,6 +306,9 @@ _eglUnlinkResource(_EGLResource *res, _EGLResourceType type)
}
res->Next = NULL;
/* do not reset res->Display */
res->IsLinked = EGL_FALSE;
_eglPutResource(res);
/* We always unlink before destroy. The driver still owns a reference */
assert(res->RefCount);
}

View File

@@ -40,6 +40,7 @@ struct _egl_resource
/* which display the resource belongs to */
_EGLDisplay *Display;
EGLBoolean IsLinked;
EGLint RefCount;
/* used to link resources of the same type */
_EGLResource *Next;
@@ -162,7 +163,19 @@ _eglGetDisplayHandle(_EGLDisplay *dpy)
extern void
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy);
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy);
PUBLIC void
_eglGetResource(_EGLResource *res);
PUBLIC EGLBoolean
_eglPutResource(_EGLResource *res);
extern void
_eglLinkResource(_EGLResource *res, _EGLResourceType type);
extern void

View File

@@ -9,19 +9,10 @@
#include <stdlib.h>
#include "eglstring.h"
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldefines.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "egllog.h"
#include "eglmisc.h"
#include "eglmode.h"
#include "eglscreen.h"
#include "eglstring.h"
#include "eglsurface.h"
#include "eglimage.h"
#include "eglsync.h"
#include "eglmutex.h"
#if defined(_EGL_OS_UNIX)
@@ -404,35 +395,62 @@ _eglPreloadForEach(const char *search_path,
static const char *
_eglGetSearchPath(void)
{
static const char *search_path;
static char search_path[1024];
#if defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS)
if (!search_path) {
static char buffer[1024];
const char *p;
if (search_path[0] == '\0') {
char *buf = search_path;
size_t len = sizeof(search_path);
EGLBoolean use_env;
char dir_sep;
int ret;
p = getenv("EGL_DRIVERS_PATH");
#if defined(_EGL_OS_UNIX)
if (p && (geteuid() != getuid() || getegid() != getgid())) {
use_env = (geteuid() == getuid() && getegid() == getgid());
dir_sep = '/';
#else
use_env = EGL_TRUE;
dir_sep = '\\';
#endif
if (use_env) {
char *p;
/* extract the dirname from EGL_DRIVER */
p = getenv("EGL_DRIVER");
if (p && strchr(p, dir_sep)) {
ret = _eglsnprintf(buf, len, "%s", p);
if (ret > 0 && ret < len) {
p = strrchr(buf, dir_sep);
*p++ = ':';
len -= p - buf;
buf = p;
}
}
/* append EGL_DRIVERS_PATH */
p = getenv("EGL_DRIVERS_PATH");
if (p) {
ret = _eglsnprintf(buf, len, "%s:", p);
if (ret > 0 && ret < len) {
buf += ret;
len -= ret;
}
}
}
else {
_eglLog(_EGL_DEBUG,
"ignore EGL_DRIVERS_PATH for setuid/setgid binaries");
p = NULL;
}
#endif /* _EGL_OS_UNIX */
if (p) {
ret = _eglsnprintf(buffer, sizeof(buffer),
"%s:%s", p, _EGL_DRIVER_SEARCH_DIR);
if (ret > 0 && ret < sizeof(buffer))
search_path = buffer;
}
ret = _eglsnprintf(buf, len, "%s", _EGL_DRIVER_SEARCH_DIR);
if (ret < 0 || ret >= len)
search_path[0] = '\0';
_eglLog(_EGL_DEBUG, "EGL search path is %s", search_path);
}
if (!search_path)
search_path = _EGL_DRIVER_SEARCH_DIR;
#else
search_path = "";
#endif
#endif /* defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS) */
return search_path;
}
@@ -663,77 +681,6 @@ _eglUnloadDrivers(void)
}
/**
* Plug all the available fallback routines into the given driver's
* dispatch table.
*/
void
_eglInitDriverFallbacks(_EGLDriver *drv)
{
/* If a pointer is set to NULL, then the device driver _really_ has
* to implement it.
*/
drv->API.Initialize = NULL;
drv->API.Terminate = NULL;
drv->API.GetConfigs = _eglGetConfigs;
drv->API.ChooseConfig = _eglChooseConfig;
drv->API.GetConfigAttrib = _eglGetConfigAttrib;
drv->API.CreateContext = _eglCreateContext;
drv->API.DestroyContext = _eglDestroyContext;
drv->API.MakeCurrent = _eglMakeCurrent;
drv->API.QueryContext = _eglQueryContext;
drv->API.CreateWindowSurface = _eglCreateWindowSurface;
drv->API.CreatePixmapSurface = _eglCreatePixmapSurface;
drv->API.CreatePbufferSurface = _eglCreatePbufferSurface;
drv->API.DestroySurface = _eglDestroySurface;
drv->API.QuerySurface = _eglQuerySurface;
drv->API.SurfaceAttrib = _eglSurfaceAttrib;
drv->API.BindTexImage = _eglBindTexImage;
drv->API.ReleaseTexImage = _eglReleaseTexImage;
drv->API.SwapInterval = _eglSwapInterval;
drv->API.SwapBuffers = _eglSwapBuffers;
drv->API.CopyBuffers = _eglCopyBuffers;
drv->API.QueryString = _eglQueryString;
drv->API.WaitClient = _eglWaitClient;
drv->API.WaitNative = _eglWaitNative;
#ifdef EGL_MESA_screen_surface
drv->API.ChooseModeMESA = _eglChooseModeMESA;
drv->API.GetModesMESA = _eglGetModesMESA;
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
drv->API.GetScreensMESA = _eglGetScreensMESA;
drv->API.CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA;
drv->API.ShowScreenSurfaceMESA = _eglShowScreenSurfaceMESA;
drv->API.ScreenPositionMESA = _eglScreenPositionMESA;
drv->API.QueryScreenMESA = _eglQueryScreenMESA;
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer;
#endif /* EGL_VERSION_1_2 */
#ifdef EGL_KHR_image_base
drv->API.CreateImageKHR = _eglCreateImageKHR;
drv->API.DestroyImageKHR = _eglDestroyImageKHR;
#endif /* EGL_KHR_image_base */
#ifdef EGL_KHR_reusable_sync
drv->API.CreateSyncKHR = _eglCreateSyncKHR;
drv->API.DestroySyncKHR = _eglDestroySyncKHR;
drv->API.ClientWaitSyncKHR = _eglClientWaitSyncKHR;
drv->API.SignalSyncKHR = _eglSignalSyncKHR;
drv->API.GetSyncAttribKHR = _eglGetSyncAttribKHR;
#endif /* EGL_KHR_reusable_sync */
}
/**
* Invoke a callback function on each EGL search path.
*

View File

@@ -4,7 +4,7 @@
#include "egltypedefs.h"
#include "eglapi.h"
#include <stddef.h>
/**
* Define an inline driver typecast function.
@@ -80,6 +80,7 @@ extern void
_eglUnloadDrivers(void);
/* defined in eglfallbacks.c */
PUBLIC void
_eglInitDriverFallbacks(_EGLDriver *drv);

View File

@@ -0,0 +1,99 @@
#include <string.h>
#include "egltypedefs.h"
#include "egldriver.h"
#include "eglconfig.h"
#include "eglcontext.h"
#include "eglsurface.h"
#include "eglmisc.h"
#include "eglscreen.h"
#include "eglmode.h"
#include "eglsync.h"
static EGLBoolean
_eglReturnFalse(void)
{
return EGL_FALSE;
}
/**
* Plug all the available fallback routines into the given driver's
* dispatch table.
*/
void
_eglInitDriverFallbacks(_EGLDriver *drv)
{
memset(&drv->API, 0, sizeof(drv->API));
/* the driver has to implement these */
drv->API.Initialize = NULL;
drv->API.Terminate = NULL;
drv->API.GetConfigs = _eglGetConfigs;
drv->API.ChooseConfig = _eglChooseConfig;
drv->API.GetConfigAttrib = _eglGetConfigAttrib;
drv->API.CreateContext = (CreateContext_t) _eglReturnFalse;
drv->API.DestroyContext = (DestroyContext_t) _eglReturnFalse;
drv->API.MakeCurrent = (MakeCurrent_t) _eglReturnFalse;
drv->API.QueryContext = _eglQueryContext;
drv->API.CreateWindowSurface = (CreateWindowSurface_t) _eglReturnFalse;
drv->API.CreatePixmapSurface = (CreatePixmapSurface_t) _eglReturnFalse;
drv->API.CreatePbufferSurface = (CreatePbufferSurface_t) _eglReturnFalse;
drv->API.CreatePbufferFromClientBuffer =
(CreatePbufferFromClientBuffer_t) _eglReturnFalse;
drv->API.DestroySurface = (DestroySurface_t) _eglReturnFalse;
drv->API.QuerySurface = _eglQuerySurface;
drv->API.SurfaceAttrib = _eglSurfaceAttrib;
drv->API.BindTexImage = (BindTexImage_t) _eglReturnFalse;
drv->API.ReleaseTexImage = (ReleaseTexImage_t) _eglReturnFalse;
drv->API.CopyBuffers = (CopyBuffers_t) _eglReturnFalse;
drv->API.SwapBuffers = (SwapBuffers_t) _eglReturnFalse;
drv->API.SwapInterval = _eglSwapInterval;
drv->API.WaitClient = (WaitClient_t) _eglReturnFalse;
drv->API.WaitNative = (WaitNative_t) _eglReturnFalse;
drv->API.GetProcAddress = (GetProcAddress_t) _eglReturnFalse;
drv->API.QueryString = _eglQueryString;
#ifdef EGL_MESA_screen_surface
drv->API.CopyContextMESA = (CopyContextMESA_t) _eglReturnFalse;
drv->API.CreateScreenSurfaceMESA =
(CreateScreenSurfaceMESA_t) _eglReturnFalse;
drv->API.ShowScreenSurfaceMESA = (ShowScreenSurfaceMESA_t) _eglReturnFalse;
drv->API.ChooseModeMESA = _eglChooseModeMESA;
drv->API.GetModesMESA = _eglGetModesMESA;
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
drv->API.GetScreensMESA = _eglGetScreensMESA;
drv->API.ScreenPositionMESA = _eglScreenPositionMESA;
drv->API.QueryScreenMESA = _eglQueryScreenMESA;
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_KHR_image_base
drv->API.CreateImageKHR = NULL;
drv->API.DestroyImageKHR = NULL;
#endif /* EGL_KHR_image_base */
#ifdef EGL_KHR_reusable_sync
drv->API.CreateSyncKHR = NULL;
drv->API.DestroySyncKHR = NULL;
drv->API.ClientWaitSyncKHR = NULL;
drv->API.SignalSyncKHR = NULL;
drv->API.GetSyncAttribKHR = _eglGetSyncAttribKHR;
#endif /* EGL_KHR_reusable_sync */
#ifdef EGL_MESA_drm_image
drv->API.CreateDRMImageMESA = NULL;
drv->API.ExportDRMImageMESA = NULL;
#endif
#ifdef EGL_NOK_swap_region
drv->API.SwapBuffersRegionNOK = NULL;
#endif
}

View File

@@ -2,7 +2,6 @@
#include <string.h>
#include "eglimage.h"
#include "eglcurrent.h"
#include "egllog.h"
@@ -12,28 +11,57 @@
/**
* Parse the list of image attributes and return the proper error code.
*/
static EGLint
_eglParseImageAttribList(_EGLImage *img, const EGLint *attrib_list)
EGLint
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
const EGLint *attrib_list)
{
EGLint i, err = EGL_SUCCESS;
(void) dpy;
memset(attrs, 0, sizeof(attrs));
attrs->ImagePreserved = EGL_FALSE;
attrs->GLTextureLevel = 0;
attrs->GLTextureZOffset = 0;
if (!attrib_list)
return EGL_SUCCESS;
return err;
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
EGLint attr = attrib_list[i++];
EGLint val = attrib_list[i];
switch (attr) {
/* EGL_KHR_image_base */
case EGL_IMAGE_PRESERVED_KHR:
img->Preserved = val;
attrs->ImagePreserved = val;
break;
/* EGL_KHR_gl_image */
case EGL_GL_TEXTURE_LEVEL_KHR:
img->GLTextureLevel = val;
attrs->GLTextureLevel = val;
break;
case EGL_GL_TEXTURE_ZOFFSET_KHR:
img->GLTextureZOffset = val;
attrs->GLTextureZOffset = val;
break;
/* EGL_MESA_drm_image */
case EGL_WIDTH:
attrs->Width = val;
break;
case EGL_HEIGHT:
attrs->Height = val;
break;
case EGL_DRM_BUFFER_FORMAT_MESA:
attrs->DRMBufferFormatMESA = val;
break;
case EGL_DRM_BUFFER_USE_MESA:
attrs->DRMBufferUseMESA = val;
break;
case EGL_DRM_BUFFER_STRIDE_MESA:
attrs->DRMBufferStrideMESA = val;
break;
default:
/* unknown attrs are ignored */
break;
@@ -50,41 +78,12 @@ _eglParseImageAttribList(_EGLImage *img, const EGLint *attrib_list)
EGLBoolean
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy, const EGLint *attrib_list)
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy)
{
EGLint err;
memset(img, 0, sizeof(_EGLImage));
img->Resource.Display = dpy;
img->Preserved = EGL_FALSE;
img->GLTextureLevel = 0;
img->GLTextureZOffset = 0;
err = _eglParseImageAttribList(img, attrib_list);
if (err != EGL_SUCCESS)
return _eglError(err, "eglCreateImageKHR");
_eglInitResource(&img->Resource, sizeof(*img), dpy);
return EGL_TRUE;
}
_EGLImage *
_eglCreateImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer,
const EGLint *attr_list)
{
/* driver should override this function */
return NULL;
}
EGLBoolean
_eglDestroyImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image)
{
/* driver should override this function */
return EGL_FALSE;
}
#endif /* EGL_KHR_image_base */

View File

@@ -6,6 +6,23 @@
#include "egldisplay.h"
struct _egl_image_attribs
{
/* EGL_KHR_image_base */
EGLBoolean ImagePreserved;
/* EGL_KHR_gl_image */
EGLint GLTextureLevel;
EGLint GLTextureZOffset;
/* EGL_MESA_drm_image */
EGLint Width;
EGLint Height;
EGLint DRMBufferFormatMESA;
EGLint DRMBufferUseMESA;
EGLint DRMBufferStrideMESA;
};
/**
* "Base" class for device driver images.
*/
@@ -13,34 +30,48 @@ struct _egl_image
{
/* An image is a display resource */
_EGLResource Resource;
EGLBoolean Preserved;
EGLint GLTextureLevel;
EGLint GLTextureZOffset;
};
PUBLIC EGLint
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
const EGLint *attrib_list);
PUBLIC EGLBoolean
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy, const EGLint *attrib_list);
extern _EGLImage *
_eglCreateImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer, const EGLint *attr_list);
extern EGLBoolean
_eglDestroyImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image);
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy);
/**
* Link an image to a display and return the handle of the link.
* Increment reference count for the image.
*/
static INLINE _EGLImage *
_eglGetImage(_EGLImage *img)
{
if (img)
_eglGetResource(&img->Resource);
return img;
}
/**
* Decrement reference count for the image.
*/
static INLINE EGLBoolean
_eglPutImage(_EGLImage *img)
{
return (img) ? _eglPutResource(&img->Resource) : EGL_FALSE;
}
/**
* Link an image to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLImageKHR
_eglLinkImage(_EGLImage *img, _EGLDisplay *dpy)
_eglLinkImage(_EGLImage *img)
{
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE, dpy);
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
return (EGLImageKHR) img;
}
@@ -82,15 +113,4 @@ _eglGetImageHandle(_EGLImage *img)
}
/**
* Return true if the image is linked to a display.
*/
static INLINE EGLBoolean
_eglIsImageLinked(_EGLImage *img)
{
_EGLResource *res = (_EGLResource *) img;
return (res && _eglIsResourceLinked(res));
}
#endif /* EGLIMAGE_INCLUDED */

View File

@@ -151,6 +151,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
{
va_list args;
char msg[MAXSTRING];
int ret;
/* one-time initialization; a little race here is fine */
if (!logging.initialized)
@@ -162,7 +163,9 @@ _eglLog(EGLint level, const char *fmtStr, ...)
if (logging.logger) {
va_start(args, fmtStr);
vsnprintf(msg, MAXSTRING, fmtStr, args);
ret = vsnprintf(msg, MAXSTRING, fmtStr, args);
if (ret < 0 || ret >= MAXSTRING)
strcpy(msg, "<message truncated>");
va_end(args);
logging.logger(level, msg);

View File

@@ -158,32 +158,3 @@ _eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name)
return NULL;
}
}
EGLBoolean
_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
/* just a placeholder */
(void) drv;
(void) dpy;
(void) ctx;
return EGL_TRUE;
}
EGLBoolean
_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine)
{
/* just a placeholder */
(void) drv;
(void) dpy;
switch (engine) {
case EGL_CORE_NATIVE_ENGINE:
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");
return EGL_FALSE;
}
return EGL_TRUE;
}

View File

@@ -37,12 +37,4 @@ extern const char *
_eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name);
extern EGLBoolean
_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
extern EGLBoolean
_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine);
#endif /* EGLMISC_INCLUDED */

View File

@@ -3,11 +3,9 @@
#include <string.h>
#include "egldisplay.h"
#include "egldriver.h"
#include "eglmode.h"
#include "eglcurrent.h"
#include "eglscreen.h"
#include "eglstring.h"
#ifdef EGL_MESA_screen_surface
@@ -31,12 +29,19 @@ _eglLookupMode(EGLModeMESA mode, _EGLDisplay *disp)
/* loop over all screens on the display */
for (scrnum = 0; scrnum < disp->Screens->Size; scrnum++) {
const _EGLScreen *scrn = disp->Screens->Elements[scrnum];
EGLint i;
/* search list of modes for handle */
for (i = 0; i < scrn->NumModes; i++) {
if (scrn->Modes[i].Handle == mode) {
return scrn->Modes + i;
}
EGLint idx;
/*
* the mode ids of a screen ranges from scrn->Handle to scrn->Handle +
* scrn->NumModes
*/
if (mode >= scrn->Handle &&
mode < scrn->Handle + _EGL_SCREEN_MAX_MODES) {
idx = mode - scrn->Handle;
assert(idx < scrn->NumModes && scrn->Modes[idx].Handle == mode);
return &scrn->Modes[idx];
}
}
@@ -44,45 +49,6 @@ _eglLookupMode(EGLModeMESA mode, _EGLDisplay *disp)
}
/**
* Add a new mode with the given attributes (width, height, depth, refreshRate)
* to the given screen.
* Assign a new mode ID/handle to the mode as well.
* \return pointer to the new _EGLMode
*/
_EGLMode *
_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height,
EGLint refreshRate, const char *name)
{
EGLint n;
_EGLMode *newModes;
assert(screen);
assert(width > 0);
assert(height > 0);
assert(refreshRate > 0);
n = screen->NumModes;
newModes = (_EGLMode *) realloc(screen->Modes, (n+1) * sizeof(_EGLMode));
if (newModes) {
screen->Modes = newModes;
screen->Modes[n].Handle = n + 1;
screen->Modes[n].Width = width;
screen->Modes[n].Height = height;
screen->Modes[n].RefreshRate = refreshRate;
screen->Modes[n].Optimal = EGL_FALSE;
screen->Modes[n].Interlaced = EGL_FALSE;
screen->Modes[n].Name = _eglstrdup(name);
screen->NumModes++;
return screen->Modes + n;
}
else {
return NULL;
}
}
/**
* Parse the attrib_list to fill in the fields of the given _eglMode
* Return EGL_FALSE if any errors, EGL_TRUE otherwise.

View File

@@ -32,11 +32,6 @@ extern _EGLMode *
_eglLookupMode(EGLModeMESA mode, _EGLDisplay *dpy);
PUBLIC _EGLMode *
_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height,
EGLint refreshRate, const char *name);
extern EGLBoolean
_eglChooseModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
const EGLint *attrib_list, EGLModeMESA *modes,

View File

@@ -18,7 +18,6 @@
#include "egldisplay.h"
#include "eglcurrent.h"
#include "eglmode.h"
#include "eglconfig.h"
#include "eglsurface.h"
#include "eglscreen.h"
#include "eglmutex.h"
@@ -42,7 +41,8 @@ _eglAllocScreenHandle(void)
EGLScreenMESA s;
_eglLockMutex(&_eglNextScreenHandleMutex);
s = _eglNextScreenHandle++;
s = _eglNextScreenHandle;
_eglNextScreenHandle += _EGL_SCREEN_MAX_MODES;
_eglUnlockMutex(&_eglNextScreenHandleMutex);
return s;
@@ -53,16 +53,54 @@ _eglAllocScreenHandle(void)
* Initialize an _EGLScreen object to default values.
*/
void
_eglInitScreen(_EGLScreen *screen)
_eglInitScreen(_EGLScreen *screen, _EGLDisplay *dpy, EGLint num_modes)
{
memset(screen, 0, sizeof(_EGLScreen));
screen->Display = dpy;
screen->NumModes = num_modes;
screen->StepX = 1;
screen->StepY = 1;
if (num_modes > _EGL_SCREEN_MAX_MODES)
num_modes = _EGL_SCREEN_MAX_MODES;
screen->Modes = (_EGLMode *) calloc(num_modes, sizeof(*screen->Modes));
screen->NumModes = (screen->Modes) ? num_modes : 0;
}
/**
* Given a public screen handle, return the internal _EGLScreen object.
* Link a screen to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
EGLScreenMESA
_eglLinkScreen(_EGLScreen *screen)
{
_EGLDisplay *display;
EGLint i;
assert(screen && screen->Display);
display = screen->Display;
if (!display->Screens) {
display->Screens = _eglCreateArray("Screen", 4);
if (!display->Screens)
return (EGLScreenMESA) 0;
}
screen->Handle = _eglAllocScreenHandle();
for (i = 0; i < screen->NumModes; i++)
screen->Modes[i].Handle = screen->Handle + i;
_eglAppendArray(display->Screens, (void *) screen);
return screen->Handle;
}
/**
* Lookup a handle to find the linked config.
* Return NULL if the handle has no corresponding linked config.
*/
_EGLScreen *
_eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *display)
@@ -74,39 +112,21 @@ _eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *display)
for (i = 0; i < display->Screens->Size; i++) {
_EGLScreen *scr = (_EGLScreen *) display->Screens->Elements[i];
if (scr->Handle == screen)
if (scr->Handle == screen) {
assert(scr->Display == display);
return scr;
}
}
return NULL;
}
/**
* Add the given _EGLScreen to the display's list of screens.
*/
void
_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen)
{
assert(display);
assert(screen);
if (!display->Screens) {
display->Screens = _eglCreateArray("Screen", 4);
if (!display->Screens)
return;
}
screen->Handle = _eglAllocScreenHandle();
_eglAppendArray(display->Screens, (void *) screen);
}
static EGLBoolean
_eglFlattenScreen(void *elem, void *buffer)
{
_EGLScreen *scr = (_EGLScreen *) elem;
EGLScreenMESA *handle = (EGLScreenMESA *) buffer;
*handle = scr->Handle;
*handle = _eglGetScreenHandle(scr);
return EGL_TRUE;
}
@@ -122,66 +142,6 @@ _eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *display, EGLScreenMESA *screens
}
/**
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreateScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
const EGLint *attrib_list)
{
return NULL;
}
/**
* Show the given surface on the named screen.
* If surface is EGL_NO_SURFACE, disable the screen's output.
*
* This is just a placeholder function; drivers will always override
* this with code that _really_ shows the surface.
*/
EGLBoolean
_eglShowScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLScreen *scrn, _EGLSurface *surf,
_EGLMode *mode)
{
if (!surf) {
scrn->CurrentSurface = NULL;
}
else {
if (surf->Type != EGL_SCREEN_BIT_MESA) {
_eglError(EGL_BAD_SURFACE, "eglShowSurfaceMESA");
return EGL_FALSE;
}
if (surf->Width < mode->Width || surf->Height < mode->Height) {
_eglError(EGL_BAD_SURFACE,
"eglShowSurfaceMESA(surface smaller than screen size)");
return EGL_FALSE;
}
scrn->CurrentSurface = surf;
scrn->CurrentMode = mode;
}
return EGL_TRUE;
}
/**
* Set a screen's current display mode.
* Note: mode = EGL_NO_MODE is valid (turns off the screen)
*
* This is just a placeholder function; drivers will always override
* this with code that _really_ sets the mode.
*/
EGLBoolean
_eglScreenModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
_EGLMode *m)
{
scrn->CurrentMode = m;
return EGL_TRUE;
}
/**
* Set a screen's surface origin.
*/
@@ -242,33 +202,4 @@ _eglQueryScreenMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
}
/**
* Delete the modes associated with given screen.
*/
void
_eglDestroyScreenModes(_EGLScreen *scrn)
{
EGLint i;
for (i = 0; i < scrn->NumModes; i++) {
if (scrn->Modes[i].Name)
free((char *) scrn->Modes[i].Name); /* cast away const */
}
if (scrn->Modes)
free(scrn->Modes);
scrn->Modes = NULL;
scrn->NumModes = 0;
}
/**
* Default fallback routine - drivers should usually override this.
*/
void
_eglDestroyScreen(_EGLScreen *scrn)
{
_eglDestroyScreenModes(scrn);
free(scrn);
}
#endif /* EGL_MESA_screen_surface */

View File

@@ -8,6 +8,9 @@
#ifdef EGL_MESA_screen_surface
#define _EGL_SCREEN_MAX_MODES 16
/**
* Per-screen information.
* Note that an EGL screen doesn't have a size. A screen may be set to
@@ -19,6 +22,8 @@
*/
struct _egl_screen
{
_EGLDisplay *Display;
EGLScreenMESA Handle; /* The public/opaque handle which names this object */
_EGLMode *CurrentMode;
@@ -33,41 +38,35 @@ struct _egl_screen
PUBLIC void
_eglInitScreen(_EGLScreen *screen);
_eglInitScreen(_EGLScreen *screen, _EGLDisplay *dpy, EGLint num_modes);
PUBLIC EGLScreenMESA
_eglLinkScreen(_EGLScreen *screen);
extern _EGLScreen *
_eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *dpy);
PUBLIC void
_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen);
/**
* Return the handle of a linked screen.
*/
static INLINE EGLScreenMESA
_eglGetScreenHandle(_EGLScreen *screen)
{
return (screen) ? screen->Handle : (EGLScreenMESA) 0;
}
extern EGLBoolean
_eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
extern _EGLSurface *
_eglCreateScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, const EGLint *attrib_list);
extern EGLBoolean
_eglShowScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, _EGLSurface *surf, _EGLMode *m);
extern EGLBoolean
_eglScreenModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, _EGLMode *m);
extern EGLBoolean
_eglScreenPositionMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint x, EGLint y);
extern EGLBoolean
_eglQueryDisplayMESA(_EGLDriver *drv, _EGLDisplay *dpy, EGLint attribute, EGLint *value);
extern EGLBoolean
_eglQueryScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLScreen *scrn, _EGLSurface **surface);
@@ -81,14 +80,6 @@ extern EGLBoolean
_eglQueryScreenMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint attribute, EGLint *value);
extern void
_eglDestroyScreenModes(_EGLScreen *scrn);
PUBLIC void
_eglDestroyScreen(_EGLScreen *scrn);
#endif /* EGL_MESA_screen_surface */

View File

@@ -17,12 +17,12 @@
static void
_eglClampSwapInterval(_EGLSurface *surf, EGLint interval)
{
EGLint bound = GET_CONFIG_ATTRIB(surf->Config, EGL_MAX_SWAP_INTERVAL);
EGLint bound = surf->Config->MaxSwapInterval;
if (interval >= bound) {
interval = bound;
}
else {
bound = GET_CONFIG_ATTRIB(surf->Config, EGL_MIN_SWAP_INTERVAL);
bound = surf->Config->MinSwapInterval;
if (interval < bound)
interval = bound;
}
@@ -263,14 +263,13 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
return EGL_FALSE;
}
if ((GET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE) & type) == 0) {
if ((conf->SurfaceType & type) == 0) {
/* The config can't be used to create a surface of this type */
_eglError(EGL_BAD_CONFIG, func);
return EGL_FALSE;
}
memset(surf, 0, sizeof(_EGLSurface));
surf->Resource.Display = dpy;
_eglInitResource(&surf->Resource, sizeof(*surf), dpy);
surf->Type = type;
surf->Config = conf;
@@ -303,24 +302,6 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
}
EGLBoolean
_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
{
/* Drivers have to do the actual buffer swap. */
return EGL_TRUE;
}
EGLBoolean
_eglCopyBuffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLNativePixmapType target)
{
/* copy surface to native pixmap */
/* All implementation burdon for this is in the device driver */
return EGL_FALSE;
}
EGLBoolean
_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
EGLint attribute, EGLint *value)
@@ -333,7 +314,7 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
*value = surface->Height;
break;
case EGL_CONFIG_ID:
*value = GET_CONFIG_ATTRIB(surface->Config, EGL_CONFIG_ID);
*value = surface->Config->ConfigID;
break;
case EGL_LARGEST_PBUFFER:
*value = surface->LargestPbuffer;
@@ -388,51 +369,6 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
}
/**
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
EGLNativeWindowType window, const EGLint *attrib_list)
{
return NULL;
}
/**
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
EGLNativePixmapType pixmap, const EGLint *attrib_list)
{
return NULL;
}
/**
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
const EGLint *attrib_list)
{
return NULL;
}
/**
* Default fallback routine - drivers should usually override this.
*/
EGLBoolean
_eglDestroySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
{
if (!_eglIsSurfaceBound(surf))
free(surf);
return EGL_TRUE;
}
/**
* Default fallback routine - drivers might override this.
*/
@@ -445,7 +381,7 @@ _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
switch (attribute) {
case EGL_MIPMAP_LEVEL:
confval = GET_CONFIG_ATTRIB(surface->Config, EGL_RENDERABLE_TYPE);
confval = surface->Config->RenderableType;
if (!(confval & (EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT))) {
err = EGL_BAD_PARAMETER;
break;
@@ -457,7 +393,7 @@ _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
case EGL_MULTISAMPLE_RESOLVE_DEFAULT:
break;
case EGL_MULTISAMPLE_RESOLVE_BOX:
confval = GET_CONFIG_ATTRIB(surface->Config, EGL_SURFACE_TYPE);
confval = surface->Config->SurfaceType;
if (!(confval & EGL_MULTISAMPLE_RESOLVE_BOX_BIT))
err = EGL_BAD_MATCH;
break;
@@ -474,7 +410,7 @@ _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
case EGL_BUFFER_DESTROYED:
break;
case EGL_BUFFER_PRESERVED:
confval = GET_CONFIG_ATTRIB(surface->Config, EGL_SURFACE_TYPE);
confval = surface->Config->SurfaceType;
if (!(confval & EGL_SWAP_BEHAVIOR_PRESERVED_BIT))
err = EGL_BAD_MATCH;
break;
@@ -536,40 +472,6 @@ _eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
}
EGLBoolean
_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
EGLint buffer)
{
/* Just do basic error checking and return success/fail.
* Drivers must implement the real stuff.
*/
if (surface->Type != EGL_PBUFFER_BIT) {
_eglError(EGL_BAD_SURFACE, "eglBindTexImage");
return EGL_FALSE;
}
if (surface->TextureFormat == EGL_NO_TEXTURE) {
_eglError(EGL_BAD_MATCH, "eglBindTexImage");
return EGL_FALSE;
}
if (buffer != EGL_BACK_BUFFER) {
_eglError(EGL_BAD_PARAMETER, "eglReleaseTexImage");
return EGL_FALSE;
}
if (!surface->BoundToTexture) {
_eglError(EGL_BAD_SURFACE, "eglReleaseTexImage");
return EGL_FALSE;
}
surface->BoundToTexture = EGL_FALSE;
return EGL_TRUE;
}
EGLBoolean
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLint interval)
@@ -577,24 +479,3 @@ _eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
_eglClampSwapInterval(surf, interval);
return EGL_TRUE;
}
#ifdef EGL_VERSION_1_2
/**
* Example function - drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, _EGLDisplay *dpy,
EGLenum buftype, EGLClientBuffer buffer,
_EGLConfig *conf, const EGLint *attrib_list)
{
if (buftype != EGL_OPENVG_IMAGE) {
_eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer");
return NULL;
}
return NULL;
}
#endif /* EGL_VERSION_1_2 */

View File

@@ -51,34 +51,10 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
_EGLConfig *config, const EGLint *attrib_list);
extern EGLBoolean
_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf);
extern EGLBoolean
_eglCopyBuffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLNativePixmapType target);
extern EGLBoolean
_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint attribute, EGLint *value);
extern _EGLSurface *
_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, EGLNativeWindowType window, const EGLint *attrib_list);
extern _EGLSurface *
_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, EGLNativePixmapType pixmap, const EGLint *attrib_list);
extern _EGLSurface *
_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, const EGLint *attrib_list);
extern EGLBoolean
_eglDestroySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf);
extern EGLBoolean
_eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint attribute, EGLint value);
@@ -87,45 +63,40 @@ PUBLIC extern EGLBoolean
_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint buffer);
extern EGLBoolean
_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint buffer);
extern EGLBoolean
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint interval);
#ifdef EGL_VERSION_1_2
extern _EGLSurface *
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, _EGLDisplay *dpy,
EGLenum buftype, EGLClientBuffer buffer,
_EGLConfig *conf, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
/**
* Return true if there is a context bound to the surface.
*
* The binding is considered a reference to the surface. Drivers should not
* destroy a surface when it is bound.
* Increment reference count for the surface.
*/
static INLINE EGLBoolean
_eglIsSurfaceBound(_EGLSurface *surf)
static INLINE _EGLSurface *
_eglGetSurface(_EGLSurface *surf)
{
return (surf->CurrentContext != NULL);
if (surf)
_eglGetResource(&surf->Resource);
return surf;
}
/**
* Link a surface to a display and return the handle of the link.
* Decrement reference count for the surface.
*/
static INLINE EGLBoolean
_eglPutSurface(_EGLSurface *surf)
{
return (surf) ? _eglPutResource(&surf->Resource) : EGL_FALSE;
}
/**
* Link a surface to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLSurface
_eglLinkSurface(_EGLSurface *surf, _EGLDisplay *dpy)
_eglLinkSurface(_EGLSurface *surf)
{
_eglLinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE, dpy);
_eglLinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE);
return (EGLSurface) surf;
}
@@ -167,18 +138,4 @@ _eglGetSurfaceHandle(_EGLSurface *surf)
}
/**
* Return true if the surface is linked to a display.
*
* The link is considered a reference to the surface (the display is owning the
* surface). Drivers should not destroy a surface when it is linked.
*/
static INLINE EGLBoolean
_eglIsSurfaceLinked(_EGLSurface *surf)
{
_EGLResource *res = (_EGLResource *) surf;
return (res && _eglIsResourceLinked(res));
}
#endif /* EGLSURFACE_INCLUDED */

View File

@@ -50,10 +50,7 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
!(type == EGL_SYNC_FENCE_KHR && dpy->Extensions.KHR_fence_sync))
return _eglError(EGL_BAD_ATTRIBUTE, "eglCreateSyncKHR");
memset(sync, 0, sizeof(*sync));
sync->Resource.Display = dpy;
_eglInitResource(&sync->Resource, sizeof(*sync), dpy);
sync->Type = type;
sync->SyncStatus = EGL_UNSIGNALED_KHR;
sync->SyncCondition = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR;
@@ -66,37 +63,6 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
}
_EGLSync *
_eglCreateSyncKHR(_EGLDriver *drv, _EGLDisplay *dpy,
EGLenum type, const EGLint *attrib_list)
{
return NULL;
}
EGLBoolean
_eglDestroySyncKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
{
return EGL_TRUE;
}
EGLint
_eglClientWaitSyncKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
EGLint flags, EGLTimeKHR timeout)
{
return EGL_FALSE;
}
EGLBoolean
_eglSignalSyncKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
EGLenum mode)
{
return EGL_FALSE;
}
EGLBoolean
_eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
EGLint attribute, EGLint *value)

View File

@@ -28,38 +28,41 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
const EGLint *attrib_list);
extern _EGLSync *
_eglCreateSyncKHR(_EGLDriver *drv, _EGLDisplay *dpy,
EGLenum type, const EGLint *attrib_list);
extern EGLBoolean
_eglDestroySyncKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync);
extern EGLint
_eglClientWaitSyncKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
EGLint flags, EGLTimeKHR timeout);
extern EGLBoolean
_eglSignalSyncKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
EGLenum mode);
extern EGLBoolean
_eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
EGLint attribute, EGLint *value);
/**
* Link a sync to a display and return the handle of the link.
* Increment reference count for the sync.
*/
static INLINE _EGLSync *
_eglGetSync(_EGLSync *sync)
{
if (sync)
_eglGetResource(&sync->Resource);
return sync;
}
/**
* Decrement reference count for the sync.
*/
static INLINE EGLBoolean
_eglPutSync(_EGLSync *sync)
{
return (sync) ? _eglPutResource(&sync->Resource) : EGL_FALSE;
}
/**
* Link a sync to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLSyncKHR
_eglLinkSync(_EGLSync *sync, _EGLDisplay *dpy)
_eglLinkSync(_EGLSync *sync)
{
_eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC, dpy);
_eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
return (EGLSyncKHR) sync;
}
@@ -100,20 +103,6 @@ _eglGetSyncHandle(_EGLSync *sync)
}
/**
* Return true if the sync is linked to a display.
*
* The link is considered a reference to the sync (the display is owning the
* sync). Drivers should not destroy a sync when it is linked.
*/
static INLINE EGLBoolean
_eglIsSyncLinked(_EGLSync *sync)
{
_EGLResource *res = (_EGLResource *) sync;
return (res && _eglIsResourceLinked(res));
}
#endif /* EGL_KHR_reusable_sync */

View File

@@ -24,6 +24,8 @@ typedef struct _egl_extensions _EGLExtensions;
typedef struct _egl_image _EGLImage;
typedef struct _egl_image_attribs _EGLImageAttribs;
typedef struct _egl_mode _EGLMode;
typedef struct _egl_resource _EGLResource;

View File

@@ -40,7 +40,7 @@ depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURC
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
$(PROGS): % : %.o
$(PROGS): % : %.o $(PROGS_DEPS)
$(LD) $(LDFLAGS) $(filter %.o,$^) -o $@ -Wl,--start-group $(LIBS) -Wl,--end-group
# Emacs tags

View File

@@ -1,30 +1,134 @@
import os
Import('env')
Import('*')
#
# Auxiliary modules
#
SConscript('auxiliary/SConscript')
for driver in env['drivers']:
SConscript(os.path.join('drivers', driver, 'SConscript'))
#
# Drivers
#
SConscript([
'drivers/failover/SConscript',
'drivers/galahad/SConscript',
'drivers/identity/SConscript',
'drivers/llvmpipe/SConscript',
'drivers/rbug/SConscript',
'drivers/softpipe/SConscript',
'drivers/svga/SConscript',
'drivers/trace/SConscript',
])
if not env['msvc']:
# These drivers do not build on MSVC compilers
SConscript([
'drivers/i915/SConscript',
'drivers/i965/SConscript',
'drivers/r300/SConscript',
])
if env['drm']:
# These drivers depend on drm headers
if env['drm_radeon']:
SConscript([
'drivers/r600/SConscript',
])
# XXX: nouveau drivers have a tight dependency on libdrm, so to enable
# we need some version logic before we enable them. Also, ATM there is
# no nouveau target in scons
# if env['drm_nouveau']:
# SConscript([
# 'drivers/nouveau/SConscript',
# 'drivers/nv50/SConscript',
# 'drivers/nvfx/SConscript',
# ])
#
# State trackers
#
# Needed by some state trackers
SConscript('winsys/sw/null/SConscript')
SConscript('state_trackers/python/SConscript')
if platform != 'embedded':
SConscript('state_trackers/glx/xlib/SConscript')
SConscript('state_trackers/dri/SConscript')
SConscript('state_trackers/xorg/SConscript')
SConscript('state_trackers/egl/SConscript')
SConscript('state_trackers/vega/SConscript')
if env['platform'] != 'embedded':
SConscript('state_trackers/vega/SConscript')
if platform == 'windows':
SConscript('state_trackers/wgl/SConscript')
if env['x11']:
SConscript('state_trackers/glx/xlib/SConscript')
if env['dri']:
SConscript('state_trackers/dri/SConscript')
if env['dri'] and env['xorg']:
SConscript('state_trackers/xorg/SConscript')
if env['platform'] == 'windows':
SConscript([
'state_trackers/egl/SConscript',
'state_trackers/wgl/SConscript',
])
#
# Winsys
#
SConscript('winsys/SConscript')
SConscript('targets/SConscript')
#
# Targets
#
if platform != 'embedded':
SConscript('tests/unit/SConscript')
SConscript('tests/graw/SConscript')
SConscript([
'targets/graw-null/SConscript',
])
if env['x11']:
SConscript([
'targets/graw-xlib/SConscript',
'targets/libgl-xlib/SConscript',
])
if env['platform'] == 'windows':
SConscript([
'targets/graw-gdi/SConscript',
'targets/libgl-gdi/SConscript',
#'egl-gdi/SConscript',
])
if env['dri']:
SConscript([
'targets/SConscript.dri',
'targets/dri-swrast/SConscript',
'targets/dri-vmwgfx/SConscript',
#'targets/dri-nouveau/SConscript',
])
if env['drm_intel']:
SConscript([
'targets/dri-i915/SConscript',
'targets/dri-i965/SConscript',
])
if env['drm_radeon']:
SConscript([
'targets/dri-r300/SConscript',
'targets/dri-r600/SConscript',
])
if env['xorg'] and env['drm']:
SConscript([
#'targets/xorg-i915/SConscript',
#'targets/xorg-i965/SConscript',
#'targets/xorg-nouveau/SConscript',
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript',
])
#
# Unit tests & tools
#
if env['platform'] != 'embedded':
SConscript('tests/unit/SConscript')
SConscript('tests/graw/SConscript')

View File

@@ -8,6 +8,7 @@ C_SOURCES = \
cso_cache/cso_context.c \
cso_cache/cso_hash.c \
draw/draw_context.c \
draw/draw_fs.c \
draw/draw_gs.c \
draw/draw_pipe.c \
draw/draw_pipe_aaline.c \
@@ -121,17 +122,18 @@ C_SOURCES = \
util/u_handle_table.c \
util/u_hash.c \
util/u_hash_table.c \
util/u_index_modify.c \
util/u_keymap.c \
util/u_linear.c \
util/u_linkage.c \
util/u_network.c \
util/u_math.c \
util/u_mempool.c \
util/u_mm.c \
util/u_rect.c \
util/u_ringbuffer.c \
util/u_sampler.c \
util/u_simple_shaders.c \
util/u_slab.c \
util/u_snprintf.c \
util/u_staging.c \
util/u_surface.c \
@@ -140,8 +142,7 @@ C_SOURCES = \
util/u_tile.c \
util/u_transfer.c \
util/u_resource.c \
util/u_upload_mgr.c \
target-helpers/wrap_screen.c
util/u_upload_mgr.c
# Disabling until pipe-video branch gets merged in
#vl/vl_bitstream_parser.c \
@@ -153,6 +154,7 @@ C_SOURCES = \
GALLIVM_SOURCES = \
gallivm/lp_bld_arit.c \
gallivm/lp_bld_assert.c \
gallivm/lp_bld_bitarit.c \
gallivm/lp_bld_const.c \
gallivm/lp_bld_conv.c \
gallivm/lp_bld_debug.c \
@@ -168,10 +170,12 @@ GALLIVM_SOURCES = \
gallivm/lp_bld_printf.c \
gallivm/lp_bld_quad.c \
gallivm/lp_bld_sample.c \
gallivm/lp_bld_sample_aos.c \
gallivm/lp_bld_sample_soa.c \
gallivm/lp_bld_struct.c \
gallivm/lp_bld_swizzle.c \
gallivm/lp_bld_tgsi_aos.c \
gallivm/lp_bld_tgsi_info.c \
gallivm/lp_bld_tgsi_soa.c \
gallivm/lp_bld_type.c \
draw/draw_llvm.c \
@@ -181,7 +185,7 @@ GALLIVM_SOURCES = \
draw/draw_pt_fetch_shade_pipeline_llvm.c
GALLIVM_CPP_SOURCES = \
gallivm/lp_bld_misc.cpp
gallivm/lp_bld_misc.cpp
GENERATED_SOURCES = \
indices/u_indices_gen.c \
@@ -199,23 +203,20 @@ CPP_SOURCES += \
endif
LIBRARY_DEFINES += -D__STDC_CONSTANT_MACROS
include ../Makefile.template
indices/u_indices_gen.c: indices/u_indices_gen.py
python $< > $@
$(PYTHON2) $< > $@
indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
python $< > $@
$(PYTHON2) $< > $@
util/u_format_srgb.c: util/u_format_srgb.py
python $< > $@
$(PYTHON2) $< > $@
util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
python util/u_format_table.py util/u_format.csv > $@
$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
util/u_half.c: util/u_half.py
python util/u_half.py > $@
$(PYTHON2) util/u_half.py > $@

View File

@@ -7,8 +7,6 @@ env.Append(CPPPATH = [
'util',
])
env.Tool('udis86')
env.CodeGenerate(
target = 'indices/u_indices_gen.c',
script = 'indices/u_indices_gen.py',
@@ -54,6 +52,7 @@ source = [
'cso_cache/cso_context.c',
'cso_cache/cso_hash.c',
'draw/draw_context.c',
'draw/draw_fs.c',
'draw/draw_gs.c',
'draw/draw_pipe.c',
'draw/draw_pipe_aaline.c',
@@ -170,18 +169,19 @@ source = [
'util/u_handle_table.c',
'util/u_hash.c',
'util/u_hash_table.c',
'util/u_index_modify.c',
'util/u_keymap.c',
'util/u_linear.c',
'util/u_linkage.c',
'util/u_network.c',
'util/u_math.c',
'util/u_mempool.c',
'util/u_mm.c',
'util/u_rect.c',
'util/u_resource.c',
'util/u_ringbuffer.c',
'util/u_sampler.c',
'util/u_simple_shaders.c',
'util/u_slab.c',
'util/u_snprintf.c',
'util/u_staging.c',
'util/u_surface.c',
@@ -196,40 +196,45 @@ source = [
#'vl/vl_compositor.c',
#'vl/vl_csc.c',
#'vl/vl_shader_build.c',
'target-helpers/wrap_screen.c',
]
if env['llvm']:
if env['UDIS86']:
env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')])
source += [
'gallivm/lp_bld_arit.c',
'gallivm/lp_bld_assert.c',
'gallivm/lp_bld_const.c',
'gallivm/lp_bld_conv.c',
'gallivm/lp_bld_debug.c',
'gallivm/lp_bld_flow.c',
'gallivm/lp_bld_format_aos.c',
'gallivm/lp_bld_format_soa.c',
'gallivm/lp_bld_format_yuv.c',
'gallivm/lp_bld_gather.c',
'gallivm/lp_bld_init.c',
'gallivm/lp_bld_intr.c',
'gallivm/lp_bld_logic.c',
'gallivm/lp_bld_misc.cpp',
'gallivm/lp_bld_pack.c',
'gallivm/lp_bld_printf.c',
'gallivm/lp_bld_quad.c',
'gallivm/lp_bld_sample.c',
'gallivm/lp_bld_sample_soa.c',
'gallivm/lp_bld_struct.c',
'gallivm/lp_bld_swizzle.c',
'gallivm/lp_bld_tgsi_aos.c',
'gallivm/lp_bld_tgsi_soa.c',
'gallivm/lp_bld_type.c',
'draw/draw_llvm.c',
'draw/draw_llvm_sample.c',
'draw/draw_llvm_translate.c',
'draw/draw_pt_fetch_shade_pipeline_llvm.c',
'draw/draw_vs_llvm.c'
'gallivm/lp_bld_arit.c',
'gallivm/lp_bld_assert.c',
'gallivm/lp_bld_bitarit.c',
'gallivm/lp_bld_const.c',
'gallivm/lp_bld_conv.c',
'gallivm/lp_bld_debug.c',
'gallivm/lp_bld_flow.c',
'gallivm/lp_bld_format_aos.c',
'gallivm/lp_bld_format_soa.c',
'gallivm/lp_bld_format_yuv.c',
'gallivm/lp_bld_gather.c',
'gallivm/lp_bld_init.c',
'gallivm/lp_bld_intr.c',
'gallivm/lp_bld_logic.c',
'gallivm/lp_bld_misc.cpp',
'gallivm/lp_bld_pack.c',
'gallivm/lp_bld_printf.c',
'gallivm/lp_bld_quad.c',
'gallivm/lp_bld_sample.c',
'gallivm/lp_bld_sample_aos.c',
'gallivm/lp_bld_sample_soa.c',
'gallivm/lp_bld_struct.c',
'gallivm/lp_bld_swizzle.c',
'gallivm/lp_bld_tgsi_aos.c',
'gallivm/lp_bld_tgsi_info.c',
'gallivm/lp_bld_tgsi_soa.c',
'gallivm/lp_bld_type.c',
'draw/draw_llvm.c',
'draw/draw_llvm_sample.c',
'draw/draw_llvm_translate.c',
'draw/draw_pt_fetch_shade_pipeline_llvm.c',
'draw/draw_vs_llvm.c'
]
gallium = env.ConvenienceLibrary(
@@ -237,4 +242,6 @@ gallium = env.ConvenienceLibrary(
source = source,
)
env.Alias('gallium', gallium)
Export('gallium')

View File

@@ -595,7 +595,7 @@ enum pipe_error cso_set_vertex_samplers(struct cso_context *ctx,
error = temp;
}
for ( ; i < ctx->nr_samplers; i++) {
for ( ; i < ctx->nr_vertex_samplers; i++) {
temp = cso_single_vertex_sampler( ctx, i, NULL );
if (temp != PIPE_OK)
error = temp;

View File

@@ -63,19 +63,32 @@ draw_get_option_use_llvm(void)
}
#endif
struct draw_context *draw_create( struct pipe_context *pipe )
/**
* Create new draw module context.
*/
struct draw_context *
draw_create(struct pipe_context *pipe)
{
return draw_create_gallivm(pipe, NULL);
}
/**
* Create new draw module context with gallivm state for LLVM JIT.
*/
struct draw_context *
draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm)
{
struct draw_context *draw = CALLOC_STRUCT( draw_context );
if (draw == NULL)
goto fail;
#if HAVE_LLVM
if(draw_get_option_use_llvm())
{
lp_build_init();
assert(lp_build_engine);
draw->engine = lp_build_engine;
draw->llvm = draw_llvm_create(draw);
if (draw_get_option_use_llvm() && gallivm) {
draw->llvm = draw_llvm_create(draw, gallivm);
}
#endif
@@ -91,6 +104,8 @@ fail:
return NULL;
}
boolean draw_init(struct draw_context *draw)
{
/*
@@ -335,6 +350,7 @@ draw_set_mapped_constant_buffer(struct draw_context *draw,
case PIPE_SHADER_VERTEX:
draw->pt.user.vs_constants[slot] = buffer;
draw->pt.user.vs_constants_size[slot] = size;
draw->pt.user.planes = (float (*) [12][4]) &(draw->plane[0]);
draw_vs_set_constants(draw, slot, buffer, size);
break;
case PIPE_SHADER_GEOMETRY:
@@ -413,6 +429,42 @@ draw_set_force_passthrough( struct draw_context *draw, boolean enable )
}
/**
* Allocate an extra vertex/geometry shader vertex attribute.
* This is used by some of the optional draw module stages such
* as wide_point which may need to allocate additional generic/texcoord
* attributes.
*/
int
draw_alloc_extra_vertex_attrib(struct draw_context *draw,
uint semantic_name, uint semantic_index)
{
const int num_outputs = draw_current_shader_outputs(draw);
const int n = draw->extra_shader_outputs.num;
assert(n < Elements(draw->extra_shader_outputs.semantic_name));
draw->extra_shader_outputs.semantic_name[n] = semantic_name;
draw->extra_shader_outputs.semantic_index[n] = semantic_index;
draw->extra_shader_outputs.slot[n] = num_outputs + n;
draw->extra_shader_outputs.num++;
return draw->extra_shader_outputs.slot[n];
}
/**
* Remove all extra vertex attributes that were allocated with
* draw_alloc_extra_vertex_attrib().
*/
void
draw_remove_extra_vertex_attribs(struct draw_context *draw)
{
draw->extra_shader_outputs.num = 0;
}
/**
* Ask the draw module for the location/slot of the given vertex attribute in
* a post-transformed vertex.
@@ -446,12 +498,12 @@ draw_find_shader_output(const struct draw_context *draw,
return i;
}
/* XXX there may be more than one extra vertex attrib.
* For example, simulated gl_FragCoord and gl_PointCoord.
*/
if (draw->extra_shader_outputs.semantic_name == semantic_name &&
draw->extra_shader_outputs.semantic_index == semantic_index) {
return draw->extra_shader_outputs.slot;
/* Search the extra vertex attributes */
for (i = 0; i < draw->extra_shader_outputs.num; i++) {
if (draw->extra_shader_outputs.semantic_name[i] == semantic_name &&
draw->extra_shader_outputs.semantic_index[i] == semantic_index) {
return draw->extra_shader_outputs.slot[i];
}
}
return 0;
@@ -470,16 +522,18 @@ draw_find_shader_output(const struct draw_context *draw,
uint
draw_num_shader_outputs(const struct draw_context *draw)
{
uint count = draw->vs.vertex_shader->info.num_outputs;
uint count;
/* If a geometry shader is present, its outputs go to the
* driver, else the vertex shader's outputs.
*/
if (draw->gs.geometry_shader)
count = draw->gs.geometry_shader->info.num_outputs;
else
count = draw->vs.vertex_shader->info.num_outputs;
count += draw->extra_shader_outputs.num;
if (draw->extra_shader_outputs.slot > 0)
count++;
return count;
}
@@ -671,6 +725,11 @@ draw_set_samplers(struct draw_context *draw,
draw->samplers[i] = NULL;
draw->num_samplers = num;
#ifdef HAVE_LLVM
if (draw->llvm)
draw_llvm_set_sampler_state(draw);
#endif
}
void
@@ -678,9 +737,9 @@ draw_set_mapped_texture(struct draw_context *draw,
unsigned sampler_idx,
uint32_t width, uint32_t height, uint32_t depth,
uint32_t last_level,
uint32_t row_stride[DRAW_MAX_TEXTURE_LEVELS],
uint32_t img_stride[DRAW_MAX_TEXTURE_LEVELS],
const void *data[DRAW_MAX_TEXTURE_LEVELS])
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
const void *data[PIPE_MAX_TEXTURE_LEVELS])
{
#ifdef HAVE_LLVM
if(draw->llvm)

View File

@@ -46,12 +46,17 @@ struct draw_context;
struct draw_stage;
struct draw_vertex_shader;
struct draw_geometry_shader;
struct draw_fragment_shader;
struct tgsi_sampler;
struct gallivm_state;
#define DRAW_MAX_TEXTURE_LEVELS 13 /* 4K x 4K for now */
struct draw_context *draw_create( struct pipe_context *pipe );
struct draw_context *
draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm);
void draw_destroy( struct draw_context *draw );
void draw_flush(struct draw_context *draw);
@@ -119,9 +124,9 @@ draw_set_mapped_texture(struct draw_context *draw,
unsigned sampler_idx,
uint32_t width, uint32_t height, uint32_t depth,
uint32_t last_level,
uint32_t row_stride[DRAW_MAX_TEXTURE_LEVELS],
uint32_t img_stride[DRAW_MAX_TEXTURE_LEVELS],
const void *data[DRAW_MAX_TEXTURE_LEVELS]);
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
const void *data[PIPE_MAX_TEXTURE_LEVELS]);
/*
@@ -137,6 +142,17 @@ void draw_delete_vertex_shader(struct draw_context *draw,
struct draw_vertex_shader *dvs);
/*
* Fragment shader functions
*/
struct draw_fragment_shader *
draw_create_fragment_shader(struct draw_context *draw,
const struct pipe_shader_state *shader);
void draw_bind_fragment_shader(struct draw_context *draw,
struct draw_fragment_shader *dvs);
void draw_delete_fragment_shader(struct draw_context *draw,
struct draw_fragment_shader *dvs);
/*
* Geometry shader functions
*/

View File

@@ -0,0 +1,73 @@
/**************************************************************************
*
* Copyright 2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include "pipe/p_shader_tokens.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_prim.h"
#include "tgsi/tgsi_parse.h"
#include "draw_fs.h"
#include "draw_private.h"
#include "draw_context.h"
struct draw_fragment_shader *
draw_create_fragment_shader(struct draw_context *draw,
const struct pipe_shader_state *shader)
{
struct draw_fragment_shader *dfs;
dfs = CALLOC_STRUCT(draw_fragment_shader);
if (dfs) {
dfs->base = *shader;
tgsi_scan_shader(shader->tokens, &dfs->info);
}
return dfs;
}
void
draw_bind_fragment_shader(struct draw_context *draw,
struct draw_fragment_shader *dfs)
{
draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE);
draw->fs.fragment_shader = dfs;
}
void
draw_delete_fragment_shader(struct draw_context *draw,
struct draw_fragment_shader *dfs)
{
FREE(dfs);
}

View File

@@ -0,0 +1,42 @@
/**************************************************************************
*
* Copyright 2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef DRAW_FS_H
#define DRAW_FS_H
#include "tgsi/tgsi_scan.h"
struct draw_fragment_shader
{
struct pipe_shader_state base;
struct tgsi_shader_info info;
};
#endif /* DRAW_FS_H */

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,6 @@
#include <llvm-c/Target.h>
#include <llvm-c/ExecutionEngine.h>
#define DRAW_MAX_TEXTURE_LEVELS 13 /* 4K x 4K for now */
struct draw_llvm;
struct llvm_vertex_shader;
@@ -52,9 +51,13 @@ struct draw_jit_texture
uint32_t height;
uint32_t depth;
uint32_t last_level;
uint32_t row_stride[DRAW_MAX_TEXTURE_LEVELS];
uint32_t img_stride[DRAW_MAX_TEXTURE_LEVELS];
const void *data[DRAW_MAX_TEXTURE_LEVELS];
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS];
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS];
const void *data[PIPE_MAX_TEXTURE_LEVELS];
float min_lod;
float max_lod;
float lod_bias;
float border_color[4];
};
enum {
@@ -65,6 +68,10 @@ enum {
DRAW_JIT_TEXTURE_ROW_STRIDE,
DRAW_JIT_TEXTURE_IMG_STRIDE,
DRAW_JIT_TEXTURE_DATA,
DRAW_JIT_TEXTURE_MIN_LOD,
DRAW_JIT_TEXTURE_MAX_LOD,
DRAW_JIT_TEXTURE_LOD_BIAS,
DRAW_JIT_TEXTURE_BORDER_COLOR,
DRAW_JIT_TEXTURE_NUM_FIELDS /* number of fields above */
};
@@ -89,46 +96,51 @@ struct draw_jit_context
{
const float *vs_constants;
const float *gs_constants;
float (*planes) [12][4];
float *viewport;
struct draw_jit_texture textures[PIPE_MAX_VERTEX_SAMPLERS];
};
#define draw_jit_context_vs_constants(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, 0, "vs_constants")
#define draw_jit_context_vs_constants(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 0, "vs_constants")
#define draw_jit_context_gs_constants(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, 1, "gs_constants")
#define draw_jit_context_gs_constants(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 1, "gs_constants")
#define DRAW_JIT_CTX_TEXTURES 2
#define draw_jit_context_planes(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 2, "planes")
#define draw_jit_context_textures(_builder, _ptr) \
lp_build_struct_get_ptr(_builder, _ptr, DRAW_JIT_CTX_TEXTURES, "textures")
#define draw_jit_context_viewport(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 3, "viewport")
#define DRAW_JIT_CTX_TEXTURES 4
#define draw_jit_context_textures(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_TEXTURES, "textures")
#define draw_jit_header_id(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, 0, "id")
#define draw_jit_header_clip(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, 1, "clip")
#define draw_jit_header_data(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, 2, "data")
#define draw_jit_vbuffer_stride(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 0, "stride")
#define draw_jit_header_id(_builder, _ptr) \
lp_build_struct_get_ptr(_builder, _ptr, 0, "id")
#define draw_jit_vbuffer_max_index(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 1, "max_index")
#define draw_jit_header_clip(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, 1, "clip")
#define draw_jit_header_data(_builder, _ptr) \
lp_build_struct_get_ptr(_builder, _ptr, 2, "data")
#define draw_jit_vbuffer_offset(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 2, "buffer_offset")
#define draw_jit_vbuffer_stride(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, 0, "stride")
#define draw_jit_vbuffer_max_index(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, 1, "max_index")
#define draw_jit_vbuffer_offset(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, 2, "buffer_offset")
typedef void
typedef int
(*draw_jit_vert_func)(struct draw_jit_context *context,
struct vertex_header *io,
const char *vbuffers[PIPE_MAX_ATTRIBS],
@@ -139,7 +151,7 @@ typedef void
unsigned instance_id);
typedef void
typedef int
(*draw_jit_vert_func_elts)(struct draw_jit_context *context,
struct vertex_header *io,
const char *vbuffers[PIPE_MAX_ATTRIBS],
@@ -151,8 +163,16 @@ typedef void
struct draw_llvm_variant_key
{
unsigned nr_vertex_elements:16;
unsigned nr_samplers:16;
unsigned nr_vertex_elements:8;
unsigned nr_samplers:8;
unsigned clip_xy:1;
unsigned clip_z:1;
unsigned clip_user:1;
unsigned clip_halfz:1;
unsigned bypass_viewport:1;
unsigned need_edgeflags:1;
unsigned nr_planes:4;
unsigned pad:6;
/* Variable number of vertex elements:
*/
@@ -226,21 +246,19 @@ struct draw_llvm {
struct draw_jit_context jit_context;
struct gallivm_state *gallivm;
struct draw_llvm_variant_list_item vs_variants_list;
int nr_variants;
LLVMModuleRef module;
LLVMExecutionEngineRef engine;
LLVMModuleProviderRef provider;
LLVMTargetDataRef target;
LLVMPassManagerRef pass;
/* LLVM JIT builder types */
LLVMTypeRef context_ptr_type;
LLVMTypeRef vertex_header_ptr_type;
LLVMTypeRef buffer_ptr_type;
LLVMTypeRef vb_ptr_type;
LLVMTypeRef vertex_header_ptr_type;
};
static INLINE struct llvm_vertex_shader *
llvm_vertex_shader(struct draw_vertex_shader *vs)
{
@@ -249,7 +267,7 @@ llvm_vertex_shader(struct draw_vertex_shader *vs)
struct draw_llvm *
draw_llvm_create(struct draw_context *draw);
draw_llvm_create(struct draw_context *draw, struct gallivm_state *gallivm);
void
draw_llvm_destroy(struct draw_llvm *llvm);
@@ -266,7 +284,7 @@ struct draw_llvm_variant_key *
draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store);
LLVMValueRef
draw_llvm_translate_from(LLVMBuilderRef builder,
draw_llvm_translate_from(struct gallivm_state *gallivm,
LLVMValueRef vbuffer,
enum pipe_format from_format);
@@ -274,13 +292,16 @@ struct lp_build_sampler_soa *
draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
LLVMValueRef context_ptr);
void
draw_llvm_set_sampler_state(struct draw_context *draw);
void
draw_llvm_set_mapped_texture(struct draw_context *draw,
unsigned sampler_idx,
uint32_t width, uint32_t height, uint32_t depth,
uint32_t last_level,
uint32_t row_stride[DRAW_MAX_TEXTURE_LEVELS],
uint32_t img_stride[DRAW_MAX_TEXTURE_LEVELS],
const void *data[DRAW_MAX_TEXTURE_LEVELS]);
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
const void *data[PIPE_MAX_TEXTURE_LEVELS]);
#endif

View File

@@ -32,6 +32,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
#include "gallivm/lp_bld_const.h"
#include "gallivm/lp_bld_debug.h"
#include "gallivm/lp_bld_type.h"
#include "gallivm/lp_bld_sample.h"
@@ -84,12 +85,13 @@ struct draw_llvm_sampler_soa
*/
static LLVMValueRef
draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
LLVMBuilderRef builder,
struct gallivm_state *gallivm,
unsigned unit,
unsigned member_index,
const char *member_name,
boolean emit_load)
{
LLVMBuilderRef builder = gallivm->builder;
struct draw_llvm_sampler_dynamic_state *state =
(struct draw_llvm_sampler_dynamic_state *)base;
LLVMValueRef indices[4];
@@ -99,13 +101,13 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
debug_assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
/* context[0] */
indices[0] = LLVMConstInt(LLVMInt32Type(), 0, 0);
indices[0] = lp_build_const_int32(gallivm, 0);
/* context[0].textures */
indices[1] = LLVMConstInt(LLVMInt32Type(), DRAW_JIT_CTX_TEXTURES, 0);
indices[1] = lp_build_const_int32(gallivm, DRAW_JIT_CTX_TEXTURES);
/* context[0].textures[unit] */
indices[2] = LLVMConstInt(LLVMInt32Type(), unit, 0);
indices[2] = lp_build_const_int32(gallivm, unit);
/* context[0].textures[unit].member */
indices[3] = LLVMConstInt(LLVMInt32Type(), member_index, 0);
indices[3] = lp_build_const_int32(gallivm, member_index);
ptr = LLVMBuildGEP(builder, state->context_ptr, indices, Elements(indices), "");
@@ -132,10 +134,10 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
#define DRAW_LLVM_TEXTURE_MEMBER(_name, _index, _emit_load) \
static LLVMValueRef \
draw_llvm_texture_##_name( const struct lp_sampler_dynamic_state *base, \
LLVMBuilderRef builder, \
struct gallivm_state *gallivm, \
unsigned unit) \
{ \
return draw_llvm_texture_member(base, builder, unit, _index, #_name, _emit_load ); \
return draw_llvm_texture_member(base, gallivm, unit, _index, #_name, _emit_load ); \
}
@@ -146,6 +148,10 @@ DRAW_LLVM_TEXTURE_MEMBER(last_level, DRAW_JIT_TEXTURE_LAST_LEVEL, TRUE)
DRAW_LLVM_TEXTURE_MEMBER(row_stride, DRAW_JIT_TEXTURE_ROW_STRIDE, FALSE)
DRAW_LLVM_TEXTURE_MEMBER(img_stride, DRAW_JIT_TEXTURE_IMG_STRIDE, FALSE)
DRAW_LLVM_TEXTURE_MEMBER(data_ptr, DRAW_JIT_TEXTURE_DATA, FALSE)
DRAW_LLVM_TEXTURE_MEMBER(min_lod, DRAW_JIT_TEXTURE_MIN_LOD, TRUE)
DRAW_LLVM_TEXTURE_MEMBER(max_lod, DRAW_JIT_TEXTURE_MAX_LOD, TRUE)
DRAW_LLVM_TEXTURE_MEMBER(lod_bias, DRAW_JIT_TEXTURE_LOD_BIAS, TRUE)
DRAW_LLVM_TEXTURE_MEMBER(border_color, DRAW_JIT_TEXTURE_BORDER_COLOR, FALSE)
static void
@@ -161,7 +167,7 @@ draw_llvm_sampler_soa_destroy(struct lp_build_sampler_soa *sampler)
*/
static void
draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
LLVMBuilderRef builder,
struct gallivm_state *gallivm,
struct lp_type type,
unsigned unit,
unsigned num_coords,
@@ -176,7 +182,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
lp_build_sample_soa(builder,
lp_build_sample_soa(gallivm,
&sampler->dynamic_state.static_state[unit],
&sampler->dynamic_state.base,
type,
@@ -207,6 +213,10 @@ draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
sampler->dynamic_state.base.row_stride = draw_llvm_texture_row_stride;
sampler->dynamic_state.base.img_stride = draw_llvm_texture_img_stride;
sampler->dynamic_state.base.data_ptr = draw_llvm_texture_data_ptr;
sampler->dynamic_state.base.min_lod = draw_llvm_texture_min_lod;
sampler->dynamic_state.base.max_lod = draw_llvm_texture_max_lod;
sampler->dynamic_state.base.lod_bias = draw_llvm_texture_lod_bias;
sampler->dynamic_state.base.border_color = draw_llvm_texture_border_color;
sampler->dynamic_state.static_state = static_state;
sampler->dynamic_state.context_ptr = context_ptr;

View File

@@ -3,7 +3,7 @@
#include "draw_llvm.h"
#include "gallivm/lp_bld_arit.h"
#include "gallivm/lp_bld_const.h"
#include "gallivm/lp_bld_struct.h"
#include "gallivm/lp_bld_format.h"
#include "gallivm/lp_bld_debug.h"
@@ -17,272 +17,279 @@
#define DRAW_DBG 0
static LLVMValueRef
from_64_float(LLVMBuilderRef builder, LLVMValueRef val)
from_64_float(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMDoubleType(), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
return LLVMBuildFPTrunc(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMDoubleTypeInContext(gallivm->context), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildFPTrunc(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static LLVMValueRef
from_32_float(LLVMBuilderRef builder, LLVMValueRef val)
from_32_float(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMFloatType(), 0) , "");
return LLVMBuildLoad(builder, bc, "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMFloatTypeInContext(gallivm->context), 0) , "");
return LLVMBuildLoad(gallivm->builder, bc, "");
}
static INLINE LLVMValueRef
from_8_uscaled(LLVMBuilderRef builder, LLVMValueRef val)
from_8_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(builder, val, "");
return LLVMBuildUIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_16_uscaled(LLVMBuilderRef builder, LLVMValueRef val)
from_16_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
return LLVMBuildUIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_32_uscaled(LLVMBuilderRef builder, LLVMValueRef val)
from_32_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
return LLVMBuildUIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_8_sscaled(LLVMBuilderRef builder, LLVMValueRef val)
from_8_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(builder, val, "");
return LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_16_sscaled(LLVMBuilderRef builder, LLVMValueRef val)
from_16_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
return LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_32_sscaled(LLVMBuilderRef builder, LLVMValueRef val)
from_32_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
return LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_8_unorm(LLVMBuilderRef builder, LLVMValueRef val)
from_8_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(builder, val, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(builder, l, LLVMFloatType(), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 255.), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 255.), "");
}
static INLINE LLVMValueRef
from_16_unorm(LLVMBuilderRef builder, LLVMValueRef val)
from_16_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(builder, l, LLVMFloatType(), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 65535.), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65535.), "");
}
static INLINE LLVMValueRef
from_32_unorm(LLVMBuilderRef builder, LLVMValueRef val)
from_32_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 4294967295.), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 4294967295.), "");
}
static INLINE LLVMValueRef
from_8_snorm(LLVMBuilderRef builder, LLVMValueRef val)
from_8_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(builder, val, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 127.0), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 127.0), "");
}
static INLINE LLVMValueRef
from_16_snorm(LLVMBuilderRef builder, LLVMValueRef val)
from_16_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 32767.0f), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 32767.0f), "");
}
static INLINE LLVMValueRef
from_32_snorm(LLVMBuilderRef builder, LLVMValueRef val)
from_32_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 2147483647.0), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 2147483647.0), "");
}
static INLINE LLVMValueRef
from_32_fixed(LLVMBuilderRef builder, LLVMValueRef val)
from_32_fixed(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(builder, val,
LLVMPointerType(LLVMIntType(32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(builder, l, LLVMFloatType(), "");
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 65536.0), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65536.0), "");
}
static LLVMValueRef
to_64_float(LLVMBuilderRef builder, LLVMValueRef fp)
to_64_float(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPExt(builder, l, LLVMDoubleType(), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPExt(gallivm->builder, l, LLVMDoubleTypeInContext(gallivm->context), "");
}
static LLVMValueRef
to_32_float(LLVMBuilderRef builder, LLVMValueRef fp)
to_32_float(struct gallivm_state *gallivm, LLVMValueRef fp)
{
return LLVMBuildLoad(builder, fp, "");
return LLVMBuildLoad(gallivm->builder, fp, "");
}
static INLINE LLVMValueRef
to_8_uscaled(LLVMBuilderRef builder, LLVMValueRef fp)
to_8_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPToUI(builder, l, LLVMIntType(8), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 8), "");
}
static INLINE LLVMValueRef
to_16_uscaled(LLVMBuilderRef builder, LLVMValueRef fp)
to_16_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPToUI(builder, l, LLVMIntType(16), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 16), "");
}
static INLINE LLVMValueRef
to_32_uscaled(LLVMBuilderRef builder, LLVMValueRef fp)
to_32_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPToUI(builder, l, LLVMIntType(32), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 32), "");
}
static INLINE LLVMValueRef
to_8_sscaled(LLVMBuilderRef builder, LLVMValueRef fp)
to_8_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPToSI(builder, l, LLVMIntType(8), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 8), "");
}
static INLINE LLVMValueRef
to_16_sscaled(LLVMBuilderRef builder, LLVMValueRef fp)
to_16_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPToSI(builder, l, LLVMIntType(16), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 16), "");
}
static INLINE LLVMValueRef
to_32_sscaled(LLVMBuilderRef builder, LLVMValueRef fp)
to_32_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
return LLVMBuildFPToSI(builder, l, LLVMIntType(32), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 32), "");
}
static INLINE LLVMValueRef
to_8_unorm(LLVMBuilderRef builder, LLVMValueRef fp)
to_8_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(builder, l, LLVMIntType(8), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 255.), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 8), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 255.), "");
}
static INLINE LLVMValueRef
to_16_unorm(LLVMBuilderRef builder, LLVMValueRef fp)
to_16_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(builder, l, LLVMIntType(32), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 65535.), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65535.), "");
}
static INLINE LLVMValueRef
to_32_unorm(LLVMBuilderRef builder, LLVMValueRef fp)
to_32_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(builder, l, LLVMIntType(32), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 4294967295.), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 4294967295.), "");
}
static INLINE LLVMValueRef
to_8_snorm(LLVMBuilderRef builder, LLVMValueRef val)
to_8_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(builder, val, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(builder, l, LLVMIntType(8), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 127.0), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 8), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 127.0), "");
}
static INLINE LLVMValueRef
to_16_snorm(LLVMBuilderRef builder, LLVMValueRef fp)
to_16_snorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(builder, l, LLVMIntType(16), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 32767.0f), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 16), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 32767.0f), "");
}
static INLINE LLVMValueRef
to_32_snorm(LLVMBuilderRef builder, LLVMValueRef fp)
to_32_snorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(builder, l, LLVMIntType(32), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 2147483647.0), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 2147483647.0), "");
}
static INLINE LLVMValueRef
to_32_fixed(LLVMBuilderRef builder, LLVMValueRef fp)
to_32_fixed(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(builder, l, LLVMIntType(32), "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(builder, uscaled,
LLVMConstReal(LLVMFloatType(), 65536.0), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65536.0), "");
}
typedef LLVMValueRef (*from_func)(LLVMBuilderRef, LLVMValueRef);
typedef LLVMValueRef (*to_func)(LLVMBuilderRef, LLVMValueRef);
typedef LLVMValueRef (*from_func)(struct gallivm_state *, LLVMValueRef);
typedef LLVMValueRef (*to_func)(struct gallivm_state *, LLVMValueRef);
/* so that underneath can avoid function calls which are prohibited
* for static initialization we need this conversion */
@@ -295,21 +302,21 @@ enum ll_type {
};
static INLINE LLVMTypeRef
ll_type_to_llvm(enum ll_type type)
ll_type_to_llvm(struct gallivm_state *gallivm, enum ll_type type)
{
switch (type) {
case LL_Double:
return LLVMDoubleType();
return LLVMDoubleTypeInContext(gallivm->context);
case LL_Float:
return LLVMFloatType();
return LLVMFloatTypeInContext(gallivm->context);
case LL_Int32:
return LLVMInt32Type();
return LLVMInt32TypeInContext(gallivm->context);
case LL_Int16:
return LLVMIntType(16);
return LLVMIntTypeInContext(gallivm->context, 16);
case LL_Int8:
return LLVMIntType(8);
return LLVMIntTypeInContext(gallivm->context, 8);
}
return LLVMIntType(8);
return LLVMIntTypeInContext(gallivm->context, 8);
}
static INLINE int
@@ -415,42 +422,42 @@ struct draw_llvm_translate {
static LLVMValueRef
fetch(LLVMBuilderRef builder,
fetch(struct gallivm_state *gallivm,
LLVMValueRef ptr, int val_size, int nr_components,
from_func func)
{
int i;
int offset = 0;
LLVMValueRef res = LLVMConstNull(
LLVMVectorType(LLVMFloatType(), 4));
LLVMValueRef res =
LLVMConstNull(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context), 4));
LLVMValueRef defaults[4];
defaults[0] = LLVMConstReal(LLVMFloatType(), 0);
defaults[1] = LLVMConstReal(LLVMFloatType(), 0);
defaults[2] = LLVMConstReal(LLVMFloatType(), 0);
defaults[3] = LLVMConstReal(LLVMFloatType(), 1);
defaults[0] =
defaults[1] =
defaults[2] = lp_build_const_float(gallivm, 0.0);
defaults[3] = lp_build_const_float(gallivm, 1.0);
for (i = 0; i < nr_components; ++i) {
LLVMValueRef src_index = LLVMConstInt(LLVMInt32Type(), offset, 0);
LLVMValueRef dst_index = LLVMConstInt(LLVMInt32Type(), i, 0);
LLVMValueRef src_index = lp_build_const_int32(gallivm, offset);
LLVMValueRef dst_index = lp_build_const_int32(gallivm, i);
LLVMValueRef src_tmp;
LLVMValueRef component;
src_tmp = LLVMBuildGEP(builder, ptr, &src_index, 1, "src_tmp");
src_tmp = LLVMBuildGEP(gallivm->builder, ptr, &src_index, 1, "src_tmp");
/* convert src_tmp to float */
component = func(builder, src_tmp);
component = func(gallivm, src_tmp);
/* vec.comp = component */
res = LLVMBuildInsertElement(builder,
res = LLVMBuildInsertElement(gallivm->builder,
res,
component,
dst_index, "");
offset += val_size;
}
for (; i < 4; ++i) {
LLVMValueRef dst_index = LLVMConstInt(LLVMInt32Type(), i, 0);
res = LLVMBuildInsertElement(builder,
LLVMValueRef dst_index = lp_build_const_int32(gallivm, i);
res = LLVMBuildInsertElement(gallivm->builder,
res,
defaults[i],
dst_index, "");
@@ -460,7 +467,7 @@ fetch(LLVMBuilderRef builder,
LLVMValueRef
draw_llvm_translate_from(LLVMBuilderRef builder,
draw_llvm_translate_from(struct gallivm_state *gallivm,
LLVMValueRef vbuffer,
enum pipe_format from_format)
{
@@ -477,7 +484,7 @@ draw_llvm_translate_from(LLVMBuilderRef builder,
for (i = 0; i < Elements(translates); ++i) {
if (translates[i].format == from_format) {
/*LLVMTypeRef type = ll_type_to_llvm(translates[i].type);*/
return fetch(builder,
return fetch(gallivm,
vbuffer,
ll_type_size(translates[i].type),
translates[i].num_components,
@@ -494,6 +501,6 @@ draw_llvm_translate_from(LLVMBuilderRef builder,
*/
format_desc = util_format_description(from_format);
zero = LLVMConstNull(LLVMInt32Type());
return lp_build_fetch_rgba_aos(builder, format_desc, type, vbuffer, zero, zero, zero);
zero = LLVMConstNull(LLVMInt32TypeInContext(gallivm->context));
return lp_build_fetch_rgba_aos(gallivm, format_desc, type, vbuffer, zero, zero, zero);
}

View File

@@ -406,6 +406,7 @@ aaline_create_texture(struct aaline_stage *aaline)
texTemp.width0 = 1 << MAX_TEXTURE_LEVEL;
texTemp.height0 = 1 << MAX_TEXTURE_LEVEL;
texTemp.depth0 = 1;
texTemp.array_size = 1;
texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
aaline->texture = screen->resource_create(screen, &texTemp);
@@ -441,10 +442,10 @@ aaline_create_texture(struct aaline_stage *aaline)
/* This texture is new, no need to flush.
*/
transfer = pipe->get_transfer(pipe,
aaline->texture,
u_subresource(0, level),
PIPE_TRANSFER_WRITE,
&box);
aaline->texture,
level,
PIPE_TRANSFER_WRITE,
&box);
data = pipe->transfer_map(pipe, transfer);
if (data == NULL)
@@ -688,10 +689,9 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
aaline->tex_slot = draw_current_shader_outputs(draw);
aaline->pos_slot = draw_current_shader_position_output(draw);;
/* advertise the extra post-transformed vertex attribute */
draw->extra_shader_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
draw->extra_shader_outputs.semantic_index = aaline->fs->generic_attrib;
draw->extra_shader_outputs.slot = aaline->tex_slot;
/* allocate the extra post-transformed vertex attribute */
(void) draw_alloc_extra_vertex_attrib(draw, TGSI_SEMANTIC_GENERIC,
aaline->fs->generic_attrib);
/* how many samplers? */
/* we'll use sampler/texture[pstip->sampler_unit] for the stipple */
@@ -744,7 +744,7 @@ aaline_flush(struct draw_stage *stage, unsigned flags)
draw->suspend_flushing = FALSE;
draw->extra_shader_outputs.slot = 0;
draw_remove_extra_vertex_attribs(draw);
}

View File

@@ -701,9 +701,9 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
aapoint->pos_slot = draw_current_shader_position_output(draw);
draw->extra_shader_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
draw->extra_shader_outputs.semantic_index = aapoint->fs->generic_attrib;
draw->extra_shader_outputs.slot = aapoint->tex_slot;
/* allocate the extra post-transformed vertex attribute */
(void) draw_alloc_extra_vertex_attrib(draw, TGSI_SEMANTIC_GENERIC,
aapoint->fs->generic_attrib);
/* find psize slot in post-transform vertex */
aapoint->psize_slot = -1;
@@ -754,7 +754,7 @@ aapoint_flush(struct draw_stage *stage, unsigned flags)
draw->suspend_flushing = FALSE;
draw->extra_shader_outputs.slot = 0;
draw_remove_extra_vertex_attribs(draw);
}

View File

@@ -163,6 +163,7 @@ static void interp( const struct clip_stage *clip,
*/
static void emit_poly( struct draw_stage *stage,
struct vertex_header **inlist,
const boolean *edgeflags,
unsigned n,
const struct prim_header *origPrim)
{
@@ -181,6 +182,9 @@ static void emit_poly( struct draw_stage *stage,
edge_last = DRAW_PIPE_EDGE_FLAG_1;
}
if (!edgeflags[0])
edge_first = 0;
/* later stages may need the determinant, but only the sign matters */
header.det = origPrim->det;
header.flags = DRAW_PIPE_RESET_STIPPLE | edge_first | edge_middle;
@@ -199,7 +203,11 @@ static void emit_poly( struct draw_stage *stage,
header.v[2] = inlist[0]; /* the provoking vertex */
}
if (i == n-1)
if (!edgeflags[i-1]) {
header.flags &= ~edge_middle;
}
if (i == n - 1 && edgeflags[i])
header.flags |= edge_last;
if (0) {
@@ -248,40 +256,72 @@ do_clip_tri( struct draw_stage *stage,
unsigned tmpnr = 0;
unsigned n = 3;
unsigned i;
boolean aEdges[MAX_CLIPPED_VERTICES];
boolean bEdges[MAX_CLIPPED_VERTICES];
boolean *inEdges = aEdges;
boolean *outEdges = bEdges;
inlist[0] = header->v[0];
inlist[1] = header->v[1];
inlist[2] = header->v[2];
/*
* Note: at this point we can't just use the per-vertex edge flags.
* We have to observe the edge flag bits set in header->flags which
* were set during primitive decomposition. Put those flags into
* an edge flags array which parallels the vertex array.
* Later, in the 'unfilled' pipeline stage we'll draw the edge if both
* the header.flags bit is set AND the per-vertex edgeflag field is set.
*/
inEdges[0] = !!(header->flags & DRAW_PIPE_EDGE_FLAG_0);
inEdges[1] = !!(header->flags & DRAW_PIPE_EDGE_FLAG_1);
inEdges[2] = !!(header->flags & DRAW_PIPE_EDGE_FLAG_2);
while (clipmask && n >= 3) {
const unsigned plane_idx = ffs(clipmask)-1;
const boolean is_user_clip_plane = plane_idx >= 6;
const float *plane = clipper->plane[plane_idx];
struct vertex_header *vert_prev = inlist[0];
boolean *edge_prev = &inEdges[0];
float dp_prev = dot4( vert_prev->clip, plane );
unsigned outcount = 0;
clipmask &= ~(1<<plane_idx);
assert(n < MAX_CLIPPED_VERTICES);
if (n >= MAX_CLIPPED_VERTICES)
return;
inlist[n] = inlist[0]; /* prevent rotation of vertices */
inEdges[n] = inEdges[0];
for (i = 1; i <= n; i++) {
struct vertex_header *vert = inlist[i];
boolean *edge = &inEdges[i];
float dp = dot4( vert->clip, plane );
if (!IS_NEGATIVE(dp_prev)) {
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
return;
outEdges[outcount] = *edge_prev;
outlist[outcount++] = vert_prev;
}
if (DIFFERENT_SIGNS(dp, dp_prev)) {
struct vertex_header *new_vert;
boolean *new_edge;
assert(tmpnr < MAX_CLIPPED_VERTICES+1);
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
return;
new_vert = clipper->stage.tmp[tmpnr++];
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
return;
new_edge = &outEdges[outcount];
outlist[outcount++] = new_vert;
if (IS_NEGATIVE(dp)) {
@@ -291,10 +331,22 @@ do_clip_tri( struct draw_stage *stage,
float t = dp / (dp - dp_prev);
interp( clipper, new_vert, t, vert, vert_prev );
/* Force edgeflag true in this case:
/* Whether or not to set edge flag for the new vert depends
* on whether it's a user-defined clipping plane. We're
* copying NVIDIA's behaviour here.
*/
new_vert->edgeflag = 1;
} else {
if (is_user_clip_plane) {
/* we want to see an edge along the clip plane */
*new_edge = TRUE;
new_vert->edgeflag = TRUE;
}
else {
/* we don't want to see an edge along the frustum clip plane */
*new_edge = *edge_prev;
new_vert->edgeflag = FALSE;
}
}
else {
/* Coming back in.
*/
float t = dp_prev / (dp_prev - dp);
@@ -303,10 +355,12 @@ do_clip_tri( struct draw_stage *stage,
/* Copy starting vert's edgeflag:
*/
new_vert->edgeflag = vert_prev->edgeflag;
*new_edge = *edge_prev;
}
}
vert_prev = vert;
edge_prev = edge;
dp_prev = dp;
}
@@ -317,31 +371,42 @@ do_clip_tri( struct draw_stage *stage,
outlist = tmp;
n = outcount;
}
{
boolean *tmp = inEdges;
inEdges = outEdges;
outEdges = tmp;
}
}
/* If flat-shading, copy provoking vertex color to polygon vertex[0]
*/
if (clipper->flat) {
if (stage->draw->rasterizer->flatshade_first) {
if (inlist[0] != header->v[0]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
copy_colors(stage, inlist[0], header->v[0]);
}
}
else {
if (inlist[0] != header->v[2]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
copy_colors(stage, inlist[0], header->v[2]);
if (n >= 3) {
if (clipper->flat) {
if (stage->draw->rasterizer->flatshade_first) {
if (inlist[0] != header->v[0]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
return;
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
copy_colors(stage, inlist[0], header->v[0]);
}
}
else {
if (inlist[0] != header->v[2]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
return;
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
copy_colors(stage, inlist[0], header->v[2]);
}
}
}
/* Emit the polygon as triangles to the setup stage:
*/
emit_poly( stage, inlist, inEdges, n, header );
}
/* Emit the polygon as triangles to the setup stage:
*/
if (n >= 3)
emit_poly( stage, inlist, n, header );
}

View File

@@ -393,8 +393,8 @@ pstip_update_texture(struct pstip_stage *pstip)
*/
pipe->flush( pipe, PIPE_FLUSH_TEXTURE_CACHE, NULL );
transfer = pipe_get_transfer(pipe, pstip->texture, 0, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0, 32, 32);
transfer = pipe_get_transfer(pipe, pstip->texture, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0, 32, 32);
data = pipe->transfer_map(pipe, transfer);
/*
@@ -440,6 +440,7 @@ pstip_create_texture(struct pstip_stage *pstip)
texTemp.width0 = 32;
texTemp.height0 = 32;
texTemp.depth0 = 1;
texTemp.array_size = 1;
texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
pstip->texture = screen->resource_create(screen, &texTemp);

View File

@@ -172,7 +172,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
wide_lines = (rast->line_width > draw->pipeline.wide_line_threshold
&& !rast->line_smooth);
/* drawing large points? */
/* drawing large/sprite points (but not AA points)? */
if (rast->sprite_coord_enable && draw->pipeline.point_sprite)
wide_points = TRUE;
else if (rast->point_smooth && draw->pipeline.aapoint)
@@ -207,7 +207,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
precalc_flat = TRUE;
}
if (wide_points || rast->sprite_coord_enable) {
if (wide_points) {
draw->pipeline.wide_point->next = next;
next = draw->pipeline.wide_point;
}

View File

@@ -57,26 +57,24 @@
#include "util/u_memory.h"
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
#include "draw_fs.h"
#include "draw_vs.h"
#include "draw_pipe.h"
struct widepoint_stage {
struct draw_stage stage;
struct draw_stage stage; /**< base class */
float half_point_size;
float xbias;
float ybias;
uint texcoord_slot[PIPE_MAX_SHADER_OUTPUTS];
uint texcoord_enable[PIPE_MAX_SHADER_OUTPUTS];
uint num_texcoords;
uint texcoord_mode;
/** for automatic texcoord generation/replacement */
uint num_texcoord_gen;
uint texcoord_gen_slot[PIPE_MAX_SHADER_OUTPUTS];
int psize_slot;
int point_coord_fs_input; /**< input for pointcoord */
};
@@ -96,30 +94,20 @@ widepoint_stage( struct draw_stage *stage )
static void set_texcoords(const struct widepoint_stage *wide,
struct vertex_header *v, const float tc[4])
{
const struct draw_context *draw = wide->stage.draw;
const struct pipe_rasterizer_state *rast = draw->rasterizer;
const uint texcoord_mode = rast->sprite_coord_mode;
uint i;
for (i = 0; i < wide->num_texcoords; i++) {
if (wide->texcoord_enable[i]) {
uint j = wide->texcoord_slot[i];
v->data[j][0] = tc[0];
if (wide->texcoord_mode == PIPE_SPRITE_COORD_LOWER_LEFT)
v->data[j][1] = 1.0f - tc[1];
else
v->data[j][1] = tc[1];
v->data[j][2] = tc[2];
v->data[j][3] = tc[3];
}
}
if (wide->point_coord_fs_input >= 0) {
/* put gl_PointCoord into the extra vertex slot */
uint slot = wide->stage.draw->extra_shader_outputs.slot;
for (i = 0; i < wide->num_texcoord_gen; i++) {
const uint slot = wide->texcoord_gen_slot[i];
v->data[slot][0] = tc[0];
if (wide->texcoord_mode == PIPE_SPRITE_COORD_LOWER_LEFT)
if (texcoord_mode == PIPE_SPRITE_COORD_LOWER_LEFT)
v->data[slot][1] = 1.0f - tc[1];
else
v->data[slot][1] = tc[1];
v->data[slot][2] = 0.0F;
v->data[slot][3] = 1.0F;
v->data[slot][2] = tc[2];
v->data[slot][3] = tc[3];
}
}
@@ -201,18 +189,9 @@ static void widepoint_point( struct draw_stage *stage,
}
static int
find_pntc_input_attrib(struct draw_context *draw)
{
/* Scan the fragment program's input decls to find the pointcoord
* attribute. The xy components will store the point coord.
*/
return 0; /* XXX fix this */
}
static void widepoint_first_point( struct draw_stage *stage,
struct prim_header *header )
static void
widepoint_first_point(struct draw_stage *stage,
struct prim_header *header)
{
struct widepoint_stage *wide = widepoint_stage(stage);
struct draw_context *draw = stage->draw;
@@ -244,31 +223,49 @@ static void widepoint_first_point( struct draw_stage *stage,
stage->point = draw_pipe_passthrough_point;
}
draw_remove_extra_vertex_attribs(draw);
if (rast->point_quad_rasterization) {
/* find vertex shader texcoord outputs */
const struct draw_vertex_shader *vs = draw->vs.vertex_shader;
uint i, j = 0;
wide->texcoord_mode = rast->sprite_coord_mode;
for (i = 0; i < vs->info.num_outputs; i++) {
if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_GENERIC) {
wide->texcoord_slot[j] = i;
wide->texcoord_enable[j] = (rast->sprite_coord_enable >> j) & 1;
j++;
const struct draw_fragment_shader *fs = draw->fs.fragment_shader;
uint i;
wide->num_texcoord_gen = 0;
/* Loop over fragment shader inputs looking for generic inputs
* for which bit 'k' in sprite_coord_enable is set.
*/
for (i = 0; i < fs->info.num_inputs; i++) {
if (fs->info.input_semantic_name[i] == TGSI_SEMANTIC_GENERIC) {
const int generic_index = fs->info.input_semantic_index[i];
/* Note that sprite_coord enable is a bitfield of
* PIPE_MAX_SHADER_OUTPUTS bits.
*/
if (generic_index < PIPE_MAX_SHADER_OUTPUTS &&
(rast->sprite_coord_enable & (1 << generic_index))) {
/* OK, this generic attribute needs to be replaced with a
* texcoord (see above).
*/
int slot = draw_find_shader_output(draw,
TGSI_SEMANTIC_GENERIC,
generic_index);
if (slot > 0) {
/* there's already a post-vertex shader attribute
* for this fragment shader input attribute.
*/
}
else {
/* need to allocate a new post-vertex shader attribute */
slot = draw_alloc_extra_vertex_attrib(draw,
TGSI_SEMANTIC_GENERIC,
generic_index);
}
/* add this slot to the texcoord-gen list */
wide->texcoord_gen_slot[wide->num_texcoord_gen++] = slot;
}
}
}
wide->num_texcoords = j;
/* find fragment shader PointCoord input */
wide->point_coord_fs_input = find_pntc_input_attrib(draw);
/* setup extra vp output (point coord implemented as a texcoord) */
draw->extra_shader_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
draw->extra_shader_outputs.semantic_index = 0;
draw->extra_shader_outputs.slot = draw_current_shader_outputs(draw);
}
else {
wide->point_coord_fs_input = -1;
draw->extra_shader_outputs.slot = 0;
}
wide->psize_slot = -1;
@@ -295,7 +292,8 @@ static void widepoint_flush( struct draw_stage *stage, unsigned flags )
stage->point = widepoint_first_point;
stage->next->flush( stage->next, flags );
stage->draw->extra_shader_outputs.slot = 0;
draw_remove_extra_vertex_attribs(draw);
/* restore original rasterizer state */
if (draw->rast_handle) {

View File

@@ -169,6 +169,9 @@ struct draw_context
unsigned vs_constants_size[PIPE_MAX_CONSTANT_BUFFERS];
const void *gs_constants[PIPE_MAX_CONSTANT_BUFFERS];
unsigned gs_constants_size[PIPE_MAX_CONSTANT_BUFFERS];
/* pointer to planes */
float (*planes)[12][4];
} user;
boolean test_fse; /* enable FSE even though its not correct (eg for softpipe) */
@@ -250,6 +253,11 @@ struct draw_context
struct tgsi_sampler **samplers;
} gs;
/** Fragment shader state */
struct {
struct draw_fragment_shader *fragment_shader;
} fs;
/** Stream output (vertex feedback) state */
struct {
struct pipe_stream_output_state state;
@@ -266,9 +274,10 @@ struct draw_context
/* If a prim stage introduces new vertex attributes, they'll be stored here
*/
struct {
uint semantic_name;
uint semantic_index;
int slot;
uint num;
uint semantic_name[10];
uint semantic_index[10];
uint slot[10];
} extra_shader_outputs;
unsigned reduced_prim;
@@ -277,7 +286,6 @@ struct draw_context
#ifdef HAVE_LLVM
struct draw_llvm *llvm;
LLVMExecutionEngineRef engine;
#endif
struct pipe_sampler_view *sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
@@ -362,6 +370,11 @@ void draw_gs_destroy( struct draw_context *draw );
uint draw_current_shader_outputs(const struct draw_context *draw);
uint draw_current_shader_position_output(const struct draw_context *draw);
int draw_alloc_extra_vertex_attrib(struct draw_context *draw,
uint semantic_name, uint semantic_index);
void draw_remove_extra_vertex_attribs(struct draw_context *draw);
/*******************************************************************************
* Vertex processing (was passthrough) code:
*/

View File

@@ -287,6 +287,84 @@ draw_print_arrays(struct draw_context *draw, uint prim, int start, uint count)
}
/** Helper code for below */
#define PRIM_RESTART_LOOP(elements) \
do { \
for (i = start; i < end; i++) { \
if (elements[i] == info->restart_index) { \
if (cur_count > 0) { \
/* draw elts up to prev pos */ \
draw_pt_arrays(draw, prim, cur_start, cur_count); \
} \
/* begin new prim at next elt */ \
cur_start = i + 1; \
cur_count = 0; \
} \
else { \
cur_count++; \
} \
} \
if (cur_count > 0) { \
draw_pt_arrays(draw, prim, cur_start, cur_count); \
} \
} while (0)
/**
* For drawing prims with primitive restart enabled.
* Scan for restart indexes and draw the runs of elements/vertices between
* the restarts.
*/
static void
draw_pt_arrays_restart(struct draw_context *draw,
const struct pipe_draw_info *info)
{
const unsigned prim = info->mode;
const unsigned start = info->start;
const unsigned count = info->count;
const unsigned end = start + count;
unsigned i, cur_start, cur_count;
assert(info->primitive_restart);
if (draw->pt.user.elts) {
/* indexed prims (draw_elements) */
cur_start = start;
cur_count = 0;
switch (draw->pt.user.eltSize) {
case 1:
{
const ubyte *elt_ub = (const ubyte *) draw->pt.user.elts;
PRIM_RESTART_LOOP(elt_ub);
}
break;
case 2:
{
const ushort *elt_us = (const ushort *) draw->pt.user.elts;
PRIM_RESTART_LOOP(elt_us);
}
break;
case 4:
{
const uint *elt_ui = (const uint *) draw->pt.user.elts;
PRIM_RESTART_LOOP(elt_ui);
}
break;
default:
assert(0 && "bad eltSize in draw_arrays()");
}
}
else {
/* Non-indexed prims (draw_arrays).
* Primitive restart should have been handled in the state tracker.
*/
draw_pt_arrays(draw, prim, start, count);
}
}
/**
* Non-instanced drawing.
* \sa draw_arrays_instanced
@@ -395,6 +473,12 @@ draw_vbo(struct draw_context *draw,
for (instance = 0; instance < info->instance_count; instance++) {
draw->instance_id = instance + info->start_instance;
draw_pt_arrays(draw, info->mode, info->start, info->count);
if (info->primitive_restart) {
draw_pt_arrays_restart(draw, info);
}
else {
draw_pt_arrays(draw, info->mode, info->start, info->count);
}
}
}

View File

@@ -34,6 +34,7 @@
#include "draw/draw_pt.h"
#include "draw/draw_vs.h"
#include "draw/draw_llvm.h"
#include "gallivm/lp_bld_init.h"
struct llvm_middle_end {
@@ -72,19 +73,18 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
struct draw_llvm_variant_list_item *li;
unsigned i;
unsigned instance_id_index = ~0;
unsigned out_prim = (draw->gs.geometry_shader ?
draw->gs.geometry_shader->output_primitive :
in_prim);
const unsigned out_prim = (draw->gs.geometry_shader ?
draw->gs.geometry_shader->output_primitive :
in_prim);
/* Add one to num_outputs because the pipeline occasionally tags on
* an additional texcoord, eg for AA lines.
*/
unsigned nr = MAX2( shader->base.info.num_inputs,
shader->base.info.num_outputs + 1 );
const unsigned nr = MAX2( shader->base.info.num_inputs,
shader->base.info.num_outputs + 1 );
/* Scan for instanceID system value.
* XXX but we never use instance_id_index?!
*/
for (i = 0; i < shader->base.info.num_inputs; i++) {
if (shader->base.info.input_semantic_name[i] == TGSI_SEMANTIC_INSTANCEID) {
@@ -133,9 +133,10 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
key = draw_llvm_make_variant_key(fpme->llvm, store);
/* Search shader's list of variants for the key */
li = first_elem(&shader->variants);
while(!at_end(&shader->variants, li)) {
if(memcmp(&li->base->key, key, shader->variant_key_size) == 0) {
while (!at_end(&shader->variants, li)) {
if (memcmp(&li->base->key, key, shader->variant_key_size) == 0) {
variant = li->base;
break;
}
@@ -143,10 +144,16 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
}
if (variant) {
/* found the variant, move to head of global list (for LRU) */
move_to_head(&fpme->llvm->vs_variants_list, &variant->list_item_global);
}
else {
/* Need to create new variant */
unsigned i;
/* First check if we've created too many variants. If so, free
* 25% of the LRU to avoid using too much memory.
*/
if (fpme->llvm->nr_variants >= DRAW_MAX_SHADER_VARIANTS) {
/*
* XXX: should we flush here ?
@@ -175,6 +182,11 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
draw->pt.user.vs_constants[0];
fpme->llvm->jit_context.gs_constants =
draw->pt.user.gs_constants[0];
fpme->llvm->jit_context.planes =
(float (*) [12][4]) draw->pt.user.planes[0];
fpme->llvm->jit_context.viewport =
(float *)draw->viewport.scale;
}
@@ -217,6 +229,7 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
struct draw_vertex_info gs_vert_info;
struct draw_vertex_info *vert_info;
unsigned opt = fpme->opt;
unsigned clipped = 0;
llvm_vert_info.count = fetch_info->count;
llvm_vert_info.vertex_size = fpme->vertex_size;
@@ -230,7 +243,7 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
}
if (fetch_info->linear)
fpme->current_variant->jit_func( &fpme->llvm->jit_context,
clipped = fpme->current_variant->jit_func( &fpme->llvm->jit_context,
llvm_vert_info.verts,
(const char **)draw->pt.user.vbuffer,
fetch_info->start,
@@ -239,7 +252,7 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
draw->pt.vertex_buffer,
draw->instance_id);
else
fpme->current_variant->jit_func_elts( &fpme->llvm->jit_context,
clipped = fpme->current_variant->jit_func_elts( &fpme->llvm->jit_context,
llvm_vert_info.verts,
(const char **)draw->pt.user.vbuffer,
fetch_info->elts,
@@ -266,6 +279,9 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
FREE(vert_info->verts);
vert_info = &gs_vert_info;
prim_info = &gs_prim_info;
clipped = draw_pt_post_vs_run( fpme->post_vs, vert_info );
}
/* stream output needs to be done before clipping */
@@ -273,11 +289,11 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
vert_info,
prim_info );
if (draw_pt_post_vs_run( fpme->post_vs, vert_info )) {
if (clipped) {
opt |= PT_PIPELINE;
}
/* Do we need to run the pipeline?
/* Do we need to run the pipeline? Now will come here if clipped
*/
if (opt & PT_PIPELINE) {
pipeline( fpme,
@@ -413,7 +429,7 @@ draw_pt_fetch_pipeline_or_emit_llvm(struct draw_context *draw)
{
struct llvm_middle_end *fpme = 0;
if (!draw->engine)
if (!draw->llvm->gallivm->engine)
return NULL;
fpme = CALLOC_STRUCT( llvm_middle_end );

Some files were not shown because too many files have changed in this diff Show More