Compare commits

...

305 Commits

Author SHA1 Message Date
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
282 changed files with 19137 additions and 15584 deletions

View File

@@ -180,7 +180,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.10-devel
VERSION=7.10.2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -209,7 +209,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 \
@@ -308,8 +307,7 @@ MAPI_FILES = \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(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 \

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@

View File

@@ -82,9 +82,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 +116,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)

View File

@@ -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

@@ -572,10 +572,6 @@ xno)
;;
esac
PKG_CHECK_MODULES([TALLOC], [talloc])
AC_SUBST([TALLOC_LIBS])
AC_SUBST([TALLOC_CFLAGS])
dnl
dnl Driver specific build directories
dnl
@@ -714,8 +710,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
@@ -964,7 +960,7 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
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])
@@ -1040,12 +1036,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])
@@ -1352,7 +1348,7 @@ if test "x$enable_gallium_egl" = xauto; then
enable_gallium_egl=$enable_egl
;;
*)
enable_gallium_egl=no
enable_gallium_egl=$enable_openvg
;;
esac
fi
@@ -1467,10 +1463,6 @@ 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

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,10 +19,7 @@ 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>
@@ -86,16 +83,19 @@ select the right platforms automatically.</p>
<li><code>--enable-gles1</code> and <code>--enable-gles2</code>
<p>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 libraries. This is an alternative
approach to enable OpenGL ES. It is only supported by
<code>egl_gallium</code>.</p>
<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>
@@ -134,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>
@@ -180,8 +190,10 @@ variable to true forces the use of software rendering.</p>
<li><code>egl_dri2</code>
<p>This driver supports both <code>x11</code> and <code>drm</code> platforms.
It functions as a DRI2 driver loader. For <code>x11</code> support, it talks
to the X server directly using (XCB-)DRI2 protocol.</p>
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>
@@ -191,6 +203,10 @@ to the X server directly using (XCB-)DRI2 protocol.</p>
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
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>
<li><code>egl_glx</code>
@@ -202,6 +218,21 @@ is not available in GLX or GLX extensions.</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

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

@@ -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">

View File

@@ -11,6 +11,39 @@
<H1>News</H1>
<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 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 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>

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>

201
docs/relnotes-7.10.2.html Normal file
View File

@@ -0,0 +1,201 @@
<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 / TBD</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>
TBD
</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>

File diff suppressed because it is too large Load Diff

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

@@ -13,6 +13,10 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<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>

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

@@ -4,7 +4,6 @@ SConscript('mapi/vgapi/SConscript')
if env['platform'] == 'windows':
SConscript('egl/main/SConscript')
SConscript('talloc/SConscript')
SConscript('glsl/SConscript')
SConscript('mapi/glapi/SConscript')

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

@@ -258,9 +258,10 @@ vsplit_segment_fan_linear(struct vsplit_frontend *vsplit, unsigned flags,
boolean use_spoken = ((flags & DRAW_SPLIT_BEFORE) != 0);
unsigned nr = 0, i;
assert(icount + !!use_spoken <= vsplit->segment_size);
assert(icount <= vsplit->segment_size);
if (use_spoken) {
/* replace istart by i0 */
vsplit->fetch_elts[nr++] = i0;
for (i = 1 ; i < icount; i++)
vsplit->fetch_elts[nr++] = istart + i;

View File

@@ -65,19 +65,7 @@ static void
vs_llvm_delete( struct draw_vertex_shader *dvs )
{
struct llvm_vertex_shader *shader = llvm_vertex_shader(dvs);
struct pipe_fence_handle *fence = NULL;
struct draw_llvm_variant_list_item *li;
struct pipe_context *pipe = dvs->draw->pipe;
/*
* XXX: This might be not neccessary at all.
*/
pipe->flush(pipe, 0, &fence);
if (fence) {
pipe->screen->fence_finish(pipe->screen, fence, 0);
pipe->screen->fence_reference(pipe->screen, &fence, NULL);
}
li = first_elem(&shader->variants);
while(!at_end(&shader->variants, li)) {

View File

@@ -125,4 +125,22 @@ lp_build_const_float(struct gallivm_state *gallivm, float x)
}
/** Return constant-valued pointer to int */
static INLINE LLVMValueRef
lp_build_const_int_pointer(struct gallivm_state *gallivm, const void *ptr)
{
LLVMTypeRef int_type;
LLVMValueRef v;
/* int type large enough to hold a pointer */
int_type = LLVMIntTypeInContext(gallivm->context, 8 * sizeof(void *));
v = LLVMConstInt(int_type, (unsigned long long) ptr, 0);
v = LLVMBuildIntToPtr(gallivm->builder, v,
LLVMPointerType(int_type, 0),
"cast int to ptr");
return v;
}
#endif /* !LP_BLD_CONST_H */

View File

@@ -36,6 +36,7 @@
#include "util/u_format.h"
#include "util/u_memory.h"
#include "util/u_math.h"
#include "util/u_pointer.h"
#include "util/u_string.h"
#include "lp_bld_arit.h"
@@ -520,6 +521,7 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
LLVMValueRef tmp_ptr;
LLVMValueRef tmp;
LLVMValueRef res;
LLVMValueRef callee;
unsigned k;
util_snprintf(name, sizeof name, "util_format_%s_fetch_rgba_8unorm",
@@ -535,6 +537,10 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
function = LLVMGetNamedFunction(module, name);
if (!function) {
/*
* Function to call looks like:
* fetch(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
*/
LLVMTypeRef ret_type;
LLVMTypeRef arg_types[4];
LLVMTypeRef function_type;
@@ -542,19 +548,26 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
ret_type = LLVMVoidTypeInContext(gallivm->context);
arg_types[0] = pi8t;
arg_types[1] = pi8t;
arg_types[3] = arg_types[2] = LLVMIntTypeInContext(gallivm->context, sizeof(unsigned) * 8);
function_type = LLVMFunctionType(ret_type, arg_types, Elements(arg_types), 0);
arg_types[2] = i32t;
arg_types[3] = i32t;
function_type = LLVMFunctionType(ret_type, arg_types,
Elements(arg_types), 0);
function = LLVMAddFunction(module, name, function_type);
LLVMSetFunctionCallConv(function, LLVMCCallConv);
LLVMSetLinkage(function, LLVMExternalLinkage);
assert(LLVMIsDeclaration(function));
LLVMAddGlobalMapping(gallivm->engine, function,
func_to_pointer((func_pointer)format_desc->fetch_rgba_8unorm));
}
/* make const pointer for the C fetch_rgba_float function */
callee = lp_build_const_int_pointer(gallivm,
func_to_pointer((func_pointer) format_desc->fetch_rgba_8unorm));
/* cast the callee pointer to the function's type */
function = LLVMBuildBitCast(builder, callee,
LLVMTypeOf(function), "cast callee");
tmp_ptr = lp_build_alloca(gallivm, i32t, "");
res = LLVMGetUndef(LLVMVectorType(i32t, num_pixels));
@@ -619,10 +632,13 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
LLVMTypeRef f32t = LLVMFloatTypeInContext(gallivm->context);
LLVMTypeRef f32x4t = LLVMVectorType(f32t, 4);
LLVMTypeRef pf32t = LLVMPointerType(f32t, 0);
LLVMTypeRef pi8t = LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0);
LLVMTypeRef i32t = LLVMInt32TypeInContext(gallivm->context);
LLVMValueRef function;
LLVMValueRef tmp_ptr;
LLVMValueRef tmps[LP_MAX_VECTOR_LENGTH/4];
LLVMValueRef res;
LLVMValueRef callee;
unsigned k;
util_snprintf(name, sizeof name, "util_format_%s_fetch_rgba_float",
@@ -638,26 +654,42 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
function = LLVMGetNamedFunction(module, name);
if (!function) {
/*
* Function to call looks like:
* fetch(float *dst, const uint8_t *src, unsigned i, unsigned j)
*/
LLVMTypeRef ret_type;
LLVMTypeRef arg_types[4];
LLVMTypeRef function_type;
ret_type = LLVMVoidTypeInContext(gallivm->context);
arg_types[0] = pf32t;
arg_types[1] = LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0);
arg_types[3] = arg_types[2] = LLVMIntTypeInContext(gallivm->context, sizeof(unsigned) * 8);
function_type = LLVMFunctionType(ret_type, arg_types, Elements(arg_types), 0);
arg_types[1] = pi8t;
arg_types[2] = i32t;
arg_types[3] = i32t;
function_type = LLVMFunctionType(ret_type, arg_types,
Elements(arg_types), 0);
function = LLVMAddFunction(module, name, function_type);
LLVMSetFunctionCallConv(function, LLVMCCallConv);
LLVMSetLinkage(function, LLVMExternalLinkage);
assert(LLVMIsDeclaration(function));
LLVMAddGlobalMapping(gallivm->engine, function,
func_to_pointer((func_pointer)format_desc->fetch_rgba_float));
}
/* Note: we're using this casting here instead of LLVMAddGlobalMapping()
* to work around a bug in LLVM 2.6.
*/
/* make const pointer for the C fetch_rgba_float function */
callee = lp_build_const_int_pointer(gallivm,
func_to_pointer((func_pointer) format_desc->fetch_rgba_float));
/* cast the callee pointer to the function's type */
function = LLVMBuildBitCast(builder, callee,
LLVMTypeOf(function), "cast callee");
tmp_ptr = lp_build_alloca(gallivm, f32x4t, "");
/*

View File

@@ -1064,6 +1064,8 @@ lp_setup_begin_query(struct lp_setup_context *setup,
{
/* init the query to its beginning state */
assert(setup->active_query == NULL);
set_scene_state(setup, SETUP_ACTIVE, "begin_query");
if (setup->scene) {
if (!lp_scene_bin_everywhere(setup->scene,
@@ -1093,6 +1095,8 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
{
union lp_rast_cmd_arg dummy = { 0 };
set_scene_state(setup, SETUP_ACTIVE, "end_query");
assert(setup->active_query == pq);
setup->active_query = NULL;

View File

@@ -1130,7 +1130,7 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn,
case TGSI_FILE_INPUT:
res = bld_saved_input(bld, idx, swz);
if (res && (insn->Instruction.Opcode != TGSI_OPCODE_TXP))
return res;
break;
res = new_value(bld->pc, bld->ti->input_file, type);
res->reg.id = bld->ti->input_map[idx][swz];

View File

@@ -35,7 +35,9 @@
#include "r300_screen_buffer.h"
#include "r300_winsys.h"
#include <inttypes.h>
#ifdef HAVE_LLVM
#include "gallivm/lp_bld_init.h"
#endif
static void r300_update_num_contexts(struct r300_screen *r300screen,
int diff)
@@ -103,9 +105,14 @@ static void r300_destroy_context(struct pipe_context* context)
if (r300->blitter)
util_blitter_destroy(r300->blitter);
if (r300->draw)
if (r300->draw) {
draw_destroy(r300->draw);
#ifdef HAVE_LLVM
gallivm_destroy(r300->gallivm);
#endif
}
if (r300->upload_vb)
u_upload_destroy(r300->upload_vb);
if (r300->upload_ib)
@@ -424,7 +431,12 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
if (!r300screen->caps.has_tcl) {
/* Create a Draw. This is used for SW TCL. */
#ifdef HAVE_LLVM
r300->gallivm = gallivm_create();
r300->draw = draw_create_gallivm(&r300->context, r300->gallivm);
#else
r300->draw = draw_create(&r300->context);
#endif
if (r300->draw == NULL)
goto fail;
/* Enable our renderer. */

View File

@@ -459,6 +459,7 @@ struct r300_context {
struct r300_screen *screen;
/* Draw module. Used mostly for SW TCL. */
struct gallivm_state *gallivm;
struct draw_context* draw;
/* Vertex buffer for SW TCL. */
struct pipe_resource* vbo;

View File

@@ -494,6 +494,11 @@ void r300_emit_fb_state_pipelined(struct r300_context *r300,
for (i = 0; i < fb->nr_cbufs; i++) {
OUT_CS(r300_surface(fb->cbufs[i])->format);
}
for (; i < 1; i++) {
OUT_CS(R300_US_OUT_FMT_C4_8 |
R300_C0_SEL_B | R300_C1_SEL_G |
R300_C2_SEL_R | R300_C3_SEL_A);
}
for (; i < 4; i++) {
OUT_CS(R300_US_OUT_FMT_UNUSED);
}

View File

@@ -34,6 +34,10 @@
#include "draw/draw_context.h"
#ifdef HAVE_LLVM
#include "gallivm/lp_bld_init.h"
#endif
/* Return the identifier behind whom the brave coders responsible for this
* amalgamation of code, sweat, and duct tape, routinely obscure their names.
*
@@ -209,7 +213,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
case PIPE_SHADER_CAP_MAX_PREDS:
return is_r500 ? 1 : 0;
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
return 1;
return 0;
case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
@@ -247,7 +251,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
case PIPE_SHADER_CAP_MAX_PREDS:
return is_r500 ? 4 : 0; /* XXX guessed. */
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
return 1;
return 0;
case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
@@ -484,5 +488,9 @@ struct pipe_screen* r300_screen_create(struct r300_winsys_screen *rws)
util_format_s3tc_init();
#ifdef HAVE_LLVM
lp_build_init();
#endif
return &r300screen->screen;
}

View File

@@ -119,6 +119,7 @@ int r300_upload_user_buffers(struct r300_context *r300)
vb->buffer = upload_buffer;
vb->buffer_offset = upload_offset;
r300->validate_buffers = TRUE;
r300->aos_dirty = TRUE;
}
}
return ret;

View File

@@ -1298,29 +1298,27 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe,
}
for (i = 0; i < count; i++) {
if (&state->sampler_views[i]->base != views[i]) {
pipe_sampler_view_reference(
(struct pipe_sampler_view**)&state->sampler_views[i],
views[i]);
pipe_sampler_view_reference(
(struct pipe_sampler_view**)&state->sampler_views[i],
views[i]);
if (!views[i]) {
continue;
}
/* A new sampler view (= texture)... */
dirty_tex = TRUE;
/* Set the texrect factor in the fragment shader.
* Needed for RECT and NPOT fallback. */
texture = r300_texture(views[i]->texture);
if (texture->desc.is_npot) {
r300_mark_atom_dirty(r300, &r300->fs_rc_constant_state);
}
state->sampler_views[i]->texcache_region =
r300_assign_texture_cache_region(view_index, real_num_views);
view_index++;
if (!views[i]) {
continue;
}
/* A new sampler view (= texture)... */
dirty_tex = TRUE;
/* Set the texrect factor in the fragment shader.
* Needed for RECT and NPOT fallback. */
texture = r300_texture(views[i]->texture);
if (texture->desc.is_npot) {
r300_mark_atom_dirty(r300, &r300->fs_rc_constant_state);
}
state->sampler_views[i]->texcache_region =
r300_assign_texture_cache_region(view_index, real_num_views);
view_index++;
}
for (i = count; i < tex_units; i++) {
@@ -1496,14 +1494,14 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
any_user_buffer = TRUE;
}
/* The stride of zero means we will be fetching only the first
* vertex, so don't care about max_index. */
if (!vbo->stride)
continue;
if (vbo->max_index == ~0) {
/* if no VBO stride then only one vertex value so max index is 1 */
/* should think about converting to VS constants like svga does */
if (!vbo->stride)
vbo->max_index = 1;
else
vbo->max_index =
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
vbo->max_index =
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
}
max_index = MIN2(vbo->max_index, max_index);

View File

@@ -899,7 +899,7 @@ struct pipe_surface* r300_create_surface(struct pipe_context * ctx,
tex->desc.b.b.nr_samples,
tex->desc.microtile,
tex->desc.macrotile[level],
DIM_HEIGHT);
DIM_HEIGHT, 0);
surface->cbzb_height = align((surface->base.height + 1) / 2,
tile_height);

View File

@@ -34,7 +34,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
unsigned num_samples,
enum r300_buffer_tiling microtile,
enum r300_buffer_tiling macrotile,
enum r300_dim dim)
enum r300_dim dim, boolean is_rs690)
{
static const unsigned table[2][5][3][2] =
{
@@ -57,6 +57,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
{{ 16, 8}, { 0, 0}, { 0, 0}} /* 128 bits per pixel */
}
};
static const unsigned aa_block[2] = {4, 8};
unsigned tile = 0;
unsigned pixsize = util_format_get_blocksize(format);
@@ -74,6 +75,14 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
} else {
/* Standard alignment. */
tile = table[macrotile][util_logbase2(pixsize)][microtile][dim];
if (macrotile == 0 && is_rs690 && dim == DIM_WIDTH) {
int align;
int h_tile;
h_tile = table[macrotile][util_logbase2(pixsize)][microtile][DIM_HEIGHT];
align = 64 / (pixsize * h_tile);
if (tile < align)
tile = align;
}
}
assert(tile);
@@ -89,7 +98,7 @@ static boolean r300_texture_macro_switch(struct r300_texture_desc *desc,
unsigned tile, texdim;
tile = r300_get_pixel_alignment(desc->b.b.format, desc->b.b.nr_samples,
desc->microtile, R300_BUFFER_TILED, dim);
desc->microtile, R300_BUFFER_TILED, dim, 0);
if (dim == DIM_WIDTH) {
texdim = u_minify(desc->width0, level);
} else {
@@ -113,6 +122,9 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
unsigned level)
{
unsigned tile_width, width, stride;
boolean is_rs690 = (screen->caps.family == CHIP_FAMILY_RS600 ||
screen->caps.family == CHIP_FAMILY_RS690 ||
screen->caps.family == CHIP_FAMILY_RS740);
if (desc->stride_in_bytes_override)
return desc->stride_in_bytes_override;
@@ -131,38 +143,14 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
desc->b.b.nr_samples,
desc->microtile,
desc->macrotile[level],
DIM_WIDTH);
DIM_WIDTH, is_rs690);
width = align(width, tile_width);
stride = util_format_get_stride(desc->b.b.format, width);
/* Some IGPs need a minimum stride of 64 bytes, hmm... */
if (!desc->macrotile[level] &&
(screen->caps.family == CHIP_FAMILY_RS600 ||
screen->caps.family == CHIP_FAMILY_RS690 ||
screen->caps.family == CHIP_FAMILY_RS740)) {
unsigned min_stride;
if (desc->microtile) {
unsigned tile_height =
r300_get_pixel_alignment(desc->b.b.format,
desc->b.b.nr_samples,
desc->microtile,
desc->macrotile[level],
DIM_HEIGHT);
min_stride = 64 / tile_height;
} else {
min_stride = 64;
}
return stride < min_stride ? min_stride : stride;
}
/* The alignment to 32 bytes is sort of implied by the layout... */
return stride;
} else {
return align(util_format_get_stride(desc->b.b.format, width), 32);
return align(util_format_get_stride(desc->b.b.format, width), is_rs690 ? 64 : 32);
}
}
@@ -179,7 +167,7 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc,
desc->b.b.nr_samples,
desc->microtile,
desc->macrotile[level],
DIM_HEIGHT);
DIM_HEIGHT, 0);
height = align(height, tile_height);
/* This is needed for the kernel checker, unfortunately. */

View File

@@ -41,7 +41,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
unsigned num_samples,
enum r300_buffer_tiling microtile,
enum r300_buffer_tiling macrotile,
enum r300_dim dim);
enum r300_dim dim, boolean is_rs690);
boolean r300_texture_desc_init(struct r300_screen *rscreen,
struct r300_texture_desc *desc,

View File

@@ -1069,12 +1069,76 @@ void evergreen_init_config(struct r600_pipe_context *rctx)
num_hs_stack_entries = 42;
num_ls_stack_entries = 42;
break;
case CHIP_BARTS:
num_ps_gprs = 93;
num_vs_gprs = 46;
num_temp_gprs = 4;
num_gs_gprs = 31;
num_es_gprs = 31;
num_hs_gprs = 23;
num_ls_gprs = 23;
num_ps_threads = 128;
num_vs_threads = 20;
num_gs_threads = 20;
num_es_threads = 20;
num_hs_threads = 20;
num_ls_threads = 20;
num_ps_stack_entries = 85;
num_vs_stack_entries = 85;
num_gs_stack_entries = 85;
num_es_stack_entries = 85;
num_hs_stack_entries = 85;
num_ls_stack_entries = 85;
break;
case CHIP_TURKS:
num_ps_gprs = 93;
num_vs_gprs = 46;
num_temp_gprs = 4;
num_gs_gprs = 31;
num_es_gprs = 31;
num_hs_gprs = 23;
num_ls_gprs = 23;
num_ps_threads = 128;
num_vs_threads = 20;
num_gs_threads = 20;
num_es_threads = 20;
num_hs_threads = 20;
num_ls_threads = 20;
num_ps_stack_entries = 42;
num_vs_stack_entries = 42;
num_gs_stack_entries = 42;
num_es_stack_entries = 42;
num_hs_stack_entries = 42;
num_ls_stack_entries = 42;
break;
case CHIP_CAICOS:
num_ps_gprs = 93;
num_vs_gprs = 46;
num_temp_gprs = 4;
num_gs_gprs = 31;
num_es_gprs = 31;
num_hs_gprs = 23;
num_ls_gprs = 23;
num_ps_threads = 128;
num_vs_threads = 10;
num_gs_threads = 10;
num_es_threads = 10;
num_hs_threads = 10;
num_ls_threads = 10;
num_ps_stack_entries = 42;
num_vs_stack_entries = 42;
num_gs_stack_entries = 42;
num_es_stack_entries = 42;
num_hs_stack_entries = 42;
num_ls_stack_entries = 42;
break;
}
tmp = 0x00000000;
switch (family) {
case CHIP_CEDAR:
case CHIP_PALM:
case CHIP_CAICOS:
break;
default:
tmp |= S_008C00_VC_ENABLE(1);
@@ -1295,11 +1359,6 @@ void evergreen_vertex_buffer_update(struct r600_pipe_context *rctx)
if (rctx->vertex_elements == NULL || !rctx->nvertex_buffer)
return;
/* delete previous translated vertex elements */
if (rctx->tran.new_velems) {
r600_end_vertex_translate(rctx);
}
if (rctx->vertex_elements->incompatible_layout) {
/* translate rebind new vertex elements so
* return once translated
@@ -1332,16 +1391,16 @@ void evergreen_vertex_buffer_update(struct r600_pipe_context *rctx)
vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index;
vertex_buffer = &rctx->vertex_buffer[vbuffer_index];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
offset = rctx->vertex_elements->vbuffer_offset[i] +
vertex_buffer->buffer_offset +
r600_bo_offset(rbuffer->bo);
offset = rctx->vertex_elements->vbuffer_offset[i];
} else {
/* bind vertex buffer once */
vertex_buffer = &rctx->vertex_buffer[i];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
offset = vertex_buffer->buffer_offset +
r600_bo_offset(rbuffer->bo);
offset = 0;
}
if (vertex_buffer == NULL || rbuffer == NULL)
continue;
offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);
r600_pipe_state_add_reg(rstate, R_030000_RESOURCE0_WORD0,
offset, 0xFFFFFFFF, rbuffer->bo);

View File

