Compare commits

..

497 Commits
useful ... 7.9

Author SHA1 Message Date
Jeremy Huddleston
5078cb6858 apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e903cc17bb)
2011-06-13 23:14:32 -07:00
Jeremy Huddleston
025d348dc1 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit c6cf82fb55)
2011-06-13 23:14:09 -07:00
Jeremy Huddleston
2bf24ffaff osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
(cherry picked from commit 0e8d045bf8)
2011-06-13 23:10:42 -07:00
Jeremy Huddleston
02e7aa6cea darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit cebdffaa2a)
2011-06-13 23:10:42 -07:00
Jeremy Huddleston
55bf1244e3 darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22c320aa2c)
(cherry picked from commit 6ea70600b9)
2011-06-13 23:10:42 -07:00
Jeremy Huddleston
70d5758479 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e5d241ddb2)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
72b8f19fa6 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d563009cd1)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
e004ac273d apple: Fix build failures in applegl_glx.c
See https://bugs.freedesktop.org/show_bug.cgi?id=29162

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

This commit squashes three cherry-picks:
(cherry picked from commit 5d35343d12)
(cherry picked from commit 7c5f37c032)
(cherry picked from commit 2ee5272e16)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
9cbc705e83 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

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

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1885cf27c9)
2011-06-13 23:10:41 -07:00
Jeremy Huddleston
858db8cd4e glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 3843bbcb4c)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
d8802cd242 apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8593bb32ea)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
7c4cc8d2b9 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7cdf969527)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
a6a5772250 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 279e471750)
2011-06-13 23:10:40 -07:00
Jeremy Huddleston
9bcc214159 apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit b7f0ed8444)
2011-06-13 23:10:39 -07:00
Jeremy Huddleston
e03abf70cd apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 488d6c739f)
2011-06-13 23:10:39 -07:00
Jeremy Huddleston
0c6fbf66cd apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22613d1670)
2011-06-13 23:10:39 -07:00
Jeremy Huddleston
14b9e91d01 apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit bb621cb61e)
2011-06-13 23:10:38 -07:00
Jeremy Huddleston
ff7e6622fc apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4c9bab78a1)
2011-06-13 23:10:38 -07:00
Jeremy Huddleston
bde5310339 apple: Manually edit gl.spec to match mesa 7.9 ProgramParameters4dvNV
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 23:10:37 -07:00
Jeremy Huddleston
4f362e0494 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8e89d0bea7)
2011-06-13 22:59:04 -07:00
Kenneth Graunke
5408ccb09f 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,
as well as a regression in the Meego Tablet UX.

(cherry-picked from 45e8e6c6b1)
2011-05-25 11:17:41 -07:00
José Fonseca
203624128c mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

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

NOTE: This is a candidate for the stable branches.
2011-05-12 14:19:15 +01:00
Tom Stellard
ea95bf7d89 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

(cherry picked from commit 0fa81d6d05)
2011-04-16 14:23:04 -07:00
Tom Stellard
b8050add56 r300/compiler: Fix vertex shader MAD instructions with constant swizzles
(cherry picked from commit d8361400b7)
2011-04-05 09:37:20 -07:00
Marek Olšák
4633054b8b 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:35 +02:00
Marek Olšák
897e464a5d 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:15 +02:00
Marek Olšák
0140b830af r300g: tell the GLSL compiler to lower the continue opcode
NOTE: This is a candidate for the stable branches.
(cherry picked from commit f814dd7a81)

Conflicts:

	src/gallium/drivers/r300/r300_screen.c
2011-04-03 19:43:36 +02:00
Tom Stellard
9e2c9cdf48 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:39:57 -07:00
Marek Olšák
e3dcb53e6e u_blitter: remove invalid assertion 2011-03-30 02:19:32 +02:00
Henri Verbeet
6b46754bc0 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:18 +02:00
Marek Olšák
7397c034ac 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:39:43 +01:00
José Fonseca
39149172c8 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:19:30 +00:00
José Fonseca
c8bd053d3a mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*). 2011-03-22 23:01:01 +00:00
Marek Olšák
7272f8fb18 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:11:52 +01:00
Marek Olšák
c91d217ff7 r300/compiler: remove unused variables
(cherry picked from commit ff8baec5bc)
2011-03-12 22:04:20 +01:00
Marek Olšák
e2baddb653 r300/compiler: fix equal and notequal shadow compare functions
(cherry picked from commit 4dfcf3c4fe)
2011-03-12 22:03:59 +01:00
Marek Olšák
20c7067257 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:46 +01:00
Marek Olšák
ca76f4f6aa 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:34 +01:00
Marek Olšák
c7305375d1 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:21 +01:00
Marek Olšák
dea5e972ff 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:10 +01:00
Marek Olšák
c198d29fbe 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:59 +01:00
Marek Olšák
90292b8001 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:42 +01:00
Marek Olšák
6ea13078fb 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:18 +01:00
Marek Olšák
48d44713f9 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:52 +01:00
Brian Paul
351814a21c docs: fill in 7.9.2 release date 2011-03-08 09:19:13 -07:00
Ian Romanick
a6909b6bd3 docs: Add 7.9.2 md5sums 2011-03-02 14:20:27 -08:00
Ian Romanick
7e9d853665 docs: Add change log to 7.9.2 release notes 2011-03-02 14:18:05 -08:00
Ian Romanick
ca5cf9bf66 mesa: set version string to 7.9.2 (final) 2011-03-02 13:48:22 -08:00
Ian Romanick
dfae3ffa0f 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.
(cherry picked from commit b0a7492aeb)
2011-03-02 13:47:41 -08:00
Ian Romanick
2b41289691 docs: Clean up bug fixes list
All the unnumbered bugs are first.  These are followed by numbered
bugs sorted by bug number.  This is analogous to 8aabb1bc on the 7.10
branch.
2011-03-01 13:22:02 -08:00
Ian Romanick
42c3e00bdb docs: Update 7.9.2 release notes for recent cherry picks 2011-03-01 13:16:53 -08:00
Cyril Brulebois
0ebbfa4335 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:23 -08:00
Brian Paul
fc5889a528 docs: updated environment variable list
(cherry picked from commit 1bf9954bb4)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-03-01 12:57:07 -08:00
Sam Hocevar
a5b6d8ec4d docs: fix glsl_compiler name
(cherry picked from commit fde4943688)
2011-03-01 12:54:21 -08:00
Sam Hocevar
6eb1f39b55 docs: add glsl info
(cherry picked from commit 3e8fb54fb8)
2011-03-01 12:54:05 -08:00
Chad Versace
5e987d0849 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:26 -08:00
Ian Romanick
9fe29f34f3 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 11:53:06 -08:00
Ian Romanick
24a9d95ec7 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:49:56 -08:00
Ian Romanick
38c93ba921 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:49:49 -08:00
Kenneth Graunke
1156006e4a 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:33:09 -08:00
Ian Romanick
7be5744b5b 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 16:01:08 -08:00
nobled
c73bedd191 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 16:01:08 -08:00
Ian Romanick
bf66888a81 glsl: Regenerate compiler files from cherry picks 2011-02-28 16:01:08 -08:00
Ian Romanick
808ba96f3e 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 16:01:08 -08:00
Keith Packard
cf2076f89d 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 16:01:08 -08:00
Chad Versace
e1e829689d 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 15:27:41 -08:00
Chad Versace
3df97ee70c 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 15:27:40 -08:00
Ian Romanick
7d6d3d6133 glcpp: Regenerate files from recent cherry picks 2011-02-28 15:27:40 -08:00
Chad Versace
a068f7a2df 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:33 -08:00
Ian Romanick
d72c16a0d3 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:05 -08:00
Kenneth Graunke
2eb4816939 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:59 -08:00
Ian Romanick
8cf57be878 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:31 -08:00
Ian Romanick
bf50184f42 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:22 -08:00
Ian Romanick
4d2a725196 intel: Fix typeos from 3d028024 and 790ff232
...and remove egg from face.
(cherry picked from commit 2fb0aebd4a)
2011-02-28 14:27:36 -08:00
Ian Romanick
bcfa054b29 i915: Set correct values for range/precision of fragment shader types
(cherry picked from commit 790ff232e2)
2011-02-28 14:27:36 -08:00
Ian Romanick
499936406b i965: Set correct values for range/precision of fragment shader types
(cherry picked from commit 3d028024e5)
2011-02-28 14:27:36 -08:00
Ian Romanick
56c63dba48 mesa: Connect glGetShaderPrecisionFormat into the dispatch table
(cherry picked from commit dde3270c19)
2011-02-28 14:27:35 -08:00
Brian Paul
9c8d677a16 mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed.
No drivers do this yet.

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

(cherry picked from commit 3ee60a3558)
2011-02-28 14:27:35 -08:00
Chia-I Wu
f8d1b4fd26 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 14:27:35 -08:00
Eric Anholt
3eda10aebf 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 14:27:35 -08:00
Eric Anholt
215ec57e69 mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.
Fixes piglit arb_es2_compatibility-maxvectors.

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

(cherry picked from commit 8395f206a8)
2011-02-28 14:27:35 -08:00
Eric Anholt
33aee8177e 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 14:27:35 -08:00
Eric Anholt
c9d5d6ebc6 mesa: Add actual support for glReleaseShaderCompiler from ES2.
Fixes no-op dispatch warning in piglit
arb_es2_compatibility-releaseshadercompiler.c.

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

(cherry picked from commit 7b987578a9)
2011-02-28 14:27:34 -08:00
Eric Anholt
e63f8638cd mesa: Add extension enable bit for GL_ARB_ES2_compatibility.
(cherry picked from commit 9c6954fc9d)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-02-28 14:27:34 -08:00
Ian Romanick
ae775f3f37 glapi: Regenerate for GL_ARB_ES2_compatibility.
This is not a cherry pick, but it matches 841ad6bf (and ac06d610).
2011-02-28 14:27:34 -08:00
Eric Anholt
bd0457346f glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.
(cherry picked from commit 8560cb939b)
2011-02-28 13:56:06 -08:00
Ian Romanick
161e36c0f7 mesa: Remove unsupported OES extensions
Based commit 19418e921 from master.  Chad's extension rework series,
of which 19418e921 is part, wasn't cherry picked to 7.9 because there
were too many conflicts.  Most of the conflicts were caused by
extensions that were removed in 7.10.
2011-02-25 17:34:02 -08:00
Paulo Zanoni
4996e4a845 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:35 -05:00
Dave Airlie
b093c9939e radeon: avoid segfault on 3D textures.
This is a candidate for 7.9 and 7.10
2011-02-22 15:11:09 -05:00
Dave Airlie
87a02b952b 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:07:45 -05:00
Brian Paul
1bac4815a8 glsl2: fix signed/unsigned comparison warning
(cherry picked from commit 3633e1f538)
2011-02-22 08:17:27 -07:00
Brian Paul
ffd9033227 glsl: add ir_shader case in switch stmt to silence warning 2011-02-22 08:17:21 -07:00
Brian Paul
439c298595 mesa: include compiler.h for ASSERT macro
This was already done in the 7.10 branch and master.
2011-02-22 07:20:12 -07:00
Marek Olšák
cd42dda3a5 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:08:20 +01:00
Brian Paul
c2b76d966e docs: add links to 7.9.1 and 7.9.2 release notes 2011-02-21 18:05:18 -07:00
Brian Paul
a28050de4f docs: update 7.9.2 release notes with Brian's cherry-picks 2011-02-21 18:05:01 -07:00
Brian Paul
9c122ce963 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)

Conflicts:

	src/mesa/state_tracker/st_atom_sampler.c
2011-02-21 17:40:06 -07:00
Brian Paul
f0eff3061c 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:39:03 -07:00
Brian Paul
5a79a6dc04 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:32 -07:00
Brian Paul
652ceece0e 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:48 -07:00
Julien Cristau
e39aa1966b 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:44 -07:00
Julien Cristau
ba764ae5b1 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:32 -07:00
Dimitry Andric
3959f9f7c8 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:01 -07:00
Brian Paul
fa5c4b988a 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:18 -07:00
Brian Paul
0a218b00e7 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:53 -07:00
Dimitry Andric
8198e26969 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:36 -07:00
Julien Cristau
1b641f1b32 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:10 -07:00
Dimitry Andric
8a9e6a57d0 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:17 -07:00
Dimitry Andric
279c03b98f 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:23:58 -07:00
Brian Paul
edfe056747 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:13 -07:00
Brian Paul
8ad9670866 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:21:59 -07:00
Brian Paul
09cb5815ae 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:34 -07:00
Brian Paul
d1424f0185 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:20:54 -07:00
Brian Paul
7e43495053 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:47 -07:00
Ian Romanick
246716c8f6 docs: Update 7.9.2 release notes
Add recent cherry picks
2011-02-21 14:47:43 -08:00
Ian Romanick
8159bef77f 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 14:47:38 -08:00
Ian Romanick
d8392a2ca8 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:50:35 -08:00
Ian Romanick
ac270e43e6 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:50:03 -08:00
Eric Anholt
fc09445c87 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)
(cherry picked from commit 4e0d6cf7ba)
2011-02-21 13:48:46 -08:00
Ian Romanick
0f3a9643c6 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:05 -08:00
Eric Anholt
59422a1716 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-02-21 13:19:05 -08:00
Marek Olšák
231e72cdbd mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2
(cherry picked from commit d5a1325f81)
2011-02-16 20:53:39 +01:00
Bryce Harrington
da623c9c44 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:32:48 +01:00
Vinson Lee
175f3c9674 ralloc: Add missing va_end following va_copy.
(cherry picked from commit cde443e0b9)
2011-02-07 15:03:10 -08:00
Kenneth Graunke
4e4a9d4050 Remove the talloc sources from the Mesa repository.
(cherry picked from commit 1568b19e3b)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
f7993b66a6 Remove talloc from the SCons build system.
(cherry picked from commit 1f4fbc56e52ff2215f7eac7fc84ef8d8a8ec3c2f)

Conflicts:
	src/gallium/targets/libgl-gdi/SConscript
	src/mesa/SConscript
2011-02-07 15:02:30 -08:00
Kenneth Graunke
7f1a7a26e0 Remove talloc from the make and automake build systems.
(cherry picked from commit d610a57c8c69a0197ac7c3d0b22be1b8f0dc446f)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
cdcc5da9fe ralloc: a new MIT-licensed recursive memory allocator.
(cherry picked from commit 42fd9c2ebb)
2011-02-07 15:02:30 -08:00
Kenneth Graunke
5afd1d6ac2 Convert everything from the talloc API to the ralloc API.
(cherry-picked from 2ac83dba30dfe6f61b2c9639100acbb329ac4543)

Conflicts:
	src/glsl/ast_function.cpp
	src/glsl/glcpp/glcpp.c
	src/glsl/glsl_parser_extras.cpp
	src/glsl/ir.cpp
	src/glsl/ir.h
	src/glsl/ir_explog_to_explog2.cpp
	src/glsl/ir_mat_op_to_vec.cpp
	src/glsl/ir_sub_to_add_neg.cpp
	src/glsl/lower_texture_projection.cpp
	src/glsl/lower_variable_index_to_cond_assign.cpp
	src/glsl/lower_vector.cpp
	src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
	src/mesa/drivers/dri/i965/brw_fs.cpp
	src/mesa/drivers/dri/i965/brw_fs.h
	src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderobj.h
	src/mesa/program/ir_to_mesa.cpp
	src/mesa/program/register_allocate.c
	src/mesa/program/sampler.cpp
2011-02-07 15:02:30 -08:00
Kenneth Graunke
c9954dab04 ralloc: Add a fake implementation of ralloc based on talloc.
(cherry picked from commit dc55254f5b)

Conflicts:
	src/glsl/SConscript
2011-02-07 15:02:30 -08:00
Kenneth Graunke
e33d9b48c4 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:30 -08:00
Kenneth Graunke
f5bef74066 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:30 -08:00
Kenneth Graunke
5e8523895a 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:29 -08:00
Ian Romanick
ccc11aacbb docs: Update 7.9.2 release notes
Add recent cherry picks for precision qualifers, linker bugs, and other issues.
2011-02-04 16:53:25 -08:00
Eric Anholt
9acbde11f5 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.

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

(cherry picked from commit 9351ef7a44)
2011-02-04 16:53:25 -08:00
Eric Anholt
6c6894eac7 docs: Add a relnote for the Civ IV on i965. 2011-02-04 16:53:24 -08:00
Eric Anholt
41d4af17a1 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-02-04 16:53:24 -08:00
Chris Wilson
bf3932aad6 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)
2011-02-04 18:17:46 -06:00
Ian Romanick
2b1150170a 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:18:20 -08:00
Ian Romanick
a46bc59b27 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:18:15 -08:00
Ian Romanick
1f34edbbde 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:18:06 -08:00
Kenneth Graunke
427d574920 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:18:00 -08:00
Chad Versace
13711c8a5a 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)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-02-04 15:16:56 -08:00
Chad Versace
3ddf406530 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-02-04 14:37:06 -08:00
Chad Versace
a246791c20 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-02-04 14:36:23 -08:00
Ian Romanick
b481b8059d glsl: Refresh autogenerated lexer and parser files.
For the previous few commits.
2011-02-04 14:35:59 -08:00
Chad Versace
6fc2c15dbd 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-02-04 14:33:50 -08:00
Chad Versace
f5819379ed 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-02-04 14:33:37 -08:00
Chad Versace
dbc19fe94c 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-02-04 14:33:12 -08:00
Chad Versace
6292060193 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-02-04 14:31:36 -08:00
Chad Versace
378910ab97 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-02-04 14:31:30 -08:00
Ian Romanick
2925a5a1f5 i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!
This is similar to commit 0efea25c in 7.10.  The change was made
directly in the 7.9 branch because the affected code does not exist in
Mesa 7.10 or later.  It was removed with the change to the new
fragment shader back-end.

Fixes the GPU hang in piglit test glsl-fs-discard-03.
2011-02-04 10:05:56 -08:00
Ian Romanick
b632543289 docs: Update 7.9.2 release notes
Replace "Fix an error in uniform arrays in row calculating" with the
actual bugzilla that was fixed.
2011-01-26 10:16:19 -08:00
Ian Romanick
9e15c878bb mesa: bump version to 7.9.2-devel 2011-01-25 16:27:22 -08:00
Ian Romanick
ab6c7bbf4e docs: Initial set of release notes for 7.9.2 2011-01-25 16:22:26 -08:00
Jian Zhao
e4c1bcacef 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-19 10:58:06 -08:00
Ian Romanick
179edc673b 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-19 10:50:35 -08:00
Ian Romanick
48e81e3b9e 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-19 10:48:39 -08:00
Ian Romanick
1785904c5c 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-19 10:47:32 -08:00
Ian Romanick
28d47fed61 glsl & glcpp: Refresh autogenerated lexer and parser files.
For the previous few commits.
2011-01-19 10:46:15 -08:00
Ian Romanick
df033be3f7 glsl: Add version_string containing properly formatted GLSL version
(cherry picked from commit eebdfdfbcf)
2011-01-19 10:43:03 -08:00
Ian Romanick
ef2f4b5469 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-19 10:42:55 -08:00
Chad Versace
8d1e0de5f7 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-19 10:42:45 -08:00
Chad Versace
5f9c50053c 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-19 10:42:38 -08:00
Ian Romanick
7757980139 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-19 10:42:00 -08:00
Brian Paul
dab59f70e6 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:24 -07:00
Alberto Milone
4200c6bae4 r600c: add evergreen ARL support.
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
2011-01-11 14:49:30 -05:00
Marek Olšák
67aeab0b77 docs: fix messed up names with special characters in relnotes-7.9.1 2011-01-08 02:54:51 +01:00
Ian Romanick
f912245ed1 docs: Add 7.9.1 md5sums 2011-01-07 13:31:30 -08:00
Ian Romanick
42a9472dc6 docs: Add change log to 7.9.1 release notes 2011-01-07 13:28:22 -08:00
Ian Romanick
234144b48d mesa: set version string to 7.9.1 2011-01-07 12:16:29 -08:00
Ian Romanick
3d90628138 docs: Initial set of release notes for 7.9.1 2011-01-07 12:12:55 -08:00
Marek Olšák
d0f0a6920b 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)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
2011-01-07 07:25:12 +01:00
Chia-I Wu
110c49fddd egl: Check extensions.
Do not call into the driver if the extension for the called function is
not enabled.
(cherry picked from commit 6b2f1561ad)
2011-01-07 12:43:38 +08:00
Chia-I Wu
c438a09b4c egl_glx: Fix borken driver.
The driver was broken since 6eda3f311b.
All configs fail to pass _eglValidateConfig.  This fix might not be
complete, but at least EGL demos run.

This fixes bug #32825.
2011-01-05 18:54:44 +08:00
Brian Paul
0ab166d556 mesa: Bump the number of bits in the register index.
More than 1023 temporaries were being used for a Cinebench shader before
doing temporary optimization, causing the index value to wrap around to
-1024.
(cherry picked from commit a9fa0f3a2f)
2011-01-04 11:10:19 -07:00
Kenneth Graunke
b50658c804 i965: Internally enable GL_NV_blend_square on ES2.
Hopefully should fix bug #32520.
(cherry picked from commit 6bb1e4541e)
2011-01-04 09:50:14 -08:00
Kenneth Graunke
3c8dd6a8de Fix build on systems where "python" is python 3.
First, it changes autoconf to use a "python2" binary when available,
rather than plain "python" (which is ambiguous).  Secondly, it changes
the Makefiles to use $(PYTHON) $(PYTHON_FLAGS) rather than calling
python directly.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Matthew William Cox <matt@mattcox.ca>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3acc826520)
2011-01-04 09:50:14 -08:00
Marek Olšák
801e26a02a mesa: fix texel store functions for some float formats
These are copy-paste errors obviously.
(cherry picked from commit bf7b6f60ae)
2011-01-04 09:50:14 -08:00
Ian Romanick
247774085c Refresh autogenerated file builtin_function.cpp.
See also a954dbeb.
2011-01-04 09:50:14 -08:00
Kenneth Graunke
d5d573b592 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:50:14 -08:00
Brian Paul
54c2846f23 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:25 -07:00
Brian Paul
8941450010 tdfx: s/Format/_BaseFormat/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31560
(cherry picked from commit d18df9e336)
2011-01-04 07:53:44 -07:00
Brian Paul
0ff45dd5d7 mesa: no-op glBufferSubData() on size==0
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31439

NOTE: this is a candidate for the 7.9 branch
(cherry picked from commit 6e2e136428)
2011-01-03 17:05:24 -08:00
Kenneth Graunke
4e7cdca57a Remove OES_compressed_paletted_texture from the ES2 extension list.
We don't support it.
(cherry picked from commit d0f8eea9a0)
2011-01-03 17:05:24 -08:00
Brian Paul
69cc356832 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 17:05:24 -08:00
Ian Romanick
0d98ceb4bf 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 17:05:24 -08:00
Ian Romanick
40390b80e9 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 17:05:24 -08:00
Henri Verbeet
7ffeced927 st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().
(cherry picked from commit 59051ad443)
2010-12-31 07:51:53 +01:00
Henri Verbeet
b8c16ee7b1 r600: Evergreen has two extra frac_bits for the sampler LOD state.
Note: this is a candidate for the 7.9 branch.
(cherry picked from commit 228d0d1153)
2010-12-31 07:51:49 +01:00
Brian Paul
f5435ec3a9 st/mesa: fix mipmap generation bug
In st_finalize_texture() we were looking at the st_texture_object::
lastLevel field instead of the pipe_resource::last_level field to
determine which resource to store the mipmap in.

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

These changes fix the broken piglit fbo-generatemipmap-formats test.
(cherry picked from commit cae2bb76c1)
2010-12-30 17:40:07 +01:00
richard
a3740ba31e 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:54:44 -05:00
Alex Deucher
166da97889 r600c: fix some opcodes on evergreen
There were a few places where we were using the wrong opcodes
on evergreen.  arl still needs to be fixed on evergreen; see
r600g for reference.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-29 10:54:14 -05:00
Luca Barbieri
2fb170c90f glsl: Unroll loops with conditional breaks anywhere (not just the end)
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.

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

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

Fixes glsl-mat-attribute.
(cherry picked from commit b13a2e640f)
2010-12-27 13:11:54 -08:00
Fabian Bieler
9d1c6dd79b glsl: fix lowering conditional returns in subroutines
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass

Fixes piglit tests glsl-functions-5 and glsl-functions-6.
(cherry picked from commit ef534f3838)
2010-12-27 13:11:26 -08:00
Chia-I Wu
47552b2c66 mesa: Do not advertise GL_OES_texture_3D.
GL_OES_texture_3D has a GLSL counterpart.  Since it is not implemented,
GL_OES_texture_3D should not be advertised.
(cherry picked from commit d2028ba339)
2010-12-27 13:11:26 -08:00
Ian Romanick
edfe057f94 linker: Fix regressions caused by previous commit
That's what I get for not running piglit before pushing.

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

Don't try to patch types of unsized arrays that are shared between
shader stages.
(cherry picked from commit 002cd2c8d4)
2010-12-27 13:11:26 -08:00
Ian Romanick
a4cda571f0 linker: Ensure that unsized arrays have a size after linking
Fixes piglit test case glsl-vec-array (bugzilla #31908).

NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.
(cherry picked from commit 6f53921c4b)
2010-12-27 13:09:26 -08:00
Eric Anholt
ecb68d51aa 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 14:27:11 -08:00
Marek Olšák
be1f4cfd96 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)

Conflicts:

	src/gallium/drivers/r300/r300_state.c
2010-12-18 10:17:52 +01:00
Ian Romanick
7b6b66d617 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)

Conflicts:

	src/glsl/ast_to_hir.cpp
2010-12-17 13:51:46 -08:00
Ian Romanick
2b4277dcf3 glsl: Inherrit type of declared variable from initializer
Types of declared variables and their initializer must match excatly
except for unsized arrays.  Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms.  Now that type
is explicitly copied unconditionally.

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

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit b0fc5103cb)
2010-12-17 13:51:46 -08:00
Ian Romanick
585fa612c9 glcpp: Commit changes in generated files cause by previous commit 2010-12-17 13:51:45 -08:00
Kenneth Graunke
b8e73354d9 glcpp: Don't emit SPACE tokens in conditional_tokens production.
Fixes glslparsertest defined-01.vert.

Reported-by: José Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 800eed6765)
2010-12-17 13:14:25 -08:00
Eric Anholt
154d0a3e7e mesa: Add getters for ARB_copy_buffer's attachment points.
Fixes more complaints by oglconform.
(cherry picked from commit 43491adc44)
2010-12-17 12:58:15 -08:00
Eric Anholt
7c0ff4a5df mesa: Add getters for the rest of the supported draw buffers.
MAX_DRAW_BUFFERS is 8, so allow all 8 GL_DRAW_BUFFER# to be retrieved.
Fixes complaints by oglconform.
(cherry picked from commit 7cba339375)
2010-12-17 12:57:57 -08:00
Eric Anholt
d192179605 glsl: Fix flipped return of has_value() for array constants.
Fixes glsl-array-uniform.
(cherry picked from commit b381eff141)
2010-12-17 12:57:35 -08:00
Chad Versace
b2cd388b79 glsl: Fix linker bug in cross_validate_globals()
Cause linking to fail if a global has mismatching invariant qualifiers.

See https://bugs.freedesktop.org/show_bug.cgi?id=30261
(cherry picked from commit 7528f143df)
2010-12-17 12:56:40 -08:00
Aras Pranckevicius
bb2cd98e51 glsl: fix matrix type check in ir_algebraic
Fixes glsl-mat-mul-1.
(cherry picked from commit 4ce084c707)
2010-12-16 17:11:50 -08:00
Ian Romanick
d9d4f22e65 glsl: Ensure that equality comparisons don't return a NULL IR tree
This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 6d36be508f)
2010-12-16 17:11:50 -08:00
Eric Anholt
d347b90b94 glsl: Mark the array access for whole-array comparisons.
By not doing so, the uniform contents of
glsl-uniform-non-uniform-array-compare.shader_test was getting thrown
out since nobody was recorded as dereferencing the array.
(cherry picked from commit b4f585665c)
2010-12-16 17:11:50 -08:00
Eric Anholt
23a868930c glsl: Quiet unreachable no-return-from-function warning.
(cherry picked from commit d56c97413e)
2010-12-16 16:56:51 -08:00
Eric Anholt
1e88b3461a glsl: Fix structure and array comparisions.
We were trying to emit a single ir_expression to compare the whole
thing.  The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass).  Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.

Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
(cherry picked from commit ff79633d9f)
2010-12-16 16:56:51 -08:00
Eric Anholt
573c78803d glsl: Add a helper constructor for expressions that works out result type.
This doesn't cover all expressions or all operand types, but it will
complain if you overreach and it allows for much greater slack on the
programmer's part.
(cherry picked from commit 6b937465d4)

The new constructors required some changes because the
ir_quadop_vector changes were not cherry picked over from master.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-12-16 16:56:51 -08:00
Ian Romanick
5650cc462d glsl: Add unary ir_expression constructor
(cherry picked from commit 13f57d42b6)
2010-12-16 16:56:51 -08:00
Vinson Lee
54a596e34a glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning.
ir.cpp: In static member function
'static unsigned int ir_expression::get_num_operands(ir_expression_operation)':
ir.cpp:199: warning: control reaches end of non-void function
(cherry picked from commit 855c66bde7)
2010-12-16 16:56:51 -08:00
Kenneth Graunke
2127692542 glsl: Refactor get_num_operands.
This adds sentinel values to the ir_expression_operation enum type:
ir_last_unop, ir_last_binop, and ir_last_opcode.  They are set to the
previous one so they don't trigger "unhandled case in switch statement"
warnings, but should never be handled directly.

This allows us to remove the huge array of 1s and 2s in
ir_expression::get_num_operands().
(cherry picked from commit 007f488150)
2010-12-16 16:56:40 -08:00
Ian Romanick
0795cb71fc i915: Correctly generate unconditional KIL instructions
Fixes piglit test glsl-fs-discard-03.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit c92550be64)
2010-12-16 10:34:59 -08:00
Kenneth Graunke
cefccebd89 glsl: Remove "discard" support from lower_jumps.
The new lower_discard and opt_discard_simplification passes should
handle all the necessary transformations, so lower_jumps doesn't need to
support it.

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

NOTE: This is a candidate for the 7.9 branch.
2010-12-16 10:34:59 -08:00
Ian Romanick
927c752dd6 glsl: Add a lowering pass to move discards out of if-statements.
This should allow lower_if_to_cond_assign to work in the presence of
discards, fixing bug #31690 and likely #31983.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 940df10100)
2010-12-16 10:34:59 -08:00
Marek Olšák
0b4287a687 ir_to_mesa: Add support for conditional discards.
NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ead2ea89f4)
2010-12-16 10:34:59 -08:00
Ian Romanick
69d19cb84b glsl: Add an optimization pass to simplify discards.
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9a1d063c6d)
2010-12-16 10:34:59 -08:00
Ian Romanick
0ab2bb8270 glsl/linker: Free any IR discarded by optimization passes.
Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.

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

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 2da02e75b1)
2010-12-16 10:34:59 -08:00
Kenneth Graunke
1e2e387a15 glsl: Add a virtual as_discard() method.
NOTE: This is candidate for the 7.9 branch.
(cherry picked from commit 1eb7a81f2e)
2010-12-16 10:34:59 -08:00
Marek Olšák
dcc7a8a80a 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 16:55:59 +01:00
Marek Olšák
0a8ad737e7 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 16:55:16 +01:00
Dave Airlie
4b19941399 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 32218e4cc8)
2010-12-16 18:15:25 +10:00
Ian Romanick
1cfd517b15 i915: Disallow alpha, red, RG, and sRGB as render targets
Fixes bugzilla #31832

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 78a340fd48)
2010-12-15 15:11:01 -08:00
Eric Anholt
a0d5da96b5 i965: Add support for rendering to SARGB8 FBOs.
Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb.  The test
still fails on SLA8, though.
(cherry picked from commit 1946b81e70)
2010-12-15 14:39:58 -08:00
Kenneth Graunke
50ec3c74e3 glsl: Don't inline function prototypes.
Currently, the standalone compiler tries to do function inlining before
linking shaders (including linking against the built-in functions).
This resulted in the built-in function _prototypes_ being inlined rather
than the actual function definition.

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

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e8a24c65bc)
2010-12-15 14:38:37 -08:00
Kenneth Graunke
d595657e5a glsl: Use do_common_optimization in the standalone compiler.
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit a82592de92)
2010-12-15 14:38:37 -08:00
Ian Romanick
c055239bae mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.
Previously, the get table listed all three as having custom locations,
yet find_custom_value did not have cases to handle them.

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

Fixes bugs.freedesktop.org #31495.
(cherry picked from commit 1197393faa)

Conflicts:

	src/mesa/main/get.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-12-15 14:38:37 -08:00
Kristian Høgsberg
6b96b002c8 i965: Don't write mrf assignment for pointsize output
https://bugs.freedesktop.org/show_bug.cgi?id=31894
(cherry picked from commit a889f9ee5c)
2010-12-15 14:38:37 -08:00
Ian Romanick
ce8f4f266e glsl: better handling of linker failures
Upon link error, exit translation loop, free program instructions.
Check for null pointers in calling code.
(cherry picked from commit 6162773ea4)
2010-12-15 14:25:42 -08:00
Brian Paul
e0dbd44a00 glsl: fix off by one in register index assertion
(cherry picked from commit 50fd99d172)
2010-12-15 14:24:09 -08:00
Kenneth Graunke
67b7a3844a glsl: Fix constant expression handling for <, >, <=, >= on vectors.
ir_binop_less, ir_binop_greater, ir_binop_lequal, and ir_binop_gequal
are defined to work on vectors as well as scalars, as long as the two
operands have the same type.

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

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

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e16c9d5d03)
2010-12-15 14:19:16 -08:00
Chad Versace
69cc62b907 glsl: Fix erroneous cast in ast_jump_statement::hir()
Return values were erroneously cast from (ir_rvalue*) to (ir_expression*).

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit b4cdba687c)
2010-12-15 14:19:07 -08:00
Kenneth Graunke
8c8c1b2c99 glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
This is really supposed to be defined only if the driver supports highp
in the fragment shader - but all of our current ES2 implementations do.
So, just define it.  In the future, we'll need to add a flag to
gl_context and only define the macro if the flag is set.

"Fixes" freedesktop.org bug #31673.
(cherry picked from commit d719bf8fb4)
2010-12-15 14:18:01 -08:00
Kenneth Graunke
9b8e56a502 glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.
Per section 4.5.4 of the GLSL 1.30 specification.
(cherry picked from commit 3fb83038a0)
2010-12-15 14:17:51 -08:00
Robert Hooker
5a8d1d5b72 egl_dri2: Add missing intel chip ids.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
(cherry picked from commit 778917069c)
2010-12-15 14:17:29 -08:00
Robert Hooker
029252a448 intel: Add a new B43 pci id.
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
(cherry picked from commit e8b2d36723)
2010-12-15 14:17:11 -08:00
Peter Clifton
4b30da86a7 intel: Fix emit_linear_blit to use DWORD aligned width blits
The width of the 2D blits used to copy the data is defined as a 16-bit
signed integer, but the pitch must be DWORD aligned. Limit to an integral
number of DWORDs, (1 << 15 - 4) rather than (1 << 15 -1).

Fixes corruption to data uploaded with glBufferSubData.

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
(cherry picked from commit 10b9e018ca)
2010-12-15 12:39:53 -08:00
Eric Anholt
da5d6c42c0 i965: Allow OPCODE_SWZ to put immediates in the first arg.
Fixes assertion failure with texture swizzling in the GLSL path when
it's triggered (such as gen6 FF or ARB_fp shadow comparisons).

Fixes:
texdepth
texSwizzle
fp1-DST test
fp1-LIT test 3
(cherry picked from commit f00929cbdd)
2010-12-15 12:36:01 -08:00
Eric Anholt
0c56721cfc glsl: Free the loop state context when we free the loop state.
Since this was talloced off of NULL instead of the compile state, it
was a real leak over the course of the program.  Noticed with
valgrind --leak-check=full --show-reachable=yes.  We should really
change these passes to generally get the compile context as an argument
so simple mistakes like this stop mattering.
(cherry picked from commit 6929cdd14b)
2010-12-15 12:26:59 -08:00
Aras Pranckevicius
6333f1d224 glsl: fix crash in loop analysis when some controls can't be determined
Fixes loop-07.frag.
(cherry picked from commit d67df5dd9d)
2010-12-15 12:26:34 -08:00
Ian Romanick
639e65e054 mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample
Previously queries of MAX_SAMPLES were only allowed with
ARB_framebuffer_object, but EXT_framebuffer_multisample also enables
this query.  This seems to only effect the i915.  All other drivers
support both extensions or neither extension.

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

NOTE: this is a candidate for the 7.9 branch.

Reported-by: Kenneth Waters <kwaters@chromium.org>
(cherry picked from commit bcef51c3b8)
2010-12-15 12:26:19 -08:00
Ian Romanick
8454f931d6 glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 956ae44dcf)
2010-12-15 12:24:45 -08:00
Chad Versace
0da1c7b90f glsl: Fix ir_expression::constant_expression_value()
When the type of the ir_expression is error_type, return NULL.
This fixes bug 31371.
(cherry picked from commit b62c1c4595)
2010-12-15 12:24:25 -08:00
Kenneth Graunke
6e5907c390 ir_dead_functions: Actually free dead functions and signatures.
This makes linked shaders use around 36k less memory since the
built-in prototypes are now freed.
(cherry picked from commit a457ca7844)
2010-12-15 12:24:15 -08:00
Francisco Jerez
4c1db8c7a4 meta: Don't try to disable cube maps if the driver doesn't expose the extension.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8eaa97592a)
2010-12-15 12:20:20 -08:00
Francisco Jerez
edd9b9350e meta: Fix incorrect rendering of the bitmap alpha component.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7831994868)
2010-12-15 12:19:02 -08:00
Francisco Jerez
5c71690096 meta: Don't leak alpha function/reference value changes.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d846362389)
2010-12-15 12:18:44 -08:00
Ian Romanick
44df2b0844 mesa: Make metaops use program refcounts instead of names.
Fixes failure on restoring state when the program was active but
deleted, and the name no longer exists.

Bug #31194
(cherry picked from commit a974949f3b)

Conflicts:

	src/mesa/drivers/common/meta.c
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderapi.h

This required substantial edits because the 7.9 branch doesn't have
the EXT_separate_shader_objects changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-12-15 12:17:00 -08:00
Brian Paul
5b28db24ff 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:29:52 -07:00
Brian Paul
2f4af9e37b 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:39 -07:00
Brian Paul
34e0da8e73 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:06 -07:00
Brian Paul
1ee289960f mesa: test for cube map completeness in glGenerateMipmap()
The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit ecb7cc3319)
2010-12-14 16:28:14 -07:00
Brian Paul
22ba37aae2 mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM
In find_value() check if we've hit the 0th/invalid entry before checking
if the pname matches.

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

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit 503983b09e)
2010-12-14 16:27:35 -07:00
Brian Paul
3b200dd3c5 mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type
If querying the default/window-system FBO's attachment type, return
GL_FRAMEBUFFER_DEFAULT (per the GL_ARB_framebuffer_object spec).

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

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit 6d13ec7dc0)
2010-12-14 16:26:30 -07:00
Brian Paul
5f05ade503 mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query
Return 0 instead of generating an error.

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

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

NOTE: This is a candidate for the 7.9 branch.

(cherry picked from commit 20cf1851d8)
2010-12-14 16:26:14 -07:00
Ian Romanick
9ef05d27a6 glsl: Commit lexer files changed by previous cherry picking 2010-12-14 13:10:14 -08:00
Kenneth Graunke
1d63a77177 glsl: Fix constant component count in vector constructor emitting.
Fixes freedesktop.org bug #31101 as well as piglit test cases
assignment-type-mismatch.vert and constructor-28.vert.
(cherry picked from commit ba2382f50d)
2010-12-14 11:55:55 -08:00
Chad Versace
554dbaa8a0 glsl: Fix ast-to-hir for ARB_fragment_coord_conventions
Function ast_declarator_list::hir(), when processing keywords added by
extension ARB_fragment_coord_conventions, made the mistake of checking only if
the extension was __supported by the driver__. The correct behavior is to check
if the extensi0n is __enabled in the parse state__.

NOTE: this is a candidate for the 7.9 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6e00627384)
2010-12-14 11:55:55 -08:00
Kenneth Graunke
1c089271fd generate_builtins.py: Output large strings as arrays of characters.
This works around MSVC's 65535 byte limit, unfortunately at the expense
of any semblance of readability and much larger file size.  Hopefully I
can implement a better solution later, but for now this fixes the build.
(cherry picked from commit 2cacaf6e7b)
2010-12-14 11:55:54 -08:00
Kenneth Graunke
2c57c020a3 glcpp: Return NEWLINE token for newlines inside multi-line comments.
This is necessary for the main compiler to get correct line numbers.
(cherry picked from commit bd55ba568b)
2010-12-14 11:55:54 -08:00
Ian Romanick
2f398485f2 linker: Improve handling of unread/unwritten shader inputs/outputs
Previously some shader input or outputs that hadn't received location
assignments could slip through.  This could happen when a shader
contained user-defined varyings and was used with either
fixed-function or assembly shaders.

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

NOTE: this is a candidate for the 7.9 branch.

(cherry picked from commit cc90e62d70)
2010-12-14 11:55:54 -08:00
Ian Romanick
e5ad6c3366 glsl: Slightly change the semantic of _LinkedShaders
Previously _LinkedShaders was a compact array of the linked shaders
for each shader stage.  Now it is arranged such that each slot,
indexed by the MESA_SHADER_* defines, refers to a specific shader
stage.  As a result, some slots will be NULL.  This makes things a
little more complex in the linker, but it simplifies things in other
places.

As a side effect _NumLinkedShaders is removed.

NOTE: This may be a candidate for the 7.9 branch.  If there are other
patches that get backported to 7.9 that use _LinkedShader, this patch
should be cherry picked also.

(cherry picked from commit 3322fbaf3b)
2010-12-14 11:55:54 -08:00
Chad Versace
1c15fb4414 glsl: Fix lexer rule for ^=
The caret is a special character, and needs to be quoted or escaped.
(cherry picked from commit cba9062d58)
2010-12-14 11:55:54 -08:00
Ian Romanick
a138a59966 mesa: Refactor validation of shader targets
Actually validate that the implementation supports the particular
shader target as well.  Previously if a driver only supported vertex
shaders, for example, glCreateShaderObjectARB would gladly create a
fragment shader.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 5cb24c4a75)
2010-12-14 11:55:54 -08:00
Ian Romanick
6fc544dd50 linker: Reject shaders that have unresolved function calls
This really amounts to just using the return value from
link_function_calls.  All the work was being done, but the result was
being ignored.

Fixes piglit test link-unresolved-funciton.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 4a45595cf3)
2010-12-14 11:55:54 -08:00
Eric Anholt
42e9750975 intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.
The format selection of the CopyTexSubImage is pretty bogus still, but
this at least avoids software fallbacks in nexuiz, bringing
performance from 7.5fps to 12.8fps on my machine.
(cherry picked from commit 3316a54205)
2010-12-14 11:55:54 -08:00
Ian Romanick
72a3bddb24 mesa: Validate assembly shaders when GLSL shaders are used
If an GLSL shader is used that does not provide all stages and
assembly shaders are provided for the missing stages, validate the
assembly shaders.

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

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit b2b9b22c10)
2010-12-14 11:55:54 -08:00
Tom Stellard
e8bc8d6a5c r300/compiler: Don't allow presubtract sources to be remapped twice
https://bugs.freedesktop.org/show_bug.cgi?id=31193

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 4265c2f819)
2010-12-10 11:07:24 -08:00
Alex Deucher
dc4956922d gallium/egl: fix r300 vs r600 loading
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=31841
2010-12-07 10:59:20 +10:00
Marek Olšák
b486197013 st/mesa: initialize key in st_vp_varient
This fixes endless vertex shader recompilations in find_translated_vp
if the shader contains an edge flag output.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by Brian Paul <brianp@vmware.com>
(cherry picked from commit c0c929cdac)
2010-12-06 22:44:04 +01:00
Marek Olšák
2cb8522523 mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium
gl_FragCoord.y needs to be flipped upside down if a FBO is bound.

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

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

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

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d531f9c2f5)
2010-12-06 22:43:15 +01:00
Brian Paul
564a6a15fe llvmpipe: fix broken stencil writemask
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32070
(cherry picked from commit dbf996f308)

Conflicts:

	src/gallium/drivers/llvmpipe/lp_bld_depth.c
2010-12-03 09:47:23 -07:00
Marek Olšák
7d280a3bbe r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only
r3xx cannot swizzle compressed textures. r4xx+ is unaffected.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit fcf6b353bf)
2010-12-01 23:56:56 +01:00
Marek Olšák
988a35c7f7 r300g: fix texture swizzling with compressed textures on r400-r500
This fixes all S3TC piglit/texwrap tests.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 6478a4de14)
2010-12-01 23:56:56 +01:00
Marek Olšák
4e7548aafc r300g: fix texture border color once again
I made the texwrap test be more thorough and realized that this driver code
had not been quite right. This commit fixes the border color for depth
textures, compressed textures, and 16-bits-per-channel textures
with up to 2 channels (R16, RG16).

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 1f1375d4d8)
2010-12-01 23:56:55 +01:00
Marek Olšák
277655d7fa r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction
It looks like the function was originally written for ARB_fragment_program.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit ae3e58d973)
2010-12-01 23:56:55 +01:00
Marek Olšák
d42db5b738 r300g: fix rendering with no vertex elements
Fixes glsl-vs-point-size, although I meant to fix glsl-novertexdata.
Since swrast fails glsl-novertexdata too, I guess it's a core issue.
(cherry picked from commit ffb732d8bd)
2010-12-01 23:56:51 +01:00
Marek Olšák
62f2b7e759 r300g: fix texture border color for all texture formats
This fixes 8 texwrap format tests.
The code should handle arbitrary formats now and is cleaner.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 7e2256688a)
2010-12-01 23:38:52 +01:00
Marek Olšák
44ba61c518 r300g: add a default channel ordering of texture border for unhandled formats
It should fix the texture border for compressed textures.
Broken since 8449a4772a.
(cherry picked from commit 676c3f08bd)

Conflicts:

	src/gallium/drivers/r300/r300_state_derived.c
2010-12-01 23:38:36 +01:00
Marek Olšák
1c746ba9d4 r300g: fix texture border for 16-bits-per-channel formats
This is kinda hacky, but it's hard to come up with a generic solution for
all formats when only a few are used in practice (I mostly get B8G8R8*8).
(cherry picked from commit 8449a4772a)
2010-12-01 23:34:59 +01:00
Marek Olšák
c9661d695b r300g: fix microtiling for 16-bits-per-channel formats
(cherry picked from commit d0408cf55d)
2010-12-01 23:33:33 +01:00
Brian Paul
aa7bf2d88e mesa: check for posix_memalign() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b1097607db)
2010-11-29 09:21:26 -07:00
Brian Paul
9d644e7b95 st/mesa: fix mapping of zero-sized buffer objects
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31934

(cherry picked from commit 97ae4dad1c)
2010-11-26 13:53:33 -07:00
Brian Paul
54047fcd8d meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear
This fixes incorrect behaviour when the stencil clear value exceeds
the size of the stencil buffer, for example, when set with:

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

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

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

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>

(cherry picked from commit ee88727df8)
2010-11-24 12:16:44 -07:00
Thomas Hellstrom
bcdd93e3a7 gallium/targets: Trivial crosscompiling fix
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:52 +01:00
Thomas Hellstrom
75065b0b55 svga/drm: Optionally resolve calls to powf during link-time
When linked with certain builds of libstdc++, it appears like powf is resolved
by a symbol in that library. Other builds of libstdc++ doesn't contain that
symbol resulting in a linker / loader error. Optionally
resolve that symbol and replace it with calls to logf and expf.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:45 +01:00
Thomas Hellstrom
8ae23176d6 st/egl: Fix build for include files in nonstandard places
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:34 +01:00
Thomas Hellstrom
7d0c0d32b5 mesa: Add talloc includes for gles
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:26 +01:00
Thomas Hellstrom
e5c78c2003 egl: Add an include for size_t
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-11-23 11:43:17 +01:00
Tom Stellard
930c168df6 r300/compiler: Use correct swizzles for all presubtract sources 2010-11-22 12:00:10 -08:00
Tom Stellard
5551faf649 r300/compiler: Ignore alpha dest register when replicating the result
When the result of the alpha instruction is being replicated to the RGB
destination register, we do not need to use alpha's destination register.
This fixes an invalid "Too many hardware temporaries used" error in
the case where a transcendent operation writes to a temporary register
greater than max_temp_regs.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 23f577dbd4)
2010-11-22 11:21:53 -08:00
Tom Stellard
80ff25b628 r300/compiler: Use zero as the register index for unused sources
This fixes an invalid "Too many hardware temporaries used" error in the
case where a source reads from a temporary register with an index greater
than max_temp_regs and then the source is marked as unused before the
register allocation pass.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit d668659003)
2010-11-22 11:21:53 -08:00
Tom Stellard
7c8715ef0a r300/compiler: Fix instruction scheduling within IF blocks
Reads of registers that where not written to within the same block were
not being tracked.  So in a situations like this:
0: IF
1: ADD t0, t1, t2
2: MOV t2, t1

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

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 3e5f9789d6)
2010-11-22 11:21:48 -08:00
Tom Stellard
06fa5d81da r300/compiler: Fix register allocator's handling of loops
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e2301b45c2)
2010-11-22 11:15:33 -08:00
Tom Stellard
b86bf31b05 r300/compiler: Make sure presubtract sources use supported swizzles
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 412803b5cd)
2010-11-22 11:04:07 -08:00
Brian Paul
68afe8f685 swrast: init alpha value to 1.0 in opt_sample_rgb_2d()
(cherry picked from commit 6a0255122a)
2010-11-22 09:05:31 -07:00
Chia-I Wu
0d060d9933 st/vega: Do not wait NULL fences.
(cherry picked from commit cc5c908d7d)
2010-11-20 15:59:58 +08:00
Chia-I Wu
aa5574e78f egl_dri2: Fix __DRI_DRI2 version 1 support.
Correctly set __DRI_API_OPENGL flag.
(cherry picked from commit aa139a14ba)
2010-11-20 15:59:58 +08:00
Chia-I Wu
5105e3d415 st/mesa: Unreference the sampler view in st_bind_surface.
Without this, update_textures may not pick up the new pipe_resource.

It is actually update_textures that should check
stObj->sampler_view->texture != stObj->pt, but let's follow st_TexImage
and others for now.
(cherry picked from commit cfc81d93f7)
2010-11-20 15:59:58 +08:00
Chia-I Wu
feacfc4a93 egl: Fix a false negative check in _eglCheckMakeCurrent.
This call sequence

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

should be valid if ctx1 and ctx2 have the same client API and are not
current in another thread.
(cherry picked from commit 0d43cbed2f)
2010-11-20 15:59:57 +08:00
Julien Cristau
b6ae3d7b23 Makefile: don't include the same files twice in the tarball
src/mesa/drivers/dri/*/*/*.[chS] is a superset of
src/mesa/drivers/dri/*/server/*.[ch] and
src/mesa/drivers/dri/common/xmlpool/*.[ch].
include/GL/internal/glcore.h is already in MAIN_FILES, no need for it in
DRI_FILES too.  src/glx/Makefile was listed twice.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-15 08:53:12 -07:00
Brian Paul
3db8f85446 mesa: fix glDeleteBuffers() regression
This fixes a regression (failed assertion) from commit
c552f273f5 which was hit if glDeleteBuffers()
was called on a buffer that was never bound.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 78587ea012)
2010-11-15 08:53:12 -07:00
Brian Paul
3e4ed38791 mesa: make glIsBuffer() return false for never bound buffers
Use a dummy buffer object as we do for frame/renderbuffer objects.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31514

Note: this is a candidate for the 7.9 branch.
(cherry picked from commit c552f273f5)
2010-11-15 08:53:12 -07:00
Brian Paul
acee46d9a1 mesa: handle more pixel types in mipmap generation code
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit b3b6476695)
2010-11-15 08:53:11 -07:00
Brian Paul
97805cfedd mesa: add missing formats in _mesa_format_to_type_and_comps()
NOTE: this is a candidate for the 7.9 branch
(cherry picked from commit 79c65410c1)

Conflicts:

	src/mesa/main/formats.c
2010-11-15 08:53:04 -07:00
Daniel Lichtenberger
9b1ac4d127 radeon: fix potential segfault in renderbuffer update
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31617

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-15 01:36:02 -05:00
Roland Scheidegger
78ccca5a69 r200: fix r200 large points
DD_POINT_SIZE got never set for some time now (as it was set only in ifdefed
out code), which caused the r200 driver to use the point primitive mistakenly
in some cases which can only do size 1 instead of point sprite. Since the
logic to use point instead of point sprite prim is flaky at best anyway (can't
work correctly for per-vertex point size), just drop this and always emit point
sprites (except for AA points) - reasons why the driver tried to use points for
size 1.0 are unknown though it is possible they are faster or more conformant.
Note that we can't emit point sprites without point sprite cntl as that might
result in undefined point sizes, hence need drm version check (which was
unnecessary before as it should always have selected points). An
alternative would be to rely on the RE point size clamp controls which could
clamp the size to 1.0 min/max even if the SE point size is undefined, but currently
always use 0 for min clamp. (As a side note, this also means the driver does
not honor the gl spec which mandates points, but not point sprites, with zero size
to be rendered as size 1.)
This should fix recent reports of https://bugs.freedesktop.org/show_bug.cgi?id=702.
This is a candidate for the mesa 7.9 branch.
2010-11-11 01:14:10 +01:00
Mario Kleiner
2fe82c281d mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.
A call to radeon_prepare_render() at the beginning of draw
operations was placed too deep in the call chain,
inside r300RunRenderPrimitive(), instead of
r300DrawPrims() where it belongs. This leads to
emission of stale target color renderbuffer into the cs if
bufferswaps via page-flipping are used, and thereby causes
massive rendering corruption due to unsynchronized
rendering into the active frontbuffer.

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

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-11-08 13:54:10 -05:00
Alex Deucher
773e8fadc8 r600c: properly align mipmaps to group size
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31400
2010-11-08 12:11:14 -05:00
Alex Deucher
7f2d1280e7 r600c: add missing radeon_prepare_render() call on evergreen 2010-10-27 14:32:02 -04:00
Alex Deucher
075640e37e r100: revalidate after radeon_update_renderbuffers
This is a port of 603741a86d
to r100.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-10-27 13:58:54 -04:00
Thomas Hellstrom
fb7a095785 mesa: Make sure we have the talloc cflags when using the talloc headers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 14:21:13 +02:00
Thomas Hellstrom
f245bb4c9c st/xorg: Fix compilation for Xservers >= 1.10
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:44 +02:00
Thomas Hellstrom
cc71f76be2 xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:31 +02:00
Thomas Hellstrom
47887b1efe st/xorg: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:21 +02:00
Thomas Hellstrom
764f9974e5 st/xorg: Fix compilation errors for Xservers compiled without Composite
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:13 +02:00
Thomas Hellstrom
aa2b751abb st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-19 12:11:02 +02:00
Brian Paul
6f5c6e5cc5 mesa: Add missing else in do_row_3D
This fixes erroneous "bad format in do_row()" messages

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 746b602fbd)
2010-10-18 08:11:45 -06:00
Brian Paul
e5b2a8d350 egl/i965: include inline_wrapper_sw_helper.h
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e19187e1be)
2010-10-18 08:02:42 -06:00
Chia-I Wu
da580c734f st/egl: Do not finish a fence that is NULL.
i915g would dereference the NULL pointer.
(cherry picked from commit d6de1f44a0)
2010-10-15 11:20:39 +08:00
Chia-I Wu
db7de707a3 st/vega: Fix version check in context creation.
This fixes a regression since 4531356817.
(cherry picked from commit b2c0ef8b51)
2010-10-15 11:20:39 +08:00
Chia-I Wu
bce3917192 targets/egl: Fix linking with libdrm.
(cherry picked from commit da495ee870)
2010-10-15 11:20:39 +08:00
Thomas Hellstrom
2eac388bfe st/xorg: Fix typo
Pointed out by Jakob Bornecrantz.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 18:26:56 +02:00
Thomas Hellstrom
6730630804 st/xorg: Don't try to remove invalid fbs
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 14:20:27 +02:00
Thomas Hellstrom
d5618c55ec xorg/vmwgfx: Don't hide HW cursors when updating them
Gets rid of annoying cursor flicker

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 14:12:36 +02:00
Thomas Hellstrom
ee6417f97f st/xorg: Add a customizer option to get rid of annoying cursor update flicker
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 14:09:09 +02:00
Thomas Hellstrom
14bae5cdf2 xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 11:08:39 +02:00
Thomas Hellstrom
799e6d4d15 st/xorg: Don't try to use option values before processing options
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-10-12 10:28:57 +02:00
Daniel Vetter
6936fbc039 r200: revalidate after radeon_update_renderbuffers
By calling radeon_draw_buffers (which sets the necessary flags
in radeon->NewGLState) and revalidating if NewGLState is non-zero
in r200TclPrimitive. This fixes an assert in libdrm (the color-/
depthbuffer was changed but not yet validated) and and stops the
kernel cs checker from complaining about them (when they're too
small).

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

v2: Also fix the swtcl r200 path.

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-10-11 15:17:44 -04:00
Brian Paul
0a060c8fb0 st/mesa: replace assertion w/ conditional in framebuffer invalidation
https://bugs.freedesktop.org/show_bug.cgi?id=30632

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 3d6eec0a87)
2010-10-06 08:41:44 -06:00
Brian Paul
34c518be52 swrast: fix choose_depth_texture_level() to respect mipmap filtering state
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit fb5e6f88fc)
2010-10-05 14:34:58 -06:00
Ian Romanick
2b4a05e74a docs: added news item for 7.9 release
Also fix link to release notes in 7.9-rc1 news item.
2010-10-05 10:08:28 -07:00
Ian Romanick
7afce798ee docs: Update mailing lines from sf.net to freedesktop.org
(cherry picked from commit c19bc5de96)
2010-10-05 10:08:21 -07:00
Ian Romanick
ab502d0d6b docs: download.html does not need to be updated for each release
(cherry picked from commit 41e371e351)
2010-10-05 10:08:14 -07:00
Ian Romanick
548a50caae docs: Import 7.8.x release notes from 7.8 branch. 2010-10-05 10:08:06 -07:00
Ian Romanick
11e290daa4 Add 7.9 md5sums 2010-10-04 18:59:34 -07:00
Ian Romanick
889cb2539b docs: Add 7.9 release date 2010-10-04 18:56:21 -07:00
Ian Romanick
242facde45 mesa: set version string to 7.9 (final) 2010-10-04 18:55:57 -07:00
Alex Deucher
73be0dfe03 Add evergreen support to release notes 2010-10-04 21:46:57 -04:00
Ian Romanick
0b300a4e3d docs: Update 7.9 release notes with one more bug fix 2010-10-04 17:43:52 -07:00
Eric Anholt
586797d7a8 i965: Fix glean/texSwizzle regression in previous commit.
Easy enough patch, who needs a full test run.  Oh, that's right.  Me.
(cherry picked from commit 14bf92ba19)
2010-10-04 17:41:56 -07:00
Eric Anholt
9b646b1fd3 i965: Set up swizzling of shadow compare results for GL_DEPTH_TEXTURE_MODE.
The brw_wm_surface_state.c handling of GL_DEPTH_TEXTURE_MODE doesn't
apply to shadow compares, which always return an intensity value.  The
texture swizzles can do the job for us.

Fixes:
glsl1-shadow2D(): 1
glsl1-shadow2D(): 3
(cherry picked from commit a7fa00dfc5)
2010-10-04 17:41:45 -07:00
Kenneth Graunke
dc8e22e4f0 i965: Fix incorrect batchbuffer size in gen6 clip state command.
FORCE_ZERO_RTAINDEX should be in the fourth (and final) dword.
(cherry picked from commit f317713432)
2010-10-04 17:41:33 -07:00
Ian Romanick
21078eef10 docs: Add list of bugs fixed in 7.9
(cherry picked from commit 7f440b3f9d76fa3a02877074d9701ab499d5de34)
2010-10-04 17:38:54 -07:00
Marek Olšák
968a9ec76e update release notes for Gallium
I am trying to be exhaustive, but still I might have missed tons of other
changes to Gallium.
2010-10-05 02:24:50 +02:00
Vinson Lee
2cdfda8851 tgsi: Remove duplicate case value.
Cherry-picked from master commit 2491258436
2010-10-04 17:31:33 +02:00
Jakob Bornecrantz
09d89dc95b tgsi: Actually care what check_soa_dependencies says
Thanks to José for the more complete list of supported opcodes.

Cherry-picked from master commit d21301675c
Also includes fix commit 4bb42a4f7e
2010-10-04 17:30:34 +02:00
José Fonseca
15ad34f012 tgsi: Don't ignore indirect registers in tgsi_check_soa_dependencies
Cherry-picked from master commit c66f0c4629
2010-10-04 17:30:00 +02:00
Alex Deucher
094fe2aa23 r600c: fix segfault in evergreen stencil code
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=30551
2010-10-01 20:15:17 -04:00
Tom Fogal
ba889a2b3e Implement x86_64 atomics for compilers w/o intrinsics.
Really old gcc's (3.3, at least) don't have support for the
intrinsics we need.  This implements a fallback for that case.
2010-10-01 17:56:02 -06:00
richard
71cc467f4c evergreen : fix z format setting, enable stencil. 2010-10-01 16:18:16 -04:00
Alex Deucher
d6e2b707ba r600c: pull over 6xx/7xx vertex fixes for evergreen 2010-10-01 00:52:36 -04:00
Alex Deucher
0ab9d8d94b r600c: add reloc for CB_COLOR0_ATTRIB
We'll need a reloc for tiling eventually,
so add it now.
2010-09-30 20:57:38 -04:00
Adam Jackson
759e9fb737 i965: Update renderer strings for sandybridge
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 0c86e1f294)
2010-09-30 13:32:42 -07:00
Zhenyu Wang
4af00f1a5e i965: always set tiling for fbo depth buffer on sandybridge
Sandybridge requires depth buffer must be tiling.

Fix 'fbo_firecube' demo.
(cherry picked from commit 72b368ae69)
2010-09-30 13:23:38 -07:00
Zhenyu Wang
1c8795075f i965: fallback lineloop on sandybridge for now
Until we fixed GS hang issue.
(cherry picked from commit 73dab75b41)
2010-09-30 13:23:37 -07:00
Kenneth Graunke
5d43c78d03 glsl: "Copyright", not "Constantright"
Clearly this started out as ir_copy_propagation.cpp, but the search and
replace was a bit overzealous.
(cherry picked from commit 565ff67688)
2010-09-30 13:23:37 -07:00
Marek Olšák
9f076a0848 r300g: fix conditional rendering in non-wait path
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 83278d384e)
2010-09-30 22:17:15 +02:00
Chia-I Wu
9bab8ca4f8 st/egl: Drop context argument from egl_g3d_get_egl_image.
Fix a regression since 17eace581d.
(cherry picked from commit e2b51b7c5b)
2010-09-30 23:48:34 +08:00
Chia-I Wu
f6eb5d991c mapi: Fix compiler warnings.
Do not use "void *" in arithmetics.
(cherry picked from commit ebeb4a7e8a)
2010-09-30 17:12:30 +08:00
Tom Stellard
f282d72678 r300/compiler: Don't merge instructions that write output regs and ALU result
https://bugs.freedesktop.org/show_bug.cgi?id=30415

(cherry picked from commit b27a809266)
2010-09-29 11:05:01 -07:00
Tom Stellard
e1918fd5d5 r300/compiler: Don't use rc_error() unless the error is unrecoverable
https://bugs.freedesktop.org/show_bug.cgi?id=30416

(cherry picked from commit 1b76dde0cd)
2010-09-29 11:04:12 -07:00
Tom Stellard
fcf5819945 r300/compiler: Fix segfault in error path
https://bugs.freedesktop.org/show_bug.cgi?id=30415

(cherry picked from commit d40ff5510c)
2010-09-29 11:03:02 -07:00
Brian Paul
c584318a21 Makefile: ensure Gallium's Makefile.xorg and SConscript.dri are in the tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 698893889a)
2010-09-29 09:53:02 -06:00
Kristian Høgsberg
b24238c49a glx: Only remove drawables from the hash when we actually delete them
https://bugs.freedesktop.org/show_bug.cgi?id=30457
2010-09-29 09:10:05 -04:00
Ian Romanick
5d3a4317e8 mesa: set version string to 7.9-rc2 2010-09-28 19:22:55 -07:00
Eric Anholt
836b44b2c8 glsl: Also update implicit sizes of varyings at link time.
Otherwise, we'll often end up with gl_TexCoord being 0 length, for
example.  With ir_to_mesa, things ended up working out anyway, as long
as multiple implicitly-sized arrays weren't involved.
(cherry picked from commit 586b4b500f)
2010-09-28 18:41:05 -07:00
Eric Anholt
83854a9c84 i965: Fix up part of my Sandybridge attributes support patch.
I confused the array sizing for number of files for the number of regs
in a file.
(cherry picked from commit ef8e002c75)
2010-09-28 18:40:32 -07:00
Eric Anholt
b4824096b0 i965: Fix all non-snb regression in the snb attribute interpolation commit.
This apparently had never been tested elsewhere before being merged to
master.
(cherry picked from commit f1dba03056)
2010-09-28 18:40:24 -07:00
Zhenyu Wang
71bdc82c19 i965: fallback bitmap operation on sandybridge
Need to bring back correct fb write with header to set pixel
write mask. Fallback for now.

Note: Conflicts in intel_pixel_bitmap.c due to the removal of
intel_texture_bitmap from master.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-28 18:37:20 -07:00
Zhenyu Wang
aaf7f78dfa i965: fix occlusion query on sandybridge
Fix pipe control command for depth stall and PS_DEPTH_COUNT write.
(cherry picked from commit 3074b61f64)
2010-09-28 18:36:05 -07:00
Zhenyu Wang
5c7a7d0b09 i965: fix point sprite on sandybridge
Need to set point sprite function in fixed SF state now on sandybridge.
(cherry picked from commit ec99833e92)
2010-09-28 18:36:01 -07:00
Zhenyu Wang
f736d85a5a i965: fix scissor state on sandybridge
Fix incorrect scissor rect struct and missed scissor state pointer
setting for sandybridge.
(cherry picked from commit 4b6b0bf24a)
2010-09-28 18:35:57 -07:00
Zhenyu Wang
40dc275431 i965: enable polygon offset on sandybridge
Depth offset function is moved to SF stage on sandybridge.
(cherry picked from commit 3f3059fcc0)
2010-09-28 18:35:41 -07:00
Zhenyu Wang
3dd52d51ce i965: fix pixel w interpolation on sandybridge
(cherry picked from commit 15a8e7ec90)
2010-09-28 18:35:35 -07:00
Zhenyu Wang
e00bb8732c i965: don't do calculation for delta_xy on sandybridge
Sandybridge doesn't have Xstart/Ystart in payload header.
(cherry picked from commit 85fa900b93)
2010-09-28 18:35:30 -07:00
Zhenyu Wang
11215cd535 i965: only allow SIMD8 kernel on sandybridge now
Until we fixed SIMD16 kernel, force to SIMD8 on sandybridge now.
(cherry picked from commit c58bf2cee5)
2010-09-28 18:35:26 -07:00
Zhenyu Wang
6831cf67d1 i965: sandybridge pipe control workaround before write cache flush
Must issue a pipe control with any non-zero post sync op before
write cache flush = 1 pipe control.
(cherry picked from commit 18c3b754f9)
2010-09-28 18:35:21 -07:00
Zhenyu Wang
ece465219f i965: Add all device ids for sandybridge
(cherry picked from commit c8033f1b1e)
2010-09-28 18:35:16 -07:00
Zhenyu Wang
0dc83cc437 i965: fix const register count for sandybridge
Sandybridge's PS constant buffer payload size is decided from
push const buffer command, incorrect size would cause wrong data
in payload for position and vertex attributes. This fixes coefficients
for tex2d/tex3d.
(cherry picked from commit 81aae67e58)
2010-09-28 18:35:11 -07:00
Zhenyu Wang
922d7e1025 i965: Fix sampler on sandybridge
Sandybridge has not much change on texture sampler with Ironlake.
(cherry picked from commit 956f866030)
2010-09-28 18:35:04 -07:00
Zhenyu Wang
4afb1c8451 i965: fix jump count on sandybridge
Jump count is for 64bit long each, so one instruction requires 2
like on Ironlake.
(cherry picked from commit c5a3b25bb9)
2010-09-28 18:34:58 -07:00
Zhenyu Wang
ad52c2b773 i965: VS use SPF mode on sandybridge for now
Until conditional instructions were fixed, use SPF mode instead for now.
(cherry picked from commit 9c39a9fcb2)
2010-09-28 18:34:53 -07:00
Zhenyu Wang
364b6e0709 i965: add sandybridge viewport state bo into validation list
(cherry picked from commit 7401a98e29)
2010-09-28 18:34:47 -07:00
Zhenyu Wang
32c1dc76af i965: ignore quads for GS kernel on sandybridge
Sandybridge's VF would convert quads to polygon which not required
for GS then. Current GS state still would cause hang on lineloop.
(cherry picked from commit a0b1d7b2b8)
2010-09-28 18:34:43 -07:00
Zhenyu Wang
f9ad343cf7 i965: ff sync message change for sandybridge
(cherry picked from commit 67dafa4b56)
2010-09-28 18:34:39 -07:00
Zhenyu Wang
76469d710c i965: fix point size setting in header on sandybridge
(cherry picked from commit fa589770e8)
2010-09-28 18:34:33 -07:00
Zhenyu Wang
6eec2dbfc8 i965: force zero in clipper to ignore RTAIndex on sandybridge
(cherry picked from commit 03218a0093)
2010-09-28 18:34:27 -07:00
Zhenyu Wang
a4f126beaf i965: Fix color interpolation on sandybridge
Don't double store position in vertex attribute. This makes color
interpolation right by using barycentric coordinates.
(cherry picked from commit 41c31c2ebd)
2010-09-28 18:34:22 -07:00
Zhenyu Wang
0d5400519e i965: enable accumulator update in PS kernel too on sandybridge
Accumulator update flag must be set for implicit update on sandybridge.
(cherry picked from commit 8c31a4c3cf)
2010-09-28 18:34:16 -07:00
Zhenyu Wang
36722d7673 i965: new state dump for sandybridge
Dump new state object on sandybridge for cc viewport, clip viewport,
depth stencil, cc and blend state.
(cherry picked from commit b016a78b98)
2010-09-28 18:34:11 -07:00
Zhenyu Wang
3c26f3883a i965: disasm quarter and write enable instruction control on sandybridge
(cherry picked from commit bf60f35934)
2010-09-28 18:34:01 -07:00
Eric Anholt
1975d851e8 i965: Add support for POW in gen6 FS.
Fixes glsl-algebraic-pow-2 in brw_wm_glsl.c mode.
(cherry picked from commit fe2d4a5ea0)
2010-09-28 18:33:49 -07:00
Eric Anholt
f4f1e0d108 i965: Set up inputs to the fragment shader according to FP InputsRead.
Sending down data that doesn't get read doesn't make any sense, and
would make handling things like gl_FrontFacing and gl_PointCoord
harder.
(cherry picked from commit 2f914053bc)
2010-09-28 18:33:34 -07:00
Eric Anholt
cda661fd1c i965: Add support for attribute interpolation on Sandybridge.
Things are simpler these days thanks to barycentric interpolation
parameters being handed in in the payload.
(cherry picked from commit a66e9a4d86)
2010-09-28 18:33:10 -07:00
Eric Anholt
1ab0d45c9f glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.
It's trying to get an int smeared across all channels, not trying to
get a 1:1 mapping of a subset of a vector's channels.  This usually
ended up not mattering with ir_to_mesa, since it just smears floats
into every chan of a vec4.

Fixes:
glsl1-temp array with swizzled variable indexing
(cherry picked from commit 668cdbe129)
2010-09-28 18:31:05 -07:00
Dave Airlie
269dd51162 mesa/mipmap: fix warning since 1acadebd62
1acadebd62 fixed the pointer but not the cast.
(cherry picked from commit 865cf77503)
2010-09-28 18:29:17 -07:00
Eric Anholt
f60c28e083 mesa: Fix type typo in glGenerateMipmap handling of GL_UNSIGNED_INT data.
Fixes ARB_depth_texture/fbo-generatemipmap-formats.
(cherry picked from commit 1acadebd62)
2010-09-28 18:29:10 -07:00
Eric Anholt
aebd78f607 glsl: Fix copy'n'wasted ir_noop_swizzle conditions.
It considered .xyyy a noop for vec4 instead of .xyzw, and similar for vec3.
(cherry picked from commit 3ffab36768)
2010-09-28 18:26:25 -07:00
Eric Anholt
0391eaf088 glsl: Rework assignments with write_masks to have LHS chan count match RHS.
It turns out that most people new to this IR are surprised when an
assignment to (say) 3 components on the LHS takes 4 components on the
RHS.  It also makes for quite strange IR output:

(assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) ))
(assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) ))
(assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) ))

But even worse, even we get it wrong, as shown by this line of our
current step(float, vec4):

(assign (constant bool (1)) (w)
	(var_ref t)
	(expression float b2f (expression bool >=
		    (swiz w (var_ref x))(var_ref edge))))

where we try to assign a float to the writemasked-out x channel and
don't supply anything for the actual w channel we're writing.  Drivers
right now just get lucky since ir_to_mesa spams the float value across
all the source channels of a vec4.

Instead, the RHS will now have a number of components equal to the
number of components actually being written.  Hopefully this confuses
everyone less, and it also makes codegen for a scalar target simpler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b39e6f33b6)
2010-09-28 18:25:57 -07:00
Marek Olšák
7436872dce configure.ac: do not build xorg-r300g by default
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 11eb422a16)
2010-09-28 19:52:22 +02:00
Marek Olšák
7a297bd926 configure.ac: look for libdrm_radeon before building gallium/r300,r600
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit a1aec2e2be)
2010-09-28 19:52:16 +02:00
Marek Olšák
6c3a8aeb27 r300g: fix swizzling of texture border color
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit e4fd65e9d7)
2010-09-28 19:51:38 +02:00
Marek Olšák
5c3be43cd2 r300/compiler: fix shadow sampling with swizzled coords
Taking the W component from coords directly ignores swizzling. Instead,
take the component which is mapped to W in the TEX instruction parameter.
The same for Z.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 7128e1625b)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
2010-09-28 19:51:19 +02:00
Marek Olšák
5906b9ac51 r300/compiler: do not use copy propagation if SaturateMode is used
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit c2ea7ffb0a)
2010-09-28 19:48:31 +02:00
Marek Olšák
89ed679a9e r300/compiler: fix projective mapping of 2D NPOT textures
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 6f747567ec)

Conflicts:

	src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
2010-09-28 19:48:00 +02:00
Kristian Høgsberg
7d154de048 glx: Invalidate buffers after binding a drawable
If the server doesn't send invalidate events, we may miss a
resize before the rendering starts.  Invalidate the buffers now
so the driver will recheck before rendering starts.

https://bugs.freedesktop.org/show_bug.cgi?id=29984
https://bugs.freedesktop.org/show_bug.cgi?id=30155
2010-09-28 08:32:45 -04:00
Ian Romanick
2a7ed4ba96 dri: Ensure that DRI driver cpp files are in tarballs
(cherry picked from commit 5717093f15fd7259441b2ee5583432fb9833c9a1)
2010-09-27 14:13:46 -07:00
Ian Romanick
8ad0396108 Add 7.9-rc1 md5sums 2010-09-27 10:20:25 -07:00
Ian Romanick
61653b488d mesa: set version string to 7.9-rc1 2010-09-27 10:17:11 -07:00
Marek Olšák
7e62335f35 r300g: fix macrotiling on R350
MACRO_SWITCH on R350 appears to use the RV350 mode by default. Who knew?

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 311ab3d468)

https://bugs.freedesktop.org/show_bug.cgi?id=30313
2010-09-26 23:00:16 +02:00
Joakim Sindholt
b8a60c84aa radeong: fix leaks
(cherry picked from commit 16baa465a2)
2010-09-26 19:59:11 +02:00
Joakim Sindholt
9f221e738d util/u_blitter: fix leak
(cherry picked from commit b51f6e7c23)
2010-09-26 19:53:47 +02:00
Tom Stellard
5c78e931c2 r300/compiler: Fix two mistakes in the presubtract optimization pass.
1. We can't turn an instruction into a presubtract operation if it
writes to one of the registers it reads from.
2. If we turn an instruction into a presubtract operation, we can't
remove that intruction unless all readers can use the presubtract
operation.

This fixes fdo bug 30337.
This is a candidate for the 7.9 branch.
(cherry picked from commit 522e994a22)
2010-09-25 15:53:20 -07:00
Marek Olšák
361084ac4b util: fix util_pack_color for B4G4R4A4
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 8619495790)
2010-09-25 01:54:12 +02:00
Marek Olšák
9409b544cc Build r300g by default
NOTE: This will go to 7.9 as well.
(cherry picked from commit 85a45dcd5d)
2010-09-25 01:54:12 +02:00
Marek Olšák
7261c3973d r300g: fix the border color for every format other than PIPE_FORMAT_B8G8R8A8
TX_BORDER_COLOR should be formatted according to the texture format.
Also the interaction with ARB_texture_swizzle should be fixed too.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9f35dcd24c)
2010-09-25 01:54:12 +02:00
Marek Olšák
bb4c9e0969 r300g: make accessing map_list and buffer_handles thread-safe
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit a333485386)
2010-09-25 01:54:12 +02:00
Marek Olšák
aa05753059 r300g: fixup long-lived BO maps being incorrectly unmapped when flushing
Based on commit 3ddc714b20 by Dave Airlie.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 206d92912c)
2010-09-25 01:54:12 +02:00
Marek Olšák
09085ada5d util: make calling remove_from_list multiple times in a row safe
This commit fixes an infinite loop in foreach_s if remove_from_list is used
more than once on the same item with other list operations in between.

NOTE: This is a candidate for the 7.9 branch because the commit
"r300g: fixup long-lived BO maps being incorrectly unmapped when flushing"
depends on it.
(cherry picked from commit 68afbe89c7)
2010-09-25 01:54:11 +02:00
Alex Deucher
77cc2a4e17 r600c: fix mipmap stride on evergreen
taken from Dave's r600g fix
2010-09-24 13:27:21 -04:00
Brian Paul
96085dc41a st/mesa: use the wrapped renderbuffer in CopyPixels()
Fixes assertion failures when copying stencil pixels.

NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit f5c810c42f)
2010-09-24 10:18:12 -06:00
Brian Paul
a128b62a35 st/mesa: add missing MESA_FORMAT_S8 case in st_mesa_format_to_pipe_format()
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit 10dcc989ab)
2010-09-24 10:17:40 -06:00
Brian Paul
b756100892 mesa: fix assertions to handle srgb formats
http://bugs.freedesktop.org/show_bug.cgi?id=30333

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9f7c8053e0)
2010-09-24 10:16:52 -06:00
Tom Stellard
3ad0279344 r300g: Always try to build libr300compiler.a
Make libr300compiler.a a PHONY target so that this library will always be
built.  This fixes the problem of libr300compiler.a not being updated
when r300g is being built and r300c is not.

(cherry picked from commit 92762842a0)
2010-09-23 15:42:40 -07:00
Kristian Høgsberg
97cfa1240c intel: Fix GL_ARB_shading_language_120 commit
Fix commit e7087175f8.  Move the reference to
GL_VERSION_2_1_functions to intel_extensions.c where it's available,
don't try to enable a non-existing extension and advertise 1.20 for all
intel chipsets, not just GEN4 and up.
(cherry picked from commit b91dba49e0)
2010-09-23 08:47:01 -07:00
Brian Paul
6b0c280660 mesa: don't advertise bogus GL_ARB_shading_language_120 extension
Instead of using the invalid GL_ARB_shading_language_120 extension to
determine the GLSL version, use a new ctx->Const.GLSLVersion field.
Updated the intel and r600 drivers, but untested.

See fd.o bug 29910

NOTE: This is a candidate for the 7.9 branch (but let's wait and see if
there's any regressions).
(cherry picked from commit e7087175f8)
2010-09-23 08:47:01 -07:00
Eric Anholt
b437c9102f i965: Share the KIL_NV implementation between glsl and non-glsl.
(cherry picked from commit 23c507f135)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
4ec818ea4a glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.
(cherry picked from commit 6ea16b6c51)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
80a6cbfea3 glsl: Add comments to clarify the types of comparison binops.
(cherry picked from commit 14eea26828)
2010-09-23 08:47:01 -07:00
Brian Paul
ec2031563a glsl2: silence compiler warnings in printf() calls
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"
(cherry picked from commit 1739124159)
2010-09-23 08:47:01 -07:00
Ian Romanick
b7d4f08f4e glsl: Add doxygen comments
(cherry picked from commit e053d62aa5)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
2fc2b89680 glsl/builtins: Switch comparison functions to just return an expression.
(cherry picked from commit dbd2480507)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
b29289a61c glsl/builtins: Fix equal and notEqual builtins.
Commit 309cd4115b incorrectly converted
these to all_equal and any_nequal, which is the wrong operation.
(cherry picked from commit 52f9156e88)
2010-09-23 08:47:01 -07:00
Kenneth Graunke
728829ab63 glsl: Properly handle nested structure types.
Fixes piglit test CorrectFull.frag.
(cherry picked from commit ca92ae2699)
2010-09-23 08:47:01 -07:00
Tilman Sauerbeck
9753ee3f3e glsl2: Fixed cloning of ir_call error instructions.
Those have the callee field set to the null pointer, so
calling the public constructor will segfault.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
(cherry picked from commit 3894fddccc)
2010-09-23 08:47:01 -07:00
Vinson Lee
2db5398449 glsl: Fix 'control reaches end of non-void function' warning.
Fixes this GCC warning.

lower_variable_index_to_cond_assign.cpp:
In member function
'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const':

lower_variable_index_to_cond_assign.cpp:261:
warning: control reaches end of non-void function
(cherry picked from commit a822ae3f1a)
2010-09-23 08:47:01 -07:00
Vinson Lee
ee8a96707a ir_to_mesa: Remove unused member array_indexed from struct statevar_element.
Fixes this GCC warning.
warning: missing initializer for member 'statevar_element::array_indexed'
(cherry picked from commit ff78d6dcc0)
2010-09-23 08:47:01 -07:00
Tilman Sauerbeck
22dcee8da2 glsl2: Empty functions can be inlined.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 19f8f32a96)
2010-09-23 08:47:00 -07:00
Ian Romanick
1b622bfbee glsl2: Add flags to enable variable index lowering
(cherry picked from commit a6ecd1c372)
2010-09-23 08:47:00 -07:00
Ian Romanick
2bb2efd7b2 glsl2: Refactor testing for whether a deref is of a matrix or array
(cherry picked from commit 6e4fe39da2)
2010-09-23 08:47:00 -07:00
Luca Barbieri
a19f0fb50b glsl: add pass to lower variable array indexing to conditional assignments
Currenly GLSL happily generates indirect addressing of any kind of
arrays.

Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in
general.

This pass fixes that by lowering such constructs to a binary search on the
values, followed at the end by vectorized generation of equality masks, and
4 conditional assignments for each mask generation.

Note that this requires the ir_binop_equal change so that we can emit SEQ
to generate the boolean masks.

Unfortunately, ir_structure_splitting is too dumb to turn the resulting
constant array references to individual variables, so this will need to
be added too before this pass can actually be effective for temps.

Several patches in the glsl2-lower-variable-indexing were squashed
into this commit.  These patches fix bugs in Luca's original
implementation, and the individual patches can be seen in that branch.
This was done to aid bisecting in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit a47539c7a1)
2010-09-23 08:47:00 -07:00
Kenneth Graunke
8df8bb43c7 glsl: Don't print blank (function ...) headers for built-ins.
Fixes a regression caused when I added my GLSL ES support.
(cherry picked from commit 8fbe968a62)
2010-09-23 08:47:00 -07:00
Kenneth Graunke
d2b6502c93 glsl: Change from has_builtin_signature to has_user_signature.
The print visitor needs this, and the only existing user can work with
has_user_signature just as well.
(cherry picked from commit 81f0339398)
2010-09-23 08:47:00 -07:00
Brian Paul
e68ec2212f glsl2: fix signed/unsigned comparison warning
(cherry picked from commit 7545514fb6)
2010-09-23 08:47:00 -07:00
Vinson Lee
c0f82e619c glsl: Fix 'format not a string literal and no format arguments' warning.
Fix the following GCC warning.
loop_controls.cpp: In function 'int calculate_iterations(ir_rvalue*, ir_rvalue*, ir_rvalue*, ir_expression_operation)':
loop_controls.cpp:88: warning: format not a string literal and no format arguments
(cherry picked from commit f20f2cc330)
2010-09-23 08:47:00 -07:00
José Fonseca
7f95c59509 draw: Prevent clipped vertices overflow.
Some pathological triangles cause a theoritically impossible number of
clipped vertices.

The clipper will still assert, but at least release builds will not
crash, while this problem is further investigated.
2010-09-23 16:48:59 +01:00
Keith Whitwell
6f310f379b draw: don't apply flatshading to clipped tris with <3 verts
If a triangle was completely culled by clipping, we would still try to
fix up its provoking vertex.
2010-09-23 16:28:27 +01:00
Dave Airlie
f279480df2 egl: fix build since 17eace581d
looks like mesa st didn't get updated.
2010-09-23 07:41:05 -04:00
Kristian Høgsberg
d382c51a23 dri: Pass the __DRIscreen and the __DRIscreen private back to image lookup
We will typically have a current context when we need to lookup the image,
but the lookup implementation don't need it so drop it.
2010-09-23 07:40:59 -04:00
Kristian Høgsberg
cdb3f23d8a glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
2010-09-23 07:40:27 -04:00
Eric Anholt
8f4c99a9af i965: Also enable CC statistics when doing OQs.
This is required by the spec, so respect that.

(oh, and it was required to actually fix occlusion-query-discard,
though I didn't know at the time of the commit since o-q-discard was
hanging the GPU)

(cherry picked from commit 4a0bc4716d)
2010-09-22 13:45:50 -07:00
Eric Anholt
5285100502 ir_to_mesa: Only compare vector_elements present for any_nequal/all_equal
Fixes: glsl-mat-from-int-ctor-03
(cherry picked from commit eaa6bf59db)
2010-09-22 13:43:10 -07:00
Eric Anholt
56dc7ca916 i965: Track the windowizer's dispatch for kill pixel, promoted, and OQ
Looks like the problem was we weren't passing the depth to the render
target as expected, so the chip would wedge.  Fixes GPU hang in
occlusion-query-discard.

Bug #30097
(cherry picked from commit dd9a88f4dd)
2010-09-22 13:15:59 -07:00
Eric Anholt
902dfdaa86 glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.
Fixes glsl2/builtin-texturematrix.
Bug #30196.
(cherry picked from commit b5bb215629)
2010-09-22 13:15:59 -07:00
Kristian Høgsberg
c98ce41de3 dri2: Make createImageFromName() take a __DRIscreen instead of __DRIcontext
We can't expect to have a context when this is called, and we don't need one
so just require a __DRIscreen instead.

Reported by Yu Dai <yu.dai@intel.com>
2010-09-22 15:27:04 -04:00
Brian Paul
3cdfc62523 llvmpipe: use draw module to draw sprites
For the 7.9 branch, this is simpler than merging the sprite-coord branch
and less likely to break other drivers.

Fixes fd.o bug 29849.
2010-09-22 08:22:36 -06:00
Brian Paul
2606105cc5 glsl2: fix typo in error msg
(cherry picked from commit 2b95525429)
2010-09-21 14:58:24 -06:00
Keith Whitwell
141dbbfc78 llvmpipe: fix flatshading in new line code
Calculate interpolants before rearranging the vertices.
2010-09-21 14:40:22 +01:00
Brian Paul
e678c3f4e1 docs: mark as obsolete, remove dead links
(cherry picked from commit 0bc3e1f4f4)
2010-09-20 10:56:53 -06:00
Brian Paul
1b90889eb4 docs: remove old broken link
(cherry picked from commit a8fde1ba4d)
2010-09-20 10:56:41 -06:00
Brian Paul
a9fceb6979 llvmpipe: fix query bug when no there's no scene
(cherry picked from commit 7888a2f822)
2010-09-20 10:56:10 -06:00
Brian Paul
febd353bcd gallivm: fix incorrect vector shuffle datatype
The permutation vector must always be a vector of int32 values.

(cherry picked from commit 3c9f4c7b75)
2010-09-20 10:55:35 -06:00
Marek Olšák
0f1faa9c7b st/mesa: fix assertion failure in GetTexImage for cubemaps
Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 168554904b)
2010-09-20 18:21:24 +02:00
Jakob Bornecrantz
b247620854 i915g: Link with wrapper sw winsys with scons
cherry picked from commit 208f1f3810
2010-09-20 15:45:35 +02:00
Michal Krol
d36344f900 svga: Integer constant register file has a separate namespace.
Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.
2010-09-20 09:29:26 +01:00
Michal Krol
202c1279c6 svga: Fix relative addressing translation for pixel shaders.
Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.
2010-09-20 09:29:24 +01:00
Jakob Bornecrantz
f6e811a7d0 scons: Link against talloc in the Gallium DRI drivers
cherry picked from commit b83156d42f
2010-09-20 00:08:06 +02:00
Luca Barbieri
bd009df1cc auxiliary: fix depth-only and stencil-only clears
Depth-only and stencil-only clears should mask out depth/stencil from the
output, mask out stencil/input from input, and OR or ADD them together.

However, due to a typo they were being ANDed, resulting in zeroing the buffer.
2010-09-19 21:51:25 +02:00
Chia-I Wu
d6df0cdcca egl: Enable drm platform by default.
This enables EGL_MESA_drm_display for st/egl in the default setup.
(cherry picked from commit 2a910b3396)
2010-09-19 17:37:00 +08:00
Chia-I Wu
52f6be0688 st/egl: s/kms/drm/ on the drm backend.
s/kms/drm/, s/kdpy/drmdpy/, and so forth.
(cherry picked from commit e4513e7fb9)
2010-09-19 17:30:00 +08:00
Chia-I Wu
b73cfde5ce st/egl: Rename kms backend to drm.
The main use of the backend is to support EGL_MESA_drm_display.  drm
should be a better name.
(cherry picked from commit e7424d7240)
2010-09-19 17:29:55 +08:00
Chia-I Wu
d7500ac4df st/egl: Split modeset code support to modeset.c.
The modeset code supports now obsolete EGL_MESA_screen_surface.  Move it
to a file of its own.
(cherry picked from commit c7c2e7d0ce)
2010-09-19 17:29:50 +08:00
Brian Paul
83917660f1 tgsi/sse: fix aos_to_soa() loop to handle num_inputs==0
Basically, change the loop from:
  do {...} while (--num_inputs != 0)
into:
  while (num_inputs != 0) { ... --num_inputs; }

Fixes fd.o bug 29987.
(cherry picked from commit 4b27c614cf)
2010-09-17 10:51:50 -07:00
Chia-I Wu
69f67f5ded libgl-xlib: Remove unused st_api_create_OpenGL.
st/egl no longer relies on libGL for OpenGL support.
2010-09-17 12:57:15 +08:00
Chia-I Wu
a42527be33 targets/egl: Use C++ compiler to link GL/ES state trackers.
Otherwise, applications compiled with C compiler might have trouble
using them.
2010-09-17 12:57:06 +08:00
Brian Paul
d169a67ad1 mesa: include mfeatures.h in formats.c
Otherwise, FEATURE_EXT_texture_sRGB was undefined.
This is (part of?) the fix for fd.o bug 30177.

(cherry picked from commit 3a6f9d0f47)
2010-09-16 12:42:53 -06:00
Marek Olšák
be16a35438 r300g/swtcl: fix CS overrun
https://bugs.freedesktop.org/show_bug.cgi?id=29901
(cherry picked from commit d4b2de13bc)
2010-09-16 20:35:39 +02:00
Brian Paul
d46b7c9f6f glx: add const qualifiers to __indirect_glMultiDrawArraysEXT()
(cherry picked from commit 4cd751bcc4)
2010-09-16 14:34:06 +08:00
Chia-I Wu
5d02503467 st/xlib: Notify the context when the front/back buffers are swapped.
The current context should be notified when the the front/back buffers
of the current drawable are swapped.  The notification was skipped when
xmesa_strict_invalidate is false (the default).

This fixes fdo bug #29774.
(cherry picked from commit 03224f492d)
2010-09-16 14:24:46 +08:00
Chia-I Wu
e3b89388ff mesa: Update ES APIspec.xml.
Enable some extensions now that the needed tokens are defined in
GLES/glext.h and GLES2/glext.h.  Update the prototype of MultiDrawArrays
now that the prototype of _mesa_MultiDrawArraysEXT has been updated.
(cherry picked from commit 9ca59b2427)
2010-09-16 14:24:45 +08:00
Chia-I Wu
d6538baa3b glapi: Fix ES build errors again.
This fixes an error in GLAPI ES.  My build is ok with or without this
patch, and the error affects others' setups.

[Patch from Francesco Marella]
(cherry picked from commit e3c46cf586)
2010-09-16 14:24:45 +08:00
Chia-I Wu
16a023ad7d glapi: Fix build errors for ES.
The latest glext.h defines GL_FIXED.  Test GL_OES_fixed_point instead to
decide whether to define GLfixed and GLclampx.

This fixes fdo bug #30205.
(cherry picked from commit cad87ebc3a)
2010-09-16 14:24:45 +08:00
Andre Maasikas
029eb8e764 r600c: fix buffer height setting in dri2 case
fbHeight is 0 in this case

uncovered by changes in b0bc026c and should fix kernel rejecting command
streams after that commit
2010-09-16 09:09:43 +03:00
Brian Paul
71b4054a6c tgsi: fix incorrect usage_mask for shadow tex instructions
The shadow versions of the texture targets use an extra component
(Z) to express distance from light source to the fragment.
Fixes the shadowtex demo with llvmpipe.

(cherry picked from commit 95254bbd2d)
2010-09-15 13:57:50 -06:00
Keith Whitwell
8e8a42ffc5 llvmpipe: return zero from floor_pot(zero) 2010-09-15 16:41:59 +01:00
Dave Airlie
fd4c6bd135 r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb

test run glxgears, resize.
(cherry picked from commit 09ef8e9283)
2010-09-15 13:32:29 +02:00
Marek Olšák
5d4409e0e5 r300g: prevent creating multiple winsys BOs for the same handle
This fixes a DRM deadlock in the cubestorm xscreensaver, because somehow
there must not be 2 different BOs relocated in one CS if both BOs back
the same handle. I was told it is impossible to happen, but apparently
it is not, or there is something else wrong.
(cherry picked from commit 0b9eb5c9bb)
2010-09-15 04:34:36 +02:00
Luca Barbieri
26e63a431d auxiliary: fix unintended fallthrough 2010-09-14 23:22:16 +02:00
2607 changed files with 169776 additions and 236049 deletions

View File

@@ -5,10 +5,7 @@ TOP = .
SUBDIRS = src
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
@$(TOP)/bin/extract_git_sha1
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
@@ -183,7 +180,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.11-devel
VERSION=7.9.2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -202,7 +199,6 @@ MAIN_FILES = \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
@@ -213,6 +209,7 @@ 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 \
@@ -235,7 +232,6 @@ MAIN_FILES = \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/sources.mak \
@@ -287,7 +283,8 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/windows/VC8/
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
@@ -311,7 +308,8 @@ 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/vg.pc.in \
$(DIRECTORY)/src/mapi/vgapi/*.h
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
@@ -346,12 +344,24 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch] \
$(DIRECTORY)/src/glx/apple/*.tcl \
$(DIRECTORY)/src/glx/apple/apple_exports.list \
$(DIRECTORY)/src/glx/apple/GL_aliases \
$(DIRECTORY)/src/glx/apple/GL_extensions \
$(DIRECTORY)/src/glx/apple/GL_noop \
$(DIRECTORY)/src/glx/apple/GL_promoted \
$(DIRECTORY)/src/glx/apple/specs/*.spec \
$(DIRECTORY)/src/glx/apple/specs/*.tm
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
@@ -424,22 +434,10 @@ LIB_FILES = \
$(GLW_FILES)
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
tarballs: rm_depend configure aclocal.m4 lib_gz glut_gz \
lib_bz2 glut_bz2 lib_zip glut_zip md5
tarballs: md5
rm -f ../$(LIB_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
@@ -448,7 +446,7 @@ AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@@ -457,41 +455,47 @@ rm_depend:
touch $$dep ; \
done
rm_config: parsers
rm_config:
rm -f configs/current
rm -f configs/autoconf
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
lib_gz: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
glut_gz:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
lib_bz2: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
glut_bz2:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
bzip2 $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
$(LIB_NAME).zip: rm_config
lib_zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
$(GLUT_NAME).zip:
glut_zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
md5: $(ARCHIVES)
md5:
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@@ -499,4 +503,7 @@ md5: $(ARCHIVES)
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz glut_gz \
lib_bz2 glut_bz2 \
lib_zip glut_zip

View File

@@ -3,14 +3,14 @@
#
# For example, invoke scons as
#
# scons build=debug llvm=yes machine=x86
# scons debug=1 dri=0 machine=x86
#
# to set configuration variables. Or you can write those options to a file
# named config.py:
#
# # config.py
# build='debug'
# llvm=True
# debug=1
# dri=0
# machine='x86'
#
# Invoke
@@ -30,8 +30,55 @@ import common
#######################################################################
# Configuration options
default_statetrackers = 'mesa'
default_targets = 'graw-null'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_drivers = 'softpipe,galahad,failover,svga,i915,i965,trace,identity,llvmpipe'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_drivers = 'softpipe,svga,i915,i965,trace,identity'
default_winsys = 'all'
elif common.default_platform in ('embedded',):
default_drivers = 'softpipe,llvmpipe'
default_winsys = 'xlib'
else:
default_drivers = 'all'
default_winsys = 'all'
opts = Variables('config.py')
common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg', 'egl']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'galahad', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'r600', 'identity', 'llvmpipe', 'nouveau', 'nv50', 'nvfx']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'vmware', 'i915', 'i965', 'gdi', 'radeon', 'r600', 'graw-xlib']))
opts.Add(ListVariable('targets', 'driver targets to build', default_targets,
['dri-i915',
'dri-i965',
'dri-nouveau',
'dri-radeong',
'dri-swrast',
'dri-vmwgfx',
'egl-i915',
'egl-i965',
'egl-nouveau',
'egl-radeon',
'egl-swrast',
'egl-vmwgfx',
'graw-xlib',
'graw-null',
'libgl-gdi',
'libgl-xlib',
'xorg-i915',
'xorg-i965',
'xorg-nouveau',
'xorg-radeon',
'xorg-vmwgfx']))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
env = Environment(
options = opts,
@@ -40,32 +87,61 @@ env = Environment(
ENV = os.environ,
)
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
except KeyError:
pass
else:
targets = targets.split(',')
print 'scons: warning: targets option is deprecated; pass the targets on their own such as'
print
print ' scons %s' % ' '.join(targets)
print
COMMAND_LINE_TARGETS.append(targets)
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
Help(opts.GenerateHelpText(env))
# fail early for a common error on windows
if env['gles']:
try:
import libxml2
except ImportError:
raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
# replicate options values in local variables
debug = env['debug']
dri = env['dri']
machine = env['machine']
platform = env['platform']
# derived options
x86 = machine == 'x86'
ppc = machine == 'ppc'
gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded')
msvc = platform in ('windows', 'winddk')
Export([
'debug',
'x86',
'ppc',
'dri',
'platform',
'gcc',
'msvc',
])
#######################################################################
# Environment setup
# Always build trace, rbug, identity, softpipe, and llvmpipe (where possible)
if 'trace' not in env['drivers']:
env['drivers'].append('trace')
if 'rbug' not in env['drivers']:
env['drivers'].append('rbug')
if 'galahad' not in env['drivers']:
env['drivers'].append('galahad')
if 'identity' not in env['drivers']:
env['drivers'].append('identity')
if 'softpipe' not in env['drivers']:
env['drivers'].append('softpipe')
if env['llvm'] and 'llvmpipe' not in env['drivers']:
env['drivers'].append('llvmpipe')
if 'sw' not in env['drivers']:
env['drivers'].append('sw')
# Includes
env.Prepend(CPPPATH = [
'#/include',
@@ -81,7 +157,7 @@ if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# Embedded
if env['platform'] == 'embedded':
if platform == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
@@ -98,7 +174,7 @@ if env['platform'] == 'embedded':
])
# Posix
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
if platform in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
@@ -108,9 +184,9 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if env['gcc']:
if gcc:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if env['platform'] == 'darwin':
if platform == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(LIBS = [
'm',
@@ -121,52 +197,9 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
# for debugging
#print env.Dump()
#######################################################################
# Invoke host SConscripts
#
# For things that are meant to be run on the native host build machine, instead
# of the target machine.
#
# Create host environent
if env['crosscompile'] and env['platform'] != 'embedded':
host_env = Environment(
options = opts,
# no tool used
tools = [],
toolpath = ['#scons'],
ENV = os.environ,
)
# Override options
host_env['platform'] = common.host_platform
host_env['machine'] = common.host_machine
host_env['toolchain'] = 'default'
host_env['llvm'] = False
host_env.Tool('gallium')
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
if host_env['msvc']:
host_env.Append(CPPPATH = ['#include/c99'])
target_env = env
env = host_env
Export('env')
SConscript(
'src/SConscript',
variant_dir = host_env['build_dir'],
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env = target_env
Export('env')
#######################################################################
# Invoke SConscripts
@@ -175,7 +208,9 @@ Export('env')
SConscript(
'src/SConscript',
variant_dir = env['build_dir'],
variant_dir = env['build'],
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env.Default('src')

View File

@@ -1,10 +0,0 @@
#!/bin/sh
touch src/mesa/main/git_sha1.h
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h
fi

View File

@@ -307,7 +307,7 @@ fi
#
case $ARCH in
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/* | 'NetBSD')
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
# we assume gcc
if [ "x$LINK" = "x" ] ; then
@@ -574,6 +574,20 @@ case $ARCH in
fi
;;
'NetBSD')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}_pic.a"
echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
FINAL_LIBS=`make_ar_static_lib cq 1 ${LIBNAME} ${OBJECTS}`
else
LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
rm -f ${LIBNAME}
ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
fi
;;
'IRIX' | 'IRIX64')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"

View File

@@ -8,22 +8,17 @@ import subprocess
import sys
import platform as _platform
import SCons.Script.SConscript
#######################################################################
# Defaults
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
_platform_map = {
'linux2': 'linux',
'win32': 'windows',
}
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
if 'platform' in SCons.Script.ARGUMENTS:
target_platform = SCons.Script.ARGUMENTS['platform']
else:
target_platform = host_platform
default_platform = sys.platform
default_platform = _platform_map.get(default_platform, default_platform)
_machine_map = {
'x86': 'x86',
@@ -32,39 +27,48 @@ _machine_map = {
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}
# find host_machine value
# find default_machine value
if 'PROCESSOR_ARCHITECTURE' in os.environ:
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
default_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
host_machine = _platform.machine()
host_machine = _machine_map.get(host_machine, 'generic')
default_machine = host_machine
default_toolchain = 'default'
if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'
default_toolchain = 'crossmingw'
default_machine = _platform.machine()
default_machine = _machine_map.get(default_machine, 'generic')
# find default_llvm value
if 'LLVM' in os.environ:
default_llvm = 'yes'
else:
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
platform = default_platform
pattern = re.compile("(platform=)(.*)")
for arg in sys.argv:
m = pattern.match(arg)
if m:
platform = m.group(2)
default_llvm = 'no'
try:
if target_platform != 'windows' and \
subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
if platform != 'windows' and subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
default_llvm = 'yes'
except:
pass
# find default_dri value
if default_platform in ('linux', 'freebsd'):
default_dri = 'yes'
elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
default_dri = 'no'
else:
default_dri = 'no'
#######################################################################
# Common options
@@ -77,16 +81,13 @@ def AddOptions(opts):
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
except ImportError:
from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('debug', 'debug build', 'yes'))
opts.Add(BoolOption('profile', 'profile build', 'no'))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
opts.Add('toolchain', 'compiler toolchain', 'default')
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))

View File

@@ -15,13 +15,11 @@ ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
GLES_OVERLAY = @GLES_OVERLAY@
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
@@ -35,9 +33,6 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
@@ -67,8 +62,6 @@ OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -80,8 +73,6 @@ EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -93,8 +84,6 @@ EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -111,10 +100,7 @@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
DRI_DIRS = @DRI_DIRS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
@@ -140,16 +126,12 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
@@ -197,16 +179,11 @@ GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@

View File

@@ -31,21 +31,23 @@ CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
@@ -57,3 +59,5 @@ GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=11
MESA_MINOR=9
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
@@ -25,7 +25,6 @@ CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
# Compiler for building demos/tests/etc
APP_CC = $(CC)
@@ -59,8 +58,6 @@ EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
# Library names (actual file names)
@@ -73,8 +70,6 @@ EGL_LIB_NAME = lib$(EGL_LIB).so
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -86,11 +81,6 @@ EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -114,7 +104,7 @@ EGL_DRIVERS_DIRS = glx
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS_DIRS = softpipe trace rbug identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
@@ -136,8 +126,6 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
@@ -186,6 +174,3 @@ GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =

View File

@@ -30,11 +30,9 @@ ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)

View File

@@ -43,11 +43,9 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(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)
@@ -60,10 +58,10 @@ EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_TARGET_DIRS = egl-swrast
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome swrast
INTEL_LIBS = `pkg-config --libs libdrm_intel`

View File

@@ -41,11 +41,9 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)

View File

@@ -38,11 +38,9 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(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

@@ -42,8 +42,7 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl

View File

@@ -12,10 +12,10 @@ GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DHAVE_UDIS86
# override -std=c99
CFLAGS += -std=gnu99
CFLAGS += -std=gnu99 -D__STDC_CONSTANT_MACROS
LLVM_VERSION := $(shell llvm-config --version)
@@ -30,10 +30,10 @@ else
endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
# LLVM_CFLAGS=`llvm-config --cflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
@@ -41,4 +41,4 @@ else
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++ -ludis86

View File

@@ -18,12 +18,11 @@ AC_CONFIG_AUX_DIR([bin])
AC_CANONICAL_HOST
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.24
LIBDRM_INTEL_REQUIRED=2.4.24
LIBDRM_REQUIRED=2.4.15
LIBDRM_RADEON_REQUIRED=2.4.17
DRI2PROTO_REQUIRED=2.1
GLPROTO_REQUIRED=1.4.11
LIBDRM_XORG_REQUIRED=2.4.24
LIBDRM_XORG_REQUIRED=2.4.17
LIBKMS_XORG_REQUIRED=1.0.0
dnl Check for progs
@@ -35,10 +34,6 @@ AC_CHECK_PROGS([PYTHON2], [python2 python])
AC_PATH_PROG([MKDEP], [makedepend])
AC_PATH_PROG([SED], [sed])
if test "x$MKDEP" = "x"; then
AC_MSG_ERROR([makedepend is required to build Mesa])
fi
dnl Our fallback install-sh is a symlink to minstall. Use the existing
dnl configuration in that case.
AC_PROG_INSTALL
@@ -151,13 +146,9 @@ if test "x$GCC" = xyes; then
# Enable -fvisibility=hidden if using a gcc that supports it
save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
VISIBILITY_CFLAGS="-fvisibility=hidden"
CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
# Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
CFLAGS=$save_CFLAGS
[CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
# Work around aliasing bugs - developers should comment this out
CFLAGS="$CFLAGS -fno-strict-aliasing"
@@ -168,21 +159,14 @@ if test "x$GXX" = xyes; then
# Enable -fvisibility=hidden if using a gcc that supports it
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
VISIBILITY_CXXFLAGS="-fvisibility=hidden"
CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
# Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
CXXFLAGS=$save_CXXFLAGS
[CXXFLAGS="$save_CXXFLAGS" ; AC_MSG_RESULT([no])]);
# Work around aliasing bugs - developers should comment this out
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi
AC_SUBST([VISIBILITY_CFLAGS])
AC_SUBST([VISIBILITY_CXXFLAGS])
dnl These should be unnecessary, but let the user set them if they want
AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Default is to use CFLAGS.])
@@ -328,8 +312,6 @@ EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -341,8 +323,6 @@ EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTE
GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
@@ -353,8 +333,6 @@ AC_SUBST([EGL_LIB_NAME])
AC_SUBST([GLESv1_CM_LIB_NAME])
AC_SUBST([GLESv2_LIB_NAME])
AC_SUBST([VG_LIB_NAME])
AC_SUBST([GLAPI_LIB_NAME])
AC_SUBST([WAYLAND_EGL_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
@@ -365,8 +343,6 @@ AC_SUBST([EGL_LIB_GLOB])
AC_SUBST([GLESv1_CM_LIB_GLOB])
AC_SUBST([GLESv2_LIB_GLOB])
AC_SUBST([VG_LIB_GLOB])
AC_SUBST([GLAPI_LIB_GLOB])
AC_SUBST([WAYLAND_EGL_LIB_GLOB])
dnl
dnl Arch/platform-specific settings
@@ -397,14 +373,14 @@ if test "x$enable_asm" = xyes; then
case "$host_cpu" in
i?86)
case "$host_os" in
linux* | *freebsd* | dragonfly* | *netbsd*)
linux* | *freebsd* | dragonfly*)
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
;;
esac
;;
x86_64)
case "$host_os" in
linux* | *freebsd* | dragonfly* | *netbsd*)
linux* | *freebsd* | dragonfly*)
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
;;
esac
@@ -485,77 +461,6 @@ if test "x$enable_selinux" = "xyes"; then
DEFINES="$DEFINES -DMESA_SELINUX"
fi
dnl Determine which APIs to support
AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl],
[disable support for standard OpenGL API @<:@default=no@:>@])],
[enable_opengl="$enableval"],
[enable_opengl=yes])
AC_ARG_ENABLE([gles1],
[AS_HELP_STRING([--enable-gles1],
[enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
[enable_gles1="$enableval"],
[enable_gles1=no])
AC_ARG_ENABLE([gles2],
[AS_HELP_STRING([--enable-gles2],
[enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
[enable_gles2="$enableval"],
[enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[DEPRECATED. Same as --enable-gles1 and --enable-gles2])],
[enable_gles1="$enableval"; enable_gles2="$enableval"],
[])
AC_ARG_ENABLE([openvg],
[AS_HELP_STRING([--enable-openvg],
[enable support for OpenVG API @<:@default=no@:>@])],
[enable_openvg="$enableval"],
[enable_openvg=no])
dnl smooth the transition; should be removed eventually
if test "x$enable_openvg" = xno; then
case "x$with_state_trackers" in
x*vega*)
AC_MSG_WARN([vega state tracker is enabled without --enable-openvg])
enable_openvg=yes
;;
esac
fi
if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \
"x$enable_openvg" = xno; then
AC_MSG_ERROR([at least one API should be enabled])
fi
API_DEFINES=""
if test "x$enable_opengl" = xno; then
API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
else
API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
fi
if test "x$enable_gles1" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
fi
if test "x$enable_gles2" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
fi
AC_SUBST([API_DEFINES])
AC_ARG_ENABLE([shared-glapi],
[AS_HELP_STRING([--enable-shared-glapi],
[EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
[enable_shared_glapi="$enableval"],
[enable_shared_glapi=no])
SHARED_GLAPI="0"
if test "x$enable_shared_glapi" = xyes; then
SHARED_GLAPI="1"
fi
AC_SUBST([SHARED_GLAPI])
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
dnl More later: fbdev, ...
@@ -568,17 +473,13 @@ linux*)
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
;;
*freebsd* | dragonfly* | *netbsd*)
*freebsd* | dragonfly*)
case "$host_cpu" in
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
;;
esac
if test "x$enable_opengl" = xno; then
default_driver="no"
fi
AC_ARG_WITH([driver],
[AS_HELP_STRING([--with-driver=DRIVER],
[driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
@@ -587,11 +488,6 @@ AC_ARG_WITH([driver],
dnl Check for valid option
case "x$mesa_driver" in
xxlib|xdri|xosmesa)
if test "x$enable_opengl" = xno; then
AC_MSG_ERROR([Driver '$mesa_driver' requires OpenGL enabled])
fi
;;
xno)
;;
*)
AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
@@ -603,50 +499,16 @@ dnl Driver specific build directories
dnl
dnl this variable will be prepended to SRC_DIRS and is not exported
CORE_DIRS=""
CORE_DIRS="mapi/glapi glsl mesa"
SRC_DIRS=""
GLU_DIRS="sgi"
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_TARGET_DIRS=""
GALLIUM_WINSYS_DIRS="sw"
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug noop identity"
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity"
GALLIUM_STATE_TRACKERS_DIRS=""
# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
x*yes*)
CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
;;
esac
# build glapi if OpenGL is enabled
if test "x$enable_opengl" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/glapi"
fi
# build es1api if OpenGL ES 1.x is enabled
if test "x$enable_gles1" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/es1api"
fi
# build es2api if OpenGL ES 2.x is enabled
if test "x$enable_gles2" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/es2api"
fi
# build vgapi if OpenVG is enabled
if test "x$enable_openvg" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/vgapi"
fi
# build glsl and mesa if OpenGL or OpenGL ES is enabled
case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*)
CORE_DIRS="$CORE_DIRS glsl mesa"
;;
esac
case "$mesa_driver" in
xlib)
DRIVER_DIRS="x11"
@@ -661,9 +523,6 @@ dri)
osmesa)
DRIVER_DIRS="osmesa"
;;
no)
DRIVER_DRIS=""
;;
esac
AC_SUBST([SRC_DIRS])
AC_SUBST([GLU_DIRS])
@@ -729,27 +588,6 @@ else
enable_xcb=no
fi
dnl Direct rendering or just indirect rendering
case "$host_os" in
gnu*)
dnl Disable by default on GNU/Hurd
driglx_direct_default="no"
;;
cygwin*)
dnl Disable by default on cygwin
driglx_direct_default="no"
;;
*)
driglx_direct_default="yes"
;;
esac
AC_ARG_ENABLE([driglx-direct],
[AS_HELP_STRING([--disable-driglx-direct],
[enable direct rendering in GLX and EGL for DRI \
@<:@default=auto@:>@])],
[driglx_direct="$enableval"],
[driglx_direct="$driglx_direct_default"])
dnl
dnl libGL configuration per driver
dnl
@@ -777,23 +615,18 @@ xlib)
GL_LIB_DEPS=""
fi
;;
dri|no) # these checks are still desired when there is no mesa_driver
dri)
# DRI must be shared, I think
if test "$enable_static" = yes; then
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
fi
# Check for libdrm
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
DRI_PC_REQ_PRIV=""
if test x"$driglx_direct" = xyes; then
# Check for libdrm
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
fi
GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
# find the DRI deps for libGL
if test "$x11_pkgconfig" = yes; then
@@ -853,48 +686,11 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
AC_SUBST([GLESv2_LIB_DEPS])
AC_SUBST([GLESv2_PC_LIB_PRIV])
GLAPI_LIB_DEPS="-lpthread"
AC_SUBST([GLAPI_LIB_DEPS])
dnl Setup default DRI CFLAGS
DRI_CFLAGS='$(CFLAGS)'
DRI_CXXFLAGS='$(CXXFLAGS)'
DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
AC_ARG_ENABLE([shared-dricore],
[AS_HELP_STRING([--enable-shared-dricore],
[link DRI modules with shared core DRI routines @<:@default=disabled@:>@])],
[enable_dricore="$enableval"],
[enable_dricore=no])
if test "$mesa_driver" = dri ; then
if test "$enable_dricore" = yes ; then
if test "$GCC$GXX" != yesyes ; then
AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore])
enable_dricore=no
else
DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
fi
fi
fi
AC_SUBST([DRICORE_LIBS])
AC_SUBST([DRICORE_GLSL_LIBS])
AC_SUBST([DRICORE_LIB_DEPS])
AC_SUBST([DRI_CXXFLAGS])
AC_SUBST([DRI_CFLAGS])
AC_SUBST([MESA_MODULES])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
@@ -906,22 +702,13 @@ if test "$mesa_driver" = xlib; then
fi
dnl
dnl TLS detection
dnl More DRI setup
dnl
AC_ARG_ENABLE([glx-tls],
[AS_HELP_STRING([--enable-glx-tls],
[enable TLS support in GLX @<:@default=disabled@:>@])],
[GLX_USE_TLS="$enableval"],
[GLX_USE_TLS=no])
AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
AS_IF([test "x$GLX_USE_TLS" = xyes],
[DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
dnl
dnl More DRI setup
dnl
dnl Directory for DRI drivers
AC_ARG_WITH([dri-driverdir],
[AS_HELP_STRING([--with-dri-driverdir=DIR],
@@ -936,6 +723,12 @@ AC_ARG_WITH([dri-searchpath],
[DRI_DRIVER_SEARCH_DIR="$withval"],
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
AC_SUBST([DRI_DRIVER_SEARCH_DIR])
dnl Direct rendering or just indirect rendering
AC_ARG_ENABLE([driglx-direct],
[AS_HELP_STRING([--disable-driglx-direct],
[enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])],
[driglx_direct="$enableval"],
[driglx_direct="yes"])
dnl Which drivers to build - default is chosen by platform
AC_ARG_WITH([dri-drivers],
[AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
@@ -947,6 +740,51 @@ if test "x$with_dri_drivers" = x; then
with_dri_drivers=no
fi
dnl Determine which APIs to support
AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl],
[disable support for standard OpenGL API @<:@default=no@:>@])],
[enable_opengl="$enableval"],
[enable_opengl=yes])
AC_ARG_ENABLE([gles1],
[AS_HELP_STRING([--enable-gles1],
[enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
[enable_gles1="$enableval"],
[enable_gles1=no])
AC_ARG_ENABLE([gles2],
[AS_HELP_STRING([--enable-gles2],
[enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
[enable_gles2="$enableval"],
[enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[build separate OpenGL ES only libraries @<:@default=no@:>@])],
[enable_gles_overlay="$enableval"],
[enable_gles_overlay=no])
API_DEFINES=""
GLES_OVERLAY=0
if test "x$enable_opengl" = xno; then
API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
else
API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
fi
if test "x$enable_gles1" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
fi
if test "x$enable_gles2" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
fi
if test "x$enable_gles_overlay" = xyes -o \
"x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
if test "x$enable_gles_overlay" = xyes; then
GLES_OVERLAY=1
fi
fi
AC_SUBST([API_DEFINES])
AC_SUBST([GLES_OVERLAY])
dnl If $with_dri_drivers is yes, directories will be added through
dnl platform checks
DRI_DIRS=""
@@ -967,7 +805,12 @@ yes)
esac
dnl Set DRI_DIRS, DEFINES and LIB_DEPS
if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
if test "$mesa_driver" = dri; then
# Use TLS in GLX?
if test "x$GLX_USE_TLS" = xyes; then
DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
fi
# Platform specific settings and drivers to build
case "$host_os" in
linux*)
@@ -1002,13 +845,16 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
;;
esac
;;
freebsd* | dragonfly* | *netbsd*)
freebsd* | dragonfly*)
DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
if test "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -ansi -pedantic"
fi
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
@@ -1026,16 +872,6 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
;;
cygwin*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
if test "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="swrast"
fi
;;
esac
# default drivers
@@ -1047,24 +883,22 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
# Check for expat
if test "$mesa_driver" = dri; then
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
fi
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
# put all the necessary libs together, including possibly libdricore
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
# put all the necessary libs together
DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
fi
AC_SUBST([DRI_DIRS])
AC_SUBST([EXPAT_INCLUDES])
@@ -1072,7 +906,7 @@ AC_SUBST([DRI_LIB_DEPS])
case $DRI_DIRS in
*i915*|*i965*)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.21])
;;
esac
@@ -1102,9 +936,6 @@ AC_ARG_ENABLE([gl-osmesa],
[gl_osmesa="$enableval"],
[gl_osmesa="$default_gl_osmesa"])
if test "x$gl_osmesa" = xyes; then
if test "x$enable_opengl" = xno; then
AC_MSG_ERROR([OpenGL is not available for OSMesa driver])
fi
if test "$mesa_driver" = osmesa; then
AC_MSG_ERROR([libGL is not available for OSMesa driver])
else
@@ -1161,21 +992,13 @@ AC_ARG_ENABLE([egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
if test "x$enable_egl" = xno; then
if test "x$mesa_driver" = xno; then
AC_MSG_ERROR([cannot disable EGL when there is no mesa driver])
fi
if test "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without EGL])
fi
fi
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
EGL_DRIVERS_DIRS=""
if test "$enable_static" != yes; then
# build egl_glx when libGL is built
if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
if test "$mesa_driver" != osmesa; then
EGL_DRIVERS_DIRS="glx"
fi
@@ -1192,9 +1015,6 @@ if test "x$enable_egl" = xyes; then
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
# workaround a bug in xcb-dri2 generated by xcb-proto 1.6
AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
[DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
fi
fi
@@ -1212,12 +1032,6 @@ AC_ARG_ENABLE([glu],
[enable OpenGL Utility library @<:@default=enabled@:>@])],
[enable_glu="$enableval"],
[enable_glu=yes])
if test "x$enable_glu" = xyes -a "x$mesa_driver" = xno; then
AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
enable_glu=no
fi
if test "x$enable_glu" = xyes; then
SRC_DIRS="$SRC_DIRS glu"
@@ -1267,13 +1081,9 @@ AC_ARG_ENABLE([glw],
[enable_glw="$enableval"],
[enable_glw=yes])
dnl Don't build GLw on osmesa
if test "x$enable_glw" = xyes; then
case "$mesa_driver" in
osmesa|no)
AC_MSG_NOTICE([Disabling GLw since there is no OpenGL driver])
enable_glw=no
;;
esac
if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
enable_glw=no
fi
AC_ARG_ENABLE([motif],
[AS_HELP_STRING([--enable-motif],
@@ -1347,20 +1157,16 @@ AC_ARG_ENABLE([glut],
[enable_glut="$enableval"],
[enable_glut="$default_glut"])
dnl Don't build glut on osmesa
if test "x$enable_glut" = xyes; then
case "$mesa_driver" in
osmesa|no)
AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver])
enable_glut=no
;;
esac
fi
dnl Can't build glut if GLU not available
if test "x$enable_glu$enable_glut" = xnoyes; then
AC_MSG_WARN([Disabling glut since GLU is disabled])
enable_glut=no
fi
dnl Don't build glut on osmesa
if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
AC_MSG_WARN([Disabling glut since the driver is OSMesa])
enable_glut=no
fi
if test "x$enable_glut" = xyes; then
SRC_DIRS="$SRC_DIRS glut/glx"
@@ -1425,11 +1231,10 @@ AC_ARG_ENABLE([gallium],
[build gallium @<:@default=enabled@:>@])],
[enable_gallium="$enableval"],
[enable_gallium=yes])
if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
fi
if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"],
[HAS_UDIS86="no"])
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
fi
@@ -1438,30 +1243,15 @@ AC_SUBST([LLVM_LIBS])
AC_SUBST([LLVM_LDFLAGS])
AC_SUBST([LLVM_VERSION])
VG_LIB_DEPS=""
EGL_CLIENT_APIS='$(GL_LIB)'
if test "x$enable_gles_overlay" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
dnl
dnl Gallium state trackers configuration
dnl
AC_ARG_ENABLE([gallium-egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable gallium EGL state tracker @<:@default=auto@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=auto])
if test "x$enable_gallium_egl" = xauto; then
case "$mesa_driver" in
dri|no)
enable_gallium_egl=$enable_egl
;;
*)
enable_gallium_egl=$enable_openvg
;;
esac
fi
case "x$enable_egl$enable_gallium_egl" in
xnoyes)
AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL])
esac
AC_ARG_WITH([state-trackers],
[AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
[comma delimited state_trackers list, e.g.
@@ -1482,24 +1272,16 @@ yes)
dri)
GALLIUM_STATE_TRACKERS_DIRS="dri"
HAVE_ST_DRI="yes"
if test "x$enable_egl" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
HAVE_ST_EGL="yes"
fi
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_ST_XORG="no")
;;
esac
if test "x$enable_egl" = xyes; then
if test "$enable_openvg" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega"
st_egl="yes"
fi
if test "$enable_gallium_egl" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
HAVE_ST_EGL="yes"
fi
fi
;;
*)
# verify the requested state tracker exist
@@ -1525,11 +1307,22 @@ yes)
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
HAVE_ST_XORG="yes"
;;
vega)
if test "x$enable_openvg" != xyes; then
AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
es)
AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
if test "x$enable_gles_overlay" != xyes; then
if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
fi
GLES_OVERLAY=1
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
have_st_vega="yes"
tracker=""
;;
vega)
CORE_DIRS="$CORE_DIRS mapi/vgapi"
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
;;
esac
@@ -1544,36 +1337,18 @@ yes)
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
# append --enable-openvg/--enable-gallium-egl to --with-state-trackers
if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
fi
if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
fi
;;
esac
EGL_CLIENT_APIS=""
VG_LIB_DEPS=""
case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*)
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
;;
esac
if test "x$enable_openvg" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
fi
AC_SUBST([VG_LIB_DEPS])
AC_SUBST([EGL_CLIENT_APIS])
if test "x$HAVE_ST_EGL" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
# define GLX_DIRECT_RENDERING even when the driver is not dri
if test "x$mesa_driver" != xdri -a "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
fi
if test "x$HAVE_ST_XORG" = xyes; then
@@ -1594,8 +1369,6 @@ AC_ARG_WITH([egl-displays],
[with_egl_platforms="$withval"])
EGL_PLATFORMS=""
WAYLAND_EGL_LIB_DEPS=""
case "$with_egl_platforms" in
yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
@@ -1613,31 +1386,16 @@ yes)
egl_platforms=`IFS=', '; echo $with_egl_platforms`
for plat in $egl_platforms; do
test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
AC_MSG_ERROR([EGL platform '$plat' doesn't exist])
AC_MSG_ERROR([EGL platform '$plat' does't exist])
if test "$plat" = "fbdev"; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
fi
if test "$plat" = "wayland"; then
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
[AC_MSG_ERROR([cannot find libwayland-client])])
WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
fi
done
EGL_PLATFORMS="$egl_platforms"
;;
esac
AC_SUBST([EGL_PLATFORMS])
AC_SUBST([WAYLAND_EGL_LIB_DEPS])
WAYLAND_EGL_PC_REQ_PRIV="wayland-client libdrm"
WAYLAND_EGL_PC_LIB_PRIV=
WAYLAND_EGL_PC_CFLAGS=
AC_SUBST([WAYLAND_EGL_PC_REQ_PRIV])
AC_SUBST([WAYLAND_EGL_PC_LIB_PRIV])
AC_SUBST([WAYLAND_EGL_PC_CFLAGS])
AC_ARG_WITH([egl-driver-dir],
[AS_HELP_STRING([--with-egl-driver-dir=DIR],
[directory for EGL drivers [[default=${libdir}/egl]]])],
@@ -1678,9 +1436,13 @@ AC_ARG_ENABLE([gallium-llvm],
if test "x$enable_gallium_llvm" = xyes; then
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
LLVM_LIBS="`$LLVM_CONFIG --libs` -lstdc++"
LLVM_CFLAGS=`$LLVM_CONFIG --cflags`
LLVM_LIBS="`$LLVM_CONFIG --libs jit interpreter nativecodegen bitwriter` -lstdc++"
if test "x$HAS_UDIS86" != xno; then
LLVM_LIBS="$LLVM_LIBS -ludis86"
DEFINES="$DEFINES -DHAVE_UDIS86"
fi
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
DEFINES="$DEFINES -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS"
@@ -1764,12 +1526,20 @@ AC_ARG_ENABLE([gallium-radeon],
[enable_gallium_radeon="$enableval"],
[enable_gallium_radeon=auto])
if test "x$enable_gallium_radeon" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
else
AC_MSG_WARN([libdrm_radeon is missing, not building gallium-radeon (r300)])
fi
fi
if test "x$enable_gallium_radeon" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-radeon (r300)])
fi
fi
dnl
@@ -1781,8 +1551,12 @@ AC_ARG_ENABLE([gallium-r600],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-r600])
fi
fi
dnl
@@ -1794,7 +1568,7 @@ AC_ARG_ENABLE([gallium-nouveau],
[enable_gallium_nouveau="$enableval"],
[enable_gallium_nouveau=no])
if test "x$enable_gallium_nouveau" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
fi
@@ -1841,56 +1615,25 @@ echo " exec_prefix: $exec_prefix"
echo " libdir: $libdir"
echo " includedir: $includedir"
dnl API info
echo ""
echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
echo " OpenVG: $enable_openvg"
dnl Driver info
echo ""
echo " Driver: $mesa_driver"
if test "$mesa_driver" != no; then
if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
echo " OSMesa: lib$OSMESA_LIB"
else
echo " OSMesa: no"
fi
if test "$mesa_driver" = dri; then
# cleanup the drivers var
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
if test "x$DRI_DIRS" = x; then
echo " DRI drivers: no"
else
echo " DRI drivers: $dri_dirs"
fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
echo " Use XCB: $enable_xcb"
echo " Shared dricore: $enable_dricore"
fi
if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
echo " OSMesa: lib$OSMESA_LIB"
else
echo " OSMesa: no"
fi
echo ""
echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl EGL
echo ""
echo " EGL: $enable_egl"
if test "$enable_egl" = yes; then
echo " EGL platforms: $EGL_PLATFORMS"
egl_drivers=""
for d in $EGL_DRIVERS_DIRS; do
egl_drivers="$egl_drivers builtin:egl_$d"
done
if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then
echo " EGL drivers: ${egl_drivers} egl_gallium"
echo " EGL Gallium STs:$EGL_CLIENT_APIS"
else
echo " EGL drivers: $egl_drivers"
fi
if test "$mesa_driver" = dri; then
# cleanup the drivers var
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
if test "x$DRI_DIRS" = x; then
echo " DRI drivers: no"
else
echo " DRI drivers: $dri_dirs"
fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
fi
echo " Use XCB: $enable_xcb"
echo ""
if test "x$MESA_LLVM" = x1; then
@@ -1909,6 +1652,9 @@ if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
if test "x$HAVE_ST_EGL" = xyes; then
echo " EGL client APIs: $EGL_CLIENT_APIS"
fi
else
echo " Gallium: no"
fi
@@ -1917,6 +1663,15 @@ dnl Libraries
echo ""
echo " Shared libs: $enable_shared"
echo " Static libs: $enable_static"
if test "$enable_egl" = yes; then
echo " EGL: $EGL_DRIVERS_DIRS"
echo " EGL platforms: $EGL_PLATFORMS"
else
echo " EGL: no"
fi
echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl Compiler options
# cleanup the CFLAGS/CXXFLAGS/DEFINES vars

View File

@@ -1,4 +0,0 @@
Known issues in the ARB_color_buffer_float implementation:
- Rendering to multiple render targets, some fixed-point, some floating-point, with FIXED_ONLY fragment clamping and polygon smooth enabled may write incorrect values to the fixed point buffers (depends on spec interpretation)
- For fragment programs with ARB_fog_* options, colors are clamped before fog application regardless of the fragment clamping setting (this depends on spec interpretation)

View File

@@ -15,45 +15,39 @@ GL 3.0:
GLSL changes (GL_EXT_gpu_shader4, etc) not started
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe)
Map buffer subranges (GL_ARB_map_buffer_range) DONE
Clamping controls (GL_ARB_color_buffer_float) DONE
Float textures, renderbuffers (GL_ARB_texture_float) BRANCH ~mareko/mesa floating2
GL_EXT_packed_float not started
GL_EXT_texture_shared_exponent not started
Float depth buffers (GL_ARB_depth_buffer_float) not started
Float textures, renderbuffers some infrastructure done
(incl. GL_EXT_packed_float, GL_EXT_shared_exponent)
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float DONE
Half-float some infrastructure done
Multisample blit DONE
Non-normalized Integer texture/framebuffer formats ~50% done
Non-normalized Integer texture/framebuffer formats not started
1D/2D Texture arrays core Mesa, swrast done
Packed depth/stencil formats DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
GL_EXT_texture_compression_rgtc DONE (swrast, gallium r600)
Red and red/green texture formats DONE (swrast, i965, gallium)
GL_EXT_texture_compression_rgtc not started
Red and red/green texture formats Ian?
Transform feedback (GL_EXT_transform_feedback) ~50% done
glBindFragDataLocation, glGetFragDataLocation,
glBindBufferRange, glBindBufferBase commands
Vertex array objects (GL_APPLE_vertex_array_object) DONE
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) core GL done (i965, gallium), GLX todo
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE (but converts int
values to floats)
Depth format cube textures 0% done
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started
glClearBuffer commands DONE, except for dispatch
glGetStringi command DONE, except for dispatch
glTexParameterI, glGetTexParameterI commands DONE, except for dispatch
glVertexAttribI commands not started
GL 3.1:
GLSL 1.30 and 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
Instanced drawing (GL_ARB_draw_instanced) ~50% done
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
Primitive restart (GL_NV_primitive_restart) not started
16 vertex texture image units not started
Texture buffer objs (GL_ARB_texture_buffer_object) not started
Texture buffer objs (GL_ARB_textur_buffer_object) not started
Rectangular textures (GL_ARB_texture_rectangle) DONE
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Signed normalized textures (GL_EXT_texture_snorm) DONE (gallium)
Signed normalized texture formats ~50% done
GL 3.2:
@@ -75,13 +69,13 @@ GL 3.3:
GLSL 3.30 not started
GL_ARB_blend_func_extended not started
GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
GL_ARB_occlusion_query2 DONE (swrast, gallium)
GL_ARB_sampler_objects DONE (gallium)
GL_ARB_explicit_attrib_location not started
GL_ARB_occlusion_query2 not started
GL_ARB_sampler_objects not started
GL_ARB_texture_rgb10_a2ui not started
GL_ARB_texture_swizzle DONE (same as EXT version)
GL_ARB_timer_query DONE (only Xlib sw driver)
GL_ARB_instanced_arrays DONE (gallium)
GL_ARB_instanced_arrays not started
GL_ARB_vertex_type_2_10_10_10_rev not started
@@ -89,7 +83,7 @@ GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod not started
GL_ARB_draw_buffers_blend DONE (gallium softpipe)
GL_ARB_draw_buffers_blend not started
GL_ARB_draw_indirect not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started
@@ -99,18 +93,6 @@ GL_ARB_texture_buffer_object_rgb32 not started
GL_ARB_texture_cube_map_array not started
GL_ARB_texture_gather not started
GL_ARB_transform_feedback2 not started
GL_ARB_transform_feedback3 not started
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility not started
GL_ARB_get_program_binary not started
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started
GL_ARB_vertex_attrib_64bit not started
GL_ARB_viewport_array not started

View File

@@ -67,7 +67,7 @@ Additions to Chapter 3 the GLX 1.4 Specification (Functions and Errors)
On "PC" computers, AGP memory can be allocated with glXAllocateMemoryNV
and freed with glXFreeMemoryNV. Sometimes it's useful to know where a
block of AGP memory is located with respect to the start of the AGP
aperture. The function
aperature. The function
GLuint glXGetAGPOffsetMESA( const GLvoid *pointer )

View File

@@ -24,7 +24,7 @@ Number
Dependencies
Requires EGL 1.4 or later. This extension is written against the
Reguires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
@@ -83,7 +83,7 @@ Additions to the EGL 1.4 Specification:
EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
const EGLint *attrib_list);
In the attribute list, pass EGL_WIDTH, EGL_HEIGHT and format and
In the attribute list, pass EGL_WIDTH, EGL_EIGHT and format and
use in the attrib list using EGL_DRM_BUFFER_FORMAT_MESA and
EGL_DRM_BUFFER_USE_MESA. The only format specified by this
extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
@@ -134,7 +134,7 @@ Issues
RESOLVED: The eglQueryImage function has been proposed often,
but it goes against the EGLImage design. EGLImages are opaque
handles to a 2D array of pixels, which can be passed between
client APIs. By referencing an EGLImage in a client API, the
client APIs. By referenceing an EGLImage in a client API, the
EGLImage target (a texture, a renderbuffer or such) can be
used to query the attributes of the EGLImage. We don't have a
full client API for creating and querying DRM buffers, though,

View File

@@ -1,158 +0,0 @@
Name
MESA_multithread_makecurrent
Name Strings
GLX_MESA_multithread_makecurrent
Contact
Eric Anholt (eric@anholt.net)
Status
Not shipping.
Version
Last Modified Date: 21 February 2011
Number
TBD
Dependencies
OpenGL 1.0 or later is required.
GLX 1.3 or later is required.
Overview
The GLX context setup encourages multithreaded applications to
create a context per thread which each operate on their own
objects in parallel, and leaves synchronization for write access
to shared objects up to the application.
For some applications, maintaining per-thread contexts and
ensuring that the glFlush happens in one thread before another
thread starts working on that object is difficult. For them,
using the same context across multiple threads and protecting its
usage with a mutex is both higher performance and easier to
implement. This extension gives those applications that option by
relaxing the context binding requirements.
This new behavior matches the requirements of AGL, while providing
a feature not specified in WGL.
IP Status
Open-source; freely implementable.
Issues
None.
New Procedures and Functions
None.
New Tokens
None.
Changes to Chapter 2 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 2.2 Rendering Contexts:
In addition, a rendering context can be current for only one
thread at a time.
with:
In addition, an indirect rendering context can be current for
only one thread at a time. A direct rendering context may be
current to multiple threads, with synchronization of access to
the context thruogh the GL managed by the application through
mutexes.
Changes to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 3.3.7 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeContextCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeContextCurrent will generate a BadAccess error.
Replace the following sentence from section 3.5 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeCurrent will generate a BadAccess error.
GLX Protocol
None. The GLX extension only extends to direct rendering contexts.
Errors
None.
New State
None.
Issues
(1) What happens if the app binds a context/drawable in multiple
threads, then binds a different context/thread in one of them?
As with binding a new context from the current thread, the old
context's refcount is reduced and the new context's refcount is
increased.
(2) What happens if the app binds a context/drawable in multiple
threads, then binds None/None in one of them?
The GLX context is unreferenced from that thread, and the other
threads retain their GLX context binding.
(3) What happens if the app binds a context/drawable in 7 threads,
then destroys the context in one of them?
As with GLX context destruction previously, the XID is destroyed
but the context remains usable by threads that have the context
current.
(4) What happens if the app binds a new drawable/readable with
glXMakeCurrent() when it is already bound to another thread?
The context becomes bound to the new drawable/readable, and
further rendering in either thread will use the new
drawable/readable.
(5) What requirements should be placed on the user managing contexts
from multiple threads?
The intention is to allow multithreaded access to the GL at the
minimal performance cost, so requiring that the GL do general
synchronization (beyond that already required by context sharing)
is not an option, and synchronizing of GL's access to the GL
context between multiple threads is left to the application to do
across GL calls. However, it would be unfortunate for a library
doing multithread_makecurrent to require that other libraries
share in synchronization for binding of their own contexts, so the
refcounting of the contexts is required to be threadsafe.
(6) Does this apply to indirect contexts?
This was ignored in the initial revision of the spec. Behavior
for indirect contexts is left as-is.
Revision History
20 November 2009 Eric Anholt - initial specification
22 November 2009 Eric Anholt - added issues from Ian Romanick.
3 February 2011 Eric Anholt - updated with resolution to issues 1-3
3 February 2011 Eric Anholt - added issue 4, 5
21 February 2011 Eric Anholt - Include glXMakeCurrent() sentence
along with glXMakeContextCurrent() for removal.

View File

@@ -48,7 +48,7 @@ IP Status
Issues
1. Should we also define UNPACK_INVERT_MESA for glDrawPixels, etc?
1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc?
Resolved: No, we're only concerned with pixel packing. There are other
solutions for inverting images when using glDrawPixels (negative Y pixel

View File

@@ -31,12 +31,12 @@ Overview
Mesa's implementation of GLX is entirely implemented on the client side.
Therefore, Mesa cannot immediately detect when an X window or pixmap is
destroyed in order to free any ancillary data associated with the window
destroyed in order to free any ancilliary data associated with the window
or pixmap.
The glxMesaReleaseBuffers() function can be used to explicitly indicate
when the back color buffer, depth buffer, stencil buffer, and/or accumu-
lation buffer associated with a drawable can be freed.
when the back color buffer, depth buffer, stencil buffer, and/or accum-
ulation buffer associated with a drawable can be freed.
IP Status
@@ -60,7 +60,7 @@ Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
causes all software ancillary buffers (back buffer, depth, stencil,
causes all software ancilliary buffers (back buffer, depth, stencil,
accum, etc) associated with the named drawable to be immediately
deallocated. True is returned if <d> is a valid Mesa GLX drawable,
else False is returned. After calling glXReleaseBuffersMESA, the

View File

@@ -35,7 +35,7 @@ Overview
Mesa's glViewport command queries the current window size and updates
its internal data structors accordingly. This normally works fine
since most applications call glViewport in response to window size
since most applications call glViewport in responce to window size
changes.
In some situations, however, the application may not call glViewport
@@ -65,7 +65,7 @@ Additions to the AGL/GLX/WGL Specifications
Errors
INVALID_OPERATION is generated if glResizeBuffersMESA is called between
INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen
Begin and End.
New State

View File

@@ -88,8 +88,8 @@ Additions to the GLX 1.3 Specification
this is typically the time required to display both the even and odd
fields of a frame of video data.
If <interval> is set to a value of 0, buffer swaps are not synchro-
nized to a video frame. The <interval> value is silently clamped to
If <interval> is set to a value of 0, buffer swaps are not synchron-
ized to a video frame. The <interval> value is silently clamped to
the maximum implementation-dependent value supported before being
stored.

View File

@@ -328,7 +328,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
-- Section 3.8.10 "Texture Completeness"
Change the second paragraph (page 177) to say (spec changes identical
Change the second paragaph (page 177) to say (spec changes identical
to EXT_texture_array):
"For one-, two-, or three-dimensional textures and one- or
@@ -443,10 +443,10 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
Change second through fourth paragraphs (page 188) to say:
"Let D_t be the depth texture value, in the range [0, 1]. For
texture lookups from one- and two-dimensional, rectangle, and
texture lookups from one- and two-dimesional, rectangle, and
one-dimensional array targets, let R be the interpolated <r>
texture coordinate, clamped to the range [0, 1]. For texture lookups
from two-dimensional array texture targets, let R be the interpolated
from two-dimesional array texture targets, let R be the interpolated
<q> texture coordinate, clamped to the range [0, 1]. Then the
effective texture value L_t, I_t, or A_t is computed as follows:
@@ -604,7 +604,7 @@ Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
-- Section 5.4 "Display Lists"
Change the first paragraph on page 242 to say (spec changes
Change the first paragraphi on page 242 to say (spec changes
identical to EXT_texture_array):
"TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are

View File

@@ -44,7 +44,7 @@ Overview
ARB_texture_compression_rgtc introduces some compressed red and
red_green signed formats but no uncompressed ones, which might
still be useful. NV_texture_shader adds signed texture formats,
but also a lot of functionality which has been superseded by fragment
but also a lot of functionality which has been superceded by fragment
shaders.
It is usually possible to get the same functionality
using a unsigned format by doing scale and bias in a shader, but this
@@ -105,7 +105,7 @@ Issues
This is also different to what NV_texture_shader used.
The above mapping should be considered the reference, but there
is some leeway so other mappings are allowed for implementations which
cannot do this. Particularly the mapping given in NV_texture_shader or
cannot do this. Particulary the mapping given in NV_texture_shader or
the standard OpenGL byte/float mapping is considered acceptable too, as
might be a mapping which represents -1.0 by -128, 0.0 by 0 and 1.0 by
127 (that is, uses different scale factors for negative and positive

View File

@@ -88,7 +88,7 @@ Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
WindosPos4MESA takes four values indicating x, y, z, and w.
WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only
x, y, and z with w implicitly set to 1 (or only x and y with z
implicitly set to 0 and w implicitly set to 1).
implicititly set to 0 and w implicitly set to 1).
WindowPosMESA operates like RasterPos except that the current modelview
matrix, projection matrix and viewport parameters are ignored and the
@@ -108,7 +108,7 @@ GLX Protocol
Errors
INVALID_OPERATION is generated if WindowPosMESA is called between
INVALID_OPERATION is generated if WindowPosMESA is called betweeen
Begin and End.
New State

View File

@@ -26,7 +26,7 @@ Number
Dependencies
OpenGL 1.0 or later is required
This extension is written against the OpenGL 1.4 Specification.
This extensions is written against the OpenGL 1.4 Specification.
NV_texture_rectangle effects the definition of this extension.
Overview
@@ -104,7 +104,7 @@ Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
In section 3.6.4, Rasterization of Pixel Rectangles, on page 104,
add the following to Table 3.12 (Packed pixel field assignments):
add the following to Table 3.12 (Packed pixel fiedl assignments):
First Second Third Fourth
Format Element Element Element Element

View File

@@ -1,10 +1,6 @@
File: docs/README.WIN32
Last updated: Apr 25, 2007
NOTE: This information only applies to Mesa 7.8 and older. Nowadays
it's probably better to use Scons to build for Windows.
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
----- -----
@@ -134,5 +130,11 @@ change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you as
much as I can. I also monitor the Mesa mailing lists and will answer
questions in this area there as well.
Karl Schultz

View File

@@ -1,92 +0,0 @@
Name
WL_bind_wayland_display
Name Strings
EGL_WL_bind_wayland_display
Contact
Kristian Høgsberg <krh@bitplanet.net>
Benjamin Franzke <benjaminfranzke@googlemail.com>
Status
Proposal
Version
Version 1, March 1, 2011
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
Overview
This extension provides entry points for binding and unbinding the
wl_display of a Wayland compositor to an EGLDisplay. Binding a
wl_display means that the EGL implementation should provide one or
more interfaces in the Wayland protocol to allow clients to create
wl_buffer objects. On the server side, this extension also
provides a new target for eglCreateImageKHR, to create an EGLImage
from a wl_buffer
Adding an implementation specific wayland interface, allows the
EGL implementation to define specific wayland requests and events,
needed for buffer sharing in an EGL wayland platform.
IP Status
Open-source; freely implementable.
New Procedures and Functions
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
New Tokens
Accepted as <target> in eglCreateImageKHR
EGL_WAYLAND_BUFFER_WL 0x31D5
Additions to the EGL 1.4 Specification:
To bind a server side wl_display to an EGLDisplay, call
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
To unbind a server side wl_display from an EGLDisplay, call
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
eglBindWaylandDisplayWL returns EGL_FALSE when there is already a
wl_display bound to EGLDisplay otherwise EGL_TRUE.
eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
and an empty attribute_list.
Issues
Revision History
Version 1, March 1, 2011
Initial draft (Benjamin Franzke)

View File

@@ -62,7 +62,6 @@ a:visited {
<LI><A HREF="perf.html" target="MainFrame">Performance Tips</A>
<LI><A HREF="extensions.html" target="MainFrame">Mesa Extensions</A>
<LI><A HREF="mangling.html" target="MainFrame">Function Name Mangling</A>
<LI><A href="llvmpipe.html" target="MainFrame">Gallium llvmpipe driver</A>
</ul>
<b>Developer Topics</b>

View File

@@ -21,52 +21,76 @@ When a new release is coming, release candidates (betas) may be found
<p>
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.
Mesa is distributed in several parts:
</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>
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.
If you're not interested in running the demos, you'll only need the first
package.
</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>
To unpack .tar.gz files:
All the packages should be in the same directory prior to unpacking.
</p>
<ul>
<li>To unpack .tar.gz files:
<pre>
tar zxf MesaLib-x.y.z.tar.gz
tar zxf MesaLib-X.Y.tar.gz
tar zxf MesaDemos-X.Y.tar.gz
tar zxf MesaGLUT-X.Y.tar.gz
</pre>
or
<pre>
gzcat MesaLib-x.y.z.tar.gz | tar xf -
gzcat MesaLib-X.Y.tar.gz | tar xf -
gzcat MesaDemos-X.Y.tar.gz | tar xf -
gzcat MesaGLUT-X.Y.tar.gz | tar xf -
</pre>
or
<pre>
gunzip MesaLib-x.y.z.tar.gz ; tar xf MesaLib-x.y.z.tar
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
</pre>
<p>
To unpack .tar.bz2 files:
</p>
<li>To unpack .tar.bz2 files:
<pre>
bunzip2 -c MesaLib-x.y.z.tar.gz | tar xf -
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 -
</pre>
<p>
To unpack .zip files:
</p>
<li>To unpack .zip files:
<pre>
unzip MesaLib-x.y.z.zip
unzip MesaLib-X.Y.zip
unzip MesaDemos-X.Y.zip
unzip MesaGLUT-X.Y.zip
</pre>
</ul>
<h1>Contents</h1>
@@ -82,13 +106,22 @@ 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 MesaGLUT.x.y.z package:
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:
<pre>
src/glut - GLUT library source code
</pre>

View File

@@ -19,23 +19,27 @@ 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.</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>
<h2>Build EGL</h2>
<ol>
<li>
<p>Run <code>configure</code> with the desired client APIs and enable
the driver for your hardware. For example</p>
<p>Run <code>configure</code> with the desired state trackers and enable
the Gallium driver for your hardware. For example</p>
<pre>
$ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
$ ./configure --enable-gles-overlay --with-state-trackers=egl,vega --enable-gallium-intel
</pre>
<p>The main library and OpenGL is enabled by default. The first option above
enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
<a href="openvg.html">OpenVG</a>.</p>
<p>The main library and OpenGL is enabled by default. The first option enables
<a href="opengles.html">OpenGL ES 1.x and 2.x</a>. The <code>egl</code> state
tracker is needed by a number of EGL drivers. EGL drivers will be covered
later. The <a href="openvg.html">vega state tracker</a> provides OpenVG
1.x.</p>
</li>
<li>Build and install Mesa as usual.</li>
@@ -76,27 +80,31 @@ types such as <code>EGLNativeDisplayType</code> or
<p>The available platforms are <code>x11</code>, <code>drm</code>,
<code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> platform can
only be built with SCons. Unless for special needs, the build system should
select the right platforms automatically.</p>
only be built with SCons.</p>
</li>
<li><code>--with-state-trackers</code>
<p>The argument is a comma separated string. It is usually used to specify the
rendering APIs, such as OpenVG, to build. But it is also used to specify
<code>egl</code> state tracker that <code>egl_gallium</code> depends on.</p>
</li>
<li><code>--enable-gles-overlay</code>
<p>OpenGL and OpenGL ES are not controlled by
<code>--with-state-trackers</code>. OpenGL is always built. To build OpenGL
ES, this option must be explicitly given.</p>
</li>
<li><code>--enable-gles1</code> and <code>--enable-gles2</code>
<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-openvg</code>
<p>OpenVG must be explicitly enabled by this option.</p>
</li>
<li><code>--enable-gallium-egl</code>
<p>Explicitly enable or disable <code>egl_gallium</code>.</p>
<p>Unlike <code>--enable-gles-overlay</code>, which builds one library for each
rendering API, these options enable OpenGL ES support in OpenGL. The result is
one big library that supports multiple APIs.</p>
</li>
@@ -123,24 +131,17 @@ 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>
<p>This variable specifies a full path to or the name of an EGL driver. It
forces the specified EGL driver to be loaded. It comes in handy when one wants
to test a specific driver. This variable is ignored for setuid/setgid
binaries.</p>
<p>This variable specifies a full path to an EGL driver and it forces the
specified EGL driver to be loaded. It comes in handy when one wants to test a
specific driver. This variable is ignored for setuid/setgid binaries.</p>
<p><code>egl_gallium</code> dynamically loads hardware drivers and client API
modules found in <code>EGL_DRIVERS_PATH</code>. Thus, specifying this variable
alone is not sufficient for <code>egl_gallium</code> for uninstalled build.</p>
</li>
@@ -149,12 +150,7 @@ binaries.</p>
<p>This variable specifies the native platform. The valid values are the same
as those for <code>--with-egl-platforms</code>. When the variable is not set,
the main library uses the first platform listed in
<code>--with-egl-platforms</code> as the native platform.</p>
<p>Extensions like <code>EGL_MESA_drm_display</code> define new functions to
create displays for non-native platforms. These extensions are usually used by
applications that support non-native platforms. Setting this variable is
probably required only for some of the demos found in mesa/demo repository.</p>
<code>--with-egl-platforms</code> as the native platform</p>
</li>
@@ -177,25 +173,11 @@ variable to true forces the use of software rendering.</p>
<h2>EGL Drivers</h2>
<ul>
<li><code>egl_dri2</code>
<p>This driver supports both <code>x11</code> and <code>drm</code> platforms.
It functions as a DRI driver loader. For <code>x11</code> support, it talks to
the X server directly using (XCB-)DRI2 protocol.</p>
<p>This driver can share DRI drivers with <code>libGL</code>.</p>
</li>
<li><code>egl_gallium</code>
<p>This driver is based on Gallium3D. It supports all rendering APIs and
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
The supported platforms are X11, 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>
The supported platforms are X11, KMS, FBDEV, and GDI.</p>
</li>
@@ -205,24 +187,26 @@ The supported platforms are X11, DRM, FBDEV, and GDI.</p>
the EGL API. It supports both direct and indirect rendering when the GLX does.
It is accelerated when the GLX is. As such, it cannot provide functions that
is not available in GLX or GLX extensions.</p>
</li>
<li><code>egl_dri2</code>
<p>This driver supports the X Window System as its window system. It functions
as a DRI2 driver loader. Unlike <code>egl_glx</code>, it has no dependency on
<code>libGL</code>. It talks to the X server directly using DRI2 protocol.</p>
</li>
<li><code>egl_dri</code>
<p>This driver lacks maintenance and does <em>not</em> build. It is similiar
to <code>egl_dri2</code> in that it functions as a DRI(1) driver loader. But
unlike <code>egl_dri2</code>, it supports Linux framebuffer devices as its
window system and supports EGL_MESA_screen_surface extension. As DRI1 drivers
are phasing out, it might eventually be replaced by <code>egl_dri2</code>.</p>
</li>
</ul>
<h2>Packaging</h2>
<p>The ABI between the main library and its drivers are not stable. Nor is
there a plan to stabilize it at the moment. Of the EGL drivers,
<code>egl_gallium</code> has its own hardware drivers and client API modules.
They are considered internal to <code>egl_gallium</code> and there is also no
stable ABI between them. These should be kept in mind when packaging for
distribution.</p>
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
may either be disabled with <code>--disable-gallium-egl</code> or packaged
separately.</p>
<h2>Developers</h2>
<p>The sources of the main library and the classic drivers can be found at
@@ -311,6 +295,7 @@ should as well lock the display before using it.
<ul>
<li>Pass the conformance tests</li>
<li>Reference counting in main library?</li>
<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported. But
which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
<code>libGLESv2.so</code> should an application link to? Bad things may happen

View File

@@ -41,6 +41,7 @@ sometimes be useful for debugging end-user issues.
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)
<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
@@ -49,15 +50,6 @@ 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_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
by extension year.
If this variable is set to year X, only extensions defined on or before year
X will be reported.
This is to work-around a bug in some games where the extension string is
copied into a fixed-size buffer without truncating.
If the extension string is too long, the buffer overrun can cause the game
to crash.
This is a work-around for that.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
</ul>

View File

@@ -12,16 +12,16 @@
<ol>
<li><a href="#unix-x11">Unix / X11</a>
<ul>
<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="#prereq">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">Building with SCons</a>
<li><a href="#scons">SCons</a>
<li><a href="#other">Other</a>
</ol>
<br>
@@ -31,22 +31,8 @@
<H2>1. Unix/X11 Compilation and Installation</H1>
<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>
<a name="prereq">
<h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
<p>
The following are required for DRI-based hardware acceleration with Mesa:
@@ -63,7 +49,7 @@ version 2.4.15 or later
<a name="autoconf">
<h3>1.3 Building with Autoconf</h3>
<h3>1.2 Building with Autoconf</h3>
<p>
Mesa may be <a href="autoconf.html">built using autoconf</a>.
@@ -73,7 +59,7 @@ If that fails the traditional Mesa build system is available.
<a name="traditional">
<h3>1.4 Building with traditional Makefiles</h3>
<h3>1.3 Building with traditional Makefiles</h3>
<p>
The traditional Mesa build system is based on a collection of pre-defined
@@ -140,7 +126,7 @@ Later, if you want to rebuild for a different configuration run
<a name="libs">
<h3>1.5 The libraries</h3>
<h3>1.4 The libraries</h3>
<p>
When compilation has finished, look in the top-level <code>lib/</code>
@@ -199,11 +185,81 @@ 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 built with Gallium support, look in lib/gallium/ for Gallium-based
versions of libGL and device drivers.
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.
</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

@@ -1,204 +0,0 @@
<HTML>
<TITLE>llvmpipe</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<H1>Introduction</H1>
<p>
The Gallium llvmpipe driver is a software rasterizer that uses LLVM to
do runtime code generation.
Shaders, point/line/triangle rasterization and vertex processing are
implemented with LLVM IR which is translated to x86 or x86-64 machine
code.
Also, the driver is multithreaded to take advantage of multiple CPU cores
(up to 8 at this time).
It's the fastest software rasterizer for Mesa.
</p>
<h1>Requirements</h1>
<dl>
<dt>An x86 or amd64 processor. 64-bit mode is preferred.</dt>
<dd>
<p>
Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will
yield the most efficient code. The less features the CPU has the more
likely is that you ran into underperforming, buggy, or incomplete code.
</p>
<p>
See /proc/cpuinfo to know what your CPU supports.
</p>
</dd>
<dt>LLVM. Version 2.8 recommended. 2.6 or later required.</dt>
<dd>
<p>
<b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
</p>
<p>
For Linux, on a recent Debian based distribution do:
</p>
<pre>
aptitude install llvm-dev
</pre>
For a RPM-based distribution do:
</p>
<pre>
yum install llvm-devel
</pre>
<p>
For Windows download pre-built MSVC 9.0 or MinGW binaries from
http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment
variable to the extracted path.
</p>
<p>
For MSVC there are two set of binaries: llvm-x.x-msvc32mt.7z and
llvm-x.x-msvc32mtd.7z .
</p>
<p>
You have to set the LLVM=/path/to/llvm-x.x-msvc32mtd env var when passing
debug=yes to scons, and LLVM=/path/to/llvm-x.x-msvc32mt when building with
debug=no. This is necessary as LLVM builds as static library so the chosen
MS CRT must match.
</p>
</dd>
<dt>scons (optional)</dt>
</dl>
<h1>Building</h1>
To build everything on Linux invoke scons as:
<pre>
scons build=debug libgl-xlib
</pre>
Alternatively, you can build it with GNU make, if you prefer, by invoking it as
<pre>
make linux-llvm
</pre>
but the rest of these instructions assume that scons is used.
For windows is everything the except except the winsys:
<pre>
scons build=debug libgl-gdi
</pre>
<h1>Using</h1>
On Linux, building will create a drop-in alternative for libGL.so into
<pre>
build/foo/gallium/targets/libgl-xlib/libGL.so
</pre>
or
<pre>
lib/gallium/libGL.so
</pre>
To use it set the LD_LIBRARY_PATH environment variable accordingly.
For performance evaluation pass debug=no to scons, and use the corresponding
lib directory without the "-debug" suffix.
On Windows, building will create a drop-in alternative for opengl32.dll. To use
it put it in the same directory as the application. It can also be used by
replacing the native ICD driver, but it's quite an advanced usage, so if you
need to ask, don't even try it.
<h1>Profiling</h1>
To profile llvmpipe you should pass the options
<pre>
scons build=profile <same-as-before>
</pre>
This will ensure that frame pointers are used both in C and JIT functions, and
that no tail call optimizations are done by gcc.
To better profile JIT code you'll need to build LLVM with oprofile integration.
<pre>
./configure \
--prefix=$install_dir \
--enable-optimized \
--disable-profiling \
--enable-targets=host-only \
--with-oprofile
make -C "$build_dir"
make -C "$build_dir" install
find "$install_dir/lib" -iname '*.a' -print0 | xargs -0 strip --strip-debug
</pre>
The you should define
<pre>
export LLVM=/path/to/llvm-2.6-profile
</pre>
and rebuild.
<h1>Unit testing</h1>
<p>
Building will also create several unit tests in
build/linux-???-debug/gallium/drivers/llvmpipe:
</p>
</ul>
<li> lp_test_blend: blending
<li> lp_test_conv: SIMD vector conversion
<li> lp_test_format: pixel unpacking/packing
</ul>
<p>
Some of this tests can output results and benchmarks to a tab-separated-file
for posterior analysis, e.g.:
</p>
<pre>
build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
</pre>
<h1>Development Notes</h1>
<ul>
<li>
When looking to this code by the first time start in lp_state_fs.c, and
then skim through the lp_bld_* functions called in there, and the comments
at the top of the lp_bld_*.c functions.
</li>
<li>
The driver-independent parts of the LLVM / Gallium code are found in
src/gallium/auxiliary/gallivm/. The filenames and function prefixes
need to be renamed from "lp_bld_" to something else though.
</li>
<li>
We use LLVM-C bindings for now. They are not documented, but follow the C++
interfaces very closely, and appear to be complete enough for code
generation. See
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
for a stand-alone example. See the llvm-c/Core.h file for reference.
</li>
</ul>

View File

@@ -11,22 +11,6 @@
<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.9.2.html">Mesa 7.9.2</a> and
<a href="relnotes-7.10.1.html">Mesa 7.10.1</a> are released. These are
stable releases containing bug fixes since the 7.9.1 and 7.10 releases.
</p>
<h2>October 4, 2010</h2>
<p>

View File

@@ -17,7 +17,7 @@ target="_parent"> http://www.khronos.org/opengles/</a>.</p>
<h2>Build the Libraries</h2>
<ol>
<li>Run <code>configure</code> with <code>--enable-gles1 --enable-gles2</code> and enable the Gallium driver for your hardware.</li>
<li>Run <code>configure</code> with <code>--enable-gles-overlay</code> and enable the Gallium driver for your hardware.</li>
<li>Build and install Mesa as usual.</li>
</ol>
@@ -53,6 +53,8 @@ your build. For example,</p>
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libes1gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>y</td><td>n</td></tr>
<tr><td><code>libes2gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>n</td><td>y</td></tr>
</table>
<h3>Dispatch Table</h3>

View File

@@ -26,27 +26,36 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
<h2>Building the library</h2>
<ol>
<li>Run <code>configure</code> with <code>--enable-openvg</code>. If you do
not need OpenGL, you can add <code>--disable-opengl</code> to save the
compilation time.</li>
<li>Build and install Mesa as usual.</li>
<li>Build Mesa3D with Gallium3D. Any build that builds Gallium3D libraries, EGL, and Gallium EGL drivers will suffice</li>
<li>cd src/gallium/state_trackers/vega; make</li>
<li>The last step will build libOpenVG library. You can add the libdir to LD_LIBRARY_PATH or install libOpenVG</li>
</ol>
<h3>Sample build</h3>
A sample build looks as follows:
<pre>
$ ./configure --disable-opengl --enable-openvg
$ ./configure --with-state-trackers=egl,vega --enable-gallium-intel
$ make
$ make install
</pre>
<p>It will install <code>libOpenVG.so</code>, <code>libEGL.so</code>, and one
or more EGL drivers.</p>
<h2>OpenVG Demos</h2>
<p>OpenVG demos can be found in mesa/demos repository.</p>
<p>
To build the OpenVG demos:
</p>
<pre>
cd progs/openvg
make
</pre>
<p>
To run a demo:
</p>
<pre>
cd openvg/demos
./lion
</pre>
</body>
</html>

View File

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

View File

@@ -1,206 +0,0 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.2 Release Notes / April 6, 2011</H1>
<p>
Mesa 7.10.2 is a bug fix release which fixes bugs found since the 7.10 release.
</p>
<p>
Mesa 7.10.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
2f9f444265534a2cfd9a99d1a8291089 MesaLib-7.10.2.tar.gz
f5de82852f1243f42cc004039e10b771 MesaLib-7.10.2.tar.bz2
47836e37bab6fcafe3ac90c9544ba0e9 MesaLib-7.10.2.zip
175120325828f313621cc5bc6c504803 MesaGLUT-7.10.2.tar.gz
8c71d273f5f8d6c5eda4ffc39e0fe03e MesaGLUT-7.10.2.tar.bz2
03036c8efe7b791a90fa0f2c41b43f43 MesaGLUT-7.10.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29172">Bug 29172</a> - Arrandale - Pill Popper Pops Pills</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31159">Bug 31159</a> - shadow problem in 0ad game</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32688">Bug 32688</a> - [RADEON:KMS:R300G] some games have a wireframe or outline visible</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32949">Bug 32949</a> - [glsl wine] Need for Speed renders incorrectly with GLSL enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34203">Bug 34203</a> - [GLSL] fail to call long chains across shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34376">Bug 34376</a> - [GLSL] allowing assignment to unsized array
<ul>
<li>The commit message incorrectly
lists <a href="https://bugs.freedesktop.org/show_bug.cgi?id=34367">bug
34367</a>.</li>
</ul>
</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34370">Bug 34370</a> - [GLSL] "i&lt;5 &amp;&amp; i&lt;4" in for loop fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34374">Bug 34374</a> - [GLSL] fail to redeclare an array using initializer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35073">Bug 35073</a> - [GM45] Alpha test is broken when rendering to FBO with no color attachment</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35483">Bug 35483</a> - util_blit_pixels_writemask: crash in line 322 of src/gallium/auxiliary/util/u_blit.c</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10.1..mesa-7.10.2
</pre>
<p><em>Note:</em> Reverted commits and the reverts are not included in this list.</p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new ontario pci ids</li>
<li>r600g: add some additional ontario pci ids</li>
</ul></p>
<p>Benjamin Franzke (1):
<ul>
<li>st/dri: Fix surfaceless gl using contexts with previous bound surfaces</li>
</ul></p>
<p>Brian Paul (9):
<ul>
<li>docs: pull 7.9.2 release notes into 7.10 branch</li>
<li>docs: update news.html with 7.10.1 and 7.9.2 releases</li>
<li>docs: fill in 7.10.1 release data</li>
<li>docs: add, fix release notes links</li>
<li>docs: update info about Mesa packaging/contents</li>
<li>docs: update prerequisites, remove old demo info</li>
<li>mesa: Guard against null pointer deref in fbo validation</li>
<li>st/mesa: Apply LOD bias from correct texture unit</li>
<li>glsl: silence warning in printf() with a cast</li>
</ul></p>
<p>Chad Versace (1):
<ul>
<li>i965: Fix tex_swizzle when depth mode is GL_RED</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r600: don't close fd on failed load</li>
</ul></p>
<p>Eric Anholt (2):
<ul>
<li>i965: Apply a workaround for the Ironlake "vertex flashing".</li>
<li>i965: Fix alpha testing when there is no color buffer in the FBO.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>st/mesa: Apply LOD from texture object</li>
</ul></p>
<p>Henri Verbeet (1):
<ul>
<li>st/mesa: Validate state before doing blits.</li>
</ul></p>
<p>Ian Romanick (13):
<ul>
<li>docs: Add 7.10.1 md5sums</li>
<li>glsl: Refactor AST-to-HIR code handling variable initializers</li>
<li>glsl: Refactor AST-to-HIR code handling variable redeclarations</li>
<li>glsl: Process redeclarations before initializers</li>
<li>glsl: Function signatures cannot have NULL return type</li>
<li>glsl: Add several function / call related validations</li>
<li>linker: Add imported functions to the linked IR</li>
<li>glsl: Use insert_before for lists instead of open coding it</li>
<li>glsl: Only allow unsized array assignment in an initializer</li>
<li>glcpp: Refresh autogenerated lexer files</li>
<li>docs: Initial bits of 7.10.2 release notes</li>
<li>mesa: set version string to 7.10.2</li>
<li>mesa: Remove nonexistant files from _FILES lists</li>
</ul></p>
<p>Jerome Glisse (1):
<ul>
<li>r600g: move user fence into base radeon structure</li>
</ul></p>
<p>José Fonseca (2):
<ul>
<li>mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*).</li>
<li>mesa: More glGet* fixes.</li>
</ul></p>
<p>Kenneth Graunke (4):
<ul>
<li>glcpp: Rework lexer to use a SKIP state rather than REJECT.</li>
<li>glcpp: Remove trailing contexts from #if rules.</li>
<li>i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.</li>
<li>glsl: Accept precision qualifiers on sampler types, but only in ES.</li>
</ul></p>
<p>Marek Olšák (15):
<ul>
<li>st/mesa: fix crash when DrawBuffer-&gt;_ColorDrawBuffers[0] is NULL</li>
<li>st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails</li>
<li>r300/compiler: fix the saturate modifier when applied to TEX instructions</li>
<li>r300/compiler: fix translating the src negate bits in pair_translate</li>
<li>r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)</li>
<li>r300/compiler: TEX instructions don't support negation on source arguments</li>
<li>r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500</li>
<li>r300/compiler: saturate Z before the shadow comparison</li>
<li>r300/compiler: fix equal and notequal shadow compare functions</li>
<li>r300/compiler: remove unused variables</li>
<li>st/mesa: fix crash when using both user and vbo buffers with the same stride</li>
<li>r300g: fix alpha-test with no colorbuffer</li>
<li>r300g: tell the GLSL compiler to lower the continue opcode</li>
<li>r300/compiler: propagate SaturateMode down to the result of shadow comparison</li>
<li>r300/compiler: apply the texture swizzle to shadow pass and fail values too</li>
</ul></p>
<p>Michel Dänzer (1):
<ul>
<li>Use proper source row stride when getting depth/stencil texels.</li>
</ul></p>
<p>Tom Stellard (4):
<ul>
<li>r300/compiler: Use a 4-bit writemask in pair instructions</li>
<li>prog_optimize: Fix reallocating registers for shaders with loops</li>
<li>r300/compiler: Fix vertex shader MAD instructions with constant swizzles</li>
<li>r300/compiler: Don't try to convert RGB to Alpha in full instructions</li>
</ul></p>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +0,0 @@
<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.11 Release Notes / (release date TBD)</H1>
<p>
Mesa 7.11 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 7.11.1.
</p>
<p>
Mesa 7.11 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>
<ul>
<li>GL_ARB_draw_instanced extension (gallium drivers, swrast)
<li>GL_ARB_instanced_arrays extension (gallium drivers)
<li>GL_ARB_texture_compression_rgtc (gallium r600, swrast)
<li>GL_ARB_draw_buffers_blend (gallium)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
<li>GL_ARB_sampler_objects (gallium drivers)
</ul>
<h2>Bug fixes</h2>
<ul>
</ul>
<h2>Changes</h2>
<ul>
<li>The Windows MSVC project files have been removed. They haven't been maintained
in quite a while. Building with SCons is an alterantive.
<li>Removed GL_SGI_texture_color_table support from swrast driver - the only
driver that implemented it.
</ul>
</body>
</html>

View File

@@ -10,7 +10,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.2 Release Notes / TBD</H1>
<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.

View File

@@ -13,10 +13,6 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>

1
doxygen/.gitignore vendored
View File

@@ -6,7 +6,6 @@ core
core_subset
gallium
glapi
glsl
main
math
math_subset

View File

@@ -11,7 +11,6 @@ FULL = \
math.doxy \
vbo.doxy \
glapi.doxy \
glsl.doxy \
shader.doxy \
swrast.doxy \
swrast_setup.doxy \

View File

@@ -1,39 +0,0 @@
# Doxyfile 0.1
@INCLUDE = common.doxy
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa GLSL module"
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/glsl/
RECURSIVE = NO
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
../src/glsl/glsl_lexer.h \
../src/glsl/glsl_parser.cpp \
../src/glsl/glsl_parser.h
EXCLUDE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
HTML_OUTPUT = glsl
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = glsl.tag

View File

@@ -7,7 +7,6 @@
<div class="qindex">
<a class="qindex" href="../main/index.html">core</a> |
<a class="qindex" href="../glapi/index.html">glapi</a> |
<a class="qindex" href="../glsl/index.html">glsl</a> |
<a class="qindex" href="../vbo/index.html">vbo</a> |
<a class="qindex" href="../math/index.html">math</a> |
<a class="qindex" href="../shader/index.html">shader</a> |

View File

@@ -143,20 +143,6 @@ typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESA) (EGLDisplay dpy, con
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESA) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
struct wl_display;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
#else
typedef EGLBoolean (EGLAPIENTRY PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRY PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1

View File

@@ -78,12 +78,6 @@ typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#elif defined(WL_EGL_PLATFORM)
typedef struct wl_egl_display *EGLNativeDisplayType;
typedef struct wl_egl_pixmap *EGLNativePixmapType;
typedef struct wl_egl_window *EGLNativeWindowType;
#elif defined(__unix__) || defined(__unix)
#ifdef MESA_EGL_NO_X11_HEADERS

View File

@@ -655,8 +655,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_TEXTURE_ENV_COLOR 0x2201
#define GL_TEXTURE_GEN_S 0x0C60
#define GL_TEXTURE_GEN_T 0x0C61
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_Q 0x0C63
#define GL_TEXTURE_GEN_MODE 0x2500
#define GL_TEXTURE_BORDER_COLOR 0x1004
#define GL_TEXTURE_WIDTH 0x1000
@@ -687,6 +685,8 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_T 0x2001
#define GL_R 0x2002
#define GL_Q 0x2003
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_Q 0x0C63
/* Utility */
#define GL_VENDOR 0x1F00

View File

@@ -31,7 +31,6 @@
#define glAccum MANGLE(Accum)
#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
#define glActiveShaderProgram MANGLE(ActiveShaderProgram)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glActiveTexture MANGLE(ActiveTexture)
@@ -57,7 +56,6 @@
#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)
@@ -77,27 +75,22 @@
#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)
@@ -119,22 +112,18 @@
#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)
@@ -164,7 +153,6 @@
#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)
@@ -227,10 +215,6 @@
#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)
@@ -252,7 +236,6 @@
#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)
@@ -327,18 +310,10 @@
#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)
@@ -351,25 +326,20 @@
#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)
@@ -378,10 +348,7 @@
#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)
@@ -396,7 +363,6 @@
#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)
@@ -408,7 +374,6 @@
#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)
@@ -421,9 +386,7 @@
#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)
@@ -451,7 +414,6 @@
#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)
@@ -485,7 +447,6 @@
#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)
@@ -537,6 +498,7 @@
#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)
@@ -559,30 +521,23 @@
#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)
@@ -634,21 +589,16 @@
#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)
@@ -658,7 +608,6 @@
#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)
@@ -729,26 +678,6 @@
#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)
@@ -771,7 +700,6 @@
#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)
@@ -788,42 +716,28 @@
#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)
@@ -856,17 +770,14 @@
#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)
@@ -892,10 +803,6 @@
#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)
@@ -957,25 +864,20 @@
#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)
@@ -1013,8 +915,6 @@
#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)
@@ -1028,7 +928,6 @@
#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)
@@ -1064,10 +963,8 @@
#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)
@@ -1151,14 +1048,6 @@
#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)
@@ -1191,7 +1080,6 @@
#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)
@@ -1199,6 +1087,8 @@
#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)
@@ -1214,7 +1104,6 @@
#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)
@@ -1232,8 +1121,6 @@
#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)
@@ -1253,9 +1140,6 @@
#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)
@@ -1307,7 +1191,6 @@
#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)
@@ -1348,123 +1231,39 @@
#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)
@@ -1475,7 +1274,6 @@
#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)
@@ -1502,7 +1300,6 @@
#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)
@@ -1513,7 +1310,6 @@
#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)
@@ -1549,7 +1345,6 @@
#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)
@@ -1562,17 +1357,8 @@
#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)
@@ -1609,8 +1395,6 @@
#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)
@@ -1624,7 +1408,6 @@
#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)
@@ -1726,14 +1509,6 @@
#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)
@@ -1794,108 +1569,73 @@
#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)
@@ -1906,11 +1646,9 @@
#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)
@@ -1921,16 +1659,6 @@
#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)
@@ -1964,7 +1692,6 @@
#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)
@@ -2073,7 +1800,6 @@
#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)
@@ -2118,49 +1844,6 @@
#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)
@@ -2185,12 +1868,6 @@
#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)
@@ -2236,9 +1913,6 @@
#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
#define glViewportArrayv MANGLE(ViewportArrayv)
#define glViewportIndexedf MANGLE(ViewportIndexedf)
#define glViewportIndexedfv MANGLE(ViewportIndexedfv)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)

View File

@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2010-12-09 02:15:08 -0800 (Thu, 09 Dec 2010) $ */
/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 67
#define GL_GLEXT_VERSION 64
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -4840,7 +4840,7 @@ extern "C" {
#endif
#ifndef GL_AMD_seamless_cubemap_per_texture
/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */
#endif
#ifndef GL_AMD_conservative_depth
@@ -4925,8 +4925,6 @@ extern "C" {
#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
#endif
@@ -5021,17 +5019,6 @@ extern "C" {
#ifndef GL_AMD_transform_feedback3_lines_triangles
#endif
#ifndef GL_AMD_depth_clamp_separate
#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
#endif
#ifndef GL_EXT_texture_sRGB_decode
#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
#define GL_DECODE_EXT 0x8A49
#define GL_SKIP_DECODE_EXT 0x8A4A
#endif
/*************************************************************/
@@ -8778,8 +8765,8 @@ GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdoubl
GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v);
GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v);
GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -8843,8 +8830,8 @@ typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint in
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -11033,14 +11020,6 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
#define GL_AMD_transform_feedback3_lines_triangles 1
#endif
#ifndef GL_AMD_depth_clamp_separate
#define GL_AMD_depth_clamp_separate 1
#endif
#ifndef GL_EXT_texture_sRGB_decode
#define GL_EXT_texture_sRGB_decode 1
#endif
#ifdef __cplusplus
}

View File

@@ -251,15 +251,6 @@ struct __DRItexBufferExtensionRec {
GLint target,
GLint format,
__DRIdrawable *pDraw);
/**
* Method to release texture buffer in case some special platform
* need this.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
__DRIdrawable *pDraw);
};
/**
@@ -499,7 +490,6 @@ struct __DRIuseInvalidateExtensionRec {
#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
#define __DRI_ATTRIB_YINVERTED 47
#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
/* __DRI_ATTRIB_RENDER_TYPE */
#define __DRI_ATTRIB_RGBA_BIT 0x01
@@ -657,7 +647,7 @@ struct __DRIlegacyExtensionRec {
* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
#define __DRI_SWRAST_VERSION 2
#define __DRI_SWRAST_VERSION 1
struct __DRIswrastExtensionRec {
__DRIextension base;
@@ -670,13 +660,6 @@ struct __DRIswrastExtensionRec {
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
/* Since version 2 */
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
};
/**
@@ -786,14 +769,6 @@ struct __DRIdri2ExtensionRec {
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
__DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
unsigned int attachment,
unsigned int format,
int width,
int height);
void (*releaseBuffer)(__DRIscreen *screen,
__DRIbuffer *buffer);
};

View File

@@ -1,8 +1,8 @@
/* $Revision: 9203 $ on $Date:: 2009-10-07 02:21:52 -0700 #$ */
/* $Revision: 6822 $ on $Date:: 2008-10-30 05:14:19 -0400 #$ */
/*------------------------------------------------------------------------
*
* OpenVG 1.1 Reference Implementation
* OpenVG 1.0.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
@@ -28,7 +28,7 @@
*
*//**
* \file
* \brief OpenVG 1.1 API.
* \brief OpenVG 1.0.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _OPENVG_H
@@ -42,7 +42,6 @@ extern "C" {
#define OPENVG_VERSION_1_0 1
#define OPENVG_VERSION_1_0_1 1
#define OPENVG_VERSION_1_1 2
#ifndef VG_MAXSHORT
#define VG_MAXSHORT 0x7FFF
@@ -56,12 +55,10 @@ extern "C" {
#define VG_MAX_ENUM 0x7FFFFFFF
#endif
typedef VGuint VGHandle;
typedef long VGHandle;
typedef VGHandle VGPath;
typedef VGHandle VGImage;
typedef VGHandle VGMaskLayer;
typedef VGHandle VGFont;
typedef VGHandle VGPaint;
#define VG_INVALID_HANDLE ((VGHandle)0)
@@ -99,10 +96,6 @@ typedef enum {
/* Scissoring rectangles */
VG_SCISSOR_RECTS = 0x1106,
/* Color Transformation */
VG_COLOR_TRANSFORM = 0x1170,
VG_COLOR_TRANSFORM_VALUES = 0x1171,
/* Stroke parameters */
VG_STROKE_LINE_WIDTH = 0x1110,
VG_STROKE_CAP_STYLE = 0x1111,
@@ -118,9 +111,6 @@ typedef enum {
/* Color for vgClear */
VG_CLEAR_COLOR = 0x1121,
/* Glyph origin */
VG_GLYPH_ORIGIN = 0x1122,
/* Enable/disable alpha masking and scissoring */
VG_MASKING = 0x1130,
VG_SCISSORING = 0x1131,
@@ -175,7 +165,6 @@ typedef enum {
VG_MATRIX_IMAGE_USER_TO_SURFACE = 0x1401,
VG_MATRIX_FILL_PAINT_TO_USER = 0x1402,
VG_MATRIX_STROKE_PAINT_TO_USER = 0x1403,
VG_MATRIX_GLYPH_USER_TO_SURFACE = 0x1404,
VG_MATRIX_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGMatrixMode;
@@ -376,8 +365,6 @@ typedef enum {
VG_lL_8 = 10,
VG_A_8 = 11,
VG_BW_1 = 12,
VG_A_1 = 13,
VG_A_4 = 14,
/* {A,X}RGB channel ordering */
VG_sXRGB_8888 = 0 | (1 << 6),
@@ -461,12 +448,6 @@ typedef enum {
VG_BLEND_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGBlendMode;
typedef enum {
VG_FONT_NUM_GLYPHS = 0x2F00,
VG_FONT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGFontParamType;
typedef enum {
VG_IMAGE_FORMAT_QUERY = 0x2100,
VG_PATH_DATATYPE_QUERY = 0x2101,
@@ -560,22 +541,8 @@ VG_API_CALL void VG_API_ENTRY vgShear(VGfloat shx, VGfloat shy) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgRotate(VGfloat angle) VG_API_EXIT;
/* Masking and Clearing */
VG_API_CALL void VG_API_ENTRY vgMask(VGHandle mask, VGMaskOperation operation,
VGint x, VGint y,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgRenderToMask(VGPath path,
VGbitfield paintModes,
VGMaskOperation operation) VG_API_EXIT;
VG_API_CALL VGMaskLayer VG_API_ENTRY vgCreateMaskLayer(VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyMaskLayer(VGMaskLayer maskLayer) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgFillMaskLayer(VGMaskLayer maskLayer,
VGint x, VGint y,
VGint width, VGint height,
VGfloat value) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgCopyMask(VGMaskLayer maskLayer,
VGint dx, VGint dy,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgMask(VGImage mask, VGMaskOperation operation,
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClear(VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
/* Paths */
@@ -669,33 +636,6 @@ VG_API_CALL void VG_API_ENTRY vgCopyPixels(VGint dx, VGint dy,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
/* Text */
VG_API_CALL VGFont VG_API_ENTRY vgCreateFont(VGint glyphCapacityHint) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyFont(VGFont font) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetGlyphToPath(VGFont font,
VGuint glyphIndex,
VGPath path,
VGboolean isHinted,
const VGfloat glyphOrigin [2],
const VGfloat escapement[2]) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetGlyphToImage(VGFont font,
VGuint glyphIndex,
VGImage image,
const VGfloat glyphOrigin [2],
const VGfloat escapement[2]) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClearGlyph(VGFont font,VGuint glyphIndex) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font,
VGuint glyphIndex,
VGbitfield paintModes,
VGboolean allowAutoHinting) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDrawGlyphs(VGFont font,
VGint glyphCount,
const VGuint *glyphIndices,
const VGfloat *adjustments_x,
const VGfloat *adjustments_y,
VGbitfield paintModes,
VGboolean allowAutoHinting) VG_API_EXIT;
/* Image Filters */
VG_API_CALL void VG_API_ENTRY vgColorMatrix(VGImage dst, VGImage src,
const VGfloat * matrix) VG_API_EXIT;

View File

@@ -1,233 +1,233 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
/*------------------------------------------------------------------------
*
* VG extensions Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG extensions
*//*-------------------------------------------------------------------*/
#ifndef _VGEXT_H
#define _VGEXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#include <VG/vgu.h>
#ifndef VG_API_ENTRYP
# define VG_API_ENTRYP VG_API_ENTRY*
#endif
#ifndef VGU_API_ENTRYP
# define VGU_API_ENTRYP VGU_API_ENTRY*
#endif
/*-------------------------------------------------------------------------------
* KHR extensions
*------------------------------------------------------------------------------*/
typedef enum {
#ifndef VG_KHR_iterative_average_blur
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
#endif
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeKHR;
#ifndef VG_KHR_EGL_image
#define VG_KHR_EGL_image 1
/* VGEGLImageKHR is an opaque handle to an EGLImage */
typedef void* VGeglImageKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
#endif
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
#endif
#ifndef VG_KHR_iterative_average_blur
#define VG_KHR_iterative_average_blur 1
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
#ifndef VG_KHR_advanced_blending
#define VG_KHR_advanced_blending 1
typedef enum {
VG_BLEND_OVERLAY_KHR = 0x2010,
VG_BLEND_HARDLIGHT_KHR = 0x2011,
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
VG_BLEND_COLORDODGE_KHR = 0x2014,
VG_BLEND_COLORBURN_KHR = 0x2015,
VG_BLEND_DIFFERENCE_KHR = 0x2016,
VG_BLEND_SUBTRACT_KHR = 0x2017,
VG_BLEND_INVERT_KHR = 0x2018,
VG_BLEND_EXCLUSION_KHR = 0x2019,
VG_BLEND_LINEARDODGE_KHR = 0x201a,
VG_BLEND_LINEARBURN_KHR = 0x201b,
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
VG_BLEND_PINLIGHT_KHR = 0x201e,
VG_BLEND_HARDMIX_KHR = 0x201f,
VG_BLEND_CLEAR_KHR = 0x2020,
VG_BLEND_DST_KHR = 0x2021,
VG_BLEND_SRC_OUT_KHR = 0x2022,
VG_BLEND_DST_OUT_KHR = 0x2023,
VG_BLEND_SRC_ATOP_KHR = 0x2024,
VG_BLEND_DST_ATOP_KHR = 0x2025,
VG_BLEND_XOR_KHR = 0x2026,
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
} VGBlendModeKHR;
#endif
#ifndef VG_KHR_parametric_filter
#define VG_KHR_parametric_filter 1
typedef enum {
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
VG_PF_OUTER_FLAG_KHR = (1 << 2),
VG_PF_INNER_FLAG_KHR = (1 << 3),
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGPfTypeKHR;
typedef enum {
VGU_IMAGE_IN_USE_ERROR = 0xF010,
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCodeKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
/*-------------------------------------------------------------------------------
* NDS extensions
*------------------------------------------------------------------------------*/
#ifndef VG_NDS_paint_generation
#define VG_NDS_paint_generation 1
typedef enum {
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
VG_COLOR_MATRIX_NDS = 0x1A11,
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPaintParamTypeNds;
typedef enum {
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGImageModeNds;
#endif
#ifndef VG_NDS_projective_geometry
#define VG_NDS_projective_geometry 1
typedef enum {
VG_CLIP_MODE_NDS = 0x1180,
VG_CLIP_LINES_NDS = 0x1181,
VG_MAX_CLIP_LINES_NDS = 0x1182,
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeNds;
typedef enum {
VG_CLIPMODE_NONE_NDS = 0x3000,
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
VG_CLIPMODE_CULL_NDS = 0x3003,
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGClipModeNds;
typedef enum {
VG_RQUAD_TO_NDS = ( 13 << 1 ),
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathSegmentNds;
typedef enum {
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathCommandNds;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGEXT_H */
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VG extensions Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG extensions
*//*-------------------------------------------------------------------*/
#ifndef _VGEXT_H
#define _VGEXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#include <VG/vgu.h>
#ifndef VG_API_ENTRYP
# define VG_API_ENTRYP VG_API_ENTRY*
#endif
#ifndef VGU_API_ENTRYP
# define VGU_API_ENTRYP VGU_API_ENTRY*
#endif
/*-------------------------------------------------------------------------------
* KHR extensions
*------------------------------------------------------------------------------*/
typedef enum {
#ifndef VG_KHR_iterative_average_blur
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
#endif
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeKHR;
#ifndef VG_KHR_EGL_image
#define VG_KHR_EGL_image 1
/* VGEGLImageKHR is an opaque handle to an EGLImage */
typedef void* VGeglImageKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
#endif
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
#endif
#ifndef VG_KHR_iterative_average_blur
#define VG_KHR_iterative_average_blur 1
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
#ifndef VG_KHR_advanced_blending
#define VG_KHR_advanced_blending 1
typedef enum {
VG_BLEND_OVERLAY_KHR = 0x2010,
VG_BLEND_HARDLIGHT_KHR = 0x2011,
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
VG_BLEND_COLORDODGE_KHR = 0x2014,
VG_BLEND_COLORBURN_KHR = 0x2015,
VG_BLEND_DIFFERENCE_KHR = 0x2016,
VG_BLEND_SUBTRACT_KHR = 0x2017,
VG_BLEND_INVERT_KHR = 0x2018,
VG_BLEND_EXCLUSION_KHR = 0x2019,
VG_BLEND_LINEARDODGE_KHR = 0x201a,
VG_BLEND_LINEARBURN_KHR = 0x201b,
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
VG_BLEND_PINLIGHT_KHR = 0x201e,
VG_BLEND_HARDMIX_KHR = 0x201f,
VG_BLEND_CLEAR_KHR = 0x2020,
VG_BLEND_DST_KHR = 0x2021,
VG_BLEND_SRC_OUT_KHR = 0x2022,
VG_BLEND_DST_OUT_KHR = 0x2023,
VG_BLEND_SRC_ATOP_KHR = 0x2024,
VG_BLEND_DST_ATOP_KHR = 0x2025,
VG_BLEND_XOR_KHR = 0x2026,
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
} VGBlendModeKHR;
#endif
#ifndef VG_KHR_parametric_filter
#define VG_KHR_parametric_filter 1
typedef enum {
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
VG_PF_OUTER_FLAG_KHR = (1 << 2),
VG_PF_INNER_FLAG_KHR = (1 << 3),
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGPfTypeKHR;
typedef enum {
VGU_IMAGE_IN_USE_ERROR = 0xF010,
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCodeKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
/*-------------------------------------------------------------------------------
* NDS extensions
*------------------------------------------------------------------------------*/
#ifndef VG_NDS_paint_generation
#define VG_NDS_paint_generation 1
typedef enum {
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
VG_COLOR_MATRIX_NDS = 0x1A11,
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPaintParamTypeNds;
typedef enum {
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGImageModeNds;
#endif
#ifndef VG_NDS_projective_geometry
#define VG_NDS_projective_geometry 1
typedef enum {
VG_CLIP_MODE_NDS = 0x1180,
VG_CLIP_LINES_NDS = 0x1181,
VG_MAX_CLIP_LINES_NDS = 0x1182,
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeNds;
typedef enum {
VG_CLIPMODE_NONE_NDS = 0x3000,
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
VG_CLIPMODE_CULL_NDS = 0x3003,
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGClipModeNds;
typedef enum {
VG_RQUAD_TO_NDS = ( 13 << 1 ),
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathSegmentNds;
typedef enum {
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathCommandNds;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGEXT_H */

View File

@@ -1,92 +1,92 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
/*------------------------------------------------------------------------
*
* VG platform specific header Reference Implementation
* ----------------------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG platform specific header
*//*-------------------------------------------------------------------*/
#ifndef _VGPLATFORM_H
#define _VGPLATFORM_H
#include <KHR/khrplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef VG_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VG_API_CALL
#else
# define VG_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VG_API_CALL */
#ifndef VGU_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VGU_API_CALL
#else
# define VGU_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VGU_API_CALL */
#ifndef VG_API_ENTRY
#define VG_API_ENTRY
#endif
#ifndef VG_API_EXIT
#define VG_API_EXIT
#endif
#ifndef VGU_API_ENTRY
#define VGU_API_ENTRY
#endif
#ifndef VGU_API_EXIT
#define VGU_API_EXIT
#endif
typedef float VGfloat;
typedef signed char VGbyte;
typedef unsigned char VGubyte;
typedef signed short VGshort;
typedef signed int VGint;
typedef unsigned int VGuint;
typedef unsigned int VGbitfield;
#ifndef VG_VGEXT_PROTOTYPES
#define VG_VGEXT_PROTOTYPES
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGPLATFORM_H */
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VG platform specific header Reference Implementation
* ----------------------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG platform specific header
*//*-------------------------------------------------------------------*/
#ifndef _VGPLATFORM_H
#define _VGPLATFORM_H
#include <KHR/khrplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef VG_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VG_API_CALL
#else
# define VG_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VG_API_CALL */
#ifndef VGU_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VGU_API_CALL
#else
# define VGU_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VGU_API_CALL */
#ifndef VG_API_ENTRY
#define VG_API_ENTRY
#endif
#ifndef VG_API_EXIT
#define VG_API_EXIT
#endif
#ifndef VGU_API_ENTRY
#define VGU_API_ENTRY
#endif
#ifndef VGU_API_EXIT
#define VGU_API_EXIT
#endif
typedef float VGfloat;
typedef signed char VGbyte;
typedef unsigned char VGubyte;
typedef signed short VGshort;
typedef signed int VGint;
typedef unsigned int VGuint;
typedef unsigned int VGbitfield;
#ifndef VG_VGEXT_PROTOTYPES
#define VG_VGEXT_PROTOTYPES
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGPLATFORM_H */

View File

@@ -1,131 +1,130 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
/*------------------------------------------------------------------------
*
* VGU 1.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VGU 1.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _VGU_H
#define _VGU_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#define VGU_VERSION_1_0 1
#define VGU_VERSION_1_1 2
#ifndef VGU_API_CALL
# error VGU_API_CALL must be defined
#endif
#ifndef VGU_API_ENTRY
# error VGU_API_ENTRY must be defined
#endif
#ifndef VGU_API_EXIT
# error VGU_API_EXIT must be defined
#endif
typedef enum {
VGU_NO_ERROR = 0,
VGU_BAD_HANDLE_ERROR = 0xF000,
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
VGU_PATH_CAPABILITY_ERROR = 0xF003,
VGU_BAD_WARP_ERROR = 0xF004,
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCode;
typedef enum {
VGU_ARC_OPEN = 0xF100,
VGU_ARC_CHORD = 0xF101,
VGU_ARC_PIE = 0xF102,
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGUArcType;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
VGfloat x0, VGfloat y0,
VGfloat x1, VGfloat y1) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
const VGfloat * points, VGint count,
VGboolean closed) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
VGfloat cx, VGfloat cy,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat startAngle, VGfloat angleExtent,
VGUArcType arcType) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* #ifndef _VGU_H */
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VGU 1.0.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VGU 1.0.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _VGU_H
#define _VGU_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#define VGU_VERSION_1_0 1
#ifndef VGU_API_CALL
# error VGU_API_CALL must be defined
#endif
#ifndef VGU_API_ENTRY
# error VGU_API_ENTRY must be defined
#endif
#ifndef VGU_API_EXIT
# error VGU_API_EXIT must be defined
#endif
typedef enum {
VGU_NO_ERROR = 0,
VGU_BAD_HANDLE_ERROR = 0xF000,
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
VGU_PATH_CAPABILITY_ERROR = 0xF003,
VGU_BAD_WARP_ERROR = 0xF004,
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCode;
typedef enum {
VGU_ARC_OPEN = 0xF100,
VGU_ARC_CHORD = 0xF101,
VGU_ARC_PIE = 0xF102,
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGUArcType;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
VGfloat x0, VGfloat y0,
VGfloat x1, VGfloat y1) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
const VGfloat * points, VGint count,
VGboolean closed) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
VGfloat cx, VGfloat cy,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat startAngle, VGfloat angleExtent,
VGUArcType arcType) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* #ifndef _VGU_H */

View File

@@ -54,13 +54,11 @@ prefixes32 = SCons.Util.Split("""
i586-mingw32msvc-
i686-mingw32msvc-
i686-pc-mingw32-
i686-w64-mingw32-
""")
prefixes64 = SCons.Util.Split("""
amd64-mingw32-
amd64-mingw32msvc-
amd64-pc-mingw32-
x86_64-w64-mingw32-
""")
def find(env):
@@ -194,8 +192,5 @@ def generate(env):
env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup'])
#env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at'])
# Avoid depending on gcc runtime DLLs
env.AppendUnique(LINKFLAGS = ['-static-libgcc'])
def exists(env):
return find(env)

View File

@@ -56,8 +56,6 @@ def quietCommandLines(env):
env['SHLINKCOMSTR'] = " Linking $TARGET ..."
env['LDMODULECOMSTR'] = " Linking $TARGET ..."
env['SWIGCOMSTR'] = " Generating $TARGET ..."
env['LEXCOMSTR'] = " Generating $TARGET ..."
env['YACCCOMSTR'] = " Generating $TARGET ..."
env['CODEGENCOMSTR'] = " Generating $TARGET ..."

217
scons/gallium.py Executable file → Normal file
View File

@@ -35,7 +35,6 @@ import os
import os.path
import re
import subprocess
import platform as _platform
import SCons.Action
import SCons.Builder
@@ -50,35 +49,30 @@ def symlink(target, source, env):
os.symlink(os.path.basename(source), target)
def install(env, source, subdir):
target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'], subdir)
return env.Install(target_dir, source)
target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], subdir)
env.Install(target_dir, source)
def install_program(env, source):
return install(env, source, 'bin')
install(env, source, 'bin')
def install_shared_library(env, sources, version = ()):
targets = []
install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'])
install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'])
version = tuple(map(str, version))
if env['SHLIBSUFFIX'] == '.dll':
dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX')
targets += install(env, dlls, 'bin')
install(env, dlls, 'bin')
libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX')
targets += install(env, libs, 'lib')
install(env, libs, 'lib')
else:
for source in sources:
target_dir = os.path.join(install_dir, 'lib')
target_name = '.'.join((str(source),) + version)
last = env.InstallAs(os.path.join(target_dir, target_name), source)
targets += last
while len(version):
version = version[:-1]
target_name = '.'.join((str(source),) + version)
action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE")
last = env.Command(os.path.join(target_dir, target_name), last, action)
targets += last
return targets
def createInstallMethods(env):
env.AddMethod(install_program, 'InstallProgram')
@@ -104,48 +98,9 @@ def num_jobs():
return 1
def pkg_config_modules(env, name, modules):
'''Simple wrapper for pkg-config.'''
env[name] = False
if env['platform'] == 'windows':
return
if not env.Detect('pkg-config'):
return
if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
return
# Put -I and -L flags directly into the environment, as these don't affect
# the compilation of targets that do not use them
try:
env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules))
except OSError:
return
# Other flags may affect the compilation of unrelated targets, so store
# them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
try:
flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules))
except OSError:
return
prefix = name.upper() + '_'
for flag_name, flag_value in flags.iteritems():
env[prefix + flag_name] = flag_value
env[name] = True
def generate(env):
"""Common environment generation code"""
# Tell tools which machine to compile for
env['TARGET_ARCH'] = env['machine']
env['MSVS_ARCH'] = env['machine']
# Toolchain
platform = env['platform']
if env['toolchain'] == 'default':
@@ -155,36 +110,27 @@ def generate(env):
env['toolchain'] = 'wcesdk'
env.Tool(env['toolchain'])
# Allow override compiler and specify additional flags from environment
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
# Update CCVERSION to match
pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
stdin = 'devnull',
stderr = 'devnull',
stdout = subprocess.PIPE)
if pipe.wait() == 0:
line = pipe.stdout.readline()
match = re.search(r'[0-9]+(\.[0-9]+)+', line)
if match:
env['CCVERSION'] = match.group(0)
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
if env['platform'] == 'embedded':
# Allow overriding compiler from environment
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
# Update CCVERSION to match
pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
stdin = 'devnull',
stderr = 'devnull',
stdout = subprocess.PIPE)
if pipe.wait() == 0:
line = pipe.stdout.readline()
match = re.search(r'[0-9]+(\.[0-9]+)+', line)
if match:
env['CCVERSION'] = match.group(0)
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
# MSVC x64 support is broken in earlier versions of scons
env.EnsurePythonVersion(2, 0)
# shortcuts
debug = env['debug']
machine = env['machine']
platform = env['platform']
x86 = env['machine'] == 'x86'
@@ -192,69 +138,20 @@ def generate(env):
gcc = env['gcc']
msvc = env['msvc']
# Determine whether we are cross compiling; in particular, whether we need
# to compile code generators with a different compiler as the target code.
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
host_machine = {
'x86': 'x86',
'i386': 'x86',
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}.get(host_machine, 'generic')
env['crosscompile'] = platform != host_platform
if machine == 'x86_64' and host_machine != 'x86_64':
env['crosscompile'] = True
env['hostonly'] = False
# Backwards compatability with the debug= profile= options
if env['build'] == 'debug':
if not env['debug']:
print 'scons: warning: debug option is deprecated and will be removed eventually; use instead'
print
print ' scons build=release'
print
env['build'] = 'release'
if env['profile']:
print 'scons: warning: profile option is deprecated and will be removed eventually; use instead'
print
print ' scons build=profile'
print
env['build'] = 'profile'
if False:
# Enforce SConscripts to use the new build variable
env.popitem('debug')
env.popitem('profile')
else:
# Backwards portability with older sconscripts
if env['build'] in ('debug', 'checked'):
env['debug'] = True
env['profile'] = False
if env['build'] == 'profile':
env['debug'] = False
env['profile'] = True
if env['build'] == 'release':
env['debug'] = False
env['profile'] = False
# Put build output in a separate dir, which depends on the current
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
build_topdir = 'build'
build_subdir = env['platform']
if env['machine'] != 'generic':
build_subdir += '-' + env['machine']
if env['build'] != 'release':
build_subdir += '-' + env['build']
if env['debug']:
build_subdir += "-debug"
if env['profile']:
build_subdir += "-profile"
build_dir = os.path.join(build_topdir, build_subdir)
# Place the .sconsign file in the build dir too, to avoid issues with
# different scons versions building the same source file
env['build_dir'] = build_dir
env['build'] = build_dir
env.SConsignFile(os.path.join(build_dir, '.sconsign'))
if 'SCONS_CACHE_DIR' in os.environ:
print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],)
@@ -266,16 +163,13 @@ def generate(env):
if env.GetOption('num_jobs') <= 1:
env.SetOption('num_jobs', num_jobs())
env.Decider('MD5-timestamp')
env.SetOption('max_drift', 60)
# C preprocessor options
cppdefines = []
if env['build'] in ('debug', 'checked'):
if debug:
cppdefines += ['DEBUG']
else:
cppdefines += ['NDEBUG']
if env['build'] == 'profile':
if env['profile']:
cppdefines += ['PROFILE']
if platform == 'windows':
cppdefines += [
@@ -296,7 +190,7 @@ def generate(env):
'_SCL_SECURE_NO_WARNINGS',
'_SCL_SECURE_NO_DEPRECATE',
]
if env['build'] in ('debug', 'checked'):
if debug:
cppdefines += ['_DEBUG']
if env['toolchain'] == 'winddk':
# Mimic WINDDK's builtin flags. See also:
@@ -323,7 +217,7 @@ def generate(env):
('__BUILDMACHINE__', 'WinDDK'),
('FPO', '0'),
]
if env['build'] in ('debug', 'checked'):
if debug:
cppdefines += [('DBG', 1)]
if platform == 'wince':
cppdefines += [
@@ -359,16 +253,15 @@ def generate(env):
ccflags = [] # C & C++
if gcc:
ccversion = env['CCVERSION']
if env['build'] == 'debug':
ccflags += ['-O0']
if debug:
ccflags += ['-O0', '-g3']
elif ccversion.startswith('4.2.'):
# gcc 4.2.x optimizer is broken
print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations"
ccflags += ['-O0']
ccflags += ['-O0', '-g3']
else:
ccflags += ['-O3']
ccflags += ['-g3']
if env['build'] in ('checked', 'profile'):
ccflags += ['-O3', '-g3']
if env['profile']:
# See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
ccflags += [
'-fno-omit-frame-pointer',
@@ -379,15 +272,12 @@ def generate(env):
'-m32',
#'-march=pentium4',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
and (platform != 'windows' or env['build'] == 'debug' or True):
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
# NOTE: We need to ensure stack is realigned given that we
# produce shared objects, and have no control over the stack
# alignment policy of the application. Therefore we need
# -mstackrealign ore -mincoming-stack-boundary=2.
#
# XXX: -O and -mstackrealign causes stack corruption on MinGW
#
# XXX: We could have SSE without -mstackrealign if we always used
# __attribute__((force_align_arg_pointer)), but that's not
# always the case.
@@ -430,24 +320,18 @@ def generate(env):
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# - cl /?
if env['build'] == 'debug':
if debug:
ccflags += [
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
'/Oy-', # disable frame pointer omission
'/GL-', # disable whole program optimization
]
else:
ccflags += [
'/O2', # optimize for speed
]
if env['build'] == 'release':
ccflags += [
'/GL', # enable whole program optimization
]
else:
ccflags += [
'/GL-', # disable whole program optimization
]
ccflags += [
'/fp:fast', # fast floating point
'/W3', # warning level
@@ -505,7 +389,7 @@ def generate(env):
if env['platform'] == 'windows' and msvc:
# Choose the appropriate MSVC CRT
# http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
if env['build'] in ('debug', 'checked'):
if env['debug']:
env.Append(CCFLAGS = ['/MTd'])
env.Append(SHCCFLAGS = ['/LDd'])
else:
@@ -537,7 +421,7 @@ def generate(env):
else:
env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
if msvc:
if env['build'] == 'release':
if not env['debug']:
# enable Link-time Code Generation
linkflags += ['/LTCG']
env.Append(ARFLAGS = ['/LTCG'])
@@ -576,7 +460,7 @@ def generate(env):
'/entry:DrvEnableDriver',
]
if env['build'] != 'release':
if env['debug'] or env['profile']:
linkflags += [
'/MAP', # http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
]
@@ -590,27 +474,12 @@ def generate(env):
env.Append(LINKFLAGS = linkflags)
env.Append(SHLINKFLAGS = shlinkflags)
# We have C++ in several libraries, so always link with the C++ compiler
if env['gcc']:
env['LINK'] = env['CXX']
# Default libs
env.Append(LIBS = [])
# Load tools
env.Tool('lex')
env.Tool('yacc')
# Load LLVM
if env['llvm']:
env.Tool('llvm')
pkg_config_modules(env, 'x11', ['x11', 'xext'])
pkg_config_modules(env, 'drm', ['libdrm'])
pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
pkg_config_modules(env, 'xorg', ['xorg-server'])
pkg_config_modules(env, 'kms', ['libkms'])
env['dri'] = env['x11'] and env['drm']
# Custom builders and methods
env.Tool('custom')

View File

@@ -38,8 +38,6 @@ import SCons.Util
def generate(env):
env['llvm'] = False
try:
llvm_dir = os.environ['LLVM']
except KeyError:
@@ -66,13 +64,13 @@ def generate(env):
# XXX: There is no llvm-config on Windows, so assume a standard layout
if llvm_dir is None:
print 'scons: LLVM environment variable must be specified when building for windows'
return
env.Exit(1)
# Try to determine the LLVM version from llvm/Config/config.h
llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h')
if not os.path.exists(llvm_config):
print 'scons: could not find %s' % llvm_config
return
env.Exit(1)
llvm_version_re = re.compile(r'^#define PACKAGE_VERSION "([^"]*)"')
llvm_version = None
for line in open(llvm_config, 'rt'):
@@ -83,7 +81,7 @@ def generate(env):
break
if llvm_version is None:
print 'scons: could not determine the LLVM version from %s' % llvm_config
return
env.Exit(1)
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
env.AppendUnique(CPPDEFINES = [
@@ -126,7 +124,7 @@ def generate(env):
# Some of the LLVM C headers use the inline keyword without
# defining it.
env.Append(CPPDEFINES = [('inline', '__inline')])
if env['build'] in ('debug', 'checked'):
if env['debug']:
# LLVM libraries are static, build with /MT, and they
# automatically link agains LIBCMT. When we're doing a
# debug build we'll be linking against LIBCMTD, so disable
@@ -135,21 +133,22 @@ def generate(env):
else:
if not env.Detect('llvm-config'):
print 'scons: llvm-config script not found' % llvm_version
return
env.Exit(1)
llvm_version = env.backtick('llvm-config --version').rstrip()
llvm_version = distutils.version.LooseVersion(llvm_version)
try:
env.ParseConfig('llvm-config --cppflags')
env.ParseConfig('llvm-config --libs')
env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
env.ParseConfig('llvm-config --ldflags')
except OSError:
print 'scons: llvm-config version %s failed' % llvm_version
return
env.Exit(1)
else:
env['LINK'] = env['CXX']
assert llvm_version is not None
env['llvm'] = True
print 'scons: Found LLVM version %s' % llvm_version
env['LLVM_VERSION'] = llvm_version

72
scons/python.py Normal file
View File

@@ -0,0 +1,72 @@
"""gallium
Frontend-tool for Gallium3D architecture.
"""
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sub license, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial portions
# of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
import sys
import distutils.sysconfig
import os.path
def generate(env):
# See http://www.scons.org/wiki/PythonExtensions
if sys.platform in ['win32']:
python_root = sys.prefix
python_version = '%u%u' % sys.version_info[:2]
python_include = os.path.join(python_root, 'include')
python_libs = os.path.join(python_root, 'libs')
python_lib = os.path.join(python_libs, 'python' + python_version + '.lib')
env.Append(CPPPATH = [python_include])
env.Append(LIBPATH = [python_libs])
env.Append(LIBS = ['python' + python_version + '.lib'])
env.Replace(SHLIBPREFIX = '')
env.Replace(SHLIBSUFFIX = '.pyd')
# XXX; python25_d.lib is not included in Python for windows, and
# we'll get missing symbols unless we undefine _DEBUG
cppdefines = env['CPPDEFINES']
cppdefines = [define for define in cppdefines if define != '_DEBUG']
env.Replace(CPPDEFINES = cppdefines)
env.AppendUnique(CPPFLAGS = ['/U_DEBUG'])
env.AppendUnique(LINKFLAGS = ['/nodefaultlib:python25_d.lib'])
else:
#env.ParseConfig('python-config --cflags --ldflags --libs')
env.AppendUnique(CPPPATH = [distutils.sysconfig.get_python_inc()])
env.Replace(SHLIBPREFIX = '')
env.Replace(SHLIBSUFFIX = distutils.sysconfig.get_config_vars()['SO'])
# for debugging
#print env.Dump()
def exists(env):
return 1

42
scons/udis86.py Normal file
View File

@@ -0,0 +1,42 @@
"""udis86
Tool-specific initialization for udis86
"""
#
# Copyright (c) 2009 VMware, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
def generate(env):
conf = env.Configure()
if conf.CheckHeader('udis86.h'): # and conf.CheckLib('udis86'):
env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')])
env.Prepend(LIBS = ['udis86'])
conf.Finish()
def exists(env):
return True
# vim:set ts=4 sw=4 et:

View File

@@ -122,7 +122,7 @@ def get_wce600_paths(env):
host_cpu = os.environ.get('_HOSTCPUTYPE', 'i386')
target_cpu = os.environ.get('_TGTCPU', 'x86')
if env['build'] == 'debug':
if env['debug']:
build = 'debug'
else:
build = 'retail'

View File

@@ -1,32 +1,19 @@
Import('*')
if env['platform'] == 'windows':
SConscript('getopt/SConscript')
SConscript('glsl/SConscript')
if env['hostonly']:
# We are just compiling the things necessary on the host for cross
# compilation
Return()
# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
# in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
# enable OpenGL ES support.
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
SConscript('mapi/vgapi/SConscript')
if env['platform'] != 'embedded':
if 'egl' in env['statetrackers']:
SConscript('mapi/vgapi/SConscript')
SConscript('egl/main/SConscript')
SConscript('glut/glx/SConscript')
if env['gles']:
SConscript('mapi/shared-glapi/SConscript')
if 'mesa' in env['statetrackers']:
if platform == 'windows':
SConscript('talloc/SConscript')
SConscript('glsl/SConscript')
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
if platform != 'embedded':
SConscript('glut/glx/SConscript')
SConscript('gallium/SConscript')

View File

@@ -3,13 +3,8 @@
TOP = ../..
include $(TOP)/configs/current
SUBDIRS =
SUBDIRS = main drivers
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
SUBDIRS += wayland
endif
SUBDIRS += drivers main
default: subdirs

View File

@@ -2,7 +2,6 @@
#
# Drivers should define
#
# EGL_BUILTIN, the driver is built-in or external
# EGL_DRIVER, the driver name
# EGL_SOURCES, the driver sources
# EGL_INCLUDES, the include pathes
@@ -13,45 +12,32 @@
#
EGL_DRIVER_PATH = $(TOP)/$(LIB_DIR)/egl/$(EGL_DRIVER).so
EGL_DRIVER_PATH = $(TOP)/$(LIB_DIR)/egl/$(EGL_DRIVER)
EGL_OBJECTS = $(EGL_SOURCES:.c=.o)
# built-in or external
ifeq ($(EGL_BUILTIN),true)
EGL_TARGET = lib$(EGL_DRIVER).a
EGL_INSTALL =
else
EGL_TARGET = $(EGL_DRIVER_PATH)
EGL_INSTALL = install-so
endif
default: depend $(EGL_TARGET)
default: depend $(EGL_DRIVER_PATH)
$(EGL_DRIVER_PATH): $(EGL_DRIVER).so
$(EGL_DRIVER_PATH): $(EGL_DRIVER)
@$(INSTALL) -d $(TOP)/$(LIB_DIR)/egl
$(INSTALL) $< $(TOP)/$(LIB_DIR)/egl
$(EGL_DRIVER).so: $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER).so -noprefix \
-linker '$(CC)' -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
$(MKLIB_OPTIONS) \
$(EGL_DRIVER): $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -noprefix \
-linker '$(CC)' -ldflags '$(LDFLAGS)' \
-L$(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
$(EGL_OBJECTS) $(EGL_LIBS) -l$(EGL_LIB)
lib$(EGL_DRIVER).a: $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -static $(EGL_OBJECTS)
.c.o:
$(CC) -c $(EGL_INCLUDES) $(CFLAGS) $(EGL_CFLAGS) $< -o $@
install-so: $(EGL_DRIVER_PATH)
install: $(EGL_DRIVER_PATH)
$(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
$(MINSTALL) $(EGL_DRIVER_PATH) $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
install: $(EGL_INSTALL)
clean:
rm -f $(EGL_DRIVER).so
rm -f lib$(EGL_DRIVER).a
rm -f $(EGL_DRIVER)
rm -f $(EGL_OBJECTS)
rm -f depend depend.bak

View File

@@ -3,8 +3,8 @@
TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_dri2
EGL_SOURCES = egl_dri2.c platform_x11.c platform_drm.c
EGL_DRIVER = egl_dri2.so
EGL_SOURCES = egl_dri2.c
EGL_INCLUDES = \
-I$(TOP)/include \
@@ -15,22 +15,6 @@ EGL_INCLUDES = \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
EGL_BUILTIN = true
ifeq ($(SHARED_GLAPI),1)
EGL_CFLAGS += -DHAVE_SHARED_GLAPI
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_wayland.c
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
-I$(TOP)/src/egl/wayland/wayland-egl \
-I$(TOP)/src/egl/wayland/wayland-drm
EGL_LIBS += $(WAYLAND_LIBS) \
$(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(LIBDRM_LIBS)
include ../Makefile.template

File diff suppressed because it is too large Load Diff

View File

@@ -1,199 +0,0 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#ifndef EGL_DRI2_INCLUDED
#define EGL_DRI2_INCLUDED
#include <xcb/xcb.h>
#include <xcb/dri2.h>
#include <xcb/xfixes.h>
#include <X11/Xlib-xcb.h>
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
#include "wayland-drm.h"
#include "wayland-egl-priv.h"
#endif
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglcurrent.h"
#include "egllog.h"
#include "eglsurface.h"
#include "eglimage.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
struct dri2_egl_driver
{
_EGLDriver base;
void *handle;
_EGLProc (*get_proc_address)(const char *procname);
void (*glFlush)(void);
};
struct dri2_egl_display
{
xcb_connection_t *conn;
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
__DRIdri2Extension *dri2;
__DRIswrastExtension *swrast;
__DRI2flushExtension *flush;
__DRItexBufferExtension *tex_buffer;
__DRIimageExtension *image;
int fd;
char *device_name;
char *driver_name;
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[3];
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_display *wl_dpy;
struct wl_drm *wl_server_drm;
#endif
int (*authenticate) (_EGLDisplay *disp, uint32_t id);
};
struct dri2_egl_context
{
_EGLContext base;
__DRIcontext *dri_context;
};
#ifdef HAVE_WAYLAND_PLATFORM
enum wayland_buffer_type {
WL_BUFFER_FRONT,
WL_BUFFER_BACK,
WL_BUFFER_COUNT
};
#define __DRI_BUFFER_COUNT 10
#endif
enum dri2_surface_type {
DRI2_WINDOW_SURFACE,
DRI2_PIXMAP_SURFACE,
DRI2_PBUFFER_SURFACE
};
struct dri2_egl_surface
{
_EGLSurface base;
__DRIdrawable *dri_drawable;
xcb_drawable_t drawable;
__DRIbuffer buffers[5];
int buffer_count;
xcb_xfixes_region_t region;
int have_fake_front;
int swap_interval;
int depth;
int bytes_per_pixel;
xcb_gcontext_t gc;
xcb_gcontext_t swapgc;
enum dri2_surface_type type;
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_window *wl_win;
struct wl_egl_pixmap *wl_pix;
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
int dx;
int dy;
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
__DRIbuffer *pending_buffer;
EGLBoolean block_swap_buffers;
#endif
};
struct dri2_egl_buffer {
__DRIbuffer *dri_buffer;
struct dri2_egl_display *dri2_dpy;
};
struct dri2_egl_config
{
_EGLConfig base;
const __DRIconfig *dri_single_config;
const __DRIconfig *dri_double_config;
};
struct dri2_egl_image
{
_EGLImage base;
__DRIimage *dri_image;
};
/* standard typecasts */
_EGL_DRIVER_STANDARD_TYPECASTS(dri2_egl)
_EGL_DRIVER_TYPECAST(dri2_egl_image, _EGLImage, obj)
extern const __DRIimageLookupExtension image_lookup_extension;
extern const __DRIuseInvalidateExtension use_invalidate;
EGLBoolean
dri2_load_driver(_EGLDisplay *disp);
EGLBoolean
dri2_create_screen(_EGLDisplay *disp);
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list);
_EGLImage *
dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list);
EGLBoolean
dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp);
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp);
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
char *
dri2_get_driver_for_fd(int fd);
#endif /* EGL_DRI2_INCLUDED */

View File

@@ -1,732 +0,0 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <xf86drm.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_LIBUDEV
#include <libudev.h>
#endif
#include "egl_dri2.h"
#ifdef HAVE_LIBUDEV
struct dri2_driver_map {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
};
const int i915_chip_ids[] = {
0x3577, /* PCI_CHIP_I830_M */
0x2562, /* PCI_CHIP_845_G */
0x3582, /* PCI_CHIP_I855_GM */
0x2572, /* PCI_CHIP_I865_G */
0x2582, /* PCI_CHIP_I915_G */
0x258a, /* PCI_CHIP_E7221_G */
0x2592, /* PCI_CHIP_I915_GM */
0x2772, /* PCI_CHIP_I945_G */
0x27a2, /* PCI_CHIP_I945_GM */
0x27ae, /* PCI_CHIP_I945_GME */
0x29b2, /* PCI_CHIP_Q35_G */
0x29c2, /* PCI_CHIP_G33_G */
0x29d2, /* PCI_CHIP_Q33_G */
0xa001, /* PCI_CHIP_IGD_G */
0xa011, /* Pineview */
};
const int i965_chip_ids[] = {
0x0042, /* PCI_CHIP_ILD_G */
0x0046, /* PCI_CHIP_ILM_G */
0x0102, /* PCI_CHIP_SANDYBRIDGE_GT1 */
0x0106, /* PCI_CHIP_SANDYBRIDGE_M_GT1 */
0x010a, /* PCI_CHIP_SANDYBRIDGE_S */
0x0112, /* PCI_CHIP_SANDYBRIDGE_GT2 */
0x0116, /* PCI_CHIP_SANDYBRIDGE_M_GT2 */
0x0122, /* PCI_CHIP_SANDYBRIDGE_GT2_PLUS */
0x0126, /* PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS */
0x29a2, /* PCI_CHIP_I965_G */
0x2992, /* PCI_CHIP_I965_Q */
0x2982, /* PCI_CHIP_I965_G_1 */
0x2972, /* PCI_CHIP_I946_GZ */
0x2a02, /* PCI_CHIP_I965_GM */
0x2a12, /* PCI_CHIP_I965_GME */
0x2a42, /* PCI_CHIP_GM45_GM */
0x2e02, /* PCI_CHIP_IGD_E_G */
0x2e12, /* PCI_CHIP_Q45_G */
0x2e22, /* PCI_CHIP_G45_G */
0x2e32, /* PCI_CHIP_G41_G */
0x2e42, /* PCI_CHIP_B43_G */
0x2e92, /* PCI_CHIP_B43_G1 */
};
const int r100_chip_ids[] = {
0x4C57, /* PCI_CHIP_RADEON_LW */
0x4C58, /* PCI_CHIP_RADEON_LX */
0x4C59, /* PCI_CHIP_RADEON_LY */
0x4C5A, /* PCI_CHIP_RADEON_LZ */
0x5144, /* PCI_CHIP_RADEON_QD */
0x5145, /* PCI_CHIP_RADEON_QE */
0x5146, /* PCI_CHIP_RADEON_QF */
0x5147, /* PCI_CHIP_RADEON_QG */
0x5159, /* PCI_CHIP_RADEON_QY */
0x515A, /* PCI_CHIP_RADEON_QZ */
0x5157, /* PCI_CHIP_RV200_QW */
0x5158, /* PCI_CHIP_RV200_QX */
0x515E, /* PCI_CHIP_RN50_515E */
0x5969, /* PCI_CHIP_RN50_5969 */
0x4136, /* PCI_CHIP_RS100_4136 */
0x4336, /* PCI_CHIP_RS100_4336 */
0x4137, /* PCI_CHIP_RS200_4137 */
0x4337, /* PCI_CHIP_RS200_4337 */
0x4237, /* PCI_CHIP_RS250_4237 */
0x4437, /* PCI_CHIP_RS250_4437 */
};
const int r200_chip_ids[] = {
0x5148, /* PCI_CHIP_R200_QH */
0x514C, /* PCI_CHIP_R200_QL */
0x514D, /* PCI_CHIP_R200_QM */
0x4242, /* PCI_CHIP_R200_BB */
0x4966, /* PCI_CHIP_RV250_If */
0x4967, /* PCI_CHIP_RV250_Ig */
0x4C64, /* PCI_CHIP_RV250_Ld */
0x4C66, /* PCI_CHIP_RV250_Lf */
0x4C67, /* PCI_CHIP_RV250_Lg */
0x5960, /* PCI_CHIP_RV280_5960 */
0x5961, /* PCI_CHIP_RV280_5961 */
0x5962, /* PCI_CHIP_RV280_5962 */
0x5964, /* PCI_CHIP_RV280_5964 */
0x5965, /* PCI_CHIP_RV280_5965 */
0x5C61, /* PCI_CHIP_RV280_5C61 */
0x5C63, /* PCI_CHIP_RV280_5C63 */
0x5834, /* PCI_CHIP_RS300_5834 */
0x5835, /* PCI_CHIP_RS300_5835 */
0x7834, /* PCI_CHIP_RS350_7834 */
0x7835, /* PCI_CHIP_RS350_7835 */
};
const int r300_chip_ids[] = {
0x4144, /* PCI_CHIP_R300_AD */
0x4145, /* PCI_CHIP_R300_AE */
0x4146, /* PCI_CHIP_R300_AF */
0x4147, /* PCI_CHIP_R300_AG */
0x4E44, /* PCI_CHIP_R300_ND */
0x4E45, /* PCI_CHIP_R300_NE */
0x4E46, /* PCI_CHIP_R300_NF */
0x4E47, /* PCI_CHIP_R300_NG */
0x4E48, /* PCI_CHIP_R350_NH */
0x4E49, /* PCI_CHIP_R350_NI */
0x4E4B, /* PCI_CHIP_R350_NK */
0x4148, /* PCI_CHIP_R350_AH */
0x4149, /* PCI_CHIP_R350_AI */
0x414A, /* PCI_CHIP_R350_AJ */
0x414B, /* PCI_CHIP_R350_AK */
0x4E4A, /* PCI_CHIP_R360_NJ */
0x4150, /* PCI_CHIP_RV350_AP */
0x4151, /* PCI_CHIP_RV350_AQ */
0x4152, /* PCI_CHIP_RV350_AR */
0x4153, /* PCI_CHIP_RV350_AS */
0x4154, /* PCI_CHIP_RV350_AT */
0x4155, /* PCI_CHIP_RV350_AU */
0x4156, /* PCI_CHIP_RV350_AV */
0x4E50, /* PCI_CHIP_RV350_NP */
0x4E51, /* PCI_CHIP_RV350_NQ */
0x4E52, /* PCI_CHIP_RV350_NR */
0x4E53, /* PCI_CHIP_RV350_NS */
0x4E54, /* PCI_CHIP_RV350_NT */
0x4E56, /* PCI_CHIP_RV350_NV */
0x5460, /* PCI_CHIP_RV370_5460 */
0x5462, /* PCI_CHIP_RV370_5462 */
0x5464, /* PCI_CHIP_RV370_5464 */
0x5B60, /* PCI_CHIP_RV370_5B60 */
0x5B62, /* PCI_CHIP_RV370_5B62 */
0x5B63, /* PCI_CHIP_RV370_5B63 */
0x5B64, /* PCI_CHIP_RV370_5B64 */
0x5B65, /* PCI_CHIP_RV370_5B65 */
0x3150, /* PCI_CHIP_RV380_3150 */
0x3152, /* PCI_CHIP_RV380_3152 */
0x3154, /* PCI_CHIP_RV380_3154 */
0x3155, /* PCI_CHIP_RV380_3155 */
0x3E50, /* PCI_CHIP_RV380_3E50 */
0x3E54, /* PCI_CHIP_RV380_3E54 */
0x4A48, /* PCI_CHIP_R420_JH */
0x4A49, /* PCI_CHIP_R420_JI */
0x4A4A, /* PCI_CHIP_R420_JJ */
0x4A4B, /* PCI_CHIP_R420_JK */
0x4A4C, /* PCI_CHIP_R420_JL */
0x4A4D, /* PCI_CHIP_R420_JM */
0x4A4E, /* PCI_CHIP_R420_JN */
0x4A4F, /* PCI_CHIP_R420_JO */
0x4A50, /* PCI_CHIP_R420_JP */
0x4A54, /* PCI_CHIP_R420_JT */
0x5548, /* PCI_CHIP_R423_UH */
0x5549, /* PCI_CHIP_R423_UI */
0x554A, /* PCI_CHIP_R423_UJ */
0x554B, /* PCI_CHIP_R423_UK */
0x5550, /* PCI_CHIP_R423_5550 */
0x5551, /* PCI_CHIP_R423_UQ */
0x5552, /* PCI_CHIP_R423_UR */
0x5554, /* PCI_CHIP_R423_UT */
0x5D57, /* PCI_CHIP_R423_5D57 */
0x554C, /* PCI_CHIP_R430_554C */
0x554D, /* PCI_CHIP_R430_554D */
0x554E, /* PCI_CHIP_R430_554E */
0x554F, /* PCI_CHIP_R430_554F */
0x5D48, /* PCI_CHIP_R430_5D48 */
0x5D49, /* PCI_CHIP_R430_5D49 */
0x5D4A, /* PCI_CHIP_R430_5D4A */
0x5D4C, /* PCI_CHIP_R480_5D4C */
0x5D4D, /* PCI_CHIP_R480_5D4D */
0x5D4E, /* PCI_CHIP_R480_5D4E */
0x5D4F, /* PCI_CHIP_R480_5D4F */
0x5D50, /* PCI_CHIP_R480_5D50 */
0x5D52, /* PCI_CHIP_R480_5D52 */
0x4B49, /* PCI_CHIP_R481_4B49 */
0x4B4A, /* PCI_CHIP_R481_4B4A */
0x4B4B, /* PCI_CHIP_R481_4B4B */
0x4B4C, /* PCI_CHIP_R481_4B4C */
0x564A, /* PCI_CHIP_RV410_564A */
0x564B, /* PCI_CHIP_RV410_564B */
0x564F, /* PCI_CHIP_RV410_564F */
0x5652, /* PCI_CHIP_RV410_5652 */
0x5653, /* PCI_CHIP_RV410_5653 */
0x5657, /* PCI_CHIP_RV410_5657 */
0x5E48, /* PCI_CHIP_RV410_5E48 */
0x5E4A, /* PCI_CHIP_RV410_5E4A */
0x5E4B, /* PCI_CHIP_RV410_5E4B */
0x5E4C, /* PCI_CHIP_RV410_5E4C */
0x5E4D, /* PCI_CHIP_RV410_5E4D */
0x5E4F, /* PCI_CHIP_RV410_5E4F */
0x5A41, /* PCI_CHIP_RS400_5A41 */
0x5A42, /* PCI_CHIP_RS400_5A42 */
0x5A61, /* PCI_CHIP_RC410_5A61 */
0x5A62, /* PCI_CHIP_RC410_5A62 */
0x5954, /* PCI_CHIP_RS480_5954 */
0x5955, /* PCI_CHIP_RS480_5955 */
0x5974, /* PCI_CHIP_RS482_5974 */
0x5975, /* PCI_CHIP_RS482_5975 */
0x7100, /* PCI_CHIP_R520_7100 */
0x7101, /* PCI_CHIP_R520_7101 */
0x7102, /* PCI_CHIP_R520_7102 */
0x7103, /* PCI_CHIP_R520_7103 */
0x7104, /* PCI_CHIP_R520_7104 */
0x7105, /* PCI_CHIP_R520_7105 */
0x7106, /* PCI_CHIP_R520_7106 */
0x7108, /* PCI_CHIP_R520_7108 */
0x7109, /* PCI_CHIP_R520_7109 */
0x710A, /* PCI_CHIP_R520_710A */
0x710B, /* PCI_CHIP_R520_710B */
0x710C, /* PCI_CHIP_R520_710C */
0x710E, /* PCI_CHIP_R520_710E */
0x710F, /* PCI_CHIP_R520_710F */
0x7140, /* PCI_CHIP_RV515_7140 */
0x7141, /* PCI_CHIP_RV515_7141 */
0x7142, /* PCI_CHIP_RV515_7142 */
0x7143, /* PCI_CHIP_RV515_7143 */
0x7144, /* PCI_CHIP_RV515_7144 */
0x7145, /* PCI_CHIP_RV515_7145 */
0x7146, /* PCI_CHIP_RV515_7146 */
0x7147, /* PCI_CHIP_RV515_7147 */
0x7149, /* PCI_CHIP_RV515_7149 */
0x714A, /* PCI_CHIP_RV515_714A */
0x714B, /* PCI_CHIP_RV515_714B */
0x714C, /* PCI_CHIP_RV515_714C */
0x714D, /* PCI_CHIP_RV515_714D */
0x714E, /* PCI_CHIP_RV515_714E */
0x714F, /* PCI_CHIP_RV515_714F */
0x7151, /* PCI_CHIP_RV515_7151 */
0x7152, /* PCI_CHIP_RV515_7152 */
0x7153, /* PCI_CHIP_RV515_7153 */
0x715E, /* PCI_CHIP_RV515_715E */
0x715F, /* PCI_CHIP_RV515_715F */
0x7180, /* PCI_CHIP_RV515_7180 */
0x7181, /* PCI_CHIP_RV515_7181 */
0x7183, /* PCI_CHIP_RV515_7183 */
0x7186, /* PCI_CHIP_RV515_7186 */
0x7187, /* PCI_CHIP_RV515_7187 */
0x7188, /* PCI_CHIP_RV515_7188 */
0x718A, /* PCI_CHIP_RV515_718A */
0x718B, /* PCI_CHIP_RV515_718B */
0x718C, /* PCI_CHIP_RV515_718C */
0x718D, /* PCI_CHIP_RV515_718D */
0x718F, /* PCI_CHIP_RV515_718F */
0x7193, /* PCI_CHIP_RV515_7193 */
0x7196, /* PCI_CHIP_RV515_7196 */
0x719B, /* PCI_CHIP_RV515_719B */
0x719F, /* PCI_CHIP_RV515_719F */
0x7200, /* PCI_CHIP_RV515_7200 */
0x7210, /* PCI_CHIP_RV515_7210 */
0x7211, /* PCI_CHIP_RV515_7211 */
0x71C0, /* PCI_CHIP_RV530_71C0 */
0x71C1, /* PCI_CHIP_RV530_71C1 */
0x71C2, /* PCI_CHIP_RV530_71C2 */
0x71C3, /* PCI_CHIP_RV530_71C3 */
0x71C4, /* PCI_CHIP_RV530_71C4 */
0x71C5, /* PCI_CHIP_RV530_71C5 */
0x71C6, /* PCI_CHIP_RV530_71C6 */
0x71C7, /* PCI_CHIP_RV530_71C7 */
0x71CD, /* PCI_CHIP_RV530_71CD */
0x71CE, /* PCI_CHIP_RV530_71CE */
0x71D2, /* PCI_CHIP_RV530_71D2 */
0x71D4, /* PCI_CHIP_RV530_71D4 */
0x71D5, /* PCI_CHIP_RV530_71D5 */
0x71D6, /* PCI_CHIP_RV530_71D6 */
0x71DA, /* PCI_CHIP_RV530_71DA */
0x71DE, /* PCI_CHIP_RV530_71DE */
0x7281, /* PCI_CHIP_RV560_7281 */
0x7283, /* PCI_CHIP_RV560_7283 */
0x7287, /* PCI_CHIP_RV560_7287 */
0x7290, /* PCI_CHIP_RV560_7290 */
0x7291, /* PCI_CHIP_RV560_7291 */
0x7293, /* PCI_CHIP_RV560_7293 */
0x7297, /* PCI_CHIP_RV560_7297 */
0x7280, /* PCI_CHIP_RV570_7280 */
0x7288, /* PCI_CHIP_RV570_7288 */
0x7289, /* PCI_CHIP_RV570_7289 */
0x728B, /* PCI_CHIP_RV570_728B */
0x728C, /* PCI_CHIP_RV570_728C */
0x7240, /* PCI_CHIP_R580_7240 */
0x7243, /* PCI_CHIP_R580_7243 */
0x7244, /* PCI_CHIP_R580_7244 */
0x7245, /* PCI_CHIP_R580_7245 */
0x7246, /* PCI_CHIP_R580_7246 */
0x7247, /* PCI_CHIP_R580_7247 */
0x7248, /* PCI_CHIP_R580_7248 */
0x7249, /* PCI_CHIP_R580_7249 */
0x724A, /* PCI_CHIP_R580_724A */
0x724B, /* PCI_CHIP_R580_724B */
0x724C, /* PCI_CHIP_R580_724C */
0x724D, /* PCI_CHIP_R580_724D */
0x724E, /* PCI_CHIP_R580_724E */
0x724F, /* PCI_CHIP_R580_724F */
0x7284, /* PCI_CHIP_R580_7284 */
0x793F, /* PCI_CHIP_RS600_793F */
0x7941, /* PCI_CHIP_RS600_7941 */
0x7942, /* PCI_CHIP_RS600_7942 */
0x791E, /* PCI_CHIP_RS690_791E */
0x791F, /* PCI_CHIP_RS690_791F */
0x796C, /* PCI_CHIP_RS740_796C */
0x796D, /* PCI_CHIP_RS740_796D */
0x796E, /* PCI_CHIP_RS740_796E */
0x796F, /* PCI_CHIP_RS740_796F */
};
const int r600_chip_ids[] = {
0x9400, /* PCI_CHIP_R600_9400 */
0x9401, /* PCI_CHIP_R600_9401 */
0x9402, /* PCI_CHIP_R600_9402 */
0x9403, /* PCI_CHIP_R600_9403 */
0x9405, /* PCI_CHIP_R600_9405 */
0x940A, /* PCI_CHIP_R600_940A */
0x940B, /* PCI_CHIP_R600_940B */
0x940F, /* PCI_CHIP_R600_940F */
0x94C0, /* PCI_CHIP_RV610_94C0 */
0x94C1, /* PCI_CHIP_RV610_94C1 */
0x94C3, /* PCI_CHIP_RV610_94C3 */
0x94C4, /* PCI_CHIP_RV610_94C4 */
0x94C5, /* PCI_CHIP_RV610_94C5 */
0x94C6, /* PCI_CHIP_RV610_94C6 */
0x94C7, /* PCI_CHIP_RV610_94C7 */
0x94C8, /* PCI_CHIP_RV610_94C8 */
0x94C9, /* PCI_CHIP_RV610_94C9 */
0x94CB, /* PCI_CHIP_RV610_94CB */
0x94CC, /* PCI_CHIP_RV610_94CC */
0x94CD, /* PCI_CHIP_RV610_94CD */
0x9580, /* PCI_CHIP_RV630_9580 */
0x9581, /* PCI_CHIP_RV630_9581 */
0x9583, /* PCI_CHIP_RV630_9583 */
0x9586, /* PCI_CHIP_RV630_9586 */
0x9587, /* PCI_CHIP_RV630_9587 */
0x9588, /* PCI_CHIP_RV630_9588 */
0x9589, /* PCI_CHIP_RV630_9589 */
0x958A, /* PCI_CHIP_RV630_958A */
0x958B, /* PCI_CHIP_RV630_958B */
0x958C, /* PCI_CHIP_RV630_958C */
0x958D, /* PCI_CHIP_RV630_958D */
0x958E, /* PCI_CHIP_RV630_958E */
0x958F, /* PCI_CHIP_RV630_958F */
0x9500, /* PCI_CHIP_RV670_9500 */
0x9501, /* PCI_CHIP_RV670_9501 */
0x9504, /* PCI_CHIP_RV670_9504 */
0x9505, /* PCI_CHIP_RV670_9505 */
0x9506, /* PCI_CHIP_RV670_9506 */
0x9507, /* PCI_CHIP_RV670_9507 */
0x9508, /* PCI_CHIP_RV670_9508 */
0x9509, /* PCI_CHIP_RV670_9509 */
0x950F, /* PCI_CHIP_RV670_950F */
0x9511, /* PCI_CHIP_RV670_9511 */
0x9515, /* PCI_CHIP_RV670_9515 */
0x9517, /* PCI_CHIP_RV670_9517 */
0x9519, /* PCI_CHIP_RV670_9519 */
0x95C0, /* PCI_CHIP_RV620_95C0 */
0x95C2, /* PCI_CHIP_RV620_95C2 */
0x95C4, /* PCI_CHIP_RV620_95C4 */
0x95C5, /* PCI_CHIP_RV620_95C5 */
0x95C6, /* PCI_CHIP_RV620_95C6 */
0x95C7, /* PCI_CHIP_RV620_95C7 */
0x95C9, /* PCI_CHIP_RV620_95C9 */
0x95CC, /* PCI_CHIP_RV620_95CC */
0x95CD, /* PCI_CHIP_RV620_95CD */
0x95CE, /* PCI_CHIP_RV620_95CE */
0x95CF, /* PCI_CHIP_RV620_95CF */
0x9590, /* PCI_CHIP_RV635_9590 */
0x9591, /* PCI_CHIP_RV635_9591 */
0x9593, /* PCI_CHIP_RV635_9593 */
0x9595, /* PCI_CHIP_RV635_9595 */
0x9596, /* PCI_CHIP_RV635_9596 */
0x9597, /* PCI_CHIP_RV635_9597 */
0x9598, /* PCI_CHIP_RV635_9598 */
0x9599, /* PCI_CHIP_RV635_9599 */
0x959B, /* PCI_CHIP_RV635_959B */
0x9610, /* PCI_CHIP_RS780_9610 */
0x9611, /* PCI_CHIP_RS780_9611 */
0x9612, /* PCI_CHIP_RS780_9612 */
0x9613, /* PCI_CHIP_RS780_9613 */
0x9614, /* PCI_CHIP_RS780_9614 */
0x9615, /* PCI_CHIP_RS780_9615 */
0x9616, /* PCI_CHIP_RS780_9616 */
0x9710, /* PCI_CHIP_RS880_9710 */
0x9711, /* PCI_CHIP_RS880_9711 */
0x9712, /* PCI_CHIP_RS880_9712 */
0x9713, /* PCI_CHIP_RS880_9713 */
0x9714, /* PCI_CHIP_RS880_9714 */
0x9715, /* PCI_CHIP_RS880_9715 */
0x9440, /* PCI_CHIP_RV770_9440 */
0x9441, /* PCI_CHIP_RV770_9441 */
0x9442, /* PCI_CHIP_RV770_9442 */
0x9443, /* PCI_CHIP_RV770_9443 */
0x9444, /* PCI_CHIP_RV770_9444 */
0x9446, /* PCI_CHIP_RV770_9446 */
0x944A, /* PCI_CHIP_RV770_944A */
0x944B, /* PCI_CHIP_RV770_944B */
0x944C, /* PCI_CHIP_RV770_944C */
0x944E, /* PCI_CHIP_RV770_944E */
0x9450, /* PCI_CHIP_RV770_9450 */
0x9452, /* PCI_CHIP_RV770_9452 */
0x9456, /* PCI_CHIP_RV770_9456 */
0x945A, /* PCI_CHIP_RV770_945A */
0x945B, /* PCI_CHIP_RV770_945B */
0x945E, /* PCI_CHIP_RV770_945E */
0x9460, /* PCI_CHIP_RV790_9460 */
0x9462, /* PCI_CHIP_RV790_9462 */
0x946A, /* PCI_CHIP_RV770_946A */
0x946B, /* PCI_CHIP_RV770_946B */
0x947A, /* PCI_CHIP_RV770_947A */
0x947B, /* PCI_CHIP_RV770_947B */
0x9480, /* PCI_CHIP_RV730_9480 */
0x9487, /* PCI_CHIP_RV730_9487 */
0x9488, /* PCI_CHIP_RV730_9488 */
0x9489, /* PCI_CHIP_RV730_9489 */
0x948A, /* PCI_CHIP_RV730_948A */
0x948F, /* PCI_CHIP_RV730_948F */
0x9490, /* PCI_CHIP_RV730_9490 */
0x9491, /* PCI_CHIP_RV730_9491 */
0x9495, /* PCI_CHIP_RV730_9495 */
0x9498, /* PCI_CHIP_RV730_9498 */
0x949C, /* PCI_CHIP_RV730_949C */
0x949E, /* PCI_CHIP_RV730_949E */
0x949F, /* PCI_CHIP_RV730_949F */
0x9540, /* PCI_CHIP_RV710_9540 */
0x9541, /* PCI_CHIP_RV710_9541 */
0x9542, /* PCI_CHIP_RV710_9542 */
0x954E, /* PCI_CHIP_RV710_954E */
0x954F, /* PCI_CHIP_RV710_954F */
0x9552, /* PCI_CHIP_RV710_9552 */
0x9553, /* PCI_CHIP_RV710_9553 */
0x9555, /* PCI_CHIP_RV710_9555 */
0x9557, /* PCI_CHIP_RV710_9557 */
0x955F, /* PCI_CHIP_RV710_955F */
0x94A0, /* PCI_CHIP_RV740_94A0 */
0x94A1, /* PCI_CHIP_RV740_94A1 */
0x94A3, /* PCI_CHIP_RV740_94A3 */
0x94B1, /* PCI_CHIP_RV740_94B1 */
0x94B3, /* PCI_CHIP_RV740_94B3 */
0x94B4, /* PCI_CHIP_RV740_94B4 */
0x94B5, /* PCI_CHIP_RV740_94B5 */
0x94B9, /* PCI_CHIP_RV740_94B9 */
0x68E0, /* PCI_CHIP_CEDAR_68E0 */
0x68E1, /* PCI_CHIP_CEDAR_68E1 */
0x68E4, /* PCI_CHIP_CEDAR_68E4 */
0x68E5, /* PCI_CHIP_CEDAR_68E5 */
0x68E8, /* PCI_CHIP_CEDAR_68E8 */
0x68E9, /* PCI_CHIP_CEDAR_68E9 */
0x68F1, /* PCI_CHIP_CEDAR_68F1 */
0x68F8, /* PCI_CHIP_CEDAR_68F8 */
0x68F9, /* PCI_CHIP_CEDAR_68F9 */
0x68FE, /* PCI_CHIP_CEDAR_68FE */
0x68C0, /* PCI_CHIP_REDWOOD_68C0 */
0x68C1, /* PCI_CHIP_REDWOOD_68C1 */
0x68C8, /* PCI_CHIP_REDWOOD_68C8 */
0x68C9, /* PCI_CHIP_REDWOOD_68C9 */
0x68D8, /* PCI_CHIP_REDWOOD_68D8 */
0x68D9, /* PCI_CHIP_REDWOOD_68D9 */
0x68DA, /* PCI_CHIP_REDWOOD_68DA */
0x68DE, /* PCI_CHIP_REDWOOD_68DE */
0x68A0, /* PCI_CHIP_JUNIPER_68A0 */
0x68A1, /* PCI_CHIP_JUNIPER_68A1 */
0x68A8, /* PCI_CHIP_JUNIPER_68A8 */
0x68A9, /* PCI_CHIP_JUNIPER_68A9 */
0x68B0, /* PCI_CHIP_JUNIPER_68B0 */
0x68B8, /* PCI_CHIP_JUNIPER_68B8 */
0x68B9, /* PCI_CHIP_JUNIPER_68B9 */
0x68BE, /* PCI_CHIP_JUNIPER_68BE */
0x6880, /* PCI_CHIP_CYPRESS_6880 */
0x6888, /* PCI_CHIP_CYPRESS_6888 */
0x6889, /* PCI_CHIP_CYPRESS_6889 */
0x688A, /* PCI_CHIP_CYPRESS_688A */
0x6898, /* PCI_CHIP_CYPRESS_6898 */
0x6899, /* PCI_CHIP_CYPRESS_6899 */
0x689E, /* PCI_CHIP_CYPRESS_689E */
0x689C, /* PCI_CHIP_HEMLOCK_689C */
0x689D, /* PCI_CHIP_HEMLOCK_689D */
0x9802, /* PCI_CHIP_PALM_9802 */
0x9803, /* PCI_CHIP_PALM_9803 */
0x9804, /* PCI_CHIP_PALM_9804 */
0x9805, /* PCI_CHIP_PALM_9805 */
0x6720, /* PCI_CHIP_BARTS_6720 */
0x6721, /* PCI_CHIP_BARTS_6721 */
0x6722, /* PCI_CHIP_BARTS_6722 */
0x6723, /* PCI_CHIP_BARTS_6723 */
0x6724, /* PCI_CHIP_BARTS_6724 */
0x6725, /* PCI_CHIP_BARTS_6725 */
0x6726, /* PCI_CHIP_BARTS_6726 */
0x6727, /* PCI_CHIP_BARTS_6727 */
0x6728, /* PCI_CHIP_BARTS_6728 */
0x6729, /* PCI_CHIP_BARTS_6729 */
0x6738, /* PCI_CHIP_BARTS_6738 */
0x6739, /* PCI_CHIP_BARTS_6738 */
0x6740, /* PCI_CHIP_TURKS_6740 */
0x6741, /* PCI_CHIP_TURKS_6741 */
0x6742, /* PCI_CHIP_TURKS_6742 */
0x6743, /* PCI_CHIP_TURKS_6743 */
0x6744, /* PCI_CHIP_TURKS_6744 */
0x6745, /* PCI_CHIP_TURKS_6745 */
0x6746, /* PCI_CHIP_TURKS_6746 */
0x6747, /* PCI_CHIP_TURKS_6747 */
0x6748, /* PCI_CHIP_TURKS_6748 */
0x6749, /* PCI_CHIP_TURKS_6749 */
0x6750, /* PCI_CHIP_TURKS_6750 */
0x6758, /* PCI_CHIP_TURKS_6758 */
0x6759, /* PCI_CHIP_TURKS_6759 */
0x6760, /* PCI_CHIP_CAICOS_6760 */
0x6761, /* PCI_CHIP_CAICOS_6761 */
0x6762, /* PCI_CHIP_CAICOS_6762 */
0x6763, /* PCI_CHIP_CAICOS_6763 */
0x6764, /* PCI_CHIP_CAICOS_6764 */
0x6765, /* PCI_CHIP_CAICOS_6765 */
0x6766, /* PCI_CHIP_CAICOS_6766 */
0x6767, /* PCI_CHIP_CAICOS_6767 */
0x6768, /* PCI_CHIP_CAICOS_6768 */
0x6770, /* PCI_CHIP_CAICOS_6770 */
0x6779, /* PCI_CHIP_CAICOS_6779 */
};
const struct dri2_driver_map driver_map[] = {
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
};
static char *
dri2_get_device_name(int fd)
{
struct udev *udev;
struct udev_device *device;
struct stat buf;
char *device_name;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
goto out;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
}
device_name = udev_device_get_devnode(device);
if (!device_name)
goto out;
device_name = strdup(device_name);
out:
udev_device_unref(device);
udev_unref(udev);
return device_name;
}
char *
dri2_get_driver_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device, *parent;
struct stat buf;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
goto out;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
}
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL || sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; i < ARRAY_SIZE(driver_map); i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
}
static int
dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
return drmAuthMagic(dri2_dpy->fd, id);
}
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
int i;
dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->fd = (int) disp->PlatformDisplay;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL)
return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
dri2_dpy->device_name = dri2_get_device_name(dri2_dpy->fd);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
}
if (!dri2_load_driver(disp))
goto cleanup_device_name;
dri2_dpy->extensions[0] = &image_lookup_extension.base;
dri2_dpy->extensions[1] = &use_invalidate.base;
dri2_dpy->extensions[2] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
#endif
dri2_dpy->authenticate = dri2_drm_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
return EGL_FALSE;
}
#endif

View File

@@ -1,704 +0,0 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include "egl_dri2.h"
#include <wayland-client.h>
#include "wayland-drm-client-protocol.h"
static void
sync_callback(void *data)
{
int *done = data;
*done = 1;
}
static void
force_roundtrip(struct wl_display *display)
{
int done = 0;
wl_display_sync_callback(display, sync_callback, &done);
wl_display_iterate(display, WL_DISPLAY_WRITABLE);
while (!done)
wl_display_iterate(display, WL_DISPLAY_READABLE);
}
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
struct dri2_egl_buffer *dri2_buf;
int i;
(void) drv;
dri2_surf = malloc(sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
for (i = 0; i < WL_BUFFER_COUNT; ++i)
dri2_surf->wl_drm_buffer[i] = NULL;
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
dri2_surf->dri_buffers[i] = NULL;
dri2_surf->pending_buffer = NULL;
dri2_surf->block_swap_buffers = EGL_FALSE;
switch (type) {
case EGL_WINDOW_BIT:
dri2_surf->wl_win = (struct wl_egl_window *) window;
dri2_surf->type = DRI2_WINDOW_SURFACE;
dri2_surf->base.Width = -1;
dri2_surf->base.Height = -1;
break;
case EGL_PIXMAP_BIT:
dri2_surf->wl_pix = (struct wl_egl_pixmap *) window;
dri2_surf->type = DRI2_PIXMAP_SURFACE;
dri2_surf->base.Width = dri2_surf->wl_pix->width;
dri2_surf->base.Height = dri2_surf->wl_pix->height;
if (dri2_surf->wl_pix->name > 0) {
dri2_buf = dri2_surf->wl_pix->driver_private;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer;
}
break;
default:
goto cleanup_surf;
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
type == EGL_WINDOW_BIT ?
dri2_conf->dri_double_config :
dri2_conf->dri_single_config,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_dri_drawable;
}
return &dri2_surf->base;
cleanup_dri_drawable:
dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
cleanup_surf:
free(dri2_surf);
return NULL;
}
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
}
static _EGLSurface *
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
pixmap, attrib_list);
}
/**
* Called via eglDestroySurface(), drv->API.DestroySurface().
*/
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
int i;
(void) drv;
if (!_eglPutSurface(surf))
return EGL_TRUE;
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
for (i = 0; i < WL_BUFFER_COUNT; ++i)
if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
if (dri2_surf->dri_buffers[i] && !(i == __DRI_BUFFER_FRONT_LEFT &&
dri2_surf->type == DRI2_PIXMAP_SURFACE))
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
free(surf);
return EGL_TRUE;
}
static void
dri2_wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
{
struct dri2_egl_buffer *dri2_buf = egl_pixmap->driver_private;
assert(dri2_buf);
dri2_buf->dri2_dpy->dri2->releaseBuffer(dri2_buf->dri2_dpy->dri_screen,
dri2_buf->dri_buffer);
free(dri2_buf);
egl_pixmap->driver_private = NULL;
egl_pixmap->destroy = NULL;
egl_pixmap->name = 0;
}
static void
dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
(void) format;
switch (dri2_surf->type) {
case DRI2_WINDOW_SURFACE:
/* allocate a front buffer for our double-buffered window*/
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, format,
dri2_surf->base.Width, dri2_surf->base.Height);
break;
default:
break;
}
}
static void
dri2_process_front_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct dri2_egl_buffer *dri2_buf;
switch (dri2_surf->type) {
case DRI2_PIXMAP_SURFACE:
dri2_buf = malloc(sizeof *dri2_buf);
if (!dri2_buf)
return;
dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT];
dri2_buf->dri2_dpy = dri2_dpy;
dri2_surf->wl_pix->name = dri2_buf->dri_buffer->name;
dri2_surf->wl_pix->stride = dri2_buf->dri_buffer->pitch;
dri2_surf->wl_pix->driver_private = dri2_buf;
dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy;
break;
default:
break;
}
}
static void
dri2_release_pending_buffer(void *data)
{
struct dri2_egl_surface *dri2_surf = data;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
/* FIXME: print internal error */
if (!dri2_surf->pending_buffer)
return;
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->pending_buffer);
dri2_surf->pending_buffer = NULL;
}
static void
dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
if (dri2_surf->dri_buffers[i]) {
switch (i) {
case __DRI_BUFFER_FRONT_LEFT:
if (dri2_surf->pending_buffer)
force_roundtrip(dri2_dpy->wl_dpy->display);
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
wl_display_sync_callback(dri2_dpy->wl_dpy->display,
dri2_release_pending_buffer, dri2_surf);
break;
default:
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
break;
}
dri2_surf->dri_buffers[i] = NULL;
}
}
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
if (dri2_surf->type == DRI2_WINDOW_SURFACE &&
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
dri2_surf->base.Height != dri2_surf->wl_win->height)) {
dri2_release_buffers(dri2_surf);
dri2_surf->base.Width = dri2_surf->wl_win->width;
dri2_surf->base.Height = dri2_surf->wl_win->height;
dri2_surf->dx = dri2_surf->wl_win->dx;
dri2_surf->dy = dri2_surf->wl_win->dy;
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
dri2_surf->wl_drm_buffer[i] = NULL;
}
}
dri2_surf->buffer_count = 0;
for (i = 0; i < 2*count; i+=2) {
assert(attachments[i] < __DRI_BUFFER_COUNT);
assert(dri2_surf->buffer_count < 5);
if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
dri2_surf->dri_buffers[attachments[i]] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
attachments[i], attachments[i+1],
dri2_surf->base.Width, dri2_surf->base.Height);
if (!dri2_surf->dri_buffers[attachments[i]])
continue;
if (attachments[i] == __DRI_BUFFER_FRONT_LEFT)
dri2_process_front_buffer(dri2_surf, attachments[i+1]);
else if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
dri2_process_back_buffer(dri2_surf, attachments[i+1]);
}
memcpy(&dri2_surf->buffers[dri2_surf->buffer_count],
dri2_surf->dri_buffers[attachments[i]],
sizeof(__DRIbuffer));
dri2_surf->buffer_count++;
}
assert(dri2_surf->type == DRI2_PIXMAP_SURFACE ||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
*out_count = dri2_surf->buffer_count;
if (dri2_surf->buffer_count == 0)
return NULL;
*width = dri2_surf->base.Width;
*height = dri2_surf->base.Height;
return dri2_surf->buffers;
}
static __DRIbuffer *
dri2_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
const unsigned int format = 32;
int i;
attachments_with_format = calloc(count * 2, sizeof(unsigned int));
if (!attachments_with_format) {
*out_count = 0;
return NULL;
}
for (i = 0; i < count; ++i) {
attachments_with_format[2*i] = attachments[i];
attachments_with_format[2*i + 1] = format;
}
buffer =
dri2_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
free(attachments_with_format);
return buffer;
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
/* FIXME: Does EGL support front buffer rendering at all? */
#if 0
struct dri2_egl_surface *dri2_surf = loaderPrivate;
dri2WaitGL(dri2_surf);
#else
(void) loaderPrivate;
#endif
}
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
return wl_drm_create_buffer(dri2_dpy->wl_dpy->drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, dri2_surf->wl_win->visual);
}
static void
wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
{
struct dri2_egl_surface *dri2_surf = data;
dri2_surf->block_swap_buffers = EGL_FALSE;
}
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
/**
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/
static EGLBoolean
dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
while (dri2_surf->block_swap_buffers)
wl_display_iterate(dri2_dpy->wl_dpy->display, WL_DISPLAY_READABLE);
dri2_surf->block_swap_buffers = EGL_TRUE;
wl_display_frame_callback(dri2_dpy->wl_dpy->display,
dri2_surf->wl_win->surface,
wayland_frame_callback, dri2_surf);
if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
pointer_swap(
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]->attachment =
__DRI_BUFFER_FRONT_LEFT;
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
__DRI_BUFFER_BACK_LEFT;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
(const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_BACK]);
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);
wl_surface_attach(dri2_surf->wl_win->surface,
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
dri2_surf->dx, dri2_surf->dy);
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
/* reset resize growing parameters */
dri2_surf->dx = 0;
dri2_surf->dy = 0;
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
}
_EGLContext *ctx;
if (dri2_drv->glFlush) {
ctx = _eglGetCurrentContext();
if (ctx && ctx->DrawSurface == &dri2_surf->base)
dri2_drv->glFlush();
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return EGL_TRUE;
}
/**
* Called via eglCreateImageKHR(), drv->API.CreateImageKHR().
*/
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct wl_egl_pixmap *wl_egl_pixmap = (struct wl_egl_pixmap *) buffer;
struct dri2_egl_buffer *dri2_buf;
EGLint wl_attr_list[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
EGL_DRM_BUFFER_STRIDE_MESA, 0,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
EGL_NONE
};
dri2_buf = malloc(sizeof *dri2_buf);
if (!dri2_buf)
return NULL;
dri2_buf->dri2_dpy = dri2_dpy;
dri2_buf->dri_buffer =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, 32,
wl_egl_pixmap->width,
wl_egl_pixmap->height);
wl_egl_pixmap->name = dri2_buf->dri_buffer->name;
wl_egl_pixmap->stride = dri2_buf->dri_buffer->pitch;
wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy;
wl_egl_pixmap->driver_private = dri2_buf;
wl_attr_list[1] = wl_egl_pixmap->width;
wl_attr_list[3] = wl_egl_pixmap->height;
wl_attr_list[5] = wl_egl_pixmap->stride / 4;
return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA,
(EGLClientBuffer)(intptr_t) wl_egl_pixmap->name, wl_attr_list);
}
static _EGLImage *
dri2_wayland_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
(void) drv;
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
}
}
static int
dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0;
dri2_dpy->wl_dpy->authenticated = false;
wl_drm_authenticate(dri2_dpy->wl_dpy->drm, id);
force_roundtrip(dri2_dpy->wl_dpy->display);
if (!dri2_dpy->wl_dpy->authenticated)
ret = -1;
/* reset authenticated */
dri2_dpy->wl_dpy->authenticated = true;
return ret;
}
/**
* Called via eglTerminate(), drv->API.Terminate().
*/
static EGLBoolean
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
free(dri2_dpy->driver_name);
free(dri2_dpy);
disp->DriverData = NULL;
return EGL_TRUE;
}
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
int i;
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.CreateImageKHR = dri2_wayland_create_image_khr;
drv->API.Terminate = dri2_terminate;
dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->wl_dpy = disp->PlatformDisplay;
if (dri2_dpy->wl_dpy->fd == -1)
force_roundtrip(dri2_dpy->wl_dpy->display);
if (dri2_dpy->wl_dpy->fd == -1)
goto cleanup_dpy;
dri2_dpy->fd = dup(dri2_dpy->wl_dpy->fd);
if (dri2_dpy->fd < 0) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to dup fd");
goto cleanup_dpy;
}
if (!dri2_dpy->wl_dpy->authenticated)
force_roundtrip(dri2_dpy->wl_dpy->display);
if (!dri2_dpy->wl_dpy->authenticated)
goto cleanup_dpy;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
goto cleanup_fd;
}
dri2_dpy->device_name = strdup(dri2_dpy->wl_dpy->device_name);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
}
if (!dri2_load_driver(disp))
goto cleanup_device_name;
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
dri2_get_buffers_with_format;
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_lookup_extension.base;
dri2_dpy->extensions[2] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0,
EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL);
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
dri2_dpy->authenticate = dri2_wayland_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
cleanup_fd:
close(dri2_dpy->fd);
cleanup_dpy:
free(dri2_dpy);
return EGL_FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_glx
EGL_DRIVER = egl_glx.so
EGL_SOURCES = egl_glx.c
EGL_INCLUDES = \
@@ -11,9 +11,6 @@ EGL_INCLUDES = \
-I$(TOP)/src/egl/main
EGL_CFLAGS = $(X11_CFLAGS)
EGL_LIBS = $(X11_LIBS) $(DLOPEN_LIBS)
EGL_CFLAGS += -D_EGL_MAIN=_eglBuiltInDriverGLX
EGL_BUILTIN = true
EGL_LIBS = $(X11_LIBS) -lGL
include ../Makefile.template

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,6 @@ SOURCES = \
eglcurrent.c \
egldisplay.c \
egldriver.c \
eglfallbacks.c \
eglglobals.c \
eglimage.c \
egllog.c \
@@ -52,31 +51,12 @@ OBJECTS = $(SOURCES:.c=.o)
# use dl*() to load drivers
LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
LOCAL_LIBS =
# egl_dri2 and egl_glx are built-ins
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a
EGL_LIB_DEPS += $(X11_LIBS) $(DLOPEN_LIBS)
endif
# translate --with-egl-platforms to _EGLPlatformType
EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
ifeq ($(firstword $(EGL_PLATFORMS)),x11)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
endif
ifeq ($(firstword $(EGL_PLATFORMS)),wayland)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WAYLAND
endif
ifeq ($(firstword $(EGL_PLATFORMS)),drm)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
endif
@@ -99,12 +79,11 @@ default: depend library
# EGL Library
library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS)
$(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(EGL_MAJOR) -minor $(EGL_MINOR) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-L$(TOP)/$(LIB_DIR) $(EGL_LIB_DEPS) \
$(OBJECTS) $(LOCAL_LIBS)
$(EGL_LIB_DEPS) $(OBJECTS)
install-headers:
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR

View File

@@ -4,53 +4,48 @@
Import('*')
env = env.Clone()
if env['platform'] != 'winddk':
env.Append(CPPDEFINES = [
'_EGL_BUILT_IN_DRIVER_GALLIUM',
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
])
env = env.Clone()
if env['platform'] == 'windows':
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
else:
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11',
'_EGL_OS_UNIX',
])
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
env.Append(CPPPATH = [
'#/include',
])
env.Append(CPPPATH = [
'#/include',
])
egl_sources = [
'eglapi.c',
'eglarray.c',
'eglconfig.c',
'eglcontext.c',
'eglcurrent.c',
'egldisplay.c',
'egldriver.c',
'eglfallbacks.c',
'eglglobals.c',
'eglimage.c',
'egllog.c',
'eglmisc.c',
'eglmode.c',
'eglscreen.c',
'eglstring.c',
'eglsurface.c',
'eglsync.c',
]
egl_sources = [
'eglapi.c',
'eglarray.c',
'eglconfig.c',
'eglcontext.c',
'eglcurrent.c',
'egldisplay.c',
'egldriver.c',
'eglglobals.c',
'eglimage.c',
'egllog.c',
'eglmisc.c',
'eglmode.c',
'eglscreen.c',
'eglstring.c',
'eglsurface.c',
'eglsync.c',
]
egl = env.ConvenienceLibrary(
target = 'egl',
source = egl_sources,
)
egl = env.SharedLibrary(
target = 'libEGL',
source = egl_sources + ['egl.def'],
)
Export('egl')
env.InstallSharedLibrary(egl, version=(1, 4, 0))
egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')]
Export('egl')

View File

@@ -57,6 +57,7 @@
#include <stdlib.h>
#include <string.h>
#include "eglstring.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egltypedefs.h"
@@ -293,14 +294,16 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
if (!_eglMatchDriver(disp, EGL_FALSE))
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
_eglsnprintf(disp->Version, sizeof(disp->Version), "%d.%d (%s)",
disp->APImajor, disp->APIminor, disp->Driver->Name);
/* limit to APIs supported by core */
disp->ClientAPIs &= _EGL_API_ALL_BITS;
disp->ClientAPIsMask &= _EGL_API_ALL_BITS;
}
/* Update applications version of major and minor if not NULL */
if ((major != NULL) && (minor != NULL)) {
*major = disp->VersionMajor;
*minor = disp->VersionMinor;
*major = disp->APImajor;
*minor = disp->APIminor;
}
RETURN_EGL_SUCCESS(disp, EGL_TRUE);
@@ -413,7 +416,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
context = drv->API.CreateContext(drv, disp, conf, share, attrib_list);
ret = (context) ? _eglLinkContext(context) : EGL_NO_CONTEXT;
ret = (context) ? _eglLinkContext(context, disp) : EGL_NO_CONTEXT;
RETURN_EGL_EVAL(disp, ret);
}
@@ -512,7 +515,7 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -533,7 +536,7 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -552,7 +555,7 @@ eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
surf = drv->API.CreatePbufferSurface(drv, disp, conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -645,12 +648,11 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval)
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
ctx->Resource.Display != disp)
if (!ctx || !_eglIsContextLinked(ctx) || ctx->Resource.Display != disp)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
surf = ctx->DrawSurface;
if (_eglGetSurfaceHandle(surf) == EGL_NO_SURFACE)
if (!_eglIsSurfaceLinked(surf))
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
ret = drv->API.SwapInterval(drv, disp, surf, interval);
@@ -671,8 +673,7 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
/* surface must be bound to current context in EGL 1.4 */
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
surf != ctx->DrawSurface)
if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
ret = drv->API.SwapBuffers(drv, disp, surf);
@@ -713,8 +714,7 @@ eglWaitClient(void)
_eglLockMutex(&disp->Mutex);
/* let bad current context imply bad current surface */
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
_eglGetSurfaceHandle(ctx->DrawSurface) == EGL_NO_SURFACE)
if (!_eglIsContextLinked(ctx) || !_eglIsSurfaceLinked(ctx->DrawSurface))
RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
/* a valid current context implies an initialized current display */
@@ -763,8 +763,7 @@ eglWaitNative(EGLint engine)
_eglLockMutex(&disp->Mutex);
/* let bad current context imply bad current surface */
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
_eglGetSurfaceHandle(ctx->DrawSurface) == EGL_NO_SURFACE)
if (!_eglIsContextLinked(ctx) || !_eglIsSurfaceLinked(ctx->DrawSurface))
RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
/* a valid current context implies an initialized current display */
@@ -913,10 +912,6 @@ eglGetProcAddress(const char *procname)
#ifdef EGL_MESA_drm_image
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
#endif
#ifdef EGL_WL_bind_display
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
#endif
{ NULL, NULL }
};
@@ -1048,7 +1043,7 @@ eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
surf = drv->API.CreateScreenSurfaceMESA(drv, disp, conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1240,7 +1235,7 @@ eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer,
conf, attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1303,7 +1298,7 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
img = drv->API.CreateImageKHR(drv,
disp, context, target, buffer, attr_list);
ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR;
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1349,7 +1344,7 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
sync = drv->API.CreateSyncKHR(drv, disp, type, attrib_list);
ret = (sync) ? _eglLinkSync(sync) : EGL_NO_SYNC_KHR;
ret = (sync) ? _eglLinkSync(sync, disp) : EGL_NO_SYNC_KHR;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1442,8 +1437,7 @@ eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface,
RETURN_EGL_EVAL(disp, EGL_FALSE);
/* surface must be bound to current context in EGL 1.4 */
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
surf != ctx->DrawSurface)
if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
ret = drv->API.SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
@@ -1469,7 +1463,7 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list)
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
img = drv->API.CreateDRMImageMESA(drv, disp, attr_list);
ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR;
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR;
RETURN_EGL_EVAL(disp, ret);
}
@@ -1495,43 +1489,3 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
}
#endif
#ifdef EGL_WL_bind_wayland_display
struct wl_display;
EGLBoolean EGLAPIENTRY
eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!display)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.BindWaylandDisplayWL(drv, disp, display);
RETURN_EGL_EVAL(disp, ret);
}
EGLBoolean EGLAPIENTRY
eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!display)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.UnbindWaylandDisplayWL(drv, disp, display);
RETURN_EGL_EVAL(disp, ret);
}
#endif

View File

@@ -12,7 +12,7 @@ typedef void (*_EGLProc)(void);
*/
/* driver funcs */
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, _EGLDisplay *dpy);
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, _EGLDisplay *dpy, EGLint *major, EGLint *minor);
typedef EGLBoolean (*Terminate_t)(_EGLDriver *, _EGLDisplay *dpy);
/* config funcs */
@@ -95,12 +95,6 @@ typedef _EGLImage *(*CreateDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, c
typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifdef EGL_WL_bind_wayland_display
struct wl_display;
typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
#endif
/**
* The API dispatcher jumps through these functions
*/
@@ -175,11 +169,6 @@ struct _egl_api
CreateDRMImageMESA_t CreateDRMImageMESA;
ExportDRMImageMESA_t ExportDRMImageMESA;
#endif
#ifdef EGL_WL_bind_wayland_display
BindWaylandDisplayWL_t BindWaylandDisplayWL;
UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL;
#endif
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -118,39 +118,38 @@ _eglFindArray(_EGLArray *array, void *elem)
/**
* Filter an array and return the number of filtered elements.
* Filter an array and return the filtered data. The returned data pointer
* should be freed.
*/
EGLint
_eglFilterArray(_EGLArray *array, void **data, EGLint size,
void **
_eglFilterArray(_EGLArray *array, EGLint *size,
_EGLArrayForEach filter, void *filter_data)
{
void **data;
EGLint count = 0, i;
if (!array)
return 0;
if (!array) {
*size = 0;
return malloc(0);
}
data = malloc(array->Size * sizeof(array->Elements[0]));
if (!data)
return NULL;
if (filter) {
for (i = 0; i < array->Size; i++) {
if (filter(array->Elements[i], filter_data)) {
if (data && count < size)
data[count] = array->Elements[i];
count++;
}
if (data && count >= size)
break;
if (filter(array->Elements[i], filter_data))
data[count++] = array->Elements[i];
}
}
else {
if (data) {
count = (size < array->Size) ? size : array->Size;
memcpy(data, array->Elements, count * sizeof(array->Elements[0]));
}
else {
count = array->Size;
}
memcpy(data, array->Elements, array->Size * sizeof(array->Elements[0]));
}
return count;
*size = count;
return data;
}

View File

@@ -37,8 +37,8 @@ void *
_eglFindArray(_EGLArray *array, void *elem);
PUBLIC EGLint
_eglFilterArray(_EGLArray *array, void **data, EGLint size,
void **
_eglFilterArray(_EGLArray *array, EGLint *size,
_EGLArrayForEach filter, void *filter_data);

View File

@@ -24,34 +24,34 @@
* IDs are from 1 to N respectively.
*/
void
_eglInitConfig(_EGLConfig *conf, _EGLDisplay *dpy, EGLint id)
_eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id)
{
memset(conf, 0, sizeof(*conf));
memset(config, 0, sizeof(*config));
conf->Display = dpy;
config->Display = dpy;
/* some attributes take non-zero default values */
conf->ConfigID = id;
conf->ConfigCaveat = EGL_NONE;
conf->TransparentType = EGL_NONE;
conf->NativeVisualType = EGL_NONE;
conf->ColorBufferType = EGL_RGB_BUFFER;
SET_CONFIG_ATTRIB(config, EGL_CONFIG_ID, id);
SET_CONFIG_ATTRIB(config, EGL_CONFIG_CAVEAT, EGL_NONE);
SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_TYPE, EGL_NONE);
SET_CONFIG_ATTRIB(config, EGL_NATIVE_VISUAL_TYPE, EGL_NONE);
#ifdef EGL_VERSION_1_2
SET_CONFIG_ATTRIB(config, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER);
#endif /* EGL_VERSION_1_2 */
}
/**
* Link a config to its display and return the handle of the link.
* Link a config to a display and return the handle of the link.
* The handle can be passed to client directly.
*
* Note that we just save the ptr to the config (we don't copy the config).
*/
PUBLIC EGLConfig
_eglLinkConfig(_EGLConfig *conf)
EGLConfig
_eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf)
{
_EGLDisplay *dpy = conf->Display;
/* sanity check */
assert(dpy && conf->ConfigID > 0);
assert(GET_CONFIG_ATTRIB(conf, EGL_CONFIG_ID) > 0);
if (!dpy->Configs) {
dpy->Configs = _eglCreateArray("Config", 16);
@@ -59,29 +59,23 @@ _eglLinkConfig(_EGLConfig *conf)
return (EGLConfig) NULL;
}
conf->Display = dpy;
_eglAppendArray(dpy->Configs, (void *) conf);
return (EGLConfig) conf;
}
/**
* Lookup a handle to find the linked config.
* Return NULL if the handle has no corresponding linked config.
*/
_EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy)
EGLBoolean
_eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy)
{
_EGLConfig *conf;
if (!dpy)
return NULL;
conf = (_EGLConfig *) _eglFindArray(dpy->Configs, (void *) config);
if (conf)
assert(conf->Display == dpy);
return conf;
return (conf != NULL);
}
@@ -110,7 +104,6 @@ static const struct {
EGLint default_value;
} _eglValidationTable[] =
{
/* core */
{ EGL_BUFFER_SIZE, ATTRIB_TYPE_INTEGER,
ATTRIB_CRITERION_ATLEAST,
0 },
@@ -207,13 +200,22 @@ static const struct {
{ EGL_TRANSPARENT_BLUE_VALUE, ATTRIB_TYPE_INTEGER,
ATTRIB_CRITERION_EXACT,
EGL_DONT_CARE },
/* these are not real attributes */
{ EGL_MATCH_NATIVE_PIXMAP, ATTRIB_TYPE_PSEUDO,
ATTRIB_CRITERION_SPECIAL,
EGL_NONE },
/* extensions */
/* there is a gap before EGL_SAMPLES */
{ 0x3030, ATTRIB_TYPE_PSEUDO,
ATTRIB_CRITERION_IGNORE,
0 },
{ EGL_NONE, ATTRIB_TYPE_PSEUDO,
ATTRIB_CRITERION_IGNORE,
0 },
{ EGL_Y_INVERTED_NOK, ATTRIB_TYPE_BOOLEAN,
ATTRIB_CRITERION_EXACT,
EGL_DONT_CARE }
EGL_DONT_CARE },
};
@@ -230,13 +232,18 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
{
EGLint i, attr, val;
EGLBoolean valid = EGL_TRUE;
EGLint red_size = 0, green_size = 0, blue_size = 0, luminance_size = 0;
EGLint alpha_size = 0, buffer_size = 0;
/* all attributes should have been listed */
assert(ARRAY_SIZE(_eglValidationTable) == _EGL_CONFIG_NUM_ATTRIBS);
/* check attributes by their types */
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
EGLint mask;
attr = _eglValidationTable[i].attr;
val = _eglGetConfigKey(conf, attr);
val = GET_CONFIG_ATTRIB(conf, attr);
switch (_eglValidationTable[i].type) {
case ATTRIB_TYPE_INTEGER:
@@ -248,14 +255,30 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
break;
case EGL_SAMPLE_BUFFERS:
/* there can be at most 1 sample buffer */
if (val > 1 || val < 0)
if (val > 1)
valid = EGL_FALSE;
break;
default:
if (val < 0)
valid = EGL_FALSE;
case EGL_RED_SIZE:
red_size = val;
break;
case EGL_GREEN_SIZE:
green_size = val;
break;
case EGL_BLUE_SIZE:
blue_size = val;
break;
case EGL_LUMINANCE_SIZE:
luminance_size = val;
break;
case EGL_ALPHA_SIZE:
alpha_size = val;
break;
case EGL_BUFFER_SIZE:
buffer_size = val;
break;
}
if (val < 0)
valid = EGL_FALSE;
break;
case ATTRIB_TYPE_BOOLEAN:
if (val != EGL_TRUE && val != EGL_FALSE)
@@ -343,18 +366,17 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
/* now check for conflicting attribute values */
switch (conf->ColorBufferType) {
switch (GET_CONFIG_ATTRIB(conf, EGL_COLOR_BUFFER_TYPE)) {
case EGL_RGB_BUFFER:
if (conf->LuminanceSize)
if (luminance_size)
valid = EGL_FALSE;
if (conf->RedSize + conf->GreenSize +
conf->BlueSize + conf->AlphaSize != conf->BufferSize)
if (red_size + green_size + blue_size + alpha_size != buffer_size)
valid = EGL_FALSE;
break;
case EGL_LUMINANCE_BUFFER:
if (conf->RedSize || conf->GreenSize || conf->BlueSize)
if (red_size || green_size || blue_size)
valid = EGL_FALSE;
if (conf->LuminanceSize + conf->AlphaSize != conf->BufferSize)
if (luminance_size + alpha_size != buffer_size)
valid = EGL_FALSE;
break;
}
@@ -363,19 +385,23 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
return EGL_FALSE;
}
if (!conf->SampleBuffers && conf->Samples)
val = GET_CONFIG_ATTRIB(conf, EGL_SAMPLE_BUFFERS);
if (!val && GET_CONFIG_ATTRIB(conf, EGL_SAMPLES))
valid = EGL_FALSE;
if (!valid) {
_eglLog(_EGL_DEBUG, "conflicting samples and sample buffers");
return EGL_FALSE;
}
if (!(conf->SurfaceType & EGL_WINDOW_BIT)) {
if (conf->NativeVisualID != 0 || conf->NativeVisualType != EGL_NONE)
val = GET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE);
if (!(val & EGL_WINDOW_BIT)) {
if (GET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_ID) != 0 ||
GET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE) != EGL_NONE)
valid = EGL_FALSE;
}
if (!(conf->SurfaceType & EGL_PBUFFER_BIT)) {
if (conf->BindToTextureRGB || conf->BindToTextureRGBA)
if (!(val & EGL_PBUFFER_BIT)) {
if (GET_CONFIG_ATTRIB(conf, EGL_BIND_TO_TEXTURE_RGB) ||
GET_CONFIG_ATTRIB(conf, EGL_BIND_TO_TEXTURE_RGBA))
valid = EGL_FALSE;
}
if (!valid) {
@@ -407,11 +433,11 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria)
continue;
attr = _eglValidationTable[i].attr;
cmp = _eglGetConfigKey(criteria, attr);
cmp = GET_CONFIG_ATTRIB(criteria, attr);
if (cmp == EGL_DONT_CARE)
continue;
val = _eglGetConfigKey(conf, attr);
val = GET_CONFIG_ATTRIB(conf, attr);
switch (_eglValidationTable[i].criterion) {
case ATTRIB_CRITERION_EXACT:
if (val != cmp)
@@ -452,11 +478,16 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria)
static INLINE EGLBoolean
_eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
{
if (_eglOffsetOfConfig(attr) < 0)
if (_eglIndexConfig(conf, attr) < 0)
return EGL_FALSE;
/* there are some holes in the range */
switch (attr) {
case 0x3030 /* a gap before EGL_SAMPLES */:
case EGL_NONE:
#ifdef EGL_VERSION_1_4
case EGL_MATCH_NATIVE_PIXMAP:
#endif
return EGL_FALSE;
case EGL_Y_INVERTED_NOK:
return conf->Display->Extensions.NOK_texture_from_pixmap;
@@ -472,18 +503,18 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
* Return EGL_FALSE if any of the attribute is invalid.
*/
EGLBoolean
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
const EGLint *attrib_list)
_eglParseConfigAttribList(_EGLConfig *conf, const EGLint *attrib_list)
{
EGLint attr, val, i;
_eglInitConfig(conf, dpy, EGL_DONT_CARE);
EGLint config_id = 0, level = 0;
EGLBoolean has_native_visual_type = EGL_FALSE;
EGLBoolean has_transparent_color = EGL_FALSE;
/* reset to default values */
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
attr = _eglValidationTable[i].attr;
val = _eglValidationTable[i].default_value;
_eglSetConfigKey(conf, attr, val);
SET_CONFIG_ATTRIB(conf, attr, val);
}
/* parse the list */
@@ -493,33 +524,59 @@ _eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
if (!_eglIsConfigAttribValid(conf, attr))
return EGL_FALSE;
SET_CONFIG_ATTRIB(conf, attr, val);
_eglSetConfigKey(conf, attr, val);
/* rememeber some attributes for post-processing */
switch (attr) {
case EGL_CONFIG_ID:
config_id = val;
break;
case EGL_LEVEL:
level = val;
break;
case EGL_NATIVE_VISUAL_TYPE:
has_native_visual_type = EGL_TRUE;
break;
case EGL_TRANSPARENT_RED_VALUE:
case EGL_TRANSPARENT_GREEN_VALUE:
case EGL_TRANSPARENT_BLUE_VALUE:
has_transparent_color = EGL_TRUE;
break;
default:
break;
}
}
if (!_eglValidateConfig(conf, EGL_TRUE))
return EGL_FALSE;
/* the spec says that EGL_LEVEL cannot be EGL_DONT_CARE */
if (conf->Level == EGL_DONT_CARE)
if (level == EGL_DONT_CARE)
return EGL_FALSE;
/* ignore other attributes when EGL_CONFIG_ID is given */
if (conf->ConfigID != EGL_DONT_CARE) {
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
attr = _eglValidationTable[i].attr;
if (attr != EGL_CONFIG_ID)
_eglSetConfigKey(conf, attr, EGL_DONT_CARE);
}
if (config_id > 0) {
_eglResetConfigKeys(conf, EGL_DONT_CARE);
SET_CONFIG_ATTRIB(conf, EGL_CONFIG_ID, config_id);
}
else {
if (!(conf->SurfaceType & EGL_WINDOW_BIT))
conf->NativeVisualType = EGL_DONT_CARE;
if (has_native_visual_type) {
val = GET_CONFIG_ATTRIB(conf, EGL_SURFACE_TYPE);
if (!(val & EGL_WINDOW_BIT))
SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE);
}
if (conf->TransparentType == EGL_NONE) {
conf->TransparentRedValue = EGL_DONT_CARE;
conf->TransparentGreenValue = EGL_DONT_CARE;
conf->TransparentBlueValue = EGL_DONT_CARE;
if (has_transparent_color) {
val = GET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_TYPE);
if (val == EGL_NONE) {
SET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_RED_VALUE,
EGL_DONT_CARE);
SET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_GREEN_VALUE,
EGL_DONT_CARE);
SET_CONFIG_ATTRIB(conf, EGL_TRANSPARENT_BLUE_VALUE,
EGL_DONT_CARE);
}
}
}
@@ -553,6 +610,7 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
EGL_ALPHA_MASK_SIZE,
};
EGLint val1, val2;
EGLBoolean rgb_buffer;
EGLint i;
if (conf1 == conf2)
@@ -561,41 +619,44 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
/* the enum values have the desired ordering */
assert(EGL_NONE < EGL_SLOW_CONFIG);
assert(EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG);
val1 = conf1->ConfigCaveat - conf2->ConfigCaveat;
if (val1)
return val1;
val1 = GET_CONFIG_ATTRIB(conf1, EGL_CONFIG_CAVEAT);
val2 = GET_CONFIG_ATTRIB(conf2, EGL_CONFIG_CAVEAT);
if (val1 != val2)
return (val1 - val2);
/* the enum values have the desired ordering */
assert(EGL_RGB_BUFFER < EGL_LUMINANCE_BUFFER);
val1 = conf1->ColorBufferType - conf2->ColorBufferType;
if (val1)
return val1;
val1 = GET_CONFIG_ATTRIB(conf1, EGL_COLOR_BUFFER_TYPE);
val2 = GET_CONFIG_ATTRIB(conf2, EGL_COLOR_BUFFER_TYPE);
if (val1 != val2)
return (val1 - val2);
rgb_buffer = (val1 == EGL_RGB_BUFFER);
if (criteria) {
val1 = val2 = 0;
if (conf1->ColorBufferType == EGL_RGB_BUFFER) {
if (criteria->RedSize > 0) {
val1 += conf1->RedSize;
val2 += conf2->RedSize;
if (rgb_buffer) {
if (GET_CONFIG_ATTRIB(criteria, EGL_RED_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_RED_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_RED_SIZE);
}
if (criteria->GreenSize > 0) {
val1 += conf1->GreenSize;
val2 += conf2->GreenSize;
if (GET_CONFIG_ATTRIB(criteria, EGL_GREEN_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_GREEN_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_GREEN_SIZE);
}
if (criteria->BlueSize > 0) {
val1 += conf1->BlueSize;
val2 += conf2->BlueSize;
if (GET_CONFIG_ATTRIB(criteria, EGL_BLUE_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_BLUE_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_BLUE_SIZE);
}
}
else {
if (criteria->LuminanceSize > 0) {
val1 += conf1->LuminanceSize;
val2 += conf2->LuminanceSize;
if (GET_CONFIG_ATTRIB(criteria, EGL_LUMINANCE_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_LUMINANCE_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_LUMINANCE_SIZE);
}
}
if (criteria->AlphaSize > 0) {
val1 += conf1->AlphaSize;
val2 += conf2->AlphaSize;
if (GET_CONFIG_ATTRIB(criteria, EGL_ALPHA_SIZE) > 0) {
val1 += GET_CONFIG_ATTRIB(conf1, EGL_ALPHA_SIZE);
val2 += GET_CONFIG_ATTRIB(conf2, EGL_ALPHA_SIZE);
}
}
else {
@@ -608,15 +669,24 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
return (val2 - val1);
for (i = 0; i < ARRAY_SIZE(compare_attribs); i++) {
val1 = _eglGetConfigKey(conf1, compare_attribs[i]);
val2 = _eglGetConfigKey(conf2, compare_attribs[i]);
val1 = GET_CONFIG_ATTRIB(conf1, compare_attribs[i]);
val2 = GET_CONFIG_ATTRIB(conf2, compare_attribs[i]);
if (val1 != val2)
return (val1 - val2);
}
/* EGL_NATIVE_VISUAL_TYPE cannot be compared here */
return (compare_id) ? (conf1->ConfigID - conf2->ConfigID) : 0;
if (compare_id) {
val1 = GET_CONFIG_ATTRIB(conf1, EGL_CONFIG_ID);
val2 = GET_CONFIG_ATTRIB(conf2, EGL_CONFIG_ID);
assert(val1 != val2);
}
else {
val1 = val2 = 0;
}
return (val1 - val2);
}
@@ -694,25 +764,15 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
if (!num_configs)
return _eglError(EGL_BAD_PARAMETER, "eglChooseConfigs");
if (!_eglParseConfigAttribList(&criteria, disp, attrib_list))
_eglInitConfig(&criteria, disp, 0);
if (!_eglParseConfigAttribList(&criteria, attrib_list))
return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
/* get the number of matched configs */
count = _eglFilterArray(disp->Configs, NULL, 0,
configList = (_EGLConfig **) _eglFilterArray(disp->Configs, &count,
(_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
if (!count) {
*num_configs = count;
return EGL_TRUE;
}
configList = malloc(sizeof(*configList) * count);
if (!configList)
return _eglError(EGL_BAD_ALLOC, "eglChooseConfig(out of memory)");
/* get the matched configs */
_eglFilterArray(disp->Configs, (void **) configList, count,
(_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
/* perform sorting of configs */
if (configs && count) {
_eglSortConfigs((const _EGLConfig **) configList, count,
@@ -742,7 +802,7 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
if (!value)
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");
*value = _eglGetConfigKey(conf, attribute);
*value = GET_CONFIG_ATTRIB(conf, attribute);
return EGL_TRUE;
}

View File

@@ -3,107 +3,72 @@
#include <assert.h>
#include <stddef.h>
#include "egltypedefs.h"
/* update _eglValidationTable and _eglOffsetOfConfig before updating this
* struct */
#define _EGL_CONFIG_FIRST_ATTRIB EGL_BUFFER_SIZE
#define _EGL_CONFIG_LAST_ATTRIB EGL_CONFORMANT
#define _EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS \
(_EGL_CONFIG_LAST_ATTRIB - _EGL_CONFIG_FIRST_ATTRIB + 1)
/* Attributes outside the contiguous block:
*
* EGL_Y_INVERTED_NOK
*/
#define _EGL_CONFIG_FIRST_EXTRA_ATTRIB _EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS
#define _EGL_CONFIG_NUM_EXTRA_ATTRIBS 1
#define _EGL_CONFIG_NUM_ATTRIBS \
_EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS + _EGL_CONFIG_NUM_EXTRA_ATTRIBS
struct _egl_config
{
_EGLDisplay *Display;
/* core */
EGLint BufferSize;
EGLint AlphaSize;
EGLint BlueSize;
EGLint GreenSize;
EGLint RedSize;
EGLint DepthSize;
EGLint StencilSize;
EGLint ConfigCaveat;
EGLint ConfigID;
EGLint Level;
EGLint MaxPbufferHeight;
EGLint MaxPbufferPixels;
EGLint MaxPbufferWidth;
EGLint NativeRenderable;
EGLint NativeVisualID;
EGLint NativeVisualType;
EGLint Samples;
EGLint SampleBuffers;
EGLint SurfaceType;
EGLint TransparentType;
EGLint TransparentBlueValue;
EGLint TransparentGreenValue;
EGLint TransparentRedValue;
EGLint BindToTextureRGB;
EGLint BindToTextureRGBA;
EGLint MinSwapInterval;
EGLint MaxSwapInterval;
EGLint LuminanceSize;
EGLint AlphaMaskSize;
EGLint ColorBufferType;
EGLint RenderableType;
EGLint MatchNativePixmap;
EGLint Conformant;
/* extensions */
EGLint YInvertedNOK;
EGLint Storage[_EGL_CONFIG_NUM_ATTRIBS];
};
/**
* Map an EGL attribute enum to the offset of the member in _EGLConfig.
* Macros for source level compatibility.
*/
#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) _eglSetConfigKey(CONF, ATTR, VAL)
#define GET_CONFIG_ATTRIB(CONF, ATTR) _eglGetConfigKey(CONF, ATTR)
/**
* Given a key, return an index into the storage of the config.
* Return -1 if the key is invalid.
*/
static INLINE EGLint
_eglOffsetOfConfig(EGLint attr)
_eglIndexConfig(const _EGLConfig *conf, EGLint key)
{
switch (attr) {
#define ATTRIB_MAP(attr, memb) case attr: return offsetof(_EGLConfig, memb)
/* core */
ATTRIB_MAP(EGL_BUFFER_SIZE, BufferSize);
ATTRIB_MAP(EGL_ALPHA_SIZE, AlphaSize);
ATTRIB_MAP(EGL_BLUE_SIZE, BlueSize);
ATTRIB_MAP(EGL_GREEN_SIZE, GreenSize);
ATTRIB_MAP(EGL_RED_SIZE, RedSize);
ATTRIB_MAP(EGL_DEPTH_SIZE, DepthSize);
ATTRIB_MAP(EGL_STENCIL_SIZE, StencilSize);
ATTRIB_MAP(EGL_CONFIG_CAVEAT, ConfigCaveat);
ATTRIB_MAP(EGL_CONFIG_ID, ConfigID);
ATTRIB_MAP(EGL_LEVEL, Level);
ATTRIB_MAP(EGL_MAX_PBUFFER_HEIGHT, MaxPbufferHeight);
ATTRIB_MAP(EGL_MAX_PBUFFER_PIXELS, MaxPbufferPixels);
ATTRIB_MAP(EGL_MAX_PBUFFER_WIDTH, MaxPbufferWidth);
ATTRIB_MAP(EGL_NATIVE_RENDERABLE, NativeRenderable);
ATTRIB_MAP(EGL_NATIVE_VISUAL_ID, NativeVisualID);
ATTRIB_MAP(EGL_NATIVE_VISUAL_TYPE, NativeVisualType);
ATTRIB_MAP(EGL_SAMPLES, Samples);
ATTRIB_MAP(EGL_SAMPLE_BUFFERS, SampleBuffers);
ATTRIB_MAP(EGL_SURFACE_TYPE, SurfaceType);
ATTRIB_MAP(EGL_TRANSPARENT_TYPE, TransparentType);
ATTRIB_MAP(EGL_TRANSPARENT_BLUE_VALUE, TransparentBlueValue);
ATTRIB_MAP(EGL_TRANSPARENT_GREEN_VALUE, TransparentGreenValue);
ATTRIB_MAP(EGL_TRANSPARENT_RED_VALUE, TransparentRedValue);
ATTRIB_MAP(EGL_BIND_TO_TEXTURE_RGB, BindToTextureRGB);
ATTRIB_MAP(EGL_BIND_TO_TEXTURE_RGBA, BindToTextureRGBA);
ATTRIB_MAP(EGL_MIN_SWAP_INTERVAL, MinSwapInterval);
ATTRIB_MAP(EGL_MAX_SWAP_INTERVAL, MaxSwapInterval);
ATTRIB_MAP(EGL_LUMINANCE_SIZE, LuminanceSize);
ATTRIB_MAP(EGL_ALPHA_MASK_SIZE, AlphaMaskSize);
ATTRIB_MAP(EGL_COLOR_BUFFER_TYPE, ColorBufferType);
ATTRIB_MAP(EGL_RENDERABLE_TYPE, RenderableType);
ATTRIB_MAP(EGL_MATCH_NATIVE_PIXMAP, MatchNativePixmap);
ATTRIB_MAP(EGL_CONFORMANT, Conformant);
/* extensions */
ATTRIB_MAP(EGL_Y_INVERTED_NOK, YInvertedNOK);
#undef ATTRIB_MAP
(void) conf;
if (key >= _EGL_CONFIG_FIRST_ATTRIB &&
key < _EGL_CONFIG_FIRST_ATTRIB + _EGL_CONFIG_NUM_CONTIGUOUS_ATTRIBS)
return key - _EGL_CONFIG_FIRST_ATTRIB;
switch (key) {
case EGL_Y_INVERTED_NOK:
return _EGL_CONFIG_FIRST_EXTRA_ATTRIB;
default:
return -1;
}
}
/**
* Reset all keys in the config to a given value.
*/
static INLINE void
_eglResetConfigKeys(_EGLConfig *conf, EGLint val)
{
EGLint i;
for (i = 0; i < _EGL_CONFIG_NUM_ATTRIBS; i++)
conf->Storage[i] = val;
}
/**
* Update a config for a given key.
*
@@ -114,9 +79,9 @@ _eglOffsetOfConfig(EGLint attr)
static INLINE void
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
{
EGLint offset = _eglOffsetOfConfig(key);
assert(offset >= 0);
*((EGLint *) ((char *) conf + offset)) = val;
EGLint idx = _eglIndexConfig(conf, key);
assert(idx >= 0);
conf->Storage[idx] = val;
}
@@ -126,9 +91,9 @@ _eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
static INLINE EGLint
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
{
EGLint offset = _eglOffsetOfConfig(key);
assert(offset >= 0);
return *((EGLint *) ((char *) conf + offset));
EGLint idx = _eglIndexConfig(conf, key);
assert(idx >= 0);
return conf->Storage[idx];
}
@@ -137,20 +102,34 @@ _eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id);
PUBLIC EGLConfig
_eglLinkConfig(_EGLConfig *conf);
_eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf);
extern _EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy);
extern EGLBoolean
_eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy);
/**
* Return the handle of a linked config.
* Lookup a handle to find the linked config.
* Return NULL if the handle has no corresponding linked config.
*/
static INLINE _EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy)
{
_EGLConfig *conf = (_EGLConfig *) config;
if (!dpy || !_eglCheckConfigHandle(config, dpy))
conf = NULL;
return conf;
}
/**
* Return the handle of a linked config, or NULL.
*/
static INLINE EGLConfig
_eglGetConfigHandle(_EGLConfig *conf)
{
return (EGLConfig) conf;
return (EGLConfig) ((conf && conf->Display) ? conf : NULL);
}
@@ -163,8 +142,7 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria);
PUBLIC EGLBoolean
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
const EGLint *attrib_list);
_eglParseConfigAttribList(_EGLConfig *conf, const EGLint *attrib_list);
PUBLIC EGLint

View File

@@ -103,7 +103,8 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
return EGL_FALSE;
}
_eglInitResource(&ctx->Resource, sizeof(*ctx), dpy);
memset(ctx, 0, sizeof(_EGLContext));
ctx->Resource.Display = dpy;
ctx->ClientAPI = api;
ctx->Config = conf;
ctx->WindowRenderBuffer = EGL_NONE;
@@ -112,12 +113,13 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
err = _eglParseContextAttribList(ctx, attrib_list);
if (err == EGL_SUCCESS && ctx->Config) {
EGLint api_bit;
EGLint renderable_type, api_bit;
renderable_type = GET_CONFIG_ATTRIB(ctx->Config, EGL_RENDERABLE_TYPE);
api_bit = _eglGetContextAPIBit(ctx);
if (!(ctx->Config->RenderableType & api_bit)) {
if (!(renderable_type & api_bit)) {
_eglLog(_EGL_DEBUG, "context api is 0x%x while config supports 0x%x",
api_bit, ctx->Config->RenderableType);
api_bit, renderable_type);
err = EGL_BAD_CONFIG;
}
}
@@ -128,6 +130,29 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
}
/**
* Just a placeholder/demo function. Real driver will never use this!
*/
_EGLContext *
_eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
_EGLContext *share_list, const EGLint *attrib_list)
{
return NULL;
}
/**
* Default fallback routine - drivers should usually override this.
*/
EGLBoolean
_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
if (!_eglIsContextBound(ctx))
free(ctx);
return EGL_TRUE;
}
#ifdef EGL_VERSION_1_2
static EGLint
_eglQueryContextRenderBuffer(_EGLContext *ctx)
@@ -158,9 +183,7 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
switch (attribute) {
case EGL_CONFIG_ID:
if (!c->Config)
return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
*value = c->Config->ConfigID;
*value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
break;
case EGL_CONTEXT_CLIENT_VERSION:
*value = c->ClientVersion;
@@ -303,65 +326,79 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
/**
* Bind the context to the current thread and given surfaces. Return the
* previous bound context and surfaces. The caller should unreference the
* returned context and surfaces.
*
* Making a second call with the resources returned by the first call
* unsurprisingly undoes the first call, except for the resouce reference
* counts.
* "orphaned" context and surfaces. Each argument is both input and output.
*/
EGLBoolean
_eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read,
_EGLContext **old_ctx,
_EGLSurface **old_draw, _EGLSurface **old_read)
_eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
_EGLContext *prev_ctx;
_EGLSurface *prev_draw, *prev_read;
_EGLContext *newCtx = *ctx, *oldCtx;
_EGLSurface *newDraw = *draw, *newRead = *read;
if (!_eglCheckMakeCurrent(ctx, draw, read))
if (!_eglCheckMakeCurrent(newCtx, newDraw, newRead))
return EGL_FALSE;
/* increment refcounts before binding */
_eglGetContext(ctx);
_eglGetSurface(draw);
_eglGetSurface(read);
/* bind the new context */
prev_ctx = _eglBindContextToThread(ctx, t);
oldCtx = _eglBindContextToThread(newCtx, t);
/* break previous bindings */
if (prev_ctx) {
prev_draw = prev_ctx->DrawSurface;
prev_read = prev_ctx->ReadSurface;
/* break old bindings */
if (oldCtx) {
*ctx = oldCtx;
*draw = oldCtx->DrawSurface;
*read = oldCtx->ReadSurface;
if (prev_draw)
prev_draw->CurrentContext = NULL;
if (prev_read)
prev_read->CurrentContext = NULL;
if (*draw)
(*draw)->CurrentContext = NULL;
if (*read)
(*read)->CurrentContext = NULL;
prev_ctx->DrawSurface = NULL;
prev_ctx->ReadSurface = NULL;
}
else {
prev_draw = prev_read = NULL;
oldCtx->DrawSurface = NULL;
oldCtx->ReadSurface = NULL;
}
/* establish new bindings */
if (ctx) {
if (draw)
draw->CurrentContext = ctx;
if (read)
read->CurrentContext = ctx;
if (newCtx) {
if (newDraw)
newDraw->CurrentContext = newCtx;
if (newRead)
newRead->CurrentContext = newCtx;
ctx->DrawSurface = draw;
ctx->ReadSurface = read;
newCtx->DrawSurface = newDraw;
newCtx->ReadSurface = newRead;
}
assert(old_ctx && old_draw && old_read);
*old_ctx = prev_ctx;
*old_draw = prev_draw;
*old_read = prev_read;
/* an old context or surface is not orphaned if it is still bound */
if (*ctx == newCtx)
*ctx = NULL;
if (*draw == newDraw || *draw == newRead)
*draw = NULL;
if (*read == newDraw || *read == newRead)
*read = NULL;
return EGL_TRUE;
}
/**
* Just a placeholder/demo function. Drivers should override this.
*/
EGLBoolean
_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw,
_EGLSurface *read, _EGLContext *ctx)
{
return EGL_FALSE;
}
/**
* This is defined by the EGL_MESA_copy_context extension.
*/
EGLBoolean
_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source,
EGLContext dest, EGLint mask)
{
/* This function will always have to be overridden/implemented in the
* device driver. If the driver is based on Mesa, use _mesa_copy_context().
*/
return EGL_FALSE;
}

View File

@@ -34,46 +34,51 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy,
_EGLConfig *config, const EGLint *attrib_list);
extern _EGLContext *
_eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, _EGLContext *share_list, const EGLint *attrib_list);
extern EGLBoolean
_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
extern EGLBoolean
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
PUBLIC EGLBoolean
_eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read,
_EGLContext **old_ctx,
_EGLSurface **old_draw, _EGLSurface **old_read);
_eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read);
extern EGLBoolean
_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw, _EGLSurface *read, _EGLContext *ctx);
extern EGLBoolean
_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
/**
* Increment reference count for the context.
*/
static INLINE _EGLContext *
_eglGetContext(_EGLContext *ctx)
{
if (ctx)
_eglGetResource(&ctx->Resource);
return ctx;
}
/**
* Decrement reference count for the context.
* Return true if the context is bound to a thread.
*
* The binding is considered a reference to the context. Drivers should not
* destroy a context when it is bound.
*/
static INLINE EGLBoolean
_eglPutContext(_EGLContext *ctx)
_eglIsContextBound(_EGLContext *ctx)
{
return (ctx) ? _eglPutResource(&ctx->Resource) : EGL_FALSE;
return (ctx->Binding != NULL);
}
/**
* Link a context to its display and return the handle of the link.
* Link a context to a display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLContext
_eglLinkContext(_EGLContext *ctx)
_eglLinkContext(_EGLContext *ctx, _EGLDisplay *dpy)
{
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT, dpy);
return (EGLContext) ctx;
}
@@ -115,4 +120,18 @@ _eglGetContextHandle(_EGLContext *ctx)
}
/**
* Return true if the context is linked to a display.
*
* The link is considered a reference to the context (the display is owning the
* context). Drivers should not destroy a context when it is linked.
*/
static INLINE EGLBoolean
_eglIsContextLinked(_EGLContext *ctx)
{
_EGLResource *res = (_EGLResource *) ctx;
return (res && _eglIsResourceLinked(res));
}
#endif /* EGLCONTEXT_INCLUDED */

View File

@@ -14,7 +14,33 @@
static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
#if PTHREADS
#ifdef GLX_USE_TLS
static __thread const _EGLThreadInfo *_egl_TSD
__attribute__ ((tls_model("initial-exec")));
static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
{
_egl_TSD = t;
}
static INLINE _EGLThreadInfo *_eglGetTSD(void)
{
return (_EGLThreadInfo *) _egl_TSD;
}
static INLINE void _eglFiniTSD(void)
{
}
static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
{
/* TODO destroy TSD */
(void) dtor;
(void) _eglFiniTSD;
return EGL_TRUE;
}
#elif PTHREADS
#include <pthread.h>
static _EGL_DECLARE_MUTEX(_egl_TSDMutex);
@@ -22,26 +48,14 @@ static EGLBoolean _egl_TSDInitialized;
static pthread_key_t _egl_TSD;
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
#ifdef GLX_USE_TLS
static __thread const _EGLThreadInfo *_egl_TLS
__attribute__ ((tls_model("initial-exec")));
#endif
static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
{
pthread_setspecific(_egl_TSD, (const void *) t);
#ifdef GLX_USE_TLS
_egl_TLS = t;
#endif
}
static INLINE _EGLThreadInfo *_eglGetTSD(void)
{
#ifdef GLX_USE_TLS
return (_EGLThreadInfo *) _egl_TLS;
#else
return (_EGLThreadInfo *) pthread_getspecific(_egl_TSD);
#endif
}
static INLINE void _eglFiniTSD(void)
@@ -286,9 +300,6 @@ _eglError(EGLint errCode, const char *msg)
case EGL_BAD_SURFACE:
s = "EGL_BAD_SURFACE";
break;
case EGL_NOT_INITIALIZED:
s = "EGL_NOT_INITIALIZED";
break;
#ifdef EGL_MESA_screen_surface
case EGL_BAD_SCREEN_MESA:
s = "EGL_BAD_SCREEN_MESA";
@@ -298,7 +309,7 @@ _eglError(EGLint errCode, const char *msg)
break;
#endif
default:
s = "other EGL error";
s = "other";
}
_eglLog(_EGL_DEBUG, "EGL user error 0x%x (%s) in %s\n", errCode, s, msg);
}

View File

@@ -27,7 +27,6 @@ _eglGetNativePlatformFromEnv(void)
} egl_platforms[_EGL_NUM_PLATFORMS] = {
{ _EGL_PLATFORM_WINDOWS, "gdi" },
{ _EGL_PLATFORM_X11, "x11" },
{ _EGL_PLATFORM_WAYLAND, "wayland" },
{ _EGL_PLATFORM_DRM, "drm" },
{ _EGL_PLATFORM_FBDEV, "fbdev" }
};
@@ -234,53 +233,17 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
/**
* Initialize a display resource.
* Link a resource to a display.
*/
void
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy)
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy)
{
memset(res, 0, size);
assert(!res->Display || res->Display == dpy);
res->Display = dpy;
res->RefCount = 1;
}
/**
* Increment reference count for the resource.
*/
void
_eglGetResource(_EGLResource *res)
{
assert(res && res->RefCount > 0);
/* hopefully a resource is always manipulated with its display locked */
res->RefCount++;
}
/**
* Decrement reference count for the resource.
*/
EGLBoolean
_eglPutResource(_EGLResource *res)
{
assert(res && res->RefCount > 0);
res->RefCount--;
return (!res->RefCount);
}
/**
* Link a resource to its display.
*/
void
_eglLinkResource(_EGLResource *res, _EGLResourceType type)
{
assert(res->Display);
res->IsLinked = EGL_TRUE;
res->Next = res->Display->ResourceLists[type];
res->Display->ResourceLists[type] = res;
_eglGetResource(res);
res->Next = dpy->ResourceLists[type];
dpy->ResourceLists[type] = res;
}
@@ -307,9 +270,6 @@ _eglUnlinkResource(_EGLResource *res, _EGLResourceType type)
}
res->Next = NULL;
/* do not reset res->Display */
res->IsLinked = EGL_FALSE;
_eglPutResource(res);
/* We always unlink before destroy. The driver still owns a reference */
assert(res->RefCount);
}

View File

@@ -11,7 +11,6 @@
enum _egl_platform_type {
_EGL_PLATFORM_WINDOWS,
_EGL_PLATFORM_X11,
_EGL_PLATFORM_WAYLAND,
_EGL_PLATFORM_DRM,
_EGL_PLATFORM_FBDEV,
@@ -41,7 +40,6 @@ struct _egl_resource
/* which display the resource belongs to */
_EGLDisplay *Display;
EGLBoolean IsLinked;
EGLint RefCount;
/* used to link resources of the same type */
_EGLResource *Next;
@@ -58,8 +56,6 @@ struct _egl_extensions
EGLBoolean MESA_drm_display;
EGLBoolean MESA_drm_image;
EGLBoolean WL_bind_wayland_display;
EGLBoolean KHR_image_base;
EGLBoolean KHR_image_pixmap;
EGLBoolean KHR_vg_parent_image;
@@ -77,6 +73,8 @@ struct _egl_extensions
EGLBoolean NOK_swap_region;
EGLBoolean NOK_texture_from_pixmap;
char String[_EGL_MAX_EXTENSIONS_LEN];
};
@@ -87,29 +85,21 @@ struct _egl_display
_EGLMutex Mutex;
_EGLPlatformType Platform; /**< The type of the platform display */
void *PlatformDisplay; /**< A pointer to the platform display */
_EGLPlatformType Platform;
void *PlatformDisplay;
_EGLDriver *Driver; /**< Matched driver of the display */
EGLBoolean Initialized; /**< True if the display is initialized */
EGLBoolean Initialized; /**< True if the display is initialized */
_EGLDriver *Driver;
void *DriverData; /* private to driver */
/* options that affect how the driver initializes the display */
struct {
EGLBoolean TestOnly; /**< Driver should not set fields when true */
EGLBoolean UseFallback; /**< Use fallback driver (sw or less features) */
} Options;
int APImajor, APIminor; /**< as returned by eglInitialize() */
char Version[1000]; /**< initialized from APImajor/minor, DriverName */
/* these fields are set by the driver during init */
void *DriverData; /**< Driver private data */
EGLint VersionMajor; /**< EGL major version */
EGLint VersionMinor; /**< EGL minor version */
EGLint ClientAPIs; /**< Bitmask of APIs supported (EGL_xxx_BIT) */
_EGLExtensions Extensions; /**< Extensions supported */
/** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
EGLint ClientAPIsMask;
char ClientAPIs[1000]; /**< updated by eglQueryString */
/* these fields are derived from above */
char VersionString[1000]; /**< EGL_VERSION */
char ClientAPIsString[1000]; /**< EGL_CLIENT_APIS */
char ExtensionsString[_EGL_MAX_EXTENSIONS_LEN]; /**< EGL_EXTENSIONS */
_EGLExtensions Extensions;
_EGLArray *Screens;
_EGLArray *Configs;
@@ -172,19 +162,7 @@ _eglGetDisplayHandle(_EGLDisplay *dpy)
extern void
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy);
PUBLIC void
_eglGetResource(_EGLResource *res);
PUBLIC EGLBoolean
_eglPutResource(_EGLResource *res);
extern void
_eglLinkResource(_EGLResource *res, _EGLResourceType type);
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy);
extern void

View File

@@ -9,10 +9,19 @@
#include <stdlib.h>
#include "eglstring.h"
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldefines.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "egllog.h"
#include "eglmisc.h"
#include "eglmode.h"
#include "eglscreen.h"
#include "eglstring.h"
#include "eglsurface.h"
#include "eglimage.h"
#include "eglsync.h"
#include "eglmutex.h"
#if defined(_EGL_OS_UNIX)
@@ -25,7 +34,6 @@
typedef struct _egl_module {
char *Path;
_EGLMain_t BuiltIn;
void *Handle;
_EGLDriver *Driver;
} _EGLModule;
@@ -33,21 +41,6 @@ typedef struct _egl_module {
static _EGL_DECLARE_MUTEX(_eglModuleMutex);
static _EGLArray *_eglModules;
const struct {
const char *name;
_EGLMain_t main;
} _eglBuiltInDrivers[] = {
#ifdef _EGL_BUILT_IN_DRIVER_GALLIUM
{ "egl_gallium", _eglBuiltInDriverGALLIUM },
#endif
#ifdef _EGL_BUILT_IN_DRIVER_DRI2
{ "egl_dri2", _eglBuiltInDriverDRI2 },
#endif
#ifdef _EGL_BUILT_IN_DRIVER_GLX
{ "egl_glx", _eglBuiltInDriverGLX },
#endif
{ NULL, NULL }
};
/**
* Wrappers for dlopen/dlclose()
@@ -144,6 +137,9 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
if (!lib) {
_eglLog(_EGL_WARNING, "Could not open driver %s (%s)",
driverPath, error);
if (!getenv("EGL_DRIVER"))
_eglLog(_EGL_WARNING,
"The driver can be overridden by setting EGL_DRIVER");
return NULL;
}
@@ -170,18 +166,9 @@ _eglLoadModule(_EGLModule *mod)
lib_handle lib;
_EGLDriver *drv;
if (mod->Driver)
return EGL_TRUE;
if (mod->BuiltIn) {
lib = (lib_handle) NULL;
mainFunc = mod->BuiltIn;
}
else {
mainFunc = _eglOpenLibrary(mod->Path, &lib);
if (!mainFunc)
return EGL_FALSE;
}
mainFunc = _eglOpenLibrary(mod->Path, &lib);
if (!mainFunc)
return EGL_FALSE;
drv = mainFunc(NULL);
if (!drv) {
@@ -208,22 +195,11 @@ _eglLoadModule(_EGLModule *mod)
static void
_eglUnloadModule(_EGLModule *mod)
{
#if defined(_EGL_OS_UNIX)
/* destroy the driver */
if (mod->Driver && mod->Driver->Unload)
mod->Driver->Unload(mod->Driver);
/*
* XXX At this point (atexit), the module might be the last reference to
* libEGL. Closing the module might unmap libEGL and give problems.
*/
#if 0
if (mod->Handle)
close_library(mod->Handle);
#endif
#elif defined(_EGL_OS_WINDOWS)
/* XXX Windows unloads DLLs before atexit */
#endif
mod->Driver = NULL;
mod->Handle = NULL;
@@ -334,6 +310,68 @@ _eglLoaderFile(const char *dir, size_t len, void *loader_data)
}
/**
* A loader function for use with _eglPreloadForEach. The loader data is the
* pattern (prefix) of the files to look for.
*/
static EGLBoolean
_eglLoaderPattern(const char *dir, size_t len, void *loader_data)
{
#if defined(_EGL_OS_UNIX)
const char *prefix, *suffix;
size_t prefix_len, suffix_len;
DIR *dirp;
struct dirent *dirent;
char path[1024];
if (len + 2 > sizeof(path))
return EGL_TRUE;
if (len) {
memcpy(path, dir, len);
path[len++] = '/';
}
path[len] = '\0';
dirp = opendir(path);
if (!dirp)
return EGL_TRUE;
prefix = (const char *) loader_data;
prefix_len = strlen(prefix);
suffix = library_suffix();
suffix_len = (suffix) ? strlen(suffix) : 0;
while ((dirent = readdir(dirp))) {
size_t dirent_len = strlen(dirent->d_name);
const char *p;
/* match the prefix */
if (strncmp(dirent->d_name, prefix, prefix_len) != 0)
continue;
/* match the suffix */
if (suffix) {
p = dirent->d_name + dirent_len - suffix_len;
if (p < dirent->d_name || strcmp(p, suffix) != 0)
continue;
}
/* make a full path and add it to the module array */
if (len + dirent_len + 1 <= sizeof(path)) {
strcpy(path + len, dirent->d_name);
_eglAddModule(path);
}
}
closedir(dirp);
return EGL_TRUE;
#else /* _EGL_OS_UNIX */
/* stop immediately */
return EGL_FALSE;
#endif
}
/**
* Run the callback function on each driver directory.
*
@@ -366,62 +404,35 @@ _eglPreloadForEach(const char *search_path,
static const char *
_eglGetSearchPath(void)
{
static char search_path[1024];
static const char *search_path;
#if defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS)
if (search_path[0] == '\0') {
char *buf = search_path;
size_t len = sizeof(search_path);
EGLBoolean use_env;
char dir_sep;
if (!search_path) {
static char buffer[1024];
const char *p;
int ret;
p = getenv("EGL_DRIVERS_PATH");
#if defined(_EGL_OS_UNIX)
use_env = (geteuid() == getuid() && getegid() == getgid());
dir_sep = '/';
#else
use_env = EGL_TRUE;
dir_sep = '\\';
#endif
if (use_env) {
char *p;
/* extract the dirname from EGL_DRIVER */
p = getenv("EGL_DRIVER");
if (p && strchr(p, dir_sep)) {
ret = _eglsnprintf(buf, len, "%s", p);
if (ret > 0 && ret < len) {
p = strrchr(buf, dir_sep);
*p++ = ':';
len -= p - buf;
buf = p;
}
}
/* append EGL_DRIVERS_PATH */
p = getenv("EGL_DRIVERS_PATH");
if (p) {
ret = _eglsnprintf(buf, len, "%s:", p);
if (ret > 0 && ret < len) {
buf += ret;
len -= ret;
}
}
}
else {
if (p && (geteuid() != getuid() || getegid() != getgid())) {
_eglLog(_EGL_DEBUG,
"ignore EGL_DRIVERS_PATH for setuid/setgid binaries");
p = NULL;
}
#endif /* _EGL_OS_UNIX */
ret = _eglsnprintf(buf, len, "%s", _EGL_DRIVER_SEARCH_DIR);
if (ret < 0 || ret >= len)
search_path[0] = '\0';
_eglLog(_EGL_DEBUG, "EGL search path is %s", search_path);
if (p) {
ret = _eglsnprintf(buffer, sizeof(buffer),
"%s:%s", p, _EGL_DRIVER_SEARCH_DIR);
if (ret > 0 && ret < sizeof(buffer))
search_path = buffer;
}
}
#endif /* defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS) */
if (!search_path)
search_path = _EGL_DRIVER_SEARCH_DIR;
#else
search_path = "";
#endif
return search_path;
}
@@ -432,12 +443,11 @@ _eglGetSearchPath(void)
*
* The user driver is specified by EGL_DRIVER.
*/
static EGLBoolean
static void
_eglAddUserDriver(void)
{
const char *search_path = _eglGetSearchPath();
char *env;
size_t name_len = 0;
env = getenv("EGL_DRIVER");
#if defined(_EGL_OS_UNIX)
@@ -449,73 +459,35 @@ _eglAddUserDriver(void)
env = NULL;
}
}
else if (env) {
char *suffix = strchr(env, '.');
name_len = (suffix) ? suffix - env : strlen(env);
}
#else
if (env)
name_len = strlen(env);
#endif /* _EGL_OS_UNIX */
/*
* Try built-in drivers first if we know the driver name. This makes sure
* we do not load the outdated external driver that is still on the
* filesystem.
*/
if (name_len) {
_EGLModule *mod;
EGLint i;
for (i = 0; _eglBuiltInDrivers[i].name; i++) {
if (strlen(_eglBuiltInDrivers[i].name) == name_len &&
!strncmp(_eglBuiltInDrivers[i].name, env, name_len)) {
mod = _eglAddModule(env);
if (mod)
mod->BuiltIn = _eglBuiltInDrivers[i].main;
return EGL_TRUE;
}
}
}
/* otherwise, treat env as a path */
if (env) {
if (env)
_eglPreloadForEach(search_path, _eglLoaderFile, (void *) env);
return EGL_TRUE;
}
return EGL_FALSE;
}
/**
* Add egl_gallium to the module array.
* Add default drivers to the module array.
*/
static void
_eglAddGalliumDriver(void)
_eglAddDefaultDrivers(void)
{
#ifndef _EGL_BUILT_IN_DRIVER_GALLIUM
void *external = (void *) "egl_gallium";
_eglPreloadForEach(_eglGetSearchPath(), _eglLoaderFile, external);
#endif
}
/**
* Add built-in drivers to the module array.
*/
static void
_eglAddBuiltInDrivers(void)
{
_EGLModule *mod;
const char *search_path = _eglGetSearchPath();
EGLint i;
#if defined(_EGL_OS_WINDOWS)
const char *DefaultDriverNames[] = {
"egl_gallium"
};
#elif defined(_EGL_OS_UNIX)
const char *DefaultDriverNames[] = {
"egl_gallium",
"egl_dri2",
"egl_glx"
};
#endif
for (i = 0; _eglBuiltInDrivers[i].name; i++) {
mod = _eglAddModule(_eglBuiltInDrivers[i].name);
if (mod)
mod->BuiltIn = _eglBuiltInDrivers[i].main;
for (i = 0; i < ARRAY_SIZE(DefaultDriverNames); i++) {
void *name = (void *) DefaultDriverNames[i];
_eglPreloadForEach(search_path, _eglLoaderFile, name);
}
}
@@ -530,96 +502,113 @@ _eglAddDrivers(void)
if (_eglModules)
return EGL_TRUE;
if (!_eglAddUserDriver()) {
/*
* Add other drivers only when EGL_DRIVER is not set. The order here
* decides the priorities.
*/
_eglAddGalliumDriver();
_eglAddBuiltInDrivers();
}
/* the order here decides the priorities of the drivers */
_eglAddUserDriver();
_eglAddDefaultDrivers();
_eglPreloadForEach(_eglGetSearchPath(), _eglLoaderPattern, (void *) "egl_");
return (_eglModules != NULL);
}
/**
* A helper function for _eglMatchDriver. It finds the first driver that can
* initialize the display and return.
*/
static _EGLDriver *
_eglMatchAndInitialize(_EGLDisplay *dpy)
{
_EGLDriver *drv = NULL;
EGLint i = 0;
if (!_eglAddDrivers()) {
_eglLog(_EGL_WARNING, "failed to find any driver");
return NULL;
}
if (dpy->Driver) {
drv = dpy->Driver;
/* no re-matching? */
if (!drv->API.Initialize(drv, dpy))
drv = NULL;
return drv;
}
while (i < _eglModules->Size) {
_EGLModule *mod = (_EGLModule *) _eglModules->Elements[i];
if (!_eglLoadModule(mod)) {
/* remove invalid modules */
_eglEraseArray(_eglModules, i, _eglFreeModule);
continue;
}
if (mod->Driver->API.Initialize(mod->Driver, dpy)) {
drv = mod->Driver;
break;
}
else {
i++;
}
}
return drv;
}
/**
* Match a display to a driver. The display is initialized unless test_only is
* true. The matching is done by finding the first driver that can initialize
* the display.
* Match a display to a driver. The display is initialized unless use_probe is
* true.
*
* The matching is done by finding the first driver that can initialize the
* display, or when use_probe is true, the driver with highest score.
*/
_EGLDriver *
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean use_probe)
{
_EGLDriver *best_drv;
assert(!dpy->Initialized);
_EGLModule *mod;
_EGLDriver *best_drv = NULL;
EGLint best_score = 0;
EGLint major, minor, i;
_eglLockMutex(&_eglModuleMutex);
/* set options */
dpy->Options.TestOnly = test_only;
dpy->Options.UseFallback = EGL_FALSE;
if (!_eglAddDrivers()) {
_eglUnlockMutex(&_eglModuleMutex);
return EGL_FALSE;
}
best_drv = _eglMatchAndInitialize(dpy);
/* match the loaded modules */
for (i = 0; i < _eglModules->Size; i++) {
mod = (_EGLModule *) _eglModules->Elements[i];
if (!mod->Driver)
break;
if (use_probe) {
EGLint score = (mod->Driver->Probe) ?
mod->Driver->Probe(mod->Driver, dpy) : 1;
if (score > best_score) {
best_drv = mod->Driver;
best_score = score;
}
}
else {
if (mod->Driver->API.Initialize(mod->Driver, dpy, &major, &minor)) {
best_drv = mod->Driver;
best_score = 100;
}
}
/* perfect match */
if (best_score >= 100)
break;
}
/* load more modules */
if (!best_drv) {
dpy->Options.UseFallback = EGL_TRUE;
best_drv = _eglMatchAndInitialize(dpy);
EGLint first_unloaded = i;
while (i < _eglModules->Size) {
mod = (_EGLModule *) _eglModules->Elements[i];
assert(!mod->Driver);
if (!_eglLoadModule(mod)) {
/* remove invalid modules */
_eglEraseArray(_eglModules, i, _eglFreeModule);
continue;
}
if (use_probe) {
best_score = (mod->Driver->Probe) ?
mod->Driver->Probe(mod->Driver, dpy) : 1;
}
else {
if (mod->Driver->API.Initialize(mod->Driver, dpy, &major, &minor))
best_score = 100;
}
if (best_score > 0) {
best_drv = mod->Driver;
/* loaded modules come before unloaded ones */
if (first_unloaded != i) {
void *tmp = _eglModules->Elements[i];
_eglModules->Elements[i] =
_eglModules->Elements[first_unloaded];
_eglModules->Elements[first_unloaded] = tmp;
}
break;
}
else {
_eglUnloadModule(mod);
i++;
}
}
}
_eglUnlockMutex(&_eglModuleMutex);
if (best_drv) {
_eglLog(_EGL_DEBUG, "the best driver is %s%s",
best_drv->Name, (test_only) ? " (test only) " : "");
if (!test_only) {
_eglLog(_EGL_DEBUG, "the best driver is %s (score %d)",
best_drv->Name, best_score);
if (!use_probe) {
dpy->Driver = best_drv;
dpy->Initialized = EGL_TRUE;
dpy->APImajor = major;
dpy->APIminor = minor;
}
}
@@ -663,12 +652,88 @@ _eglUnloadDrivers(void)
{
/* this is called at atexit time */
if (_eglModules) {
#if defined(_EGL_OS_UNIX)
_eglDestroyArray(_eglModules, _eglFreeModule);
#elif defined(_EGL_OS_WINDOWS)
/* XXX Windows unloads DLLs before atexit */
_eglDestroyArray(_eglModules, NULL);
#endif
_eglModules = NULL;
}
}
/**
* Plug all the available fallback routines into the given driver's
* dispatch table.
*/
void
_eglInitDriverFallbacks(_EGLDriver *drv)
{
/* If a pointer is set to NULL, then the device driver _really_ has
* to implement it.
*/
drv->API.Initialize = NULL;
drv->API.Terminate = NULL;
drv->API.GetConfigs = _eglGetConfigs;
drv->API.ChooseConfig = _eglChooseConfig;
drv->API.GetConfigAttrib = _eglGetConfigAttrib;
drv->API.CreateContext = _eglCreateContext;
drv->API.DestroyContext = _eglDestroyContext;
drv->API.MakeCurrent = _eglMakeCurrent;
drv->API.QueryContext = _eglQueryContext;
drv->API.CreateWindowSurface = _eglCreateWindowSurface;
drv->API.CreatePixmapSurface = _eglCreatePixmapSurface;
drv->API.CreatePbufferSurface = _eglCreatePbufferSurface;
drv->API.DestroySurface = _eglDestroySurface;
drv->API.QuerySurface = _eglQuerySurface;
drv->API.SurfaceAttrib = _eglSurfaceAttrib;
drv->API.BindTexImage = _eglBindTexImage;
drv->API.ReleaseTexImage = _eglReleaseTexImage;
drv->API.SwapInterval = _eglSwapInterval;
drv->API.SwapBuffers = _eglSwapBuffers;
drv->API.CopyBuffers = _eglCopyBuffers;
drv->API.QueryString = _eglQueryString;
drv->API.WaitClient = _eglWaitClient;
drv->API.WaitNative = _eglWaitNative;
#ifdef EGL_MESA_screen_surface
drv->API.ChooseModeMESA = _eglChooseModeMESA;
drv->API.GetModesMESA = _eglGetModesMESA;
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
drv->API.GetScreensMESA = _eglGetScreensMESA;
drv->API.CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA;
drv->API.ShowScreenSurfaceMESA = _eglShowScreenSurfaceMESA;
drv->API.ScreenPositionMESA = _eglScreenPositionMESA;
drv->API.QueryScreenMESA = _eglQueryScreenMESA;
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer;
#endif /* EGL_VERSION_1_2 */
#ifdef EGL_KHR_image_base
drv->API.CreateImageKHR = _eglCreateImageKHR;
drv->API.DestroyImageKHR = _eglDestroyImageKHR;
#endif /* EGL_KHR_image_base */
#ifdef EGL_KHR_reusable_sync
drv->API.CreateSyncKHR = _eglCreateSyncKHR;
drv->API.DestroySyncKHR = _eglDestroySyncKHR;
drv->API.ClientWaitSyncKHR = _eglClientWaitSyncKHR;
drv->API.SignalSyncKHR = _eglSignalSyncKHR;
drv->API.GetSyncAttribKHR = _eglGetSyncAttribKHR;
#endif /* EGL_KHR_reusable_sync */
}
/**
* Invoke a callback function on each EGL search path.
*

View File

@@ -43,6 +43,16 @@ struct _egl_driver
{
const char *Name; /**< name of this driver */
/**
* Probe a display and return a score.
*
* Roughly,
* 50 means the driver supports the display;
* 90 means the driver can accelerate the display;
* 100 means a perfect match.
*/
EGLint (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy);
/**
* Release the driver resource.
*
@@ -54,24 +64,12 @@ struct _egl_driver
};
extern _EGLDriver *
_eglBuiltInDriverGALLIUM(const char *args);
extern _EGLDriver *
_eglBuiltInDriverDRI2(const char *args);
extern _EGLDriver *
_eglBuiltInDriverGLX(const char *args);
PUBLIC _EGLDriver *
_eglMain(const char *args);
extern _EGLDriver *
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only);
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean probe_only);
extern __eglMustCastToProperFunctionPointerType
@@ -82,7 +80,6 @@ extern void
_eglUnloadDrivers(void);
/* defined in eglfallbacks.c */
PUBLIC void
_eglInitDriverFallbacks(_EGLDriver *drv);

View File

@@ -1,99 +0,0 @@
#include <string.h>
#include "egltypedefs.h"
#include "egldriver.h"
#include "eglconfig.h"
#include "eglcontext.h"
#include "eglsurface.h"
#include "eglmisc.h"
#include "eglscreen.h"
#include "eglmode.h"
#include "eglsync.h"
static EGLBoolean
_eglReturnFalse(void)
{
return EGL_FALSE;
}
/**
* Plug all the available fallback routines into the given driver's
* dispatch table.
*/
void
_eglInitDriverFallbacks(_EGLDriver *drv)
{
memset(&drv->API, 0, sizeof(drv->API));
/* the driver has to implement these */
drv->API.Initialize = NULL;
drv->API.Terminate = NULL;
drv->API.GetConfigs = _eglGetConfigs;
drv->API.ChooseConfig = _eglChooseConfig;
drv->API.GetConfigAttrib = _eglGetConfigAttrib;
drv->API.CreateContext = (CreateContext_t) _eglReturnFalse;
drv->API.DestroyContext = (DestroyContext_t) _eglReturnFalse;
drv->API.MakeCurrent = (MakeCurrent_t) _eglReturnFalse;
drv->API.QueryContext = _eglQueryContext;
drv->API.CreateWindowSurface = (CreateWindowSurface_t) _eglReturnFalse;
drv->API.CreatePixmapSurface = (CreatePixmapSurface_t) _eglReturnFalse;
drv->API.CreatePbufferSurface = (CreatePbufferSurface_t) _eglReturnFalse;
drv->API.CreatePbufferFromClientBuffer =
(CreatePbufferFromClientBuffer_t) _eglReturnFalse;
drv->API.DestroySurface = (DestroySurface_t) _eglReturnFalse;
drv->API.QuerySurface = _eglQuerySurface;
drv->API.SurfaceAttrib = _eglSurfaceAttrib;
drv->API.BindTexImage = (BindTexImage_t) _eglReturnFalse;
drv->API.ReleaseTexImage = (ReleaseTexImage_t) _eglReturnFalse;
drv->API.CopyBuffers = (CopyBuffers_t) _eglReturnFalse;
drv->API.SwapBuffers = (SwapBuffers_t) _eglReturnFalse;
drv->API.SwapInterval = _eglSwapInterval;
drv->API.WaitClient = (WaitClient_t) _eglReturnFalse;
drv->API.WaitNative = (WaitNative_t) _eglReturnFalse;
drv->API.GetProcAddress = (GetProcAddress_t) _eglReturnFalse;
drv->API.QueryString = _eglQueryString;
#ifdef EGL_MESA_screen_surface
drv->API.CopyContextMESA = (CopyContextMESA_t) _eglReturnFalse;
drv->API.CreateScreenSurfaceMESA =
(CreateScreenSurfaceMESA_t) _eglReturnFalse;
drv->API.ShowScreenSurfaceMESA = (ShowScreenSurfaceMESA_t) _eglReturnFalse;
drv->API.ChooseModeMESA = _eglChooseModeMESA;
drv->API.GetModesMESA = _eglGetModesMESA;
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
drv->API.GetScreensMESA = _eglGetScreensMESA;
drv->API.ScreenPositionMESA = _eglScreenPositionMESA;
drv->API.QueryScreenMESA = _eglQueryScreenMESA;
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_KHR_image_base
drv->API.CreateImageKHR = NULL;
drv->API.DestroyImageKHR = NULL;
#endif /* EGL_KHR_image_base */
#ifdef EGL_KHR_reusable_sync
drv->API.CreateSyncKHR = NULL;
drv->API.DestroySyncKHR = NULL;
drv->API.ClientWaitSyncKHR = NULL;
drv->API.SignalSyncKHR = NULL;
drv->API.GetSyncAttribKHR = _eglGetSyncAttribKHR;
#endif /* EGL_KHR_reusable_sync */
#ifdef EGL_MESA_drm_image
drv->API.CreateDRMImageMESA = NULL;
drv->API.ExportDRMImageMESA = NULL;
#endif
#ifdef EGL_NOK_swap_region
drv->API.SwapBuffersRegionNOK = NULL;
#endif
}

View File

@@ -2,6 +2,7 @@
#include <string.h>
#include "eglimage.h"
#include "eglcurrent.h"
#include "egllog.h"
@@ -11,57 +12,28 @@
/**
* Parse the list of image attributes and return the proper error code.
*/
EGLint
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
const EGLint *attrib_list)
static EGLint
_eglParseImageAttribList(_EGLImage *img, const EGLint *attrib_list)
{
EGLint i, err = EGL_SUCCESS;
(void) dpy;
memset(attrs, 0, sizeof(attrs));
attrs->ImagePreserved = EGL_FALSE;
attrs->GLTextureLevel = 0;
attrs->GLTextureZOffset = 0;
if (!attrib_list)
return err;
return EGL_SUCCESS;
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
EGLint attr = attrib_list[i++];
EGLint val = attrib_list[i];
switch (attr) {
/* EGL_KHR_image_base */
case EGL_IMAGE_PRESERVED_KHR:
attrs->ImagePreserved = val;
img->Preserved = val;
break;
/* EGL_KHR_gl_image */
case EGL_GL_TEXTURE_LEVEL_KHR:
attrs->GLTextureLevel = val;
img->GLTextureLevel = val;
break;
case EGL_GL_TEXTURE_ZOFFSET_KHR:
attrs->GLTextureZOffset = val;
img->GLTextureZOffset = val;
break;
/* EGL_MESA_drm_image */
case EGL_WIDTH:
attrs->Width = val;
break;
case EGL_HEIGHT:
attrs->Height = val;
break;
case EGL_DRM_BUFFER_FORMAT_MESA:
attrs->DRMBufferFormatMESA = val;
break;
case EGL_DRM_BUFFER_USE_MESA:
attrs->DRMBufferUseMESA = val;
break;
case EGL_DRM_BUFFER_STRIDE_MESA:
attrs->DRMBufferStrideMESA = val;
break;
default:
/* unknown attrs are ignored */
break;
@@ -78,12 +50,41 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
EGLBoolean
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy)
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy, const EGLint *attrib_list)
{
_eglInitResource(&img->Resource, sizeof(*img), dpy);
EGLint err;
memset(img, 0, sizeof(_EGLImage));
img->Resource.Display = dpy;
img->Preserved = EGL_FALSE;
img->GLTextureLevel = 0;
img->GLTextureZOffset = 0;
err = _eglParseImageAttribList(img, attrib_list);
if (err != EGL_SUCCESS)
return _eglError(err, "eglCreateImageKHR");
return EGL_TRUE;
}
_EGLImage *
_eglCreateImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer,
const EGLint *attr_list)
{
/* driver should override this function */
return NULL;
}
EGLBoolean
_eglDestroyImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image)
{
/* driver should override this function */
return EGL_FALSE;
}
#endif /* EGL_KHR_image_base */

View File

@@ -6,23 +6,6 @@
#include "egldisplay.h"
struct _egl_image_attribs
{
/* EGL_KHR_image_base */
EGLBoolean ImagePreserved;
/* EGL_KHR_gl_image */
EGLint GLTextureLevel;
EGLint GLTextureZOffset;
/* EGL_MESA_drm_image */
EGLint Width;
EGLint Height;
EGLint DRMBufferFormatMESA;
EGLint DRMBufferUseMESA;
EGLint DRMBufferStrideMESA;
};
/**
* "Base" class for device driver images.
*/
@@ -30,48 +13,34 @@ struct _egl_image
{
/* An image is a display resource */
_EGLResource Resource;
EGLBoolean Preserved;
EGLint GLTextureLevel;
EGLint GLTextureZOffset;
};
PUBLIC EGLint
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
const EGLint *attrib_list);
PUBLIC EGLBoolean
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy);
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy, const EGLint *attrib_list);
extern _EGLImage *
_eglCreateImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer, const EGLint *attr_list);
extern EGLBoolean
_eglDestroyImageKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image);
/**
* Increment reference count for the image.
*/
static INLINE _EGLImage *
_eglGetImage(_EGLImage *img)
{
if (img)
_eglGetResource(&img->Resource);
return img;
}
/**
* Decrement reference count for the image.
*/
static INLINE EGLBoolean
_eglPutImage(_EGLImage *img)
{
return (img) ? _eglPutResource(&img->Resource) : EGL_FALSE;
}
/**
* Link an image to its display and return the handle of the link.
* Link an image to a display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLImageKHR
_eglLinkImage(_EGLImage *img)
_eglLinkImage(_EGLImage *img, _EGLDisplay *dpy)
{
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE, dpy);
return (EGLImageKHR) img;
}
@@ -113,4 +82,15 @@ _eglGetImageHandle(_EGLImage *img)
}
/**
* Return true if the image is linked to a display.
*/
static INLINE EGLBoolean
_eglIsImageLinked(_EGLImage *img)
{
_EGLResource *res = (_EGLResource *) img;
return (res && _eglIsResourceLinked(res));
}
#endif /* EGLIMAGE_INCLUDED */

View File

@@ -151,7 +151,6 @@ _eglLog(EGLint level, const char *fmtStr, ...)
{
va_list args;
char msg[MAXSTRING];
int ret;
/* one-time initialization; a little race here is fine */
if (!logging.initialized)
@@ -163,9 +162,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
if (logging.logger) {
va_start(args, fmtStr);
ret = vsnprintf(msg, MAXSTRING, fmtStr, args);
if (ret < 0 || ret >= MAXSTRING)
strcpy(msg, "<message truncated>");
vsnprintf(msg, MAXSTRING, fmtStr, args);
va_end(args);
logging.logger(level, msg);

View File

@@ -36,8 +36,6 @@
#include "eglcurrent.h"
#include "eglmisc.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglstring.h"
/**
@@ -75,11 +73,11 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
do { \
if (dpy->Extensions.ext) { \
_eglAppendExtension(&exts, "EGL_" #ext); \
assert(exts <= dpy->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
assert(exts <= dpy->Extensions.String + _EGL_MAX_EXTENSIONS_LEN); \
} \
} while (0)
char *exts = dpy->ExtensionsString;
char *exts = dpy->Extensions.String;
if (exts[0])
return;
@@ -89,8 +87,6 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(MESA_drm_display);
_EGL_CHECK_EXTENSION(MESA_drm_image);
_EGL_CHECK_EXTENSION(WL_bind_wayland_display);
_EGL_CHECK_EXTENSION(KHR_image_base);
_EGL_CHECK_EXTENSION(KHR_image_pixmap);
if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap)
@@ -118,24 +114,24 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
static void
_eglUpdateAPIsString(_EGLDisplay *dpy)
{
char *apis = dpy->ClientAPIsString;
char *apis = dpy->ClientAPIs;
if (apis[0] || !dpy->ClientAPIs)
if (apis[0] || !dpy->ClientAPIsMask)
return;
if (dpy->ClientAPIs & EGL_OPENGL_BIT)
if (dpy->ClientAPIsMask & EGL_OPENGL_BIT)
strcat(apis, "OpenGL ");
if (dpy->ClientAPIs & EGL_OPENGL_ES_BIT)
if (dpy->ClientAPIsMask & EGL_OPENGL_ES_BIT)
strcat(apis, "OpenGL_ES ");
if (dpy->ClientAPIs & EGL_OPENGL_ES2_BIT)
if (dpy->ClientAPIsMask & EGL_OPENGL_ES2_BIT)
strcat(apis, "OpenGL_ES2 ");
if (dpy->ClientAPIs & EGL_OPENVG_BIT)
if (dpy->ClientAPIsMask & EGL_OPENVG_BIT)
strcat(apis, "OpenVG ");
assert(strlen(apis) < sizeof(dpy->ClientAPIsString));
assert(strlen(apis) < sizeof(dpy->ClientAPIs));
}
@@ -143,23 +139,51 @@ const char *
_eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name)
{
(void) drv;
(void) dpy;
switch (name) {
case EGL_VENDOR:
return _EGL_VENDOR_STRING;
case EGL_VERSION:
_eglsnprintf(dpy->VersionString, sizeof(dpy->VersionString),
"%d.%d (%s)", dpy->VersionMajor, dpy->VersionMinor,
dpy->Driver->Name);
return dpy->VersionString;
return dpy->Version;
case EGL_EXTENSIONS:
_eglUpdateExtensionsString(dpy);
return dpy->ExtensionsString;
return dpy->Extensions.String;
#ifdef EGL_VERSION_1_2
case EGL_CLIENT_APIS:
_eglUpdateAPIsString(dpy);
return dpy->ClientAPIsString;
return dpy->ClientAPIs;
#endif
default:
_eglError(EGL_BAD_PARAMETER, "eglQueryString");
return NULL;
}
}
EGLBoolean
_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
/* just a placeholder */
(void) drv;
(void) dpy;
(void) ctx;
return EGL_TRUE;
}
EGLBoolean
_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine)
{
/* just a placeholder */
(void) drv;
(void) dpy;
switch (engine) {
case EGL_CORE_NATIVE_ENGINE:
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");
return EGL_FALSE;
}
return EGL_TRUE;
}

View File

@@ -37,4 +37,12 @@ extern const char *
_eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name);
extern EGLBoolean
_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
extern EGLBoolean
_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine);
#endif /* EGLMISC_INCLUDED */

View File

@@ -3,9 +3,11 @@
#include <string.h>
#include "egldisplay.h"
#include "egldriver.h"
#include "eglmode.h"
#include "eglcurrent.h"
#include "eglscreen.h"
#include "eglstring.h"
#ifdef EGL_MESA_screen_surface
@@ -29,19 +31,12 @@ _eglLookupMode(EGLModeMESA mode, _EGLDisplay *disp)
/* loop over all screens on the display */
for (scrnum = 0; scrnum < disp->Screens->Size; scrnum++) {
const _EGLScreen *scrn = disp->Screens->Elements[scrnum];
EGLint idx;
/*
* the mode ids of a screen ranges from scrn->Handle to scrn->Handle +
* scrn->NumModes
*/
if (mode >= scrn->Handle &&
mode < scrn->Handle + _EGL_SCREEN_MAX_MODES) {
idx = mode - scrn->Handle;
assert(idx < scrn->NumModes && scrn->Modes[idx].Handle == mode);
return &scrn->Modes[idx];
EGLint i;
/* search list of modes for handle */
for (i = 0; i < scrn->NumModes; i++) {
if (scrn->Modes[i].Handle == mode) {
return scrn->Modes + i;
}
}
}
@@ -49,6 +44,45 @@ _eglLookupMode(EGLModeMESA mode, _EGLDisplay *disp)
}
/**
* Add a new mode with the given attributes (width, height, depth, refreshRate)
* to the given screen.
* Assign a new mode ID/handle to the mode as well.
* \return pointer to the new _EGLMode
*/
_EGLMode *
_eglAddNewMode(_EGLScreen *screen, EGLint width, EGLint height,
EGLint refreshRate, const char *name)
{
EGLint n;
_EGLMode *newModes;
assert(screen);
assert(width > 0);
assert(height > 0);
assert(refreshRate > 0);
n = screen->NumModes;
newModes = (_EGLMode *) realloc(screen->Modes, (n+1) * sizeof(_EGLMode));
if (newModes) {
screen->Modes = newModes;
screen->Modes[n].Handle = n + 1;
screen->Modes[n].Width = width;
screen->Modes[n].Height = height;
screen->Modes[n].RefreshRate = refreshRate;
screen->Modes[n].Optimal = EGL_FALSE;
screen->Modes[n].Interlaced = EGL_FALSE;
screen->Modes[n].Name = _eglstrdup(name);
screen->NumModes++;
return screen->Modes + n;
}
else {
return NULL;
}
}
/**
* Parse the attrib_list to fill in the fields of the given _eglMode
* Return EGL_FALSE if any errors, EGL_TRUE otherwise.

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