@@ -92,6 +92,9 @@ enum radeon_family {
CHIP_CYPRESS,
CHIP_HEMLOCK,
CHIP_PALM,
CHIP_BARTS,
CHIP_TURKS,
CHIP_CAICOS,
CHIP_LAST,
};
@@ -245,10 +248,7 @@ struct r600_context {
u32 *pm4;
struct list_head query_list;
unsigned num_query_running;
unsigned fence;
struct list_head fenced_bo;
unsigned *cfence;
struct r600_bo *fence_bo;
};
struct r600_draw {

View File

@@ -155,6 +155,9 @@ int r600_bc_init(struct r600_bc *bc, enum radeon_family family)
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
case CHIP_BARTS:
case CHIP_TURKS:
case CHIP_CAICOS:
bc->chiprev = CHIPREV_EVERGREEN;
break;
default:
@@ -470,7 +473,22 @@ int r600_bc_add_alu_type(struct r600_bc *bc, const struct r600_bc_alu *alu, int
bc->cf_last->ndw += 2;
bc->ndw += 2;
bc->cf_last->kcache0_mode = 2;
/* The following configuration provides 64 128-bit constants.
* Each cacheline holds 16 128-bit constants and each
* kcache can lock 2 cachelines and there are 2 kcaches per
* ALU clause for a max of 64 constants.
* For supporting more than 64 constants, the code needs
* to be broken down into multiple ALU clauses.
*/
/* select the constant buffer (0-15) for each kcache */
bc->cf_last->kcache0_bank = 0;
bc->cf_last->kcache1_bank = 0;
/* lock 2 cachelines per kcache; 4 total */
bc->cf_last->kcache0_mode = V_SQ_CF_KCACHE_LOCK_2;
bc->cf_last->kcache1_mode = V_SQ_CF_KCACHE_LOCK_2;
/* set the cacheline offsets for each kcache */
bc->cf_last->kcache0_addr = 0;
bc->cf_last->kcache1_addr = 2;
/* process cur ALU instructions for bank swizzle */
if (alu->last) {

View File

@@ -103,7 +103,7 @@ static void r600_buffer_destroy(struct pipe_screen *screen,
{
struct r600_resource_buffer *rbuffer = r600_buffer(buf);
if (!rbuffer->uploaded && rbuffer->r.bo) {
if (rbuffer->r.bo) {
r600_bo_reference((struct radeon*)screen->winsys, &rbuffer->r.bo, NULL);
}
rbuffer->r.bo = NULL;

View File

@@ -148,6 +148,9 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
case CHIP_BARTS:
case CHIP_TURKS:
case CHIP_CAICOS:
rctx->context.draw_vbo = evergreen_draw;
evergreen_init_state_functions(rctx);
if (evergreen_context_init(&rctx->ctx, rctx->radeon)) {
@@ -232,6 +235,9 @@ static const char *r600_get_family_name(enum radeon_family family)
case CHIP_CYPRESS: return "AMD CYPRESS";
case CHIP_HEMLOCK: return "AMD HEMLOCK";
case CHIP_PALM: return "AMD PALM";
case CHIP_BARTS: return "AMD BARTS";
case CHIP_TURKS: return "AMD TURKS";
case CHIP_CAICOS: return "AMD CAICOS";
default: return "AMD unknown";
}
}

View File

@@ -589,6 +589,8 @@ int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_shader *s
if (r)
goto out_err;
break;
case TGSI_TOKEN_TYPE_PROPERTY:
break;
default:
R600_ERR("unsupported token type %d\n", ctx.parse.FullToken.Token.Type);
r = -EINVAL;
@@ -1451,7 +1453,7 @@ static int tgsi_pow(struct r600_shader_ctx *ctx)
return r;
/* b * LOG2(a) */
memset(&alu, 0, sizeof(struct r600_bc_alu));
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL_IEEE);
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
r = tgsi_src(ctx, &inst->Src[1], &alu.src[0]);
if (r)
return r;

View File

@@ -74,6 +74,10 @@
#define S_SQ_CF_ALU_WORD0_KCACHE_MODE0(x) (((x) & 0x3) << 30)
#define G_SQ_CF_ALU_WORD0_KCACHE_MODE0(x) (((x) >> 30) & 0x3)
#define C_SQ_CF_ALU_WORD0_KCACHE_MODE0 0x3FFFFFFF
#define V_SQ_CF_KCACHE_NOP 0x00000000
#define V_SQ_CF_KCACHE_LOCK_1 0x00000001
#define V_SQ_CF_KCACHE_LOCK_2 0x00000002
#define V_SQ_CF_KCACHE_LOCK_LOOP_INDEX 0x00000003
#define P_SQ_CF_ALU_WORD1
#define S_SQ_CF_ALU_WORD1_KCACHE_MODE1(x) (((x) & 0x3) << 0)
#define G_SQ_CF_ALU_WORD1_KCACHE_MODE1(x) (((x) >> 0) & 0x3)

View File

@@ -135,11 +135,6 @@ void r600_vertex_buffer_update(struct r600_pipe_context *rctx)
if (rctx->vertex_elements == NULL || !rctx->nvertex_buffer)
return;
/* delete previous translated vertex elements */
if (rctx->tran.new_velems) {
r600_end_vertex_translate(rctx);
}
if (rctx->vertex_elements->incompatible_layout) {
/* translate rebind new vertex elements so
* return once translated
@@ -172,16 +167,16 @@ void r600_vertex_buffer_update(struct r600_pipe_context *rctx)
vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index;
vertex_buffer = &rctx->vertex_buffer[vbuffer_index];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
offset = rctx->vertex_elements->vbuffer_offset[i] +
vertex_buffer->buffer_offset +
r600_bo_offset(rbuffer->bo);
offset = rctx->vertex_elements->vbuffer_offset[i];
} else {
/* bind vertex buffer once */
vertex_buffer = &rctx->vertex_buffer[i];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
offset = vertex_buffer->buffer_offset +
r600_bo_offset(rbuffer->bo);
offset = 0;
}
if (vertex_buffer == NULL || rbuffer == NULL)
continue;
offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);
r600_pipe_state_add_reg(rstate, R_038000_RESOURCE0_WORD0,
offset, 0xFFFFFFFF, rbuffer->bo);
@@ -280,7 +275,6 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
{
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_drawl draw;
boolean translate = FALSE;
memset(&draw, 0, sizeof(struct r600_drawl));
draw.ctx = ctx;
@@ -312,9 +306,6 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
}
r600_draw_common(&draw);
if (translate)
r600_end_vertex_translate(rctx);
pipe_resource_reference(&draw.index_buffer, NULL);
}

View File

@@ -119,6 +119,11 @@ void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
/* delete previous translated vertex elements */
if (rctx->tran.new_velems) {
r600_end_vertex_translate(rctx);
}
rctx->vertex_elements = v;
if (v) {
rctx->states[v->rstate.id] = &v->rstate;
@@ -174,8 +179,16 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count,
struct pipe_vertex_buffer *vbo;
unsigned max_index = (unsigned)-1;
for (int i = 0; i < rctx->nvertex_buffer; i++) {
pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL);
if (rctx->family >= CHIP_CEDAR) {
for (int i = 0; i < rctx->nvertex_buffer; i++) {
pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL);
evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
}
} else {
for (int i = 0; i < rctx->nvertex_buffer; i++) {
pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL);
r600_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
}
}
memcpy(rctx->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count);
@@ -183,15 +196,19 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count,
vbo = (struct pipe_vertex_buffer*)&buffers[i];
rctx->vertex_buffer[i].buffer = NULL;
if (buffers[i].buffer == NULL)
continue;
if (r600_buffer_is_user_buffer(buffers[i].buffer))
rctx->any_user_vbs = TRUE;
pipe_resource_reference(&rctx->vertex_buffer[i].buffer, buffers[i].buffer);
/* The stride of zero means we will be fetching only the first
* vertex, so don't care about max_index. */
if (!vbo->stride)
continue;
if (vbo->max_index == ~0) {
if (!vbo->stride)
vbo->max_index = 1;
else
vbo->max_index = (vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
vbo->max_index = (vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
}
max_index = MIN2(vbo->max_index, max_index);
}

View File

@@ -42,6 +42,7 @@ void r600_begin_vertex_translate(struct r600_pipe_context *rctx)
struct pipe_resource *out_buffer;
unsigned i, num_verts;
struct pipe_vertex_element new_velems[PIPE_MAX_ATTRIBS];
void *tmp;
/* Initialize the translate key, i.e. the recipe how vertices should be
* translated. */
@@ -159,8 +160,9 @@ void r600_begin_vertex_translate(struct r600_pipe_context *rctx)
}
}
rctx->tran.new_velems = pipe->create_vertex_elements_state(pipe, ve->count, new_velems);
pipe->bind_vertex_elements_state(pipe, rctx->tran.new_velems);
tmp = pipe->create_vertex_elements_state(pipe, ve->count, new_velems);
pipe->bind_vertex_elements_state(pipe, tmp);
rctx->tran.new_velems = tmp;
pipe_resource_reference(&out_buffer, NULL);
}
@@ -173,15 +175,11 @@ void r600_end_vertex_translate(struct r600_pipe_context *rctx)
return;
}
/* Restore vertex elements. */
if (rctx->vertex_elements == rctx->tran.new_velems) {
pipe->bind_vertex_elements_state(pipe, NULL);
}
pipe->delete_vertex_elements_state(pipe, rctx->tran.new_velems);
rctx->tran.new_velems = NULL;
/* Delete the now-unused VBO. */
pipe_resource_reference(&rctx->vertex_buffer[rctx->tran.vb_slot].buffer,
NULL);
pipe_resource_reference(&rctx->vertex_buffer[rctx->tran.vb_slot].buffer, NULL);
}
void r600_translate_index_buffer(struct r600_pipe_context *r600,

View File

@@ -69,6 +69,7 @@ void r600_upload_flush(struct r600_upload *upload)
upload->default_size = MAX2(upload->total_alloc_size, upload->default_size);
upload->total_alloc_size = 0;
upload->size = 0;
upload->offset = 0;
upload->ptr = NULL;
upload->buffer = NULL;
}
@@ -105,7 +106,8 @@ int r600_upload_buffer(struct r600_upload *upload, unsigned offset,
memcpy(upload->ptr + upload->offset, (uint8_t *) in_ptr + offset, size);
*out_offset = upload->offset;
*out_size = upload->size;
*out_buffer = upload->buffer;
*out_buffer = NULL;
r600_bo_reference(upload->rctx->radeon, out_buffer, upload->buffer);
upload->offset += alloc_size;
return 0;

View File

@@ -575,7 +575,7 @@ setup_fragcoord_coeff(struct setup_context *setup, uint slot)
setup->coef[slot].dady[0] = 0.0;
/*Y*/
setup->coef[slot].a0[1] =
(spfs->origin_lower_left ? setup->softpipe->framebuffer.height : 0)
(spfs->origin_lower_left ? setup->softpipe->framebuffer.height-1 : 0)
+ (spfs->pixel_center_integer ? 0.0 : 0.5);
setup->coef[slot].dadx[1] = 0.0;
setup->coef[slot].dady[1] = spfs->origin_lower_left ? -1.0 : 1.0;

View File

@@ -141,12 +141,18 @@ GLboolean
dri_unbind_context(__DRIcontext * cPriv)
{
/* dri_util.c ensures cPriv is not null */
struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
struct dri_context *ctx = dri_context(cPriv);
struct dri_drawable *draw = dri_drawable(ctx->dPriv);
struct dri_drawable *read = dri_drawable(ctx->rPriv);
struct st_api *stapi = screen->st_api;
if (--ctx->bind_count == 0) {
if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
ctx->stapi->make_current(ctx->stapi, NULL, NULL, NULL);
stapi->make_current(stapi, NULL, NULL, NULL);
draw->context = NULL;
read->context = NULL;
}
}
@@ -169,17 +175,23 @@ dri_make_current(__DRIcontext * cPriv,
++ctx->bind_count;
if (!driDrawPriv && !driReadPriv)
return ctx->stapi->make_current(ctx->stapi, ctx->st, NULL, NULL);
else if (!driDrawPriv || !driReadPriv)
return GL_FALSE;
draw->context = ctx;
if (ctx->dPriv != driDrawPriv) {
ctx->dPriv = driDrawPriv;
draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
read->context = ctx;
if (ctx->rPriv != driReadPriv) {
ctx->rPriv = driReadPriv;
read->texture_stamp = driReadPriv->lastStamp - 1;
}
ctx->stapi->make_current(ctx->stapi, ctx->st,
(draw) ? &draw->base : NULL, (read) ? &read->base : NULL);
ctx->stapi->make_current(ctx->stapi, ctx->st, &draw->base, &read->base);
return GL_TRUE;
}

View File

@@ -132,6 +132,7 @@ dri_create_buffer(__DRIscreen * sPriv,
drawable->base.validate = dri_st_framebuffer_validate;
drawable->base.st_manager_private = (void *) drawable;
drawable->screen = screen;
drawable->sPriv = sPriv;
drawable->dPriv = dPriv;
dPriv->driverPrivate = (void *)drawable;

View File

@@ -41,6 +41,9 @@ struct dri_drawable
struct st_framebuffer_iface base;
struct st_visual stvis;
struct dri_screen *screen;
struct dri_context *context;
/* dri */
__DRIdrawable *dPriv;
__DRIscreen *sPriv;

View File

@@ -51,7 +51,7 @@ static void
dri2_invalidate_drawable(__DRIdrawable *dPriv)
{
struct dri_drawable *drawable = dri_drawable(dPriv);
struct dri_context *ctx = dri_context(dPriv->driContextPriv);
struct dri_context *ctx = drawable->context;
dri2InvalidateDrawable(dPriv);
drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;

View File

@@ -158,17 +158,17 @@ egl_g3d_choose_config(_EGLDriver *drv, _EGLDisplay *dpy, const EGLint *attribs,
(_EGLArrayForEach) egl_g3d_match_config, (void *) &criteria);
/* perform sorting of configs */
if (tmp_configs && tmp_size) {
if (configs && tmp_size) {
_eglSortConfigs((const _EGLConfig **) tmp_configs, tmp_size,
egl_g3d_compare_config, (void *) &criteria);
size = MIN2(tmp_size, size);
for (i = 0; i < size; i++)
tmp_size = MIN2(tmp_size, size);
for (i = 0; i < tmp_size; i++)
configs[i] = _eglGetConfigHandle(tmp_configs[i]);
}
FREE(tmp_configs);
*num_configs = size;
*num_configs = tmp_size;
return EGL_TRUE;
}
@@ -402,7 +402,6 @@ egl_g3d_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *conf, const EGLint *attribs)
{
struct egl_g3d_surface *gsurf;
struct pipe_resource *ptex = NULL;
gsurf = create_pbuffer_surface(dpy, conf, attribs,
"eglCreatePbufferSurface");
@@ -411,13 +410,6 @@ egl_g3d_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy,
gsurf->client_buffer_type = EGL_NONE;
if (!gsurf->stfbi->validate(gsurf->stfbi,
&gsurf->stvis.render_buffer, 1, &ptex)) {
egl_g3d_destroy_st_framebuffer(gsurf->stfbi);
FREE(gsurf);
return NULL;
}
return &gsurf->base;
}
@@ -477,12 +469,14 @@ egl_g3d_create_pbuffer_from_client_buffer(_EGLDriver *drv, _EGLDisplay *dpy,
gsurf->client_buffer_type = buftype;
gsurf->client_buffer = buffer;
/* validate now so that it fails if the client buffer is invalid */
if (!gsurf->stfbi->validate(gsurf->stfbi,
&gsurf->stvis.render_buffer, 1, &ptex)) {
egl_g3d_destroy_st_framebuffer(gsurf->stfbi);
FREE(gsurf);
return NULL;
}
pipe_resource_reference(&ptex, NULL);
return &gsurf->base;
}
@@ -676,14 +670,13 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
ptex = get_pipe_resource(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT);
if (ptex) {
struct pipe_resource *psrc = gsurf->render_texture;
struct pipe_box src_box;
u_box_origin_2d(ptex->width0, ptex->height0, &src_box);
if (psrc) {
gdpy->pipe->resource_copy_region(gdpy->pipe, ptex, 0, 0, 0, 0,
gsurf->render_texture, 0, &src_box);
nsurf->present(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
}
gdpy->pipe->resource_copy_region(gdpy->pipe, ptex, 0, 0, 0, 0,
gsurf->render_texture, 0, &src_box);
gdpy->pipe->flush(gdpy->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
nsurf->present(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
pipe_resource_reference(&ptex, NULL);
}

View File

@@ -548,6 +548,10 @@ dri2_display_convert_config(struct native_display *ndpy,
if (!mode->xRenderable || !mode->drawableType)
return FALSE;
/* fast/slow configs are probably not relevant */
if (mode->visualRating == GLX_SLOW_CONFIG)
return FALSE;
nconf->buffer_mask = 1 << NATIVE_ATTACHMENT_FRONT_LEFT;
if (mode->doubleBufferMode)
nconf->buffer_mask |= 1 << NATIVE_ATTACHMENT_BACK_LEFT;
@@ -568,13 +572,32 @@ dri2_display_convert_config(struct native_display *ndpy,
if (nconf->color_format == PIPE_FORMAT_NONE)
return FALSE;
if (mode->drawableType & GLX_WINDOW_BIT)
if ((mode->drawableType & GLX_WINDOW_BIT) && mode->visualID)
nconf->window_bit = TRUE;
if (mode->drawableType & GLX_PIXMAP_BIT)
nconf->pixmap_bit = TRUE;
nconf->native_visual_id = mode->visualID;
nconf->native_visual_type = mode->visualType;
switch (mode->visualType) {
case GLX_TRUE_COLOR:
nconf->native_visual_type = TrueColor;
break;
case GLX_DIRECT_COLOR:
nconf->native_visual_type = DirectColor;
break;
case GLX_PSEUDO_COLOR:
nconf->native_visual_type = PseudoColor;
break;
case GLX_STATIC_COLOR:
nconf->native_visual_type = StaticColor;
break;
case GLX_GRAY_SCALE:
nconf->native_visual_type = GrayScale;
break;
case GLX_STATIC_GRAY:
nconf->native_visual_type = StaticGray;
break;
}
nconf->level = mode->level;
nconf->samples = mode->samples;
@@ -614,8 +637,17 @@ dri2_display_get_configs(struct native_display *ndpy, int *num_configs)
count = 0;
for (i = 0; i < num_modes; i++) {
struct native_config *nconf = &dri2dpy->configs[count].base;
if (dri2_display_convert_config(&dri2dpy->base, modes, nconf))
count++;
if (dri2_display_convert_config(&dri2dpy->base, modes, nconf)) {
int j;
/* look for duplicates */
for (j = 0; j < count; j++) {
if (memcmp(&dri2dpy->configs[j], nconf, sizeof(*nconf)) == 0)
break;
}
if (j == count)
count++;
}
modes = modes->next;
}

View File

@@ -72,7 +72,6 @@ COMMON_DRI_DRM_OBJECTS = [
drienv.AppendUnique(LIBS = [
'expat',
'talloc',
])
Export([

View File

@@ -15,7 +15,6 @@ env.Append(LIBS = [
'user32',
'kernel32',
'ws2_32',
talloc,
])
sources = ['libgl_gdi.c']

View File

@@ -23,7 +23,6 @@ env.Prepend(LIBS = [
mesa,
glsl,
gallium,
'talloc'
])
sources = [

View File

@@ -621,10 +621,7 @@ int evergreen_context_init(struct r600_context *ctx, struct radeon *radeon)
/* save 16dwords space for fence mecanism */
ctx->pm4_ndwords -= 16;
r = r600_context_init_fence(ctx);
if (r) {
goto out_err;
}
LIST_INITHEAD(&ctx->fenced_bo);
/* init dirty list */
LIST_INITHEAD(&ctx->dirty);

View File

@@ -79,58 +79,6 @@ struct radeon *r600_new(int fd, unsigned device)
r600_delete(r600);
return NULL;
}
switch (r600->family) {
case CHIP_R600:
case CHIP_RV610:
case CHIP_RV630:
case CHIP_RV670:
case CHIP_RV620:
case CHIP_RV635:
case CHIP_RS780:
case CHIP_RS880:
case CHIP_RV770:
case CHIP_RV730:
case CHIP_RV710:
case CHIP_RV740:
case CHIP_CEDAR:
case CHIP_REDWOOD:
case CHIP_JUNIPER:
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
break;
case CHIP_R100:
case CHIP_RV100:
case CHIP_RS100:
case CHIP_RV200:
case CHIP_RS200:
case CHIP_R200:
case CHIP_RV250:
case CHIP_RS300:
case CHIP_RV280:
case CHIP_R300:
case CHIP_R350:
case CHIP_RV350:
case CHIP_RV380:
case CHIP_R420:
case CHIP_R423:
case CHIP_RV410:
case CHIP_RS400:
case CHIP_RS480:
case CHIP_RS600:
case CHIP_RS690:
case CHIP_RS740:
case CHIP_RV515:
case CHIP_R520:
case CHIP_RV530:
case CHIP_RV560:
case CHIP_RV570:
case CHIP_R580:
default:
R600_ERR("unknown or unsupported chipset 0x%04X\n", r600->device);
break;
}
/* setup class */
switch (r600->family) {
case CHIP_R600:
@@ -155,6 +103,9 @@ struct radeon *r600_new(int fd, unsigned device)
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
case CHIP_BARTS:
case CHIP_TURKS:
case CHIP_CAICOS:
r600->chip_class = EVERGREEN;
break;
default:

View File

@@ -85,7 +85,7 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon,
free(bo);
return NULL;
}
bo->size = bo->size;
bo->size = rbo->size;
bo->domains = (RADEON_GEM_DOMAIN_CPU |
RADEON_GEM_DOMAIN_GTT |
RADEON_GEM_DOMAIN_VRAM);

View File

@@ -30,6 +30,7 @@
#include <sys/ioctl.h>
#include "util/u_inlines.h"
#include "util/u_debug.h"
#include <pipebuffer/pb_bufmgr.h>
#include "r600.h"
#include "r600_priv.h"
#include "r600_drm_public.h"
@@ -110,6 +111,18 @@ static int radeon_drm_get_tiling(struct radeon *radeon)
return 0;
}
static int radeon_init_fence(struct radeon *radeon)
{
radeon->fence = 1;
radeon->fence_bo = r600_bo(radeon, 4096, 0, 0, 0);
if (radeon->fence_bo == NULL) {
return -ENOMEM;
}
radeon->cfence = r600_bo_map(radeon, radeon->fence_bo, PB_USAGE_UNSYNCHRONIZED, NULL);
*radeon->cfence = 0;
return 0;
}
static struct radeon *radeon_new(int fd, unsigned device)
{
struct radeon *radeon;
@@ -134,59 +147,6 @@ static struct radeon *radeon_new(int fd, unsigned device)
fprintf(stderr, "Unknown chipset 0x%04X\n", radeon->device);
return radeon_decref(radeon);
}
switch (radeon->family) {
case CHIP_R600:
case CHIP_RV610:
case CHIP_RV630:
case CHIP_RV670:
case CHIP_RV620:
case CHIP_RV635:
case CHIP_RS780:
case CHIP_RS880:
case CHIP_RV770:
case CHIP_RV730:
case CHIP_RV710:
case CHIP_RV740:
case CHIP_CEDAR:
case CHIP_REDWOOD:
case CHIP_JUNIPER:
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
break;
case CHIP_R100:
case CHIP_RV100:
case CHIP_RS100:
case CHIP_RV200:
case CHIP_RS200:
case CHIP_R200:
case CHIP_RV250:
case CHIP_RS300:
case CHIP_RV280:
case CHIP_R300:
case CHIP_R350:
case CHIP_RV350:
case CHIP_RV380:
case CHIP_R420:
case CHIP_R423:
case CHIP_RV410:
case CHIP_RS400:
case CHIP_RS480:
case CHIP_RS600:
case CHIP_RS690:
case CHIP_RS740:
case CHIP_RV515:
case CHIP_R520:
case CHIP_RV530:
case CHIP_RV560:
case CHIP_RV570:
case CHIP_R580:
default:
fprintf(stderr, "%s unknown or unsupported chipset 0x%04X\n",
__func__, radeon->device);
break;
}
/* setup class */
switch (radeon->family) {
case CHIP_R600:
@@ -215,6 +175,9 @@ static struct radeon *radeon_new(int fd, unsigned device)
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
case CHIP_BARTS:
case CHIP_TURKS:
case CHIP_CAICOS:
radeon->chip_class = EVERGREEN;
/* set default group bytes, overridden by tiling info ioctl */
radeon->tiling_info.group_bytes = 512;
@@ -233,6 +196,11 @@ static struct radeon *radeon_new(int fd, unsigned device)
if (radeon->bomgr == NULL) {
return NULL;
}
r = radeon_init_fence(radeon);
if (r) {
radeon_decref(radeon);
return NULL;
}
return radeon;
}
@@ -249,12 +217,13 @@ struct radeon *radeon_decref(struct radeon *radeon)
return NULL;
}
if (radeon->fence_bo) {
r600_bo_reference(radeon, &radeon->fence_bo, NULL);
}
if (radeon->bomgr)
r600_bomgr_destroy(radeon->bomgr);
if (radeon->fd >= 0)
drmClose(radeon->fd);
free(radeon);
return NULL;
}

View File

@@ -40,27 +40,13 @@
#define GROUP_FORCE_NEW_BLOCK 0
int r600_context_init_fence(struct r600_context *ctx)
{
ctx->fence = 1;
ctx->fence_bo = r600_bo(ctx->radeon, 4096, 0, 0, 0);
if (ctx->fence_bo == NULL) {
return -ENOMEM;
}
ctx->cfence = r600_bo_map(ctx->radeon, ctx->fence_bo, PB_USAGE_UNSYNCHRONIZED, NULL);
*ctx->cfence = 0;
ctx->radeon->cfence = ctx->cfence;
LIST_INITHEAD(&ctx->fenced_bo);
return 0;
}
static void INLINE r600_context_update_fenced_list(struct r600_context *ctx)
{
for (int i = 0; i < ctx->creloc; i++) {
if (!LIST_IS_EMPTY(&ctx->bo[i]->fencedlist))
LIST_DELINIT(&ctx->bo[i]->fencedlist);
LIST_ADDTAIL(&ctx->bo[i]->fencedlist, &ctx->fenced_bo);
ctx->bo[i]->fence = ctx->fence;
ctx->bo[i]->fence = ctx->radeon->fence;
ctx->bo[i]->ctx = ctx;
}
}
@@ -71,7 +57,7 @@ static void INLINE r600_context_fence_wraparound(struct r600_context *ctx, unsig
struct radeon_bo *tmp;
LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &ctx->fenced_bo, fencedlist) {
if (bo->fence <= *ctx->cfence) {
if (bo->fence <= *ctx->radeon->cfence) {
LIST_DELINIT(&bo->fencedlist);
bo->fence = 0;
} else {
@@ -632,9 +618,6 @@ void r600_context_fini(struct r600_context *ctx)
free(ctx->pm4);
r600_context_clear_fenced_bo(ctx);
if (ctx->fence_bo) {
r600_bo_reference(ctx->radeon, &ctx->fence_bo, NULL);
}
memset(ctx, 0, sizeof(struct r600_context));
}
@@ -763,10 +746,7 @@ int r600_context_init(struct r600_context *ctx, struct radeon *radeon)
/* save 16dwords space for fence mecanism */
ctx->pm4_ndwords -= 16;
r = r600_context_init_fence(ctx);
if (r) {
goto out_err;
}
LIST_INITHEAD(&ctx->fenced_bo);
/* init dirty list */
LIST_INITHEAD(&ctx->dirty);
@@ -814,7 +794,7 @@ void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *r
ctx->reloc[ctx->creloc].write_domain = rbo->domains & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM);
ctx->reloc[ctx->creloc].flags = 0;
radeon_bo_reference(ctx->radeon, &ctx->bo[ctx->creloc], bo);
rbo->fence = ctx->fence;
rbo->fence = ctx->radeon->fence;
ctx->creloc++;
/* set PKT3 to point to proper reloc */
*pm4 = bo->reloc_id;
@@ -837,7 +817,7 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat
/* find relocation */
id = block->pm4_bo_index[id];
r600_bo_reference(ctx->radeon, &block->reloc[id].bo, state->regs[i].bo);
state->regs[i].bo->fence = ctx->fence;
state->regs[i].bo->fence = ctx->radeon->fence;
}
if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
block->status |= R600_BLOCK_STATUS_ENABLED;
@@ -877,13 +857,13 @@ static inline void r600_context_pipe_state_set_resource(struct r600_context *ctx
*/
r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->regs[0].bo);
r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->regs[0].bo);
state->regs[0].bo->fence = ctx->fence;
state->regs[0].bo->fence = ctx->radeon->fence;
} else {
/* TEXTURE RESOURCE */
r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->regs[2].bo);
r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->regs[3].bo);
state->regs[2].bo->fence = ctx->fence;
state->regs[3].bo->fence = ctx->fence;
state->regs[2].bo->fence = ctx->radeon->fence;
state->regs[3].bo->fence = ctx->radeon->fence;
}
if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
block->status |= R600_BLOCK_STATUS_ENABLED;
@@ -1123,11 +1103,11 @@ void r600_context_flush(struct r600_context *ctx)
ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5);
ctx->pm4[ctx->pm4_cdwords++] = 0;
ctx->pm4[ctx->pm4_cdwords++] = (1 << 29) | (0 << 24);
ctx->pm4[ctx->pm4_cdwords++] = ctx->fence;
ctx->pm4[ctx->pm4_cdwords++] = ctx->radeon->fence;
ctx->pm4[ctx->pm4_cdwords++] = 0;
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0;
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], ctx->fence_bo);
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], ctx->radeon->fence_bo);
#if 1
/* emit cs */
@@ -1144,18 +1124,18 @@ void r600_context_flush(struct r600_context *ctx)
r = drmCommandWriteRead(ctx->radeon->fd, DRM_RADEON_CS, &drmib,
sizeof(struct drm_radeon_cs));
#else
*ctx->cfence = ctx->fence;
*ctx->radeon->cfence = ctx->radeon->fence;
#endif
r600_context_update_fenced_list(ctx);
fence = ctx->fence + 1;
if (fence < ctx->fence) {
fence = ctx->radeon->fence + 1;
if (fence < ctx->radeon->fence) {
/* wrap around */
fence = 1;
r600_context_fence_wraparound(ctx, fence);
}
ctx->fence = fence;
ctx->radeon->fence = fence;
/* restart */
for (int i = 0; i < ctx->creloc; i++) {

View File

@@ -36,6 +36,7 @@
#include "r600.h"
struct r600_bomgr;
struct r600_bo;
struct radeon {
int fd;
@@ -45,7 +46,9 @@ struct radeon {
enum chip_class chip_class;
struct r600_tiling_info tiling_info;
struct r600_bomgr *bomgr;
unsigned fence;
unsigned *cfence;
struct r600_bo *fence_bo;
};
struct r600_reg {

View File

@@ -156,7 +156,7 @@ int radeon_bo_wait(struct radeon *radeon, struct radeon_bo *bo)
if (!bo->shared) {
if (!bo->fence)
return 0;
if (bo->fence <= *bo->ctx->cfence) {
if (bo->fence <= *radeon->cfence) {
LIST_DELINIT(&bo->fencedlist);
bo->fence = 0;
return 0;
@@ -181,7 +181,7 @@ int radeon_bo_busy(struct radeon *radeon, struct radeon_bo *bo, uint32_t *domain
if (!bo->shared) {
if (!bo->fence)
return 0;
if (bo->fence <= *bo->ctx->cfence) {
if (bo->fence <= *radeon->cfence) {
LIST_DELINIT(&bo->fencedlist);
bo->fence = 0;
return 0;

View File

@@ -445,6 +445,44 @@ struct pci_id radeon_pci_id[] = {
{0x1002, 0x9803, CHIP_PALM},
{0x1002, 0x9804, CHIP_PALM},
{0x1002, 0x9805, CHIP_PALM},
{0x1002, 0x9806, CHIP_PALM},
{0x1002, 0x9807, CHIP_PALM},
{0x1002, 0x6720, CHIP_BARTS},
{0x1002, 0x6721, CHIP_BARTS},
{0x1002, 0x6722, CHIP_BARTS},
{0x1002, 0x6723, CHIP_BARTS},
{0x1002, 0x6724, CHIP_BARTS},
{0x1002, 0x6725, CHIP_BARTS},
{0x1002, 0x6726, CHIP_BARTS},
{0x1002, 0x6727, CHIP_BARTS},
{0x1002, 0x6728, CHIP_BARTS},
{0x1002, 0x6729, CHIP_BARTS},
{0x1002, 0x6738, CHIP_BARTS},
{0x1002, 0x6739, CHIP_BARTS},
{0x1002, 0x6740, CHIP_TURKS},
{0x1002, 0x6741, CHIP_TURKS},
{0x1002, 0x6742, CHIP_TURKS},
{0x1002, 0x6743, CHIP_TURKS},
{0x1002, 0x6744, CHIP_TURKS},
{0x1002, 0x6745, CHIP_TURKS},
{0x1002, 0x6746, CHIP_TURKS},
{0x1002, 0x6747, CHIP_TURKS},
{0x1002, 0x6748, CHIP_TURKS},
{0x1002, 0x6749, CHIP_TURKS},
{0x1002, 0x6750, CHIP_TURKS},
{0x1002, 0x6758, CHIP_TURKS},
{0x1002, 0x6759, CHIP_TURKS},
{0x1002, 0x6760, CHIP_CAICOS},
{0x1002, 0x6761, CHIP_CAICOS},
{0x1002, 0x6762, CHIP_CAICOS},
{0x1002, 0x6763, CHIP_CAICOS},
{0x1002, 0x6764, CHIP_CAICOS},
{0x1002, 0x6765, CHIP_CAICOS},
{0x1002, 0x6766, CHIP_CAICOS},
{0x1002, 0x6767, CHIP_CAICOS},
{0x1002, 0x6768, CHIP_CAICOS},
{0x1002, 0x6770, CHIP_CAICOS},
{0x1002, 0x6779, CHIP_CAICOS},
{0, 0},
};

View File

@@ -118,7 +118,7 @@ static struct r300_winsys_buffer *radeon_r300_winsys_buffer_from_handle(struct r
if (stride)
*stride = whandle->stride;
if (size)
if (size && _buf)
*size = _buf->base.size;
return (struct r300_winsys_buffer*)_buf;

View File

@@ -16,6 +16,8 @@ GLCPP_SOURCES = \
glcpp/glcpp.c
C_SOURCES = \
strtod.c \
ralloc.c \
$(LIBGLCPP_SOURCES)
CXX_SOURCES = \
@@ -82,8 +84,7 @@ CXX_SOURCES = \
s_expression.cpp
LIBS = \
$(TOP)/src/glsl/libglsl.a \
$(TALLOC_LIBS)
$(TOP)/src/glsl/libglsl.a
APPS = glsl_compiler glcpp/glcpp
@@ -112,7 +113,6 @@ OBJECTS = \
$(CXX_SOURCES:.cpp=.o)
INCLUDES = \
$(TALLOC_CFLAGS) \
-I. \
-I../mesa \
-I../mapi \

View File

@@ -7,11 +7,9 @@ env = env.Clone()
env.Prepend(CPPPATH = [
'#src/mapi',
'#src/mesa',
'#src/glsl',
])
if env['platform'] == 'windows':
env.Prepend(CPPPATH = ['#src/talloc'])
sources = [
'glcpp/glcpp-lex.c',
'glcpp/glcpp-parse.c',
@@ -75,7 +73,9 @@ sources = [
'opt_structure_splitting.cpp',
'opt_swizzle_swizzle.cpp',
'opt_tree_grafting.cpp',
'ralloc.c',
's_expression.cpp',
'strtod.c',
]
glsl = env.ConvenienceLibrary(
@@ -95,7 +95,7 @@ if env['platform'] == 'windows':
'user32',
])
env.Prepend(LIBS = [glsl, talloc])
env.Prepend(LIBS = [glsl])
env.Program(
target = 'glsl2',

View File

@@ -49,23 +49,23 @@ struct YYLTYPE;
*/
class ast_node {
public:
/* Callers of this talloc-based new need not call delete. It's
* easier to just talloc_free 'ctx' (or any of its ancestors). */
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
static void* operator new(size_t size, void *ctx)
{
void *node;
node = talloc_zero_size(ctx, size);
node = rzalloc_size(ctx, size);
assert(node != NULL);
return node;
}
/* If the user *does* call delete, that's OK, we will just
* talloc_free in that case. */
* ralloc_free in that case. */
static void operator delete(void *table)
{
talloc_free(table);
ralloc_free(table);
}
/**
@@ -318,7 +318,8 @@ public:
enum {
ast_precision_high = 0, /**< Default precision. */
ast_precision_none = 0, /**< Absence of precision qualifier. */
ast_precision_high,
ast_precision_medium,
ast_precision_low
};
@@ -440,7 +441,8 @@ public:
/** Construct a type specifier from a type name */
ast_type_specifier(const char *name)
: type_specifier(ast_type_name), type_name(name), structure(NULL),
is_array(false), array_size(NULL), precision(ast_precision_high)
is_array(false), array_size(NULL), precision(ast_precision_none),
is_precision_statement(false)
{
/* empty */
}
@@ -448,7 +450,8 @@ public:
/** Construct a type specifier from a structure definition */
ast_type_specifier(ast_struct_specifier *s)
: type_specifier(ast_struct), type_name(s->name), structure(s),
is_array(false), array_size(NULL), precision(ast_precision_high)
is_array(false), array_size(NULL), precision(ast_precision_none),
is_precision_statement(false)
{
/* empty */
}
@@ -470,6 +473,8 @@ public:
ast_expression *array_size;
unsigned precision:2;
bool is_precision_statement;
};

View File

@@ -20,8 +20,8 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <cstdio>
#include <cassert>
#include <stdio.h>
#include <assert.h>
#include "ast.h"
const char *

View File

@@ -66,7 +66,7 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
* formal or actual parameter list. Only the type is used.
*
* \return
* A talloced string representing the prototype of the function.
* A ralloced string representing the prototype of the function.
*/
char *
prototype_string(const glsl_type *return_type, const char *name,
@@ -75,19 +75,19 @@ prototype_string(const glsl_type *return_type, const char *name,
char *str = NULL;
if (return_type != NULL)
str = talloc_asprintf(str, "%s ", return_type->name);
str = ralloc_asprintf(NULL, "%s ", return_type->name);
str = talloc_asprintf_append(str, "%s(", name);
ralloc_asprintf_append(&str, "%s(", name);
const char *comma = "";
foreach_list(node, parameters) {
const ir_instruction *const param = (ir_instruction *) node;
str = talloc_asprintf_append(str, "%s%s", comma, param->type->name);
ralloc_asprintf_append(&str, "%s%s", comma, param->type->name);
comma = ", ";
}
str = talloc_strdup_append(str, ")");
ralloc_strcat(&str, ")");
return str;
}
@@ -173,7 +173,7 @@ match_function_by_name(exec_list *instructions, const char *name,
ir_dereference_variable *deref;
var = new(ctx) ir_variable(sig->return_type,
talloc_asprintf(ctx, "%s_retval",
ralloc_asprintf(ctx, "%s_retval",
sig->function_name()),
ir_var_temporary);
instructions->push_tail(var);
@@ -195,7 +195,7 @@ match_function_by_name(exec_list *instructions, const char *name,
_mesa_glsl_error(loc, state, "no matching function for call to `%s'",
str);
talloc_free(str);
ralloc_free(str);
const char *prefix = "candidates are: ";
@@ -211,7 +211,7 @@ match_function_by_name(exec_list *instructions, const char *name,
str = prototype_string(sig->return_type, f->name, &sig->parameters);
_mesa_glsl_error(loc, state, "%s%s\n", prefix, str);
talloc_free(str);
ralloc_free(str);
prefix = " ";
}
@@ -232,7 +232,7 @@ match_function_by_name(exec_list *instructions, const char *name,
static ir_rvalue *
convert_component(ir_rvalue *src, const glsl_type *desired_type)
{
void *ctx = talloc_parent(src);
void *ctx = ralloc_parent(src);
const unsigned a = desired_type->base_type;
const unsigned b = src->type->base_type;
ir_expression *result = NULL;
@@ -295,7 +295,7 @@ convert_component(ir_rvalue *src, const glsl_type *desired_type)
static ir_rvalue *
dereference_component(ir_rvalue *src, unsigned component)
{
void *ctx = talloc_parent(src);
void *ctx = ralloc_parent(src);
assert(component < src->type->components());
/* If the source is a constant, just create a new constant instead of a
@@ -993,6 +993,16 @@ ast_function_expression::hir(exec_list *instructions,
const glsl_type *const constructor_type = type->glsl_type(& name, state);
/* constructor_type can be NULL if a variable with the same name as the
* structure has come into scope.
*/
if (constructor_type == NULL) {
_mesa_glsl_error(& loc, state, "unknown type `%s' (structure name "
"may be shadowed by a variable with the same name)",
type->type_name);
return ir_call::get_error_instruction(ctx);
}
/* Constructors for samplers are illegal.
*/
@@ -1022,6 +1032,57 @@ ast_function_expression::hir(exec_list *instructions,
* correct order. These constructors follow essentially the same type
* matching rules as functions.
*/
if (constructor_type->is_record()) {
exec_list actual_parameters;
process_parameters(instructions, &actual_parameters,
&this->expressions, state);
exec_node *node = actual_parameters.head;
for (unsigned i = 0; i < constructor_type->length; i++) {
ir_rvalue *ir = (ir_rvalue *) node;
if (node->is_tail_sentinel()) {
_mesa_glsl_error(&loc, state,
"insufficient parameters to constructor "
"for `%s'",
constructor_type->name);
return ir_call::get_error_instruction(ctx);
}
if (apply_implicit_conversion(constructor_type->fields.structure[i].type,
ir, state)) {
node->replace_with(ir);
} else {
_mesa_glsl_error(&loc, state,
"parameter type mismatch in constructor "
"for `%s.%s' (%s vs %s)",
constructor_type->name,
constructor_type->fields.structure[i].name,
ir->type->name,
constructor_type->fields.structure[i].type->name);
return ir_call::get_error_instruction(ctx);;
}
node = node->next;
}
if (!node->is_tail_sentinel()) {
_mesa_glsl_error(&loc, state, "too many parameters in constructor "
"for `%s'", constructor_type->name);
return ir_call::get_error_instruction(ctx);
}
ir_rvalue *const constant =
constant_record_constructor(constructor_type, &actual_parameters,
state);
return (constant != NULL)
? constant
: emit_inline_record_constructor(constructor_type, instructions,
&actual_parameters, state);
}
if (!constructor_type->is_numeric() && !constructor_type->is_boolean())
return ir_call::get_error_instruction(ctx);
@@ -1197,54 +1258,6 @@ ast_function_expression::hir(exec_list *instructions,
process_parameters(instructions, &actual_parameters, &this->expressions,
state);
const glsl_type *const type =
state->symbols->get_type(id->primary_expression.identifier);
if ((type != NULL) && type->is_record()) {
exec_node *node = actual_parameters.head;
for (unsigned i = 0; i < type->length; i++) {
ir_rvalue *ir = (ir_rvalue *) node;
if (node->is_tail_sentinel()) {
_mesa_glsl_error(&loc, state,
"insufficient parameters to constructor "
"for `%s'",
type->name);
return ir_call::get_error_instruction(ctx);
}
if (apply_implicit_conversion(type->fields.structure[i].type, ir,
state)) {
node->replace_with(ir);
} else {
_mesa_glsl_error(&loc, state,
"parameter type mismatch in constructor "
"for `%s.%s' (%s vs %s)",
type->name,
type->fields.structure[i].name,
ir->type->name,
type->fields.structure[i].type->name);
return ir_call::get_error_instruction(ctx);;
}
node = node->next;
}
if (!node->is_tail_sentinel()) {
_mesa_glsl_error(&loc, state, "too many parameters in constructor "
"for `%s'", type->name);
return ir_call::get_error_instruction(ctx);
}
ir_rvalue *const constant =
constant_record_constructor(type, &actual_parameters, state);
return (constant != NULL)
? constant
: emit_inline_record_constructor(type, instructions,
&actual_parameters, state);
}
return match_function_by_name(instructions,
id->primary_expression.identifier, & loc,
&actual_parameters, state);

View File

@@ -435,6 +435,13 @@ modulus_result_type(const struct glsl_type *type_a,
const struct glsl_type *type_b,
struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
{
if (state->language_version < 130) {
_mesa_glsl_error(loc, state,
"operator '%%' is reserved in %s",
state->version_string);
return glsl_type::error_type;
}
/* From GLSL 1.50 spec, page 56:
* "The operator modulus (%) operates on signed or unsigned integers or
* integer vectors. The operand types must both be signed or both be
@@ -596,7 +603,8 @@ shift_result_type(const struct glsl_type *type_a,
*/
ir_rvalue *
validate_assignment(struct _mesa_glsl_parse_state *state,
const glsl_type *lhs_type, ir_rvalue *rhs)
const glsl_type *lhs_type, ir_rvalue *rhs,
bool is_initializer)
{
const glsl_type *rhs_type = rhs->type;
@@ -612,12 +620,13 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
return rhs;
/* If the array element types are the same and the size of the LHS is zero,
* the assignment is okay.
* the assignment is okay for initializers embedded in variable
* declarations.
*
* Note: Whole-array assignments are not permitted in GLSL 1.10, but this
* is handled by ir_dereference::is_lvalue.
*/
if (lhs_type->is_array() && rhs->type->is_array()
if (is_initializer && lhs_type->is_array() && rhs->type->is_array()
&& (lhs_type->element_type() == rhs->type->element_type())
&& (lhs_type->array_size() == 0)) {
return rhs;
@@ -635,7 +644,7 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
ir_rvalue *
do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
ir_rvalue *lhs, ir_rvalue *rhs,
ir_rvalue *lhs, ir_rvalue *rhs, bool is_initializer,
YYLTYPE lhs_loc)
{
void *ctx = state;
@@ -654,7 +663,8 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
}
}
ir_rvalue *new_rhs = validate_assignment(state, lhs->type, rhs);
ir_rvalue *new_rhs =
validate_assignment(state, lhs->type, rhs, is_initializer);
if (new_rhs == NULL) {
_mesa_glsl_error(& lhs_loc, state, "type mismatch");
} else {
@@ -715,7 +725,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
static ir_rvalue *
get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
{
void *ctx = talloc_parent(lvalue);
void *ctx = ralloc_parent(lvalue);
ir_variable *var;
var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp",
@@ -907,7 +917,7 @@ ast_expression::hir(exec_list *instructions,
op[0] = this->subexpressions[0]->hir(instructions, state);
op[1] = this->subexpressions[1]->hir(instructions, state);
result = do_assignment(instructions, state, op[0], op[1],
result = do_assignment(instructions, state, op[0], op[1], false,
this->subexpressions[0]->get_location());
error_emitted = result->type->is_error();
type = result->type;
@@ -1234,7 +1244,7 @@ ast_expression::hir(exec_list *instructions,
op[0], op[1]);
result = do_assignment(instructions, state,
op[0]->clone(ctx, NULL), temp_rhs,
op[0]->clone(ctx, NULL), temp_rhs, false,
this->subexpressions[0]->get_location());
type = result->type;
error_emitted = (op[0]->type->is_error());
@@ -1260,7 +1270,7 @@ ast_expression::hir(exec_list *instructions,
op[0], op[1]);
result = do_assignment(instructions, state,
op[0]->clone(ctx, NULL), temp_rhs,
op[0]->clone(ctx, NULL), temp_rhs, false,
this->subexpressions[0]->get_location());
type = result->type;
error_emitted = type->is_error();
@@ -1276,7 +1286,7 @@ ast_expression::hir(exec_list *instructions,
ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper],
type, op[0], op[1]);
result = do_assignment(instructions, state, op[0]->clone(ctx, NULL),
temp_rhs,
temp_rhs, false,
this->subexpressions[0]->get_location());
error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
break;
@@ -1292,7 +1302,7 @@ ast_expression::hir(exec_list *instructions,
ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper],
type, op[0], op[1]);
result = do_assignment(instructions, state, op[0]->clone(ctx, NULL),
temp_rhs,
temp_rhs, false,
this->subexpressions[0]->get_location());
error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
break;
@@ -1408,7 +1418,7 @@ ast_expression::hir(exec_list *instructions,
op[0], op[1]);
result = do_assignment(instructions, state,
op[0]->clone(ctx, NULL), temp_rhs,
op[0]->clone(ctx, NULL), temp_rhs, false,
this->subexpressions[0]->get_location());
type = result->type;
error_emitted = op[0]->type->is_error();
@@ -1437,7 +1447,7 @@ ast_expression::hir(exec_list *instructions,
result = get_lvalue_copy(instructions, op[0]->clone(ctx, NULL));
(void)do_assignment(instructions, state,
op[0]->clone(ctx, NULL), temp_rhs,
op[0]->clone(ctx, NULL), temp_rhs, false,
this->subexpressions[0]->get_location());
type = result->type;
@@ -1567,18 +1577,38 @@ ast_expression::hir(exec_list *instructions,
}
}
/* From section 4.1.7 of the GLSL 1.30 spec:
/* From page 23 (29 of the PDF) of the GLSL 1.30 spec:
*
* "Samplers aggregated into arrays within a shader (using square
* brackets [ ]) can only be indexed with integral constant
* expressions [...]."
*
* This restriction was added in GLSL 1.30. Shaders using earlier version
* of the language should not be rejected by the compiler front-end for
* using this construct. This allows useful things such as using a loop
* counter as the index to an array of samplers. If the loop in unrolled,
* the code should compile correctly. Instead, emit a warning.
*/
if (array->type->is_array() &&
array->type->element_type()->is_sampler() &&
const_index == NULL) {
_mesa_glsl_error(&loc, state, "sampler arrays can only be indexed "
"with constant expressions");
error_emitted = true;
if (state->language_version == 100) {
_mesa_glsl_warning(&loc, state,
"sampler arrays indexed with non-constant "
"expressions is optional in GLSL ES 1.00");
} else if (state->language_version < 130) {
_mesa_glsl_warning(&loc, state,
"sampler arrays indexed with non-constant "
"expressions is forbidden in GLSL 1.30 and "
"later");
} else {
_mesa_glsl_error(&loc, state,
"sampler arrays indexed with non-constant "
"expressions is forbidden in GLSL 1.30 and "
"later");
error_emitted = true;
}
}
if (error_emitted)
@@ -1606,6 +1636,7 @@ ast_expression::hir(exec_list *instructions,
result = new(ctx) ir_dereference_variable(var);
if (var != NULL) {
var->used = true;
type = result->type;
} else {
_mesa_glsl_error(& loc, state, "`%s' undeclared",
@@ -1780,10 +1811,17 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
struct _mesa_glsl_parse_state *state,
YYLTYPE *loc)
{
if (qual->flags.q.invariant)
var->invariant = 1;
if (qual->flags.q.invariant) {
if (var->used) {
_mesa_glsl_error(loc, state,
"variable `%s' may not be redeclared "
"`invariant' after being used",
var->name);
} else {
var->invariant = 1;
}
}
/* FINISHME: Mark 'in' variables at global scope as read-only. */
if (qual->flags.q.constant || qual->flags.q.attribute
|| qual->flags.q.uniform
|| (qual->flags.q.varying && (state->target == fragment_shader)))
@@ -1835,6 +1873,23 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
else if (qual->flags.q.uniform)
var->mode = ir_var_uniform;
if (state->all_invariant && (state->current_function == NULL)) {
switch (state->target) {
case vertex_shader:
if (var->mode == ir_var_out)
var->invariant = true;
break;
case geometry_shader:
if ((var->mode == ir_var_in) || (var->mode == ir_var_out))
var->invariant = true;
break;
case fragment_shader:
if (var->mode == ir_var_in)
var->invariant = true;
break;
}
}
if (qual->flags.q.flat)
var->interpolation = ir_var_flat;
else if (qual->flags.q.noperspective)
@@ -1914,11 +1969,260 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
}
/* Does the declaration use the 'layout' keyword?
*/
const bool uses_layout = qual->flags.q.pixel_center_integer
|| qual->flags.q.origin_upper_left
|| qual->flags.q.explicit_location;
/* Does the declaration use the deprecated 'attribute' or 'varying'
* keywords?
*/
const bool uses_deprecated_qualifier = qual->flags.q.attribute
|| qual->flags.q.varying;
/* Is the 'layout' keyword used with parameters that allow relaxed checking.
* Many implementations of GL_ARB_fragment_coord_conventions_enable and some
* implementations (only Mesa?) GL_ARB_explicit_attrib_location_enable
* allowed the layout qualifier to be used with 'varying' and 'attribute'.
* These extensions and all following extensions that add the 'layout'
* keyword have been modified to require the use of 'in' or 'out'.
*
* The following extension do not allow the deprecated keywords:
*
* GL_AMD_conservative_depth
* GL_ARB_gpu_shader5
* GL_ARB_separate_shader_objects
* GL_ARB_tesselation_shader
* GL_ARB_transform_feedback3
* GL_ARB_uniform_buffer_object
*
* It is unknown whether GL_EXT_shader_image_load_store or GL_NV_gpu_shader5
* allow layout with the deprecated keywords.
*/
const bool relaxed_layout_qualifier_checking =
state->ARB_fragment_coord_conventions_enable;
if (uses_layout && uses_deprecated_qualifier) {
if (relaxed_layout_qualifier_checking) {
_mesa_glsl_warning(loc, state,
"`layout' qualifier may not be used with "
"`attribute' or `varying'");
} else {
_mesa_glsl_error(loc, state,
"`layout' qualifier may not be used with "
"`attribute' or `varying'");
}
}
if (var->type->is_array() && state->language_version != 110) {
var->array_lvalue = true;
}
}
/**
* Get the variable that is being redeclared by this declaration
*
* Semantic checks to verify the validity of the redeclaration are also
* performed. If semantic checks fail, compilation error will be emitted via
* \c _mesa_glsl_error, but a non-\c NULL pointer will still be returned.
*
* \returns
* A pointer to an existing variable in the current scope if the declaration
* is a redeclaration, \c NULL otherwise.
*/
ir_variable *
get_variable_being_redeclared(ir_variable *var, ast_declaration *decl,
struct _mesa_glsl_parse_state *state)
{
/* Check if this declaration is actually a re-declaration, either to
* resize an array or add qualifiers to an existing variable.
*
* This is allowed for variables in the current scope, or when at
* global scope (for built-ins in the implicit outer scope).
*/
ir_variable *earlier = state->symbols->get_variable(decl->identifier);
if (earlier == NULL ||
(state->current_function != NULL &&
!state->symbols->name_declared_this_scope(decl->identifier))) {
return NULL;
}
YYLTYPE loc = decl->get_location();
/* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec,
*
* "It is legal to declare an array without a size and then
* later re-declare the same name as an array of the same
* type and specify a size."
*/
if ((earlier->type->array_size() == 0)
&& var->type->is_array()
&& (var->type->element_type() == earlier->type->element_type())) {
/* FINISHME: This doesn't match the qualifiers on the two
* FINISHME: declarations. It's not 100% clear whether this is
* FINISHME: required or not.
*/
/* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
*
* "The size [of gl_TexCoord] can be at most
* gl_MaxTextureCoords."
*/
const unsigned size = unsigned(var->type->array_size());
if ((strcmp("gl_TexCoord", var->name) == 0)
&& (size > state->Const.MaxTextureCoords)) {
_mesa_glsl_error(& loc, state, "`gl_TexCoord' array size cannot "
"be larger than gl_MaxTextureCoords (%u)\n",
state->Const.MaxTextureCoords);
} else if ((size > 0) && (size <= earlier->max_array_access)) {
_mesa_glsl_error(& loc, state, "array size must be > %u due to "
"previous access",
earlier->max_array_access);
}
earlier->type = var->type;
delete var;
var = NULL;
} else if (state->ARB_fragment_coord_conventions_enable
&& strcmp(var->name, "gl_FragCoord") == 0
&& earlier->type == var->type
&& earlier->mode == var->mode) {
/* Allow redeclaration of gl_FragCoord for ARB_fcc layout
* qualifiers.
*/
earlier->origin_upper_left = var->origin_upper_left;
earlier->pixel_center_integer = var->pixel_center_integer;
} else {
_mesa_glsl_error(&loc, state, "`%s' redeclared", decl->identifier);
}
return earlier;
}
/**
* Generate the IR for an initializer in a variable declaration
*/
ir_rvalue *
process_initializer(ir_variable *var, ast_declaration *decl,
ast_fully_specified_type *type,
exec_list *initializer_instructions,
struct _mesa_glsl_parse_state *state)
{
ir_rvalue *result = NULL;
YYLTYPE initializer_loc = decl->initializer->get_location();
/* From page 24 (page 30 of the PDF) of the GLSL 1.10 spec:
*
* "All uniform variables are read-only and are initialized either
* directly by an application via API commands, or indirectly by
* OpenGL."
*/
if ((state->language_version <= 110)
&& (var->mode == ir_var_uniform)) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize uniforms in GLSL 1.10");
}
if (var->type->is_sampler()) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize samplers");
}
if ((var->mode == ir_var_in) && (state->current_function == NULL)) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize %s shader input / %s",
_mesa_glsl_shader_target_name(state->target),
(state->target == vertex_shader)
? "attribute" : "varying");
}
ir_dereference *const lhs = new(state) ir_dereference_variable(var);
ir_rvalue *rhs = decl->initializer->hir(initializer_instructions,
state);
/* Calculate the constant value if this is a const or uniform
* declaration.
*/
if (type->qualifier.flags.q.constant
|| type->qualifier.flags.q.uniform) {
ir_rvalue *new_rhs = validate_assignment(state, var->type, rhs, true);
if (new_rhs != NULL) {
rhs = new_rhs;
ir_constant *constant_value = rhs->constant_expression_value();
if (!constant_value) {
_mesa_glsl_error(& initializer_loc, state,
"initializer of %s variable `%s' must be a "
"constant expression",
(type->qualifier.flags.q.constant)
? "const" : "uniform",
decl->identifier);
if (var->type->is_numeric()) {
/* Reduce cascading errors. */
var->constant_value = ir_constant::zero(state, var->type);
}
} else {
rhs = constant_value;
var->constant_value = constant_value;
}
} else {
_mesa_glsl_error(&initializer_loc, state,
"initializer of type %s cannot be assigned to "
"variable of type %s",
rhs->type->name, var->type->name);
if (var->type->is_numeric()) {
/* Reduce cascading errors. */
var->constant_value = ir_constant::zero(state, var->type);
}
}
}
if (rhs && !rhs->type->is_error()) {
bool temp = var->read_only;
if (type->qualifier.flags.q.constant)
var->read_only = false;
/* Never emit code to initialize a uniform.
*/
const glsl_type *initializer_type;
if (!type->qualifier.flags.q.uniform) {
result = do_assignment(initializer_instructions, state,
lhs, rhs, true,
type->get_location());
initializer_type = result->type;
} else
initializer_type = rhs->type;
/* If the declared variable is an unsized array, it must inherrit
* its full type from the initializer. A declaration such as
*
* uniform float a[] = float[](1.0, 2.0, 3.0, 3.0);
*
* becomes
*
* uniform float a[4] = float[](1.0, 2.0, 3.0, 3.0);
*
* The assignment generated in the if-statement (below) will also
* automatically handle this case for non-uniforms.
*
* If the declared variable is not an array, the types must
* already match exactly. As a result, the type assignment
* here can be done unconditionally. For non-uniforms the call
* to do_assignment can change the type of the initializer (via
* the implicit conversion rules). For uniforms the initializer
* must be a constant expression, and the type of that expression
* was validated above.
*/
var->type = initializer_type;
var->read_only = temp;
}
return result;
}
ir_rvalue *
ast_declarator_list::hir(exec_list *instructions,
@@ -1971,6 +2275,11 @@ ast_declarator_list::hir(exec_list *instructions,
_mesa_glsl_error(& loc, state,
"`%s' cannot be marked invariant, fragment shader "
"inputs only\n", decl->identifier);
} else if (earlier->used) {
_mesa_glsl_error(& loc, state,
"variable `%s' may not be redeclared "
"`invariant' after being used",
earlier->name);
} else {
earlier->invariant = true;
}
@@ -2040,20 +2349,23 @@ ast_declarator_list::hir(exec_list *instructions,
*
* Local variables can only use the qualifier const."
*
* This is relaxed in GLSL 1.30.
* This is relaxed in GLSL 1.30. It is also relaxed by any extension
* that adds the 'layout' keyword.
*/
if (state->language_version < 120) {
if ((state->language_version < 130)
&& !state->ARB_explicit_attrib_location_enable
&& !state->ARB_fragment_coord_conventions_enable) {
if (this->type->qualifier.flags.q.out) {
_mesa_glsl_error(& loc, state,
"`out' qualifier in declaration of `%s' "
"only valid for function parameters in GLSL 1.10.",
decl->identifier);
"only valid for function parameters in %s.",
decl->identifier, state->version_string);
}
if (this->type->qualifier.flags.q.in) {
_mesa_glsl_error(& loc, state,
"`in' qualifier in declaration of `%s' "
"only valid for function parameters in GLSL 1.10.",
decl->identifier);
"only valid for function parameters in %s.",
decl->identifier, state->version_string);
}
/* FINISHME: Test for other invalid qualifiers. */
}
@@ -2109,6 +2421,8 @@ ast_declarator_list::hir(exec_list *instructions,
mode, var->name, extra);
}
} else if (var->mode == ir_var_in) {
var->read_only = true;
if (state->target == vertex_shader) {
bool error_emitted = false;
@@ -2161,6 +2475,45 @@ ast_declarator_list::hir(exec_list *instructions,
}
}
/* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
*/
if (this->type->specifier->precision != ast_precision_none
&& state->language_version != 100
&& state->language_version < 130) {
_mesa_glsl_error(&loc, state,
"precision qualifiers are supported only in GLSL ES "
"1.00, and GLSL 1.30 and later");
}
/* Precision qualifiers only apply to floating point and integer types.
*
* From section 4.5.2 of the GLSL 1.30 spec:
* "Any floating point or any integer declaration can have the type
* preceded by one of these precision qualifiers [...] Literal
* constants do not have precision qualifiers. Neither do Boolean
* variables.
*
* In GLSL ES, sampler types are also allowed.
*
* From page 87 of the GLSL ES spec:
* "RESOLUTION: Allow sampler types to take a precision qualifier."
*/
if (this->type->specifier->precision != ast_precision_none
&& !var->type->is_float()
&& !var->type->is_integer()
&& !(var->type->is_sampler() && state->es_shader)
&& !(var->type->is_array()
&& (var->type->fields.array->is_float()
|| var->type->fields.array->is_integer()))) {
_mesa_glsl_error(&loc, state,
"precision qualifiers apply only to floating point"
"%s types", state->es_shader ? ", integer, and sampler"
: "and integer");
}
/* Process the initializer and add its instructions to a temporary
* list. This list will be added to the instruction stream (below) after
* the declaration is added. This is done because in some cases (such as
@@ -2168,106 +2521,12 @@ ast_declarator_list::hir(exec_list *instructions,
* instruction stream.
*/
exec_list initializer_instructions;
ir_variable *earlier = get_variable_being_redeclared(var, decl, state);
if (decl->initializer != NULL) {
YYLTYPE initializer_loc = decl->initializer->get_location();
/* From page 24 (page 30 of the PDF) of the GLSL 1.10 spec:
*
* "All uniform variables are read-only and are initialized either
* directly by an application via API commands, or indirectly by
* OpenGL."
*/
if ((state->language_version <= 110)
&& (var->mode == ir_var_uniform)) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize uniforms in GLSL 1.10");
}
if (var->type->is_sampler()) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize samplers");
}
if ((var->mode == ir_var_in) && (state->current_function == NULL)) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize %s shader input / %s",
_mesa_glsl_shader_target_name(state->target),
(state->target == vertex_shader)
? "attribute" : "varying");
}
ir_dereference *const lhs = new(ctx) ir_dereference_variable(var);
ir_rvalue *rhs = decl->initializer->hir(&initializer_instructions,
state);
/* Calculate the constant value if this is a const or uniform
* declaration.
*/
if (this->type->qualifier.flags.q.constant
|| this->type->qualifier.flags.q.uniform) {
ir_rvalue *new_rhs = validate_assignment(state, var->type, rhs);
if (new_rhs != NULL) {
rhs = new_rhs;
ir_constant *constant_value = rhs->constant_expression_value();
if (!constant_value) {
_mesa_glsl_error(& initializer_loc, state,
"initializer of %s variable `%s' must be a "
"constant expression",
(this->type->qualifier.flags.q.constant)
? "const" : "uniform",
decl->identifier);
if (var->type->is_numeric()) {
/* Reduce cascading errors. */
var->constant_value = ir_constant::zero(ctx, var->type);
}
} else {
rhs = constant_value;
var->constant_value = constant_value;
}
} else {
_mesa_glsl_error(&initializer_loc, state,
"initializer of type %s cannot be assigned to "
"variable of type %s",
rhs->type->name, var->type->name);
if (var->type->is_numeric()) {
/* Reduce cascading errors. */
var->constant_value = ir_constant::zero(ctx, var->type);
}
}
}
if (rhs && !rhs->type->is_error()) {
bool temp = var->read_only;
if (this->type->qualifier.flags.q.constant)
var->read_only = false;
/* If the declared variable is an unsized array, it must inherrit
* its full type from the initializer. A declaration such as
*
* uniform float a[] = float[](1.0, 2.0, 3.0, 3.0);
*
* becomes
*
* uniform float a[4] = float[](1.0, 2.0, 3.0, 3.0);
*
* The assignment generated in the if-statement (below) will also
* automatically handle this case for non-uniforms.
*
* If the declared variable is not an array, the types must
* already match exactly. As a result, the type assignment
* here can be done unconditionally.
*/
var->type = rhs->type;
/* Never emit code to initialize a uniform.
*/
if (!this->type->qualifier.flags.q.uniform)
result = do_assignment(&initializer_instructions, state,
lhs, rhs,
this->get_location());
var->read_only = temp;
}
result = process_initializer((earlier == NULL) ? var : earlier,
decl, this->type,
&initializer_instructions, state);
}
/* From page 23 (page 29 of the PDF) of the GLSL 1.10 spec:
@@ -2278,115 +2537,54 @@ ast_declarator_list::hir(exec_list *instructions,
*/
if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) {
_mesa_glsl_error(& loc, state,
"const declaration of `%s' must be initialized");
"const declaration of `%s' must be initialized",
decl->identifier);
}
/* Check if this declaration is actually a re-declaration, either to
* resize an array or add qualifiers to an existing variable.
*
* This is allowed for variables in the current scope, or when at
* global scope (for built-ins in the implicit outer scope).
/* If the declaration is not a redeclaration, there are a few additional
* semantic checks that must be applied. In addition, variable that was
* created for the declaration should be added to the IR stream.
*/
ir_variable *earlier = state->symbols->get_variable(decl->identifier);
if (earlier != NULL && (state->current_function == NULL ||
state->symbols->name_declared_this_scope(decl->identifier))) {
/* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec,
if (earlier == NULL) {
/* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
*
* "It is legal to declare an array without a size and then
* later re-declare the same name as an array of the same
* type and specify a size."
* "Identifiers starting with "gl_" are reserved for use by
* OpenGL, and may not be declared in a shader as either a
* variable or a function."
*/
if ((earlier->type->array_size() == 0)
&& var->type->is_array()
&& (var->type->element_type() == earlier->type->element_type())) {
/* FINISHME: This doesn't match the qualifiers on the two
* FINISHME: declarations. It's not 100% clear whether this is
* FINISHME: required or not.
*/
if (strncmp(decl->identifier, "gl_", 3) == 0)
_mesa_glsl_error(& loc, state,
"identifier `%s' uses reserved `gl_' prefix",
decl->identifier);
/* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
*
* "The size [of gl_TexCoord] can be at most
* gl_MaxTextureCoords."
*/
const unsigned size = unsigned(var->type->array_size());
if ((strcmp("gl_TexCoord", var->name) == 0)
&& (size > state->Const.MaxTextureCoords)) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state, "`gl_TexCoord' array size cannot "
"be larger than gl_MaxTextureCoords (%u)\n",
state->Const.MaxTextureCoords);
} else if ((size > 0) && (size <= earlier->max_array_access)) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state, "array size must be > %u due to "
"previous access",
earlier->max_array_access);
}
earlier->type = var->type;
delete var;
var = NULL;
} else if (state->ARB_fragment_coord_conventions_enable
&& strcmp(var->name, "gl_FragCoord") == 0
&& earlier->type == var->type
&& earlier->mode == var->mode) {
/* Allow redeclaration of gl_FragCoord for ARB_fcc layout
* qualifiers.
*/
earlier->origin_upper_left = var->origin_upper_left;
earlier->pixel_center_integer = var->pixel_center_integer;
} else {
/* Add the variable to the symbol table. Note that the initializer's
* IR was already processed earlier (though it hasn't been emitted
* yet), without the variable in scope.
*
* This differs from most C-like languages, but it follows the GLSL
* specification. From page 28 (page 34 of the PDF) of the GLSL 1.50
* spec:
*
* "Within a declaration, the scope of a name starts immediately
* after the initializer if present or immediately after the name
* being declared if not."
*/
if (!state->symbols->add_variable(var)) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(&loc, state, "`%s' redeclared", decl->identifier);
_mesa_glsl_error(&loc, state, "name `%s' already taken in the "
"current scope", decl->identifier);
continue;
}
continue;
/* Push the variable declaration to the top. It means that all the
* variable declarations will appear in a funny last-to-first order,
* but otherwise we run into trouble if a function is prototyped, a
* global var is decled, then the function is defined with usage of
* the global var. See glslparsertest's CorrectModule.frag.
*/
instructions->push_head(var);
}
/* By now, we know it's a new variable declaration (we didn't hit the
* above "continue").
*
* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
*
* "Identifiers starting with "gl_" are reserved for use by
* OpenGL, and may not be declared in a shader as either a
* variable or a function."
*/
if (strncmp(decl->identifier, "gl_", 3) == 0)
_mesa_glsl_error(& loc, state,
"identifier `%s' uses reserved `gl_' prefix",
decl->identifier);
/* Add the variable to the symbol table. Note that the initializer's
* IR was already processed earlier (though it hasn't been emitted yet),
* without the variable in scope.
*
* This differs from most C-like languages, but it follows the GLSL
* specification. From page 28 (page 34 of the PDF) of the GLSL 1.50
* spec:
*
* "Within a declaration, the scope of a name starts immediately
* after the initializer if present or immediately after the name
* being declared if not."
*/
if (!state->symbols->add_variable(var)) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(&loc, state, "name `%s' already taken in the "
"current scope", decl->identifier);
continue;
}
/* Push the variable declaration to the top. It means that all
* the variable declarations will appear in a funny
* last-to-first order, but otherwise we run into trouble if a
* function is prototyped, a global var is decled, then the
* function is defined with usage of the global var. See
* glslparsertest's CorrectModule.frag.
*/
instructions->push_head(var);
instructions->append_list(&initializer_instructions);
}
@@ -2749,27 +2947,26 @@ ast_jump_statement::hir(exec_list *instructions,
assert(state->current_function);
if (opt_return_value) {
if (state->current_function->return_type->base_type ==
GLSL_TYPE_VOID) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state,
"`return` with a value, in function `%s' "
"returning void",
state->current_function->function_name());
}
ir_rvalue *const ret = opt_return_value->hir(instructions, state);
assert(ret != NULL);
/* The value of the return type can be NULL if the shader says
* 'return foo();' and foo() is a function that returns void.
*
* NOTE: The GLSL spec doesn't 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. Seriously.
*/
const glsl_type *const ret_type =
(ret == NULL) ? glsl_type::void_type : ret->type;
/* Implicit conversions are not allowed for return values. */
if (state->current_function->return_type != ret->type) {
if (state->current_function->return_type != ret_type) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state,
"`return' with wrong type %s, in function `%s' "
"returning %s",
ret->type->name,
ret_type->name,
state->current_function->function_name(),
state->current_function->return_type->name);
}
@@ -2986,6 +3183,58 @@ ir_rvalue *
ast_type_specifier::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
if (!this->is_precision_statement && this->structure == NULL)
return NULL;
YYLTYPE loc = this->get_location();
if (this->precision != ast_precision_none
&& state->language_version != 100
&& state->language_version < 130) {
_mesa_glsl_error(&loc, state,
"precision qualifiers exist only in "
"GLSL ES 1.00, and GLSL 1.30 and later");
return NULL;
}
if (this->precision != ast_precision_none
&& this->structure != NULL) {
_mesa_glsl_error(&loc, state,
"precision qualifiers do not apply to structures");
return NULL;
}
/* If this is a precision statement, check that the type to which it is
* applied is either float or int.
*
* From section 4.5.3 of the GLSL 1.30 spec:
* "The precision statement
* precision precision-qualifier type;
* can be used to establish a default precision qualifier. The type
* field can be either int or float [...]. Any other types or
* qualifiers will result in an error.
*/
if (this->is_precision_statement) {
assert(this->precision != ast_precision_none);
assert(this->structure == NULL); /* The check for structures was
* performed above. */
if (this->is_array) {
_mesa_glsl_error(&loc, state,
"default precision statements do not apply to "
"arrays");
return NULL;
}
if (this->type_specifier != ast_float
&& this->type_specifier != ast_int) {
_mesa_glsl_error(&loc, state,
"default precision statements apply only to types "
"float and int");
return NULL;
}
/* FINISHME: Translate precision statements into IR. */
return NULL;
}
if (this->structure != NULL)
return this->structure->hir(instructions, state);
@@ -3016,7 +3265,7 @@ ast_struct_specifier::hir(exec_list *instructions,
* the types to HIR. This ensures that structure definitions embedded in
* other structure definitions are processed.
*/
glsl_struct_field *const fields = talloc_array(state, glsl_struct_field,
glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field,
decl_count);
unsigned i = 0;
@@ -3062,11 +3311,9 @@ ast_struct_specifier::hir(exec_list *instructions,
if (!state->symbols->add_type(name, t)) {
_mesa_glsl_error(& loc, state, "struct `%s' previously defined", name);
} else {
const glsl_type **s = (const glsl_type **)
realloc(state->user_structures,
sizeof(state->user_structures[0]) *
(state->num_user_structures + 1));
const glsl_type **s = reralloc(state, state->user_structures,
const glsl_type *,
state->num_user_structures + 1);
if (s != NULL) {
s[state->num_user_structures] = t;
state->user_structures = s;

View File

@@ -21,7 +21,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <cstdio>
#include <stdio.h>
#include "ast.h"
extern "C" {
#include "program/symbol_table.h"
@@ -49,7 +49,8 @@ ast_type_specifier::print(void) const
ast_type_specifier::ast_type_specifier(int specifier)
: type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
is_array(false), array_size(NULL), precision(ast_precision_high)
is_array(false), array_size(NULL), precision(ast_precision_none),
is_precision_statement(false)
{
static const char *const names[] = {
"void",

View File

@@ -63,7 +63,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
if (st->error) {
printf("error reading builtin: %.35s ...\n", functions[i]);
printf("Info log:\n%s\n", st->info_log);
talloc_free(sh);
ralloc_free(sh);
return NULL;
}
}
@@ -3010,40 +3010,26 @@ static const char builtin_smoothstep[] =
" (declare (in) float edge1)\n"
" (declare (in) float x))\n"
" ((declare () float t)\n"
"\n"
" (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n"
"\n"
" (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t))))))))\n"
" (signature vec2\n"
" (parameters\n"
" (declare (in) float edge0)\n"
" (declare (in) float edge1)\n"
" (declare (in) vec2 x))\n"
" ((declare () vec2 t)\n"
" (declare () vec2 retval)\n"
"\n"
" (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (assign (constant bool (1)) (xy) (var_ref t)\n"
" (expression vec2 max\n"
" (expression vec2 min\n"
" (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
"\n"
" (assign (constant bool (1)) (y) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
" (return (var_ref retval))\n"
" ))\n"
" (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))\n"
"\n"
" (signature vec3\n"
" (parameters\n"
@@ -3051,33 +3037,13 @@ static const char builtin_smoothstep[] =
" (declare (in) float edge1)\n"
" (declare (in) vec3 x))\n"
" ((declare () vec3 t)\n"
" (declare () vec3 retval)\n"
"\n"
" (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (assign (constant bool (1)) (xyz) (var_ref t)\n"
" (expression vec3 max\n"
" (expression vec3 min\n"
" (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
"\n"
" (assign (constant bool (1)) (y) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
"\n"
" (assign (constant bool (1)) (z) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
" (return (var_ref retval))\n"
" ))\n"
" (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))\n"
"\n"
"\n"
" (signature vec4\n"
@@ -3086,74 +3052,55 @@ static const char builtin_smoothstep[] =
" (declare (in) float edge1)\n"
" (declare (in) vec4 x))\n"
" ((declare () vec4 t)\n"
" (declare () vec4 retval)\n"
"\n"
" (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (assign (constant bool (1)) (xyzw) (var_ref t)\n"
" (expression vec4 max\n"
" (expression vec4 min\n"
" (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
"\n"
" (assign (constant bool (1)) (y) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
"\n"
" (assign (constant bool (1)) (z) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
"\n"
" (assign (constant bool (1)) (w) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (assign (constant bool (1)) (w) (var_ref retval) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
" (return (var_ref retval))\n"
" ))\n"
" (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))\n"
"\n"
" (signature vec2\n"
" (parameters\n"
" (declare (in) vec2 edge0)\n"
" (declare (in) vec2 edge1)\n"
" (declare (in) vec2 x))\n"
" ((return (expression vec2 max\n"
" ((declare () vec2 t)\n"
" (assign (constant bool (1)) (xy) (var_ref t)\n"
" (expression vec2 max\n"
" (expression vec2 min\n"
" (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))\n"
" (constant vec2 (1.0 1.0)))\n"
" (constant vec2 (0.0 0.0))))))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))\n"
"\n"
" (signature vec3\n"
" (parameters\n"
" (declare (in) vec3 edge0)\n"
" (declare (in) vec3 edge1)\n"
" (declare (in) vec3 x))\n"
" ((return (expression vec3 max\n"
" ((declare () vec3 t)\n"
" (assign (constant bool (1)) (xyz) (var_ref t)\n"
" (expression vec3 max\n"
" (expression vec3 min\n"
" (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))\n"
" (constant vec3 (1.0 1.0 1.0)))\n"
" (constant vec3 (0.0 0.0 0.0))))))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))\n"
"\n"
" (signature vec4\n"
" (parameters\n"
" (declare (in) vec4 edge0)\n"
" (declare (in) vec4 edge1)\n"
" (declare (in) vec4 x))\n"
" ((return (expression vec4 max\n"
" ((declare () vec4 t)\n"
" (assign (constant bool (1)) (xyzw) (var_ref t)\n"
" (expression vec4 max\n"
" (expression vec4 min\n"
" (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))\n"
" (constant vec4 (1.0 1.0 1.0 1.0)))\n"
" (constant vec4 (0.0 0.0 0.0 0.0))))))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
" (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))\n"
"))\n"
"\n"
""
@@ -13569,7 +13516,7 @@ void *builtin_mem_ctx = NULL;
void
_mesa_glsl_release_functions(void)
{
talloc_free(builtin_mem_ctx);
ralloc_free(builtin_mem_ctx);
builtin_mem_ctx = NULL;
memset(builtin_profiles, 0, sizeof(builtin_profiles));
}
@@ -13586,7 +13533,7 @@ _mesa_read_profile(struct _mesa_glsl_parse_state *state,
if (sh == NULL) {
sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count);
talloc_steal(builtin_mem_ctx, sh);
ralloc_steal(builtin_mem_ctx, sh);
builtin_profiles[profile_index] = sh;
}
@@ -13599,7 +13546,7 @@ _mesa_glsl_initialize_functions(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
if (builtin_mem_ctx == NULL) {
builtin_mem_ctx = talloc_init("GLSL built-in functions");
builtin_mem_ctx = ralloc_context(NULL); // "GLSL built-in functions"
memset(&builtin_profiles, 0, sizeof(builtin_profiles));
}

View File

@@ -24,10 +24,11 @@
const glsl_type glsl_type::_error_type =
glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, "");
const glsl_type glsl_type::void_type =
const glsl_type glsl_type::_void_type =
glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void");
const glsl_type *const glsl_type::error_type = & glsl_type::_error_type;
const glsl_type *const glsl_type::void_type = & glsl_type::_void_type;
/** \name Core built-in types
*

View File

@@ -5,40 +5,26 @@
(declare (in) float edge1)
(declare (in) float x))
((declare () float t)
(assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))
(return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t))))))))
(signature vec2
(parameters
(declare (in) float edge0)
(declare (in) float edge1)
(declare (in) vec2 x))
((declare () vec2 t)
(declare () vec2 retval)
(assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(assign (constant bool (1)) (xy) (var_ref t)
(expression vec2 max
(expression vec2 min
(expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
(assign (constant bool (1)) (y) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
(return (var_ref retval))
))
(return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))
(signature vec3
(parameters
@@ -46,33 +32,13 @@
(declare (in) float edge1)
(declare (in) vec3 x))
((declare () vec3 t)
(declare () vec3 retval)
(assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(assign (constant bool (1)) (xyz) (var_ref t)
(expression vec3 max
(expression vec3 min
(expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
(assign (constant bool (1)) (y) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
(assign (constant bool (1)) (z) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
(return (var_ref retval))
))
(return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))
(signature vec4
@@ -81,73 +47,54 @@
(declare (in) float edge1)
(declare (in) vec4 x))
((declare () vec4 t)
(declare () vec4 retval)
(assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(assign (constant bool (1)) (xyzw) (var_ref t)
(expression vec4 max
(expression vec4 min
(expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
(assign (constant bool (1)) (y) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
(assign (constant bool (1)) (z) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
(assign (constant bool (1)) (w) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
(assign (constant bool (1)) (w) (var_ref retval) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))
(return (var_ref retval))
))
(return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))
(signature vec2
(parameters
(declare (in) vec2 edge0)
(declare (in) vec2 edge1)
(declare (in) vec2 x))
((return (expression vec2 max
((declare () vec2 t)
(assign (constant bool (1)) (xy) (var_ref t)
(expression vec2 max
(expression vec2 min
(expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))
(constant vec2 (1.0 1.0)))
(constant vec2 (0.0 0.0))))))
(constant float (1.0)))
(constant float (0.0))))
(return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))
(signature vec3
(parameters
(declare (in) vec3 edge0)
(declare (in) vec3 edge1)
(declare (in) vec3 x))
((return (expression vec3 max
((declare () vec3 t)
(assign (constant bool (1)) (xyz) (var_ref t)
(expression vec3 max
(expression vec3 min
(expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))
(constant vec3 (1.0 1.0 1.0)))
(constant vec3 (0.0 0.0 0.0))))))
(constant float (1.0)))
(constant float (0.0))))
(return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))
(signature vec4
(parameters
(declare (in) vec4 edge0)
(declare (in) vec4 edge1)
(declare (in) vec4 x))
((return (expression vec4 max
((declare () vec4 t)
(assign (constant bool (1)) (xyzw) (var_ref t)
(expression vec4 max
(expression vec4 min
(expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))
(constant vec4 (1.0 1.0 1.0 1.0)))
(constant vec4 (0.0 0.0 0.0 0.0))))))
(constant float (1.0)))
(constant float (0.0))))
(return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))
))

View File

@@ -142,6 +142,8 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
{
struct gl_context fakeCtx;
fakeCtx.API = API_OPENGL;
fakeCtx.Const.GLSLVersion = 130;
fakeCtx.Extensions.ARB_ES2_compatibility = true;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
@@ -168,7 +170,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
if (st->error) {
printf("error reading builtin: %.35s ...\\n", functions[i]);
printf("Info log:\\n%s\\n", st->info_log);
talloc_free(sh);
ralloc_free(sh);
return NULL;
}
}
@@ -193,7 +195,7 @@ void *builtin_mem_ctx = NULL;
void
_mesa_glsl_release_functions(void)
{
talloc_free(builtin_mem_ctx);
ralloc_free(builtin_mem_ctx);
builtin_mem_ctx = NULL;
memset(builtin_profiles, 0, sizeof(builtin_profiles));
}
@@ -210,7 +212,7 @@ _mesa_read_profile(struct _mesa_glsl_parse_state *state,
if (sh == NULL) {
sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count);
talloc_steal(builtin_mem_ctx, sh);
ralloc_steal(builtin_mem_ctx, sh);
builtin_profiles[profile_index] = sh;
}
@@ -223,7 +225,7 @@ _mesa_glsl_initialize_functions(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
if (builtin_mem_ctx == NULL) {
builtin_mem_ctx = talloc_init("GLSL built-in functions");
builtin_mem_ctx = ralloc_context(NULL); // "GLSL built-in functions"
memset(&builtin_profiles, 0, sizeof(builtin_profiles));
}

View File

@@ -358,45 +358,43 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_acclist[137] =
static yyconst flex_int16_t yy_acclist[125] =
{ 0,
3, 3, 44, 39, 43, 40, 43, 41, 43, 43,
38, 43, 43, 38, 43, 38, 43, 38, 43, 25,
39, 43, 24, 39, 43, 38, 43, 38, 43, 38,
43, 37, 39, 43, 37, 39, 43, 38, 43, 40,
43, 23, 43, 43, 3, 43, 4, 43, 5, 43,
42, 43, 39, 18, 40, 32, 35, 33, 2, 1,
25, 39, 25, 39, 39, 24, 39, 24, 39, 27,
29, 31, 30, 28, 37, 39, 37, 39, 34, 40,
23, 23, 3, 4, 5, 6, 5, 7, 1, 26,
39, 37, 39,16398, 26, 39, 37, 39, 18, 37,
43, 23, 43, 3, 43, 4, 43, 5, 43, 42,
43, 18, 43, 18, 43, 18, 43, 39, 40, 32,
35, 33, 2, 1, 25, 39, 25, 39, 39, 24,
39, 24, 39, 27, 29, 31, 30, 28, 37, 39,
37, 39, 34, 40, 23, 23, 3, 4, 5, 6,
5, 7, 1, 26, 39, 37, 39, 26, 39, 37,
39,16399,16400, 8206, 18, 8206, 37, 39, 8207, 18,
8208, 18,16401, 19,16396, 22, 36, 37, 39, 21,
8209, 18, 19, 8204, 18,16397,16404, 8205, 18, 11,
18, 9, 8, 8212, 10, 18
39, 14, 37, 39, 15, 16, 37, 39, 17, 19,
12, 22, 36, 37, 39, 21, 19, 13,16404, 11,
9, 8, 8212, 10
} ;
static yyconst flex_int16_t yy_accept[164] =
static yyconst flex_int16_t yy_accept[155] =
{ 0,
1, 1, 1, 1, 1, 2, 3, 3, 3, 4,
6, 8, 10, 11, 13, 14, 16, 18, 20, 23,
26, 28, 30, 32, 35, 38, 40, 42, 44, 45,
47, 49, 51, 53, 54, 54, 55, 56, 57, 58,
59, 60, 61, 63, 65, 66, 68, 70, 71, 72,
73, 74, 75, 77, 79, 80, 81, 82, 83, 83,
83, 83, 83, 83, 83, 83, 84, 85, 86, 87,
88, 89, 90, 92, 94, 94, 94, 94, 94, 94,
95, 95, 95, 95, 95, 97, 99, 99, 99, 99,
99, 99, 99, 99, 100, 100, 100, 100, 100, 100,
1, 1, 1, 1, 1, 2, 3, 3, 3, 3,
3, 4, 6, 8, 10, 11, 13, 14, 16, 18,
20, 23, 26, 28, 30, 32, 35, 38, 40, 42,
44, 46, 48, 50, 52, 54, 56, 58, 59, 60,
61, 62, 63, 64, 65, 67, 69, 70, 72, 74,
75, 76, 77, 78, 79, 81, 83, 84, 85, 86,
87, 87, 87, 87, 87, 87, 87, 87, 88, 89,
90, 91, 92, 93, 93, 93, 93, 93, 94, 96,
98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
98, 100, 102, 102, 102, 102, 102, 102, 102, 103,
100, 102, 102, 103, 104, 104, 104, 104, 104, 106,
106, 107, 107, 107, 107, 107, 107, 107, 109, 109,
109, 111, 111, 113, 114, 115, 115, 116, 116, 116,
116, 117, 117, 120, 121, 121, 123, 124, 124, 124,
126, 127, 127, 127, 127, 128, 128, 128, 130, 130,
132, 132, 133, 134, 134, 134, 134, 135, 135, 135,
137, 137, 137
103, 103, 103, 103, 103, 103, 105, 105, 106, 107,
107, 107, 107, 107, 107, 107, 107, 107, 107, 109,
109, 110, 111, 111, 112, 112, 112, 112, 113, 113,
116, 117, 118, 118, 119, 119, 119, 119, 120, 120,
120, 121, 121, 122, 123, 123, 123, 123, 124, 124,
124, 125, 125, 125
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -433,198 +431,144 @@ static yyconst flex_int32_t yy_ec[256] =
static yyconst flex_int32_t yy_meta[40] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1
1, 2, 3, 4, 4, 4, 4, 4, 5, 6,
4, 7, 7, 7, 4, 4, 4, 8, 8, 8,
8, 8, 9, 8, 8, 8, 8, 8, 8, 9,
8, 8, 8, 8, 8, 8, 8, 8, 4
} ;
static yyconst flex_int16_t yy_base[182] =
static yyconst flex_int16_t yy_base[168] =
{ 0,
0, 38, 0, 0, 38, 39, 499, 498, 500, 48,
43, 552, 496, 44, 63, 495, 59, 65, 87, 125,
58, 67, 68, 164, 203, 40, 75, 241, 552, 494,
552, 140, 552, 140, 493, 552, 144, 492, 491, 487,
486, 485, 156, 179, 267, 0, 209, 472, 471, 470,
469, 468, 446, 124, 466, 153, 462, 458, 154, 198,
159, 155, 183, 160, 193, 460, 552, 222, 552, 227,
552, 459, 204, 161, 231, 232, 238, 243, 236, 303,
245, 180, 247, 249, 281, 56, 257, 271, 248, 259,
252, 264, 455, 454, 297, 299, 312, 313, 320, 294,
0, 38, 0, 0, 38, 39, 328, 327, 326, 44,
328, 0, 325, 332, 332, 310, 319, 332, 316, 41,
41, 44, 44, 307, 49, 321, 44, 282, 61, 79,
317, 332, 72, 332, 332, 67, 68, 0, 317, 332,
332, 332, 332, 0, 34, 0, 105, 0, 0, 332,
332, 332, 332, 332, 317, 73, 332, 82, 311, 310,
291, 61, 289, 286, 279, 281, 286, 306, 332, 90,
332, 94, 332, 84, 85, 108, 48, 0, 88, 95,
283, 86, 284, 273, 270, 91, 274, 281, 279, 268,
0, 124, 273, 274, 274, 270, 265, 271, 332, 267,
407, 295, 427, 426, 321, 296, 324, 425, 552, 424,
552, 327, 329, 195, 328, 331, 332, 230, 334, 378,
552, 377, 552, 371, 370, 335, 365, 337, 358, 342,
360, 344, 326, 255, 340, 552, 260, 338, 246, 552,
197, 364, 192, 352, 382, 348, 186, 552, 420, 552,
423, 184, 141, 437, 421, 447, 79, 476, 346, 552,
453, 552, 515, 517, 519, 521, 523, 525, 71, 527,
529, 531, 533, 535, 537, 539, 541, 543, 545, 547,
549
264, 262, 259, 260, 249, 125, 245, 332, 332, 241,
229, 231, 223, 209, 222, 194, 197, 194, 130, 196,
332, 0, 181, 332, 189, 131, 191, 332, 181, 210,
162, 0, 136, 332, 134, 0, 130, 155, 111, 138,
332, 153, 0, 332, 125, 41, 156, 332, 34, 136,
332, 159, 332, 173, 182, 191, 200, 209, 218, 227,
236, 245, 254, 263, 272, 280, 285
} ;
static yyconst flex_int16_t yy_def[182] =
static yyconst flex_int16_t yy_def[168] =
{ 0,
162, 1, 163, 163, 164, 164, 165, 165, 162, 166,
167, 162, 167, 167, 167, 167, 167, 167, 162, 166,
167, 167, 167, 168, 168, 167, 167, 167, 162, 169,
162, 170, 162, 20, 167, 162, 167, 167, 167, 167,
167, 171, 19, 20, 20, 20, 20, 167, 167, 167,
167, 167, 25, 25, 167, 167, 28, 28, 167, 167,
167, 167, 167, 167, 167, 169, 162, 170, 162, 170,
162, 171, 45, 25, 167, 167, 167, 167, 167, 167,
167, 167, 167, 167, 20, 25, 167, 167, 167, 167,
167, 167, 172, 173, 167, 167, 167, 167, 167, 167,
153, 1, 154, 154, 155, 155, 156, 156, 157, 157,
153, 158, 153, 153, 153, 153, 153, 153, 153, 153,
158, 158, 153, 153, 153, 159, 159, 153, 153, 153,
160, 153, 161, 153, 153, 153, 153, 158, 153, 153,
153, 153, 153, 162, 21, 158, 158, 22, 158, 153,
153, 153, 153, 153, 159, 159, 153, 153, 30, 30,
153, 153, 153, 153, 153, 153, 153, 160, 153, 161,
153, 161, 153, 153, 153, 153, 153, 162, 47, 159,
153, 153, 153, 153, 153, 163, 153, 153, 153, 153,
158, 159, 153, 153, 153, 153, 153, 153, 153, 153,
25, 167, 174, 175, 167, 167, 167, 172, 162, 173,
162, 167, 167, 167, 167, 167, 167, 25, 167, 174,
162, 175, 162, 176, 177, 167, 178, 167, 167, 167,
167, 167, 25, 167, 176, 162, 177, 167, 178, 162,
179, 167, 180, 167, 162, 167, 179, 162, 167, 162,
167, 180, 167, 181, 167, 167, 167, 181, 167, 162,
167, 0, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162
153, 153, 153, 153, 153, 159, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 159, 153,
153, 164, 153, 153, 153, 153, 153, 153, 153, 159,
153, 164, 153, 153, 153, 165, 153, 166, 153, 153,
153, 153, 165, 153, 167, 153, 153, 153, 167, 153,
153, 153, 0, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153
} ;
static yyconst flex_int16_t yy_nxt[592] =
static yyconst flex_int16_t yy_nxt[372] =
{ 0,
10, 11, 12, 13, 14, 15, 16, 17, 16, 16,
18, 19, 20, 20, 21, 22, 23, 24, 24, 24,
24, 24, 25, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 26, 27,
31, 31, 36, 28, 37, 36, 36, 32, 32, 35,
36, 35, 35, 35, 35, 35, 35, 35, 35, 38,
36, 36, 35, 35, 35, 36, 40, 36, 39, 36,
36, 66, 48, 49, 41, 42, 56, 36, 55, 53,
57, 36, 50, 51, 52, 101, 35, 34, 35, 36,
35, 35, 35, 35, 35, 35, 35, 35, 43, 43,
12, 13, 14, 15, 16, 17, 18, 19, 18, 18,
20, 21, 22, 22, 23, 24, 25, 26, 26, 26,
26, 26, 27, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 28, 29,
32, 32, 148, 30, 38, 36, 14, 33, 33, 37,
43, 44, 45, 45, 38, 48, 48, 48, 50, 51,
46, 47, 58, 49, 53, 54, 59, 56, 74, 76,
136, 38, 75, 38, 71, 82, 46, 83, 47, 49,
60, 72, 73, 58, 41, 74, 76, 59, 82, 75,
83, 77, 71, 84, 63, 38, 71, 80, 85, 153,
34, 35, 35, 35, 34, 34, 44, 45, 34, 34,
34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
34, 34, 44, 34, 45, 35, 35, 36, 35, 35,
35, 35, 35, 35, 35, 35, 46, 46, 46, 35,
35, 35, 69, 36, 47, 37, 36, 53, 74, 70,
71, 34, 34, 34, 56, 36, 36, 36, 57, 34,
47, 36, 36, 35, 34, 35, 36, 35, 35, 35,
35, 35, 35, 35, 35, 34, 34, 75, 35, 35,
35, 81, 36, 80, 53, 36, 36, 86, 148, 83,
34, 34, 34, 34, 36, 36, 129, 36, 34, 148,
153, 61, 62, 72, 73, 63, 64, 91, 77, 76,
65, 63, 94, 100, 66, 67, 79, 79, 79, 95,
101, 92, 79, 91, 38, 38, 79, 79, 79, 79,
38, 77, 126, 148, 63, 140, 141, 150, 151, 140,
141, 146, 135, 135, 135, 142, 142, 142, 119, 147,
147, 147, 130, 106, 140, 141, 138, 150, 151, 144,
150, 151, 139, 138, 142, 142, 142, 152, 152, 152,
152, 152, 152, 15, 15, 15, 15, 15, 15, 15,
15, 15, 31, 31, 31, 31, 31, 31, 31, 31,
31, 34, 34, 34, 34, 34, 34, 34, 34, 34,
36, 98, 35, 34, 35, 36, 35, 35, 35, 35,
35, 35, 35, 35, 34, 82, 84, 35, 35, 35,
34, 34, 34, 85, 69, 76, 54, 77, 34, 69,
78, 162, 162, 36, 36, 79, 70, 71, 36, 85,
36, 35, 58, 36, 34, 36, 39, 36, 140, 36,
36, 36, 133, 53, 36, 87, 145, 36, 88, 36,
90, 36, 36, 59, 60, 89, 36, 61, 62, 99,
92, 104, 63, 36, 97, 91, 64, 65, 73, 73,
73, 100, 106, 102, 73, 105, 34, 107, 73, 73,
73, 73, 34, 34, 34, 103, 36, 36, 36, 36,
34, 36, 34, 93, 93, 94, 93, 93, 93, 93,
93, 93, 93, 93, 36, 36, 34, 93, 93, 93,
112, 113, 36, 36, 119, 95, 36, 117, 125, 36,
36, 36, 96, 36, 36, 114, 36, 36, 115, 36,
36, 93, 136, 116, 36, 124, 36, 159, 160, 53,
36, 127, 128, 126, 36, 131, 130, 134, 132, 129,
36, 141, 36, 143, 146, 149, 150, 140, 138, 142,
142, 142, 36, 136, 144, 151, 151, 151, 155, 123,
121, 153, 35, 145, 36, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
35, 149, 150, 36, 149, 150, 111, 109, 123, 121,
118, 156, 156, 156, 151, 151, 151, 35, 35, 36,
35, 35, 35, 35, 35, 157, 35, 35, 159, 160,
143, 35, 35, 35, 159, 160, 111, 109, 161, 161,
161, 36, 67, 35, 161, 161, 161, 35, 36, 53,
36, 36, 36, 36, 36, 35, 35, 35, 36, 35,
35, 35, 35, 35, 157, 35, 35, 36, 36, 36,
35, 35, 35, 36, 36, 36, 67, 36, 36, 162,
29, 29, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 35, 29, 29, 30, 30, 33,
33, 34, 34, 35, 35, 53, 53, 68, 68, 72,
72, 108, 108, 110, 110, 120, 120, 122, 122, 135,
135, 137, 137, 139, 139, 147, 147, 152, 152, 158,
158, 9, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162
35, 35, 35, 35, 35, 35, 35, 35, 35, 38,
38, 137, 136, 134, 133, 38, 38, 38, 55, 131,
129, 128, 127, 126, 55, 55, 55, 68, 68, 68,
68, 68, 125, 68, 68, 68, 70, 70, 70, 70,
70, 70, 70, 70, 70, 78, 78, 124, 78, 78,
78, 78, 78, 78, 99, 99, 99, 99, 99, 99,
123, 122, 99, 132, 132, 121, 132, 132, 132, 132,
132, 132, 143, 143, 120, 143, 143, 143, 143, 143,
143, 145, 118, 117, 116, 115, 114, 145, 145, 149,
113, 149, 149, 149, 112, 111, 110, 109, 108, 107,
105, 104, 103, 102, 98, 97, 96, 93, 69, 90,
89, 88, 87, 86, 81, 153, 153, 38, 39, 69,
57, 38, 52, 42, 41, 40, 39, 153, 14, 15,
15, 11, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153
} ;
static yyconst flex_int16_t yy_chk[592] =
static yyconst flex_int16_t yy_chk[372] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
5, 6, 26, 2, 11, 11, 14, 5, 6, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 14,
21, 17, 10, 10, 10, 15, 17, 18, 15, 22,
23, 169, 21, 21, 18, 18, 27, 27, 26, 86,
27, 157, 22, 23, 23, 86, 10, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
5, 6, 149, 2, 27, 10, 10, 5, 6, 10,
20, 20, 21, 21, 45, 22, 22, 22, 23, 23,
21, 21, 29, 22, 25, 25, 29, 27, 36, 37,
146, 45, 36, 56, 33, 77, 21, 77, 21, 22,
30, 33, 33, 58, 30, 74, 75, 58, 62, 74,
62, 37, 70, 62, 37, 80, 72, 56, 62, 70,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 32, 153, 20, 37, 37, 54, 54, 32,
32, 34, 34, 34, 56, 56, 59, 62, 56, 34,
20, 61, 64, 20, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 34, 43, 59, 24, 24,
24, 62, 82, 61, 74, 63, 152, 74, 147, 64,
44, 44, 44, 43, 143, 65, 114, 114, 44, 141,
70, 30, 30, 72, 72, 30, 30, 79, 75, 76,
30, 75, 82, 86, 30, 30, 47, 47, 47, 82,
86, 80, 47, 79, 92, 106, 47, 47, 47, 47,
119, 76, 126, 145, 76, 135, 135, 150, 150, 140,
140, 139, 126, 126, 126, 135, 135, 135, 106, 140,
140, 140, 119, 92, 142, 142, 138, 147, 147, 137,
152, 152, 133, 131, 142, 142, 142, 147, 147, 147,
152, 152, 152, 154, 154, 154, 154, 154, 154, 154,
154, 154, 155, 155, 155, 155, 155, 155, 155, 155,
155, 156, 156, 156, 156, 156, 156, 156, 156, 156,
60, 82, 24, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 44, 63, 65, 25, 25, 25,
47, 47, 47, 73, 68, 60, 25, 60, 47, 70,
60, 68, 68, 75, 76, 60, 70, 70, 79, 73,
77, 25, 28, 28, 47, 78, 28, 81, 139, 83,
89, 84, 118, 118, 91, 75, 134, 134, 76, 87,
77, 90, 137, 28, 28, 76, 92, 28, 28, 83,
79, 89, 28, 88, 81, 78, 28, 28, 45, 45,
45, 84, 91, 87, 45, 90, 45, 92, 45, 45,
45, 45, 85, 85, 85, 88, 100, 102, 106, 95,
85, 96, 45, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 97, 98, 85, 80, 80, 80,
95, 96, 99, 105, 102, 80, 107, 100, 106, 112,
115, 113, 80, 116, 117, 97, 119, 126, 98, 128,
138, 80, 135, 99, 130, 105, 132, 159, 159, 133,
146, 112, 113, 107, 144, 116, 115, 119, 117, 129,
129, 128, 131, 130, 138, 142, 142, 127, 126, 129,
129, 129, 125, 124, 132, 142, 142, 142, 146, 122,
120, 144, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 149, 149, 155, 151, 151, 110, 108, 104, 103,
101, 149, 149, 149, 151, 151, 151, 154, 154, 154,
154, 154, 154, 154, 154, 154, 154, 154, 156, 156,
155, 154, 154, 154, 161, 161, 94, 93, 156, 156,
156, 72, 66, 58, 161, 161, 161, 57, 55, 53,
52, 51, 50, 49, 48, 154, 158, 158, 158, 158,
158, 158, 158, 158, 158, 158, 158, 42, 41, 40,
158, 158, 158, 39, 38, 35, 30, 16, 13, 9,
8, 7, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 158, 163, 163, 164, 164, 165,
165, 166, 166, 167, 167, 168, 168, 170, 170, 171,
171, 172, 172, 173, 173, 174, 174, 175, 175, 176,
176, 177, 177, 178, 178, 179, 179, 180, 180, 181,
181, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
162
157, 157, 157, 157, 157, 157, 157, 157, 157, 158,
130, 129, 127, 125, 123, 158, 158, 158, 159, 120,
118, 117, 116, 115, 159, 159, 159, 160, 160, 160,
160, 160, 114, 160, 160, 160, 161, 161, 161, 161,
161, 161, 161, 161, 161, 162, 162, 113, 162, 162,
162, 162, 162, 162, 163, 163, 163, 163, 163, 163,
112, 111, 163, 164, 164, 110, 164, 164, 164, 164,
164, 164, 165, 165, 107, 165, 165, 165, 165, 165,
165, 166, 105, 104, 103, 102, 101, 166, 166, 167,
100, 167, 167, 167, 98, 97, 96, 95, 94, 93,
90, 89, 88, 87, 85, 84, 83, 81, 68, 67,
66, 65, 64, 63, 61, 60, 59, 55, 39, 31,
28, 26, 24, 19, 17, 16, 13, 11, 9, 8,
7, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153
} ;
#define YY_TRAILING_MASK 0x2000
@@ -696,12 +640,13 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
yylloc->source = 0; \
} while(0)
#line 700 "glcpp/glcpp-lex.c"
#line 644 "glcpp/glcpp-lex.c"
#define INITIAL 0
#define DONE 1
#define COMMENT 2
#define UNREACHABLE 3
#define SKIP 4
#define YY_EXTRA_TYPE glcpp_parser_t *
@@ -795,6 +740,10 @@ int glcpp_get_lineno (yyscan_t yyscanner );
void glcpp_set_lineno (int line_number ,yyscan_t yyscanner );
int glcpp_get_column (yyscan_t yyscanner );
void glcpp_set_column (int column_no ,yyscan_t yyscanner );
YYSTYPE * glcpp_get_lval (yyscan_t yyscanner );
void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
@@ -952,9 +901,20 @@ YY_DECL
#line 76 "glcpp/glcpp-lex.l"
/* Implicitly switch between SKIP and INITIAL (non-skipping);
* don't switch if some other state was explicitly set.
*/
glcpp_parser_t *parser = yyextra;
if (YY_START == 0 || YY_START == SKIP) {
if (parser->lexing_if || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) {
BEGIN 0;
} else {
BEGIN SKIP;
}
}
/* Single-line comments */
#line 958 "glcpp/glcpp-lex.c"
#line 918 "glcpp/glcpp-lex.c"
yylval = yylval_param;
@@ -1017,14 +977,14 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 163 )
if ( yy_current_state >= 154 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yyg->yy_state_ptr++ = yy_current_state;
++yy_cp;
}
while ( yy_current_state != 162 );
while ( yy_current_state != 153 );
yy_find_action:
yy_current_state = *--yyg->yy_state_ptr;
@@ -1049,9 +1009,6 @@ find_rule: /* we branch to this label when backing up */
{
yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
yyg->yy_full_match = yy_cp;
yyg->yy_full_state = yyg->yy_state_ptr;
yyg->yy_full_lp = yyg->yy_lp;
}
else
{
@@ -1076,41 +1033,41 @@ do_action: /* This label is used only to access EOF actions. */
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
#line 79 "glcpp/glcpp-lex.l"
#line 90 "glcpp/glcpp-lex.l"
{
}
YY_BREAK
/* Multi-line comments */
case 2:
YY_RULE_SETUP
#line 83 "glcpp/glcpp-lex.l"
#line 94 "glcpp/glcpp-lex.l"
{ yy_push_state(COMMENT, yyscanner); }
YY_BREAK
case 3:
YY_RULE_SETUP
#line 84 "glcpp/glcpp-lex.l"
#line 95 "glcpp/glcpp-lex.l"
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 85 "glcpp/glcpp-lex.l"
#line 96 "glcpp/glcpp-lex.l"
{ yylineno++; yycolumn = 0; return NEWLINE; }
YY_BREAK
case 5:
YY_RULE_SETUP
#line 86 "glcpp/glcpp-lex.l"
#line 97 "glcpp/glcpp-lex.l"
YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
#line 87 "glcpp/glcpp-lex.l"
#line 98 "glcpp/glcpp-lex.l"
{ yylineno++; yycolumn = 0; return NEWLINE; }
YY_BREAK
case 7:
YY_RULE_SETUP
#line 88 "glcpp/glcpp-lex.l"
#line 99 "glcpp/glcpp-lex.l"
{
yy_pop_state(yyscanner);
if (yyextra->space_tokens)
@@ -1119,9 +1076,9 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
#line 94 "glcpp/glcpp-lex.l"
#line 105 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
yyextra->space_tokens = 0;
return HASH_VERSION;
}
@@ -1130,9 +1087,9 @@ YY_RULE_SETUP
* Simply pass them through to the main compiler's lexer/parser. */
case 9:
YY_RULE_SETUP
#line 102 "glcpp/glcpp-lex.l"
#line 113 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
return OTHER;
@@ -1143,7 +1100,7 @@ case 10:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 109 "glcpp/glcpp-lex.l"
#line 120 "glcpp/glcpp-lex.l"
{
/* Eat characters until the first digit is
* encountered
@@ -1165,7 +1122,7 @@ case 11:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 125 "glcpp/glcpp-lex.l"
#line 136 "glcpp/glcpp-lex.l"
{
/* Eat characters until the first digit is
* encountered
@@ -1181,10 +1138,10 @@ YY_RULE_SETUP
yylineno = strtol(ptr, &ptr, 0) - 1;
}
YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
#line 140 "glcpp/glcpp-lex.l"
#line 152 "glcpp/glcpp-lex.l"
{
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
@@ -1192,9 +1149,8 @@ YY_RULE_SETUP
}
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 146 "glcpp/glcpp-lex.l"
#line 158 "glcpp/glcpp-lex.l"
{
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
@@ -1203,8 +1159,11 @@ YY_RULE_SETUP
YY_BREAK
case 14:
/* rule 14 can match eol */
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 152 "glcpp/glcpp-lex.l"
#line 164 "glcpp/glcpp-lex.l"
{
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
@@ -1212,9 +1171,8 @@ YY_RULE_SETUP
}
YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
#line 158 "glcpp/glcpp-lex.l"
#line 170 "glcpp/glcpp-lex.l"
{
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
@@ -1222,53 +1180,30 @@ YY_RULE_SETUP
}
YY_BREAK
case 16:
/* rule 16 can match eol */
YY_RULE_SETUP
#line 164 "glcpp/glcpp-lex.l"
#line 176 "glcpp/glcpp-lex.l"
{
yyextra->space_tokens = 0;
return HASH_ELSE;
}
YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 169 "glcpp/glcpp-lex.l"
#line 181 "glcpp/glcpp-lex.l"
{
yyextra->space_tokens = 0;
return HASH_ENDIF;
}
YY_BREAK
/* When skipping (due to an #if 0 or similar) consume anything
* up to a newline. We do this with less priority than any
* #if-related directive (#if, #elif, #else, #endif), but with
* more priority than any other directive or token to avoid
* any side-effects from skipped content.
*
* We use the lexing_if flag to avoid skipping any part of an
* if conditional expression. */
case 18:
/* rule 18 can match eol */
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 182 "glcpp/glcpp-lex.l"
{
/* Since this rule always matches, YY_USER_ACTION gets called for it,
* wrongly incrementing yycolumn. We undo that effect here. */
yycolumn -= yyleng;
if (yyextra->lexing_if ||
yyextra->skip_stack == NULL ||
yyextra->skip_stack->type == SKIP_NO_SKIP)
{
REJECT;
}
}
#line 187 "glcpp/glcpp-lex.l"
;
YY_BREAK
case 19:
YY_RULE_SETUP
#line 194 "glcpp/glcpp-lex.l"
#line 189 "glcpp/glcpp-lex.l"
{
char *p;
for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */
@@ -1278,7 +1213,7 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
#line 201 "glcpp/glcpp-lex.l"
#line 196 "glcpp/glcpp-lex.l"
{
yyextra->space_tokens = 0;
return HASH_DEFINE_FUNC;
@@ -1286,7 +1221,7 @@ YY_RULE_SETUP
YY_BREAK
case 21:
YY_RULE_SETUP
#line 206 "glcpp/glcpp-lex.l"
#line 201 "glcpp/glcpp-lex.l"
{
yyextra->space_tokens = 0;
return HASH_DEFINE_OBJ;
@@ -1294,7 +1229,7 @@ YY_RULE_SETUP
YY_BREAK
case 22:
YY_RULE_SETUP
#line 211 "glcpp/glcpp-lex.l"
#line 206 "glcpp/glcpp-lex.l"
{
yyextra->space_tokens = 0;
return HASH_UNDEF;
@@ -1302,7 +1237,7 @@ YY_RULE_SETUP
YY_BREAK
case 23:
YY_RULE_SETUP
#line 216 "glcpp/glcpp-lex.l"
#line 211 "glcpp/glcpp-lex.l"
{
yyextra->space_tokens = 0;
return HASH;
@@ -1310,124 +1245,124 @@ YY_RULE_SETUP
YY_BREAK
case 24:
YY_RULE_SETUP
#line 221 "glcpp/glcpp-lex.l"
#line 216 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 226 "glcpp/glcpp-lex.l"
#line 221 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 231 "glcpp/glcpp-lex.l"
#line 226 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 236 "glcpp/glcpp-lex.l"
#line 231 "glcpp/glcpp-lex.l"
{
return LEFT_SHIFT;
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 240 "glcpp/glcpp-lex.l"
#line 235 "glcpp/glcpp-lex.l"
{
return RIGHT_SHIFT;
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 244 "glcpp/glcpp-lex.l"
#line 239 "glcpp/glcpp-lex.l"
{
return LESS_OR_EQUAL;
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 248 "glcpp/glcpp-lex.l"
#line 243 "glcpp/glcpp-lex.l"
{
return GREATER_OR_EQUAL;
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 252 "glcpp/glcpp-lex.l"
#line 247 "glcpp/glcpp-lex.l"
{
return EQUAL;
}
YY_BREAK
case 32:
YY_RULE_SETUP
#line 256 "glcpp/glcpp-lex.l"
#line 251 "glcpp/glcpp-lex.l"
{
return NOT_EQUAL;
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 260 "glcpp/glcpp-lex.l"
#line 255 "glcpp/glcpp-lex.l"
{
return AND;
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 264 "glcpp/glcpp-lex.l"
#line 259 "glcpp/glcpp-lex.l"
{
return OR;
}
YY_BREAK
case 35:
YY_RULE_SETUP
#line 268 "glcpp/glcpp-lex.l"
#line 263 "glcpp/glcpp-lex.l"
{
return PASTE;
}
YY_BREAK
case 36:
YY_RULE_SETUP
#line 272 "glcpp/glcpp-lex.l"
#line 267 "glcpp/glcpp-lex.l"
{
return DEFINED;
}
YY_BREAK
case 37:
YY_RULE_SETUP
#line 276 "glcpp/glcpp-lex.l"
#line 271 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 281 "glcpp/glcpp-lex.l"
#line 276 "glcpp/glcpp-lex.l"
{
return yytext[0];
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 285 "glcpp/glcpp-lex.l"
#line 280 "glcpp/glcpp-lex.l"
{
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return OTHER;
}
YY_BREAK
case 40:
YY_RULE_SETUP
#line 290 "glcpp/glcpp-lex.l"
#line 285 "glcpp/glcpp-lex.l"
{
if (yyextra->space_tokens) {
return SPACE;
@@ -1437,7 +1372,7 @@ YY_RULE_SETUP
case 41:
/* rule 41 can match eol */
YY_RULE_SETUP
#line 296 "glcpp/glcpp-lex.l"
#line 291 "glcpp/glcpp-lex.l"
{
yyextra->lexing_if = 0;
yylineno++;
@@ -1447,7 +1382,7 @@ YY_RULE_SETUP
YY_BREAK
/* Handle missing newline at EOF. */
case YY_STATE_EOF(INITIAL):
#line 304 "glcpp/glcpp-lex.l"
#line 299 "glcpp/glcpp-lex.l"
{
BEGIN DONE; /* Don't keep matching this rule forever. */
yyextra->lexing_if = 0;
@@ -1460,7 +1395,7 @@ case YY_STATE_EOF(INITIAL):
warnings. */
case 42:
YY_RULE_SETUP
#line 314 "glcpp/glcpp-lex.l"
#line 309 "glcpp/glcpp-lex.l"
{
unput('.');
yy_top_state(yyextra);
@@ -1468,13 +1403,14 @@ YY_RULE_SETUP
YY_BREAK
case 43:
YY_RULE_SETUP
#line 319 "glcpp/glcpp-lex.l"
#line 314 "glcpp/glcpp-lex.l"
ECHO;
YY_BREAK
#line 1475 "glcpp/glcpp-lex.c"
#line 1410 "glcpp/glcpp-lex.c"
case YY_STATE_EOF(DONE):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(UNREACHABLE):
case YY_STATE_EOF(SKIP):
yyterminate();
case YY_END_OF_BUFFER:
@@ -1737,7 +1673,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 163 )
if ( yy_current_state >= 154 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1761,11 +1697,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 163 )
if ( yy_current_state >= 154 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 162);
yy_is_jam = (yy_current_state == 153);
if ( ! yy_is_jam )
*yyg->yy_state_ptr++ = yy_current_state;
@@ -2665,7 +2601,7 @@ void glcpp_free (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
#line 319 "glcpp/glcpp-lex.l"
#line 314 "glcpp/glcpp-lex.l"

View File

@@ -57,7 +57,7 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
%option stack
%option never-interactive
%x DONE COMMENT UNREACHABLE
%x DONE COMMENT UNREACHABLE SKIP
SPACE [[:space:]]
NONSPACE [^[:space:]]
@@ -74,6 +74,17 @@ OCTAL_INTEGER 0[0-7]*[uU]?
HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
%%
/* Implicitly switch between SKIP and INITIAL (non-skipping);
* don't switch if some other state was explicitly set.
*/
glcpp_parser_t *parser = yyextra;
if (YY_START == 0 || YY_START == SKIP) {
if (parser->lexing_if || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) {
BEGIN 0;
} else {
BEGIN SKIP;
}
}
/* Single-line comments */
"//"[^\n]* {
@@ -92,7 +103,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
{HASH}version {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
yyextra->space_tokens = 0;
return HASH_VERSION;
}
@@ -100,7 +111,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
/* glcpp doesn't handle #extension, #version, or #pragma directives.
* Simply pass them through to the main compiler's lexer/parser. */
{HASH}(extension|pragma)[^\n]+ {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
return OTHER;
@@ -137,60 +148,44 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
yylineno = strtol(ptr, &ptr, 0) - 1;
}
{HASH}ifdef/.*\n {
<SKIP,INITIAL>{
{HASH}ifdef {
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
return HASH_IFDEF;
}
{HASH}ifndef/.*\n {
{HASH}ifndef {
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
return HASH_IFNDEF;
}
{HASH}if/[^_a-zA-Z0-9].*\n {
{HASH}if/[^_a-zA-Z0-9] {
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
return HASH_IF;
}
{HASH}elif/.*\n {
{HASH}elif {
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
return HASH_ELIF;
}
{HASH}else/.*\n {
{HASH}else {
yyextra->space_tokens = 0;
return HASH_ELSE;
}
{HASH}endif/.*\n {
{HASH}endif {
yyextra->space_tokens = 0;
return HASH_ENDIF;
}
/* When skipping (due to an #if 0 or similar) consume anything
* up to a newline. We do this with less priority than any
* #if-related directive (#if, #elif, #else, #endif), but with
* more priority than any other directive or token to avoid
* any side-effects from skipped content.
*
* We use the lexing_if flag to avoid skipping any part of an
* if conditional expression. */
[^\n]+/\n {
/* Since this rule always matches, YY_USER_ACTION gets called for it,
* wrongly incrementing yycolumn. We undo that effect here. */
yycolumn -= yyleng;
if (yyextra->lexing_if ||
yyextra->skip_stack == NULL ||
yyextra->skip_stack->type == SKIP_NO_SKIP)
{
REJECT;
}
}
<SKIP>[^\n] ;
{HASH}error.* {
char *p;
for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */
@@ -219,17 +214,17 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
{DECIMAL_INTEGER} {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
{OCTAL_INTEGER} {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
{HEXADECIMAL_INTEGER} {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
@@ -274,7 +269,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
{IDENTIFIER} {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
@@ -283,7 +278,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
{OTHER}+ {
yylval->str = talloc_strdup (yyextra, yytext);
yylval->str = ralloc_strdup (yyextra, yytext);
return OTHER;
}
@@ -293,7 +288,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
}
\n {
<SKIP,INITIAL>\n {
yyextra->lexing_if = 0;
yylineno++;
yycolumn = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -32,10 +32,6 @@
#include "main/core.h" /* for struct gl_extensions */
#include "main/mtypes.h" /* for gl_api enum */
#define glcpp_print(stream, str) stream = talloc_strdup_append(stream, str)
#define glcpp_printf(stream, fmt, args, ...) \
stream = talloc_asprintf_append(stream, fmt, args)
static void
yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error);
@@ -79,7 +75,7 @@ _argument_list_length (argument_list_t *list);
static token_list_t *
_argument_list_member_at (argument_list_t *list, int index);
/* Note: This function talloc_steal()s the str pointer. */
/* Note: This function ralloc_steal()s the str pointer. */
static token_t *
_token_create_str (void *ctx, int type, char *str);
@@ -89,10 +85,7 @@ _token_create_ival (void *ctx, int type, int ival);
static token_list_t *
_token_list_create (void *ctx);
/* Note: This function adds a talloc_reference() to token.
*
* You may want to talloc_unlink any current reference if you no
* longer need it. */
/* Note: This function calls ralloc_steal on token. */
static void
_token_list_append (token_list_t *list, token_t *token);
@@ -192,12 +185,12 @@ input:
line:
control_line {
glcpp_print(parser->output, "\n");
ralloc_strcat (&parser->output, "\n");
}
| text_line {
_glcpp_parser_print_expanded_token_list (parser, $1);
glcpp_print(parser->output, "\n");
talloc_free ($1);
ralloc_strcat (&parser->output, "\n");
ralloc_free ($1);
}
| expanded_line
| HASH non_directive
@@ -226,9 +219,9 @@ control_line:
macro_t *macro = hash_table_find (parser->defines, $2);
if (macro) {
hash_table_remove (parser->defines, $2);
talloc_free (macro);
ralloc_free (macro);
}
talloc_free ($2);
ralloc_free ($2);
}
| HASH_IF conditional_tokens NEWLINE {
/* Be careful to only evaluate the 'if' expression if
@@ -261,12 +254,12 @@ control_line:
}
| HASH_IFDEF IDENTIFIER junk NEWLINE {
macro_t *macro = hash_table_find (parser->defines, $2);
talloc_free ($2);
ralloc_free ($2);
_glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL);
}
| HASH_IFNDEF IDENTIFIER junk NEWLINE {
macro_t *macro = hash_table_find (parser->defines, $2);
talloc_free ($2);
ralloc_free ($2);
_glcpp_parser_skip_stack_push_if (parser, & @1, macro == NULL);
}
| HASH_ELIF conditional_tokens NEWLINE {
@@ -313,7 +306,7 @@ control_line:
macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
if (macro) {
hash_table_remove (parser->defines, "__VERSION__");
talloc_free (macro);
ralloc_free (macro);
}
add_builtin_define (parser, "__VERSION__", $2);
@@ -328,7 +321,7 @@ control_line:
if ($2 >= 130 || $2 == 100)
add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1);
glcpp_printf(parser->output, "#version %" PRIiMAX, $2);
ralloc_asprintf_append (&parser->output, "#version %" PRIiMAX, $2);
}
| HASH NEWLINE
;
@@ -395,10 +388,20 @@ expression:
$$ = $1 + $3;
}
| expression '%' expression {
$$ = $1 % $3;
if ($3 == 0) {
yyerror (& @1, parser,
"zero modulus in preprocessor directive");
} else {
$$ = $1 % $3;
}
}
| expression '/' expression {
$$ = $1 / $3;
if ($3 == 0) {
yyerror (& @1, parser,
"division by 0 in preprocessor directive");
} else {
$$ = $1 / $3;
}
}
| expression '*' expression {
$$ = $1 * $3;
@@ -424,12 +427,12 @@ identifier_list:
IDENTIFIER {
$$ = _string_list_create (parser);
_string_list_append_item ($$, $1);
talloc_steal ($$, $1);
ralloc_steal ($$, $1);
}
| identifier_list ',' IDENTIFIER {
$$ = $1;
_string_list_append_item ($$, $3);
talloc_steal ($$, $3);
ralloc_steal ($$, $3);
}
;
@@ -474,12 +477,10 @@ conditional_tokens:
conditional_token {
$$ = _token_list_create (parser);
_token_list_append ($$, $1);
talloc_unlink (parser, $1);
}
| conditional_tokens conditional_token {
$$ = $1;
_token_list_append ($$, $2);
talloc_unlink (parser, $2);
}
;
@@ -488,12 +489,10 @@ pp_tokens:
parser->space_tokens = 1;
$$ = _token_list_create (parser);
_token_list_append ($$, $1);
talloc_unlink (parser, $1);
}
| pp_tokens preprocessing_token {
$$ = $1;
_token_list_append ($$, $2);
talloc_unlink (parser, $2);
}
;
@@ -561,7 +560,7 @@ _string_list_create (void *ctx)
{
string_list_t *list;
list = talloc (ctx, string_list_t);
list = ralloc (ctx, string_list_t);
list->head = NULL;
list->tail = NULL;
@@ -573,8 +572,8 @@ _string_list_append_item (string_list_t *list, const char *str)
{
string_node_t *node;
node = talloc (list, string_node_t);
node->str = talloc_strdup (node, str);
node = ralloc (list, string_node_t);
node->str = ralloc_strdup (node, str);
node->next = NULL;
@@ -652,7 +651,7 @@ _argument_list_create (void *ctx)
{
argument_list_t *list;
list = talloc (ctx, argument_list_t);
list = ralloc (ctx, argument_list_t);
list->head = NULL;
list->tail = NULL;
@@ -664,7 +663,7 @@ _argument_list_append (argument_list_t *list, token_list_t *argument)
{
argument_node_t *node;
node = talloc (list, argument_node_t);
node = ralloc (list, argument_node_t);
node->argument = argument;
node->next = NULL;
@@ -715,15 +714,17 @@ _argument_list_member_at (argument_list_t *list, int index)
return NULL;
}
/* Note: This function talloc_steal()s the str pointer. */
/* Note: This function ralloc_steal()s the str pointer. */
token_t *
_token_create_str (void *ctx, int type, char *str)
{
token_t *token;
token = talloc (ctx, token_t);
token = ralloc (ctx, token_t);
token->type = type;
token->value.str = talloc_steal (token, str);
token->value.str = str;
ralloc_steal (token, str);
return token;
}
@@ -733,7 +734,7 @@ _token_create_ival (void *ctx, int type, int ival)
{
token_t *token;
token = talloc (ctx, token_t);
token = ralloc (ctx, token_t);
token->type = type;
token->value.ival = ival;
@@ -745,7 +746,7 @@ _token_list_create (void *ctx)
{
token_list_t *list;
list = talloc (ctx, token_list_t);
list = ralloc (ctx, token_list_t);
list->head = NULL;
list->tail = NULL;
list->non_space_tail = NULL;
@@ -758,11 +759,12 @@ _token_list_append (token_list_t *list, token_t *token)
{
token_node_t *node;
node = talloc (list, token_node_t);
node->token = talloc_reference (list, token);
node = ralloc (list, token_node_t);
node->token = token;
node->next = NULL;
ralloc_steal (list, token);
if (list->head == NULL) {
list->head = node;
} else {
@@ -800,8 +802,11 @@ _token_list_copy (void *ctx, token_list_t *other)
return NULL;
copy = _token_list_create (ctx);
for (node = other->head; node; node = node->next)
_token_list_append (copy, node->token);
for (node = other->head; node; node = node->next) {
token_t *new_token = ralloc (copy, token_t);
*new_token = *node->token;
_token_list_append (copy, new_token);
}
return copy;
}
@@ -818,17 +823,38 @@ _token_list_trim_trailing_space (token_list_t *list)
while (tail) {
next = tail->next;
talloc_free (tail);
ralloc_free (tail);
tail = next;
}
}
}
int
_token_list_is_empty_ignoring_space (token_list_t *l)
{
token_node_t *n;
if (l == NULL)
return 1;
n = l->head;
while (n != NULL && n->token->type == SPACE)
n = n->next;
return n == NULL;
}
int
_token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
{
token_node_t *node_a, *node_b;
if (a == NULL || b == NULL) {
int a_empty = _token_list_is_empty_ignoring_space(a);
int b_empty = _token_list_is_empty_ignoring_space(b);
return a_empty == b_empty;
}
node_a = a->head;
node_b = b->head;
@@ -883,51 +909,51 @@ static void
_token_print (char **out, token_t *token)
{
if (token->type < 256) {
glcpp_printf (*out, "%c", token->type);
ralloc_asprintf_append (out, "%c", token->type);
return;
}
switch (token->type) {
case INTEGER:
glcpp_printf (*out, "%" PRIiMAX, token->value.ival);
ralloc_asprintf_append (out, "%" PRIiMAX, token->value.ival);
break;
case IDENTIFIER:
case INTEGER_STRING:
case OTHER:
glcpp_print (*out, token->value.str);
ralloc_strcat (out, token->value.str);
break;
case SPACE:
glcpp_print (*out, " ");
ralloc_strcat (out, " ");
break;
case LEFT_SHIFT:
glcpp_print (*out, "<<");
ralloc_strcat (out, "<<");
break;
case RIGHT_SHIFT:
glcpp_print (*out, ">>");
ralloc_strcat (out, ">>");
break;
case LESS_OR_EQUAL:
glcpp_print (*out, "<=");
ralloc_strcat (out, "<=");
break;
case GREATER_OR_EQUAL:
glcpp_print (*out, ">=");
ralloc_strcat (out, ">=");
break;
case EQUAL:
glcpp_print (*out, "==");
ralloc_strcat (out, "==");
break;
case NOT_EQUAL:
glcpp_print (*out, "!=");
ralloc_strcat (out, "!=");
break;
case AND:
glcpp_print (*out, "&&");
ralloc_strcat (out, "&&");
break;
case OR:
glcpp_print (*out, "||");
ralloc_strcat (out, "||");
break;
case PASTE:
glcpp_print (*out, "##");
ralloc_strcat (out, "##");
break;
case COMMA_FINAL:
glcpp_print (*out, ",");
ralloc_strcat (out, ",");
break;
case PLACEHOLDER:
/* Nothing to print. */
@@ -938,7 +964,7 @@ _token_print (char **out, token_t *token)
}
}
/* Return a new token (talloc()ed off of 'token') formed by pasting
/* Return a new token (ralloc()ed off of 'token') formed by pasting
* 'token' and 'other'. Note that this function may return 'token' or
* 'other' directly rather than allocating anything new.
*
@@ -1009,7 +1035,7 @@ _token_paste (glcpp_parser_t *parser, token_t *token, token_t *other)
{
char *str;
str = talloc_asprintf (token, "%s%s", token->value.str,
str = ralloc_asprintf (token, "%s%s", token->value.str,
other->value.str);
combined = _token_create_str (token, token->type, str);
combined->location = token->location;
@@ -1017,11 +1043,11 @@ _token_paste (glcpp_parser_t *parser, token_t *token, token_t *other)
}
glcpp_error (&token->location, parser, "");
glcpp_print (parser->info_log, "Pasting \"");
ralloc_strcat (&parser->info_log, "Pasting \"");
_token_print (&parser->info_log, token);
glcpp_print (parser->info_log, "\" and \"");
ralloc_strcat (&parser->info_log, "\" and \"");
_token_print (&parser->info_log, other);
glcpp_print (parser->info_log, "\" does not give a valid preprocessing token.\n");
ralloc_strcat (&parser->info_log, "\" does not give a valid preprocessing token.\n");
return token;
}
@@ -1055,8 +1081,6 @@ static void add_builtin_define(glcpp_parser_t *parser,
list = _token_list_create(parser);
_token_list_append(list, tok);
_define_object_macro(parser, NULL, name, list);
talloc_unlink(parser, tok);
}
glcpp_parser_t *
@@ -1065,7 +1089,7 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
glcpp_parser_t *parser;
int language_version;
parser = talloc (NULL, glcpp_parser_t);
parser = ralloc (NULL, glcpp_parser_t);
glcpp_lex_init_extra (parser, &parser->scanner);
parser->defines = hash_table_ctor (32, hash_table_string_hash,
@@ -1082,8 +1106,8 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
parser->lex_from_list = NULL;
parser->lex_from_node = NULL;
parser->output = talloc_strdup(parser, "");
parser->info_log = talloc_strdup(parser, "");
parser->output = ralloc_strdup(parser, "");
parser->info_log = ralloc_strdup(parser, "");
parser->error = 0;
/* Add pre-defined macros. */
@@ -1123,7 +1147,7 @@ glcpp_parser_destroy (glcpp_parser_t *parser)
{
glcpp_lex_destroy (parser->scanner);
hash_table_dtor (parser->defines);
talloc_free (parser);
ralloc_free (parser);
}
typedef enum function_status
@@ -1294,7 +1318,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
/* Replace a macro defined as empty with a SPACE token. */
if (macro->replacements == NULL) {
talloc_free (arguments);
ralloc_free (arguments);
return _token_list_create_with_one_space (parser);
}
@@ -1450,7 +1474,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
token_list_t *expansion;
token_t *final;
str = talloc_strdup (parser, token->value.str);
str = ralloc_strdup (parser, token->value.str);
final = _token_create_str (parser, OTHER, str);
expansion = _token_list_create (parser);
_token_list_append (expansion, final);
@@ -1486,8 +1510,8 @@ _active_list_push (active_list_t *list,
{
active_list_t *node;
node = talloc (list, active_list_t);
node->identifier = talloc_strdup (node, identifier);
node = ralloc (list, active_list_t);
node->identifier = ralloc_strdup (node, identifier);
node->marker = marker;
node->next = list;
@@ -1503,7 +1527,7 @@ _active_list_pop (active_list_t *list)
return NULL;
node = list->next;
talloc_free (list);
ralloc_free (list);
return node;
}
@@ -1652,17 +1676,18 @@ _define_object_macro (glcpp_parser_t *parser,
if (loc != NULL)
_check_for_reserved_macro_name(parser, loc, identifier);
macro = talloc (parser, macro_t);
macro = ralloc (parser, macro_t);
macro->is_function = 0;
macro->parameters = NULL;
macro->identifier = talloc_strdup (macro, identifier);
macro->replacements = talloc_steal (macro, replacements);
macro->identifier = ralloc_strdup (macro, identifier);
macro->replacements = replacements;
ralloc_steal (macro, replacements);
previous = hash_table_find (parser->defines, identifier);
if (previous) {
if (_macro_equal (macro, previous)) {
talloc_free (macro);
ralloc_free (macro);
return;
}
glcpp_error (loc, parser, "Redefinition of macro %s\n",
@@ -1683,17 +1708,18 @@ _define_function_macro (glcpp_parser_t *parser,
_check_for_reserved_macro_name(parser, loc, identifier);
macro = talloc (parser, macro_t);
macro = ralloc (parser, macro_t);
ralloc_steal (macro, parameters);
ralloc_steal (macro, replacements);
macro->is_function = 1;
macro->parameters = talloc_steal (macro, parameters);
macro->identifier = talloc_strdup (macro, identifier);
macro->replacements = talloc_steal (macro, replacements);
macro->parameters = parameters;
macro->identifier = ralloc_strdup (macro, identifier);
macro->replacements = replacements;
previous = hash_table_find (parser->defines, identifier);
if (previous) {
if (_macro_equal (macro, previous)) {
talloc_free (macro);
ralloc_free (macro);
return;
}
glcpp_error (loc, parser, "Redefinition of macro %s\n",
@@ -1769,7 +1795,7 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser)
node = parser->lex_from_node;
if (node == NULL) {
talloc_free (parser->lex_from_list);
ralloc_free (parser->lex_from_list);
parser->lex_from_list = NULL;
return NEWLINE;
}
@@ -1798,13 +1824,13 @@ glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list)
_token_list_append (parser->lex_from_list, node->token);
}
talloc_free (list);
ralloc_free (list);
parser->lex_from_node = parser->lex_from_list->head;
/* It's possible the list consisted of nothing but whitespace. */
if (parser->lex_from_node == NULL) {
talloc_free (parser->lex_from_list);
ralloc_free (parser->lex_from_list);
parser->lex_from_list = NULL;
}
}
@@ -1819,7 +1845,7 @@ _glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
if (parser->skip_stack)
current = parser->skip_stack->type;
node = talloc (parser, skip_node_t);
node = ralloc (parser, skip_node_t);
node->loc = *loc;
if (current == SKIP_NO_SKIP) {
@@ -1864,5 +1890,5 @@ _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc)
node = parser->skip_stack;
parser->skip_stack = node->next;
talloc_free (node);
ralloc_free (node);
}

View File

@@ -54,7 +54,7 @@ load_text_fd (void *ctx, int fd)
while (1) {
if (total_read + CHUNK + 1 > text_size) {
text_size = text_size ? text_size * 2 : CHUNK + 1;
text = talloc_realloc_size (ctx, text, text_size);
text = reralloc_size (ctx, text, text_size);
if (text == NULL) {
fprintf (stderr, "Out of memory\n");
return NULL;
@@ -64,7 +64,7 @@ load_text_fd (void *ctx, int fd)
if (bytes < 0) {
fprintf (stderr, "Error while reading: %s\n",
strerror (errno));
talloc_free (text);
ralloc_free (text);
return NULL;
}
@@ -107,8 +107,8 @@ int
main (int argc, char *argv[])
{
char *filename = NULL;
void *ctx = talloc(NULL, void*);
char *info_log = talloc_strdup(ctx, "");
void *ctx = ralloc(NULL, void*);
char *info_log = ralloc_strdup(ctx, "");
const char *shader;
int ret;
@@ -125,7 +125,7 @@ main (int argc, char *argv[])
printf("%s", shader);
fprintf(stderr, "%s", info_log);
talloc_free(ctx);
ralloc_free(ctx);
return ret;
}

View File

@@ -26,7 +26,7 @@
#include <stdint.h>
#include <talloc.h>
#include "../ralloc.h"
#include "program/hash_table.h"
@@ -189,7 +189,7 @@ void
glcpp_parser_destroy (glcpp_parser_t *parser);
int
preprocess(void *talloc_ctx, const char **shader, char **info_log,
preprocess(void *ralloc_ctx, const char **shader, char **info_log,
const struct gl_extensions *extensions, int api);
/* Functions for writing to the info log */

View File

@@ -33,16 +33,15 @@ glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
va_list ap;
parser->error = 1;
parser->info_log = talloc_asprintf_append(parser->info_log,
"%u:%u(%u): "
ralloc_asprintf_append(&parser->info_log, "%u:%u(%u): "
"preprocessor error: ",
locp->source,
locp->first_line,
locp->first_column);
va_start(ap, fmt);
parser->info_log = talloc_vasprintf_append(parser->info_log, fmt, ap);
ralloc_vasprintf_append(&parser->info_log, fmt, ap);
va_end(ap);
parser->info_log = talloc_strdup_append(parser->info_log, "\n");
ralloc_strcat(&parser->info_log, "\n");
}
void
@@ -50,16 +49,15 @@ glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
{
va_list ap;
parser->info_log = talloc_asprintf_append(parser->info_log,
"%u:%u(%u): "
ralloc_asprintf_append(&parser->info_log, "%u:%u(%u): "
"preprocessor warning: ",
locp->source,
locp->first_line,
locp->first_column);
va_start(ap, fmt);
parser->info_log = talloc_vasprintf_append(parser->info_log, fmt, ap);
ralloc_vasprintf_append(&parser->info_log, fmt, ap);
va_end(ap);
parser->info_log = talloc_strdup_append(parser->info_log, "\n");
ralloc_strcat(&parser->info_log, "\n");
}
/* Searches backwards for '^ *#' from a given starting point. */
@@ -92,7 +90,7 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
{
int in_continued_line = 0;
int extra_newlines = 0;
char *clean = talloc_strdup(ctx, "");
char *clean = ralloc_strdup(ctx, "");
const char *search_start = shader;
const char *newline;
while ((newline = strchr(search_start, '\n')) != NULL) {
@@ -122,27 +120,27 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
}
if (in_continued_line) {
/* Copy everything before the \ */
clean = talloc_strndup_append(clean, shader, backslash - shader);
ralloc_strncat(&clean, shader, backslash - shader);
shader = newline + 1;
extra_newlines++;
}
} else if (in_continued_line) {
/* Copy everything up to and including the \n */
clean = talloc_strndup_append(clean, shader, newline - shader + 1);
ralloc_strncat(&clean, shader, newline - shader + 1);
shader = newline + 1;
/* Output extra newlines to make line numbers match */
for (; extra_newlines > 0; extra_newlines--)
clean = talloc_strdup_append(clean, "\n");
ralloc_strcat(&clean, "\n");
in_continued_line = 0;
}
search_start = newline + 1;
}
clean = talloc_strdup_append(clean, shader);
ralloc_strcat(&clean, shader);
return clean;
}
int
preprocess(void *talloc_ctx, const char **shader, char **info_log,
preprocess(void *ralloc_ctx, const char **shader, char **info_log,
const struct gl_extensions *extensions, int api)
{
int errors;
@@ -156,9 +154,9 @@ preprocess(void *talloc_ctx, const char **shader, char **info_log,
if (parser->skip_stack)
glcpp_error (&parser->skip_stack->loc, parser, "Unterminated #if\n");
*info_log = talloc_strdup_append(*info_log, parser->info_log);
ralloc_strcat(info_log, parser->info_log);
talloc_steal(talloc_ctx, parser->output);
ralloc_steal(ralloc_ctx, parser->output);
*shader = parser->output;
errors = parser->error;

File diff suppressed because it is too large Load Diff

View File

@@ -22,10 +22,13 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <ctype.h>
#include "strtod.h"
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
#define YY_USER_ACTION \
do { \
yylloc->source = 0; \
@@ -61,7 +64,7 @@
return ERROR_TOK; \
} else { \
yylval->identifier = strdup(yytext); \
return IDENTIFIER; \
return classify_identifier(yyextra, yytext); \
} \
} while (0)
@@ -144,6 +147,10 @@ HASH ^{SPC}#{SPC}
BEGIN PP;
return PRAGMA_OPTIMIZE_OFF;
}
^{SPC}#{SPC}pragma{SPCP}STDGL{SPCP}invariant{SPC}\({SPC}all{SPC}\) {
BEGIN PP;
return PRAGMA_INVARIANT_ALL;
}
^{SPC}#{SPC}pragma{SPCP} { BEGIN PRAGMA; }
<PRAGMA>\n { BEGIN 0; yylineno++; yycolumn = 0; }
@@ -293,23 +300,23 @@ layout {
}
[0-9]+\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
yylval->real = strtod(yytext, NULL);
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
}
\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
yylval->real = strtod(yytext, NULL);
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
}
[0-9]+\.([eE][+-]?[0-9]+)?[fF]? {
yylval->real = strtod(yytext, NULL);
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
}
[0-9]+[eE][+-]?[0-9]+[fF]? {
yylval->real = strtod(yytext, NULL);
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
}
[0-9]+[fF] {
yylval->real = strtod(yytext, NULL);
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
}
@@ -412,14 +419,25 @@ row_major KEYWORD(130, 999, ROW_MAJOR);
[_a-zA-Z][_a-zA-Z0-9]* {
struct _mesa_glsl_parse_state *state = yyextra;
void *ctx = state;
yylval->identifier = talloc_strdup(ctx, yytext);
return IDENTIFIER;
yylval->identifier = ralloc_strdup(ctx, yytext);
return classify_identifier(state, yytext);
}
. { return yytext[0]; }
%%
int
classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
{
if (state->symbols->get_variable(name) || state->symbols->get_function(name))
return IDENTIFIER;
else if (state->symbols->get_type(name))
return TYPE_IDENTIFIER;
else
return NEW_IDENTIFIER;
}
void
_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
{

File diff suppressed because it is too large Load Diff

View File

@@ -112,122 +112,125 @@
VOID_TOK = 329,
WHILE = 330,
IDENTIFIER = 331,
FLOATCONSTANT = 332,
INTCONSTANT = 333,
UINTCONSTANT = 334,
BOOLCONSTANT = 335,
FIELD_SELECTION = 336,
LEFT_OP = 337,
RIGHT_OP = 338,
INC_OP = 339,
DEC_OP = 340,
LE_OP = 341,
GE_OP = 342,
EQ_OP = 343,
NE_OP = 344,
AND_OP = 345,
OR_OP = 346,
XOR_OP = 347,
MUL_ASSIGN = 348,
DIV_ASSIGN = 349,
ADD_ASSIGN = 350,
MOD_ASSIGN = 351,
LEFT_ASSIGN = 352,
RIGHT_ASSIGN = 353,
AND_ASSIGN = 354,
XOR_ASSIGN = 355,
OR_ASSIGN = 356,
SUB_ASSIGN = 357,
INVARIANT = 358,
LOWP = 359,
MEDIUMP = 360,
HIGHP = 361,
SUPERP = 362,
PRECISION = 363,
VERSION = 364,
EXTENSION = 365,
LINE = 366,
COLON = 367,
EOL = 368,
INTERFACE = 369,
OUTPUT = 370,
PRAGMA_DEBUG_ON = 371,
PRAGMA_DEBUG_OFF = 372,
PRAGMA_OPTIMIZE_ON = 373,
PRAGMA_OPTIMIZE_OFF = 374,
LAYOUT_TOK = 375,
ASM = 376,
CLASS = 377,
UNION = 378,
ENUM = 379,
TYPEDEF = 380,
TEMPLATE = 381,
THIS = 382,
PACKED_TOK = 383,
GOTO = 384,
INLINE_TOK = 385,
NOINLINE = 386,
VOLATILE = 387,
PUBLIC_TOK = 388,
STATIC = 389,
EXTERN = 390,
EXTERNAL = 391,
LONG_TOK = 392,
SHORT_TOK = 393,
DOUBLE_TOK = 394,
HALF = 395,
FIXED_TOK = 396,
UNSIGNED = 397,
INPUT_TOK = 398,
OUPTUT = 399,
HVEC2 = 400,
HVEC3 = 401,
HVEC4 = 402,
DVEC2 = 403,
DVEC3 = 404,
DVEC4 = 405,
FVEC2 = 406,
FVEC3 = 407,
FVEC4 = 408,
SAMPLER2DRECT = 409,
SAMPLER3DRECT = 410,
SAMPLER2DRECTSHADOW = 411,
SIZEOF = 412,
CAST = 413,
NAMESPACE = 414,
USING = 415,
ERROR_TOK = 416,
COMMON = 417,
PARTITION = 418,
ACTIVE = 419,
SAMPLERBUFFER = 420,
FILTER = 421,
IMAGE1D = 422,
IMAGE2D = 423,
IMAGE3D = 424,
IMAGECUBE = 425,
IMAGE1DARRAY = 426,
IMAGE2DARRAY = 427,
IIMAGE1D = 428,
IIMAGE2D = 429,
IIMAGE3D = 430,
IIMAGECUBE = 431,
IIMAGE1DARRAY = 432,
IIMAGE2DARRAY = 433,
UIMAGE1D = 434,
UIMAGE2D = 435,
UIMAGE3D = 436,
UIMAGECUBE = 437,
UIMAGE1DARRAY = 438,
UIMAGE2DARRAY = 439,
IMAGE1DSHADOW = 440,
IMAGE2DSHADOW = 441,
IMAGEBUFFER = 442,
IIMAGEBUFFER = 443,
UIMAGEBUFFER = 444,
IMAGE1DARRAYSHADOW = 445,
IMAGE2DARRAYSHADOW = 446,
ROW_MAJOR = 447
TYPE_IDENTIFIER = 332,
NEW_IDENTIFIER = 333,
FLOATCONSTANT = 334,
INTCONSTANT = 335,
UINTCONSTANT = 336,
BOOLCONSTANT = 337,
FIELD_SELECTION = 338,
LEFT_OP = 339,
RIGHT_OP = 340,
INC_OP = 341,
DEC_OP = 342,
LE_OP = 343,
GE_OP = 344,
EQ_OP = 345,
NE_OP = 346,
AND_OP = 347,
OR_OP = 348,
XOR_OP = 349,
MUL_ASSIGN = 350,
DIV_ASSIGN = 351,
ADD_ASSIGN = 352,
MOD_ASSIGN = 353,
LEFT_ASSIGN = 354,
RIGHT_ASSIGN = 355,
AND_ASSIGN = 356,
XOR_ASSIGN = 357,
OR_ASSIGN = 358,
SUB_ASSIGN = 359,
INVARIANT = 360,
LOWP = 361,
MEDIUMP = 362,
HIGHP = 363,
SUPERP = 364,
PRECISION = 365,
VERSION = 366,
EXTENSION = 367,
LINE = 368,
COLON = 369,
EOL = 370,
INTERFACE = 371,
OUTPUT = 372,
PRAGMA_DEBUG_ON = 373,
PRAGMA_DEBUG_OFF = 374,
PRAGMA_OPTIMIZE_ON = 375,
PRAGMA_OPTIMIZE_OFF = 376,
PRAGMA_INVARIANT_ALL = 377,
LAYOUT_TOK = 378,
ASM = 379,
CLASS = 380,
UNION = 381,
ENUM = 382,
TYPEDEF = 383,
TEMPLATE = 384,
THIS = 385,
PACKED_TOK = 386,
GOTO = 387,
INLINE_TOK = 388,
NOINLINE = 389,
VOLATILE = 390,
PUBLIC_TOK = 391,
STATIC = 392,
EXTERN = 393,
EXTERNAL = 394,
LONG_TOK = 395,
SHORT_TOK = 396,
DOUBLE_TOK = 397,
HALF = 398,
FIXED_TOK = 399,
UNSIGNED = 400,
INPUT_TOK = 401,
OUPTUT = 402,
HVEC2 = 403,
HVEC3 = 404,
HVEC4 = 405,
DVEC2 = 406,
DVEC3 = 407,
DVEC4 = 408,
FVEC2 = 409,
FVEC3 = 410,
FVEC4 = 411,
SAMPLER2DRECT = 412,
SAMPLER3DRECT = 413,
SAMPLER2DRECTSHADOW = 414,
SIZEOF = 415,
CAST = 416,
NAMESPACE = 417,
USING = 418,
ERROR_TOK = 419,
COMMON = 420,
PARTITION = 421,
ACTIVE = 422,
SAMPLERBUFFER = 423,
FILTER = 424,
IMAGE1D = 425,
IMAGE2D = 426,
IMAGE3D = 427,
IMAGECUBE = 428,
IMAGE1DARRAY = 429,
IMAGE2DARRAY = 430,
IIMAGE1D = 431,
IIMAGE2D = 432,
IIMAGE3D = 433,
IIMAGECUBE = 434,
IIMAGE1DARRAY = 435,
IIMAGE2DARRAY = 436,
UIMAGE1D = 437,
UIMAGE2D = 438,
UIMAGE3D = 439,
UIMAGECUBE = 440,
UIMAGE1DARRAY = 441,
UIMAGE2DARRAY = 442,
IMAGE1DSHADOW = 443,
IMAGE2DSHADOW = 444,
IMAGEBUFFER = 445,
IIMAGEBUFFER = 446,
UIMAGEBUFFER = 447,
IMAGE1DARRAYSHADOW = 448,
IMAGE2DARRAYSHADOW = 449,
ROW_MAJOR = 450
};
#endif
@@ -271,7 +274,7 @@ typedef union YYSTYPE
/* Line 1685 of yacc.c */
#line 275 "glsl_parser.h"
#line 278 "glsl_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */

View File

@@ -93,7 +93,8 @@
%token ISAMPLER1DARRAY ISAMPLER2DARRAY USAMPLER1D USAMPLER2D USAMPLER3D
%token USAMPLERCUBE USAMPLER1DARRAY USAMPLER2DARRAY
%token STRUCT VOID_TOK WHILE
%token <identifier> IDENTIFIER
%token <identifier> IDENTIFIER TYPE_IDENTIFIER NEW_IDENTIFIER
%type <identifier> any_identifier
%token <real> FLOATCONSTANT
%token <n> INTCONSTANT UINTCONSTANT BOOLCONSTANT
%token <identifier> FIELD_SELECTION
@@ -108,6 +109,7 @@
%token VERSION EXTENSION LINE COLON EOL INTERFACE OUTPUT
%token PRAGMA_DEBUG_ON PRAGMA_DEBUG_OFF
%token PRAGMA_OPTIMIZE_ON PRAGMA_OPTIMIZE_OFF
%token PRAGMA_INVARIANT_ALL
%token LAYOUT_TOK
/* Reserved words that are not actually used in the grammar.
@@ -183,6 +185,10 @@
%type <expression> function_call_generic
%type <expression> function_call_or_method
%type <expression> function_call
%type <expression> method_call_generic
%type <expression> method_call_header_with_parameters
%type <expression> method_call_header_no_parameters
%type <expression> method_call_header
%type <n> assignment_operator
%type <n> unary_operator
%type <expression> function_identifier
@@ -213,26 +219,51 @@ translation_unit:
_mesa_glsl_initialize_types(state);
}
external_declaration_list
{
delete state->symbols;
state->symbols = new(ralloc_parent(state)) glsl_symbol_table;
_mesa_glsl_initialize_types(state);
}
;
version_statement:
/* blank - no #version specified: defaults are already set */
| VERSION INTCONSTANT EOL
{
bool supported = false;
switch ($2) {
case 100:
state->es_shader = true;
supported = state->Const.GLSL_100ES;
break;
case 110:
supported = state->Const.GLSL_110;
break;
case 120:
supported = state->Const.GLSL_120;
break;
case 130:
/* FINISHME: Check against implementation support versions. */
state->language_version = $2;
supported = state->Const.GLSL_130;
break;
default:
_mesa_glsl_error(& @2, state, "Shading language version"
"%u is not supported\n", $2);
supported = false;
break;
}
state->language_version = $2;
state->version_string =
ralloc_asprintf(state, "GLSL%s %d.%02d",
state->es_shader ? " ES" : "",
state->language_version / 100,
state->language_version % 100);
if (!supported) {
_mesa_glsl_error(& @2, state, "%s is not supported. "
"Supported versions are: %s\n",
state->version_string,
state->supported_version_string);
}
}
;
@@ -241,6 +272,16 @@ pragma_statement:
| PRAGMA_DEBUG_OFF EOL
| PRAGMA_OPTIMIZE_ON EOL
| PRAGMA_OPTIMIZE_OFF EOL
| PRAGMA_INVARIANT_ALL EOL
{
if (state->language_version < 120) {
_mesa_glsl_warning(& @1, state,
"pragma `invariant(all)' not supported in %s",
state->version_string);
} else {
state->all_invariant = true;
}
}
;
extension_statement_list:
@@ -248,8 +289,14 @@ extension_statement_list:
| extension_statement_list extension_statement
;
any_identifier:
IDENTIFIER
| TYPE_IDENTIFIER
| NEW_IDENTIFIER
;
extension_statement:
EXTENSION IDENTIFIER COLON IDENTIFIER EOL
EXTENSION any_identifier COLON any_identifier EOL
{
if (!_mesa_glsl_process_extension($2, & @2, $4, & @4, state)) {
YYERROR;
@@ -260,16 +307,16 @@ extension_statement:
external_declaration_list:
external_declaration
{
/* FINISHME: The NULL test is only required because 'precision'
* FINISHME: statements are not yet supported.
/* FINISHME: The NULL test is required because pragmas are set to
* FINISHME: NULL. (See production rule for external_declaration.)
*/
if ($1 != NULL)
state->translation_unit.push_tail(& $1->link);
}
| external_declaration_list external_declaration
{
/* FINISHME: The NULL test is only required because 'precision'
* FINISHME: statements are not yet supported.
/* FINISHME: The NULL test is required because pragmas are set to
* FINISHME: NULL. (See production rule for external_declaration.)
*/
if ($2 != NULL)
state->translation_unit.push_tail(& $2->link);
@@ -278,6 +325,7 @@ external_declaration_list:
variable_identifier:
IDENTIFIER
| NEW_IDENTIFIER
;
primary_expression:
@@ -334,7 +382,7 @@ postfix_expression:
{
$$ = $1;
}
| postfix_expression '.' IDENTIFIER
| postfix_expression '.' any_identifier
{
void *ctx = state;
$$ = new(ctx) ast_expression(ast_field_selection, $1, NULL, NULL);
@@ -365,7 +413,7 @@ function_call:
function_call_or_method:
function_call_generic
| postfix_expression '.' function_call_generic
| postfix_expression '.' method_call_generic
{
void *ctx = state;
$$ = new(ctx) ast_expression(ast_field_selection, $1, $3, NULL);
@@ -412,7 +460,7 @@ function_identifier:
$$ = new(ctx) ast_function_expression($1);
$$->set_location(yylloc);
}
| IDENTIFIER
| variable_identifier
{
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression($1);
@@ -428,6 +476,44 @@ function_identifier:
}
;
method_call_generic:
method_call_header_with_parameters ')'
| method_call_header_no_parameters ')'
;
method_call_header_no_parameters:
method_call_header VOID_TOK
| method_call_header
;
method_call_header_with_parameters:
method_call_header assignment_expression
{
$$ = $1;
$$->set_location(yylloc);
$$->expressions.push_tail(& $2->link);
}
| method_call_header_with_parameters ',' assignment_expression
{
$$ = $1;
$$->set_location(yylloc);
$$->expressions.push_tail(& $3->link);
}
;
// Grammar Note: Constructors look like methods, but lexical
// analysis recognized most of them as keywords. They are now
// recognized through "type_specifier".
method_call_header:
variable_identifier '('
{
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression($1);
$$ = new(ctx) ast_function_expression(callee);
$$->set_location(yylloc);
}
;
// Grammar Note: No traditional style type casts.
unary_expression:
postfix_expression
@@ -678,6 +764,7 @@ constant_expression:
declaration:
function_prototype ';'
{
state->symbols->pop_scope();
$$ = $1;
}
| init_declarator_list ';'
@@ -686,14 +773,9 @@ declaration:
}
| PRECISION precision_qualifier type_specifier_no_prec ';'
{
if (($3->type_specifier != ast_float)
&& ($3->type_specifier != ast_int)) {
_mesa_glsl_error(& @3, state, "global precision qualifier can "
"only be applied to `int' or `float'\n");
YYERROR;
}
$$ = NULL; /* FINISHME */
$3->precision = $2;
$3->is_precision_statement = true;
$$ = $3;
}
;
@@ -720,18 +802,21 @@ function_header_with_parameters:
;
function_header:
fully_specified_type IDENTIFIER '('
fully_specified_type variable_identifier '('
{
void *ctx = state;
$$ = new(ctx) ast_function();
$$->set_location(yylloc);
$$->return_type = $1;
$$->identifier = $2;
state->symbols->add_function(new(state) ir_function($2));
state->symbols->push_scope();
}
;
parameter_declarator:
type_specifier IDENTIFIER
type_specifier any_identifier
{
void *ctx = state;
$$ = new(ctx) ast_parameter_declarator();
@@ -741,7 +826,7 @@ parameter_declarator:
$$->type->specifier = $1;
$$->identifier = $2;
}
| type_specifier IDENTIFIER '[' constant_expression ']'
| type_specifier any_identifier '[' constant_expression ']'
{
void *ctx = state;
$$ = new(ctx) ast_parameter_declarator();
@@ -819,7 +904,7 @@ parameter_type_specifier:
init_declarator_list:
single_declaration
| init_declarator_list ',' IDENTIFIER
| init_declarator_list ',' any_identifier
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, NULL);
@@ -827,8 +912,9 @@ init_declarator_list:
$$ = $1;
$$->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto));
}
| init_declarator_list ',' IDENTIFIER '[' ']'
| init_declarator_list ',' any_identifier '[' ']'
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, NULL);
@@ -836,8 +922,9 @@ init_declarator_list:
$$ = $1;
$$->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto));
}
| init_declarator_list ',' IDENTIFIER '[' constant_expression ']'
| init_declarator_list ',' any_identifier '[' constant_expression ']'
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, NULL);
@@ -845,8 +932,9 @@ init_declarator_list:
$$ = $1;
$$->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto));
}
| init_declarator_list ',' IDENTIFIER '[' ']' '=' initializer
| init_declarator_list ',' any_identifier '[' ']' '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, $7);
@@ -854,8 +942,9 @@ init_declarator_list:
$$ = $1;
$$->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto));
}
| init_declarator_list ',' IDENTIFIER '[' constant_expression ']' '=' initializer
| init_declarator_list ',' any_identifier '[' constant_expression ']' '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, $8);
@@ -863,8 +952,9 @@ init_declarator_list:
$$ = $1;
$$->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto));
}
| init_declarator_list ',' IDENTIFIER '=' initializer
| init_declarator_list ',' any_identifier '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, $5);
@@ -872,6 +962,7 @@ init_declarator_list:
$$ = $1;
$$->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto));
}
;
@@ -888,7 +979,7 @@ single_declaration:
$$->set_location(yylloc);
}
}
| fully_specified_type IDENTIFIER
| fully_specified_type any_identifier
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL);
@@ -897,7 +988,7 @@ single_declaration:
$$->set_location(yylloc);
$$->declarations.push_tail(&decl->link);
}
| fully_specified_type IDENTIFIER '[' ']'
| fully_specified_type any_identifier '[' ']'
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, NULL);
@@ -906,7 +997,7 @@ single_declaration:
$$->set_location(yylloc);
$$->declarations.push_tail(&decl->link);
}
| fully_specified_type IDENTIFIER '[' constant_expression ']'
| fully_specified_type any_identifier '[' constant_expression ']'
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, NULL);
@@ -915,7 +1006,7 @@ single_declaration:
$$->set_location(yylloc);
$$->declarations.push_tail(&decl->link);
}
| fully_specified_type IDENTIFIER '[' ']' '=' initializer
| fully_specified_type any_identifier '[' ']' '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, $6);
@@ -924,7 +1015,7 @@ single_declaration:
$$->set_location(yylloc);
$$->declarations.push_tail(&decl->link);
}
| fully_specified_type IDENTIFIER '[' constant_expression ']' '=' initializer
| fully_specified_type any_identifier '[' constant_expression ']' '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, $7);
@@ -933,7 +1024,7 @@ single_declaration:
$$->set_location(yylloc);
$$->declarations.push_tail(&decl->link);
}
| fully_specified_type IDENTIFIER '=' initializer
| fully_specified_type any_identifier '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4);
@@ -942,7 +1033,7 @@ single_declaration:
$$->set_location(yylloc);
$$->declarations.push_tail(&decl->link);
}
| INVARIANT IDENTIFIER // Vertex only.
| INVARIANT variable_identifier // Vertex only.
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL);
@@ -1001,7 +1092,7 @@ layout_qualifier_id_list:
;
layout_qualifier_id:
IDENTIFIER
any_identifier
{
bool got_one = false;
@@ -1030,7 +1121,7 @@ layout_qualifier_id:
"identifier `%s' used\n", $1);
}
}
| IDENTIFIER '=' INTCONSTANT
| any_identifier '=' INTCONSTANT
{
bool got_one = false;
@@ -1179,6 +1270,9 @@ storage_qualifier:
type_specifier:
type_specifier_no_prec
{
$$ = $1;
}
| precision_qualifier type_specifier_no_prec
{
$$ = $2;
@@ -1215,7 +1309,7 @@ type_specifier_nonarray:
$$ = new(ctx) ast_type_specifier($1);
$$->set_location(yylloc);
}
| IDENTIFIER
| TYPE_IDENTIFIER
{
void *ctx = state;
$$ = new(ctx) ast_type_specifier($1);
@@ -1282,10 +1376,9 @@ precision_qualifier:
if (!state->es_shader && state->language_version < 130)
_mesa_glsl_error(& @1, state,
"precision qualifier forbidden "
"in GLSL %d.%d (1.30 or later "
"in %s (1.30 or later "
"required)\n",
state->language_version / 100,
state->language_version % 100);
state->version_string);
$$ = ast_precision_high;
}
@@ -1293,10 +1386,9 @@ precision_qualifier:
if (!state->es_shader && state->language_version < 130)
_mesa_glsl_error(& @1, state,
"precision qualifier forbidden "
"in GLSL %d.%d (1.30 or later "
"in %s (1.30 or later "
"required)\n",
state->language_version / 100,
state->language_version % 100);
state->version_string);
$$ = ast_precision_medium;
}
@@ -1304,21 +1396,21 @@ precision_qualifier:
if (!state->es_shader && state->language_version < 130)
_mesa_glsl_error(& @1, state,
"precision qualifier forbidden "
"in GLSL %d.%d (1.30 or later "
"in %s (1.30 or later "
"required)\n",
state->language_version / 100,
state->language_version % 100);
state->version_string);
$$ = ast_precision_low;
}
;
struct_specifier:
STRUCT IDENTIFIER '{' struct_declaration_list '}'
STRUCT any_identifier '{' struct_declaration_list '}'
{
void *ctx = state;
$$ = new(ctx) ast_struct_specifier($2, $4);
$$->set_location(yylloc);
state->symbols->add_type($2, glsl_type::void_type);
}
| STRUCT '{' struct_declaration_list '}'
{
@@ -1370,13 +1462,14 @@ struct_declarator_list:
;
struct_declarator:
IDENTIFIER
any_identifier
{
void *ctx = state;
$$ = new(ctx) ast_declaration($1, false, NULL, NULL);
$$->set_location(yylloc);
state->symbols->add_variable(new(state) ir_variable(NULL, $1, ir_var_auto));
}
| IDENTIFIER '[' constant_expression ']'
| any_identifier '[' constant_expression ']'
{
void *ctx = state;
$$ = new(ctx) ast_declaration($1, true, $3, NULL);
@@ -1416,11 +1509,16 @@ compound_statement:
$$ = new(ctx) ast_compound_statement(true, NULL);
$$->set_location(yylloc);
}
| '{' statement_list '}'
| '{'
{
state->symbols->push_scope();
}
statement_list '}'
{
void *ctx = state;
$$ = new(ctx) ast_compound_statement(true, $2);
$$ = new(ctx) ast_compound_statement(true, $3);
$$->set_location(yylloc);
state->symbols->pop_scope();
}
;
@@ -1508,7 +1606,7 @@ condition:
{
$$ = (ast_node *) $1;
}
| fully_specified_type IDENTIFIER '=' initializer
| fully_specified_type any_identifier '=' initializer
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4);
@@ -1628,5 +1726,7 @@ function_definition:
$$->set_location(yylloc);
$$->prototype = $1;
$$->body = $2;
state->symbols->pop_scope();
}
;

View File

@@ -26,10 +26,10 @@
#include <assert.h>
extern "C" {
#include <talloc.h>
#include "main/core.h" /* for struct gl_context */
}
#include "ralloc.h"
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
@@ -48,7 +48,7 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
this->scanner = NULL;
this->translation_unit.make_empty();
this->symbols = new(mem_ctx) glsl_symbol_table;
this->info_log = talloc_strdup(mem_ctx, "");
this->info_log = ralloc_strdup(mem_ctx, "");
this->error = false;
this->loop_or_switch_nesting = NULL;
@@ -79,6 +79,38 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
/* Note: Once the OpenGL 3.0 'forward compatible' context or the OpenGL 3.2
* Core context is supported, this logic will need change. Older versions of
* GLSL are no longer supported outside the compatibility contexts of 3.x.
*/
this->Const.GLSL_100ES = (ctx->API == API_OPENGLES2)
|| ctx->Extensions.ARB_ES2_compatibility;
this->Const.GLSL_110 = (ctx->API == API_OPENGL);
this->Const.GLSL_120 = (ctx->API == API_OPENGL)
&& (ctx->Const.GLSLVersion >= 120);
this->Const.GLSL_130 = (ctx->API == API_OPENGL)
&& (ctx->Const.GLSLVersion >= 130);
const unsigned lowest_version =
(ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility
? 100 : 110;
const unsigned highest_version =
(ctx->API == API_OPENGL) ? ctx->Const.GLSLVersion : 100;
char *supported = (char *) ralloc_context(this);
for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) {
const char *const prefix = (ver == lowest_version)
? ""
: ((ver == highest_version) ? ", and " : ", ");
ralloc_asprintf_append(& supported, "%s%d.%02d%s",
prefix,
ver / 100, ver % 100,
(ver == 100) ? " ES" : "");
}
this->supported_version_string = supported;
}
const char *
@@ -104,15 +136,14 @@ _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
state->error = true;
assert(state->info_log != NULL);
state->info_log = talloc_asprintf_append(state->info_log,
"%u:%u(%u): error: ",
ralloc_asprintf_append(&state->info_log, "%u:%u(%u): error: ",
locp->source,
locp->first_line,
locp->first_column);
va_start(ap, fmt);
state->info_log = talloc_vasprintf_append(state->info_log, fmt, ap);
ralloc_vasprintf_append(&state->info_log, fmt, ap);
va_end(ap);
state->info_log = talloc_strdup_append(state->info_log, "\n");
ralloc_strcat(&state->info_log, "\n");
}
@@ -123,15 +154,14 @@ _mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state,
va_list ap;
assert(state->info_log != NULL);
state->info_log = talloc_asprintf_append(state->info_log,
"%u:%u(%u): warning: ",
ralloc_asprintf_append(&state->info_log, "%u:%u(%u): warning: ",
locp->source,
locp->first_line,
locp->first_column);
va_start(ap, fmt);
state->info_log = talloc_vasprintf_append(state->info_log, fmt, ap);
ralloc_vasprintf_append(&state->info_log, fmt, ap);
va_end(ap);
state->info_log = talloc_strdup_append(state->info_log, "\n");
ralloc_strcat(&state->info_log, "\n");
}
@@ -696,7 +726,7 @@ ast_struct_specifier::ast_struct_specifier(char *identifier,
{
if (identifier == NULL) {
static unsigned anon_count = 1;
identifier = talloc_asprintf(this, "#anon_struct_%04x", anon_count);
identifier = ralloc_asprintf(this, "#anon_struct_%04x", anon_count);
anon_count++;
}
name = identifier;

View File

@@ -31,7 +31,7 @@
#ifdef __cplusplus
#include <cstdlib>
#include <stdlib.h>
#include "glsl_symbol_table.h"
enum _mesa_glsl_parser_targets {
@@ -46,21 +46,21 @@ struct _mesa_glsl_parse_state {
_mesa_glsl_parse_state(struct gl_context *ctx, GLenum target,
void *mem_ctx);
/* Callers of this talloc-based new need not call delete. It's
* easier to just talloc_free 'ctx' (or any of its ancestors). */
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
static void* operator new(size_t size, void *ctx)
{
void *mem = talloc_zero_size(ctx, size);
void *mem = rzalloc_size(ctx, size);
assert(mem != NULL);
return mem;
}
/* If the user *does* call delete, that's OK, we will just
* talloc_free in that case. */
* ralloc_free in that case. */
static void operator delete(void *mem)
{
talloc_free(mem);
ralloc_free(mem);
}
void *scanner;
@@ -69,8 +69,19 @@ struct _mesa_glsl_parse_state {
bool es_shader;
unsigned language_version;
const char *version_string;
enum _mesa_glsl_parser_targets target;
/**
* Printable list of GLSL versions supported by the current context
*
* \note
* This string should probably be generated per-context instead of per
* invokation of the compiler. This should be changed when the method of
* tracking supported GLSL versions changes.
*/
const char *supported_version_string;
/**
* Implementation defined limits that affect built-in variables, etc.
*
@@ -92,6 +103,22 @@ struct _mesa_glsl_parse_state {
/* ARB_draw_buffers */
unsigned MaxDrawBuffers;
/**
* Set of GLSL versions supported by the current context
*
* Knowing that version X is supported doesn't mean that versions before
* X are also supported. Version 1.00 is only supported in an ES2
* context or when GL_ARB_ES2_compatibility is supported. In an OpenGL
* 3.0 "forward compatible" context, GLSL 1.10 and 1.20 are \b not
* supported.
*/
/*@{*/
unsigned GLSL_100ES:1;
unsigned GLSL_110:1;
unsigned GLSL_120:1;
unsigned GLSL_130:1;
/*@}*/
} Const;
/**
@@ -108,6 +135,13 @@ struct _mesa_glsl_parse_state {
/** Was there an error during compilation? */
bool error;
/**
* Are all shader inputs / outputs invariant?
*
* This is set when the 'STDGL invariant(all)' pragma is used.
*/
bool all_invariant;
/** Loop or switch statement containing the current instructions. */
class ir_instruction *loop_or_switch_nesting;
class ast_iteration_statement *loop_or_switch_nesting_ast;

View File

@@ -26,22 +26,19 @@
class symbol_table_entry {
public:
/* Callers of this talloc-based new need not call delete. It's
* easier to just talloc_free 'ctx' (or any of its ancestors). */
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
static void* operator new(size_t size, void *ctx)
{
void *entry = talloc_size(ctx, size);
void *entry = ralloc_size(ctx, size);
assert(entry != NULL);
return entry;
}
/* If the user *does* call delete, that's OK, we will just
* talloc_free in that case. Here, C++ will have already called the
* destructor so tell talloc not to do that again. */
static void operator delete(void *table)
/* If the user *does* call delete, that's OK, we will just ralloc_free. */
static void operator delete(void *entry)
{
talloc_set_destructor(table, NULL);
talloc_free(table);
ralloc_free(entry);
}
symbol_table_entry(ir_variable *v) : v(v), f(0), t(0) {}
@@ -57,13 +54,13 @@ glsl_symbol_table::glsl_symbol_table()
{
this->language_version = 120;
this->table = _mesa_symbol_table_ctor();
this->mem_ctx = talloc_init("symbol table entries");
this->mem_ctx = ralloc_context(NULL);
}
glsl_symbol_table::~glsl_symbol_table()
{
_mesa_symbol_table_dtor(table);
talloc_free(mem_ctx);
ralloc_free(mem_ctx);
}
void glsl_symbol_table::push_scope()

View File

@@ -44,36 +44,34 @@ class symbol_table_entry;
*/
struct glsl_symbol_table {
private:
static int
static void
_glsl_symbol_table_destructor (glsl_symbol_table *table)
{
table->~glsl_symbol_table();
return 0;
}
public:
/* Callers of this talloc-based new need not call delete. It's
* easier to just talloc_free 'ctx' (or any of its ancestors). */
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
static void* operator new(size_t size, void *ctx)
{
void *table;
table = talloc_size(ctx, size);
table = ralloc_size(ctx, size);
assert(table != NULL);
talloc_set_destructor(table, (int (*)(void*)) _glsl_symbol_table_destructor);
ralloc_set_destructor(table, (void (*)(void*)) _glsl_symbol_table_destructor);
return table;
}
/* If the user *does* call delete, that's OK, we will just
* talloc_free in that case. Here, C++ will have already called the
* destructor so tell talloc not to do that again. */
* ralloc_free in that case. Here, C++ will have already called the
* destructor so tell ralloc not to do that again. */
static void operator delete(void *table)
{
talloc_set_destructor(table, NULL);
talloc_free(table);
ralloc_set_destructor(table, NULL);
ralloc_free(table);
}
glsl_symbol_table();

View File

@@ -21,7 +21,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include "main/core.h" /* for Elements */
#include "glsl_symbol_table.h"
@@ -37,10 +37,10 @@ hash_table *glsl_type::record_types = NULL;
void *glsl_type::mem_ctx = NULL;
void
glsl_type::init_talloc_type_ctx(void)
glsl_type::init_ralloc_type_ctx(void)
{
if (glsl_type::mem_ctx == NULL) {
glsl_type::mem_ctx = talloc_autofree_context();
glsl_type::mem_ctx = ralloc_autofree_context();
assert(glsl_type::mem_ctx != NULL);
}
}
@@ -55,8 +55,8 @@ glsl_type::glsl_type(GLenum gl_type,
vector_elements(vector_elements), matrix_columns(matrix_columns),
length(0)
{
init_talloc_type_ctx();
this->name = talloc_strdup(this->mem_ctx, name);
init_ralloc_type_ctx();
this->name = ralloc_strdup(this->mem_ctx, name);
/* Neither dimension is zero or both dimensions are zero.
*/
assert((vector_elements == 0) == (matrix_columns == 0));
@@ -73,8 +73,8 @@ glsl_type::glsl_type(GLenum gl_type,
vector_elements(0), matrix_columns(0),
length(0)
{
init_talloc_type_ctx();
this->name = talloc_strdup(this->mem_ctx, name);
init_ralloc_type_ctx();
this->name = ralloc_strdup(this->mem_ctx, name);
memset(& fields, 0, sizeof(fields));
}
@@ -88,13 +88,13 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
{
unsigned int i;
init_talloc_type_ctx();
this->name = talloc_strdup(this->mem_ctx, name);
this->fields.structure = talloc_array(this->mem_ctx,
init_ralloc_type_ctx();
this->name = ralloc_strdup(this->mem_ctx, name);
this->fields.structure = ralloc_array(this->mem_ctx,
glsl_struct_field, length);
for (i = 0; i < length; i++) {
this->fields.structure[i].type = fields[i].type;
this->fields.structure[i].name = talloc_strdup(this->fields.structure,
this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
fields[i].name);
}
}
@@ -120,7 +120,7 @@ glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
add_types_to_symbol_table(symtab, builtin_structure_types,
Elements(builtin_structure_types),
false);
add_types_to_symbol_table(symtab, &void_type, 1, false);
add_types_to_symbol_table(symtab, void_type, 1, false);
}
void
@@ -264,7 +264,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
* NUL.
*/
const unsigned name_length = strlen(array->name) + 10 + 3;
char *const n = (char *) talloc_size(this->mem_ctx, name_length);
char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
if (length == 0)
snprintf(n, name_length, "%s[]", array->name);
@@ -279,7 +279,7 @@ const glsl_type *
glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
{
if (base_type == GLSL_TYPE_VOID)
return &void_type;
return void_type;
if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
return error_type;
@@ -354,7 +354,7 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
if (t == NULL) {
t = new glsl_type(base, array_size);
hash_table_insert(array_types, (void *) t, talloc_strdup(mem_ctx, key));
hash_table_insert(array_types, (void *) t, ralloc_strdup(mem_ctx, key));
}
assert(t->base_type == GLSL_TYPE_ARRAY);

View File

@@ -26,14 +26,15 @@
#ifndef GLSL_TYPES_H
#define GLSL_TYPES_H
#include <cstring>
#include <cassert>
#include <string.h>
#include <assert.h>
extern "C" {
#include "GL/gl.h"
#include <talloc.h>
}
#include "ralloc.h"
struct _mesa_glsl_parse_state;
struct glsl_symbol_table;
@@ -77,28 +78,28 @@ struct glsl_type {
* and \c GLSL_TYPE_UINT are valid.
*/
/* Callers of this talloc-based new need not call delete. It's
* easier to just talloc_free 'mem_ctx' (or any of its ancestors). */
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'mem_ctx' (or any of its ancestors). */
static void* operator new(size_t size)
{
if (glsl_type::mem_ctx == NULL) {
glsl_type::mem_ctx = talloc_init("glsl_type");
glsl_type::mem_ctx = ralloc_context(NULL);
assert(glsl_type::mem_ctx != NULL);
}
void *type;
type = talloc_size(glsl_type::mem_ctx, size);
type = ralloc_size(glsl_type::mem_ctx, size);
assert(type != NULL);
return type;
}
/* If the user *does* call delete, that's OK, we will just
* talloc_free in that case. */
* ralloc_free in that case. */
static void operator delete(void *type)
{
talloc_free(type);
ralloc_free(type);
}
/**
@@ -142,6 +143,7 @@ struct glsl_type {
*/
/*@{*/
static const glsl_type *const error_type;
static const glsl_type *const void_type;
static const glsl_type *const int_type;
static const glsl_type *const ivec4_type;
static const glsl_type *const uint_type;
@@ -385,13 +387,13 @@ struct glsl_type {
private:
/**
* talloc context for all glsl_type allocations
* ralloc context for all glsl_type allocations
*
* Set on the first call to \c glsl_type::new.
*/
static void *mem_ctx;
void init_talloc_type_ctx(void);
void init_ralloc_type_ctx(void);
/** Constructor for vector and matrix types */
glsl_type(GLenum gl_type,
@@ -424,7 +426,7 @@ private:
*/
/*@{*/
static const glsl_type _error_type;
static const glsl_type void_type;
static const glsl_type _void_type;
static const glsl_type builtin_core_types[];
static const glsl_type builtin_structure_types[];
static const glsl_type builtin_110_deprecated_structure_types[];

View File

@@ -514,7 +514,7 @@ ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
|| type->is_record() || type->is_array());
if (type->is_array()) {
this->array_elements = talloc_array(this, ir_constant *, type->length);
this->array_elements = ralloc_array(this, ir_constant *, type->length);
unsigned i = 0;
foreach_list(node, value_list) {
ir_constant *value = (ir_constant *) node;
@@ -972,7 +972,7 @@ ir_dereference_array::ir_dereference_array(ir_rvalue *value,
ir_dereference_array::ir_dereference_array(ir_variable *var,
ir_rvalue *array_index)
{
void *ctx = talloc_parent(var);
void *ctx = ralloc_parent(var);
this->ir_type = ir_type_dereference_array;
this->array_index = array_index;
@@ -1005,7 +1005,7 @@ ir_dereference_record::ir_dereference_record(ir_rvalue *value,
{
this->ir_type = ir_type_dereference_record;
this->record = value;
this->field = talloc_strdup(this, field);
this->field = ralloc_strdup(this, field);
this->type = (this->record != NULL)
? this->record->type->field_type(field) : glsl_type::error_type;
}
@@ -1014,11 +1014,11 @@ ir_dereference_record::ir_dereference_record(ir_rvalue *value,
ir_dereference_record::ir_dereference_record(ir_variable *var,
const char *field)
{
void *ctx = talloc_parent(var);
void *ctx = ralloc_parent(var);
this->ir_type = ir_type_dereference_record;
this->record = new(ctx) ir_dereference_variable(var);
this->field = talloc_strdup(this, field);
this->field = ralloc_strdup(this, field);
this->type = (this->record != NULL)
? this->record->type->field_type(field) : glsl_type::error_type;
}
@@ -1181,7 +1181,7 @@ ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask)
ir_swizzle *
ir_swizzle::create(ir_rvalue *val, const char *str, unsigned vector_length)
{
void *ctx = talloc_parent(val);
void *ctx = ralloc_parent(val);
/* For each possible swizzle character, this table encodes the value in
* \c idx_map that represents the 0th element of the vector. For invalid
@@ -1270,13 +1270,14 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
{
this->ir_type = ir_type_variable;
this->type = type;
this->name = talloc_strdup(this, name);
this->name = ralloc_strdup(this, name);
this->explicit_location = false;
this->location = -1;
this->warn_extension = NULL;
this->constant_value = NULL;
this->origin_upper_left = false;
this->pixel_center_integer = false;
this->used = false;
if (type && type->base_type == GLSL_TYPE_SAMPLER)
this->read_only = true;
@@ -1360,7 +1361,7 @@ ir_function_signature::replace_parameters(exec_list *new_params)
ir_function::ir_function(const char *name)
{
this->ir_type = ir_type_function;
this->name = talloc_strdup(this, name);
this->name = ralloc_strdup(this, name);
}
@@ -1426,7 +1427,7 @@ steal_memory(ir_instruction *ir, void *new_ctx)
}
}
talloc_steal(new_ctx, ir);
ralloc_steal(new_ctx, ir);
}

View File

@@ -26,13 +26,10 @@
#ifndef IR_H
#define IR_H
#include <cstdio>
#include <cstdlib>
extern "C" {
#include <talloc.h>
}
#include <stdio.h>
#include <stdlib.h>
#include "ralloc.h"
#include "glsl_types.h"
#include "list.h"
#include "ir_visitor.h"
@@ -294,6 +291,15 @@ public:
unsigned centroid:1;
unsigned invariant:1;
/**
* Has this variable been used for reading or writing?
*
* Several GLSL semantic checks require knowledge of whether or not a
* variable has been used. For example, it is an error to redeclare a
* variable as invariant after it has been used.
*/
unsigned used:1;
/**
* Storage class of the variable.
*
@@ -949,7 +955,7 @@ public:
/**
* Get a generic ir_call object when an error occurs
*
* Any allocation will be performed with 'ctx' as talloc owner.
* Any allocation will be performed with 'ctx' as ralloc owner.
*/
static ir_call *get_error_instruction(void *ctx);

View File

@@ -346,7 +346,7 @@ ir_constant::clone(void *mem_ctx, struct hash_table *ht) const
ir_constant *c = new(mem_ctx) ir_constant;
c->type = this->type;
c->array_elements = talloc_array(c, ir_constant *, this->type->length);
c->array_elements = ralloc_array(c, ir_constant *, this->type->length);
for (unsigned i = 0; i < this->type->length; i++) {
c->array_elements[i] = this->array_elements[i]->clone(mem_ctx, NULL);
}

View File

@@ -86,7 +86,7 @@ ir_expression::constant_expression_value()
components = op[1]->type->components();
}
void *ctx = talloc_parent(this);
void *ctx = ralloc_parent(this);
/* Handle array operations here, rather than below. */
if (op[0]->type->is_array()) {
@@ -514,10 +514,18 @@ ir_expression::constant_expression_value()
switch (op[0]->type->base_type) {
case GLSL_TYPE_UINT:
data.u[c] = op[0]->value.u[c0] / op[1]->value.u[c1];
if (op[1]->value.u[c1] == 0) {
data.u[c] = 0;
} else {
data.u[c] = op[0]->value.u[c0] / op[1]->value.u[c1];
}
break;
case GLSL_TYPE_INT:
data.i[c] = op[0]->value.i[c0] / op[1]->value.i[c1];
if (op[1]->value.i[c1] == 0) {
data.i[c] = 0;
} else {
data.i[c] = op[0]->value.i[c0] / op[1]->value.i[c1];
}
break;
case GLSL_TYPE_FLOAT:
data.f[c] = op[0]->value.f[c0] / op[1]->value.f[c1];
@@ -536,10 +544,18 @@ ir_expression::constant_expression_value()
switch (op[0]->type->base_type) {
case GLSL_TYPE_UINT:
data.u[c] = op[0]->value.u[c0] % op[1]->value.u[c1];
if (op[1]->value.u[c1] == 0) {
data.u[c] = 0;
} else {
data.u[c] = op[0]->value.u[c0] % op[1]->value.u[c1];
}
break;
case GLSL_TYPE_INT:
data.i[c] = op[0]->value.i[c0] % op[1]->value.i[c1];
if (op[1]->value.i[c1] == 0) {
data.i[c] = 0;
} else {
data.i[c] = op[0]->value.i[c0] % op[1]->value.i[c1];
}
break;
case GLSL_TYPE_FLOAT:
/* We don't use fmod because it rounds toward zero; GLSL specifies
@@ -845,7 +861,7 @@ ir_swizzle::constant_expression_value()
}
}
void *ctx = talloc_parent(this);
void *ctx = ralloc_parent(this);
return new(ctx) ir_constant(this->type, &data);
}
return NULL;
@@ -868,7 +884,7 @@ ir_dereference_variable::constant_expression_value()
if (!var->constant_value)
return NULL;
return var->constant_value->clone(talloc_parent(var), NULL);
return var->constant_value->clone(ralloc_parent(var), NULL);
}
@@ -879,7 +895,7 @@ ir_dereference_array::constant_expression_value()
ir_constant *idx = this->array_index->constant_expression_value();
if ((array != NULL) && (idx != NULL)) {
void *ctx = talloc_parent(this);
void *ctx = ralloc_parent(this);
if (array->type->is_matrix()) {
/* Array access of a matrix results in a vector.
*/
@@ -984,7 +1000,7 @@ ir_call::constant_expression_value()
* - Fill "data" with appopriate constant data
* - Return an ir_constant directly.
*/
void *mem_ctx = talloc_parent(this);
void *mem_ctx = ralloc_parent(this);
ir_expression *expr = NULL;
ir_constant_data data;

Some files were not shown because too many files have changed in this diff Show More