Compare commits

...

7437 Commits
7.8-rc1 ... 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
Andre Maasikas
b0bc026c12 r600c: fix setting negative values to bitfields
when setting negative integers to bitfields we could overwrite
other parts of it. So mask the value to be written correctly.
This is used quite often in the driver - hope it doesnt affect
performace or uncover behaviour relied before...

fixes strange effects when setting negative lodbias on evergreen
2010-09-14 19:00:35 +03:00
Brian Paul
79ab394cd2 mesa: upgrade wglext.h to version 22 2010-09-14 09:40:23 -06:00
Brian Paul
b106e6261a mesa: upgrade glxext.h to version 32 2010-09-14 09:39:44 -06:00
Brian Paul
7993832c12 mesa: update to version 64 of GL/glext.h
A number of other files had to be updated as well because const
qualifiers were added to the glMultiDrawArrays() function.
Also, GL_FIXED is now defined in glext.h.
2010-09-14 09:37:37 -06:00
Brian Paul
83f5f50f2f mesa: move, redefine MESA_GEOMETRY_PROGRAM 2010-09-14 09:16:40 -06:00
Brian Paul
1c0644e9da glsl2: add case for ir_unop_noise
Silences a compiler warning.  Still need to add some assertions
for this case.
2010-09-14 09:15:20 -06:00
Brian Paul
2b04ead569 glsl2: fix comments 2010-09-14 09:05:46 -06:00
Chia-I Wu
9476efe77f mesa: Remove unnecessary FEATURE tests.
Remove all FEATURE tests in mesa/drivers/common/.  They are not needed
and the code looks better without them.
2010-09-14 15:49:58 +08:00
Chia-I Wu
10ff2646a4 mesa: Less FEATURE_ARB_sync tests.
Add dummy static inline definitions to syncobj.h when FEATURE_ARB_sync
is 0, and remove most FEATURE_ARB_sync tests.
2010-09-14 15:49:47 +08:00
Chia-I Wu
db6273e0dd mesa: Remove unused _MESA_INIT_*_FUNCTIONS.
They were intended to be used to build OpenGL ES only DRI drivers, but
that never happened.
2010-09-14 15:49:43 +08:00
Vinson Lee
1c6992b873 gallivm: Remove unnecessary header. 2010-09-14 00:42:20 -07:00
Vinson Lee
aeb83928fd llvmpipe: Initialize variable for potentially unhandled switch case. 2010-09-14 00:17:13 -07:00
Vinson Lee
45ee8463a2 i965g: Fix 'control reaches end of non-void function' warning.
Fixes the following GCC warning.
brw_screen.c: In function 'brw_get_shader_param':
brw_screen.c:241: warning: control reaches end of non-void function
2010-09-14 00:08:45 -07:00
Vinson Lee
706380cf7d i915g: Fix 'control reaches end of non-void function' warning.
Fixes the following GCC warning.
i915_screen.c: In function 'i915_get_shader_param':
i915_screen.c:184: warning: control reaches end of non-void function
2010-09-13 23:58:42 -07:00
Vinson Lee
d4d48c0579 i915: Fix "implicit declaration of function 'draw_get_shader_param'" warning.
Fixes the following GCC warning.
i915_screen.c: In function 'i915_get_shader_param':
i915_screen.c:147: warning: implicit declaration of function 'draw_get_shader_param'
2010-09-13 23:42:35 -07:00
Vinson Lee
c5867acb0d identity: Fix 'assignment from incompatible pointer type' warning.
This is a follow-up to commit a508d2dddc.

Fixes the following GCC warning.
id_screen.c: In function 'identity_screen_create':
id_screen.c:317: warning: assignment from incompatible pointer type
2010-09-13 23:23:34 -07:00
Vinson Lee
4f2f02b7d6 rbug: Fix 'assignment from incompatible pointer type' warning.
This is a follow-up to commit a508d2dddc.

Fixes the following GCC warning.
rbug_screen.c: In function 'rbug_screen_create':
rbug_screen.c:331: warning: assignment from incompatible pointer type
2010-09-13 23:02:37 -07:00
Luca Barbieri
fbc7c9b7a9 mesa/st: ask GLSL to not emit noise since we have a dummy implementation
Note, BTW, that the Gallium implementation returns 0.5, which seems
to violate the GLSL spec, where it should return 0.0 instead.

Not sure whether changing it to 0 is correct or not.
2010-09-14 06:08:03 +02:00
Luca Barbieri
b37459388b mesa/st: set compiler options based on Gallium shader caps
This turns on if conversion and unlimited loop unrolling if control
flow is not supported.

NOTE: this will change the behavior of r300g and any other driver
that doesn't advertise control flow
2010-09-14 06:08:03 +02:00
Luca Barbieri
a508d2dddc gallium: introduce get_shader_param (ALL DRIVERS CHANGED) (v3)
Changes in v3:
- Also change trace, which I forgot about

Changes in v2:
- No longer adds tessellation shaders

Currently each shader cap has FS and VS versions.

However, we want a version of them for geometry, tessellation control,
and tessellation evaluation shaders, and want to be able to easily
query a given cap type for a given shader stage.

Since having 5 duplicates of each shader cap is unmanageable, add
a new get_shader_param function that takes both a shader cap from a
new enum and a shader stage.

Drivers with non-unified shaders will first switch on the shader
and, within each case, switch on the cap.

Drivers with unified shaders instead first check whether the shader
is supported, and then switch on the cap.

MAX_CONST_BUFFERS is now per-stage.
The geometry shader cap is removed in favor of checking whether the
limit of geometry shader instructions is greater than 0, which is also
used for tessellation shaders.

WARNING: all drivers changed and compiled but only nvfx tested
2010-09-14 06:07:41 +02:00
Ian Romanick
309cd4115b glsl2: Port equal() and notEqual() to ir_unop_all_equal and ir_unop_any_nequal 2010-09-13 17:53:32 -07:00
Luca Barbieri
4dfb89904c glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmps
Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal"
and "ir_binop_nequal" to compare all elements and give a single bool.

This is highly unintuitive and prevents generation of optimal Mesa IR.

Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and
"ir_binop_nequal" to "ir_binop_any_nequal".

Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics
as less, lequal, etc.

Third, allow all comparisons to acts on vectors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13 17:53:04 -07:00
Luca Barbieri
2cdbced10d loop_unroll: unroll loops with (lowered) breaks
If the loop ends with an if with one break or in a single break unroll
it.  Loops that end with a continue will have that continue removed by
the redundant jump optimizer.  Likewise loops that end with an
if-statement with a break at the end of both branches will have the
break pulled out after the if-statement.

Loops of the form

   for (...) {
      do_something1();
      if (cond) {
	 do_something2();
	 break;
      } else {
	 do_something3();
      }
   }

will be unrolled as

   do_something1();
   if (cond) {
      do_something2();
   } else {
      do_something3();
      do_something1();
      if (cond) {
	 do_something2();
      } else {
	 do_something3();
	 /* Repeat inserting iterations here.*/
      }
   }

ir_lower_jumps can guarantee that all loops are put in this form
and thus all loops are now potentially unrollable if an upper bound
on the number of iterations can be found.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13 16:20:40 -07:00
Ian Romanick
8f2214f489 glsl2: Add pass to remove redundant jumps 2010-09-13 14:25:26 -07:00
Ian Romanick
e79a1bb02a glsl: Explain file naming convention 2010-09-13 14:06:32 -07:00
Luca Barbieri
710d41131b loop_controls: fix analysis of already analyzed loops
The loop_controls pass didn't look at the counter values it put in ir_loop
on previous iterations, so while the first iteration worked, subsequent
ones couldn't determine max_iterations.
2010-09-13 13:03:10 -07:00
Ian Romanick
4de7a3b76a i965: Request that returns be lowered in shader main
Fixes piglit tests glsl-vs-main-return and glsl-fs-main-return.
2010-09-13 13:03:10 -07:00
Luca Barbieri
87708e8c90 glsl: call ir_lower_jumps according to compiler options 2010-09-13 13:03:09 -07:00
Luca Barbieri
3361cbac2a glsl: add continue/break/return unification/elimination pass (v2)
Changes in v2:
- Base class renamed to ir_control_flow_visitor
- Tried to comply with coding style

This is a new pass that supersedes ir_if_return and "lowers" jumps
to if/else structures.

Currently it causes no regressions on softpipe and nv40, but I'm not sure
whether the piglit glsl tests are thorough enough, so consider this
experimental.

It can be asked to:
1. Pull jumps out of ifs where possible
2. Remove all "continue"s, replacing them with an "execute flag"
3. Replace all "break" with a single conditional one at the end of the loop
4. Replace all "return"s with a single return at the end of the function,
   for the main function and/or other functions

This gives several great benefits:
1. All functions can be inlined after this pass
2. nv40 and other pre-DX10 chips without "continue" can be supported
3. nv30 and other pre-DX10 chips with no control flow at all are better supported

Note that for full effect we should also teach the unroller to unroll
loops with a fixed maximum number of iterations but with the canonical
conditional "break" that this pass will insert if asked to.

Continues are lowered by adding a per-loop "execute flag", initialized to
TRUE, that when cleared inhibits all execution until the end of the loop.

Breaks are lowered to continues, plus setting a "break flag" that is checked
at the end of the loop, and trigger the unique "break".

Returns are lowered to breaks/continues, plus adding a "return flag" that
causes loops to break again out of their enclosing loops until all the
loops are exited: then the "execute flag" logic will ignore everything
until the end of the function.

Note that "continue" and "return" can also be implemented by adding
a dummy loop and using break.
However, this is bad for hardware with limited nesting depth, and
prevents further optimization, and thus is not currently performed.
2010-09-13 13:03:09 -07:00
Luca Barbieri
55adbebc62 glsl: add ir_control_flow_visitor
This is just a subclass of ir_visitor with empty implementations of all
the visit methods for non-control flow nodes.

Used to avoid duplicating that in ir_visitor subclasses.

ir_hierarchical_visitor is another way to solve this, but is less natural
for some applications.
2010-09-13 13:03:09 -07:00
José Fonseca
6b5575baaa llvmpipe: Fix non SSE2 builds.
Should fix fdo 30168.
2010-09-13 20:43:36 +01:00
Marek Olšák
428dc6d7d2 r300g/swtcl: unlock VBO after draw_flush
https://bugs.freedesktop.org/show_bug.cgi?id=29901
https://bugs.freedesktop.org/show_bug.cgi?id=30132
2010-09-13 21:12:07 +02:00
Witold Baryluk
c40858fa0d llvmpipe: Change asm to __asm__.
According to gcc documentation both are equivalent,
second are prefered as first can make conflict with existing symbols.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-09-13 18:58:50 +01:00
Jesse Barnes
e7eff0cfce EGL DRI2: 0xa011 is Pineview not Ironlake
Point about needing a better way to do this validated.
2010-09-13 10:55:56 -07:00
Alex Deucher
9532eea509 r600c: const buffer sizes must be a multiple of 16 consts
This applies to r6xx/r7xx/evergreen
2010-09-13 13:41:46 -04:00
Jesse Barnes
c121608b6e EGL DRI2: add PCI ID for Ironlake mobile
Allows KMS EGL driver to load.  We need a better way of doing this.
2010-09-13 10:36:46 -07:00
Alex Deucher
6f839eb631 r600c/eg: remove obselete comment 2010-09-13 12:16:00 -04:00
Alex Deucher
2ef5bc3976 r600c/eg: remove unused emit timestamp function 2010-09-13 12:14:24 -04:00
Alex Deucher
07d95cdbfb r600c/eg: emit CB_BLEND_ALPHA with the other blend values
saves a few dwords
2010-09-13 12:11:29 -04:00
Alex Deucher
105ef5eb5e r600c: remove redundant state emit on evergreen
r700start3d already emits the context control packets
2010-09-13 12:06:34 -04:00
Kristian Høgsberg
7dcb305000 mesa: Revert accidentally committed vertex code chunk 2010-09-13 10:32:15 -04:00
Andre Maasikas
cdfe02d3fc r600c: eg: fix typo
probably copy/paste error
2010-09-13 16:55:58 +03:00
Andre Maasikas
629842b44c r600c: eg: 256 float4 constants may need more than 256 bytes 2010-09-13 16:29:44 +03:00
Andre Maasikas
c82beb436b r600c: eg - fix uninitialized variable 2010-09-13 16:19:18 +03:00
Kristian Høgsberg
4ebf07a426 glx: Don't destroy DRI2 drawables for legacy glx drawables
For GLX 1.3 drawables, we can destroy the DRI2 drawable when the GLX
drawable is destroyed.  However, for legacy drawables, there os no
good way of knowing when the application is done with it, so we just
let the DRI2 drawable linger on the server.  The server will destroy
the DRI2 drawable when it destroys the X drawable or the client exits
anyway.

https://bugs.freedesktop.org/show_bug.cgi?id=30109
2010-09-13 08:42:22 -04:00
Marek Olšák
0392e48867 r300g: fix SWTCL
https://bugs.freedesktop.org/show_bug.cgi?id=29901
2010-09-13 13:26:35 +02:00
José Fonseca
501d43028e llvmpipe: Unbreak rasterization on 64bit. 2010-09-13 12:03:35 +01:00
José Fonseca
91a9325761 gallium: Change the resource_copy_region semantics to allow copies between different yet compatible formats 2010-09-13 11:33:44 +01:00
Dave Airlie
61c2861b4e r600g: evergreen fixup dsa state for running query.
evergreen is always the same as r700 here.
2010-09-13 19:57:29 +10:00
Andre Maasikas
2471d0d6c5 r600c: remove stray unmap call
no idea how/why it got there
2010-09-13 12:42:25 +03:00
José Fonseca
b97c75e6a3 llvmpipe: use gcc asm only with gcc 2010-09-13 09:24:09 +01:00
Marek Olšák
6990148b12 r300g: print unassigned FS inputs for DBG_RS 2010-09-13 09:55:14 +02:00
Marek Olšák
ae1aa14965 r300g: fix map_buffer
https://bugs.freedesktop.org/show_bug.cgi?id=30145
2010-09-13 07:52:13 +02:00
Marek Olšák
185434fbe8 r300/compiler: fix warnings 2010-09-13 07:52:13 +02:00
Marek Olšák
ab7cc44580 r300g: add new debug options for dumping scissor regs and disabling CBZB clear 2010-09-13 07:49:43 +02:00
Marek Olšák
c3c5646b93 r300g: skip rendering if CS space validation fails
radeon_cs_space_check flushes the pipe context on failure, retries
the validation, and returns -1 if it fails again. At that point, there is
nothing we can do, so let's skip draw operations instead of getting stuck
in an infinite loop.

This code path ideally should never be hit.
2010-09-13 07:49:43 +02:00
Marek Olšák
317680c6fb r300g: remove u_upload_flush from r300_draw_arrays
This a leftover probably and is unnecessary, since we flush u_upload_mgr
in r300_flush.
2010-09-13 07:49:43 +02:00
Vinson Lee
b4f7f059c7 nvfx: Remove unused variables. 2010-09-12 21:48:40 -07:00
Vinson Lee
89e138b1c4 nvfx: Move declaration before code.
Fixes SCons build.
2010-09-12 21:39:21 -07:00
Keith Whitwell
c4046d4fda llvmpipe: introduce tri_3_4 for tiny triangles 2010-09-12 15:03:50 +01:00
Keith Whitwell
4b56e86e67 llvmpipe: allow tri_3_16 at any 4-aligned location within a tile
Doesn't require 16-alignment, so catch more cases.
2010-09-12 15:03:49 +01:00
Keith Whitwell
26b663c2aa llvmpipe: refactor tri_3_16
Keep step array as a set of four m128i's and reuse throughout the
rasterization.
2010-09-12 15:03:49 +01:00
Keith Whitwell
67b957781d llvmpipe: pass linear masks to fragment shader
Fragment shader can extract the correct bits for each quad.
2010-09-12 15:03:49 +01:00
Keith Whitwell
4b99b9f5ff llvmpipe: fix warnings on both 32 and 64 bit builds 2010-09-12 15:01:41 +01:00
Keith Whitwell
51b1d4f03c llvmpipe: fix wierd performance regression in isosurf
I really don't understand the mechanism behind this, but it
seems like the way data blocks for a scene are malloced, and in
particular whether we treat them as stack or a queue, and whether
we retain the most recently allocated or least recently allocated
has a real affect (~5%) on isosurf framerates...

This is probably specific to my distro or even just my machine,
but none the less, it's nicer not to see the framerates go in the
wrong direction.
2010-09-12 14:58:43 +01:00
José Fonseca
67763488b1 pb: Fix the build, and add notes. 2010-09-12 10:37:06 +01:00
José Fonseca
853953dc3c llvmpipe: Only generate the whole shader specialization for opaque shaders.
If not opaque, then the color buffer will have to be read any way,
therefore the specialization is pointless.
2010-09-12 10:15:48 +01:00
Dave Airlie
b5fcf0c8e0 pb: add void * for flush ctx to mapping functions
If the buffer we are attempting to map is referenced by the unsubmitted
command stream for this context, we need to flush the command stream,
however to do that we need to be able to access the context at the lowest
level map function, currently we set the buffer in the toplevel map, but this
racy between context. (we probably have a lot more issues than that.)

I'll look into a proper solution as suggested by jrfonseca when I get some time.
2010-09-12 13:32:43 +10:00
Luca Barbieri
95555ed03e nv30: fix breakage due to 10 texcoord support on nv40 2010-09-11 21:11:03 +02:00
Chia-I Wu
c34225974b Add missing files to the tarball file lists. 2010-09-12 02:31:33 +08:00
Chia-I Wu
19b2cfd6f6 mesa: Fix depend.es[12] generation when LLVM is enabled.
"llvm-config --cflags" outputs -f options, which conflict makedepend.
Clean up compiler flags and append LLVM_CFLAGS to the new xxx_CFLAGS
instead of xxx_CPPFLAGS, where xxx may be MESA, ES1, or ES2.
2010-09-12 02:31:33 +08:00
Tilman Sauerbeck
33b1d14913 r600g: Undo bo placement change.
This reverts a part of e795ca8f31
that causes artefacts and a performance drop.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-11 18:40:45 +02:00
José Fonseca
3ad3cbfb12 llvmpipe: Silence some warnings. 2010-09-11 13:47:58 +01:00
José Fonseca
552e2b5065 gallivm: nr_channels is only valid for formats with plain layout.
This is erroneously throwing non plain formats out of the faster
AoS sampling path.

Doing 8bit interpolation for single channels such as L8 should be no
worse than with floating point. But this may need more investigation.
2010-09-11 13:34:54 +01:00
José Fonseca
74f6edaee4 gallivm: Use const keyword on swizzles. 2010-09-11 13:31:35 +01:00
José Fonseca
697fdf3fff gallivm: Allow to TGSI AoS translation to happen in BGRA ordering.
Or any ordering.
2010-09-11 13:31:17 +01:00
José Fonseca
277d768d10 llvmpipe: Don't store display the alpha ref value in the key.
It's never used.
2010-09-11 13:30:14 +01:00
José Fonseca
dcc5d7f672 gallivm: Add a new debug flag to warn about performance issues. 2010-09-11 13:29:29 +01:00
José Fonseca
c0d41d0404 gallivm: Helper functions for pointer indirection. 2010-09-11 13:27:38 +01:00
José Fonseca
225530f1f2 gallivm: Cleanup the TGSI <-> sampler interface. 2010-09-11 13:27:27 +01:00
José Fonseca
775edbfaa1 gallivm: Add some utility functions to set/get array elements too. 2010-09-11 13:27:22 +01:00
José Fonseca
93158622e2 gallivm: Basic AoS TGSI -> LLVM IR.
Essentially a variation of the SoA version.
2010-09-11 13:25:49 +01:00
José Fonseca
58daea741f gallivm: Move the texture modifiers to the header.
Useful to pass these around.
2010-09-11 13:25:46 +01:00
José Fonseca
34ea50f672 gallivm: s/lp_build_broadcast_aos/lp_build_swizzle_scalar_aos/
More accurate description of this function purpose.
2010-09-11 13:01:31 +01:00
Alex Corscadden
96c6e7e73e Add a test for the KIL opcode
This is a simple test for the KIL opcode.  It should render a 6 sided figure
with a colored interior.
2010-09-11 13:01:20 +01:00
Keith Whitwell
afd328afa8 llvmpipe: restore larger command blocks 2010-09-11 10:04:53 +01:00
Keith Whitwell
10d0a835bc llvmpipe: move some debug to DEBUG_SCENE 2010-09-11 10:04:53 +01:00
Keith Whitwell
bc759cd37e llvmpipe: add DEBUG_MEM option 2010-09-11 10:04:53 +01:00
Keith Whitwell
b7a54b3dc6 llvmpipe: allow bigger scenes 2010-09-11 10:04:52 +01:00
Tom Stellard
4749429a4a r300/compiler: Reorganize presub_helper() 2010-09-10 18:18:10 -07:00
Tom Stellard
3fffcb317c r300/compiler: Don't use presubtract in TEX instructions 2010-09-10 18:18:10 -07:00
Tom Stellard
8b67159e9a r300/compiler: Print the presub subtract operation in the correct order 2010-09-10 18:18:10 -07:00
Tom Stellard
e3fc210a4f r300/compiler: Fix dataflow bug in presub_helper() 2010-09-10 18:18:09 -07:00
Tom Stellard
d442c7f172 r300/compiler: Replace asserts with error messages 2010-09-10 18:18:09 -07:00
Tom Stellard
66b1e716fb r300/compiler: Fix copy propigation for some presub instructions 2010-09-10 18:18:09 -07:00
Tom Stellard
564653b9f1 r300/compiler: Add peephole optimization for the 'sub' presubtract operation 2010-09-10 18:18:09 -07:00
Tom Stellard
a64b4a05af r300/compiler: Add peephole optimization for the 'add' presubtract operation 2010-09-10 18:18:09 -07:00
Tom Stellard
598e220f95 r300/compiler: Clean up rc_pair_alloc_source() 2010-09-10 18:18:09 -07:00
Tom Stellard
63432ecfce r300/compiler: Enable presubtract sources
The r300 compiler can now emit instructions that select from the presubtract
source.  A peephole optimization has been added to convert instructions like:
ADD Temp[0].x, none.1, -Temp[1].x into the INV (1 - src0) presubtract
operation.
2010-09-10 18:18:08 -07:00
Ian Romanick
d8a3662008 mesa: Remove unused Emit flags from gl_shader_compiler_options 2010-09-10 13:10:26 -07:00
Ian Romanick
55aaee6020 intel: Remove noise opcode support from i915 and i965 drivers
With recent changes to the GLSL compiler, these opcode should never be
seen in these drivers.
2010-09-10 12:33:15 -07:00
Alex Deucher
58eaade662 r600c: add missing header 2010-09-10 14:14:12 -04:00
Alex Deucher
9cced19125 r600c: add OQ support for evergreen 2010-09-10 13:26:10 -04:00
Alex Deucher
7ffc5d7c2e r600c: oq updates 2010-09-10 13:13:08 -04:00
Alex Deucher
4e53d6e6c9 r600c: add blit support for evergreen
driver was previously calling the r600 blit code
which won't work on evergreen.
2010-09-10 13:01:23 -04:00
Alex Deucher
886c6c09ea r600c: emit start3d packet on evergreen 2010-09-10 13:01:23 -04:00
Alex Deucher
f35b728acc r600c: fix some typos 2010-09-10 13:01:23 -04:00
Alex Deucher
a712db73ce r600c: fix type in cb setup on evergreen 2010-09-10 13:01:23 -04:00
Alex Deucher
c7843280f0 r600c: add support for more rendering formats on evergreen 2010-09-10 13:01:22 -04:00
Andre Maasikas
78109952d4 r600: set correct initial point_minmax values 2010-09-10 14:55:10 +03:00
Tilman Sauerbeck
ec2e0fd1e9 r600g: Fixed a bo reference leak in the draw module.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
0b4c529da5 r600g: Only increase a bo's map_count if radeon_bo_map() succeeded.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
56a80535b6 r600g: Fixed a bo leak in the error path of radeon_ctx_set_bo_new().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
ac2bddb9f2 r600g: Fixed a bo leak in r600_texture_from_handle().
We would leak bo if the argument check failed.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
ae23d425c2 r600g: Don't leave stale references in query_list when we cannot create bo.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck
96a4edb8cc r600g: Implemented the y component write for the LOG opcode.
This makes the 'vp1-LOG test' piglit test work.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:32 +02:00
Chia-I Wu
ea9e5dbbc2 egl: Simplify _eglBindContext.
Remove the hard-to-get-right _eglBindContextToSurfaces.  As well as fix
an assertion failure from b90a3e7d8b when
such call sequence is hit

  eglMakeCurrent(dpy, surf1, surf1, ctx1);
  eglMakeCurrent(dpy, surf2, surf2, ctx2);
  eglMakeCurrent(dpy, surf1, surf1, ctx1);
2010-09-10 18:41:14 +08:00
Andre Maasikas
67270e1fd6 r600: dont bswap rgba FLOAT formats
fixes at least some readback tests in piglit
2010-09-10 12:14:26 +03:00
Chia-I Wu
67660ccee9 targets/egl: Fix crashes from loading invalid modules.
Be defensive.
2010-09-10 16:03:04 +08:00
Chia-I Wu
5ea092117f gallium: Remove ST_API_OPENGL_ES1 and ST_API_OPENGL_ES2.
They are no longer used.
2010-09-10 15:44:19 +08:00
Chia-I Wu
948e3fa27c st/egl: Use profiles to create OpenGL ES contexts.
Replace all uses of ST_API_OPENGL_ES{1,2} by profiles.  Having 3
st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is not a
sane abstraction, since all of them share glapi for current
context/dispatch management.
2010-09-10 15:44:11 +08:00
Chia-I Wu
0cd480f076 st/dri: Use profiles to create OpenGL ES contexts.
Having 3 st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is
not a sane abstraction, since all of them share glapi for current
context/dispatch management.
2010-09-10 15:43:34 +08:00
Chia-I Wu
4531356817 gallium: Add context profile support to st_api.
Add struct st_context_attribs to describe context profiles and
attributes.  Modify st_api::create_context to take the new struct
instead of an st_visual.

st_context_attribs can be used to support GLX_ARB_create_context_profile
and GLX_EXT_create_context_es2_profile in the future.  But the
motivation for doing it now is to be able to replace ST_API_OPENGL_ES1
and ST_API_OPENGL_ES2 by profiles.

Having 3 st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is
not a sane abstraction, since all of them share glapi for current
context/dispatch management.
2010-09-10 15:37:43 +08:00
Dave Airlie
fcae8ca575 r600g: fixup state calculations for picking states.
for evergreen I ended up using a non-contig array of states, but
this code needs a bit of fixing up to deal with that.
2010-09-10 22:41:00 +10:00
Dave Airlie
f61b241eba r600g: fixup CB state numbering header 2010-09-10 21:59:06 +10:00
Dave Airlie
cc1b3b1013 r600g: fix warning in r600 pipe driver 2010-09-10 14:07:49 +10:00
Dave Airlie
ad5ada4372 r600g: evergreen CBs are more sane to support with a single state 2010-09-10 13:52:02 +10:00
Dave Airlie
7d564fdddd r600g: add multi-buffer flush support properly. 2010-09-10 13:52:02 +10:00
Dave Airlie
ab686d340a r600g: fix regression in multi-buffer tests since CB flush merge 2010-09-10 13:52:02 +10:00
Eric Anholt
6ef5f21234 i965: Add switch cases for ir_unop_noise, which should have been lowered.
Fixes compiler warnings.
2010-09-09 19:49:58 -07:00
Dave Airlie
50526e094f r600g: add initial evergreen support
adds shader opcodes + assembler support (except ARL)
uses constant buffers
add interp instructions in fragment shader
adds all evergreen hw states
adds evergreen pm4 support.

this runs gears for me on my evergreen
2010-09-10 19:41:18 +10:00
Dave Airlie
42da027433 r600g: align flushing of cb/db with DDX/r600c.
the DDX and r600c both flush cb/db after the draw is emitted,
as long as they do that, r600g can't be different, as it races.

We end up with r600g flush, set CB, DDX set CB, flush. This
was causing misrendering on my evergreen, where sometimes the drawing
would go to an old CB.
2010-09-10 11:29:23 +10:00
Dave Airlie
e795ca8f31 r600g: don't need 3 bos here.
the code should reloc correctly a single BO 3 times.
2010-09-10 11:29:23 +10:00
Brian Paul
48fda8c446 graw: added test for finding shader mem leaks 2010-09-09 19:19:28 -06:00
Brian Paul
451dfe5413 draw: minor reformatting 2010-09-09 19:19:28 -06:00
Brian Paul
821e390018 graw: emit warnings when context/surface creation failes 2010-09-09 19:19:28 -06:00
Brian Paul
5c3f678790 winsys: emit warning in null_sw_displaytarget_create() 2010-09-09 19:19:28 -06:00
Brian Paul
d851dae919 graw: fix array size, indentation, 2010-09-09 19:19:28 -06:00
Jakob Bornecrantz
379e2e77ba glsl2: Fix scons build for all platforms 2010-09-10 01:17:56 +02:00
Kristian Høgsberg
042a333028 Revert "glapi: Implement optional dispatch logging"
This reverts commit b9abc6139a and the
follow on fixes (7aae704 and 6fe1b47).  It's changing the glapi/driver
ABI and causes a number of problems for debug/non-debug builds.
2010-09-09 19:02:55 -04:00
Ian Romanick
1f3c7d968c glsl2: Implement noise[1234] built-in functions using ir_unop_noise 2010-09-09 15:39:52 -07:00
Ian Romanick
2b70dbfe09 glsl2: Add EmitNoNoise flag, use it to remove noise opcodes 2010-09-09 15:39:52 -07:00
Ian Romanick
547131ac87 glsl2: Add lowering pass to remove noise opcodes 2010-09-09 15:39:51 -07:00
Ian Romanick
3a5ce85cfa glsl2: Add ir_unop_noise 2010-09-09 15:39:51 -07:00
Kenneth Graunke
6dcca5a308 glsl/builtins: normalize of a negative scalar should be -1.0. 2010-09-09 15:23:12 -07:00
Kristian Høgsberg
6fe1b479ca mesa: Only reference logging symbols in debug builds 2010-09-09 18:00:44 -04:00
Kristian Høgsberg
144356f992 mesa: Don't reuse DummyFramebuffer as the incomplete framebuffer
Binding framebuffer 0 on a context that doesn't have a winsys drawable
will try to bind the incomplete framebuffer.  That fails when that's
also the dummy framebuffer.
2010-09-09 17:08:12 -04:00
Jakob Bornecrantz
7aae70406b glapi: Fix non-debug builds 2010-09-09 22:47:42 +02:00
ben
1d61793824 st/dri: support EGL_MESA_image_drm: queryImage
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-09-09 22:47:38 +02:00
ben
a572e3198d st/dri: support EGL_MESA_image_drm: createImage
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-09-09 22:47:31 +02:00
Kristian Høgsberg
6eda3f311b eglglx: Convert glx visuals/fbconfigs straight to EGL configs
In other words, skip the __GLcontextModes middle man.
2010-09-09 15:00:18 -04:00
Kristian Høgsberg
01a7eebc4c egl: Remove old egldri driver
This driver doesn't work with any of the DRI drivers in the source tree.
2010-09-09 14:05:30 -04:00
Kristian Høgsberg
b9abc6139a glapi: Implement optional dispatch logging
There's a useful feature buried in glapi to log all API calls to stderr.
Unfortunately it requires editing the code and then it's enabled
unconditionally for that build.  This patch builds in API logging for
debug builds and makes it run-time switchable by setting MESA_DEBUG=dispatch.
2010-09-09 13:21:15 -04:00
Kristian Høgsberg
94118fe2d4 glx: Optimize out no-op make current calls
This make a lot more sense now that we might have to recreate the
glx drawables for legacy code paths.
2010-09-09 13:18:43 -04:00
Chia-I Wu
916c8ed2c8 egl: Use _EGL_CHECK_DISPLAY in eglCreateContext.
_EGL_CHECK_DISPLAY checks the display and returns from eglCreateContext
on error.
2010-09-10 00:18:23 +08:00
Chia-I Wu
08a482e7a9 egl: Display may be NULL in _eglLookup*.
This fixes several NULL dereferences.
2010-09-10 00:18:14 +08:00
Brian Paul
3ec296390c llvmpipe: remove redundant tgsi_dup_tokens() call
We were calling this twice so the first allocation was orphaned/leaked.
2010-09-09 10:04:39 -06:00
Francisco Jerez
cdd5f21eac dri/nouveau: Expose EXT_texture_env_combine. 2010-09-09 14:19:36 +02:00
Francisco Jerez
3bbad7f108 dri/nv10-nv20: Add support for NV_texture_env_combine4. 2010-09-09 14:19:35 +02:00
Francisco Jerez
699749cfee dri/nv04: Add support for NV_texture_env_combine4. 2010-09-09 14:19:35 +02:00
Francisco Jerez
a76f6dc849 dri/nouveau: Minor cleanup. 2010-09-09 14:19:35 +02:00
Kristian Høgsberg
80e48ddcf6 glx: Fix another use-after-free problem 2010-09-09 08:06:51 -04:00
Andre Maasikas
777f352e60 r600: add TXL instruction and note about TXB 2010-09-09 11:08:11 +03:00
Andre Maasikas
1f12945d2f r600: remove depth exports move, just set to output x <- z in the export intruction 2010-09-09 11:08:11 +03:00
Andre Maasikas
7753416c5b r600: protect cleanup instructions from double free
We might get the cleanup when we have not translated the shader yet
e.g 2 programstringnotifys in a row
2010-09-09 11:08:11 +03:00
Andre Maasikas
5697bf1660 r600: remove mask from output intructions
in case of relative addressing we never get to know which comps
were really written.
2010-09-09 11:08:11 +03:00
Andre Maasikas
ae21956be2 r600: allow relative addressing of temps, inputs, outputs 2010-09-09 11:08:10 +03:00
Andre Maasikas
515d6eed0b r600: handle LIT writemask 2010-09-09 11:08:10 +03:00
Andre Maasikas
9d0d78ad3f r600: fix rsq from negative input
arbfp specifies rsq of abs value
2010-09-09 11:08:10 +03:00
Chia-I Wu
68071822f7 docs: Update egl.html.
Mention that EGL_DRIVERS_PATH should be specified for uninstalled build.
Update TODOs.
2010-09-09 13:53:13 +08:00
Luca Barbieri
e591c4625c glsl: add several EmitNo* options, and MaxUnrollIterations
This increases the chance that GLSL programs will actually work.

Note that continues and returns are not yet lowered, so linking
will just fail if not supported.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-08 20:36:37 -07:00
Luca Barbieri
6d3a2c97f4 glsl: make compiler options per-target
This allows us to specify different options, especially useful for chips
without unified shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-08 20:36:37 -07:00
Luca Barbieri
ede4205b24 mesa: add PIPE_SHADER_* like constants and conversions to/from enums (v2)
Changes in v2:
- No longer adds tessellation enums
2010-09-08 20:36:37 -07:00
Eric Anholt
5ecd9c70ce glsl: Add info about talloc and optimization passes to the README. 2010-09-08 18:09:05 -07:00
Eric Anholt
e04f90712d glsl: Update README talking about multi-instruction operations.
The previous thing taking multiple instructions ended up being handled
at the IR level, as we suggested would be the common result.  Pick a
new one.
2010-09-08 18:05:22 -07:00
Kristian Høgsberg
d8ab9aac54 glx: Destroy pixmap after destroying glx and dri drawables
Now that we suppress BadDrawable from DRI2DestroyDrawable, this doesn't
matter, but we would get that error before when destroying pbuffers.
2010-09-08 20:55:24 -04:00
Kristian Høgsberg
7b34fcc487 configure: Enable -fvisibility=hidden for g++ as well 2010-09-08 20:45:07 -04:00
Kenneth Graunke
7fc882643c glsl/builtins: Set the API in the fake context.
Otherwise it gets used uninitialized.
2010-09-08 17:38:42 -07:00
Ian Romanick
f69a6647fb glsl2: Clear out profile pointers in _mesa_glsl_release_functions
Otherwise builtin_profiles contains dangling pointers the next time
_mesa_read_profile is called.  I suspect this may fix bugzilla #29847,
but I was never able to reproduce it.
2010-09-08 17:16:49 -07:00
Ian Romanick
de1ffd2f62 mesa: Refactor parameter processing in set_combiner_(operand|source)
The enum values were chosen to have sequential values for a reason.
Use that to compact and simplify the code.
2010-09-08 16:26:15 -07:00
Ian Romanick
1a2d498b41 mesa: Fix handling of texenv operands for EXT vs ARB version
GL_EXT_texture_env_combine has slightly more restrictive limits on the
valid sources for some operands.  This wasn't caught before because
almost every driver in Mesa that supports the EXT version also
supports the ARB version.

Inspired by a patch posted the the mesa-dev mailing list by Andrew
Randrianasulu.
2010-09-08 16:26:07 -07:00
Kristian Høgsberg
f24ec6367b glx: Ignore DRI2 event for drawables we've destroyed
Since we now actually destroy GLX drawables, we get into situations where
we get events for drawables that no longer exist.  Just ignore the
event in that case.
2010-09-08 18:54:48 -04:00
Kristian Høgsberg
659dab6be6 glx: Fix use after free problem 2010-09-08 18:54:48 -04:00
Kenneth Graunke
fc1daab2a2 glsl: Fix for scalar float built-in definitions.
These need abs, and we need more tests.
2010-09-08 15:38:09 -07:00
Eric Anholt
c3db43df04 glsl: regenerate builtins 2010-09-08 15:01:02 -07:00
Eric Anholt
aa973d3533 glsl: Fix typo in builtin step() using a wrong channel. 2010-09-08 14:54:08 -07:00
Kenneth Graunke
368dc76f04 ir_validate: Ensure ir_binop_dot is only used on vector types. 2010-09-08 12:09:42 -07:00
Kenneth Graunke
4b2ffa0a42 glsl: Refresh automatically generated file builtin_function.cpp. 2010-09-08 12:09:42 -07:00
Kenneth Graunke
1f7e6e1e72 glsl/builtins: Don't use ir_binop_dot on floating point values.
ir_binop_dot is only defined for vector types.  Use ir_binop_mul.
2010-09-08 12:09:41 -07:00
Kenneth Graunke
84160a0454 glsl/builtins: Simplify degenerate scalar float cases.
The code being generated was just stupid, considering that:
- normalize(x) = 1.0
- length(x) = x
- distance(x, y) = x - y
2010-09-08 12:09:41 -07:00
Ian Romanick
961f42c9bd glsl2: Make sure _mesa_glsl_parse_state constructor gets a context
Fix an major regression in dc754586.  Too bad that change was
obviously never tested.
2010-09-08 11:34:22 -07:00
Kristian Høgsberg
16887d042a glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread
safe.  Instead, just destroy the client side structures when the
drawable is no long current for a context.
2010-09-08 09:20:42 -04:00
Kristian Høgsberg
b4bb668020 dri: Unset current context and dispatch table when unbinding
Otherwise, when we switch to an indirect glx context and then back, it looks
like we're still current.

https://bugs.freedesktop.org/show_bug.cgi?id=29977#c7
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-08 09:01:43 -04:00
Chia-I Wu
1a5b32ca01 glsl: Support GLSL ES in the standalone compile.
GLSL ES mode is enabled when --glsl-es is passed to glsl_compiler.
2010-09-08 04:08:29 -07:00
Chia-I Wu
dc754586ca glsl: Require a context in _mesa_glsl_parse_state.
Create a dummy context in the standalone compiler and pass it to
_mesa_glsl_parse_state.
2010-09-08 04:08:24 -07:00
Chia-I Wu
7e03e2b2c7 st/dri: Call dri_init_extensions only for API_OPENGL.
libmesagallium.a that this state tracker will be linked to expects
OpenGL's _glapi_table.  That is, it expects libGL.so instead of
libGLESv1_CM.so or libGLESv2.so.  As there is no clean way to know the
shared library the app links to, use the api as a simple check.  It
might be as well to simply remove this function call though.
2010-09-08 18:21:19 +08:00
Chia-I Wu
444d8408e7 st/dri: Use enum st_api_type internally. 2010-09-08 18:20:44 +08:00
nobled
8e3b658b7f st/dri: Add multi-api support
Make st/dri screens capable of creating OpenGL ES and
OpenGL ES2 contexts.

TODO: Figure out the "get_current" problem with multiple
st_api's for real.

(s/API_OPENGLES1/API_OPENGLES/ by Chia-I Wu)
2010-09-08 17:25:01 +08:00
nobled
ecd7ec9d62 st/dri: Make clear which API's are supported
If the caller requests a GLES context, don't silently create
a desktop GL context in its place.
2010-09-08 12:55:26 +08:00
Dave Airlie
bf346f065c r600g: add initial bank swizzle support.
this is ported from r600c mostly, bank swizzling is real messy and I don't think
I got enough sleep last night to fully understand it.
2010-09-08 14:12:21 +10:00
Kenneth Graunke
48e789d71e glcpp: Fix build on non-GCC compilers. 2010-09-07 18:01:33 -07:00
Kenneth Graunke
10eaa8bcbc ast_to_hir: Mark arrays as lvalues in GLSL ES, but prohibit assignment.
This allows them to be passed as out/inout parameters, but still
prevents them from being used as the target of an assignment.  This is
per section 5.8 of the GLSL ES 1.00 specification.
2010-09-07 17:30:39 -07:00
Kenneth Graunke
a98d5a5ac8 glsl: Allow overloading of built-ins without hiding in GLSL ES.
The rules are explicitly different from desktop GLSL.
2010-09-07 17:30:39 -07:00
Kenneth Graunke
f412fac5b4 glsl: Move is_builtin flag back to ir_function_signature.
This effectively reverts b6f15869b3.

In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.

However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
c98deb18d5 ast_to_hir: Reject embedded structure definitions in GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
d8e34e29eb ast_to_hir: Reject unsized array declarations in GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
b4ec3f268c ast_to_hir: Allow matrix-from-matrix constructors in GLSL ES.
Everything but 1.10 supports this, so just change the check to ==.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
883ac22810 i965: Enable EXT_framebuffer_blit internally.
Otherwise, ES2's BindFramebuffer entrypoint hits this assertion:
main/fbobject.c:1323: _mesa_BindFramebufferEXT: Assertion
`ctx->Extensions.EXT_framebuffer_blit' failed.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
67da41c10c mesa: Enable GL_MAX_VERTEX_ATTRIBS in ES2.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-07 17:30:38 -07:00
Kenneth Graunke
5a81d057db linker: Fix assertion and cross-version checks for version 100.
Fixes an assert (min_version >= 110) which was no longer correct, and
also prohibits linking ES2 shaders with non-ES2 shaders.  I'm not
positive this is correct, but the specification doesn't seem to say.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
116dc670e9 glsl: Add built-in function profiles for GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
b4fe4d52b6 glsl: Add built-in variables for GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
76deef138e glsl: Split out types that are in 1.10 but not GLSL ES 1.00. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
c5e74871d9 glsl: Recognize GLSL ES 1.00 keywords. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
7dcfc44b72 glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.
Also define it if #version 100 is encountered.
2010-09-07 17:30:37 -07:00
Kenneth Graunke
719caa403e glsl: Accept language version 100 and make it the default on ES2. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
814c89abdb glsl: Set default language version in mesa_glsl_parse_state constructor.
This should make it easier to change the default version based on the
API (say, version 1.00 for OpenGL ES).

Also, synchronize the symbol table's version with the parse state's
version just before doing AST-to-HIR.  This way, it will be set when
it matters, but the main initialization code doesn't have to care about
the symbol table.
2010-09-07 17:30:37 -07:00
Eric Anholt
4a867be143 ir_to_mesa: Add support for gl_NormalScale.
Bug #30040.
2010-09-07 16:43:35 -07:00
Kenneth Graunke
a09a8ec12d glsl: Make sure shader source isn't NULL.
This should only occur if glCompileShader is called without a prior call
to glShaderSource.  An empty source program should be the empty string.
2010-09-07 16:25:53 -07:00
Tilman Sauerbeck
1e28dd4ebe r600g: Added missing r600_bc_add_literal() calls to XPD implementation.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:10:46 +10:00
Tilman Sauerbeck
460c5304ab r600g: Added preliminary support for the LOG opcode.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:10:07 +10:00
Tilman Sauerbeck
42c966bc49 r600g: Added missing abs-ification to RSQ.
This makes the 'fp1-RSQ test 2' piglit test work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:07:02 +10:00
Dave Airlie
a3a94554f5 r600g: split opcodes out and add wrapper around usage.
This splits the r600 opcodes out of the sq file and adds a wrapper
so we can convert to evergreen opcodes later without touching these functions
too much.
2010-09-08 08:49:00 +10:00
Dave Airlie
d42efb9e8d r600g: add support for constants in memory buffers.
DX9 constants were in the constant file, and evergreen no longer support
cfile. r600/700 can also use constants in memory buffers, so add the code
(disabled for now) to enable that as precursor for evergreen.
2010-09-08 08:41:57 +10:00
Dave Airlie
9ef1c51be1 r600g: abstract the hw states out behind a vtbl.
this is step one towards evergreen support, it lets us plug in whole
new hw level states.
2010-09-08 08:30:59 +10:00
Ian Romanick
f09fabc448 glsl2: Forbid array-types in ?: operator in GLSL 1.10
Fixes bugzilla #30039.
2010-09-07 14:33:29 -07:00
Eric Anholt
50a3349bee mesa: Set the base format of GL_ALPHA FBOs and teach swrast about it.
Fixes assertion failures in fbo-alpha with a debug build of Mesa.
Bug #29781.
2010-09-07 14:34:23 -07:00
Eric Anholt
acd7c21541 ir_to_mesa: Fix warning in last commit.
I swear there was some git option for "don't push things when you've
got uncommitted changes", but I can't find it now.
2010-09-07 14:26:53 -07:00
Eric Anholt
6c0ba32fd1 ir_to_mesa: Move the STATE_VAR elements of a builtin uniform to a temp (v2).
Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

v2: Continue referencing the STATE_VAR[] file directly when the
uniform will land in STATE_VAR[] formatted exactly as we'd put into a
temporary.  When there's array dereferencing, we don't copy-propagate
in Mesa IR (not knowing where the array is in register space), so
smarts here are required or we'll massively increase the temp count.
2010-09-07 13:59:29 -07:00
Ian Romanick
956f049fd2 glsl2: Early return with visit_continue in loop_analysis::visit(ir_dereference_variable *)
Returning early with visit_continue_with_parent prevented the
then-statements and else-statements of if-statements such as the
following from being processed:

	  if (some_var) { ... } else { ... }

Fixes piglit test case glsl-fs-loop-nested-if and bugzilla #30030.
2010-09-07 13:36:32 -07:00
Kenneth Graunke
0427228bbc glsl: Change grammar rules for selection statements to match the spec.
Fixes piglit test case loop-06.vert.

Unfortunately, causes 1 shift/reduce conflict.
2010-09-07 13:17:05 -07:00
Eric Anholt
24c12e6c7f i965: Store the byte address in the VS constant buffer as an integer.
We carefully multiplied our two ints (since we want to be precise
after all) then stored them in a float, which is not specced to really
work, in addition to wasting precision.  Fixes
vp-arl-constant-array-huge-* things since the assertions were added.
2010-09-07 13:00:22 -07:00
Eric Anholt
32b84ef4ca i965: Make pixel_xy results UW.
There is a restriction on the destination of an operation involving a
vector immediate being 128-bit aligned and the destination horizontal
stride being equivalent to 2 bytes.  Fixes bad pixel_x results from
gl_FragCoord, where each pair had the same value.
2010-09-07 13:00:22 -07:00
Török Edvin
c47b289972 glsl2: check for _NumLinkedShaders being 0
Otherwise spring 0.82+.4.0 crashes when starting a game
because prog->_LinkedShaders[0] is NULL.

This also fixes piglit test cases glsl-link-empty-prog-0[12].
2010-09-07 12:27:07 -07:00
Kristian Høgsberg
3ea3f5e0a5 glx: Set an all NULL vtable for dummyContext
This reverts 6a6e6d7b0a and initializes
dummyContext with an all NULL vtable.  The context vtable pointer is
supposed to always be non-NULL, but the vtable entries can be NULL.
2010-09-07 14:32:28 -04:00
Kristian Høgsberg
57d3f71132 glx: Fix compilation with out xf86vidmode 2010-09-07 14:24:25 -04:00
Kristian Høgsberg
f84d8fab99 glx: Use GLX_BufferSwapComplete unconditionally, we require glproto 1.4.11 2010-09-07 14:24:25 -04:00
Michel Dänzer
6a6e6d7b0a Fix crashes when some GLX API entrypoints are called with no current context.
I was hitting this with gliv.

The GLX spec explicitly mentions that glXWaitX, glXWaitGL and glXUseXFont calls
are ignored when there's no current context. Not sure what if anything the
GLX_EXT_texture_from_pixmap spec says about this, but I think ignoring the
calls makes more sense than crashing there as well. :)
2010-09-07 19:54:16 +02:00
Eric Anholt
5afdfa222f i965: Don't bother with RNDZ for f2i.
The default type conversion for MOV should be fine, and RNDZ actually
requires two instructions.
2010-09-07 10:34:10 -07:00
Eric Anholt
a560a509fa i965: Add some validation on BRW_OPCODE_MUL and ADD's arguments.
Now that we're playing with other types in brw_fs.cpp, it's easy to
trip over issues like these.
2010-09-07 10:34:10 -07:00
Eric Anholt
0002069fd5 i965: Add assertion for another requirement about types.
This catches a failure in the FS backend.
2010-09-07 10:34:09 -07:00
Eric Anholt
3fb5377ba5 i965: Align the start of attribute interp coefficients in FS to use PLN. 2010-09-07 10:34:09 -07:00
Eric Anholt
3dbc9ea0a3 i965: Just assert when we flagged a compile error in the FS for now.
Dumping back to potentially 16-wide dispatch doesn't really work out
at the moment, and hopefully I'll just be able to resolve all the
failures so we never have to do this at all.
2010-09-07 10:34:09 -07:00
Eric Anholt
42fc60cadc i965: Clean up fs_reg setup by using a helper for constructors. 2010-09-07 10:34:09 -07:00
Eric Anholt
b157113e73 i965: When using the new FS backend, don't validate the Mesa IR version. 2010-09-07 10:34:09 -07:00
Eric Anholt
5c77792859 i965: Add a bit of validation for some ISA restrictions in the docs. 2010-09-07 10:34:09 -07:00
Eric Anholt
e432fe09dd i965: set the source width/stride when handling reladdr dests in the VS.
This is a requirement specified in the docs.  No behavior change in
glsl-vs-varying-array.shader_test that violated these requirements.
2010-09-07 10:34:09 -07:00
Jon TURNEY
2b9dac397b Make XF86VIDMODE extension optional
Code in glx/glxcmds.c which uses the XF86VIDMODE extension is already guarded.  Also use
that guard to control inclusion of the xf86vmode.h header, and only enable that guard if the
XF86VIDMODE extension is found by pkgconfig.

This changes the behaviour on platforms which XF86VIDMODE exists, in that XF86VIDMODE used to
be mandatory, but is now optional.

Presumably other build systems are already arranging for -DXF86VIDMODE to be supplied to the
complier when glxcmds.c is compiled, so are not affected by this change

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-09-07 13:30:19 -04:00
Kristian Høgsberg
dd2658d0ac glx: Drop unused dri2proto.h include 2010-09-07 13:30:12 -04:00
Kristian Høgsberg
60fce15447 glx: Move dpy and scr fields out of direct rendering conditional
Nothing direct rendering specific about these fields.  Moving them out
makes no-direct-rendering compilation work again.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-07 12:41:09 -04:00
Jon TURNEY
ae9487c299 Some fixes for GLX_INDIRECT_RENDERING only build
This fixes some of the build issues with GLX_INDIRECT_RENDERING but !GLX_DIRECT_RENDERING due to recent changes.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-07 12:33:11 -04:00
nobled
6561a64a69 dri: Make it a little clearer that we're not dereferencing a NULL pointer 2010-09-07 12:26:33 -04:00
nobled
1b8c9fef11 dri: Use the right type for the API token
Pass mesa_api to CreateContext, and abort early
if the requested API isn't recognized.
2010-09-07 12:26:33 -04:00
Chia-I Wu
28c790ab31 libgl-xlib: Fix --enable-gallium-llvm build.
Check MESA_LLVM and link to LLVM as other targets do.
2010-09-07 23:54:25 +08:00
Chia-I Wu
d5c5a5aea0 llvmpipe: Add lp_rast_debug.c to Makefile. 2010-09-07 23:04:43 +08:00
Jon TURNEY
23e2dec1a1 glx: Only clear the stored context tag when the context has been unbound
The calling order of ->bind and ->unbind changed and then ->unbind would
clear the currentContextTag of the old context before ->bind could reuse
it in the make current request, in the indirect case.

Instead, clear the old currentContextTag if and only if we send a request
to the server to actually unbind it or reassign it to another context.

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

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-07 09:07:23 -04:00
José Fonseca
a7c4541d27 llvmpipe: Refactor lp_scene_add_resource_reference
Less goto spaghetti.
2010-09-07 14:02:29 +01:00
José Fonseca
9cd45b8edf llvmpipe: Fix negated logic in lp_scene_add_resource_reference().
Fixes performance regression.
2010-09-07 14:02:29 +01:00
Keith Whitwell
9df8a7565d llvmpipe: move more coef setup into lp_setup_coef.c 2010-09-07 14:02:29 +01:00
Keith Whitwell
afba373cb1 llvmpipe: declare fence handle struct 2010-09-07 14:02:29 +01:00
Keith Whitwell
f25836d7b2 llvmpipe: rasterization debugging helpers 2010-09-07 14:02:29 +01:00
Keith Whitwell
9f6e8e1d6b llvmpipe: use opcodes instead of function pointers in bins
Also, move some state from rasterizer struct to the scene.
2010-09-07 14:02:15 +01:00
Keith Whitwell
040e59851a llvmpipe: rearrange queries 2010-09-07 14:01:50 +01:00
Keith Whitwell
6419ecd02c llvmpipe: enforce fixed memory limit on scenes 2010-09-07 14:01:43 +01:00
Keith Whitwell
c512ba88a7 llvmpipe: clean up deferred zstencil clears 2010-09-07 13:22:55 +01:00
Keith Whitwell
18452c1e87 llvmpipe: rework fences and queries 2010-09-07 13:22:55 +01:00
Keith Whitwell
5024d9b90e llvmpipe: move whole-tile emit into a function 2010-09-07 13:22:55 +01:00
Keith Whitwell
71e27ef21c llvmpipe: put fs variant dumping in a function 2010-09-07 13:22:54 +01:00
Tilman Sauerbeck
98e277111b Replace reference to tgsi-instruction-set.txt.
That file has been replaced by tgsi.rst.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-09-07 09:48:22 +01:00
Luca Barbieri
4a730b773f nouveau: restore nouveau_class.h for nv04-nv20
Sorry, I deleted the Gallium copy without realizing that the DRI
one was just a symlink to it.
2010-09-07 08:22:43 +02:00
Luca Barbieri
09782c727d nvfx: fix return in vp main 2010-09-06 18:08:36 +02:00
José Fonseca
079c884060 mesa: Define C99's __func__ macro on MSVC. 2010-09-06 13:57:44 +01:00
Dave Airlie
35e01b79cb r600g: add error print for no literals for r700s as well 2010-09-06 10:38:29 +10:00
Dave Airlie
2caf6f5e84 r600g: fixup r700 assembler for clamp/relative addressing 2010-09-06 10:35:51 +10:00
Dave Airlie
48cdad70d9 r600g: add script to generate header file with offsets into state objects.
This was inherently fragile as any changes to r600_states.h would also
need manual updating of all of the bits in radeon.h. Just add a simple
python script to do the conversion, its not hooked up to make at all.

This also will make adding evergreen a bit easier.
2010-09-06 10:28:08 +10:00
Dave Airlie
5b82777311 r600g: fix up surface references
We end up referencing the new surf and derefing the old surface which
is a copy of the pointer to the new surf. So just bump the ref count directly.
2010-09-06 09:15:42 +10:00
Dave Airlie
3a672785df r600g: search for sampler views in context on removal.
Need to remove from context as well.
2010-09-06 09:15:42 +10:00
Dave Airlie
6ec0fff822 r600g: add missing printf operand 2010-09-06 09:15:41 +10:00
Luca Barbieri
357a7e90df nvfx: support nv30 simulation on nv40 2010-09-05 23:41:33 +02:00
Henri Verbeet
d8bba2ef69 radeon: Add radeon_buffer_objects.c. 2010-09-05 22:42:12 +02:00
Henri Verbeet
7d4f352586 r200: Add radeon_buffer_objects.c. 2010-09-05 21:58:20 +02:00
Henri Verbeet
50b9c54ef6 radeon: Make do_blit_readpixels() into a PBO work. 2010-09-05 20:26:14 +02:00
Luca Barbieri
029c181571 mesa: don't smash the stack in _mesa_find_used_registers
At some point this actually triggered, not sure if it still does.

Give a meaningful assert and refuse to smash the stack anyway.
2010-09-05 17:57:12 +02:00
Luca Barbieri
9a77d0471a mesa: don't expose unsupported GL_ARB_geometry_shader4 for now
The new GLSL compiler doesn't support it.

Advertising it prevents Unigine Heaven from working, since it attempts to
use it.
2010-09-05 17:53:16 +02:00
Luca Barbieri
beb3d030a1 nouveau: delete nouveau_class.h, move nv50 regs to nv50_reg.h
nv50 should switch to rules-ng-ng too at some point.

The classic Mesa Nouveau driver also includes a copy of nouveau_class.h,
and should convert to rules-ng-ng too and remove it.
2010-09-05 17:52:26 +02:00
Luca Barbieri
7d53a3b7a4 nvfx: move nv04_2d to rules-ng-ng 2010-09-05 17:52:26 +02:00
Luca Barbieri
d46c5ce7b6 nvfx: switch to rules-ng-ng register headers
This is the new register generation toolkit in use by nouveau.

As far as I know, this is the best register description toolkit in
existence, and you should use it too for your hardware :)

Thanks to Marcin Kościelnicki for inventing it and performing
invaluable reverse engineering work of nVidia chips.
2010-09-05 17:52:26 +02:00
Luca Barbieri
3bca263a92 nvfx: remove remaining BEGIN_RING/eng3d uses 2010-09-05 17:52:26 +02:00
Luca Barbieri
49b493ddd0 nvfx: pause occlusion queries during blitter usage
Thanks for Dave Airlie and Jerome Glisse for their code which made
me realize I need this too.
2010-09-05 17:52:26 +02:00
Luca Barbieri
14d5805235 nvfx: properly return fogcoord.w == 1
Hardware sets it to 0, so we add an ADD to put an 1 there if the
application really wants the alpha channel.
2010-09-05 17:52:25 +02:00
Luca Barbieri
76f696b1f6 nvfx: support saturate in vp
Completely untested, since Mesa apparently never uses this currently.

In particular, it might not work with scalar slot op.
2010-09-05 17:52:25 +02:00
Luca Barbieri
8e2badfc26 nvfx: add rewritten swtnl support
The old swtnl code was broken by the new shader linkage support for
GLSL.

This is a rewrite of swtnl support, which should instead work properly,
be faster and more closer to the much more tested hardware pipeline.
2010-09-05 17:52:25 +02:00
Luca Barbieri
43cfc1ed8e nvfx: use a piglit-ignored format for unknown cap message 2010-09-05 17:52:25 +02:00
José Fonseca
7d45bf8762 llvmpipe: Remove some broken MinGW hacks in the sin/cos reference code. 2010-09-05 10:40:38 +01:00
José Fonseca
1c009f970e glsl: Add new files to sconscript. 2010-09-05 10:17:51 +01:00
José Fonseca
d278ddc009 llvmpipe: Fix perspective divide interpolation.
Intuition != mathematics, so this time I actually worked out the right
formula for first order approximation of perspective interpolation.

Ironically, per quad divide actually makes things slower when compared
with per pixel divide -- probably because the divide hardware unit is
rarely used, whereas the multiply unit is typically already saturated
and the first order approximation imply more multiplications.
2010-09-05 10:17:51 +01:00
José Fonseca
b8684b2458 util: Helper function to determined whether two formats can be memcpy'ed.
These are the non-trivial conversions that this function recognizes,
which was produced by u_format_compatible_test.c:

  b8g8r8a8_unorm -> b8g8r8x8_unorm
  a8r8g8b8_unorm -> x8r8g8b8_unorm
  b5g5r5a1_unorm -> b5g5r5x1_unorm
  b4g4r4a4_unorm -> b4g4r4x4_unorm
  l8_unorm -> r8_unorm
  i8_unorm -> l8_unorm
  i8_unorm -> a8_unorm
  i8_unorm -> r8_unorm
  l16_unorm -> r16_unorm
  z24_unorm_s8_uscaled -> z24x8_unorm
  s8_uscaled_z24_unorm -> x8z24_unorm
  r8g8b8a8_unorm -> r8g8b8x8_unorm
  a8b8g8r8_srgb -> x8b8g8r8_srgb
  b8g8r8a8_srgb -> b8g8r8x8_srgb
  a8r8g8b8_srgb -> x8r8g8b8_srgb
  a8b8g8r8_unorm -> x8b8g8r8_unorm
  r10g10b10a2_uscaled -> r10g10b10x2_uscaled
  r10sg10sb10sa2u_norm -> r10g10b10x2_snorm

State trackers and pipe drivers should be updated to take advantage of
this knowledge, e.g., in surface_copy.
2010-09-05 10:17:51 +01:00
José Fonseca
00989d5bfc llvmpipe: Relax the colormask constraint on opaque.
Also, include the color buffer in the key. Not having it there
causes a tight knots in the logic to determine when it is OK or not
to discard previous color buffer contents.
2010-09-05 10:17:51 +01:00
José Fonseca
f25b6e546e util: Utility function to determine the channels that can be written in a color format. 2010-09-05 10:17:51 +01:00
José Fonseca
30c5d5d9d8 scons: Re-enable SSE on MinGW.
It seems to be working correctly with gcc 4.4, and enabling it allows to
test some of the llvmpipe instrinsics on Windows.
2010-09-05 10:17:51 +01:00
José Fonseca
6ed726b8fc gallivm: Pass condition masks as an unsigned bitmask.
Much more convenient than boolean arrays.
2010-09-05 10:17:51 +01:00
José Fonseca
079763f746 gallivm: Cope with tgsi instruction reallocation failure. 2010-09-05 10:17:51 +01:00
Kenneth Graunke
9a3df46fbc ir_reader: Only validate IR when a global 'debug' flag is set.
This extra validation is very useful when working on the built-ins, but
in general overkill - the results should stay the same unless the
built-ins or ir_validate have changed.

Also, validating all the built-in functions in every test case makes
piglit run unacceptably slow.
2010-09-05 01:57:37 -07:00
Marek Olšák
ece8490bb5 r300g,r300c: memset the compiler struct to zeros
This should fix bogus reports "Too many temporaries." and maybe some others.
2010-09-05 05:09:25 +02:00
Tom Stellard
7a212525a2 r300/compiler: Remove stray break statement
This fixes glsl-fs-loop-nested.
2010-09-04 17:27:55 -07:00
Luca Barbieri
c50b7e04eb nvfx: support unlimited constants and immediates in fp 2010-09-05 02:01:02 +02:00
Luca Barbieri
9fc50968ad nvfx: support using blitter to copy depth/stencil resources, fix Heaven
We might want to copy them as color ones though.

Also works around crash in Unigine Heaven due to failing to allocate
a 64 MB temporary in GART for a CPU copy.

Unigine Heaven now works on nv40, albeit with very heavy glitches (with
the floating branch with render_hdr 0).
2010-09-05 02:01:02 +02:00
Marek Olšák
6dc71d6aa5 r300/compiler: fix the instruction limit in vertex shaders
Broken with commit d774b0c710.

Reported by Chris Rankin.
2010-09-05 00:44:52 +02:00
Luca Barbieri
20bf5037d6 nvfx: support rendering to more formats 2010-09-04 22:45:21 +02:00
Luca Barbieri
25ecc9521d nvfx: move 2D format selection logic to 2D code 2010-09-04 22:45:21 +02:00
Luca Barbieri
5bd0e0adb1 nvfx: fix swizzling of high bpp surfaces 2010-09-04 22:45:21 +02:00
Luca Barbieri
2e6c65722a nvfx: fix some subrectangle copies
Actually, we may want to get rid of the x/y coordinates for linear
surfaces, and realign the origin from scratch if necessary, instead
of doing this "on-demand realignment".
2010-09-04 22:45:21 +02:00
Luca Barbieri
90d3291595 nvfx: fix inlinining in nv04_2d.c 2010-09-04 22:45:21 +02:00
Luca Barbieri
11d29739e1 nvfx: fix the temporary copying logic and add asserts 2010-09-04 22:45:21 +02:00
Luca Barbieri
f7392eb23a nvfx: prevent swizzled rendering into formats where it's not supported 2010-09-04 22:45:21 +02:00
Marek Olšák
280665be70 Revert "ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp."
This reverts commit 5ad74779ce.

Sorry, but I had to revert this.

Any commit which needlessly increases the number of temporaries is wrong.
More temporaries mean less shader performance because of reduced parallelism
and therefore less efficient latency hiding. In this case, there is possible
performance degradation of every shader which uses GL state variables.
I cannot accept this.
2010-09-04 19:06:47 +02:00
Marek Olšák
cbf7e82786 Revert "r300g: refuse to create a texture with size 0"
This reverts commit 5cdedaaf29.

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

Conflicts:

	src/gallium/drivers/r300/r300_texture.c
2010-09-04 19:06:47 +02:00
Marek Olšák
6e64096190 r300g: remove unnecessary assignments 2010-09-04 19:06:47 +02:00
Marek Olšák
58471c801a r300/compiler: indent printed instructions according to the branch depth 2010-09-04 18:56:22 +02:00
Marek Olšák
d3ca8a4edd r300g: skip draw calls with no vertex elements, fixing hardlocks 2010-09-04 18:56:22 +02:00
Marek Olšák
d774b0c710 r300/compiler: use limits from the compiler input instead of inline constants 2010-09-04 18:56:22 +02:00
Marek Olšák
63943c8fcd r300/compiler: improve register allocation with indexable temporaries for VS
Register allocation can now reallocate temporaries right after the last indexed
source operand, instead of being disabled for the whole shader.
2010-09-04 18:56:22 +02:00
Marek Olšák
33360a707e r300/compiler: fix handling of indexed temporaries in peephole 2010-09-04 18:56:22 +02:00
Marek Olšák
aa554d508b r300/compiler: disable deadcode elimination for indexed dst operands 2010-09-04 18:56:22 +02:00
Marek Olšák
f90c870304 r300/compiler: allocate at least FS inputs if register allocation is disabled 2010-09-04 18:56:22 +02:00
Marek Olšák
cfc461fca6 r300g: add a new debug option which disables compiler optimizations
Those are:
- dead-code elimination
- constant folding
- peephole (mainly copy propagation)
- register allocation

There are some bugs which I need to track down.

Also fix up the descriptions of all the debug options.
2010-09-04 18:56:22 +02:00
Marek Olšák
d2f4ceaa47 r300/compiler: compute the final number of temporaries during translation
And not during the register allocation, which may be skipped for debugging
purposes. Also the predicate register is now added to the number of temps.
2010-09-04 18:56:21 +02:00
Marek Olšák
f46fd04136 r300/compiler: make optimizations not use 0.5 swizzles in vertex shaders 2010-09-04 18:56:21 +02:00
Marek Olšák
63eafaa8ec r300/compiler: use peephole and constant folding for vertex shaders too 2010-09-04 18:56:21 +02:00
Marek Olšák
f5609ff0d7 r300/compiler: remove unused enum OPCODE_REPL_ALPHA
We use RC_OPCODE_REPL_ALPHA instead.
2010-09-04 18:56:21 +02:00
Marek Olšák
fba5f6bda7 r300/compiler: refactor fragment shader compilation
This cleans up the mess in r3xx_compile_fragment_program.
2010-09-04 18:56:21 +02:00
Marek Olšák
3ba562e62a r300/compiler: add new compiler parameter max_constants 2010-09-04 18:56:21 +02:00
Marek Olšák
0b9f836147 r300/compiler: refactor vertex shader compilation
First list compiler passes in an array, then run the new function rc_run_compiler.
Every backend may need a different set of passes.
This cleans up the mess in r3xx_compile_vertex_program.
2010-09-04 18:56:21 +02:00
Marek Olšák
9a9aa7daa8 r300/compiler: remove a redundant parameter in rc_pair_regalloc 2010-09-04 18:56:21 +02:00
Marek Olšák
f0ae99252a r300/compiler: remove a redundant parameter in rc_dataflow_deadcode
&c->Base == c.
2010-09-04 18:56:21 +02:00
Marek Olšák
cc8f2d5599 r300/compiler: use null-terminated array of transformation functions
I need to reduce the number of parameters of each compiler pass function.
This is part of a larger cleanup.
2010-09-04 18:56:21 +02:00
Marek Olšák
56de72c78a r300g: only check for an empty shader if there are no compile errors 2010-09-04 18:56:20 +02:00
Marek Olšák
313e95f0c7 r300/compiler: add new compiler parameter max_alu_insts 2010-09-04 18:56:20 +02:00
Marek Olšák
a0fb406d9f r300/compiler: put emulate_loop_state in radeon_compiler 2010-09-04 18:56:20 +02:00
Kenneth Graunke
79088746a2 ir_reader: Run ir_validate on the generated IR.
It's just too easy to get something wrong in hand-written IR.
2010-09-04 02:19:38 -07:00
Kenneth Graunke
2809d70723 ir_reader: Emit global variables at the top of the instruction list.
Since functions are emitted when scanning for prototypes, functions
always come first, even if the original IR listed the variable
declarations first.

Fixes an ir_validate error (to be turned on in the next commit).
2010-09-04 02:19:38 -07:00
Kenneth Graunke
b758de16e3 ir_reader: Drop support for reading the old assignment format. 2010-09-04 02:19:38 -07:00
Kenneth Graunke
a878107d6c glsl: Regenerate autogenerated file builtin_function.cpp. 2010-09-04 02:19:37 -07:00
Kenneth Graunke
bacbf941d2 glsl/builtins: Convert assignments to new format (with write mask). 2010-09-04 02:19:37 -07:00
Kenneth Graunke
03a6276477 ir_reader: Read the new assignment format (with write mask).
This preserves the ability to read the old format, for momentary
compatibility with all the existing IR implementations of built-ins.
2010-09-04 02:19:37 -07:00
Kenneth Graunke
a71b46a8ad ir_reader: Track the current function and report it in error messages. 2010-09-04 02:19:37 -07:00
Kenneth Graunke
a7dc8081b6 glsl/builtins: Actually print the info log if reading a builtin failed. 2010-09-04 02:19:37 -07:00
Luca Barbieri
7a830ac49f nvfx: consolidate tiny files
We probably want to reorganize the remaining files too, but that's
for later, maybe.
2010-09-04 05:31:52 +02:00
Luca Barbieri
603bef5572 mesa/st: add missing _mesa_set_fetch_functions in st_get_tex_image
Fixes piglit fdo25614-genmipmap.
2010-09-04 05:13:06 +02:00
Luca Barbieri
f1d50606ba nvfx: fix vp DP2 2010-09-04 04:43:02 +02:00
Luca Barbieri
72648ca51f nvfx: implement fp SSG properly 2010-09-04 04:38:43 +02:00
Luca Barbieri
527a4f11a7 nvfx: don't claim we support preds since the driver doesn't 2010-09-04 04:05:37 +02:00
Luca Barbieri
f1507806ca nv40: support all 10 texcoords 2010-09-04 04:05:37 +02:00
Luca Barbieri
c98b29ec92 nvfx: add missing context init 2010-09-04 03:05:28 +02:00
Luca Barbieri
e887a9fcad nvfx: tidy up state_emit 2010-09-04 03:05:22 +02:00
Luca Barbieri
71a8544f89 nvfx: support all coord conventions in hardware 2010-09-04 02:57:14 +02:00
Luca Barbieri
5dd296bcb1 nvfx: add missing pushbuffer space check 2010-09-04 02:37:41 +02:00
Luca Barbieri
351a669465 nvfx: support all possible vs consts
We were incorrectly setting a register that limited the range of
constants accessible via indirect addressing.

Setting it correctly, we can address all the constants the GPU
supports.
2010-09-04 02:27:59 +02:00
Luca Barbieri
fa82ad84fb nvfx: set magic bit to round NPOT mipmap sizes down and not up
Does any API even use rounding-up?
2010-09-04 02:08:02 +02:00
Luca Barbieri
60fe5757ae nvfx: allow nested blitter usage, fixing bug in clear 2010-09-04 02:08:02 +02:00
Brian Paul
3b8182793b galahad: do map/unmap counting for resources 2010-09-03 16:35:07 -06:00
Brian Paul
f1de38b851 libgl-xlib: enable galahad support
If the GALLIUM_GALAHAD env var is 1 we'll wrap the regular driver with
the galahad validation driver.
2010-09-03 16:33:20 -06:00
Brian Paul
14056e052b scons: added galahad to driver list 2010-09-03 16:25:44 -06:00
Brian Paul
2a5491792e mesa: also build galahad driver 2010-09-03 15:57:48 -06:00
Brian Paul
a5fd039672 exec_list: replace class with struct
To match the definition below.
2010-09-03 15:25:55 -06:00
Brian Paul
8680c13240 mesa: fix up a comment 2010-09-03 15:22:26 -06:00
Brian Paul
d500ad4405 st/glx: added some comments 2010-09-03 15:22:26 -06:00
Luca Barbieri
befc66788b nvfx: implement LIT in fp 2010-09-03 22:37:35 +02:00
Ian Romanick
f061524f07 glsl2: Use as_constant some places instead of constant_expression_value
The places where constant_expression_value are still used in loop
analysis are places where a new expression tree is created and
constant folding won't have happened.  This is used, for example, when
we try to determine the maximal loop iteration count.

Based on review comments by Eric.  "...rely on constant folding to
have done its job, instead of going all through the subtree again when
it wasn't a constant."
2010-09-03 11:55:22 -07:00
Ian Romanick
4e5b41c2f6 glsl2: Allow copy / constant propagation into array indices 2010-09-03 11:55:22 -07:00
Ian Romanick
de7c3fe31a glsl2: Add module to perform simple loop unrolling 2010-09-03 11:55:22 -07:00
Ian Romanick
3bcfafcf03 glsl2: Track the number of ir_loop_jump instructions that are in a loop 2010-09-03 11:55:22 -07:00
Ian Romanick
351525d534 ir_expression: Add static operator_string method
I've used this in quite a few debug commits that never reached an
up-stream tree.
2010-09-03 11:55:21 -07:00
Ian Romanick
79082b8aca exec_node: Add insert_before that inserts an entire list 2010-09-03 11:55:21 -07:00
Ian Romanick
7850ce0a99 glsl2: Eliminate zero-iteration loops 2010-09-03 11:55:21 -07:00
Ian Romanick
8df2dbf91d glsl2: Perform initial bits of loop analysis during compilation 2010-09-03 11:55:21 -07:00
Ian Romanick
bfe3fbb38e glsl2: Add module to suss out loop control variables from loop analysis data
This is the next step on the road to loop unrolling
2010-09-03 11:55:21 -07:00
Ian Romanick
9434a0749f glsl2: Add module to analyze variables used in loops
This is the first step eventually leading to loop unrolling.
2010-09-03 11:55:21 -07:00
Ian Romanick
0f4f8c7364 ir_to_mesa: Handle loops with loop controls set
The downside of our talloc usage is that we can't really make static
(i.e., not created with new) instances of our IR types.  This leads to
a lot of unnecessary dynamic allocation in this patch.
2010-09-03 11:55:21 -07:00
Ian Romanick
53acbd87d7 ir_validate: Validate loop control fields in ir_loop 2010-09-03 11:55:21 -07:00
Ian Romanick
3b85f1cc6c glsl2: Add cmp field to ir_loop
This reprents the type of comparison between the loop induction
variable and the loop termination value.
2010-09-03 11:55:21 -07:00
Ian Romanick
c8ee8e07f7 glsl2: Set a flag when visiting the assignee of an assignment 2010-09-03 11:55:21 -07:00
Ian Romanick
29eebe9a9a exec_list: Add pop_head 2010-09-03 11:55:21 -07:00
Ian Romanick
9710d272f7 ir_print_visitor: Print empty else blocks more compactly 2010-09-03 11:55:21 -07:00
Luca Barbieri
67a9a90794 nvfx: fix division by zero in vp-ignore-input 2010-09-03 20:57:44 +02:00
Luca Barbieri
f1980af71d nvfx: report correct max lodbias
Fixes piglit lodbias
2010-09-03 20:54:48 +02:00
Luca Barbieri
657b88fc4c nvfx: remove message 2010-09-03 20:48:14 +02:00
Luca Barbieri
b946984e3b nvfx: support indirect addressing in vps
Negative or huge offsets not yet supported.
2010-09-03 20:48:14 +02:00
Alex Deucher
7e282b8e62 r600c: add proper returns for some evergreen functions
these weren't checked anyway.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=29999
2010-09-03 12:13:47 -04:00
Luca Barbieri
6ddfdaead8 nvfx: fix support for more than 8 texture units (fixes etqw crash) 2010-09-03 16:13:21 +02:00
Dave Airlie
50c1b6f2e8 r600g: fix segfault in state after rework
probably can improve this a bit.
2010-09-03 19:39:14 +10:00
Alex Deucher
b009d50f44 r600c: emit DB_HTILE_DATA_BASE on evergreen
Make the hw happy.
2010-09-03 01:13:41 -04:00
Dave Airlie
191bfc5c3b r600g: refactor sample states into a reusable struct.
I will not cut-n-paste.
I will not cut-n-paste.
I will not cut-n-paste.
2010-09-03 14:12:38 +10:00
Dave Airlie
9ef228ee2d r600g: reduce size of r600 context structure to !insane
Its now about 7.8k, and might actually fit in a cache.
2010-09-03 13:53:39 +10:00
Dave Airlie
b5fcf82749 r600g: add texture border state.
Okay I finally wrapped my head around what r600_context_state is meant to be,
maybe I should just rename all the structs so that have distinct names.

I've no idea however why 16 is a good magic number for R600_MAX_RSTATE.
2010-09-03 13:34:57 +10:00
Dave Airlie
ce7077423f r600g: deref old driver states for set entry points. 2010-09-03 12:01:59 +10:00
Dave Airlie
4ca207b174 r600g: drop r600_bind_state.
This was another ugly function that really wasn't needed.

The 3 calls to it from the gallium api were shorter than it,
and all the calls from the set_ functions were pointless.
2010-09-03 11:56:07 +10:00
Dave Airlie
49b4f5259b r600g: kill r600_context_state function
having some sort of locality of code really matters, just create
and setup state at time. Not sure if this is just further polishing of a bad thing,
but at least it makes it more readable.
2010-09-03 11:35:08 +10:00
Dave Airlie
1bd8493a0b r600g: move lots of state inline helpers to separate header.
this gets them out of sight of the main codeflow.
2010-09-03 10:55:54 +10:00
Vinson Lee
619e899a42 draw: Include missing headers in draw_vs_aos.h.
Include tgsi_exec.h for TGSI_EXEC_NUM_TEMPS.
Include draw_vs.h for draw_vs_varient.
2010-09-02 17:03:47 -07:00
Dave Airlie
883cbbd99c r600g: drop magic numbers in depth state.
this also fixes occulsion queries.
2010-09-03 09:48:40 +10:00
Vinson Lee
23120b8d30 util: Include missing header in u_linear.h.
Include p_compiler.h for size_t and boolean symbols.
2010-09-02 16:30:34 -07:00
Vinson Lee
3888c38fc9 mesa: Fix printf-like warning. 2010-09-02 16:12:58 -07:00
Vinson Lee
c5dde53f4e mesa: Fix printf-like warnings. 2010-09-02 16:03:32 -07:00
Jerome Glisse
f8d11b2e8e r600g: force unbind of previously bind sampler/sampler_view
Previously bind sampler/sampler_view can be converted and endup
overwritting the current state we want to schedule. Example :
bind texA texB to sampler_view[0] & sampler_view[1], render,
bind texB to sampler_view[0] render. Now state associated to
texB are set to configure sampler_view slot 0, but as we don't
unbind sampler_view[1] still point to texB state so we end up
with sampler_view[1] overwritting sampler_view[0], which gives
wrong rendering if next rendering bind texA to sampler_view[0],
it will endup as texB is bound to sampler_view[0]. If you are
not confuse at that point give me a call i will be buying you
beer.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 16:58:47 -04:00
Brian Paul
e746a6bb9a st/mesa: clamp gl_constants::MaxVarying against MAX_VARYING
Don't try to use more generic varying vars than core Mesa supports.
Fixes fd.o bug 29959.
2010-09-02 13:00:10 -06:00
Ian Romanick
6e3cbeb361 glsl2: Update TODO file 2010-09-02 10:11:54 -07:00
Jerome Glisse
e73c5501b2 r600g: fix memory/bo leak
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 11:47:30 -04:00
Brian Paul
c9039fdb16 mesa: fix code generation for ir_unop_sqrt
The CMP instruction needed to be flipped to properly handle
operand==0.

Fixes fd.o bug 29923.
2010-09-02 07:58:33 -06:00
Brian Paul
9eca0e2c3e mesa: fix some printf warnings with casts 2010-09-02 07:57:16 -06:00
Dave Airlie
5d5f693cef r600g: fix thinko in shadow code.
spotted by taiu on irc
2010-09-02 21:26:12 +10:00
Dave Airlie
76d0541e79 r600g: fix logicop, the 3d ROP is the 2D rop shifted twice. 2010-09-02 16:40:41 +10:00
Dave Airlie
e8ff0f63b6 r600g: fix depth texture tests 2010-09-02 15:51:23 +10:00
Kenneth Graunke
f32d3df8ab glsl: Apply implicit conversions to structure constructor parameters.
The code for handling implicit conversions should probably get
refactored, but for now, this is easy.

Fixes piglit test constructor-26.vert.
2010-09-01 20:39:09 -07:00
Kenneth Graunke
43a6200f3c glsl: Convert constant record constructor parameters to ir_constants.
I'm not sure if this is strictly necessary, but it seems wise.
2010-09-01 20:39:09 -07:00
Kenneth Graunke
cfe0dd5622 glsl: Reject structure constructors that have too many arguments.
Fixes piglit test constructor-27.vert.
2010-09-01 20:39:09 -07:00
Ian Romanick
e466b182bb glsl2: Remove unnecessary glsl_symbol_table::get_function parameter return_constructors
Now that constructors are not generated as functions or stored in the
symbol table, there is no need to flag whether or not constructors
should be returned.
2010-09-01 20:39:09 -07:00
Ian Romanick
4d6221f90d glsl2: Remove unused method glsl_type::generate_constructor 2010-09-01 20:39:09 -07:00
Ian Romanick
16d9ebb357 glsl2: Remove unused 'constructor' parameter from glsl_symbol_table::add_type 2010-09-01 20:39:09 -07:00
Ian Romanick
a789ca649c glsl2: Don't generate constructor functions for structures 2010-09-01 20:39:09 -07:00
Ian Romanick
37200d83d3 glsl2: Emit structure constructors inline
Fixes piglit test cases glsl-[fv]s-all-0[12].
2010-09-01 20:39:09 -07:00
Dave Airlie
7299023c2a r600g: add missing vertex fetch formats to the translation table.
fixes at least 2 more piglits.
2010-09-02 13:32:25 +10:00
Jerome Glisse
31b84acbd2 r600g: fix binding of same texture to several target slot
One can bind same texture or sampler to different slot,
each slot needs it own state. The solution implemented
here is not exactly beautifull or optimal need to think
to somethings better.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 21:59:28 -04:00
Kenneth Graunke
3960558795 glsl: Fix write mask in matrix-from-matrix constructors.
If the matrix being constructed was larger than the source matrix, it
would overwrite the lower-right part of the matrix with the wrong
values, rather than leaving it as the identity matrix.

For example, constructing a mat4 from a mat2 should only use a writemask
of "xy" when copying from the source, but was using "xyzw".

Fixes the code generated by piglit test constructor-23.vert.
2010-09-01 18:57:51 -07:00
Kenneth Graunke
54b35e6735 glsl: Add proper handling for constant matrix-from-matrix constructors.
Fixes piglit test case constructor-21.vert and changes
constructor-22.vert to give the correct output.
2010-09-01 18:57:51 -07:00
Kenneth Graunke
1f7c7df40f glsl: Move generate_constructor_(matrix|vector) to ir_constant ctor. 2010-09-01 18:57:50 -07:00
Kenneth Graunke
550237eedd ast_function: Fix check for "too few components".
This was triggering even for matrix-from-matrix constructors.  It is
perfectly legal to construct a mat3 from a mat2 - the rest will be
filled in by the identity matrix.

Changes piglit test constructor-23.vert from FAIL to PASS, but the
generated code is incorrect.
2010-09-01 18:57:50 -07:00
Kenneth Graunke
ee88c46640 ast_function: Remove bogus cases from generate_constructor_matrix.
There are no integer matrix types, so switching on them is silly.
2010-09-01 18:57:50 -07:00
Dave Airlie
36192b772e r600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_view
fixes problems in valgrind with uninitialised values.
2010-09-02 11:17:37 +10:00
Eric Anholt
5ad74779ce ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp.
Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

Regresses glsl-vs-array-04 on 965.  Thanks to a slight change in
register allocation, this test of undefined behavior now wraps around
the register space and unexpectedly reads the constant value it's
trying to compare to.  The test should probably not look at the
resulting color, since behavior is undefined.
2010-09-01 17:08:23 -07:00
Eric Anholt
500e7b7599 ir_to_mesa: Add a little helper for emitting link failure messages. 2010-09-01 17:08:23 -07:00
Eric Anholt
86af037e6a mesa: Fix many printf-like warnings.
Most of these are just typecasting to long to match the arg type.  I
don't really care too much about getting a GLsizei or whatever
appropriate type in.  However, there were a number of real bugs, like
missing arguments or passing floats to integer format specifiers.  My
favorite: printflike("%s, argument") is missing an argument.
2010-09-01 17:08:23 -07:00
Eric Anholt
3cddc15d9d mesa: Add __printf__ attribute to printf-like functions to get warnings. 2010-09-01 17:08:23 -07:00
Dave Airlie
557a71c506 mesa/st: remove check for buffer/elements = 0
shown by the glsl-vs-point-size failing on r600g.

the test passes on softpipe and I get a full piglit test run completing on r600g.
2010-09-02 09:51:25 +10:00
Jerome Glisse
ffcb443cd7 r600g: silence compiler warning
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:09:37 -04:00
Jerome Glisse
67234b4b42 r600g: refix db/cb state
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:05:52 -04:00
Brian Paul
4ff3467daf mesa: fix out of bounds memory read in mipmap gen code
Out of bounds reads could happen for reducing WxH to WxH/2
or WxH to W/2xH.

Fixes fd.o bug 29918.
2010-09-01 13:24:26 -06:00
Brian Paul
fd7f2ae085 mesa: more prog_execute.c debug code 2010-09-01 13:24:26 -06:00
Kenneth Graunke
0181385f36 glsl: Add forgotten implementations of equal/notEqual on bvecs. 2010-09-01 11:50:23 -07:00
Alex Deucher
c70459a1b9 r600g: fix up default state differences between r6xx and r7xx
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-09-01 14:41:03 -04:00
Brian Paul
6ac66192a6 st/glx: re-order destruction of buffers, visuals
Free the buffers before the visuals.  Fixes valgrind warning
reported in fd.o bug 29919.
2010-09-01 12:40:31 -06:00
Eric Anholt
dd5ef33e3c i965: DP2 produces a scalar result like DP3, DP4, etc.
Fixes glsl-fs-dot-vec2-2.
2010-09-01 10:45:05 -07:00
Ian Romanick
a35faa6a41 glsl2: Perform algebraic simplifications on logical binary operators
Reduces glsl-vs-all-01 from 42 Mesa IR instructions (including the
END) to 17.
2010-09-01 10:25:11 -07:00
Ian Romanick
a4262874f8 glsl2: Allow ir_constant::zero to create boolean constants 2010-09-01 10:25:11 -07:00
Jerome Glisse
66e4cb1cd5 r600g: avoid dynamic allocation of states
Make state statically allocated, this kills a bunch of code
and avoid intensive use of malloc/free. There is still a lot
of useless duplicate function wrapping that can be kill. This
doesn't improve yet performance, needs to avoid memcpy states
in radeon_ctx_set_draw and to avoid rebuilding vs_resources,
dsa, scissor, cb_cntl, ... states at each draw command.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 13:16:23 -04:00
Jerome Glisse
15ce70252c Revert "Revert "r600g: precompute some of the hw state""
This reverts commit 1fa7245c34.

Conflicts:

	src/gallium/drivers/r600/r600_state.c
2010-09-01 13:04:42 -04:00
Patrice Mandin
4a955ab6b7 nouveau/nvfx: Remove enforcement of bit depth being same as front buffer
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-09-01 18:13:14 +02:00
Vladimir Vukicevic
0731701236 mesa: initialize dummy framebuffer and renderbuffer mutexes
See fd.o bug 29909.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:54:23 -06:00
Jon TURNEY
c085cd6917 Cygwin: Adjust mklib so -linker and -cplusplus options are processed more like they are for linux
It looks like we were ignoring -linker when -noprefix wasn't present, and
when -noprefix was present, -linker was mandatory and -cplusplus ignored.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:11 -06:00
Jon TURNEY
c55a8a73a4 Cygwin: Teach mklib/minstall to properly install libraries on cygwin
Teach mklib/minstall more about cygwin so libraries are properly installed

Have mklib install the .dll into the lib/ staging directory as well

Have minstall install the .dll into PREFIX/bin at the same time as
installing the .dll.a link library into PREFIX/lib

mklib uses a '-' rather than a '.' as the separator before the version
number in library names on cygwin.  Change the install globs so they match
library names like that.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:06 -06:00
Jon TURNEY
36b195332f Cygwin: Change mklib not to report the full archname on cygwin
Change mklib not to report the full archname when building a library for cygwin
(which is something like 'CYGWIN_NT-5.1' or 'CYGWIN_NT-6.1-WOW64' and kind of
confusing), but just 'CYGWIN'.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:02 -06:00
Jon TURNEY
8fee182e8c Cygwin: Have mklib exit with error code if link fails
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:48:00 -06:00
Ian Romanick
63b80f8cc1 glsl2: Disallow function declarations within function definitions in GLSL 1.20
The GLSL 1.20 spec specifically disallows this, but it was allowed in
GLSL 1.10.

Fixes piglit test cases local-function-0[13].frag and bugzilla #29921.
2010-09-01 07:08:34 -07:00
Andre Maasikas
c3c25a7ab8 r600: cube mipmap levels are aligned to 8 faces only starting from r7xx 2010-09-01 09:19:51 +03:00
Dave Airlie
1d7b4af817 r600g: correct cb/zb offset emits.
This fixes fbo-3d and fbo-cubemap
2010-09-01 14:59:18 +10:00
Dave Airlie
1fa7245c34 Revert "r600g: precompute some of the hw state"
This reverts commit de0b76cab2, its pre-computes the texture state wrong,

you can't just use an array of levels, since you can have FBOs to depth texture slices inside a level as well
it would get really messy quickly. Probably need to split commits like this up into pieces for each piece
of state, so we can revert bits easier in case of regressions.

This also break 5 piglit tests, and valgrind starts to warn about invalid read/writes after this.
2010-09-01 14:56:04 +10:00
Dave Airlie
d7e2509692 r600g: fix typo causing segfault.
fixes warning that
r600_blit.c: In function ‘r600_resource_copy_region’:
r600_blit.c:136: warning: passing argument 1 of ‘util_resource_copy_region’ from incompatible pointer type

and also 7 more piglit tests.
2010-09-01 13:55:56 +10:00
Dave Airlie
bea5f559a6 r600g: fix glean texCube and shadows.
add cube and shadow support to the texture code.
2010-09-01 12:55:21 +10:00
Brian Paul
3fa3c33844 gallivm: fix bug in nested conditionals
This, plus the previous commit fix fd.o bug 29806.
2010-08-31 19:15:07 -06:00
Brian Paul
16c733495d glsl2: fix bug in atan(y, x) function
When x==0, the result was wrong.  Fixes piglit glsl-fs-atan-1.shader_test
2010-08-31 19:15:07 -06:00
Eric Anholt
9b075cb9fa ir_to_mesa: When emitting a pixel kill, flag that we did so.
Both i965 and swrast rely on UsesKill to determine whether to do early
depth writes.  Fixes glsl-fs-discard-02.

Bug #29835.
2010-08-31 15:43:49 -07:00
Keith Whitwell
e38d2f7163 llvmpipe: slightly simplify build_mask 2010-08-31 23:31:45 +01:00
Keith Whitwell
0aa3a09ced llvmpipe: combine linear mask calculation 2010-08-31 23:31:45 +01:00
Keith Whitwell
d8c92a1eea llvmpipe: intrinsics versions of build_mask functions 2010-08-31 23:31:44 +01:00
Ian Romanick
a6c3cd5ca6 glsl2: Write vector constructor constants in a single assignment
Make two passes over the constructor parameters.  Write all of the
constants in a single write, then write the non-constants one at a
time.  This causes the fragment shader

varying float g;
void main()
{
	gl_FragColor = vec4(0.0, g, 0.0, 1.0);
}

to generate

(function main
  (signature void (parameters )
    (
      (declare (temporary ) vec4 vec_ctor@0x8580058)
      (assign (constant bool (1)) (xzw) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058)  (swiz xxxx (var_ref g@0x8580218) ))
      (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0)  (var_ref vec_ctor@0x8580058) )
    ))
)

instead of

(function main
  (signature void (parameters )
    (
      (declare (temporary ) vec4 vec_ctor@0x8580058)
      (assign (constant bool (1)) (x) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058)  (swiz xxxx (var_ref g@0x8580218) ))
      (assign (constant bool (1)) (z) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (w) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0)  (var_ref vec_ctor@0x8580058) )
    ))
)

A similar optimization could be done for matrix constructors, but it
is a little more complicate there.
2010-08-31 14:44:13 -07:00
Eric Anholt
99f3c9caa3 ir_to_mesa: Sort the uniform list we're adding to Parameters[] order.
Fixes glsl-uniform-linking-1 and failure to link a shader in Unigine.
An alternative here would be to just ditch using _mesa_add_parameter
and build the initial params list on our own, but that would require
two walks of the list as well.

Bug #29822
2010-08-31 11:34:29 -07:00
nobled
2a78807db7 ir_to_mesa: Fix struct/class confusion 2010-08-31 11:34:29 -07:00
Eric Anholt
7406898441 ir_to_mesa: Set up our instruction nodes with zeroed data.
cond_update wasn't being set by emit_op3, leading to valgrind
complaints, and failures in several piglit tests when built with
clang.
2010-08-31 11:34:29 -07:00
Kenneth Graunke
1eea96326f ast_to_hir: Add support for bit-wise operators (but not shifts).
Previously, using bit-wise operators in some larger expression would
crash on a NULL pointer dereference.  This code at least doesn't crash.

Fixes piglit test bitwise-01.frag.
2010-08-31 11:00:34 -07:00
Chia-I Wu
3fbbd70e80 st/egl: Enable EGL_MESA_drm_display. 2010-08-31 15:52:33 +08:00
Chia-I Wu
8cdeff8444 egl: Mark EGL_MESA_screen_surface as obsolete.
EGL_MESA_drm_{display,image} can achieve the same functionality.
2010-08-31 15:25:22 +08:00
Dave Airlie
b87b6e5bf7 r600g: fix up depth write swizzles.
For some reason r600c, emits extra instructions in the FP to do the depth write output swizzle,
I'm not sure this is required, so here I'm doing it in the exports.

this fixes the mesa trivial demos tri-depthwrite and tri-depthwrite2, it doesn't fix
the glsl1 gl_FragDepth writing test however.
2010-08-31 16:15:04 +10:00
Dave Airlie
ad202678fc r600g: fix fp-fragment-position test. 2010-08-31 15:13:24 +10:00
Dave Airlie
580781babe r600g: fix typo in last commit 2010-08-31 15:13:21 +10:00
Dave Airlie
5d66a8606d r600g: fix position input to fragment shader.
this fixes a few if the fs shader tests, 10 more piglits
2010-08-31 14:55:32 +10:00
Dave Airlie
4e61f085d0 r600g: remove unneeded function call from scs 2010-08-31 14:55:32 +10:00
Marek Olšák
4f189b3bf5 ir_to_mesa: use RSQ+MUL instead of RSQ+RCP for SQRT
sqrt(x) = 1/rsq(x) = x*rsq(x)

This optimization already was in the old GLSL compiler.

Acked on irc by Eric Anholt.
2010-08-31 06:36:52 +02:00
Kenneth Graunke
2619b1c96f linker: Require an exact matching signature when looking for prototypes.
Fixes piglit test glsl-override-builtin.  The linker incorrectly found
the prototype for the float signature, rather than adding a new
prototype with the int return type.  This caused ir_calls with type int
to have their callees set to the float signature, triggering an assert.
2010-08-30 21:04:13 -07:00
Dave Airlie
d3fa92584b r600g: make LIT work properly
this is a bit of a workaround, something is wrong with the literal emits here
so we just use the trig copy function to copy the immd to a temp at start of op.

fix VP/FP LIT tests
2010-08-31 12:59:10 +10:00
Zhenyu Wang
24ff42e7d5 i965: fix depth test on sandybridge
This includes several corrections for fixing depth test on sandybridge.
Fix wrong bits definition in depth stencil state. Fix wrong order of
state buffer offset in 3DSTATE_CC_STATE_POINTERS command. Correctly use
buffer width parameter in depth buffer setting.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-08-31 09:58:18 +08:00
Dave Airlie
be7816f2b7 r600g: fixup trig functions when input is a literal
So as the trig functions used up the literal spots for the PI work, if the arg0 was an immediate
we'd hit failure, so copy the literal before starting.

add some tracking of max temp used to avoid trashing temp regs.

5 more piglits, fp1 COS,SCS,SIN tests
2010-08-31 11:44:34 +10:00
Dave Airlie
ee0153f891 r600g: make sure LIT splits constants 2010-08-31 10:47:08 +10:00
Dave Airlie
9bbc54a10d r600g: fix constant splitting
constant splitting was broken for multi-constant cases, fixes fp1 CMP+MAD, vp1 CMP.
2010-08-31 10:47:03 +10:00
Dave Airlie
85e401d8bf r600g: fix LIT tests 2010-08-31 10:46:58 +10:00
Dave Airlie
5ea238b799 r600g: add missing literals
Also add an error if we hit this problem again, we need to do this better
possibly tying the literal addition to the last flag.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-31 09:43:48 +10:00
Ian Romanick
df869d9163 linker: Handle varying arrays, matrices, and arrays of matrices
Fixes piglit test case glsl-array-varying-01.
2010-08-30 16:02:51 -07:00
Eric Anholt
a3c2bd416a Don't pass -ffast-math to clang, since it ignores it and complains. 2010-08-30 14:20:05 -07:00
nobled
2a50187a92 Make configure work with clang
It was mistaking clang for gcc and deciding its version
was too low.
2010-08-30 13:59:18 -07:00
Jon TURNEY
e637f8b40c Add talloc to osmesa library dependencies
also link osmesa with C++ standard libraries, as it now contains C++ code

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-08-30 13:41:39 -07:00
Jon TURNEY
6356303de6 Add talloc to dependencies for libGL built with xlib driver
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-08-30 13:41:36 -07:00
Eric Anholt
8b3d36d563 glsl: Clear the static values of builtin function profiles at release.
When releasing the builtin functions, we were just freeing the memory,
not telling the builtin function loader that we had freed its memory.
I wish I had done ARB_ES2_compatibility so we had regression testing
of this path.  Fixes segfault on changing video options in nexuiz.
2010-08-30 13:12:24 -07:00
Ian Romanick
33fe364e5a glsl2: Commit generated files changed by previous commit 2010-08-30 12:52:42 -07:00
Ian Romanick
bea3963f59 glsl2: Parse #pragma lines
All pragmas are currently ignored.  Also, the error messages when a
pragma is used incorrectly (i.e., '#pragma debug(on)' inside a
function) are crap, but I think this is sufficient for now.

Fixes piglit test cases pragma-0[1-8].(vert|frag).
2010-08-30 12:52:42 -07:00
Kenneth Graunke
9b0ba68b44 Fix inverted version checks in check_extra.
Previously, if an attribute was enabled by either a specific GL version
or an extension, the check would require -both- to be enabled.  This bug
was not discovered earlier because version checks are currently only ever
used on their own.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-08-30 12:29:22 -07:00
Jerome Glisse
de0b76cab2 r600g: precompute some of the hw state
Idea is to build hw state at pipe state creation and
reuse them while keeping a non PM4 packet interface
btw winsys & pipe driver. This commit also force rebuild
of pm4 packet on each call to radeon_state_pm4 which
in turn slow down everythings, this will be addressed.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-30 15:00:55 -04:00
Jerome Glisse
0bba7796a3 r600g: fix depth buffer decompression after states rework
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-30 15:00:55 -04:00
Dave Airlie
69c30f5d6d r600g: fixup states generation in winsys.
The current states code had an unhealthy relationship between
that had to somehow magically align themselves, editing either
place meant renumbering all states after the one you were on,
and it was pretty unapproachable code.

This replaces the huge types structures with a simple type + sub
type struct, which is keyed on an stype enum in radeon.h. Each
stype can have a per-shader type subclassing (4 types supported,
PS/VS/GS/FS), and also has a number of states per-subtype. So you
have 256 constants per 4 shaders per one CONSTANT stype.

The interface from the driver is changed to pass in the tuple,
(stype, id, shader_type), and we look for this. If
radeon_state_shader ever shows up on profile, it could use a
hashtable based on stype/shader_type to speed things up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 15:00:55 -04:00
Luca Barbieri
699c82e30c glapi: fix generator which got out of sync with the codebase
The __GLapi typedef was removed in c356f5867f,
but the code generator hasn't been updated.
2010-08-30 20:51:49 +02:00
Eric Anholt
5360c48317 i965: Clear the cached constant buffer entry in the VS at control flow.
Fixes the 7 regressions with constant buffers forced on with piglit -t
glsl (glsl-vs-if-*).
2010-08-30 11:19:30 -07:00
Eric Anholt
3bae20bbc9 i965: Align the number of payload regs to 2 again in 16-wide mode.
Fixes a regression in point-line-no-cull and glean/paths tests since
501c9dc627.
2010-08-30 10:47:05 -07:00
Cedric Vivier
e1aa3c234f i965: Apply the rest of the old-libdrm guard patch.
Bug #29855
2010-08-30 10:42:20 -07:00
Eric Anholt
1fcb5a9858 i965: Add support for loops to the new FS backend.
This includes a handy little safety check to prevent the loop from
going "too long", as permitted by the spec.  I haven't gone out of my
way to test it, though…

Fixes 20 more piglit tests.
2010-08-30 10:26:05 -07:00
Eric Anholt
352dff62f8 i965: Make brw_CONT and brw_BREAK take the pop count.
We always need to set it, so pass it in.
2010-08-30 10:26:05 -07:00
Eric Anholt
b0a933a4d9 i965: Add "discard" support to the new FS backend.
Fixes 3 testcases related to discard.
2010-08-30 10:26:05 -07:00
Eric Anholt
4ff25c2106 i965: Fix the new implementation of ir_unop_sign to match brw_wm_emit.c
Like the comparison operations, this suffered from CMP only setting
the low bit.  Doing the AND instructions would be the same instruction
count as the more obvious conditional moves, so do cond moves.

Fixes glsl-fs-sign and 6 other cases, like trig functions that use
sign() internally.
2010-08-30 10:26:05 -07:00
Eric Anholt
40aadafa91 i965: Add support for texturing with bias to i965 FS backend.
Fixes 5 piglit tests for bias.  Note that LOD is a 1.30 feature and
not yet supported.
2010-08-30 10:26:05 -07:00
José Fonseca
f3eebb8465 glut: Silence missing initializer warning. 2010-08-30 14:12:01 +01:00
José Fonseca
4841c0a15a mesa: Return after assertion failure.
Addresses the warnings:
warning: ‘target’ may be used uninitialized in this function
warning: ‘target_string’ may be used uninitialized in this function
2010-08-30 13:59:24 +01:00
José Fonseca
0a6c908e0d gallivm: Compute the 4 texel offsets for linear filtering en ensemble. 2010-08-30 13:58:09 +01:00
José Fonseca
ccd8b935e4 glsl: Silence unused variable warning. 2010-08-30 13:53:15 +01:00
José Fonseca
128237927d mesa: Fix _mesa_lookup_parameter_constant's return value.
Fixes gcc warning

  In function ‘_mesa_add_unnamed_constant’:
  warning: ‘pos’ may be used uninitialized in this function

but also what appears to be a bug.
2010-08-30 13:48:21 +01:00
José Fonseca
e4c3e7f9d8 gallivm: Disable LLVM's pretty stack trace dumper.
By default LLVM adds a signal handler to output a pretty stack trace.
This signal handler is never removed, causing problems when unloading
the shared object where the gallium driver resides.

Thanks to Chris Li for finding this.
2010-08-30 13:27:28 +01:00
José Fonseca
7a08dbcf55 gallivm: Correct copy'n'pasted comments. 2010-08-30 13:27:03 +01:00
José Fonseca
e18c7f68b4 gallivm: Fix lp_build_sum_vector.
The result is scalar, so when argument is zero/undef we can pass vector
zero/undef.

Also, support the scalar case.
2010-08-30 13:26:29 +01:00
Michal Krol
1bb97610e9 svga: Fix CMP translation for vertex shader targets.
SVGA3DOP_CMP is not supported for vertex shaders;
use SLT + LRP instead.
2010-08-30 13:01:58 +01:00
José Fonseca
5a70db6432 svga: Re-emit bound rendertargets and texture samplers at the beginning of every command buffer.
Only non null resources.

To ensure that relocations are emitted for every resource currently
referred.
2010-08-30 13:01:57 +01:00
Marek Olšák
007bac8331 st/mesa: set the MaxVarying GLSL constant 2010-08-30 13:27:36 +02:00
Marek Olšák
77dac1945f r300g: fix warning in winsys 2010-08-30 13:25:07 +02:00
Dave Airlie
57eecbbf6c r600g: add DST opcode support. 2010-08-30 16:22:54 +10:00
Dave Airlie
92f5c7a597 r600g: add SCS support. 2010-08-30 16:09:39 +10:00
Dave Airlie
db92a03aac r600g: fix warning introduced by last commit. 2010-08-30 15:50:52 +10:00
Dave Airlie
47d5a19df1 r600g: add initial relative support to assembler
passes another ~20 piglits.

/me starts to run out low hanging fruit around now.
2010-08-30 15:47:49 +10:00
Ian Romanick
a2711d6968 linker: Treat sized and unsized array types as the same
If two shaders contain variables declared with array types that have
the same base type but one is sized and the other is not, linking
should succeed.  I'm not super pleased with the way this is
implemented, and I am more convinced than ever that we need more
linker tests.  We especially need "negative" tests.

Fixes bugzilla #29697 and piglit test glsl-link-array-01.
2010-08-29 22:11:35 -07:00
Dave Airlie
4502b17901 r600g: add KILP support
passes glsl1-discard tests
2010-08-30 15:04:40 +10:00
Dave Airlie
cb08b9fa84 r600g: fix SSG and op3 neg writing
8 more piglits, mainly the two SSG tests.
2010-08-30 14:22:12 +10:00
Dave Airlie
09547e1bce r600g : add basic loop support.
Adds BGNLOOP, BRK, CONT, ENDLOOP support, ported from r600c.

17 piglits more on r300g.tests.
2010-08-30 13:38:33 +10:00
Bas Nieuwenhuizen
cd4bd4fb53 r600g: use the values from the correct literals
Created an array for literals as we should not always use the last declared literal.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 09:41:02 +10:00
Bas Nieuwenhuizen
e77b1e777d r600g: added literals where needed for POW instruction
Fixes size calculation for the bytecode buffer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 09:41:02 +10:00
Richard Li
b3d41844c7 evergreen : fix shader const allocation and instruction bugs. 2010-08-29 19:27:46 -04:00
Vinson Lee
0c93e69b25 glsl: Initialize data in ast_function_expression::hir.
Completely initialize data that is passed to ir_constant constructor.

Fixes piglit glsl-orangebook-ch06-bump valgrind uninitialized variable
error on softpipe and llvmpipe.
2010-08-29 14:05:07 -07:00
Vinson Lee
30a0865528 glsl: Completely initialize value member in ir_constant constructor.
The
ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
did not completely initialize the entire value member.

Fixes piglit glsl-fs-sampler-numbering-2 valgrind uninitialized value
error in softpipe and llvmpipe.
2010-08-29 13:15:56 -07:00
Vinson Lee
2d0ef6bfee glsl: Initialize variable in ir_swizzle::constant_expression_value.
Complete initialize data passed to ir_constant constructor.

Fixes piglit glsl-mat-from-int-ctor-02 valgrind unintialized variable
error with softpipe and llvmpipe.
2010-08-29 12:19:57 -07:00
Vinson Lee
b43611b79c glsl: Initialize data in read_constant.
Completely initialize data that is passed into a ir_constant constructor.

Fixes piglit glsl-fs-mix valgrind uninitialized variable error on
softpipe and llvmpipe.
2010-08-29 11:48:02 -07:00
Vinson Lee
0a46497a4e ir_to_mesa: Initialize variable in ir_to_mesa_visitor::visit.
Fixes piglit glsl-fs-loop valgrind uninitialized value error on softpipe
and llvmpipe.
2010-08-29 11:31:33 -07:00
Dave Airlie
c48ae0b6ed r600g: drop file I added by mistake in a previous commit 2010-08-29 18:45:26 +10:00
Vinson Lee
f67400d467 glsl: Initialize the rest of values of ir_constant::value.
Fixes valgrind uninitialized value errors in the piglit shader tests for
softpipe and llvmpipe.
2010-08-28 23:55:51 -07:00
Vinson Lee
182d635060 gallium: Remove unnecessary header from p_state.h.
Remove p_screen.h.
2010-08-28 22:15:37 -07:00
Vinson Lee
1fc396204b nvfx: Remove util_is_pot in favor of util_is_power_of_two.
This is a follow up to commit 89b2897220.
2010-08-28 22:12:55 -07:00
Vinson Lee
b812ff8f9e util: Include missing header in u_draw.h.
Include p_state.h for complete type to pipe_draw_info.
2010-08-28 21:46:41 -07:00
Vinson Lee
1f3e6e9726 util: Add forward declaration in u_transfer.h. 2010-08-28 21:42:28 -07:00
Marek Olšák
a922725118 r300g,u_blitter: use u_framebuffer
Removing another function duplication in u_blitter.
2010-08-29 06:16:53 +02:00
Marek Olšák
89b2897220 util: remove util_is_pot in favor of util_is_power_of_two
The function was duplicated.
2010-08-29 06:16:25 +02:00
Eric Anholt
735af3959f i965: Add initial support for texturing to the new FS backend.
Fixes 11 piglit tests.
2010-08-28 20:04:03 -07:00
Eric Anholt
af62060ef2 i965: Add disasm for gen5 sampler messages. 2010-08-28 20:02:54 -07:00
Cedric Vivier
3d4597f9d4 i965: Move libdrm/C++ hack introduced in fa2deb3d to intel_context.h
Fixes build on Linux/GCC 4.4 as libdrm includes are also used by other
brw_fs_*.cpp files.

Bug #29855
2010-08-28 20:02:54 -07:00
Vinson Lee
2dfd348e33 st/mesa: Include missing header in st_mesa_to_tgsi.c.
Include p_screen.h for complete type to pipe_screen.
2010-08-28 14:24:42 -07:00
Vinson Lee
d42b7d5f8d softpipe: Include missing header in sp_flush.c.
Include p_screen.h for complete type to pipe_screen.
2010-08-28 14:21:28 -07:00
Vinson Lee
9112e531d4 draw: Include missing header in draw_vs_llvm.c.
Include p_screen.h for completely type to pipe_screen.
2010-08-28 14:18:57 -07:00
Vinson Lee
cf1e4b15a4 llvmpipe: Include missing header in lp_flush.c.
Include p_screen.h for complete type to pipe_screen.
2010-08-28 14:14:33 -07:00
Marek Olšák
c5b8ba9368 r300g: fix blitting between 2D NPOT mipmaps
Even though MIP filtering is not supported, we can bind an arbitrary mipmap
as the zero mipmap level.

NPOT textures now follow GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MIN_LOD.

This fixes piglit/fbo-copyteximage.
2010-08-28 22:37:53 +02:00
Mathias Fröhlich
c0f0eb8668 r300g: fix min/max lod computation 2010-08-28 18:17:30 +02:00
Marek Olšák
97cbb563f8 r300g: set the correct value in PVS_NUM_CNTLRS
As per docs.
2010-08-28 18:17:30 +02:00
Vinson Lee
f7579f2f28 llvmpipe: Remove unnecessary header. 2010-08-28 00:29:02 -07:00
Ian Romanick
120d5a95cb glsl2: Decompose matrix comparison into vector operations 2010-08-27 17:41:16 -07:00
Jakob Bornecrantz
977f7d48ee trace: Don't try to dump the rgba array if null 2010-08-28 00:56:51 +01:00
Eric Anholt
c7adb4ff1e glsl: Rename a couple of common variable names in mat_op_to_vec.
It was easy while typing implementations to accidentally overwrite the
original expression or assignment variables.
2010-08-27 16:11:00 -07:00
Eric Anholt
3c96ef1f07 glsl: Make mat_op_to_vec allocate out of the IR's parent.
This will reduce memory consumption of compiled shaders by not
dragging optimized-out children around.
2010-08-27 16:11:00 -07:00
Eric Anholt
d17faf726e i965: Set the pop count on BRK/CONT inside of an if statement in the FS.
This is the same as 8de8c97275 for the
VS, and fixes glsl-fs-if-nested-loop and the mandelbrot demo.

Bug #29498
2010-08-27 16:10:53 -07:00
Eric Anholt
681492cbe2 glsl: Regenerate for double destroy fix. 2010-08-27 15:25:06 -07:00
Eric Anholt
d539c69044 glsl: Protect against double compiler-destroy.
DRI was doing teardown when we close the last screen, then an atexit()
was added to call it as well.
2010-08-27 15:25:06 -07:00
Eric Anholt
ae6e112c69 dri: Get prototype for _mesa_destroy_compiler().
Bug #29665.
2010-08-27 14:43:39 -07:00
Eric Anholt
d20c276618 i965: Don't strip negate/abs flags when assigning uniform locations.
Fixes glsl-algebraic-sub-zero-4.
2010-08-27 14:42:35 -07:00
Eric Anholt
f0aa2d6118 i965: Add missing handling for BRW_OPCODE_SEL.
Fixes 4 piglit tests about min, max, and clamp.
2010-08-27 14:11:25 -07:00
Eric Anholt
38d01c5b27 i965: Mask out higher bits of the result of BRW_CMP producing a boolean.
When it says it sets the LSB, that's not just a hint as to where the
result goes.  Only the LSB is modified.  Fixes 20 piglit cases.
2010-08-27 13:59:36 -07:00
Eric Anholt
4229a93cc7 i965: Fix the types of immediate integer values.
When we're trying to do integer ops, handing a float in doesn't help.
2010-08-27 13:59:36 -07:00
Eric Anholt
41e75cde26 i965: Add translation for RNDD and RNDZ.
Fixes:
glsl-fs-any.
glsl1-integer division with uniform var
2010-08-27 13:59:36 -07:00
Eric Anholt
31c9f468f3 i965: Add support for ir_binop_mod using do_mod_to_fract.
Fixes glsl-fs-mod.
2010-08-27 13:59:36 -07:00
Jerome Glisse
48d8814c03 r600g: fix vbo size
Silence the kernel, vbo size is size - 1.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-27 16:54:00 -04:00
Brian Paul
9ce0d92ae7 mesa: move null ptr check (fdo bug 29843) 2010-08-27 14:35:52 -06:00
Nick Bowler
f57df7f213 mesa: Use the format info to identify packed depth/stencil formats.
Due to a misunderstanding of the Z24_X8 and X8_Z24 formats, the earlier
patch created depth/stencil wrappers for them.  This broke swrast.

Use the format info instead, which only identifies Z24_S8 and S8_Z24 as
packed depth/stencil.  It also has the advantage of being nicer code.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-27 14:31:00 -06:00
Brian Paul
579fce2524 mesa: use atexit() handler to release GLSL compiler memory
This releases a bunch of memory that was showing up as leaks with
valgrind.

If atexit() isn't widely supported we may need to add some #ifdef
tests around the call.
2010-08-27 14:30:59 -06:00
Brian Paul
b820bf979a glsl2: restructure header file for C++ and C inclusion
As it was, the header could not be cleanly #included by a C source.
2010-08-27 14:30:59 -06:00
Brian Paul
1be5d1c887 glsl2: remove 'extern' keyword in .c file 2010-08-27 14:30:59 -06:00
Eric Anholt
53290900db i965: Fix swapped instructions in ir_unop_abs and ir_unop_neg.
Fixes glsl-fs-neg and 5 other tests.
2010-08-27 13:19:28 -07:00
Eric Anholt
2776ad2641 i965: Add generate() handling for AND, OR, XOR.
10 more piglit tests pass.
2010-08-27 13:16:22 -07:00
Eric Anholt
130368f910 i965: Add support for if instructions in the new FS backend.
20 more piglit tests pass.
2010-08-27 13:15:05 -07:00
Eric Anholt
a0ffee2cd7 i965: When encountering an unknown opcode in new FS backend, print its name. 2010-08-27 13:14:52 -07:00
Eric Anholt
40932c1752 i965: Fix the maximum grf counting in the new FS backend.
glsl-algebraic-rcp-rsq managed to use 33 registers, and we claimed to
only use 32, so the write to g32 would go stomping over the precious
g0 of some other thread.
2010-08-27 12:21:40 -07:00
Eric Anholt
166b3fa29d i965: Validate the IR tree after doing our custom optimization passes.
This wouldn't catch the last failure fixed in them, because we don't
validate assignments well (due to the fact that we've got a pretty
glaring inconsistency in how we handle assignment writemasking), but
it could catch other failure we may produce.
2010-08-27 12:19:17 -07:00
Eric Anholt
55ced33675 i965: Add a bit of support for matrices to the new FS. 2010-08-27 12:02:15 -07:00
Eric Anholt
91a037b5e1 i965: Fix destination writemasking in the new FS. 2010-08-27 12:02:15 -07:00
Eric Anholt
0435cb348a i965: Fix swizzling in vector splitting for the new FS backend.
We weren't smearing a component of a split RHS out to reach an unsplit
LHS's writemask, so gl_FragColor (always unsplit) would often get
uninitialized values.

Fixes: glsl-algebraic-add-add-1 (and probably many others).
2010-08-27 12:02:15 -07:00
Zack Rusin
83e3a2d970 graw: fix the build (missing header) 2010-08-27 13:09:38 -04:00
Brian Paul
c8e0970667 mesa: free the fallback texture object in free_shared_state() 2010-08-27 10:51:47 -06:00
Brian Paul
476adf796b mesa: fix double-underscore naming 2010-08-27 10:21:59 -06:00
Keith Whitwell
55f4eab93c llvmpipe: use util_iround in place of round
Fix mingw build.
2010-08-27 13:43:06 +01:00
Keith Whitwell
04f8560dd8 util: fix typo in MAX4
Thanks to Michal for spotting it.
2010-08-27 13:34:12 +01:00
Keith Whitwell
aea6b415de llvmpipe: eliminate tri->dx, tri->dy values
Use an internal struct for line setup information.
2010-08-27 13:08:55 +01:00
Hui Qi Tay
29ec116e8f llvmpipe: point sprites rasterization
Point sprites now done in the rasterizer setup code instead of
going through the draw module.
2010-08-27 13:08:54 +01:00
Hui Qi Tay
2cd72dd459 llvmpipe: native point rasterization with better pixel rasterization
A few subpixel_snap and fixed width changes.

Conflicts:

	src/gallium/drivers/llvmpipe/lp_setup_point.c
2010-08-27 13:08:54 +01:00
Hui Qi Tay
57d84d9ca4 llvmpipe: native point rasterization
Conflicts:

	src/gallium/drivers/llvmpipe/lp_setup_context.h
	src/gallium/drivers/llvmpipe/lp_setup_line.c
	src/gallium/drivers/llvmpipe/lp_setup_tri.c
2010-08-27 13:08:54 +01:00
Keith Whitwell
3783053fa5 llvmpipe: update line rasterization code to current master 2010-08-27 13:08:54 +01:00
Keith Whitwell
e826d0e817 util: add MIN4, MAX4 2010-08-27 13:08:54 +01:00
Hui Qi Tay
b91553355f llvmpipe: native line rasterization with correct pixel rasterization
Line rasterization that follows diamond exit rule.
Can still optimize logic for start/endpoints.
2010-08-27 13:08:54 +01:00
Hui Qi Tay
5286dd7016 llvmpipe: native rasterization for lines
Rasterize lines directly by treating them as 4-sided polygons.
Still need to check the exact pixel rasteration.
2010-08-27 13:08:54 +01:00
Keith Whitwell
c95ca04b63 llvmpipe: add lp_setup_coef to makefile 2010-08-27 11:18:11 +01:00
Keith Whitwell
0be0ad5d58 llvmpipe: intrinsics version of triangle coeficient calculation
Looks nice, but makes almost no impact on performance - maybe
a percent or so in isosurf, nothing elsewhere.  May be of use
later on.
2010-08-27 09:47:22 +01:00
Vinson Lee
af8f037db2 gallium: Remove unnecessary header from p_shader_tokens.h.
Remove p_compiler.h.
2010-08-27 00:40:42 -07:00
Vinson Lee
ec21ed1ce7 tgsi: Include missing header in tgsi_parse.h.
Include p_compiler.h for boolean and INLINE symbols.
2010-08-27 00:34:32 -07:00
Vinson Lee
57421cb464 tgsi: Include missing header in tgsi_info.h.
Include p_compiler.h for uint symbol.
2010-08-27 00:31:27 -07:00
Vinson Lee
0b9b8694d9 tgsi: Include missing header in tgsi_dump.h.
Include p_compiler.h for uint symbol.
2010-08-27 00:26:59 -07:00
Vinson Lee
43ed82bdb2 gallium: Remove unnecessary header from p_format.h.
Remove p_compiler.h.
2010-08-27 00:15:04 -07:00
Vinson Lee
1b83ede8cc graw: Include missing header in graw.h.
Include p_compiler.h for PUBLIC symbol.
2010-08-27 00:07:38 -07:00
Vinson Lee
677623a6c8 r300g: Include missing header in r300_texture.h.
Include p_compiler.h for uint32_t and boolean symbols.
2010-08-27 00:04:50 -07:00
Kenneth Graunke
67ffbbbb5d Fix typo in function name "shading_laguage_version". 2010-08-26 23:07:45 -07:00
Dave Airlie
2184f3ec30 Revert "r600g: simplify states"
This reverts commit bd25e23bf3.

Apart from introducing a lot of hex magic numbers and being highly impenetable code,
it causes lots of lockups on an average piglit run that always runs without lockups.

Always run piglit before/after doing big things like this.
2010-08-27 15:45:58 +10:00
Dave Airlie
a03d456f5a r600g: add initial if/else/endif support
this adds handling for some more CF instructions and conditions
also adds parameter for stack size emission

These seem to pass on VS with the stack size hack but not on FS,

TODO: fix FS + stack size calcs
2010-08-27 15:30:07 +10:00
Dave Airlie
d8fb13bae3 r600g: optimise op2 and swapped op2 emission.
this makes op2 emission smaller, since it skips instructions
that don't write to the dst. not sure if this could have unwanted
side effects but try it and see.
2010-08-27 15:29:04 +10:00
Dave Airlie
36d91be75e r600g: add exp support in theory.
though it isn't passing the test, and this instruction is pure bonghits.
2010-08-27 15:29:04 +10:00
Dave Airlie
e57437ccd6 r600g: add DPH support. 2010-08-27 15:29:03 +10:00
Eric Anholt
a4d97d3726 i965: Add preliminary support for uniforms to the new FS backend.
+269 piglits
2010-08-26 17:11:18 -07:00
Eric Anholt
3dff682b65 i965: Abort on gl_FragDepth in the new FS backend for now.
It hangs the GPU due to FB_WRITE handling being incomplete.  There are
bigger issues to handle first.
2010-08-26 17:06:25 -07:00
Eric Anholt
1a3de23509 i965: Fix up and actually enable the NewShader and NewShaderProgram hooks. 2010-08-26 17:00:30 -07:00
Eric Anholt
fa2deb3ddc i965: Hack in avoidance of c++ reserved keyword in libdrm.
I'm also fixing this upstream in libdrm, but this avoids new libdrm
dependency for the moment.
2010-08-26 15:43:36 -07:00
Eric Anholt
363d0f6774 i965: Add GLSL IR-level source annotation and comments to new FS debug.
This should make debugging way easier, as now we have context for
reading large programs.
2010-08-26 14:55:44 -07:00
Eric Anholt
7268bd82f6 i965: Use the implied move in brw_math() in the new FS. 2010-08-26 14:55:44 -07:00
Eric Anholt
e85f8272d0 i965: Add support for in varyings to the new FS codegen.
At least some tests, like glsl-vs-sign, now work.
2010-08-26 14:55:44 -07:00
Eric Anholt
dcb7c0009b i965: Start building the codegen visitor.
This can successfully emit a real program that generates magenta now.
2010-08-26 14:55:44 -07:00
Eric Anholt
9763d0a82a i965: Start building direct GLSL2 IR to 965 assembly codegen.
Our channel-expressions and vector-splitting changes now happen into a
private copy of the IR that we maintain for ourselves.  Uniform
assignment still happens by the core, so we continue using Mesa IR
generation not just for swrast fallbacks but also for uniform values
(since there's no storage for their contents other than
shader_program->FragmentProgram->Parameters->ParameterValues).  And
most importantly, at the moment no actual codegen is hooked up other
than emitting our favorite color to the framebuffer.
2010-08-26 14:55:44 -07:00
Eric Anholt
c1dfdcb93a i965: Add new pass to split vectors into scalar variables
Combined with the previous pass, this lets other optimization passes
do their work thanks to ir_tree_grafting.  Still have regression in
instruction count with INTEL_NEW_FS, but register count is even
better.
2010-08-26 14:55:44 -07:00
Eric Anholt
3a8ad33dde i965: Add a pass for the FS to reduce vector expressions down to scalar.
This is a step towards implementing a GLSL IR backend for the 965
fragment shader.  Because it has downsides with the current codegen,
it is hidden under the environment variable INTEL_NEW_FS.

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

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

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

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

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

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

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

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

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

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

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

Fixes fdo bug 27590.

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

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

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

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

Bug #27403.
2010-08-25 23:43:21 -07:00
Eric Anholt
aa2f55883b mesa: Disable the debug spam for x86 CPU detection with a compile-time flag.
I don't know of any problems with CPU detection in years.  Don't spam
the user that was just looking to enable assertions with this stuff.
2010-08-25 23:43:21 -07:00
Eric Anholt
7af8f7f164 mesa: Move the x86 detection debug messages next to the detection. 2010-08-25 23:43:21 -07:00
Eric Anholt
0673b46933 mesa: Don't warn when the desired result of s3tc lib available occurs. 2010-08-25 23:43:21 -07:00
Vinson Lee
d8ad10dc45 util: Include missing header in u_blit.h.
Include p_compiler.h for uint symbol.
Clean up forward declarations.
2010-08-25 23:37:27 -07:00
Vinson Lee
3e41029d6e util: Include missing header in u_bitmask.h.
Include p_compiler.h for boolean symbol.
2010-08-25 23:31:04 -07:00
Vinson Lee
d2dd23e858 util: Include missing header in u_dirty_surfaces.h.
Include p_state.h for pipe_surface symbol.
2010-08-25 23:04:39 -07:00
Vinson Lee
c7111f321c util: Add include guard in u_split_prim.h. 2010-08-25 22:55:15 -07:00
Vinson Lee
cc3e322d96 util: Include missing headers in u_split_prim.h.
Include p_compiler.h for boolean symbol.
Include u_debug.h for assert symbol.
2010-08-25 22:51:15 -07:00
José Fonseca
43d94dba5f graw: Remove graw-null.
Pointless now that the graw tests can be built independently of any graw
implementation.
2010-08-26 06:47:24 +01:00
José Fonseca
f0eb02af80 graw: Dynamically load graw libraries.
This allows to build multiple graws libs simultaneously and avoid
unnecessary rebuilds of the tests.

Also remove graw_util.c from inside the graw implementation -- it was
only being provided by one implementation, and graw tests were linking
against gallium anyway.
2010-08-26 06:44:34 +01:00
José Fonseca
c32f87c39c scons: Fix old script compatability logic.
Sconscript could be invoked twice if specified in the command line.
2010-08-26 06:44:34 +01:00
Vinson Lee
58cfbd697d util: Include missing headers in u_tile.h.
Include p_format.h for enum pipe_format symbol.
Include p_state.h for pipe_box symbol.
2010-08-25 22:41:20 -07:00
Vinson Lee
c65c86cfe7 util: Clean up header file inclusion in u_upload_mgr.h.
Remove p_defines.h.
Remove unnecessary forward declarations.
Add forward declaration for pipe_context.
2010-08-25 22:34:31 -07:00
Marek Olšák
c1ab2c327e r300g: fix constant buffer upload once again for r3xx->r4xx 2010-08-26 07:19:10 +02:00
Vinson Lee
fdf054a585 r600: Remove unnecessary headers. 2010-08-25 18:06:01 -07:00
Vinson Lee
d430aea8bc r300: Remove unnecessary header. 2010-08-25 18:00:23 -07:00
Eric Anholt
b2872ea353 Revert "mesa: Don't add 1 to GL_ACTIVE_UNIFORM_MAX_LENGTH."
This reverts commit 001a7bfdfc.  I
hadn't found the section of the spec clarifying that the old behavior
was right.  Reverting fixes the new version of the testcase, and the
Humus demos that could no longer find their uniforms.

Bug #29782
Bug #29783
2010-08-25 16:45:31 -07:00
Aras Pranckevicius
5226f8c7b0 glsl: fix crash with variable indexing into array in a struct
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-25 16:22:44 -07:00
Eric Anholt
a1f2ac2b37 i965: Fix detection of implicit MOVs to message regs in brw_optimize.c.
Texcoords in AmbientApertureLighting were getting trashed since the
move of math arguments to implied moves, due to the logic for
detecting ALU message reg writes overriding the logic for SEND
implicit message reg writes.
2010-08-25 16:03:56 -07:00
Marcin Slusarz
a49167c1c0 nouveau: handle early initialization errors
handle very early errors in pipe_screen creation (failure of
nouveau_screen_init in nv50_screen_create)

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-08-26 00:28:01 +02:00
Jerome Glisse
bd25e23bf3 r600g: simplify states
Directly build PM4 packet, avoid using malloc (no states are
bigger than 128 dwords), remove unecessary informations,
remove pm4 building in favor of prebuild pm4 packet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-25 17:41:50 -04:00
Eric Anholt
b5c07b9226 mesa: Remove now-unused _mesa_add_sampler().
We do the generation of "what sampler number within Parameters are we"
right in ir_to_mesa.cpp, instead of repeatedly walking the existing
list to find out.
2010-08-25 12:38:32 -07:00
Eric Anholt
aa452e20bf ir_to_mesa: Add support for samplers in structures.
Fixes:
glsl-fs-uniform-sampler-struct
glsl-fs-sampler-numbering-3
Bug #29690
2010-08-25 12:38:27 -07:00
Eric Anholt
9ab1332d74 mesa: Remove now-unused _mesa_add_uniform.
We had to inline it to avoid doing a double-lookup in the process of
adding assertion checks.
2010-08-25 12:38:27 -07:00
Eric Anholt
0924ba0c34 ir_to_mesa: Convert this code to using linker.cpp's uniform locations.
Fixes: glsl-fs-uniform-array-4.
2010-08-25 12:38:26 -07:00
Eric Anholt
45388b5467 glsl: Make uniform linking generate separate uniforms for struct members.
This is a step towards making the linker code usable as our uniform
setup, instead of having it wedged into ir_to_mesa.cpp.
2010-08-25 12:38:26 -07:00
Eric Anholt
ea2231ff5e mesa: Remove the "Used" flag in gl_program_parameter.
This was in place for uniform handling, but nothing actually needs the
value now, since presence in a parameter list indicates that the
uniform was used as far as the linker was concerned.
2010-08-25 12:38:26 -07:00
Marek Olšák
bcca7fd5d5 r300/compiler: emulate relative addressing with negative offsets in VS
3 more piglits, cool.
2010-08-25 21:22:56 +02:00
Vinson Lee
721954c334 nvfx: Set pointer to NULL after free.
Guard against potential use after free.
2010-08-25 11:22:55 -07:00
Marek Olšák
dc27515780 r300g: fix potentially uninitialized variables in create_rs_state
It had no impact on correctness, though.

Reported by Vinson Lee.
2010-08-25 20:10:06 +02:00
Vinson Lee
92cfcc2afd st/mesa: Remove unnecessary header. 2010-08-25 10:06:05 -07:00
Keith Whitwell
d4bfd8a24a llvmpipe: fix bad patch application 2010-08-25 18:01:51 +01:00
Vinson Lee
14ac294e1a llvmpipe: Remove unnecessary header. 2010-08-25 09:55:07 -07:00
Aras Pranckevicius
653ddaab26 glsl/mesa: fixes for MSVC
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-25 09:21:10 -06:00
Kristian Høgsberg
f301932dba intel: Support EGL_MESA_image_drm 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
9087ba1280 intel: Take an intel_screen pointer in intel_alloc_region_* functions 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
5aaa53e66c egl_dri2: Add support for MESA_image_drm 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
b7a8893a24 egl: Add EGL_MESA_drm_image extension
Create EGLImages from DRM buffer handles.
2010-08-25 09:17:47 -04:00
Keith Whitwell
29bcbf5e79 llvmpipe: track drawing region as a single u_rect 2010-08-25 10:29:27 +01:00
Keith Whitwell
d808f7b53e llvmpipe: better triangle debugging 2010-08-25 10:29:27 +01:00
Keith Whitwell
c25151dd6a llvmpipe: cull zero-area triangles early 2010-08-25 10:29:27 +01:00
Keith Whitwell
98f3ff8f4a llvmpipe: more rasterization counters 2010-08-25 10:29:27 +01:00
Keith Whitwell
5a45e53df4 llvmpipe: move some fence functions into lp_screen.c 2010-08-25 10:29:27 +01:00
Keith Whitwell
1e926fe42a llvmpipe: wake all threads waiting on a fence 2010-08-25 10:29:27 +01:00
Keith Whitwell
b6e03eafe3 llvmpipe: fence debugging, add llvmpipe_finish 2010-08-25 10:29:27 +01:00
Keith Whitwell
285ea417ef tgsi: helper for dumping tokens as hex 2010-08-25 10:29:26 +01:00
Keith Whitwell
6c0dc4bafb draw: specialized cliptesting routines 2010-08-25 10:29:21 +01:00
Keith Whitwell
4cef308726 util: add rectangle helpers to u_rect.h
This begins a process of repurposing this file.  The existing usage is
as a header file for some software blit fallbacks, which should be
moved to a more appropriately named header.
2010-08-25 10:07:36 +01:00
Keith Whitwell
bc3cff2a4f gallium/docs: notes on scissor state 2010-08-25 10:07:36 +01:00
Keith Whitwell
f77daaa882 llvmpipe: remove dead code 2010-08-25 10:07:36 +01:00
Chia-I Wu
d29d7807c1 draw: Remove UNDEFINED_VERTEX_ID checks in emit pathes.
UNDEFINED_VERTEX_ID is used by draw_pipe_vbuf to decide whether a vertex
has been emitted or not.  The non-pipeline pathes do not use it (they
tell the frontend the max vertex count when prepare() is called).
2010-08-25 16:23:01 +08:00
Chia-I Wu
22f6026324 gallium: Use draw_set_index_buffer and others.
Update all drivers to use draw_set_index_buffer,
draw_set_mapped_index_buffer, and draw_vbo.  Remove
draw_set_mapped_element_buffer and draw_set_mapped_element_buffer_range.
2010-08-25 16:06:45 +08:00
Chia-I Wu
94e8d4171d svga: Remove redundant svga_draw_range_elements.
That is, implement draw_vbo directly.  As a result,
svga_swtnl_draw_range_elements is also replaced by svga_swtnl_draw_vbo.

This commit should not have any functional change.
2010-08-25 16:06:38 +08:00
Chia-I Wu
4f024e0f64 draw: Add draw_set_index_buffer and others.
This commit adds draw_set_index_buffer, draw_set_mapped_index_buffer,
and draw_vbo.  The idea behind the new functions is that an index buffer
should be a state.

draw_arrays and draw_set_mapped_element_buffer are preserved, but the
latter will be removed soon.
2010-08-25 16:06:37 +08:00
Vinson Lee
4e82319733 nvfx: Clean up header file inclusion in nvfx_screen.h.
Remove nvfx_context.h.
Include p_compiler.h for INLINE symbol.

Fixes nvfx_context.h -> nvfx_screen.h -> nvfx_context.h include recursion.
2010-08-25 00:52:34 -07:00
Vinson Lee
fbc3a911e1 nvfx: Include missing headers in nvfx_shader.h.
Include stdint.h for uint8_t symbol.
Include p_compiler.h for INLINE symbol.
2010-08-25 00:44:28 -07:00
Vinson Lee
cc4925bfe6 i965: Remove unnecessary header. 2010-08-25 00:40:00 -07:00
Vinson Lee
a8177e7456 r600: Include missing header in evergreen_fragprog.c.
Include r600_emit.h for r600EmitShader and r600EmitShaderConsts symbols.

Fixes the following GCC warnings.
evergreen_fragprog.c: In function 'evergreenSetupFragmentProgram':
evergreen_fragprog.c:521: warning: implicit declaration of function 'r600EmitShader'
evergreen_fragprog.c:778: warning: implicit declaration of function 'r600EmitShaderConsts'
2010-08-25 00:29:19 -07:00
Vinson Lee
cab86cb765 r600: Include missing header in evergreen_vertprog.c.
Include r600_emit.h for r600EmitShader and r600EmitShaderConsts symbols.

Fixes the following GCC warnings.
evergreen_vertprog.c:614: warning: implicit declaration of function 'r600EmitShader'
evergreen_vertprog.c:701: warning: implicit declaration of function 'r600EmitShaderConsts'
2010-08-25 00:19:45 -07:00
Vinson Lee
deffeba172 gallivm: Include missing header in lp_bld_sample.h.
Include p_format.h for enum pipe_format symbol.
2010-08-24 23:53:26 -07:00
Vinson Lee
72ae834fa1 gallivm: Include missing header in lp_bld_pack.h.
Include p_compiler.h for boolean symbol.
2010-08-24 23:50:45 -07:00
Vinson Lee
0ae6b30c14 r300/compiler: Silence uninitialized variable warning.
The variable loops would be used uninitialized if it ever processed a
RC_OPCODE_ENDLOOP case first.

This patch initalizes the loops variable to NULL and adds an assert at
the RC_OPCODE_ENDLOOP case that loops isn't NULL.

Silence the following GCC warning.
r3xx_vertprog.c: In function 'translate_vertex_program':
r3xx_vertprog.c:469: warning: 'loops' may be used uninitialized in this function
2010-08-24 23:04:20 -07:00
Vinson Lee
19f9340e67 r300g: Add missing comma in SConscript.
This is a follow-on patch to commit
574ba4b5f5.

Fixes r300g SCons build.
2010-08-24 22:28:21 -07:00
Marek Olšák
879a730231 r300g: fix gl_PointCoord
Is this hackish or is this the correct way to use point_quad_rasterization?
Copied from nvfx.
2010-08-25 04:57:11 +02:00
Vinson Lee
3a97ec7f48 r600: Include missing header in evergreen_render.c.
Fixes the following GCC warning.
evergreen_render.c: In function 'evergreenTryDrawPrims':
evergreen_render.c:836: error: implicit declaration of function 'evergreenSetupFragmentProgram'
2010-08-24 19:08:47 -07:00
Vinson Lee
8cf7eaf3ff r600: Remove unused variable.
Silences the following GCC warning.
evergreen_state.c: In function 'evergreenSetBlendState':
evergreen_state.c:341: warning: unused variable 'id'
2010-08-24 19:04:19 -07:00
Vinson Lee
e96b311037 i965: Fix printf format warnings on 32-bit builds. 2010-08-24 18:51:56 -07:00
Vinson Lee
3db9d4b253 r600: Remove unused variable.
Fixes the following GCC warning.
r600_emit.c In function 'r600AllocShaderConsts':
r600_emit.c:59: warning: unused variable 'out'
2010-08-24 18:32:51 -07:00
Vinson Lee
67925c6cd6 r600: Remove spaces between backslash and newline.
Fixes the following GCC warnings.
r600_cmdbuf.h:201: warning: backslash and newline separated by space
r600_cmdbuf.h:202: warning: backslash and newline separated by space
2010-08-24 18:20:26 -07:00
Marek Olšák
0a21938de9 r300g: eliminate unused constants in FS 2010-08-25 02:44:29 +02:00
Marek Olšák
abae06ac85 r300g: eliminate unused constants in VS 2010-08-25 02:44:29 +02:00
Marek Olšák
62eb9eda1d r300g: clean up some mess in set_constant_buffer 2010-08-25 02:44:29 +02:00
Marek Olšák
2eeaf773fd r300g: fix indentation 2010-08-25 02:44:28 +02:00
Marek Olšák
574ba4b5f5 r300/compiler: implement elimination of unused constants
Wine likes to create a *lot* of constants, exceeding the size of the constant
file in hw.
2010-08-25 02:44:28 +02:00
Marek Olšák
4b9b2a3cdc r300/compiler: terminate vertex shader compilation immediately after an error
Also rename "compiler" to "c".
2010-08-25 02:44:28 +02:00
Marek Olšák
1802007ee9 r300/compiler: fail to compile if we hit hw limits or an unimplemented feature
i.e. relative addressing (mainly FS), saturate modifiers, exceeding
the maximum number of constants.
2010-08-25 02:44:28 +02:00
Marek Olšák
6c88f84bdd r300/compiler: handle indexable temporaries correctly in deadcode elimination 2010-08-25 02:44:28 +02:00
Marek Olšák
3aee8c3b1d r300/compiler: disable register allocation for indexable temporaries in VS
If there is relative addressing of temporaries, we cannot change register
indices, so skip register allocation entirely. To utilize register allocation
at least partially, we need separate indexable and non-indexable register
files in both TGSI and Mesa IR.
2010-08-25 02:44:28 +02:00
Marek Olšák
cb925970ee r300g: reset the index bias to 0 at the end of CS 2010-08-25 02:44:28 +02:00
Marek Olšák
5755d1d6a7 ir_to_mesa: set IndirectRegisterFiles
This fixes relative addressing of temporaries (and maybe others)
in all gallium drivers.

Acked on irc by Eric Anholt.
2010-08-25 02:44:28 +02:00
Vinson Lee
57e66ed9b1 nvfx: Initialize variables on error path. 2010-08-24 17:40:50 -07:00
Eric Anholt
2f5bf20e44 glsl: Set up uniform initializers by walking the shaders after linking.
Previously, uniform initializers were handled by ir_to_mesa as it made
its Parameters list.  However, uniform values are global to all
shaders, and the value set in one Parameters list wasn't propagated to
the other gl_program->Parameters lists.  By going back through the
general Mesa uniform handling, we make sure that all gl_programs get
updated values, and also successfully separate uniform initializer
handling from ir_to_mesa gl_program generation.

Fixes:
glsl-uniform-initializer-5.
2010-08-24 16:37:02 -07:00
Eric Anholt
7de4d8fe11 glsl: Don't dead-code eliminate a uniform initializer.
Partial fix for glsl-uniform-initializer-5.
2010-08-24 16:37:02 -07:00
Dave Airlie
37f0654fa5 r300g: rename radeong_dri.so to r300_dri.so
acked on irc by Corbin + Marek.
2010-08-25 06:10:01 +10:00
Brian Paul
ad58f0d9e0 make: Use C++ compiler to link stdc++ library.
glxinfo and glxgears run on swrast and softpipe without undefined symbol
errors.
2010-08-24 12:18:09 -07:00
Vinson Lee
d3772eab2d configs: Remove -lstdc++ from default.
This patch undoes commit 9b7480cd95.

A follow-on patch will provide the proper fix.
2010-08-24 12:14:14 -07:00
Henri Verbeet
547e867558 r600g: Add support for PIPE_FORMAT_R32_FLOAT. 2010-08-24 20:52:21 +02:00
Ian Romanick
0eb2026c87 prog_execute: Implement OPCODE_TXL
Fixes bugzilla #29628
2010-08-24 10:27:14 -07:00
Brian Paul
81137623e5 glsl2: rename local variable_entry class
With MSVC it seems that this class and its constructor is colliding
with the one in ir_variable_refcount.cpp.  Rename the class here to
avoid the collision.

This is a bit of a hack.  Can the two variable_entry classes be merged
and shared?
2010-08-24 10:21:27 -06:00
Brian Paul
2eb8b2d3bb glsl2: move constructor into .cpp file to work around compiler bug
Fixes fd.o bug 29770

The refcount==0 assertion only failed on some systems.  One example
being 32-bit Linux with gcc 4.4.4.
2010-08-24 10:01:44 -06:00
Brian Paul
f3ec111b0a docs: updated info about GLSL compiler
Ian or Eric should review this and add/edit as needed.
2010-08-24 09:02:08 -06:00
Brian Paul
484dde2d63 docs: list the new GLSL compiler 2010-08-24 09:01:54 -06:00
Brian Paul
f82163b012 mesa: added isblank() for MSVC 2010-08-24 08:04:37 -06:00
Brian Paul
d902eb59d5 mesa: remove non-existant files from tarball list 2010-08-24 07:51:52 -06:00
Vinson Lee
c8b26c63fd glsl: Add assert to check variable_entry referenced_count after construction.
A variable_entry after construction should have its referenced_count
member set to 0. However, occassionally this isn't the case and
entry->referenced_count has been observed to be a garbage value. This
leads to crashes of several tests in the Piglit test suite.

This patch adds an assert to check that a variable_entry instance has
its referenced_count member initialized to 0 after construction.
2010-08-24 01:16:46 -07:00
Vinson Lee
b018ea19a3 nvfx: Remove unnecessary headers. 2010-08-23 23:58:57 -07:00
Dave Airlie
f122dba59a glsl: make 'make clean' work properly.
this has make clean remove all the objects.
2010-08-24 16:10:28 +10:00
Vinson Lee
e5df3cc286 glsl: Silence unused variable warning.
The variable is used but only in the body of an assert.
2010-08-23 22:27:49 -07:00
Vinson Lee
b48f20dab8 r300g: Remove unused variable.
Fixes this GCC warning.
r300_render.c: In function 'r300_draw_flush_vbuf':
r300_render.c:988: warning: unused variable 'r300_render'
2010-08-23 22:15:24 -07:00
Chia-I Wu
1288d5c392 st/egl: Fix r300/r600 support in KMS backend.
When the kernel driver name is radeon, ask the loader for r300 or r600
depending on the PCI ID.
2010-08-24 11:50:37 +08:00
Chia-I Wu
65741c596f targets/egl: Check against drm_driver_descriptor::name.
drm_driver_descriptor::driver_name is defined to be the name of the
kernel module.  We should check against drm_driver_descriptor::name
instead of drm_driver_descriptor::driver_name.
2010-08-24 11:50:36 +08:00
Benjamin Franzke
0ba1643658 targets/egl: add pipe_r600
KNOWN ISSUE: eglShowScreenSurfaceMESA in st/egl/kms fails
but st/egl/x11 works
2010-08-24 11:50:36 +08:00
Benjamin Franzke
ce7016e882 targets/egl: rename pipe_radeon to pipe_r300
st/egl/x11/x11_screen.c requests a driver named r300 not radeon

KNOWN ISSUE: breaks st/egl/kms/
	st/egl/kms requests a pipe named "radeon"
	that will not be found now

	so why not leaving pipe_radeon there?
	that was possible as long we have only r300g.
	now there is also r600g for which st/egl/kms also
	requests a pipe named "radeon"
	(possible solution in later commit)
2010-08-24 11:50:36 +08:00
Chia-I Wu
9dd95b46c8 mesa: Remove extraneous semicolon. 2010-08-24 11:49:55 +08:00
Chia-I Wu
d473543069 st/dri: Remove unnecessary main/mtype.h. 2010-08-24 11:36:52 +08:00
Chia-I Wu
59e6e76542 st/wgl: Include main/core.h.
Make st/wgl include only main/core.h from core mesa.
2010-08-24 11:36:48 +08:00
Chia-I Wu
40fd4323b4 st/glx: Include main/core.h.
Make st/glx include only main/core.h from core mesa.
2010-08-24 11:28:12 +08:00
Chia-I Wu
bfd7c9ac22 glsl: Include main/core.h.
Make glsl include only main/core.h from core mesa.
2010-08-24 11:27:29 +08:00
Chia-I Wu
f90b5936d0 mesa: Add core.h.
core.h is the public header of core mesa.  GLX, WGL, and GLSL are
supposed to include this header file.  It should be noted that headers
included by core.h must not perform feature tests (#if FEATURE_xxx).
Otherwise, we cannot, for example, mix a FEATURE_ES2 libmesagallium.a
with a FEATURE_GL libglsl.a.
2010-08-24 11:00:29 +08:00
Luca Barbieri
6b6b454037 translate_sse: clear state for each function emission
Fixes #29771.
2010-08-24 04:18:11 +02:00
Eric Anholt
8dd619ba68 glsl: Rely on talloc_autofree_context() instead of trying to free on our own.
Because the static types talloc their names at dlopen time,
talloc_freeing the types at DRI driver screen teardown means that if
the screen gets brought back up again, the names will point at freed
memory.  talloc_autofree_context() exists to do just what we want
here: Free memory referenced across the program's lifetime so that we
avoid noise in memory leak checkers.

Fixes: bug #29722 (assertion failure in unigine).
2010-08-23 17:25:38 -07:00
Eric Anholt
e0564d56b1 intel: Add support for MAX_SAMPLES=1 EXT_framebuffer_multisample.
The spec specifically sets the minimum MAX_SAMPLES at 1 to allow exposing
the extension on all implementations, so do so.
2010-08-23 17:25:38 -07:00
Alex Deucher
d1b4f40347 radeon: print chip family for evergreen in renderer string 2010-08-23 20:18:28 -04:00
Dave Airlie
0e6a02d299 r600g: add XPD support
ported from r600c.
2010-08-24 09:56:22 +10:00
Dave Airlie
87f44d5723 r600g: add CMP support.
ported from r600c, fixes fp-cmp, glsl1-sqrt*
2010-08-24 09:18:32 +10:00
Luca Barbieri
c60c2d3a64 nvfx: don't emit dummy commands on nv30
Should fix errors on the original nv30, reported by pmdata.
2010-08-24 00:05:27 +02:00
Eric Anholt
e11757bb89 glsl: When unable to assign the initializer for a const variable, set it to 0.
This prevents assertion failures or cascading errors after we've
logged the fact that we were unable to handle the initializer.

Fixes unsized-array-non-const-index-2.vert
2010-08-23 14:58:38 -07:00
Luca Barbieri
d1e6b31cb8 translate_sse: fix x86-64 2010-08-23 23:23:27 +02:00
Eric Anholt
76e96d74f4 glsl: Cleanly fail when a function has an unknown return type.
Bug #29608.
2010-08-23 13:27:36 -07:00
Henri Verbeet
6fb39f0fa2 r600g: Add support for PIPE_CAP_DEPTH_CLAMP. 2010-08-23 22:13:18 +02:00
Eric Anholt
b75645d8ad glsl: Rebuild builtins for any() change. 2010-08-23 13:06:02 -07:00
Eric Anholt
5e9ac94cc4 mesa: Add new ir_unop_any() expression operation.
The previous any() implementation would generate arg0.x || arg0.y ||
arg0.z.  Having an expression operation for this makes it easy for the
backend to generate something easier (DPn + SNE for 915 FS, .any
predication on 965 VS)
2010-08-23 13:05:53 -07:00
Eric Anholt
47003a8f65 glsl: Regenerate builtins with the new sorting. 2010-08-23 12:58:07 -07:00
Eric Anholt
66afcb5607 ir_to_mesa: Implement f2b by comparing the arg to 0, not the result.
Fixes: glsl-fs-any
2010-08-23 12:58:07 -07:00
Eric Anholt
18a6023900 glsl: Count function call outvals as writing to variables for linker checks.
Fixes: glsl-vs-position-outval.  Bug #28138 (regnum online)
2010-08-23 12:57:59 -07:00
Ian Romanick
6dad5a4e8d glsl2: Include imports.h to get snprintf wrapper for MSVC
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23 20:55:50 +01:00
Aras Pranckevicius
44a6c13ac3 mesa: Fix msvc build of glsl.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23 20:55:50 +01:00
Luca Barbieri
c0eb479e07 auxiliary: fix nvfx/nv50 primitive splitting for line loops
s->close_first was on the wrong side of the inequality.

Caught by blender.
Thanks to AndrewR for reporting this.
2010-08-23 21:47:47 +02:00
Jerome Glisse
bcf7f66a93 r600g: export one component per pixel + r7xx uncompression shader
We need to always at least export one component (wether it's depth
or color. Add valid r7xx shader program for depth decompression.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-23 15:42:32 -04:00
Kenneth Graunke
6355ae2b80 generate_builtins.py: Generate output in sorted order. 2010-08-23 12:36:40 -07:00
Luca Barbieri
4ab1001ac2 nvfx: improve fp temp accounting 2010-08-23 20:35:56 +02:00
Brian Paul
4b2b5f8e30 tgsi: fix false CondStackTop==0 assertion 2010-08-23 12:15:40 -06:00
Eric Anholt
ebef040117 ir_to_mesa: Fix constant array handling to return the temp we created.
We ended up returning CONST[loc] rather than TEMP[loc2].  Things would
*usually* end up working out OK, since the constants often ended up
getting allocated to CONST[loc..loc+columns] with no swizzle.  But for
the case where the contigous temporary copy of the swizzled constant
vec4 args was actually needed, we'd end up reading some other constant
values, possibly including ones not actually allocated.

Fixes: glsl-varying-mat3x2.
2010-08-23 11:03:13 -07:00
Carl Worth
61f73fec53 glcpp: Make standalone preprocessor work with a tty as stdin
Previously glcpp would silently abort if it couldn't fstat the file being
read, (so it would work with stdin redirected from a file, but would not
work with stdin as a tty). The stat was so that glcpp could allocate
a buffer for the file content in a single call.

We now use talloc_realloc instead, (even if the fstat is
possible). This is theoretically less efficient, but quite irrelevant,
(particularly because the standalone preprocessor is used only for
testing).
2010-08-23 10:48:10 -07:00
Carl Worth
21560c40e8 glcpp: Fix test suite to avoid flagging failed tests as valgrind errors.
We recently added several tests that intentionally trigger
preprocessor errors. During valgrind-based testing, our test script
was noticing the non-zero return value from the preprocessor and
incorrectly flagging the valgrind-based test as failing.

To fix this, we make valgrind return an error code that is otherwise
unused by the preprocessor.
2010-08-23 10:48:10 -07:00
Carl Worth
cf8bb19a11 glcpp: Fix segfault in standalone preprocessor for "file not found", etc.
This error message was missing so that the program would simply
segfault if the provided filename could not be opened for some reason.

While we're at it, we add explicit support for a filename of "-" to
indicate input from stdin.
2010-08-23 10:48:10 -07:00
Carl Worth
eab206510f glcpp: Update generated glcpp-lex.c for the last two changes.
This fixes both "#line 0" and "#line XXX YYY" as described in the two
most recent commits.
2010-08-23 10:48:10 -07:00
Carl Worth
c2280e6381 glcpp: Fix handling of "#line 0"
The existing DECIMAL_INTEGER pattern is the correct thing to use when
looking for a C decimal integer, (that is, a digit-sequence not
starting with 0 which would instead be an octal integer).

But for #line, we really want to accept any digit sequence, (including
"0"), and always interpret it as a decimal constant. So we add a new
DIGITS pattern for this case.

This should fix the compilation failure noted in bug #28138

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

(Though the generated file will not be updated until the next commit.)
2010-08-23 10:48:10 -07:00
Carl Worth
ff10d239af glcpp: Fix source numbers set with "#line LINE_NUMBER SOURCE_NUMBER"
Previously, the YY_USER_ACTION was overwriting the yylloc->source value
in every action, (after that value had been carefully set by the handling
of the #line directive). Instead, we want to initialize it once in
YY_USER_INIT and then not touch it at all in YY_USER_ACTION.
2010-08-23 10:48:10 -07:00
Carl Worth
2a9e791fde glcpp: Add new test for #line directive.
This test exposes two current bugs:

	1. The source number is not being correctly emitted in error
	   messages (instead, it's always 0).

	2. A directive of "#line 0" is resulting in the following
	   parse error:

		preprocessor error: Invalid tokens after #
2010-08-23 10:48:10 -07:00
Carl Worth
c15f04b326 glcpp: Update README file (new specifications and fewer limitations).
The README file had grown a little bit stale. We've been using newer
versions of both the GLSL and C99 specifications, so list those. Also,
several of the documented known limitations have since been fixed, so
remove those.
2010-08-23 10:48:10 -07:00
Carl Worth
0acd68c405 glcpp: Add test for the #error directive.
This directive is already implemented nicely, but wasn't previously tested.
It will be convenient to use this directive in further tests that rely
on error messages, (such as ensuring that #line correctly sets the line
number in the error message).
2010-08-23 10:48:10 -07:00
Eric Anholt
a721abfbd1 glsl: Trim the size of uniform arrays to the maximum element used.
Fixes glsl-getactiveuniform-array-size.
2010-08-23 10:34:31 -07:00
Eric Anholt
001a7bfdfc mesa: Don't add 1 to GL_ACTIVE_UNIFORM_MAX_LENGTH.
Fixes: glsl-getactiveuniform-length.
2010-08-23 10:34:31 -07:00
Roland Scheidegger
c2f074d8a4 util: fix util_fill_rect to take util_color instead of u32 param
util_fill_rect could not handle formats with more than 32 bits,
since the fill color was a uint32_t value. Fix this by using
a util_color union instead, and also expand the union so it
works with formats which have up to 256 bits (the max of any
format currently defined).
2010-08-23 17:55:16 +02:00
Luca Barbieri
c907b94713 nvfx: emit bo relocations only when needed
Should improve performance, possibly significantly.
2010-08-23 17:12:31 +02:00
Eric Anholt
ea70969618 glsl2: Add missing sig_iter.next() to the no-constant-folding-to-outvals fix. 2010-08-23 07:22:16 -07:00
Luca Barbieri
2e215bc28f nvfx: match Gallium's gl_PointCoord brokenness
Gallium always puts gl_PointCoord in GENERIC[0] if
point_quad_rasterization is enabled.

This is silly, but for now it makes mesa-demos/glsl/pointcoord work.
2010-08-23 15:20:31 +02:00
Luca Barbieri
bfaa2577c6 nvfx: support clip planes sensibly and fix them on nv30
Before, we were discarding the compiled vertex program on each
vertex program change.

Now we compile the program as if there were 6 clip planes and
dynamically patch in an "end program" bit at the right place.

Also, nv30 should now work.
2010-08-23 15:09:22 +02:00
Dave Airlie
eb430b0e94 r300g: avoid stall in no-tcl drawing when mapping vbo
the current code reuses the same vbo over and over, however after a flush
we'd stall and wait for mapping on the vbo when we should just fire and forget.

On a gears test this brings me from ~620 to ~750 on my rv530 in swtcl mode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-23 20:31:21 +10:00
Chia-I Wu
e607b67ebc glapi: Clean up header inclusions.
Do not rely on PUBLIC being defined in glapi.h.  Do not include core
mesa headers.
2010-08-23 18:28:14 +08:00
Chia-I Wu
0c87828050 mesa: Assorted fixes for es_generator.py on win32.
Fix mixed use of GL_APIENTRY and GLAPIENTRY.  Parameter list of a function
prototype should never be empty.
2010-08-23 18:28:14 +08:00
Zhenyu Wang
8a537b2fb8 i965: Add sandybridge D0 pci ids
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-08-23 10:16:45 +08:00
Eric Anholt
27e931f679 mesa: Fix typo in autoconf.in that made talloc cflags still detect at runtime. 2010-08-22 18:54:30 -07:00
Marek Olšák
cfc4d86656 st/mesa: implement depth-only blit for BlitFramebuffer
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Marek Olšák
7945e143e0 util: implement depth blitting in u_blit
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Marek Olšák
36e523f4a3 st/mesa: fix BlitFramebuffer for D24S8 textures
This is the same issue as in the previous patch, but here the Blit is not
implemented for separate depth and stencil buffers at all (such
a configuration is not supported in Gallium) and the code incorrectly treated
a D24S8 texture as two separate buffers, making this Blit a no-op.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Brian Paul
24bd9780bc st/mesa: added st_is_depth_stencil_combined() function
This code is part of a patch by Marek Olšák.
2010-08-22 19:40:26 -06:00
Eric Anholt
428a3cd2d5 glsl: Don't constant-fold in a constant in place of a function outval. 2010-08-22 18:34:46 -07:00
Eric Anholt
6606fde3ec glsl: Convert constant folding to the rvalue visitor.
This should be mostly a noop, except that a plain dereference of a
variable that is not part of a constant expression could now get
"constant folded".  I expect that for all current backends this will
be either a noop, or possibly a win when it provokes more
ir_algebraic.  It'll also ensure that when new features are added,
tree walking will work normally.  Before this, constants weren't
getting folded inside of loops.
2010-08-22 18:34:46 -07:00
Eric Anholt
137b8397fa glsl: Don't tree-graft in an expression in place of a function outval.
Fixes: glsl-constant-folding-call-1 (bug #29737)
2010-08-22 18:34:45 -07:00
Brian Paul
6b90d1b1ac st/mesa: fix ReadPixels crashes when reading depth/stencil from a FBO
This is based on a patch from Marek Olšák.

NOTE: This is a candidate for the Mesa 7.8 branch.
2010-08-22 19:04:49 -06:00
Brian Paul
c94256e83b mesa: use driver hook for creating new renderbuffers 2010-08-22 18:54:55 -06:00
Brian Paul
ed57286b75 st/mesa: clean-up pipe_get_transfer() calls 2010-08-22 18:54:55 -06:00
Eric Anholt
639cdd3782 mesa: AC_SUBST the talloc libs/cflags so the ./configure results are saved.
I had used pkg-config from the Makefile because I didn't want to screw
around with the non-autoconf build, but that doesn't work because the
PKG_CONFIG_PATH or TALLOC_LIBS/TALLOC_CFLAGS that people set at
configure time needs to be respected and may not be present at build
time.

Bug #29585
2010-08-22 17:36:51 -07:00
Luca Barbieri
8ffc357228 nvfx: fix minor memory leak 2010-08-23 00:16:59 +02:00
Luca Barbieri
d507c0812d nvfx: support both sprite coord origins
Now we lie less when claiming OpenGL 2 support.

Also, first piglit result group is now all green, except for
fdo25614-genmipmap, which seems mesa/st's fault.
2010-08-23 00:15:03 +02:00
Luca Barbieri
d21be6ee2c nvfx: use 64-bit bitmasks for temps 2010-08-23 00:15:03 +02:00
Jerome Glisse
d843bbfd3f r600g: fix DB decompression
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22 17:14:48 -04:00
Vinson Lee
d324fcea67 nvfx: Include missing header in nvfx_vertprog.c.
Include draw_context.h for draw_*_vertex_shader symbols.

Fixes the following GCC warning.
nvfx_vertprog.c: In function 'nvfx_vp_state_create':
nvfx_vertprog.c:1276: warning: implicit declaration of function 'draw_create_vertex_shader'
nvfx_vertprog.c:1276: warning: assignment makes pointer from integer without a cast
nvfx_vertprog.c: In function 'nvfx_vp_state_delete':
nvfx_vertprog.c:1298: warning: implicit declaration of function 'draw_delete_vertex_shader'
2010-08-22 12:45:04 -07:00
Jakob Bornecrantz
8e632666af translate_sse: add R32G32B32A32_FLOAT -> X8X8X8X8_UNORM for EMIT_4UB
Changed by me to use movd instead of movss to avoid penalties.
2010-08-22 20:30:16 +02:00
Luca Barbieri
4f3fedcef7 translate_sse: refactor constant management 2010-08-22 20:28:27 +02:00
Luca Barbieri
df86f1e7d5 nvfx: refactor to support multiple fragment program versions 2010-08-22 20:28:27 +02:00
Luca Barbieri
47537a4557 nvfx: move stuff around 2010-08-22 20:28:27 +02:00
Jerome Glisse
ed99c28d12 r600g: depth buffer likely needs decompression when used as texture
Before using depth buffer as texture, it needs to be decompressed
(tile pattern of db are different from one used for colorbuffer
like texture)

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22 14:26:05 -04:00
Keith Whitwell
42719df0b8 glx/xlib: configurable strict/non-strict buffer size invalidate
Introduce a new configuration option XMESA_STRICT_INVALIDATE to switch
between swapbuffers-based and glViewport-based buffer invalidation.

Default strict invalidate to false, ie glViewport-based invalidation,
aka ST_MANAGER_BROKEN_INVALIDATE.

This means we will not call XGetGeometry after every swapbuffers,
which allows swapbuffers to remain asynchronous.  For apps running at
100fps with synchronous swapping, a 10% boost is typical.  For gears,
I see closer to 20% speedup.

Note that the work of copying data on swapbuffers doesn't disappear -
this change just allows the X server to execute the PutImage
asynchronously without us effectively blocked until its completion.

This applies even to llvmpipe's threaded rasterization as the
swapbuffers operation was a large part of the serial component of an
llvmpipe frame.

The downside of this is correctness - applications which don't call
glViewport on window resizes will get incorrect rendering, unless
XMESA_STRICT_INVALIDATE is set.

The ultimate solution would be to have per-frame but asynchronous
invalidation.  Xcb almost looks as if it could provide this, but the
API doesn't seem to quite be there.
2010-08-22 14:49:17 +01:00
Keith Whitwell
3d4b60f1f7 llvmpipe: reduce size of fragment shader variant key
Don't spend as much time comparing them.
2010-08-22 14:49:17 +01:00
Keith Whitwell
49a2ea082b llvmpipe: remove unused member from lp_fragment_shader_variant_key 2010-08-22 14:49:17 +01:00
Keith Whitwell
0ad82b8d28 llvmpipe: don't clear unused bins
If bins outside the current scene bounds are being corrupted, we'll
need to fix that separately.  Currently seems ok though.
2010-08-22 14:49:17 +01:00
Keith Whitwell
a1de6f48c3 draw: reduce the size of the llvm variant key 2010-08-22 14:49:16 +01:00
Keith Whitwell
8b15de2736 glx/xlib: remove another XSync
With this change, xmesa_get_window_size still does one round trip, but
that's better than doing two.
2010-08-22 14:48:24 +01:00
Keith Whitwell
8570232b3b glx/xlib: no need to call XSync from XMesaFlush
Try to eliminate some unnecessary X server round trips.
2010-08-22 14:48:24 +01:00
Luca Barbieri
7de1f86c49 nvfx: simplify and correct fragment program update logic
This version should hopefully be much clearer and thus less likely
to be subtly broken.

Also fixes point sprites on nv40 and possibly some other bugs too.
2010-08-22 15:42:17 +02:00
Luca Barbieri
9fefab340f nvfx: make stipple setting independent of enable 2010-08-22 15:42:16 +02:00
Luca Barbieri
793e398681 nvfx: fix vertex programs 2010-08-22 15:42:16 +02:00
Luca Barbieri
a0c45eabf9 nvfx: use relocations array for vp constants 2010-08-22 15:42:16 +02:00
Henri Verbeet
8a878c266a r600g: Don't blindly unmap NULL->size.
There may actually be something mapped in that range, especially for large
buffers like e.g. the GL Drawable.
2010-08-22 12:43:11 +02:00
José Fonseca
04094b2da2 svga: Do not shortcut NULL surface relocations with SVGA3D_INVALID_ID.
How to cope with NULL surface relocations should be entirely at winsys'
discretion.
2010-08-22 11:37:28 +01:00
Eric Anholt
52e9520274 i965: Fix 8-wide FB writes on gen6.
My merge of Zhenyu's patch on top of my previous patches broke it by
my code expecting simd16 single write and Zhenyu's simd8 path being
disabled by mine.  Merge the two for success.
2010-08-22 00:52:18 -07:00
Eric Anholt
250fccecc8 i965: Fix brw_math1 with scalar argument in gen6 FS.
The docs claim two conflicting things: One, that a scalar source is
supported.  Two, source hstride must be 1 and width must be exec size.
So splat a constant argument out into a full reg to operate on, since
violating the second set of constraints is clearly failing.

The alternative here might be to do a 1-wide exec on a constant
argument for math1.  It would probably save cycles too.  But I'll
leave that for the glsl2-965 branch.

Fixes glsl-algebraic-div-one-2.shader_test.
2010-08-22 00:52:18 -07:00
Eric Anholt
556f19415a i965: Fix up WM push constant setup on gen6.
Fixes glsl-algebraic-add-add-1.
2010-08-22 00:52:18 -07:00
Eric Anholt
527a9a4de2 i965: Use intel->gen >= 6 instead of IS_GEN6. 2010-08-22 00:52:18 -07:00
Vinson Lee
df604834d3 libgl-xlib: Include missing header in xlib.c.
Include st_api.h for st_api_create_OpenGL symbol.
2010-08-22 00:30:47 -07:00
Vinson Lee
928830606f nvfx: Silence unused variable warning.
The variable is used but only in the body of an assert.
2010-08-22 00:16:54 -07:00
Vinson Lee
48c289fb55 mesa: Initialize member variables in ir_to_mesa_src_reg constructor.
The default constructor did not initialize some member variables.
2010-08-22 00:09:43 -07:00
Vinson Lee
405546882a mesa: Initialize variables in mesa_src_reg_from_ir_src_reg. 2010-08-21 23:56:24 -07:00
Vinson Lee
3bdbccef2a util: Use #ifdef instead of #if.
This is a typo fix of earlier commit 0f3b3751b8.
2010-08-21 23:36:30 -07:00
Vinson Lee
0f3b3751b8 util: Define dump_cpu only for DEBUG builds.
dump_cpu is used only when DEBUG is defined.

Fixes the following GCC warning on builds without DEBUG defined.
util/u_cpu_detect.c:76: warning: 'debug_get_option_dump_cpu' defined but not used
2010-08-21 23:28:52 -07:00
Vinson Lee
2a7493ada4 translate_sse: Silence uninitialized variable warnings.
Initialize variables on error paths.
2010-08-21 23:24:28 -07:00
Vinson Lee
172953ef3a nvfx: Silence uninitialized variable warnings.
Variables weren't initialized on the error paths.
2010-08-21 22:59:46 -07:00
Vinson Lee
fdedff2dba i965g: Silence printf format warnings on 64-bit builds. 2010-08-21 22:45:09 -07:00
Vinson Lee
68d34f2979 nvfx: Silence uninitialized variable warnings.
Silence the following i686-apple-darwin10-gcc-4.2.1 warnings.
nv04_2d.c: In function 'nv04_region_copy_cpu':
nv04_2d.c:560: warning: 'dswy' may be used uninitialized in this function
nv04_2d.c:559: warning: 'dswx' may be used uninitialized in this function
nv04_2d.c:562: warning: 'sswy' may be used uninitialized in this function
nv04_2d.c:561: warning: 'sswx' may be used uninitialized in this function
2010-08-21 22:15:22 -07:00
Vinson Lee
4a06525737 nv50: Silence incompatible pointer type initialization warning.
Silence the following GCC warning.
warning: initialization from incompatible pointer type
2010-08-21 22:01:04 -07:00
Vinson Lee
2506b32eec nv50: Disable unused code.
Disable release_hw and emit_mov_from_pred functions as they are
currently not being used.
2010-08-21 21:42:17 -07:00
Vinson Lee
973c065abe i965g: Fix printf format warning on 32-bit platforms.
Fixes the following GCC warning on 32-bit platforms.
warning: format '%li' expects type 'long int', but argument 4 has type 'int'
2010-08-21 21:27:43 -07:00
Vinson Lee
56176f00f5 glsl: Silence uninitialized variable warning.
i686-apple-darwin10-gcc-4.2.1 generated the following warning.
warning: 'score' may be used uninitialized in this function

GCC 4.4.3 on Linux didn't generate the above warning.
2010-08-21 20:42:47 -07:00
Jerome Glisse
36efb86c05 r600g: partialy fix texturing from depth buffer + initial support for untiling
Partialy fix texturing from depth buffer, depth buffer is tiled
following different tile organisation that color buffer. This
properly set the tile type & array mode field of texture sampler
when sampling from db resource.

Add initial support to untiling buffer when transfering them,
it's kind of broken by corruption the vertex buffer of previous
draw.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-21 22:52:38 -04:00
José Fonseca
ae34a6393e draw: Don't assert if indices point outside vertex buffer.
This is valid input, and asserting here does causes the test suites that
verify this to crash.

Also, the assert was wrongly accepting the case

  max_index == vert_info->count

which, IIUC, is the first vertex outside the buffer. Assuming the
vert_info->count is precise (which often is not the case).
2010-08-22 02:26:44 +01:00
José Fonseca
ce9a6e6a7d mesa: Removed another unused variable. 2010-08-22 02:26:44 +01:00
Vinson Lee
13b3d4c23d glsl: Silence unused variable warning.
The variable is actually used but only in the body of an assert.
2010-08-21 16:22:18 -07:00
Vinson Lee
be99100ee7 util: Silence uninitialized variable warnings. 2010-08-21 15:49:17 -07:00
Kenneth Graunke
e511a35fc5 glsl: Handle array declarations in function parameters.
The 'vec4[12] foo' style already worked, but the 'vec4 foo[12]' style
did not.  Also, 'vec4[] foo' was wrongly accepted.

Fixes piglit test cases array-19.vert and array-21.vert.

May fix fd.o bug #29684 (or at least part of it).
2010-08-21 15:42:27 -07:00
Luca Barbieri
4edeeaf715 nvfx: actually fix it properly 2010-08-21 23:53:39 +02:00
Luca Barbieri
251e48c64a nvfx: fix incorrect assert 2010-08-21 23:45:32 +02:00
Vinson Lee
4a6eb492e8 util: Move loop variable declaration outside for loop.
Fixes build error with MSVC.
2010-08-21 14:36:29 -07:00
Vinson Lee
489c787b80 nvfx: Fix SCons build.
Move declarations before code.
Fix void pointer arithmetic.
2010-08-21 14:29:50 -07:00
Luca Barbieri
11d27871a7 nvfx: fix warnings 2010-08-21 23:09:43 +02:00
José Fonseca
0d96cbe4a5 gallivm: Emit DIVPS instead of RCPPS.
See comments for detailed rationale.

Thanks to Michal Krol and Zack Rusin for detecting and investigating this
in detail.
2010-08-21 21:58:22 +01:00
Luca Barbieri
42210f4464 nvfx: enable translate_sse 2010-08-21 21:56:29 +02:00
Vinson Lee
15d558c306 auxiliary: Add missing files to SCons build.
Add u_linear.c and u_linkages.c to SCons build.
Reorder list of files to be more alphabetical.
2010-08-21 12:32:17 -07:00
Vinson Lee
683118ccf2 auxiliary: Reorder list of files in Makefile.
This patch reorders the list of files so that the order is more alphabetic.
2010-08-21 12:21:59 -07:00
Vinson Lee
1badd3c43f scons: Fix nvfx build. 2010-08-21 12:00:57 -07:00
Luca Barbieri
d8e210eb11 nvfx: slightly improve handling of overlong vps 2010-08-21 20:42:15 +02:00
Luca Barbieri
5eddf95be9 nvfx: tweak CMP in fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
8983621c6b nvfx: implement CMP in vp 2010-08-21 20:42:15 +02:00
Luca Barbieri
923f5c97b1 nvfx: implement TXL in fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
847ac88671 nvfx: implement SSG in fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
32d2525d64 nvfx: implement DP2 in vp and fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
4aec8aa2e3 nvfx: implement TRUNC in vp and fp 2010-08-21 20:42:15 +02:00
Luca Barbieri
587d26fdf9 nvfx: implement NOP 2010-08-21 20:42:15 +02:00
Luca Barbieri
fe3c62dd77 nvfx: add vertex program control flow 2010-08-21 20:42:15 +02:00
Luca Barbieri
5287d86a0b nvfx: fix vertex shader headers 2010-08-21 20:42:15 +02:00
Luca Barbieri
af4a6eba55 nv40: add fragment program control flow 2010-08-21 20:42:15 +02:00
Luca Barbieri
cf0d156422 nvfx: refactor shader assembler 2010-08-21 20:42:15 +02:00
Luca Barbieri
28fa9451e1 nvfx: add option to dump shaders in TGSI and native code 2010-08-21 20:42:15 +02:00
Luca Barbieri
b2bad53478 nvfx: improve and correct nvfx_shader.h 2010-08-21 20:42:15 +02:00
Luca Barbieri
928cce672a nvfx: fix lodbias 2010-08-21 20:42:15 +02:00
Luca Barbieri
1dea9bc369 nvfx: mostly fix inline corruption magically
Not sure why this mostly works.
2010-08-21 20:42:15 +02:00
Luca Barbieri
ed232adc80 nvfx: fix GPU hardlocks when depth buffer is absent 2010-08-21 20:42:14 +02:00
Luca Barbieri
6931a01222 nvfx: fire ring after transfers
Might reduce the risk of running out of memory
2010-08-21 20:42:14 +02:00
Luca Barbieri
07b6fde410 nv30: band-aid viewport issues
For some reason nv30 seems to like to reset the viewport, even though
attempts to isolate where exactly it does that have currently been
inconclusive.
2010-08-21 20:42:14 +02:00
Luca Barbieri
0d74956a1f nvfx: support flatshade_first 2010-08-21 20:42:14 +02:00
Luca Barbieri
0184e29863 nvfx: expose GLSL
Still no control flow support, but basic stuff works.
2010-08-21 20:42:14 +02:00
Luca Barbieri
4d765f7fa3 nvfx: support proper shader linkage - adds glsl support 2010-08-21 20:42:14 +02:00
Luca Barbieri
8eb0fc430a nvfx: rewrite draw code and buffer code
This is a full rewrite of the drawing and buffer management logic.

It offers a lot of improvements:
1. A copy of buffers is now always kept in system memory. This is
   necessary to allow software processing of them, which is necessary
   or improves performance in many cases.
2. Support for pushing vertices on the FIFO, with index lookup if necessary.
3. "Smart" draw code that tries to intelligently choose the cheapest
  way to draw something: whether to use inline vertices or hardware
  vertex buffer, and whether to use hardware index buffers
4. Support for all vertex formats supported by the hardware
5. Usage of translate to push vertices, supporting all formats that are
   sensible to use as vertex formats
6. Support for base vertex
7. Usage of Ben Skeggs' primitive splitter originally for nv50, allowing
   correct splitting of line loops, triangle fans, etc.
8. Support for instancing
9. Precomputation using the vertex elements CSO

Thanks to Ben Skeggs for his primitive splitter originally for nv50.

Thanks to Christoph Bumiller for his nv50 push code, that was the basis
of this work, even though I changed his code dramatically, in particular
to replace his ad-hoc vertex data emitter with translate.

The changes could also go into nv50 too, but there are substantial
differences due to the additional nv50 hardware features.
2010-08-21 20:42:14 +02:00
Luca Barbieri
73b7c6fb33 nvfx: refactor sampling code, add support for swizzles and depth tex
This is a significant refactoring of the sampling code that:
- Moves all generic functions in nvfx_fragtex.c
- Adds a driver-specific sampler view structure and uses it to
  precompute texture setup as it should be done
- Unifies a bit more of code between nv30 and nv40
- Adds support for sampler view swizzles
- Support for specifying as sampler view format different from the
  resource one (only trivially)
- Support for sampler view specification of first and last level
- Support for depth textures on nv30, both for reading depth and
  for compare
- Support for sRGB textures
- Unifies the format table between nv30 and nv40
- Expands the format table to include essentially all supportable formats
  except mixed sign and "autonormal" formats
- Fixes the "is format supported" logic, which was quite broken, and
  makes it use the format table

Only tested on nv30 currently.
2010-08-21 20:42:14 +02:00
Luca Barbieri
4e2080a86e nvfx: new 2D: unify textures and buffers
Stop using the vtbl, and use real transfers for buffers too.
2010-08-21 20:42:14 +02:00
Luca Barbieri
0481ed25c9 nvfx: new 2D: use a CPU copy for up to 4 pixels, up from 0
Seems a reasonable threshold for now.

Significantly speeds up Piglit's 1x1 glReadPixels (but, you know,
reading pixels in 1x1 blocks is NOT a good idea, especially if you
might be running on a less-than-perfect driver).
2010-08-21 20:42:14 +02:00
Luca Barbieri
28eb392a85 nvfx: new 2D: new render temporaries with resources
This patch adds support for creating temporary surfaces to allow
rendering to surfaces that cannot be rendered to.
It uses the _second_ version of the render temporary infrastructure.

This is necessary for swizzled 3D textures and small mipmaps of
swizzled 2D textures.

This version of the patch creates a resource to use as a temporary
instead of a raw BO, making the code simpler.
2010-08-21 20:42:14 +02:00
Luca Barbieri
ff74143fcc nv30: new 2D: support ARB_texture_rectangle
This uses nv30's _RECT formats.
2010-08-21 20:42:14 +02:00
Luca Barbieri
4793f48a19 nvfx: new 2D: optimize fragtex format lookup
Use an array indexed by the pipe format instead of doing a linear scan.
2010-08-21 20:42:14 +02:00
Luca Barbieri
d983701267 nvfx: new 2D: enable swizzling for all surfaces
Now that the new 2D code is in place, swizzling can be safely enabled.

Render temporaries are needed in some cases, so this may degrade nv30
a bit until it gets render temporaries too.
2010-08-21 20:42:14 +02:00
Luca Barbieri
9ed0686e8e nvfx: new 2D: use new 2D engine in Gallium
This patch implements nv04_surface_copy/fill using the new 2D engine module.
It supports falling back to the 3D engine using the u_blitter module, which will be
added in a later patch.

Also adds support for using the 3D engine, reusing the u_blitter module
created for r300.
This is used for unswizzling and copies between swizzled surfaces.
2010-08-21 20:42:14 +02:00
Luca Barbieri
24a4ea003f nv04-nv40: new 2D: add new Gallium-independent 2D engine
This patch add a brand new nv04-nv40 2D engine module.
It should correctly implement all operations involving swizzled, and 3D-swizzled surfaces.

This code is independent from the Gallium framework and can thus be reused in the DDX and classic Mesa drivers (it's only likely to be useful in the latter, though).

Currently, surface_copy and surface_fill are broken for 3D textures, for swizzled source textures and possibly for some misaligned cases

The code is based around the new nv04_region structure, which encapsulates the information from pipe_surface needed for the 2D engine and CPU copies.
The use of nv04_region makes the code independent of the Gallium framework and allows to transform the nv04_region without clobbering the nv04_region.
The existing M2MF, blitter, and SWIZZLED_SURFACE paths have been improved and a new CPU path has been added.
There is also support to tell the caller to use the 3D engine.

The main feature of the copy/fill setup algorithm is linearization/contiguous-linearization of swizzled surfaces.
The idea of linearization is that some swizzled surfaces are laid out like linear ones (1xN, 2xN, Nx1) and can thus be used as such (e.g. useful for copying single pixels).
Also, some rectangles (e.g. the whole surface) are contiguous in memory. If both the source and destination rectangles are swizzled but contiguous, then they can be regarded as both linear: this is the idea of "contiguous linearization".
This, for instance, allows to use the 2D engine to duplicate the content of a swizzled surface to another swizzled surface, by pretending they are actually linear.
After linearization, the result may not be 64-byte aligned. Another transformation is done to enlarge the linear surface so that it becomes 64-byte aligned.
This is also used to 64-byte align swizzled texture mipmaps.

The inner loop of the CPU path is as optimized as possible without using SSE/SSE2.
Future improvements could include SSE/SSE2 support, and possibly a faster coordinate swizzling algorithm (which is however not used in the inner loop).
It may be a good idea to autogenerate swizzling code at least for all possible POT 2D texture dimensions  (less than 256), maybe for all 3D ones too (less than 4096).
Also, it woud be a very good idea to make a copy with the GPU first if the source surface is in uncached memory.
2010-08-21 20:42:14 +02:00
Luca Barbieri
23639dc046 nvfx: new 2D: rewrite transfer code to use staging transfers
This greatly simplifies the code, and avoids ad-hoc copy code.

Also, these new transfers work for buffers too, even though they
are still used for miptrees only.
2010-08-21 20:42:14 +02:00
Luca Barbieri
ed2930e7e2 nvfx: new 2D: rewrite miptree code, adapt transfers
Changes:
- Disable swizzling on non-RGBA 2D textures, since the current 2D
  code is mostly broken in those cases. A later patch will fix this.
  Thanks to Andrew Randrianasulu who reported this.
- Fix compressed texture transfers and hack around the current 2D
  code inability to copy compressed textures by using direct access.
  Thanks to Andrew Randrianasulu who reported this.

This patch rewrites all the miptree layout and transfer code in the
nvfx driver.

The current code is broken in several ways:
1. 3D textures are laid out first by face, then by level, which is
incorrect
2. Cube maps should have 128-byte aligned faces
3. Swizzled textures have a strange alignment test that seems
unnecessary
4. We store the image_offsets for each face/slice but they can be
easily computed instead
5. "Swizzling" is not supported for compressed formats. They can be
"swizzled" but swizzling only means that there are no gaps (pitch is
level-dependant) and the layout is still linear
6. Swizzling is not supported for non-RGBA formats. All formats (except
possibly depth) can be swizzled according to my testing.

The miptree layout is rewritten based on my empirical testing, which I
posted in the "miptree findings" mail.
The image_offset array is removed, since it can be calculated with a
simple multiplication; the only array in the miptree structure is now
the one for mipmap level starts, which it seems cannot be easily
computed in constant time.

Also, we now directly store a nouveau_bo instead of a pipe_buffer in
the miptree structure, like nv50 does.

Support for render temporaries is removed, and will be readded in a
later patch.

Note that the current temporary code is broken, because it does not
copy the temporary back on render cache flushes.
2010-08-21 20:42:14 +02:00
Luca Barbieri
ac97e8dba6 nvfx: add nouveau_resource_on_gpu
Add a function to get whether a resource is likely on the GPU or not.

Currently always returns TRUE.
2010-08-21 20:42:14 +02:00
Luca Barbieri
37fa0cf4ea nvfx: add linear flag for buffers 2010-08-21 20:42:14 +02:00
Luca Barbieri
6a73d99a52 nvfx: properly unreference bound objects on context destruction 2010-08-21 20:42:13 +02:00
Luca Barbieri
e189823eb4 nvfx: reference count bound objects 2010-08-21 20:42:13 +02:00
Luca Barbieri
95acfd0c8a nvfx: fix format support code for compressed texture
A source line was put in the wrong place.
2010-08-21 20:42:13 +02:00
Luca Barbieri
e6ff995d14 gallium/auxiliary: add semantic linkage utility code 2010-08-21 20:42:13 +02:00
Luca Barbieri
bed9dff9d9 u_debug_describe: use switch instead of if chain 2010-08-21 12:47:18 +02:00
Luca Barbieri
061c2a7cb3 u_debug_describe: add PIPE_TEXTURE_RECT 2010-08-21 12:45:39 +02:00
Luca Barbieri
fa32fde26c auxiliary: add copyright headers
Thanks to Jose Fonseca for pointing out they were missing.
2010-08-21 12:37:39 +02:00
José Fonseca
121aa3cfcb util: Match printf format to silence warning. 2010-08-21 10:38:22 +01:00
José Fonseca
a5888d3113 mesa: Remove unsused local variable. 2010-08-21 10:34:57 +01:00
José Fonseca
04c2a22175 util: Make the reference debuggin code more C++ friendly.
C++ doesn't accept function <-> void* conversions without a putting a
fight.
2010-08-21 10:34:42 +01:00
José Fonseca
7a40d15e6c util: Remove the x86 exception handlers.
Unused now that check_os_katmai_support was removed.
2010-08-21 10:07:12 +01:00
Alex Corscadden
ce3a07c392 trace: Don't immediately destroy the pipe's sampler view in the trace driver.
The trace driver's implementation of sampler_view_destroy was calling
directly into the underlying pipe's sampler_view_destroy implementation.
This causes problems for pipes that keep references to sampler views
even after the state tracker has released them.  Instead, we'll simply
drop the trace driver's reference to the pipe's sampler view.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-21 09:45:43 +01:00
Alex Corscadden
29dde59ea7 trace: Trace the correct version of the resource when setting the index buffer.
The trace driver was tracing the unwrapped version of the index buffer
when setting the index buffer.  This caused an assert validating that
a resource belonged to the trace driver to fail.  Instead, we'll log
the unmodified index buffer structure when setting the index buffer.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-21 09:44:12 +01:00
Vinson Lee
f7188ac9ce generate_builtins.py: Remove unused import sys. 2010-08-21 01:13:16 -07:00
Chia-I Wu
29cff9ce2e mapi: Use MAPI_EXPORT to export public functions.
mapi.h is included by vgapi and st/vega.  On win32, the macro expands to
dllexport and dllimport respectively.
2010-08-21 14:13:59 +08:00
Chia-I Wu
df98423f24 mapi: Prefix functions in u_current.h by u_current.
That is, replace the old _glapi_* names by new names that start with
u_current_.  When MAPI_GLAPI_CURRENT is defined, u_current.h defines
rename macros to restore the old names.  That is done for ABI
compatibility.
2010-08-21 14:13:59 +08:00
Chia-I Wu
760451baae glapi: Move public function/variable declarations to glapi.h.
glapi defines an interface that is used by DRI drivers.  It must not be
changed in an ABI incompatible way.  This commit moves all
functions/variables belong to the interface to glapi.h.  Instead of
including u_current.h from glapi.h, u_current.h now includes glapi.h.
2010-08-21 14:13:59 +08:00
richard
0eac4b8740 evergreen : initial support driver code. 2010-08-20 19:28:47 -04:00
Eric Anholt
501c9dc627 i965: Rename nr_depth_regs to nr_payload_regs.
Only 8 out of the up to 13 regs are for source/dest depth, so the name
wasn't particularly appropriate.  Note that this doesn't count the
constant or URB payload regs.  Also, don't pre-divide by 2, so it's
actually a number of registers.
2010-08-20 16:17:40 -07:00
Eric Anholt
e6ec500e19 i965: Also use the SIMD8 FB writes for SIMD8 mode on non-SNB. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
5266c0a0c8 i965: Add support for FB writes on Sandybridge. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
3ce2eccbfb i965: Set the destination horiz stride even for da16, as SNB seems to need it. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
35c127362f i965: Set the maximum number of threads on Sandybridge. 2010-08-20 16:17:40 -07:00
Zhenyu Wang
93ba0055c3 i965: Add AccWrCtl support on Sandybridge.
Whenever the accumulator results are needed, this bit must be set.
2010-08-20 16:17:39 -07:00
Zhenyu Wang
ffb5095d56 i965: Mention the mlen and rlen for URB reads. 2010-08-20 16:17:39 -07:00
Zhenyu Wang
da1502494b i965: Sandybridge doesn't have Compr4 mode, since it's not needed any more. 2010-08-20 16:17:39 -07:00
Zhenyu Wang
0e2d0cc577 i965: Adjust disasm of subreg numbers to be in units of the register type.
This makes reading the code easier when matching up to the specs,
which also use this format.
2010-08-20 16:17:39 -07:00
Eric Anholt
b7004350fa i965: Fix DP write channel ordering on Sandybridge.
The SIMD16 message no longer has the goofy interleaved format that
made Compr4 compression necessary before.
2010-08-20 16:17:39 -07:00
Luca Barbieri
132b9439e2 os_stream: fix bugs in allocation path 2010-08-21 00:51:29 +02:00
Luca Barbieri
9960200d5e p_compiler: add replacement va_copy
This might technically not always be correct, because va_copy might
be a function, or a system might not have va_copy, and not work with
assignment.

Hopefully this is never the case.
Without configure tests, it doesn't seem possible to do better.
2010-08-21 00:51:29 +02:00
Kenneth Graunke
7f80041efa Delete more vestiges of the old shader compiler. 2010-08-20 13:06:02 -07:00
Kenneth Graunke
d6cc7191da glsl: Remove bogus "ambient" field from vec4 gl_TextureEnvColor. 2010-08-20 13:01:12 -07:00
Luca Barbieri
c3e3793c32 glsl: add missing ambient field to gl_LightModel
Again, this is a one-element struct that was incorrectly missing the
field.
2010-08-20 13:01:09 -07:00
Luca Barbieri
fc76d72763 glsl: don't crash if a field is specified for a non-struct uniform
This was triggered by the previous bug, but is a separate problem
in the general sense.
2010-08-20 13:01:07 -07:00
Luca Barbieri
c108a7927d glsl: add missing sceneColor field to gl_{Front, Back}LightModelProduct
According to both GLSL 1.20 and 4.0, these are a struct with one field
called "sceneColor".

Fixes a crash on loading in FlightGear.
2010-08-20 13:01:04 -07:00
Eric Anholt
27e6552a8f intel: Don't try to do work for BufferSubData with a size of 0.
If we hit the linear blit path, we'd come up with a pitch of 0, then
divide by zero.

Fixes vbo-subdata-zero, made for bug #28931 (warsow).
2010-08-20 12:36:34 -07:00
Nick Bowler
5482eaba6e mesa: Fix GetUniformLocation while compiling display lists.
This function was apparently missing from the display list dispatch
table, causing the generic no-op function to be called instead.  To make
matters worse, the no-op function is indistinguishable from a successful
call to GetUniformLocation.  GL specifies that GetUniformLocation is
executed immediately when compiling display lists.

Fixes fdo bug 29622.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
2010-08-20 10:55:50 -07:00
Eric Anholt
284ce20901 Remove remnants of the old glsl compiler. 2010-08-20 10:55:42 -07:00
Jerome Glisse
a4b10a5614 r600g: add POW instruction
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 18:54:26 +02:00
Jerome Glisse
921c987c6f r600g: cleanup definition, fix segfault when no valid pixel shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 18:54:26 +02:00
Michal Krol
a43a2f0662 util: Fix build for C++ compilers. 2010-08-20 18:51:22 +02:00
Luca Barbieri
c806a40277 gallium: hook up reference count debugging code
This commit adds the ability to produce a log file containing all
reference count changes, and object creation/destruction, on Gallium
objects.

The data allows to answer these crucial questions:
1. This app is exhausting all my memory due to a resource leak: where
   is the bug?
2. Which resources is this app using at a given moment? Which parts of
   the code created them?
3. What kinds of resources does this app use?
4. How fast does this app create and destroy resources? Which parts of
   the code create resources fast?

The output is compatible with the one produced by the similar facility
in Mozilla Firefox, allowing to use Mozilla's tools to analyze the data.

To get the log file:
export GALLIUM_REFCNT_LOG=<file>

To get function names and source lines in the log file:
tools/addr2line.sh <file>

To process the log file, see:
http://www.mozilla.org/performance/refcnt-balancer.html
2010-08-20 18:18:28 +02:00
Luca Barbieri
2ff13fe89e auxiliary: add reference count debugging code 2010-08-20 18:18:28 +02:00
Luca Barbieri
b1fa352db8 os_stream: add printf facility 2010-08-20 18:18:28 +02:00
Luca Barbieri
40eef4c20c u_debug_symbol: add symbol name caching
Without this, any form of logging that dumps stack traces continuously
will spend a lot of time resolving symbol names.
2010-08-20 18:18:28 +02:00
Luca Barbieri
b3e57fc868 u_debug_symbol: add support for getting symbol names from glibc 2010-08-20 18:18:28 +02:00
Luca Barbieri
64c4f9c566 u_debug_symbol: support getting a string without output 2010-08-20 18:18:28 +02:00
Luca Barbieri
d46f91af68 auxiliary: add functions to describe gallium objects 2010-08-20 18:18:28 +02:00
Dave Airlie
63d010115c r600g: add occlusion query support
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 16:43:44 +02:00
Luca Barbieri
3aaec4750d u_staging: improve interface 2010-08-20 16:38:32 +02:00
Luca Barbieri
c843a60e63 gallium/docs: improve documentation for resources 2010-08-20 15:24:36 +02:00
Chia-I Wu
cfc0081740 mesa: Add missing ES sources to SConscript.
These sources compile to nothing when FEATURE_ES is not defined and thus
were overlooked.  Note that api_exec_es[12].c are still missing on the
list.  They should be added when they can be generated on the fly.
2010-08-20 19:26:43 +08:00
Chia-I Wu
ae2ace64f4 mesa: Decorate functions with GL_APIENTRY in es_generator.py.
Note that GLES headers use GL_APIENTRY, not GLAPIENTRY.
2010-08-20 19:26:18 +08:00
Chia-I Wu
8043bf555e mesa: Include compiler.h for ASSERT.
mfeatures.h defines ASSERT_NO_FEATURE to ASSERT, which is defined in
compiler.h.  Header files using the macro should include compiler.h.
2010-08-20 19:22:51 +08:00
Chia-I Wu
5004f823ad targets/egl-gdi: Implement guess_gl_api.
It is needed to support calling eglGetProcAddress before eglInitialize.
2010-08-20 19:22:51 +08:00
Chia-I Wu
5eb33596a0 egl: Fix context API check and be verbose.
The API of the context was not checked against EGL_RENDERABLE_TYPE when there
was no attribute list.  Move the check to _eglInitContext, and be verbose about
common mistakes (EGL_RENDERABLE_TYPE not set, EGL_CONTEXT_CLIENT_VERSION not
set, or eglBindAPI not called).
2010-08-20 19:22:51 +08:00
Chia-I Wu
ce2cae4130 egl: Add egl.def for win32 build.
Without the .def file, function names are decorated and cannot be
queried by GetProcAddress easily.
2010-08-20 19:22:50 +08:00
Chia-I Wu
f508c0c097 egl: Allow core functions to be queried.
When _EGL_GET_CORE_ADDRESSES is defined, eglGetProcAddress can be used to query
core functions.  This is non-standard, but some apps expect it.
2010-08-20 19:22:35 +08:00
Keith Whitwell
4df17f9dfe st/mesa: fix code/declaration mixing 2010-08-20 11:52:01 +01:00
Luca Barbieri
7344e6d9b5 galahad: remove incorrect comment just added 2010-08-20 12:07:14 +02:00
Luca Barbieri
09bf09cf92 nv50: use NV50TIC_0_2_TARGET_RECT 2010-08-20 12:04:10 +02:00
Luca Barbieri
ccd0864357 galahad: check resource_create template 2010-08-20 12:04:10 +02:00
Luca Barbieri
7f15dca6d9 mesa/st: use PIPE_TEXTURE_RECT for GL_TEXTURE_RECTANGLE 2010-08-20 12:04:09 +02:00
Luca Barbieri
96a82cc314 winsys/sw: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:08 +02:00
Luca Barbieri
d34f6e9db1 st/glx: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:07 +02:00
Luca Barbieri
4a5acc0ec7 st/dri: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:06 +02:00
Luca Barbieri
d4ec85e624 auxiliary: support using PIPE_TEXTURE_RECT internally
Currently Gallium internals always use PIPE_TEXTURE_2D and normalized
coordinates to access textures.

However, PIPE_TEXTURE_2D is not always supported for NPOT textures,
and PIPE_TEXTURE_RECT requires unnormalized coordinates.

Hence, this change adds support for both kinds of normalization.
2010-08-20 12:04:05 +02:00
Luca Barbieri
3070e0ea41 mesa/st: support using PIPE_TEXTURE_RECT internally
Currently Gallium internals always use PIPE_TEXTURE_2D and normalized
coordinates to access textures.

However, PIPE_TEXTURE_2D is not always supported for NPOT textures,
and PIPE_TEXTURE_RECT requires unnormalized coordinates.

Hence, this change adds support for both kinds of normalization.
2010-08-20 12:04:03 +02:00
Luca Barbieri
4a9bfb24eb u_staging: use PIPE_TEXTURE_RECT 2010-08-20 12:04:02 +02:00
Luca Barbieri
cbe3672279 u_blitter: use TGSI_TEXTURE_RECT
This seems to make sense, although I suspect the semantics of
TGSI_TEXTURE_RECT need to be closely reviewed.
2010-08-20 12:04:01 +02:00
Luca Barbieri
ae0ef6f69f gallium: make all checks for PIPE_TEXTURE_2D check for PIPE_TEXTURE_RECT too
Searched for them with:
git grep -E '[!=]=.*PIPE_TEXTURE_2D|PIPE_TEXTURE_2D.*[!=]=|case.*PIPE_TEXTURE_2D'

Behavior hasn't been changed.
2010-08-20 12:04:00 +02:00
Luca Barbieri
72b3e3fee3 gallium: add PIPE_TEXTURE_RECT target
This allows to properly support OpenGL rectangle textures in a well
defined way, especially on drivers that don't expose
PIPE_CAP_NPOT_TEXTURES.
2010-08-20 12:03:59 +02:00
Kenneth Graunke
9b3362932d i965: Fix compile warnings on 64-bit Linux.
format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’
2010-08-20 02:46:05 -07:00
Kenneth Graunke
edd180f032 ast_to_hir: Reject function names that start with "gl_".
Fixes piglit test redeclaration-03.vert.
2010-08-20 02:46:05 -07:00
Kenneth Graunke
826a39cb14 ast_to_hir: Fix crash when a function shadows a variable.
The code would attempt to add a new signature to the ir_function, which
didn't exist.  Simply bailing out/returning early seems reasonable.

Fixes piglit test redeclaration-02.vert, and fixes a crash in
redeclaration-03.vert (the test still fails).
2010-08-20 02:46:05 -07:00
Corbin Simpson
e0ef4800f5 galahad, i915g: Copy over constant buffer index check. 2010-08-20 00:18:30 -07:00
Corbin Simpson
cdc1c67b98 galahad, i915g: Move over a few state asserts. 2010-08-20 00:00:40 -07:00
Corbin Simpson
11fde173c2 galahad: Make it obvious on stderr that Galahad's active. 2010-08-19 23:34:39 -07:00
Jakob Bornecrantz
d377abd93f gallium/docs: Add Galahad 2010-08-20 02:29:42 +01:00
Vinson Lee
9b7480cd95 configs: Add -lstdc++ to default.
This fixes the following error when trying to run glxinfo or glxgears
with swrast.

undefined symbol: __cxa_pure_virtual
2010-08-19 18:09:24 -07:00
Vinson Lee
48dca27e33 mesa: Silence uninitialized variable warnings in dummy_enum_func. 2010-08-19 17:07:28 -07:00
Luca Barbieri
d3fe699b0b translate_sse: enable on Win64
According to Vinson, enabling it causes no regressions
2010-08-20 00:09:37 +02:00
Marek Olšák
a9b20d4597 u_blitter: fix a memory leak 2010-08-19 23:32:04 +02:00
Marek Olšák
06991d87be r300g: do not use fastfill with 16-bit zbuffers
To my knowledge, there is no way to flush zmask and thus write the clear
value.

This fixes zbuffer reads, among other things.
2010-08-19 23:30:26 +02:00
Alex Deucher
076c53879b r600g: update comments about ALU src operands 2010-08-19 12:06:20 -04:00
Luca Barbieri
c54dea66fd translate_sse: try to fix Win64
Not sure whether it works now (it is still disabled).
2010-08-19 10:08:57 +02:00
Luca Barbieri
18f207310b translate_sse: fix emit_load_sse2 2010-08-19 10:04:07 +02:00
Vinson Lee
11726c4e86 i915: Remove unnecessary header from i830_context.c. 2010-08-19 00:29:59 -07:00
Chia-I Wu
ce29e86458 st/egl: Fix win32 build.
Add new source files to SConscripts.
2010-08-19 14:07:29 +08:00
Dave Airlie
88f5976484 r600g: add sin/cos
This pretty much ports the code from r600c, however it doesn't
always seem to work quite perfectly, but I can't find anything in this
code that is wrong. I'm guessing either literal input or constants
aren't working always.
2010-08-19 15:36:55 +10:00
Dave Airlie
098064e8cb r600g: add a chiprev type for r600/r700/evergreen instead of using family 2010-08-19 15:36:54 +10:00
Dave Airlie
0d48925a56 r600g: add SSG, SEQ, SGT and SNE 2010-08-19 15:36:54 +10:00
Eric Anholt
8de8c97275 i965: Set the if stack pop count when breaking out of a loop inside an if.
Otherwise, we might end up with the if stack pointing at the wrong
place.  Fixes GPU hang with glsl-vs-if-loop.
2010-08-18 21:31:56 -07:00
Eric Anholt
bad29dc6da i965: Don't set the swizzle on an immediate value in the VS.
Fixes glsl-vs-if-nested (70.0 is not <= 70.000648 thanks to the
swizzle bits getting set).  Some safety checks are added to make sure
this doesn't happen again as we increase the usage of immediate values
in program generation.
2010-08-18 21:31:56 -07:00
Eric Anholt
af2ef53a27 mesa: Fix the whining for link failures to actually be under MESA_GLSL=dump. 2010-08-18 21:31:56 -07:00
Kenneth Graunke
365ce61997 glsl: Replace sscanf in s_expression reader with strspn and strcspn.
This seems to give roughly a 20% speedup.
2010-08-18 21:33:18 -07:00
Vinson Lee
a575067d70 mesa: Remove unnecessary heaaders from shaderapi.c. 2010-08-18 18:49:32 -07:00
Eric Anholt
f5703a54e2 mesa: Don't try to free components of a NULL uniform list.
This might happen if we manage to trigger the right linker errors.
2010-08-18 17:45:08 -07:00
Eric Anholt
f1d5a94197 glsl: Also strdup the names of uniform list entries for >vec4 types.
Fixes double-free since the fix to free all of the uniform list.
2010-08-18 17:45:08 -07:00
Kenneth Graunke
bd7853768d glcpp: Refresh autogenerated lexer. 2010-08-18 17:38:47 -07:00
Kenneth Graunke
9cf62bdfeb glcpp: Add basic #line support (adapted from the main compiler). 2010-08-18 17:38:47 -07:00
Eric Anholt
49dfa89873 ir_to_mesa: Fix leak by improper freeing of a uniform list. 2010-08-18 17:12:18 -07:00
Eric Anholt
b83846475b glsl2: Free the shader compiler at dri screen destruction.
Hooray, we can valgrind again without adding suppressions.  This also
adds an interface for use by an implementation of
glReleaseShaderCompiler().
2010-08-18 17:10:48 -07:00
Eric Anholt
3cd233eb57 ir_to_mesa: Don't leak the whole linked assembly program. 2010-08-18 16:29:02 -07:00
Eric Anholt
a482e03308 dri2: Clean up the common dri2 options at screen destroy. 2010-08-18 16:18:38 -07:00
Eric Anholt
4532feba14 glsl: Fix leak-causing typo in destructor that made it another constructor. 2010-08-18 16:18:38 -07:00
Vinson Lee
352e62c3c2 glsl: Fix uninitialized member in ir_hierarchical_vistor constructor.
Class member base_ir was not initialized by the default constructor.
2010-08-18 16:10:15 -07:00
Vinson Lee
e1c7f3af0c mesa: fpclassify is available on OpenSolaris.
There is no explicit predefined macro to distinguish between OpenSolaris
and Solaris. This patch assumes that the difference is in the compilers.
OpenSolaris uses GCC and not the Sun Studio compiler. Assume that the
availability of fpclassify is due to GCC.

This patch was not tested on Solaris. It would break the build on
Solaris with GCC if GCC on Solaris does not have fpclassify.
2010-08-18 14:36:08 -07:00
Eric Anholt
3ef83d270b ir_to_mesa: Fix leak of set_branchtargets temp data. 2010-08-18 14:16:07 -07:00
Eric Anholt
e271384219 glsl: Garbage collect old prototype for ir_to_mesa. 2010-08-18 14:16:07 -07:00
Eric Anholt
850c659044 ir_to_mesa: Stop leaking the ir_instruction * annotation of our compile. 2010-08-18 14:16:07 -07:00
Eric Anholt
56a0690a81 mesa: Free linked shaders when deleting the shader program. 2010-08-18 14:16:07 -07:00
Eric Anholt
5d0f430e8e mesa: Free old linked shaders when relinking new shaders. 2010-08-18 14:16:07 -07:00
Eric Anholt
0b09e6410f glsl2: Fix copy'n'paste hilarity leading to leaking in the refcount visitor. 2010-08-18 14:16:07 -07:00
Eric Anholt
abc6d7e0b4 ir_to_mesa: Free the ir_to_mesa temporary storage when we're done. 2010-08-18 14:16:07 -07:00
Eric Anholt
4a6a431684 mesa: Hang the compiled shader off the shader->ir, not the shader.
Otherwise, with repeated program recompile, we never free the results
of the previous compile.
2010-08-18 14:16:07 -07:00
Eric Anholt
0df61bdb66 mesa: Make MESA_GLSL=dump include when compile/link fails, and the info log. 2010-08-18 14:16:06 -07:00
Kenneth Graunke
665d75cc5a glsl: Fix scoping bug in if statements.
Fixes glslparsertest/glsl2/scoping-01.frag (successfully compiled but
should've failed) and scoping-02.frag (assertion triggered).
2010-08-18 14:03:25 -07:00
Kenneth Graunke
cf37ba3430 glsl: Refresh autogenerated file builtin_function.cpp. 2010-08-18 13:20:58 -07:00
Kenneth Graunke
011be6b594 generate_builtins.py: Clean up generated output a bit.
This should make it easier to diff the output, clean up some of the
insane whitespace, and make the strings a bit smaller.

We'll probably need to split up the prototype strings eventually, but
for now, this gets it under the 65K mark.
2010-08-18 13:20:41 -07:00
Kenneth Graunke
08a84c6a4a glsl/builtins: Add forgotten hyperbolic trig builtins in 1.30 profiles. 2010-08-18 13:16:50 -07:00
Kenneth Graunke
d12cb77d85 ir_constant_expression: Implement equal/notEqual for booleans.
Calls to equal(bvec, bvec) or notEqual(bvec, bvec) previously caused an
assertion.  Fixes piglit tests glsl-const-builtin-equal-bool and
glsl-const-builtin-notEqual-bool.
2010-08-18 12:08:19 -07:00
Andre Maasikas
d442a01ac1 r600: implement SSG instruction 2010-08-18 14:27:43 +03:00
michal
8690c6a6b4 gallivm: Use proper index to lookup predicate register array.
Doesn't fix anything, as those indices were both always 0.
2010-08-18 13:16:42 +02:00
Andre Maasikas
c17d5de593 r600: implement DP2 opcode 2010-08-18 11:57:28 +03:00
Kenneth Graunke
a57b1e579d glsl2: Regenerate builtin_function.cpp. 2010-08-17 23:50:40 -07:00
Kenneth Graunke
f70ce12529 glsl2: Fix cut and paste error in EXT_texture_array builtins.
Fixes fd.o bug #29629.
2010-08-17 23:50:15 -07:00
Carl Worth
9751b4ec60 glcpp: Refresh generated files.
After a recent change to glcpp-parse.y (adding "redefined macro" error).
2010-08-17 23:41:53 -07:00
Carl Worth
3882cf2169 glcpp: Add support for "redefined macro" error.
Carefully avoiding printing any error when the new definition matches
the existing definition.

This fixes the recently-added 088-redefine-macro-legitimate.c and
089-redefine-macro-error.c tests as well as glsparsertest/preprocess1
in piglit.
2010-08-17 23:41:53 -07:00
Carl Worth
105e2137d6 glcpp: Add two new tests for testing redefined macros.
The specification says that redefining a macro is an error, unless the
new definitions is identical to the old one, (identical replacement
lists but ignoring differing amounts of whitespace).
2010-08-17 23:41:53 -07:00
Carl Worth
97638aa77c glcpp: Allow standalone glcpp to accept a filename as first argument.
This is useful for debugging the preprocessor.
2010-08-17 23:41:53 -07:00
Dave Airlie
3af87162cd r600g: add FRC, FLR, DDX and DDY
the first two are straight op2's and the DDX/DDY are taken from r600c.
2010-08-18 16:10:16 +10:00
Dave Airlie
be288c3505 r600g: add SGE and SLE opcodes
fixes fp-set-01 and glsl-fs-step
2010-08-18 16:03:49 +10:00
Dave Airlie
d01c0025e8 r600g: add TXB support
fixes biased texturing tests
2010-08-18 15:42:03 +10:00
Dave Airlie
b777db3254 r600g: fix TXP vs TEX in shader.
Don't do perspective for TEX, and also copy input to a temporary for TEX

also add tex opcode names
2010-08-18 15:42:02 +10:00
Carl Worth
ce5d0a296c glcpp: Fix 064-version.c expected result to track recent change.
In commit 6be3a8b70a, the #version directive
was fixed to stop generating a spurious newline. Here we simply update
the expected result for the single test which includes a #version directive.
2010-08-17 22:23:43 -07:00
Carl Worth
b9892f22d1 glcpp: Regenerated glcpp-lex.c from previous commit.
The previous commit changed glcpp-lex.l so we commit the resulting
generated file here.
2010-08-17 22:22:13 -07:00
Carl Worth
eb26f0d5b6 glcpp: Don't include the newline when discarding single-line comments
Matching the newline here meant having to do some redundant work here,
(incrementing line number, resetting column number, and returning a
NEWLINE token), that could otherwise simply be left to the existing rule
which matches a newline.

Worse, when the comment rule matches the newline as well, the parser
can lookahead and see a token for something that should actually be skipped.

For example, in a case like this:

	#if 0 // comment here
	fail
	#else
	win
	#endif

Both fail and win appear in the output, (not that the condition is being
evaluated incorrectly---merely that one token after the comment's newline
was being lexed/parse regardless of the condition).

This commit fixes the above test case, (which is also remarkably similar
to 087-if-comments which now passes).
2010-08-17 22:17:09 -07:00
Dave Airlie
4558b63455 r600g: add two simple tgsi opcodes.
makes glsl-fs-log2 and glsl1-integer division with uniform var pass
2010-08-18 13:48:04 +10:00
Dave Airlie
1147814365 r600g: fix point size
fixes piglit pointAtten and point-sprite tests
2010-08-18 13:30:34 +10:00
Eric Anholt
35220fc598 ir_to_mesa: Allow ir_return in main().
I didn't expect that this would really work, but it turns out there
are shaders in the wild that do it.

Fixes: (with swrast)
glsl-fs-main-return
glsl-vs-main-return
2010-08-17 19:55:14 -07:00
Eric Anholt
1cdef8e90a i965: Throw a link error when we see a "return" in main().
We'll need to use the HALT instruction to do this right, like returns
from other functions.
2010-08-17 19:55:14 -07:00
Dave Airlie
03c59e4ab1 r600g: fixup pitch alignment like r600c.
This still needs work, passes tex3d, fbo-scissor-bitmap, scissor-bitmap
2010-08-18 12:49:59 +10:00
Luca Barbieri
547e88e70d translate_sse: don't overwrite source buffer pointer
We were putting the source pointer in a register used as a temporary,
breaking all paths that don't read the data in a single instruction.
2010-08-18 04:21:46 +02:00
Eric Anholt
ede67e3071 glcpp: Add testcase for #if handling bug that breaks Savage2. 2010-08-17 17:51:10 -07:00
Dave Airlie
edb465e9bb r600g: fix height calcs for miptree
h needs to be rounded up, this probably needs revisiting when we get
to tiling etc.

fixes fbo-generatemipmap-npot
2010-08-18 10:50:19 +10:00
Dave Airlie
1d18739290 r600g: emit texture level offset in CB/DB setup.
8 more piglit tests pass,
fbo-clearmipmap, fbo-copyteximage, fbo-generatemipmap,
fbo-generatemipmap-nonsquare, fbo-generatemipmap-scissor,
fbo-generatemipmap-viewport, gen-teximage, gen-texsubimage
2010-08-18 10:35:09 +10:00
Eric Anholt
6992c3c373 ir_to_mesa: Fix implementation of ir_binop_equal, ir_binop_notequal.
These binops are the vector-to-bool comparisons, not vec-to-bvec.  We
likely want both operations avilable as expression, since 915 and 965
FS naturally does the vector version, while 965 VS can also naturally
do the scalar version.  However, we can save that until later.

Fixes:
glsl-fs-vec4-operator-equal.shader_test
glsl-fs-vec4-operator-notequal.shader_test
glsl-vs-vec4-operator-equal.shader_test
glsl-vs-vec4-operator-notequal.shader_test
2010-08-17 17:27:44 -07:00
Eric Anholt
02e1639829 i915: Add support for SSG opcode.
Fixes glsl-fs-sign and many of the tests of trig builtins.
2010-08-17 16:39:18 -07:00
Eric Anholt
e43b250fc0 i915: Add support for reading output regs in the FS.
Fixes glsl-unused-varying and many others, since we produce an output
reg read any time gl_FragColor is written inside an if statement.
2010-08-17 16:39:18 -07:00
Eric Anholt
66690864ef i915: Add support for OPCODE_DP2.
Fixes glsl-fs-dot-vec2.
2010-08-17 16:39:17 -07:00
Eric Anholt
a58514cc9c i915: Enable ARB_fragment_shader by default.
Now that we have glsl2 with if flattening in place, most shaders will
just work.  Remaining failing shaders will mostly be due to loop
unrolling (in progress), some possible if flattening failures in
inlining functions (planning on fixing), and the register/instruction
count limits.

While the GLSL and GLSL-ES specs say that shaders shouldn't fail to
compile/link due to register/instruction limits, in practice we're not
the first vendor to expose GLSL on hardware with these limitations.
The benefit to application developers of providing a better language
for GPU programming is greater than the pain of having to handle
instruction limits (which they had to for ARB_fp on this hardware
anyway)
2010-08-17 16:39:17 -07:00
Ian Romanick
bdc0e5285a glsl2: Fix transpose of rows and cols
This error led to an assertion failure for some constructors of
non-square matrices.  It only occured in matrices where the number of
columns was greater than the number of rows.  It didn't even always
occur on those.

Fixes piglit glslparsertest case constructor-16.vert.
2010-08-17 16:06:30 -07:00
Henri Verbeet
8f5f44c9c8 r600c: Handle reads from PROGRAM_OUTPUT
with glsl2, reads from outputs are legal
2010-08-17 18:25:32 -04:00
Ian Romanick
40e114b5dc linker: Demote user-defined varyings in the VS-only case
Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.
2010-08-17 14:57:18 -07:00
Benjamin Segovia
5a38e70d59 prog_optimize: Only merge writes to temporary registers
In one optimization pass, register files may have been messed therefore
merging instructions which use the same index in two different register
files.
2010-08-17 14:57:18 -07:00
Jerome Glisse
608f749ec3 r600g: fix fake pixel output
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-17 17:25:08 -04:00
Eric Anholt
147ca9f3fc i965: Add support for DP2 in the VS.
Fixes glsl-vs-dot-vec2.
2010-08-17 13:59:08 -07:00
Eric Anholt
0e6066df63 glsl: When doing algebraic simplification, make sure the type still matches.
When simplifying (vec4(1.0) / (float(x))) to rcp(float(x)), we forgot
to produce a vec4, angering ir_validate when starting alien-arena.

Fixes:
glsl-algebraic-add-zero-2
glsl-algebraic-div-one-2
glsl-algebraic-mul-one-2
glsl-algebraic-sub-zero-3
glsl-algebraic-rcp-sqrt-2
2010-08-17 13:50:45 -07:00
Eric Anholt
f166d94fac glsl: Make ir_algebraic new expressions allocate out of the parent.
This could reduce the amount of memory used by a shader tree after
optimization, and increases consistency with other passes.
2010-08-17 13:47:15 -07:00
Ian Romanick
664364052f ir_constant: Don't assert on out-of-bounds array accesses
Several optimization paths, including constant folding, can lead to
accessing an ir_constant array with an out of bounds index.  The GLSL
spec lets us produce "undefined" results, but it does not let us
crash.

Fixes piglit test case glsl-array-bounds-01 and glsl-array-bounds-03.
2010-08-17 13:00:03 -07:00
Eric Anholt
1b708d8f4d mesa: Dump shader source before validating the shader.
This will make extracting source to produce minimal testcases for
shader compile issues easier.
2010-08-17 12:39:03 -07:00
Alex Deucher
6cee1d6adf r600c: fix dword miscount in blit emit code 2010-08-17 10:42:06 -04:00
Chia-I Wu
7f36b2980b targets/egl: Link with DRI_LIB_DEPS.
Use DRI_LIB_DEPS when linking GL/GLES state trackers.  This fixes
missing talloc symbol errors, and is hopefully more future proof.
2010-08-17 19:30:41 +08:00
nobled
37e5f78422 gallivm: Fix and re-enable MMX-disabling code
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-17 12:25:10 +01:00
Dave Airlie
0aa41e1d96 mesa: fix es1/2 build hopefully
needed to add cpp rules and includes properly for es1/es2
2010-08-17 20:54:45 +10:00
Dave Airlie
1c2a44e445 r300g: fix context destroy under hyperz
we were destroying the mm before unrefing all the objects, so segfault.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 19:01:18 +10:00
Vinson Lee
462e8a8b0d scons: Add -fno-common for 64-bit builds on Mac OS X.
This option is also needed for 64-bit builds if llvm is enabled.
Other the build fails during linking.
2010-08-17 00:20:58 -07:00
Dave Airlie
6043ee6e62 r600g: kill event type magic number in winsys
these events have names, use them.
2010-08-17 16:07:48 +10:00
Vinson Lee
279aeebff5 configs: Add -ltalloc to linux-dri.
Fixes build after glsl2 branch merge, which added talloc dependency.
2010-08-16 22:42:29 -07:00
Dave Airlie
3e58007892 r600g: add user clip plane support.
Apart from the fact that the radeon.h/r600_states.h editing is a nightmare, this
wasn't so bad.

passes piglit user-clip test now also trivial tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:19:09 +10:00
Eric Anholt
00ce188eb8 i965: Use the implied move available in most brw_wm_emit brw_math() calls.
This saves an extra message reg move in the program, though I'm not
clear on whether it will have any performance impact other than cache
footprint.  It will also fix those math calls on Sandybridge, where
the brw_eu_emit.c brw_math() support relies on the implied move being
used.
2010-08-16 20:09:53 -07:00
Eric Anholt
62383ae6fe i965: Add disasm for Compr4 instruction compression. 2010-08-16 20:06:55 -07:00
Ian Romanick
6c03c576cc Merge branch 'glsl2'
Conflicts:
	src/mesa/program/prog_optimize.c
2010-08-16 19:08:53 -07:00
Vinson Lee
15a3b42e13 util: Remove check_os_katmai_support.
check_os_katmai_support checks that the operating system running on a
SSE-capable processor supports SSE. This is necessary for unpatched
2.2.x and earlier kernels. 2.4.x and later kernels support SSE.

check_os_katmai_support will disable SSE capabilities for 32-bit x86
operating systems for which there is no code path. Currently, this
function handles Linux, Windows, and several BSDs. Mac OS, Cygwin, and
Solaris are several operating systems with no code paths.

Rather than add code for the unhandled operating systems, remove this
function altogether. This will fix SSE detection on all recent 32-bit
x86 operating systems. This completely breaks functionality on unpatched
2.2.x and earlier kernels, although there are likely no Gallium3D users
on such operating systems.
2010-08-16 18:52:37 -07:00
Dave Airlie
f50df65fcc r600g: drop libdrm_radeon link 2010-08-17 10:56:58 +10:00
Kenneth Graunke
a433cd286c glsl2: Refresh autogenerated file builtin_function.cpp. 2010-08-16 15:18:44 -07:00
Kenneth Graunke
2f9ecc818d glsl2: Add builtins profile for GLSL 1.30.
Many functions are currently wrapped with #if 0 since we haven't
implemented them yet.
2010-08-16 15:18:44 -07:00
Ian Romanick
45d97dd6d5 linker: Include compiler.h to avoid spurious warnings about INLINE 2010-08-16 13:59:34 -07:00
Ian Romanick
d0a9cbd20e glsl2: Silence unused variable warning 2010-08-16 13:59:01 -07:00
Vinson Lee
f437ee85f4 translate: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-08-16 13:52:57 -07:00
Kenneth Graunke
2e26145862 glcpp: Refresh autogenerated lexer and parser. 2010-08-16 13:43:43 -07:00
Kenneth Graunke
6be3a8b70a glcpp: Remove spurious newline generated by #version handling.
This was causing line numbering to be off by one.  The newline comes
from the NEWLINE token at the end of the line; there's no need to
insert one.
2010-08-16 13:43:35 -07:00
Marek Olšák
ecec6df9cf r300g: fix assert in the rasterizer block for r3xx-r4xx
Reported-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2010-08-16 19:19:17 +02:00
Ian Romanick
fc63e37b97 ir_to_mesa: Silence unused variable warnings 2010-08-16 09:45:01 -07:00
Ian Romanick
68772031e6 ir_to_mesa: Clean up assertions in ir_to_mesa_visitor::visit(ir_texture *) 2010-08-16 09:43:00 -07:00
Ian Romanick
0bf63733e5 ir_to_mesa: Support texture rectangle targets 2010-08-16 09:39:58 -07:00
José Fonseca
b421cb9546 translate: Remove unused temporary register.
Assuming the side-effect of x86_make_reg is also unnecessary.
2010-08-16 17:21:14 +01:00
José Fonseca
ded92e5dd8 translate: Eliminate void pointer arithmetic.
Non-portable.
2010-08-16 17:21:14 +01:00
Chia-I Wu
f945cb6515 st/egl: Add support for EGL_KHR_fence_sync.
The extension is implemented by pipe_fence_handle.
2010-08-17 00:06:19 +08:00
Chia-I Wu
2b2c5c4f5c egl: Add support for EGL_KHR_fence_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Chia-I Wu
4b2495661f st/egl: Add support for EGL_KHR_reusable_sync.
The extension is implemented by pipe_condvar.
2010-08-17 00:06:19 +08:00
Chia-I Wu
4eebea74a8 egl: Add support for EGL_KHR_reusable_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Chia-I Wu
b2a575ff28 egl: Update eglext.h.
Update to version 7 for EGL_KHR_fence_sync.
2010-08-17 00:06:18 +08:00
Alex Deucher
5ff769b21d r600c: blit emit updates
- set VGT_MAX_VTX_INDX to a larger value
- emit PA_SC_AA_CONFIG.  The command checker in 2.6.36+
  requires this reg.
2010-08-16 11:34:17 -04:00
Luca Barbieri
f201217c1d draw_llvm: fix segfaults on non-SSE2 CPUs where it is disabled (v2)
Changes in v2:
- Change function name

Currently draw_llvm refuses to create itself on non-SSE2 CPUs due to
an alleged LLVM bug.

However, this is implemented improperly, because other parts of draw
still attempt to access draw->llvm, resulting in segfaults.

Instead, put the check in debug_get_option_draw_use_llvm, check that
before calling draw_llvm_create, and then check whether draw->llvm is
non-null everywhere else.
2010-08-16 17:13:17 +02:00
Luca Barbieri
c2da8e7702 translate_sse: major rewrite (v5)
NOTE: Win64 is untested, and is thus currently disabled.
If you have such a system, please enable it and report whether it works.
To enable it, change src/gallium/auxiliary/translate/translate.c

Changes in v5:
- On Win64, preserve %xmm6 and %xmm7 as required by the ABI
- Use _WIN64 instead of WIN64

Changes in v4:
- Use x86_target() and x86_target_caps()
- Enable translate_sse in x86-64, but not in Win64

Changes in v3:
- Win64 support (untested)
- Use u_cpu_detect.h constants instead of #ifs

Changes in v2:
- Minimize #ifs
- Give a name to magic number CHANNELS_0001
- Add support for CPUs without SSE (only memcpy and swizzles, like non SSE2)
- Fixed comments

translate_sse is currently very limited to the point of
being useless in essentially all cases.

In particular, it only support some float32 and unorm8
formats and doesn't work on x86-64.

This commit rewrites it to support:
1. Dumb memory copy for any pair of identical formats
2. All formats that are swizzles of each other
3. Converting 32/64-bit floats and all 8/16/32-bit integers to 32-bit float
4. Converting unorm8/snorm8 to snorm16 and uscaled8/sscaled8 to sscaled16
5. Support for x86-64 (doesn't take advantage of it in any way though)

This new translate can even be useful to translate index buffers for
cards that lack 8-bit index support.

It passes the testsuite I wrote, but note that this is a major change, and more
testing would be great.
2010-08-16 17:09:24 +02:00
Luca Barbieri
a3e6e50544 rtasm: add minimal x86-64 support and new instructions (v5)
Changes in v5:
- Add sse2_movdqa

Changes in v4:
- Use _WIN64 instead of WIN64

Changes in v3:
- Add target and target caps functions, so that they could be different in
  principle from the current CPU and they don't need #ifs to check

Changes in v2:
- Win64 support (untested)
- Use u_cpu_detect.h constants instead of #ifs

This commit adds minimal x86-64 support: only movs between registers
are supported for r8-r15, and x64_rexw() must be used to ask for 64-bit
operations.

It also adds several new instructions for the new translate_sse code.

movdqa
2010-08-16 16:57:05 +02:00
Luca Barbieri
4a4e29a9ab translate: add support for 8/16-bit indices
Currently, only 32-bit indices are supported, but some use cases
translate needs support for all types.
2010-08-16 16:57:05 +02:00
Luca Barbieri
68e74f1b01 translate_sse: remove useless generated function wrappers
Currently translate_sse puts two trivial wrappers in the translate vtable.

These slow it down and enlarge the source code for no gain, except perhaps
the ability to set a breakpoint there, so remove them.

Breakpoints can be set on the caller of the translate functions, with no
loss of functionality.
2010-08-16 16:57:05 +02:00
Luca Barbieri
1cb92fb92e translate_generic: factor out common code between linear and indexed
This moves the common code into a separate ALWAYS_INLINE function.
2010-08-16 16:57:05 +02:00
Luca Barbieri
ddcf028aa0 translate_generic: use memcpy if possible (v3)
Changes in v3:
- If we can do a copy, don't try to get an emit func, as that can assert(0)

Changes in v2:
- Add comment regarding copy_size

When used in GPU drivers, translate can be used to simultaneously
perform a gather operation, and convert away from unsupported formats.

In this use case, input and output formats will often be identical: clearly
it would make sense to use a memcpy in this case.

Instead, translate will insist to convert to and from 32-bit floating point
numbers.

This is not only extremely expensive, but it also loses precision for
32/64-bit integers and 64-bit floating point numbers.

This patch changes translate_generic to just use memcpy if the formats are
identical, non-blocked, and with an integral number of bytes per pixel (note
that all sensible vertex formats are like this).
2010-08-16 16:57:05 +02:00
Chia-I Wu
9271059b36 drwa: Fix polygon edge flags.
Fix a copy-and-paste error introduced by
f141abdc8f.
2010-08-16 22:01:57 +08:00
Chia-I Wu
aaf51ed7c2 draw: No need to make max_vertices even.
Triangle strip alternates the front/back orientation of its triangles.
max_vertices was made even so that varray never splitted a triangle
strip at the wrong positions.

It did not work with triangle strips with adjacencies.  And it is no
longer relevant with vsplit.
2010-08-16 21:04:24 +08:00
Chia-I Wu
c3fee80f2b draw: Remove DRAW_PIPE_MAX_VERTICES and DRAW_PIPE_FLAG_MASK.
The higher bits of draw elements are no longer used for the stipple or
edge flags.
2010-08-16 20:57:08 +08:00
Chia-I Wu
a072f0e186 drwa: Add PRIMITIVE macro to vsplit.
PRIMITIVE is used by the indexed path to flush the entire primitive with
custom vertex count checks.  It replaces the existing fast path.
2010-08-16 20:46:29 +08:00
Chia-I Wu
7b3beb2240 draw: last_vertex_last is always true for GS and SO.
That is, OpenGL decomposition rule is assumed.  There should be a
pipe_context state to specify the rules.
2010-08-16 20:46:29 +08:00
Chia-I Wu
a97419a3ba draw: Remove varray and vcache.
They have been deprecated by vsplit.
2010-08-16 20:46:29 +08:00
Chia-I Wu
5a085c623f draw: Replace vcache by vsplit.
vcache decomposes primitives while vsplit splits primitives.  Splitting
is generally easier to do and is faster.  More importantly, vcache
depends on flatshade_first to decompose.  The outputs may have incorrect
vertex order which is significant to GS.
2010-08-16 20:46:28 +08:00
Chia-I Wu
5b6bf799e6 draw: Replace varray by vsplit.
vsplit is a superset of varray.  It sets the split flags comparing to
varray.
2010-08-16 20:46:28 +08:00
Chia-I Wu
04bc530dbd draw: Add vsplit frontend.
vsplit is based on varray.  It sets the split flags when a primitive is
splitted.  It also has support for indexed primitives.

For indexed primitives, unlike vcache, vsplit splits the primitives
instead of decomposes them.
2010-08-16 20:46:28 +08:00
Chia-I Wu
56213a64fe draw: Add new util function draw_pt_trim_count.
draw_pt_trim_count is renamed from trim in draw_pt.c.
2010-08-16 20:46:28 +08:00
Chia-I Wu
9d2be38fad draw: Simplify frontend interface a little.
The run method is simplified to take the start vertex and the vertex
count.
2010-08-16 20:46:27 +08:00
Chia-I Wu
f132498347 draw: Add prim flags to middle ends.
Update the middle end interface to pass the primitive flags from the
frontends to the pipeline.  No frontend sets the flags yet.
2010-08-16 20:46:27 +08:00
Chia-I Wu
f141abdc8f draw: Add flags to draw_prim_info.
A primitive may be splitted in frontends.  The splitted primitives
should convey certain flag bits so that the decomposer can correctly
decide the stipple or edge flags.

This commit adds flags to draw_prim_info and updates the decomposer to
honor the flags.  Frontends and middle ends will be updated later.
2010-08-16 20:46:27 +08:00
nobled
9d4a0d7d4d st/mesa: test for FEATURE defines
'struct dd_function_table' only conditionally contains
the function pointer NewFramebuffer and friends based on
FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h)

Fixes the build when the features are disabled and the vfuncs
don't exist.
2010-08-16 20:29:19 +08:00
nobled
70f9f5f7d4 dri/nouveau: test for FEATURE defines
'struct dd_function_table' only conditionally contains
the function pointer NewFramebuffer and friends based on
FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h)

Fixes the build when the features are disabled and the vfuncs
don't exist.
2010-08-16 20:29:16 +08:00
nobled
234a065171 dri/radeon: test for FEATURE defines
'struct dd_function_table' only conditionally contains
the function pointer NewFramebuffer and friends based on
FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h)

Fixes the build when the features are disabled and the vfuncs
don't exist.
2010-08-16 20:29:12 +08:00
Vinson Lee
3261c6c41e x86: Remove unnecessary header from sse.h. 2010-08-16 00:26:10 -07:00
Vinson Lee
2144f8e95e x86: Include missing headers in mmx.h.
Include compiler.h for _ASMAPI symbol.
Include mtypes.h for GLcontext symbol.
2010-08-15 23:29:09 -07:00
Vinson Lee
51f979c347 x86: Remove unnecessary header from 3dnow.h. 2010-08-15 23:10:42 -07:00
Vinson Lee
15c7ce867c glsl: Clean up header file inclusion in slang_typeinfo.h.
Remove imports.h, mtypes.h, and slang_vartable.h.
Include glheader.h for GL symbols.
2010-08-15 22:44:29 -07:00
Vinson Lee
9965ee5571 glsl: Include missing header in slang_codegen.h.
Include slang_vartable.h for slang_var_table symbol.
2010-08-15 22:39:51 -07:00
Vinson Lee
640139f80c glsl: Include missing header in slang_compile_operation.h.
Include compiler.h for INLINE symbol.
2010-08-15 22:38:23 -07:00
Vinson Lee
35a27f6fce glsl: Clean up header file inclusion in slang_storage.h.
Remove slang_compile.h.
Include glheader.h for GL symbols.
Include slang_compile_function.h for slang_function_scope symbol.
Include slang_compile_struct.h for slang_struct_scope symbol.
Include slang_compile_variable.h for slang_variable_scope symbol.
Include slang_typeinfo.h for slang_type_specifier symbol.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-15 22:26:27 -07:00
Vinson Lee
97590ebeb0 glsl: Clean up header file inclusion in slang_mem.h.
slang_mem.h
Remove imports.h.
Include glheader.h for GL symbols.

slang_label.c
Include imports.h now that slang_mem.c does not include it.
2010-08-15 22:07:04 -07:00
Vinson Lee
5d2d5bf0c7 glsl: Clean up header file inclusion in slang_ir.h.
Remove imports.h and slang_compile.h.
Include glheader.h for GL symbols.
Include slang_compile_variable.h for slang_variable symbol.
2010-08-15 21:17:50 -07:00
Vinson Lee
44ad729aa3 glsl: Include missing header in slang_link.c.
Include slang_compile.h for _slang_compile function.
2010-08-15 21:13:32 -07:00
Vinson Lee
43ba1f63c7 glsl: Include missing headers in slang_builtin.c.
Include slang_typeinfo.h for slang_type_specifier symbol.
Include slang_compiler_struct.h for slang_struct_ symbol.
2010-08-15 21:10:16 -07:00
Marek Olšák
ecae1fca6f r300g: fix an invalid pointer in free 2010-08-16 05:05:43 +02:00
nobled
e897bf524b r300g: Let hyperz init fail
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-08-16 05:00:09 +02:00
nobled
1e2cd02eae r300g: Fix leaks in failed context creation
This changes r300_destroy_context() so it can be called
on a partially-initialized context, and uses it when
r300_create_context() hits a fatal error.

This makes sure r300_create_context() doesn't leak memory
or neglect to call r300_update_num_contexts() when it fails.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-08-16 04:59:58 +02:00
nobled
b0e1565b5f r300g: Fix macro
This fixes a potential bug if (has_hyperz) is false
(it would still init the atom as if has_hyperz were true).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-08-16 04:59:13 +02:00
Marek Olšák
83baa8a6c5 st/mesa: remove output register reads inside shaders
This is a GLSL2 regression fix.
2010-08-16 02:19:18 +02:00
Marek Olšák
27eb2e2755 r300/compiler: implement DP2 opcode 2010-08-16 00:08:00 +02:00
Marek Olšák
b217167056 r300/compiler: implement SSG opcode 2010-08-16 00:08:00 +02:00
Marek Olšák
b97ab20f29 r300/compiler: fix allocation of temporaries in radeonTransformTEX 2010-08-16 00:07:54 +02:00
Keith Whitwell
c9b7bece05 llvmpipe: special case triangles which fall in a single 16x16 block
Check for these and route them to a dedicated handler with one fewer
levels of recursive rasterization.
2010-08-15 23:02:10 +01:00
Vinson Lee
a0b0afc694 mesa: Check that _XOPEN_SOURCE is defined before using it. 2010-08-15 13:08:15 -07:00
Keith Whitwell
85d9bc236d llvmpipe: consolidate several loops in lp_rast_triangle 2010-08-15 17:40:39 +01:00
Keith Whitwell
ff26594a92 llvmpipe: remove all traces of step arrays, pos_tables
No need to calculate these values any longer, nor to store them in the
bin data.  Improves isosurf a bit more, 115->123 fps.
2010-08-15 17:31:13 +01:00
Keith Whitwell
4c0641454b llvmpipe: eliminate last usage of step array in rast_tmp.h
For 16 and 64 pixel levels, calculate a mask which is linear in x and
y (ie not in the swizzle layout).

When iterating over full and partial masks, figure out position by
manipulating the bit number set in the mask, rather than relying on
postion arrays.

Similarly, calculate the lower-level c values from dcdx, dcdy and the
position rather than relying on the step array.
2010-08-15 17:24:54 +01:00
Keith Whitwell
ee0d1c29ee llvmpipe: don't refer to plane->step when dcdx or dcdy would do 2010-08-15 17:22:25 +01:00
Keith Whitwell
4b322e71bb llvmpipe: also use build_mask at 16, 64 pixel levels 2010-08-15 16:49:26 +01:00
Keith Whitwell
515194968d llvmpipe: version of block4 which doesn't need the full step array
No noticable slowdown with isosurf.
2010-08-15 16:32:45 +01:00
Keith Whitwell
510b035394 llvmpipe: reorganize block4 loop, nice speedup
isosurf 95->115 fps just by exchanging the two inner loops in this
function...
2010-08-15 16:25:06 +01:00
Corbin Simpson
2d53dc873e gallium/docs: Cleanup debugging. Spelling, grammar, organization. 2010-08-15 03:43:54 -07:00
Corbin Simpson
bf357aedff gallium/docs: Add formatting for envvar role; change debugging.
Per Jakob's request. Not super-pretty, but it's a good point for modding
later.
2010-08-15 03:43:54 -07:00
Vinson Lee
d375cb869e glsl: Fix self inclusion in slang_compile_function.h.
Fix self inclusion introduced by commit
4fef77c7c5.
2010-08-15 01:30:02 -07:00
Vinson Lee
6f2077e1ab glsl: Include missing header in slang_ir.h.
Include prog_instruction.h for gl_inst_opcode symbol.
2010-08-15 01:23:10 -07:00
Vinson Lee
babea9f1f6 glsl: Clean up header file inclusion in slang_link.h.
Remove slang_compile.h.
Include mtypes.h for GLcontext symbol.
2010-08-15 01:06:43 -07:00
Vinson Lee
c4e99500f4 glsl: Clean up header file inclusion in slang_label.h.
Move mtypes.h and prog_instruction.h to slang_label.c.
Remove imports.h.
Include glheader.h from GL symbols.
2010-08-15 01:01:58 -07:00
Marek Olšák
6dfcff6b05 r300g: mark HiZ/ZMask_clear atoms as non-dirty after emission in clear 2010-08-15 09:20:30 +02:00
Vinson Lee
ff27c68ca2 glsl: Clean up header file inclusion in slang_emit.h.
Remove imports.h.
Remove mtypes.h.
Remove slang_compile.h.
Include glheader.h for GL symbols.
Include slang_vartable.h for slang_var_table symbol.
2010-08-14 23:40:42 -07:00
Vinson Lee
0ef5449832 glsl: Clean up header file inclusion in slang_compile.h.
Remove imports.h.
Remove slang_typeinfo.h.
Remove slang_compile_operation.h.
Include glheader.h for GL symbols.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-14 23:32:08 -07:00
Vinson Lee
8981fae4c3 glsl: Include missing headers in slang_compile_struct.h.
Include glheader.h for GL symbols.
Include slang_utility.h for slang_atom symbol.
2010-08-14 23:19:28 -07:00
Marek Olšák
d5a86f9fc9 r300g: do not use HiZ if HiZ RAM is not properly initialized 2010-08-15 08:07:11 +02:00
Marek Olšák
59c2230879 r300g: rename dirty_zmask -> zmask_in_use 2010-08-15 08:07:11 +02:00
Marek Olšák
516152112e r300g: do not clear with blitter if we clear just the ZMask RAM
This skips the blitter clear path entirely if the color is not cleared and
the depth+stencil is cleared with the ZMask.
2010-08-15 08:07:11 +02:00
Marek Olšák
5f8ccf1e27 r300g: do not use fastfill if ZMask RAM is not properly initialized
z_fastfill -> dirty_zmask[level].
2010-08-15 08:07:11 +02:00
Marek Olšák
0d699e8ee9 r300g: separate num_cs_end_dwords out from prepare_for_rendering 2010-08-15 08:07:11 +02:00
Vinson Lee
f1702b1808 glsl: Include missing headers in slang_print.h.
Include glheader.h for GL symbols.
Include slang_compile_function.h for slang_function symbol.
Include slang_compile_operation.h for slang_operation symbol.
Include slang_compile_variable.h for slang_variable and slang_variable_scope symbols.
Include slang_typeinfo.h for slang_type_qualifer and slang_fully_specified_type symbols.
2010-08-14 23:14:42 -07:00
Vinson Lee
4fef77c7c5 glsl: Include missing headers in slang_compile_function.h
Include glheader.h for GL symbols.
Include slang_compile_function.h for slang_function symbol.
Include slang_compile_operation.h for slang_operation symbol.
Include slang_compile_variable.h for slang_variable and
slang_variable_scope symbols.
Include slang_log.h for slang_info_log symbols.
Include slang_utility.h for slang_atom and slang_atom_pool symbols.
2010-08-14 22:57:47 -07:00
Vinson Lee
9bfbfd55af glsl: Include missing headers in slang_compiler_operation.h.
Include glheader.h for GL symbols.
Include slang_compile_variable.h for slang_variable_scope symbol.
Include slang_utility.h for slang_atom symbol.
2010-08-14 22:43:26 -07:00
Vinson Lee
1918820d2e glsl: Include missing headers in slang_simplify.h.
Include glheader.h for GL symbols.
Include slang_compile.h for slang_name_space symbol.
Include slang_compile_function.h for slang_function symbol.
Include slang_compile_operation.h for slang_operation symbol.
Include slang_log.h for slang_info_log symbol.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-14 21:21:10 -07:00
Vinson Lee
99003560ca glsl: Include missing header in slang_utility.h.
Include glheader.h for GL symbols.
2010-08-14 18:56:17 -07:00
Vinson Lee
845554eb3b glsl: Include missing headers in slang_vartable.h.
Include glheader.h for GL symbols.
Include slang_utility.h for slang_atom symbol.
2010-08-14 18:53:22 -07:00
Jakob Bornecrantz
fe19935a12 gallium/docs: Add rbug to distribution 2010-08-15 01:06:57 +01:00
Jakob Bornecrantz
d62b29f567 gallium/docs: Add a debugging section 2010-08-15 01:06:53 +01:00
Jakob Bornecrantz
7f5202be63 gallium: Make printing info on debug builds default off
This commit silences the printing off most of the debug information
when running debug builds. The big culprits are: the tgsi sanity checker
that gets run on all shaders on debug; all the options; and
finaly the cpu caps printer.
2010-08-15 01:03:23 +01:00
Vinson Lee
84ec422232 glsl: Include missing header in slang_log.h.
Include glheader.h for GLboolean symbol.
2010-08-14 16:27:42 -07:00
Vinson Lee
fcd2da4e7a glsl: Include missing headers in slang_compile_variable.h.
Include glheader.h for GL symbols.
Include slang_typeinfo.h for slang_fully_specified_type symbol.
Include slang_utility.h for slang_atom symbol.
2010-08-14 15:16:14 -07:00
Vinson Lee
586fbc7286 glsl: Clean up header file inclusion in slang_codegen.h.
Remove mtypes.h.
Include glheader.h for GL symbols.
Include slang_compile_variable.h for slang_variable symbol.
Include slang_typeinfo.h for slang_type_specifier symbol.
Include slang_utility.h for slang_atom_pool symbol.
2010-08-14 14:58:09 -07:00
Vinson Lee
10d77f3f6b gallivm: Remove unnecessary header. 2010-08-14 12:54:21 -07:00
Vinson Lee
db0e24e34a scons: Fix r600g build. 2010-08-14 12:18:51 -07:00
Vinson Lee
77458b565a r600g: Remove unnecessary headers. 2010-08-14 11:56:26 -07:00
Vinson Lee
e01a49af61 r300g: Remove unnecessary header. 2010-08-14 11:44:01 -07:00
Luca Barbieri
9232566269 u_cpu_detect: remove arch and little_endian
This logic duplicates the one in p_config.h, so remove it and adjust
the only two places that were using it.
2010-08-14 19:23:52 +02:00
José Fonseca
eacb624a4a gallivm: Refactor the Newton-Rapshon steps, and disable once again.
It causes a very ugly corruption on the Earth's halo on Google Earth.
2010-08-14 18:03:13 +01:00
José Fonseca
9349379d1a Revert "glsl2: Use stdint.h instead of inttypes.h"
This reverts commit a77a6bc008.
2010-08-14 16:01:24 +01:00
José Fonseca
8df0bea9c5 Replace our custom C99 headers with http://code.google.com/p/msinttypes/
Perhaps http://www.azillionmonkeys.com/qed/pstdint.h would be a better
(more portable) choice, but only MSVC uses this anyway, and we can always
change later.
2010-08-14 16:00:52 +01:00
José Fonseca
1cbcf6693a glsl: Standardize a few more uses of struct vs class keyword. 2010-08-14 15:35:57 +01:00
José Fonseca
1d22923fae scons: Link talloc. 2010-08-14 15:29:15 +01:00
José Fonseca
4b1721eaf3 glsl: Silence gcc warning "control reaches end of non-void function". 2010-08-14 14:40:39 +01:00
José Fonseca
19acfa42ed mesa: Silence gcc warning "control reaches end of non-void function". 2010-08-14 14:40:06 +01:00
José Fonseca
325aa1b3cd mesa: Silence gcc warning "missing initializer for member". 2010-08-14 14:38:09 +01:00
José Fonseca
8881b0fe43 mesa: Recent versions of MSVC define the single precision functions already. 2010-08-14 13:10:24 +01:00
José Fonseca
2322404b55 scons: Add new source files. 2010-08-14 12:45:14 +01:00
José Fonseca
68f602afb1 mesa: atan2f and powf need two args. 2010-08-14 12:44:41 +01:00
Vinson Lee
3c9b00e6e8 glsl: Clean up header file inclusion in slang_builtin.h.
Remove prog_parameter.h and slang_utility.h.
Include glheader.h for GL symbols.
Include mtypes.h for gl_*_result symbols.
2010-08-14 01:59:54 -07:00
Vinson Lee
71a6dea0f5 glsl: Clean up header file inclusion. 2010-08-14 01:46:21 -07:00
Vinson Lee
d75eac5db1 glsl: Include missing header in slang_compile.c.
Include sl_pp_purify.h for sl_pp_purify_options symbol.
2010-08-14 01:38:04 -07:00
Vinson Lee
de33671a4f glsl/cl: Add forward declaration. 2010-08-14 00:53:28 -07:00
Ian Romanick
443a7e4e9a Merge branch 'master' into glsl2 2010-08-13 20:22:46 -07:00
Ian Romanick
2f8ee757ab mesa: Work-arounds for platforms that lack C99 math functions 2010-08-13 20:18:08 -07:00
Kenneth Graunke
9364ad8528 glsl2/Makefile: Add a 'make builtins' target.
This copies over a dummy builtin_functions.cpp and rebuilds a
bootstrapped version of the compiler, then uses that to generate the
proper list of builtins.  Finally, it rebuilds the compiler with the new
list.

Unfortunately, it's no longer automatic, but at least it works.
2010-08-13 19:09:36 -07:00
Kenneth Graunke
43ff8f1a4b glsl2: Rework builtin function generation.
Each language version/extension and target now has a "profile" containing
all of the available builtin function prototypes.  These are written in
GLSL, and come directly out of the GLSL spec (except for expanding genType).

A new builtins/ir/ folder contains the hand-written IR for each builtin,
regardless of what version includes it.  Only those definitions that have
prototypes in the profile will be included.

The autogenerated IR for texture builtins is no longer written to disk,
so there's no longer any confusion as to what's hand-written or
generated.

All scripts are now in python instead of perl.
2010-08-13 19:09:36 -07:00
Kenneth Graunke
d802ba110f ir_reader: Don't mark functions as defined if their body is empty. 2010-08-13 19:09:35 -07:00
Ian Romanick
d01bf822dd glsl2: Commit generated file change by commit ab18be74
This would have been included in commit 23f6017d, but make wisely did
not regenerate the file when the .lpp file did not change.
2010-08-13 19:05:54 -07:00
Eric Anholt
8f8cdbfba4 glsl2: Add a pass to strip out noop swizzles.
With the glsl2-965 branch, the optimization of glsl-algebraic-rcp-rcp
regressed due to noop swizzles hiding information from ir_algebraic.
This cleans up those noop swizzles for us.
2010-08-13 17:54:47 -07:00
Eric Anholt
42cab131da glsl2: Convert ir_constant_propagation to ir_rvalue_visitor.
This one is a little tricky because of the LHS handling.
2010-08-13 17:54:47 -07:00
Eric Anholt
b3b0cf6a4c glsl2: Add a generic visitor class to call back with pointers to each rvalue.
I keep copy and pasting this code all over, so consolidate it in one
place.
2010-08-13 17:54:46 -07:00
Eric Anholt
9c3acce680 mesa: Avoid using c++ keyword in dri_util.h when compiled with c++. 2010-08-13 17:54:46 -07:00
Eric Anholt
c374487a54 intel: Remove include of texmem.h, since we haven't used it in ages. 2010-08-13 17:54:46 -07:00
Eric Anholt
d19eecef54 glsl2: Move ir_to_mesa handling to driver CompileShader and LinkShader hooks.
This lets drivers override ir_to_mesa with their own codegen, or at
least have a native alternative.
2010-08-13 17:54:42 -07:00
Eric Anholt
013bbbbb0a glsl2: Add support for ir_unop_neg to ir_mat_op_to_vec 2010-08-13 17:47:00 -07:00
Eric Anholt
2f4fe15168 glsl2: Move the common optimization passes to a helper function.
These are passes that we expect all codegen to be happy with.  The
other lowering passes for Mesa IR are moved to the Mesa IR generator.
2010-08-13 17:47:00 -07:00
Kenneth Graunke
c55aa4292f glsl2: Refresh autogenerated bison parser. 2010-08-13 17:16:43 -07:00
Vinson Lee
07ca55b7fa Fix an MSVC build error (bugzilla 29570). 2010-08-13 17:11:21 -07:00
Ian Romanick
768b55a526 glsl2: Remove unnecessary use of 'struct' before type names
In C++ you don't have to say 'struct' or 'class' if the declaration of
the type has been seen.  Some compilers will complain if you use
'struct' when 'class' should have been used and vice versa.

Fixes bugzilla #29539.
2010-08-13 16:46:43 -07:00
Ian Romanick
d960b61ea3 Add missing intmax_t and uintmax_t 2010-08-13 16:22:38 -07:00
Ian Romanick
a77a6bc008 glsl2: Use stdint.h instead of inttypes.h 2010-08-13 16:22:21 -07:00
Brian Paul
e8000ffeaf mesa: assorted clean-ups, var type changes, assertions in prog_optimize.c 2010-08-13 15:59:25 -06:00
Benjamin Segovia
9021c56a57 mesa: more/better program optimizations
This is the patch from Benjamin's Aug 11, 2010 email with minor fixes
(such as moving declarations before code)

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-13 15:59:25 -06:00
Ian Romanick
23f6017d70 glsl2: Commit generated file changed by previous commit 2010-08-13 14:50:53 -07:00
Ian Romanick
ab18be74ac glsl2: Use --nounistd to fix MSVC build
Also remove the --never-interactive command line option for the
preprocessor lexer.  This was already done for main compiler lexer.
2010-08-13 14:50:53 -07:00
Ian Romanick
c33e78f62b linker: Assign attrib location 0 if gl_Vertex is not used
If gl_Vertex is not used in the shader, then attribute location 0 is
available for use.

Fixes piglit test case glsl-getattriblocation (bugzilla #29540).
2010-08-13 14:50:48 -07:00
George Sapountzis
5c0a0f2198 st/dri: make dri_drawable_validate_att static 2010-08-13 23:08:02 +03:00
George Sapountzis
c14b4371ed st/dri: move TFP code to dri_drawable.c
This is based on a patch by nobled <nobled@dreamwidth.org> and allows the TFP
extension to be enabled for DRISW also. This patch does not enable TFP for DRISW
though, because testing on xephyr segfaults here (for both classic and gallium):

Program received signal SIGSEGV, Segmentation fault.
0x00786a4a in _mesa_GenTextures (n=1, textures=0xbfffee4c) at main/texobj.c:788
788	   ASSERT_OUTSIDE_BEGIN_END(ctx);
(gdb)
(gdb) where
\#0  0x00786a4a in _mesa_GenTextures (n=1, textures=0xbfffee4c) at main/texobj.c:788
\#1  0x0817a004 in __glXDisp_GenTextures ()
\#2  0x08168498 in __glXDispatch ()
\#3  0x0808b6ce in Dispatch ()
\#4  0x08084435 in main ()

The TFP code is generic except for the teximage call. We need to verify that
DRISW correclty implements whatever hook teximage finally calls.
2010-08-13 22:58:11 +03:00
nobled
5270deaab6 st/dri: Fix segmentation fault in sw drivers 2010-08-13 22:57:26 +03:00
George Sapountzis
d3758feb6b st/dri: dri_drawable_get_format is shared between DRI2 and DRISW 2010-08-13 22:20:19 +03:00
Jakob Bornecrantz
204d4cbea0 glsl2: Include string.h in preprocessor 2010-08-13 18:36:55 +01:00
Ian Romanick
103453659d glsl2: Commit generated files changed by previous two commits 2010-08-13 09:34:52 -07:00
Ian Romanick
5c77efc0b2 glsl2: Avoid token name collisions with names used by Windows header files 2010-08-13 09:30:56 -07:00
Ian Romanick
5b9f3db719 glsl2: Eliminate tokens for square matrix short names
MAT2 and MAT2X2, for example, are treated identically by the parser.
The language version based error checking (becuase mat2x2 is not
available in GLSL 1.10) is already done in the lexer.
2010-08-13 09:29:39 -07:00
José Fonseca
3a3cdb909d scons: Build the new glsl2 code. 2010-08-13 13:55:34 +01:00
José Fonseca
1ca2945f84 talloc: Make it compile with MSVC, MinGW, and Xcode/gcc4.0.
Based on Aras Pranckevičius' patch.
2010-08-13 13:53:04 +01:00
José Fonseca
e6032b1d96 talloc: Import 2.0.1 code. 2010-08-13 12:31:10 +01:00
Vinson Lee
48def868d9 mesa: Clean up header file inclusion in vf.h.
Remove mtypes.h.
Include glheader.h for GL symbols.
2010-08-13 01:23:39 -07:00
Vinson Lee
5dbd3fe3d4 swrast: Clean up header file inclusion in ss_vb.h.
Remove unnecessary header swrast_setup.h.
2010-08-13 00:48:34 -07:00
Vinson Lee
c7f24afcaf swrast: Clean up header file inclusion in ss_triangle.h.
Remove ss_context.h.
Include mtypes.h for GLcontext symbol.
2010-08-12 23:56:52 -07:00
Vinson Lee
8829e0c3f3 swrast: Clean up header file inclusion in ss_context.h.
Remove mtypes.h and swrast_setup.h.
Include glheader.h for GL symbols.
2010-08-12 23:51:16 -07:00
Vinson Lee
db0c6810f9 mesa: Include missing header in programopt.h.
Include mtypes.h for GLcontext and gl_register_file symbols.
2010-08-12 23:28:25 -07:00
Marek Olšák
bac59b336b r300g: do not support separate depth/stencil clear in the driver
It doesn't work well with Hyper-Z, so put the burden on the state tracker.
2010-08-13 08:23:06 +02:00
Marek Olšák
aa6bdd38af r300g: fix fastfill when color and Z clear are invoked separately
This always restores the previous depth clear value after CBZB clear.
2010-08-13 04:41:38 +02:00
Marek Olšák
4985ce1755 r600g: update shader caps
Sent on ML by Владимир.

These values are what fglrx returns.
2010-08-13 03:28:35 +02:00
Ian Romanick
0dc39f481a glsl2: Use MIN2 from macros.h instead of open coding it 2010-08-12 18:01:14 -07:00
Marek Olšák
16e782b83f r300g: disable depth clamp for now
It breaks Regnum Online in that it renders random triangles
all over the screen.

https://bugs.freedesktop.org/show_bug.cgi?id=29518
2010-08-13 02:59:01 +02:00
Vinson Lee
06928ba3c3 mesa: fpclassify is available with MinGW.
This patch fixes the MinGW build.
2010-08-12 17:37:00 -07:00
Dave Airlie
527ac905f6 r600g: fix warning in the winsys 2010-08-13 10:22:46 +10:00
Dave Airlie
f2804e7062 r600g: fix memory leaks running gears.
I noticed gears memory usage was heading skywards, some r600 "states"
aren't properly refcounted, and the ctx->state is never freed.
2010-08-13 10:22:46 +10:00
Vinson Lee
26c042c30a translate_test: Fix compilation with MSVC. 2010-08-12 17:12:56 -07:00
Vinson Lee
ca70bf8c9d scons: Add main/querymatrix.c to SCons build.
Commit 87eb667759 added querymatrix.c to
make but not to SCons.
2010-08-12 16:34:22 -07:00
Ian Romanick
261bbc011d glsl2: Use Elements from main/compiler.h instead of open-coding 2010-08-12 15:05:39 -07:00
Brian Paul
c59c6c0122 glsl: print to stderr like other program printing code 2010-08-12 16:00:03 -06:00
Brian Paul
2d83e3fa0d mesa: check for null shader->InfoLog before printing 2010-08-12 16:00:01 -06:00
Vinson Lee
56450d5f11 mesa: Fix FreeBSD build with llvm enabled.
On FreeBSD LC_CTYPE_MASK is not available but 'llvm-config --cppflags'
adds the compiler flag -D_GNU_SOURCE to the build.
2010-08-12 14:54:30 -07:00
Luca Barbieri
b9abe7f62c translate_test: fix compilation on non-POSIX platforms
Use a kludgy function based on rand() instead of drand48()
2010-08-12 22:10:09 +02:00
Ian Romanick
4ca4edd20e glsl2: Commit generated file changed by previous commit 2010-08-12 10:09:05 -07:00
Ian Romanick
188f60fb05 glsl2: Add missing include of string.h
Makes the build happy on non-GCC platforms.
2010-08-12 10:09:05 -07:00
Luca Barbieri
4d946c4e8a translate_test: improve
1. Generate random data specifically for float and doubles, so that
   they end up in [0, 1] range
2. Don't test useless conversions like SCALED <-> NORM
3. Poison the buffers before testing
2010-08-12 18:36:21 +02:00
Jakob Bornecrantz
4f51762b07 gallium: Link DRI drivers with g++ and test with CXX
New shader compiler need libc++ runtime. This works already if
we are using llvm so this just covers the !llvm case.
2010-08-12 16:04:11 +01:00
Marek Olšák
f668ea11bd Revert "u_blitter: unify clear_depth_stencil and flush_depth_stencil"
This reverts commit de4784e365.
2010-08-12 13:35:16 +02:00
Andre Maasikas
e62e5b0922 r600: add support for draw_elements_base_vertex
use VTX_BASE_VTX_LOC for offset, last time using INDEX_OFFSET was
probably a wrong register for this
2010-08-12 12:44:10 +03:00
Vinson Lee
17bcfaa475 mesa: Clean up header file inclusion in prog_uniform.h.
Remove mtypes.h.
Remove prog_statevars.h.
Include glheader.h for GL symbols.
2010-08-12 00:33:48 -07:00
Vinson Lee
791d7d4bf9 mesa: Include missing headers in prog_print.h.
Include stdio.h for FILE symbol.
Include glheader.h for GL symbols.
Include mtypes.h for GLcontext symbol.
Add forward declarations.
2010-08-12 00:27:01 -07:00
Vinson Lee
991a24d033 mesa: Include missing header in prog_optimize.h.
Include mtypes.h for GLcontext symbol.
2010-08-12 00:18:33 -07:00
Dave Airlie
582129ced6 r600g: fix typo in stencil translate.
fixes piglit stencil-twoside and stencil-wrap
2010-08-12 16:32:19 +10:00
Dave Airlie
13bc2098ca r600g: fix provoking-vertex piglit test. 2010-08-12 16:29:04 +10:00
Dave Airlie
e2df0a8b23 r600g: improve texture format checker.
This takes the r300g texture format checker and fixes it up for r600g,
it passes glean texSwizzle, pixelformats, and texture_srgb tests,

however I think it L8S8_SRGB is broken as is L8_SRGB, need to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 16:20:31 +10:00
Marek Olšák
de4784e365 u_blitter: unify clear_depth_stencil and flush_depth_stencil
No need to enable depth test for clear.
2010-08-12 06:21:24 +02:00
Vinson Lee
e1bb9ee7a6 scons: Fix freebsd8 build. 2010-08-11 18:57:27 -07:00
Vinson Lee
4a859cd12f scons: Add freebsd8 to list of accepted platforms. 2010-08-11 17:58:06 -07:00
Ian Romanick
5a805079a8 glsl2: Change command line options passed to flex
Remove --never-interactive because it is already specified in the
source using %option.  Use -o instead of --outfile.  Some of the
%option commands may also need to be removed for compatibility with
older versions (e.g., 2.5.4) of flex.

This should fix bugzilla #29209.
2010-08-11 17:21:53 -07:00
Ian Romanick
a43871f763 glsl2: Commit generated files changed by previous commit 2010-08-11 17:21:53 -07:00
Ian Romanick
2fb94b37d2 glsl2: Use bison command line option to set prefix
Bison version 2.3 doesn't seem to support %name-prefix in the source.

This should fix bugzilla #29207.
2010-08-11 17:14:02 -07:00
Ian Romanick
db36e88052 glsl2: Commit generated files changed by previous commit 2010-08-11 17:03:37 -07:00
Ian Romanick
77215e7e7b glsl2: Emit error from lexer when illegal reserved word is encountered
Without this, the parser will generate obtuse, useless error
diagnostics when reservered word that are not used by the grammar are
encountered in a shader.

Fixes bugzilla #29519.
2010-08-11 17:03:31 -07:00
Ian Romanick
202604e816 glsl2: Don't declare a variable called sig that shadows the other one
Accidentally having a variable called 'sig' within an if-statement
cause the higher scope 'sig' to always be NULL.  As a result a new
function signature was created for a function definition even when one
already existed from a prototype declaration.

Fixes piglit test case glsl-function-prototype (bugzilla #29520).
2010-08-11 16:58:25 -07:00
Marek Olšák
608f168709 r300/compiler: remove an unused variable 2010-08-12 00:39:04 +02:00
Carl Worth
da6b10a7eb glcpp: Fix "unterminated if" diagnostic.
This was previously being appended to the output string *after* a copy
of the supposedly final string was made and handed to the caller. So
the diagnostic was never actually visible to the user.

We fix this by moving the check for an unterminated #if from
glcpp_parser_destroy to the calling function, preprocess.

This fixes the test case 083-unterminated-if.c.
2010-08-11 14:38:04 -07:00
Carl Worth
6b9e7b034c glccp: Regenerate glcpp-parse.c
Due to a recent change to glcpp-parse.y.
2010-08-11 14:38:04 -07:00
Carl Worth
253cad3f42 glcpp: Add an explicit diagnostic for #if with no expression.
This is more clear than the previously-generated diagnostic which was
something confusing like "enexpected newline".

This change makse test 080-if-witout-expression.c now pass.
2010-08-11 14:38:04 -07:00
Carl Worth
624dd585c7 glcpp: Reword diagnostic for #elif with no expression
Rather than telling the user what to fix, the standard convention is to
describe what the detected problem is. With this change, test
081-elif-without-expression now passes.
2010-08-11 14:38:03 -07:00
Carl Worth
cb5ea0c79b glcpp: Add several tests for diagnostics.
Which are proving to be useful since some of these tests are not yet
acting as desired, (in particular, the unterminated if test is not
generating any diagnostic).
2010-08-11 14:38:03 -07:00
Carl Worth
5a6285cc86 glcpp: Regenerate glcpp-lex.c
After a recent change to glcpp-lex.l
2010-08-11 14:38:03 -07:00
Carl Worth
bc64b89808 glcpp: Initialize line and column numbers to 1, not 0.
Error messages make more sense this way since the convention is for
the first line of a file to be numbered from 1, rather than 0.
2010-08-11 14:38:03 -07:00
Carl Worth
2bcff4c879 glcpp-test: Capture the stderr output of the preprocessor.
This allows writing tests that verify diagnostics from the preprocessor.
2010-08-11 14:38:03 -07:00
Brian Paul
dcb3a2899e configs: added -ltalloc to config files 2010-08-11 15:06:13 -06:00
Brian Paul
9b2d3c3285 osmesa: link with new libglsl.a lib 2010-08-11 15:06:13 -06:00
Brian Paul
9f9386d22a glsl2: added casts to silence warnings 2010-08-11 15:06:13 -06:00
Brian Paul
4415a84645 glsl2: remove stray semicolon 2010-08-11 15:06:13 -06:00
Brian Paul
d3b66be3c7 glsl2: added casts to silence warnings 2010-08-11 15:06:12 -06:00
Brian Paul
ffd3f15e96 glsl2: add cast to silence warning 2010-08-11 15:06:12 -06:00
Brian Paul
30d083903f glsl2: remove stray semicolon 2010-08-11 15:06:12 -06:00
Brian Paul
d1dda951c8 glsl2: move declarations before code 2010-08-11 15:06:12 -06:00
Brian Paul
6dc89d221d glsl2: remove trailing comma to silence warning 2010-08-11 15:06:12 -06:00
Luca Barbieri
39cd4f7ceb translate_test: fix segfault on x86-64 2010-08-11 22:32:20 +02:00
Luca Barbieri
41c7ff11e6 u_staging: remove useless inline keyword 2010-08-11 22:11:19 +02:00
Luca Barbieri
99cc6d70a4 translate_test: fix, reindent, and improve
1. Fix the segfault due to the reverted commit using the new interface
2. Reindent to Mesa 3 spaces style
3. Improve output and return success/failure with error code
4. Add much better support for testing translate_sse
2010-08-11 21:47:28 +02:00
Luca Barbieri
10adb7840c translate: allow clients to ask for supported output formats
Currently translate asserts on unsupported output formats, making
it impossible to use for some purposes, such as testing whether it
actually works on all formats it supports.

Removing the assert was met with opposition, so this change allows
clients to ask whether an output format is supported, and they are thus
able to avoid attempting to use it.

Since this is just an addition to the API, no adverse effect is
possible, and it makes the testsuite work again.
2010-08-11 21:47:27 +02:00
Carl Worth
8485f4d9aa glcpp: Clean up intermediate file when test suite is interrupted.
The glcpp-test script was leaving around bogus *.valgrind-errors files if
a valgrind test was interrupted.
2010-08-11 12:46:16 -07:00
Carl Worth
764e096647 glcpp: Regenerate glcpp-parse.c
After a recent change to glcpp-parse.y
2010-08-11 12:45:55 -07:00
Vinson Lee
27fe2347bc auxiliary: Make u_staging.c MSVC compatible.
Fixes MSVC build.
2010-08-11 12:45:02 -07:00
Carl Worth
48ba058e7a glcpp: Additional fixes for not evaluating skipped #if/#elif expressions.
This adds a couple of test cases to expand our coverage of invalid #if and
being skipped, (either by being nested inside an #if/#elif that evaluates to
zero or by being after an #if/#elif that evaluates to non-zero).
2010-08-11 12:43:44 -07:00
Vinson Lee
f7d7b080a1 translate: Add translate_test.c to SCons.
This is a follow-up to commit 945e38c73b,
which added translate_test.c to make.
2010-08-11 12:18:25 -07:00
Vinson Lee
04cfc6234c auxiliary: Add u_staging.c to SCons build.
This is a follow-up to commit b85c71d4e1
which added u_staging.c to make.
2010-08-11 12:04:54 -07:00
Tom Stellard
f78445de5d r300/compiler: Implement the CONT opcode. 2010-08-11 11:39:57 -07:00
Tom Stellard
953e39c61d r300/compiler: Handle loops in the register allocator. 2010-08-11 11:39:57 -07:00
Jerome Glisse
481b65abae r600g: accept empty frag prog shader
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11 14:26:07 -04:00
Jerome Glisse
1bb0427a85 r600g: add src negation support
Should fix few glBitmap cases.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11 13:50:19 -04:00
José Fonseca
b481a1237e gallivm: Fix and enable the extra Newton/Raphson step in lp_build_rcp().
Thanks to Michal for spotting this.
2010-08-11 18:45:26 +01:00
Jerome Glisse
457378e031 r600g: add point/sprite rendering support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11 12:20:28 -04:00
Luca Barbieri
5266bc3c60 Revert "translate_generic: return NULL instead of assert(0) if format not supported"
This reverts commit 16b45ca7ce.

José Fonseca asked for a revert.

Note that the testsuite will now segfault since it attempts to test
all possible formats.
2010-08-11 17:01:27 +02:00
Luca Barbieri
684aeb366f translate_generic: fix broken A8R8G8B8_UNORM output
translate was attempting to output A8R8G8B8_UNORM as if it were
R8G8B8A8_UNORM.

Now the tests just added pass.
2010-08-11 16:27:58 +02:00
Luca Barbieri
945e38c73b translate: add testsuite
Currently only checks all possible format conversions, and doesn't
attempt to test whether multiple buffers/elements or indices work.
2010-08-11 16:27:58 +02:00
Luca Barbieri
16b45ca7ce translate_generic: return NULL instead of assert(0) if format not supported
This gives the caller a chance to recover (or crash anyway otherwise).
2010-08-11 16:27:57 +02:00
Luca Barbieri
deb809ec98 auxiliary: fix util_framebuffer_copy
util_framebuffer_copy was attempting to copy all elements of the
source framebuffer state.

However, this breaks if the user does not zero initialize the structure.
Instead, only copy the elements up to nr_cbufs, and clear elements up
to dst->nr_cbufs, if the destination was larger than the source.
2010-08-11 16:27:57 +02:00
José Fonseca
10ce6779e8 gallivm: Use lp_build_div instead of lp_build_mul + lp_build_rcp.
Single divide, so let lp_build_div decide how to implement this.

This will save a multiplication in architectures which don't have
a RCP intrinsic.
2010-08-11 15:14:10 +01:00
José Fonseca
f8533482f4 gallivm: Use unsigned shift in lp_build_minify.
Texture dimensions are unsigned.
2010-08-11 15:14:10 +01:00
José Fonseca
66f57235d5 llvmpipe: Debug code to dump interpolation coefficients. 2010-08-11 15:14:10 +01:00
José Fonseca
3deca2e284 llvmpipe: Use single precision divide for one over area computation. 2010-08-11 15:14:10 +01:00
Marek Olšák
4b20ad7559 util: copy the u_staging commit message to the code 2010-08-11 15:11:42 +02:00
Luca Barbieri
b85c71d4e1 auxiliary: support for transfers using staging resources
Direct3D 10/11 has no concept of transfers. Applications instead
create resources with a STAGING or DYNAMIC usage, copy between them
and the real resource and use Map to map the STAGING/DYNAMIC resource.

This util module allows to implement Gallium drivers as a Direct3D
driver would be implemented: transfers allocate a resource with
PIPE_USAGE_STAGING, and copy the data between it and the real resource
with resource_copy_region.
2010-08-11 13:03:00 +02:00
Luca Barbieri
6f3c4819ec gallium: add ALWAYS_INLINE
Used when we want to be sure the compiler inlines a large function into
an inner loop.
2010-08-11 11:27:46 +02:00
Luca Barbieri
5668526c91 u_surfaces: add util_surfaces_peek
Used to find out if a surface exists without creating one.
2010-08-11 11:20:16 +02:00
Luca Barbieri
e45b2ce2c3 u_surfaces: use cso_hash instead of util_hash_table
Using cso_hash directly is the right thing since util_hash_table
adds useless overhead and is harder to use for this application.
2010-08-11 11:19:23 +02:00
Luca Barbieri
24f5ebb1d7 u_surfaces: fix surface leak due to off by one 2010-08-11 11:17:35 +02:00
Luca Barbieri
58b104d7f0 auxiliary: make primitive splitter assert on unimplemented adjacency prims
They are unimplemented, even though the framework makes it possible to
implement them well, and nv50 needs them.
2010-08-11 11:08:51 +02:00
Luca Barbieri
eee5cea385 auxiliary: fix u_split_prim naming convention
Current practice is to start identifiers with "util_" instead of "u_".
2010-08-11 11:08:51 +02:00
Luca Barbieri
0dcf0f9dfa auxiliary: move Ben Skeggs' primitive splitter to common code
This is a simple framework that handles splitting primitives in an
abstract way.

The user has to specify the primitive start, start index and count.

Then, it can ask the primitive splitter to "draw" a chunk of the
primitive, staying under a given vertex/index budget.

The primitive splitter will then call user-supplied functions to
emit a range of vertices/indices, as well as switch the edgeflag
on or off.

This is particularly useful for hardware that either has limits
on the vertex count field, or where vertices are pushed on a FIFO
or temporary buffer of limited size.

Note that unlike other splitters, it does not manipulate data in
any way, and merely asks a callback to do so, in vertex intervals.
2010-08-11 11:08:46 +02:00
Vinson Lee
0578acbe18 mesa: Include missing header in prog_noise.h.
Include glheader.h for GLfloat symbol.
2010-08-11 01:10:54 -07:00
Vinson Lee
f36a4b3c9e mesa: Clean up header file inclusion in prog_instruction.h.
Remove mfeatures.h.
Include glheader.h for GL symbols.
2010-08-11 01:06:58 -07:00
Vinson Lee
c20e92c3e0 mesa: Include missing header in prog_execute.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:43:28 -07:00
Vinson Lee
2a5bf7b4d2 mesa: Include missing header in prog_cache.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:35:34 -07:00
Vinson Lee
1c5a077e1b mesa: Include missing header in nvvertparse.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:33:02 -07:00
Vinson Lee
13887f389f mesa: Include missing header in nvfragparse.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:29:26 -07:00
Vinson Lee
48f8495040 mesa: Remove unnecessary header from hash_table.h. 2010-08-11 00:26:05 -07:00
M.Froehlich@science-computing.de
c8e714df01 swrast: fix span color array pointer assignment for 32-bit/channel rendering
See fd.o bug 29487.

NOTE: This is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-10 21:21:26 -06:00
Marek Olšák
ca5227ce8b r300g: initialize VAP_VTX_STATE_CNTL
This got lost during the rasterizer rewrite.
2010-08-11 04:48:56 +02:00
Marek Olšák
683ef52e19 r300g: implement gl_FrontFacing 2010-08-11 04:48:56 +02:00
Kenneth Graunke
298a6fcdde glcpp/tests: Commit forgotten file 074-elif-undef.c.expected. 2010-08-10 19:18:44 -07:00
Kenneth Graunke
64b408529a texture_builtins.py: Remove useless comments. 2010-08-10 19:18:44 -07:00
Carl Worth
9b7fd2099f glcpp: Discard output of cmp when running the test suite.
We're already using the return-value of cmp to print either PASS or
FAIL and in the case of failure, we're subsequently running and
showing the output of diff. So any warnings/errors from cmp itself are
not actually needed, and can be quite confusing.
2010-08-10 18:27:31 -07:00
Carl Worth
4f9a64407c glcpp: Fix expected result for the 064-version.c test.
Commit d4a04f3155 caused this test case
to produce an additional blank line, which is otherwise harmless, but
does need to be reflected in the .expected file for the test to pass.
2010-08-10 18:25:30 -07:00
Vinson Lee
cc732bf894 swrast: Remove unnecessary header. 2010-08-10 18:05:52 -07:00
Vinson Lee
61205f6189 svga: Remove unnecessary headers. 2010-08-10 17:53:08 -07:00
Vinson Lee
34cdad62dd r300g: Remove unnecessary header. 2010-08-10 17:39:13 -07:00
Carl Worth
e29cd39125 glcpp: Regnerate glcpp-parse.c and glcpp-parse.h
After making a minor change to the .y file.
2010-08-10 16:59:20 -07:00
Carl Worth
485f84d366 glcpp: Initialize location structure at beginning of parse.
Since we have a custom structure for YYLTYPE locations, we need to use
an %initial-action directive to avoid triggering use of uninitialized
memory when, for example, printing error messages.

We apparently don't yet have a test case that allowed valgrind to find
this bug for us, but valgrind found a similar problem in the other
parser, so we fix this one as well.
2010-08-10 16:58:28 -07:00
Carl Worth
a7d6c496cf glsl2: Regenerate glsl_parser.cpp and glsl_parser.h
After making a minor change to the .y file.
2010-08-10 16:54:23 -07:00
Carl Worth
60d8c46995 glsl2: Initialize location structure at beginning of parse.
Since we have a custom structure for YYLTYPE locations, we need to use
an %initial-action directive to avoid triggering use of uninitialized
memory when, for example, printing error messages.

Thanks to valgrind for noticing this bug.
2010-08-10 16:52:54 -07:00
Nigel Stewart
6768afbe9f glut: also check for GLX_ARB_multisample
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-10 17:28:33 -06:00
Brian Paul
bbfdcc16df mesa: use switch stmt in init_program_limits() 2010-08-10 17:27:56 -06:00
Brian Paul
f6ca938bcb mesa: remove obsolete comments 2010-08-10 17:27:55 -06:00
Tom Stellard
8dd4308b5e r300/compiler: Use predicate bit for IF statements in r500 vertex shaders 2010-08-10 13:17:25 -07:00
Tom Stellard
c298bab60e r300/compiler: Implement hardware assisted loops for vertex shaders.
Single loops work, but nested loops do not.
2010-08-10 13:17:25 -07:00
Tom Stellard
5c7b7da798 r300/compiler: Correctly transform nested loops. 2010-08-10 13:17:25 -07:00
Jerome Glisse
72f8edfc0b r600g: avoid reemiting literal, avoid scheduling empty cs
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-10 11:53:05 -04:00
José Fonseca
247b253d32 util: Add util_format_srgb().
To convert RGB -> SRGB format.
2010-08-10 16:37:19 +01:00
Brian Paul
f263fdee81 gallivm: fix non-SSE4.1 case in lp_build_pack2()
Since there's no SSE instruction for this case, fall through to the
generic shuffle code.

Fixes bug fd.o 29468.
2010-08-10 08:56:57 -06:00
Brian Paul
4567b47953 mesa: additional program limit assertions 2010-08-10 08:38:19 -06:00
Brian Paul
b80a830cd8 mesa: fix comment typo 2010-08-10 08:38:19 -06:00
nobled
20b3e40f16 gallivm: Fix bitwise operations for floats, division for integers
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
nobled
a44a6960fa gallivm: Even more type checking
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
nobled
e9f3994b16 llvmpipe: Always use floating-point operators for floating-point types
See:
http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
Eric Anholt
0ff3b2b344 glsl2: Make ir_algebraic reassociate add/mul operands for constant folding.
It's rather easy to produce two constant multiplies separated by other
multiplies while writing a BRDF shader, and non-obvious enough in the
resulting codegen that I didn't catch it in my demo code until just
recently.  Cuts 3 965 instructions from my demo (<1%), and 20 from
glsl-fs-raytrace (1.3%).
2010-08-09 21:42:17 -07:00
Eric Anholt
5854d4583c glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))
All the current HW backends transform subtract to adding the negation,
so I haven't bothered peepholing it back out in Mesa IR.  This allows
some subtract of subtract to get removed in ir_algebraic.
2010-08-09 21:41:14 -07:00
Eric Anholt
8bebbeb7c5 glsl2: Add constant propagation.
Whereas constant folding evaluates constant expressions at rvalue
nodes, constant propagation tracks constant components of vectors
across execution to replace (possibly swizzled) variable dereferences
with constant values, triggering possible constant folding or reduced
variable liveness.
2010-08-09 19:21:18 -07:00
Eric Anholt
81996ae861 i965: More s/stderr/stdout/ for program debug. 2010-08-09 18:24:23 -07:00
Eric Anholt
2dd3ae0d4a glsl2: Teach copy propagation about "if" and "loop" instructions.
This lets us track copies across basic block boundaries.  The loop
doesn't get a filled out list of available copies into it yet, though.

glsl-fs-raytrace drops from 585 to 535 Mesa IR instructions out of the
compiler, and it appears that Yo Frankie's largest shaders decrease in
Mesa IR count by about 10% as well.
2010-08-09 17:14:31 -07:00
Kenneth Graunke
8aa7dbacaf glsl2: Refresh autogenerated file builtin_function.cpp. 2010-08-09 12:45:25 -07:00
Kenneth Graunke
2eed82ebc0 texture_builtins.py: Fix cut and paste errors in function names.
Some signatures were being generated with the wrong function name.
2010-08-09 12:41:39 -07:00
Henri Verbeet
e165453f84 radeon: Use MESA_FORMAT_SARGB8 for sRGB formats
This can be supported on r600 without using the endian swapper, and is a
better fit for (typical) uploads using GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
anyway.
2010-08-09 15:06:02 -04:00
Henri Verbeet
08933b5a17 r600c: Disable alpha test during blits 2010-08-09 15:03:27 -04:00
Kenneth Graunke
dbff7b541e glsl2: Use gl_DepthRange's proper name.
It was being incorrectly added as gl_DepthRangeParameters, which is the
type name, not the variable name.
2010-08-09 11:42:37 -07:00
Ian Romanick
c88e60a27b ir_algebraic: Support other comparisons in ir_unop_logic_not 2010-08-09 10:46:38 -07:00
Ian Romanick
fe277089c7 ir_algebraic: Convert ir_unop_logic_not handler to use a switch statement
Currently only ir_binop_equal and ir_binop_nequal are supported, but
soon all of the relational operators will be added.  Making this
change now will simplify those commits.
2010-08-09 10:19:39 -07:00
José Fonseca
6e1f9bc8f6 gallivm: More type checks. 2010-08-09 17:31:18 +01:00
José Fonseca
8a3a971743 gallivm: Don't call LLVMBuildFNeg on llvm-2.6.
It didn't exist yet.
2010-08-09 17:31:18 +01:00
nobled
fc9a49b638 gallivm: Always use floating-point operators for floating-point types
This fixes the assert added in LLVM 2.8:
assert(getType()->isIntOrIntVectorTy() &&
       "Tried to create an integer operation on a non-integer type!")

But it also fixes some subtle bugs, since we should've been doing this
since LLVM 2.6 anyway.

Includes a modified patch from steckdenis@yahoo.fr for the
FNeg instructions in emit_fetch(); thanks for pointing those out.

http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-09 17:31:18 +01:00
José Fonseca
65b9747a54 util: Move _mm_shuffle_epi8() to u_sse.h.
It's bound to be useful elsewhere.
2010-08-09 17:31:18 +01:00
Aras Pranckevicius
3adce986c4 glsl2: do not use __retval name; two underscores is reserved word according to GLSL spec (and Win7 ATI drivers do complain about that) 2010-08-09 09:08:03 -07:00
Aras Pranckevicius
5023edaf5d glsl: fix missing return in ir_structure_splitting 2010-08-09 09:04:32 -07:00
Jerome Glisse
95fb0bf58d r600g: fix r600 context structure, avoid segfault when no scissor
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-09 11:33:25 -04:00
Marek Olšák
29b7d26401 r300g: do not print shader compiler errors by default 2010-08-09 17:18:45 +02:00
Marek Olšák
2cad5350f9 r600g: fix some warnings 2010-08-09 15:00:19 +02:00
Marek Olšák
00963589b4 r600g: fill out some missing caps and sort them
The shader caps need additional corrections.

(based on a patch from netkas at Phoronix)
2010-08-09 14:59:54 +02:00
Andre Maasikas
67ee40684d radeon: fix npot mipmap alignment on r600
seems it got lost in commit 0d383547
have no earlier radeons to test, but npot mipmaps were not supported there?
2010-08-09 14:37:01 +03:00
Andre Maasikas
8d0985b9b8 r600: bump glsl version
from the tests i couldn't find any new driver faults
2010-08-09 14:28:00 +03:00
Dave Airlie
771ad67414 r300g: fix hiz/zmask offset emissions.
ofs is in dwords, so need to shift it for registers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-09 19:56:45 +10:00
Eric Anholt
f8d2cfe4a6 glsl2: Handle plain variable copies in struct splitting.
glsl-fs-raytrace goes from 620 Mesa IR instructions out of the
compiler to 585.
2010-08-08 23:45:58 -07:00
Luca Barbieri
3bb0719fe1 nouveau: fix maps with PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_DONTBLOCK
In this case, we were incorrectly prioritizing PIPE_TRANSFER_DONTBLOCK over
PIPE_TRANSFER_UNSYNCHRONIZED.

This can lead to failure in the Mesa VBO draw paths that end up specifying
both, but don't expect map to fail (in particular, the problem manifested as
a leak of buffer objects in teapot with other changes).
2010-08-09 05:02:12 +02:00
Marek Olšák
aef0fbd5b6 r300g: remove a flush
Ooops, it wasn't supposed to be there.
2010-08-08 23:20:43 +02:00
José Fonseca
12f5c0f9ce gallivm: Fix more integer operations. 2010-08-08 22:18:53 +01:00
nobled
cd5af8c703 gallivm: Use the correct context for integers
See:
http://bugs.freedesktop.org/29407
2010-08-08 22:08:52 +01:00
Marek Olšák
4f5e51068b r300g: flush zmasks of zbuffers we are going to use as samplers
It sometimes works, sometimes not. I guess we have the zmask offsets wrong.
2010-08-08 22:53:31 +02:00
Marek Olšák
363b74f132 r300g: do not allocate a zmask block for 3D textures and cubemaps 2010-08-08 22:29:00 +02:00
Marek Olšák
757c78afe7 r300g: generalize the way we ask for hyperz
This makes it compatible with the modified DRM interface in drm-radeon-testing.

Also, now you need to set RADEON_HYPERZ=1 to be able to use hyperz.
It's not bug-free yet.
2010-08-08 22:28:35 +02:00
José Fonseca
d827972816 gallivm: Add type checks for the basic operations. 2010-08-08 21:02:59 +01:00
José Fonseca
b9a21fd6ca draw: Remove unused variable. 2010-08-08 13:58:23 +01:00
nobled
445e59057f draw: Use the correct type for integers
Two integers were being operated on as
a vector of floats in draw_llvm_generate().

This bug got uncovered by fixing this bug:
http://bugs.freedesktop.org/29407
2010-08-08 12:19:07 +01:00
Dave Airlie
b55f627937 r300g: take hiz/zmask offsets into a/c when clearing.
Need to add a test for multi-hiz/zmask db in a single context.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-08 19:12:14 +10:00
Vinson Lee
ef3b17f5f3 i810: Add missing header m_xform.h.
This is another follow-up to commit
f4511c4835.
2010-08-07 23:38:20 -07:00
Vinson Lee
facf368df2 dri: Add missing header m_xform.h.
This is a follow-up patch to commit
f4511c4835.

Files that include tnl_dd/t_dd_dmatmp.h now need to also include
m_xform.h as t_context.h no longer includes it.
2010-08-07 23:19:27 -07:00
Vinson Lee
f4511c4835 tnl: Reduce header file inclusion in t_context.h.
t_context.h
Remove m_matrix.h and m_xform.h.

t_vb_program.c
Include m_xform.h.

t_vb_render.c
Include m_xform.h.
2010-08-07 22:56:35 -07:00
Vinson Lee
2154dfa701 swrast: Reduce header file inclusion in s_zoom.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 22:13:19 -07:00
Vinson Lee
a2a40cefe2 swrast: Fix header file inclusion in s_texfilter.h.
Include mtypes.h for GLcontext symbol.
Include s_context.h for texture_sample_func symbol.
2010-08-07 22:05:28 -07:00
Vinson Lee
c20e977467 swrast: Reduce header file inclusion in s_texcombine.h.
Include mtypes.h for GLcontext sybmol.
Include s_span.h for SWspan symbol.
2010-08-07 22:01:27 -07:00
Vinson Lee
e616d05b22 swrast: Reduce header file inclusion in s_stencil.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:44:53 -07:00
Vinson Lee
01739cdda2 swrast: Reduce header file inclusion in s_masking.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:24:16 -07:00
Vinson Lee
562c727414 swrast: Reduce header file inclusion in s_logic.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:07:11 -07:00
Vinson Lee
f009f177fd swrast: Reduce header file inclusion in s_fragprog.h.
s_fragprog.h
Include mtype.h for GLcontext symbol.
Include s_span.h for SWspan symbol.

s_fragprog.c
Include s_context.h now that it is removed from s_fragprog.h.
2010-08-07 21:01:12 -07:00
Vinson Lee
7b56285487 swrast: Reduce header file inclusion in s_fog.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 13:57:50 -07:00
Vinson Lee
5db13da866 swrast: Clean up header file inclusion in s_depth.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 13:04:50 -07:00
Vinson Lee
690ead0f22 swrast: Include missing header in s_context.h.
Include compiler.h for _ASMAPIP symbol.
2010-08-07 12:44:58 -07:00
Vinson Lee
d6273bb39b swrast: Clean up header file inclusion in s_blend.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 12:36:50 -07:00
Vinson Lee
12e8e5ee95 swrast: Clean up header file inclusion in s_atifragshader.h.
s_atifragshader.h
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.

s_atifragshader.c
Include s_context.h for SWcontext symbol.
2010-08-07 12:25:20 -07:00
Vinson Lee
1bc1c669b2 swrast: Clean up header file inclusion in s_alpha.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 12:19:29 -07:00
Marek Olšák
1e46de3a83 r300c: do not advertise half float vertex on RV3xx, RS4xx, RC4xx
Fixes a hardlock.

NOTE: this is a candidate for the 7.8 branch, provided the half float vertex
is really implemented there.
2010-08-07 18:13:05 +02:00
Kenneth Graunke
b7e63c34e7 glsl2: Add the 1.30 reserved keywords. 2010-08-07 00:51:30 -07:00
Vinson Lee
d64a119c28 st/mesa: Remove unnecessary header. 2010-08-06 18:45:15 -07:00
Marek Olšák
ab0a3f30b8 r300g: fix cbzb clears when hyperz is off 2010-08-07 02:00:21 +02:00
Maarten Maathuis
a838cee6bc nouveau: fix potential NULL-ptr dereference in nouveau_stateobj.h
- This can only be triggered when DEBUG_NOUVEAU_STATEOBJ is active.
- Also remove a redundant pointer assignment.

Reported-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2010-08-06 23:56:31 +02:00
Jerome Glisse
d9f72b9f90 r600g: add PA_CL_CLIP_CNTL definition
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:27:36 -04:00
Jerome Glisse
32251c34f0 r600g: fix rendering, only enable target we write too
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:23:43 -04:00
Aras Pranckevicius
58f1ffdd7c ir_function_inlining: Fix missing iter.next() in inlining sampler params.
Fixes glsl-fs-function-samplers.
2010-08-06 14:17:40 -07:00
Jerome Glisse
b474478f20 r600g: really fix multi target support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:13:28 -04:00
Aras Pranckevicius
63cddb27d7 copy_propagation: do propagation into non-out call params 2010-08-06 14:13:15 -07:00
Brian Paul
6b97fe52c9 st/mesa: remove stray semicolons 2010-08-06 15:09:51 -06:00
Brian Paul
14e9fbee1c gallium: remove stray semicolons 2010-08-06 15:09:41 -06:00
Eric Anholt
925b49ff31 glsl2: Move gl_program->InputsRead/OutputsWritten setting to an ir pass.
This lets us handle arrays much better than trying to work backwards
from assembly.

Fixes fbo-drawbuffers-maxtargets on swrast (i965 needs loop unrolling)
2010-08-06 13:22:31 -07:00
Jerome Glisse
c3ad060488 r600g: finish multi target rendering support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 16:12:22 -04:00
Vinson Lee
69d450856a targets/egl: Fix build by including missing headers. 2010-08-06 11:46:16 -07:00
Chia-I Wu
e34c52da87 draw: Add an assertion to varray's version of trim().
Assert that "first" is always smaller than "count" and add reasoning.
It would be better to simply fix trim(), but it is used in tight loops
right now.
2010-08-07 02:20:06 +08:00
Chia-I Wu
600cd858d4 draw: Fix draw_pt_split_prim for primitives with adjacency.
Some primitives with adjacency have their "incr" wrong.
2010-08-07 02:16:50 +08:00
Chia-I Wu
6ae39f6dca draw: Assert that only the first vetex may have flags set.
642d5ba79a removed flags masking for
vertices other than the first one.  Add assertions to be on the safe
side.
2010-08-07 02:14:50 +08:00
Jerome Glisse
27041d7cb3 r600g: fix color format, indentation, defines
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 11:28:33 -04:00
Jerome Glisse
6e6103004c Revert "r600g: don't use dynamic state allocation for states"
This reverts commit 9c949d4a4d.

Conflicts:

	src/gallium/drivers/r600/r600_context.h
	src/gallium/drivers/r600/r600_draw.c
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state.c
2010-08-06 10:59:27 -04:00
Chia-I Wu
d38afcd2f2 draw: Avoid mixed declarations and code.
Do not expand LOCAL_VARS to void expression.  Otherwise, declarations
and code will be mixed when more variables are declared in FUNC_ENTER.

This fixes fdo bug #29416.
2010-08-06 17:14:21 +08:00
Vinson Lee
bec87456ed swrast: Reduce header file inclusion in s_aatriangle.h.
Include mtypes.h for GLcontext symbol.
2010-08-06 01:04:49 -07:00
Vinson Lee
a3439df79f swrast: Reduce header file inclusion in s_aaline.h.
Include mtypes.h for GLcontext symbol.
2010-08-06 00:57:52 -07:00
Eric Anholt
c234d0b25f ir_to_mesa: Add support for sampler arrays.
Support for samplers in general is still incomplete -- anything in a
uniform struct will still be broken.  But that doesn't appear to be
any different from master.

Fixes:
glsl-fs-uniform-sampler-array.shader_test
2010-08-06 00:51:42 -07:00
Eric Anholt
199c441239 glsl2: Fix inlining with sampler array or struct dereferences as arguments.
Previously, we'd replace an argument of mysampler[2] with a plain
reference to mysampler by using the cloning hash table.  Instead, use
a visitor to clone whatever complicated sampler dereference into the
sampler parameter derefs in the inlined function body.
2010-08-06 00:51:08 -07:00
Eric Anholt
8d61a23b1a glsl2: Don't assert in a couple of places when encountering sampler arrays.
Fixes glean shaderAPI.
2010-08-06 00:42:59 -07:00
Eric Anholt
658e25987f ir_to_mesa: Give the expected size for _mesa_add_attribute().
Fixes a failure in glean shaderAPI.
2010-08-06 00:23:48 -07:00
Vinson Lee
a6859f5ccc r300g: Remove unnecessary headers. 2010-08-05 23:58:00 -07:00
Dave Airlie
5f6ab5e259 r600g: start to fix up multiple targets.
fixup exports from pixel shader for multi-cbs + depth buffer writing.

Still crashes GPU running any of the multi-buffer or depth writing
2010-08-06 16:05:24 +10:00
Chia-I Wu
642d5ba79a draw: Remove unnecessary vertex flag ANDs.
Vertex flags are a contract between vcache and the pipeline.  They are
set only for the first vertex of a primitive.
2010-08-06 13:39:37 +08:00
Chia-I Wu
f1fc444bb0 draw: Mask out vertex flags in GS and stream output.
This fixes out-of-bound access to the vertices.
2010-08-06 13:39:37 +08:00
Chia-I Wu
eb3c6ddafb draw: Include draw_decompose_tmp.h in draw_pt_decompose.h.
Use draw_decompose_tmp.h to replace pipeline primitive decomposer.
2010-08-06 13:39:36 +08:00
Chia-I Wu
94d256591d draw: Include draw_decompose_tmp.h in draw_so_emit_tmp.h.
Use draw_decompose_tmp.h to replace stream out primitive decomposer.
2010-08-06 13:39:36 +08:00
Chia-I Wu
23176779f8 draw: Include draw_decompose_tmp.h in draw_gs_tmp.h.
Use draw_decompose_tmp.h to replace GS primitive decomposer.
2010-08-06 13:39:36 +08:00
Chia-I Wu
8a41b18b7d draw: Include draw_decompose_tmp.h in draw_pt_vcache_tmp.h.
Use draw_decompose_tmp.h to replace vcache primitive decomposer.  As the
new decomposer supports primitives with adjacency, vcache_triangle_adj
and vcache_line_adj (and their variants that have flags) are added.
2010-08-06 13:39:36 +08:00
Chia-I Wu
524b2626c2 draw: Add draw_decompose_tmp.h.
Including draw_decompose_tmp.h defines a primitive decomposer.  It is
intended to replace the existing vcache/so/gs/pipe decomposers.

This is based on draw_pt_vcache_tmp.h.
2010-08-06 13:39:36 +08:00
Dave Airlie
0a2a6c75bf r600g: add SRGB support.
This enables GL2.1 and passes glean's texture_srgb test.
2010-08-06 15:21:44 +10:00
Dave Airlie
fc47cb9d71 r600g: fixup z format translations.
this enables GL_EXT_packed_depth_stencil. fbo-d24s8 passes
2010-08-06 15:06:25 +10:00
Dave Airlie
b8de7788a4 r600g: fix targetmask to work correctly.
At least this seems to fix the glean maskedClear test.
2010-08-06 14:54:24 +10:00
Dave Airlie
2b90364765 r600g: improve supported format selection.
This fixes fbo-readpixels piglit test, and adds support for swapping
the formats. Not all formats are correct yet I don't think.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-06 14:53:38 +10:00
Dave Airlie
121a625c16 r600g: add bo wait after map. 2010-08-06 11:46:52 +10:00
Vinson Lee
f717fd25cc st/mesa: Clean up header file inclusion in st_program.h.
st_program.h
Remove p_shader_tokens.h
Include st_context.h for st_context symbol.
Include p_state.h for PIPE_MAX_SHADER_INPUTS symbol.
Remove unnecessary forward declarations.

st_cb_bitmap.c
st_cb_clear.c
Include p_shader_tokens.h now that st_program.h doesn't include it.
2010-08-05 18:21:09 -07:00
Marek Olšák
4d10ec4f18 r300g: do not emit GB_Z_PEQ_CONFIG on non-r500 if DRM < 2.6.0 2010-08-06 03:14:43 +02:00
Ian Romanick
0a86d766ef ir_to_mesa: Handle texture-array samplers
Fixes piglit test array_texture.
2010-08-05 17:57:48 -07:00
Jakob Bornecrantz
1a3a04d56b tgsi: Fix typo, so we follow what is in the comments 2010-08-05 17:53:48 -07:00
Ian Romanick
4f397e1d64 glsl2: Enable all supported extensions in stand-alone compiler 2010-08-05 17:50:13 -07:00
Jakob Bornecrantz
9f5c1194ff tgsi: Add option to stop the sanity checker from printing 2010-08-05 17:44:05 -07:00
Ian Romanick
0a09d679ca glsl_type: Don't have two versions of a type with the same name
Previously some sampler types were duplicated in GLSL 1.30 and
GL_EXT_texture_array.  This resulted in not being able to find the
built-in sampler functions when the extension was used.  When the
built-in functions were compiled, they bound to the 1.30 version.
This caused a type mismatch when trying to find the function.  It also
resulted in a confusing error message:

0:0(0): error: no matching function for call to `texture2DArray(sampler2DArray, vec3)'
0:0(0): error: candidates are: vec4 texture2DArray(sampler2DArray, vec3)

0:0(0): error:                 vec4 texture2DArray(sampler2DArray, vec3, float)
2010-08-05 17:29:15 -07:00
Jakob Bornecrantz
4d65055b1f util: Add option to not dump cpu caps 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
981c6bc6a5 st/mesa: Only get debug option once 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
99611f0849 st/mesa: Only get mesa mvp dp4 option once
The correct for this is of course to do what comment says
2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
e00b17830b llvmpipe: Only get no rast option once 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
4bd061b127 gallivm: Only get debug option once 2010-08-05 17:25:13 -07:00
Ian Romanick
1e0f0459e0 glsl2: Log a better error message when a matching function cannot be found 2010-08-05 17:21:39 -07:00
Vinson Lee
1b8aa2176c st/mesa: Clean up header file inclusion in st_mesa_to_tgsi.h.
st_mesa_to_tgsi.h
Replace tgsi_ureg.h with a forward declaration.
Include p_compiler.h for ubyte symbol.

st_program.c
Include tgsi_ureg.h directly.
2010-08-05 17:15:25 -07:00
Luca Barbieri
bf5ee5aa4f nvfx: fix nv30 vertex program scalar opcodes
Apparently they have always been broken, even before unification.

Fixes a lot of stuff, starting from morph3d and lighting in teapot
with textures disabled.
2010-08-06 01:28:14 +02:00
Luca Barbieri
3e231361f3 nvfx: shut up unknown cap 64 warning 2010-08-06 01:28:14 +02:00
Vinson Lee
0a7cbe845f st/mesa: Clean up header file inclusion in st_manager.h.
Include mtypes.h for GLcontext, gl_buffer_index, and GLframebuffer
symbols.
Include p_compiler.h for boolean symbol.
Include st_context.h in st_cb_eglimage.c as it previously included
st_context.h indirectly through st_manager.h.
2010-08-05 16:20:07 -07:00
Brian Paul
3d038a3ed2 glsl: fix atan(0, -1)
Fixes fd.o bug 29388

NOTE: this is a candidate for the 7.8 branch.
2010-08-05 16:39:09 -06:00
Eric Anholt
bc4034b243 glsl2: Add a pass to convert exp and log to exp2 and log2.
Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG
opcode that doesn't do what we want.  This also lets the multiplication
coefficients in there get constant-folded, possibly.

Fixes:
glsl-fs-log
2010-08-05 15:34:00 -07:00
Alex Deucher
918ef7ff18 r600c: tiling require drm 2.6.0, not 2.5.0 2010-08-05 17:42:29 -04:00
Eric Anholt
8048226b7b glsl2: Insert global declarations at the top of the instruction stream.
Fixes use-before-decl in glslparsertest shaders.

Fixes:
CorrectFull.frag
CorrectModule.frag
2010-08-05 14:41:09 -07:00
Alex Deucher
e93d413a0d r600: add support for getting the tiling config via drm ioctl (v2)
Needed for the the 2D tiling span functions.

v2: rebase on new kernel, mesa changes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:13:10 -04:00
Alex Deucher
3095bc679d r600: add new relocs for tiling support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:12:52 -04:00
Alex Deucher
063c70d7f7 r600: add span support for 2D tiling
Requires tiling config ioctl support from the drm to use.
kms only.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:12:37 -04:00
Eric Anholt
0a0ab121f8 ir_structure_splitting: Massive fixing to this.
I'd missed putting in the actual "find structures to split" part, so
most of the code didn't do anything.  I was running on too large of an
app and assuming the lack of progress was elsewhere.
2010-08-05 13:40:09 -07:00
Eric Anholt
748f81a8ea glsl2: Make the HV actually call ir_texture's visit_leave. 2010-08-05 13:34:02 -07:00
Eric Anholt
7f7eaf0285 ir_structure_splitting: New pass to chop structures into their components.
This doesn't do anything if your structure goes through an uninlined
function call or if whole-structure assignment occurs.  As such, the
impact is limited, at least until we do some global copy propagation
to reduce whole-structure assignment.
2010-08-05 12:56:03 -07:00
Eric Anholt
c314c8f231 glsl2: Fix the dereferences_variable check in ir_tree_grafting.
The HV doesn't descend into ir_variable, which is generally a good
thing (allowing one to distinguish between variable declarations and
refs), but here we never saw tree grafting opportunities killed
because we were looking for the ir_variable child of a dereference to
get visited.

Fixes:
glsl1-function call with inout params
2010-08-05 12:56:03 -07:00
Eric Anholt
b259eb2804 glsl2: Don't tree-grafting out assignment to an out variable.
Fixes:
glsl-deadcode-varying.
2010-08-05 12:56:03 -07:00
Eric Anholt
9f82806c7b glsl2: Don't dead-code eliminate a call where the return value is unused.
This showed up since the disabling of inlining at compile time, which
I apparently didn't regenerate piglit summary for.

Fixes:
glsl-deadcode-call.
2010-08-05 12:56:03 -07:00
Eric Anholt
3bd7e70bf7 glsl2: Add some easy-to-enable debug printfs to ir_dead_code.cpp. 2010-08-05 12:56:02 -07:00
Jerome Glisse
9c949d4a4d r600g: don't use dynamic state allocation for states
Simplify state handly by avoiding state allocation.
Next step is to allocate once for all context packet
buffer and then avoid rebuilding pm4 packet each time
(through use of combined crc) this would also avoid
number of memcpy.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-05 15:41:35 -04:00
Joakim Sindholt
0633c2e683 targets/egl: fix build 2010-08-05 20:42:04 +02:00
Eric Anholt
e995f0e10c ir_to_mesa: Don't do function inlining until linking.
Optimizations at compile time should generally be done with the goal
of reducing instruction count so that other work, particularly
linking, is less time-consuming if the shader is used multiple times.
However, function inlining increases instruction count for the inlined
function bodies without removing the original function body, since we
don't know if it will be used at link time or not.

Reduces the runtime of linking and executing a Yo Frankie fragment
shader from 0.9 seconds to 0.5 seconds (-45.9%, +/- 2.2%, n=5).
2010-08-05 10:18:45 -07:00
Eric Anholt
2e853ca23c glsl2: Add a pass for removing unused functions.
For a shader involving many small functions, this avoids running
optimization across all of them after they've been inlined
post-linking.

Reduces the runtime of linking and running a fragment shader from Yo
Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
2010-08-05 10:18:31 -07:00
Marek Olšák
a4be3b6b31 r300g: fix fb_state atom size 2010-08-05 19:06:09 +02:00
Marek Olšák
fc94fd9bfa r300g: debug_print on startup whether we can use hyper-z 2010-08-05 19:05:11 +02:00
Eric Anholt
c5b9cab499 glsl2: Catch pointless copies in copy propagation.
We wouldn't want to go rewriting dereferences to variables to point at
the same variable it did before.  While I didn't find a way to trigger
that, a shader in Yo Frankie managed to produce a self-assignment by
passing a constant to a function doing self assignment like this.

Cleans up the IR for glsl-deadcode-self-assign.shader_test
2010-08-05 09:17:45 -07:00
Eric Anholt
8f6a0c9ed9 glsl2: Don't try to dump GLSL IR for a shader that didn't compile. 2010-08-05 09:17:45 -07:00
Eric Anholt
9de2c4fc8e ir_to_mesa: Remove debug force-enablement of EmitNoIfs. 2010-08-05 09:17:45 -07:00
Dave Airlie
b5f1044711 r300g: always emit hyperz state atom. 2010-08-05 20:58:51 +10:00
Dave Airlie
41f9e60bb3 r300g: disable hiz on rv530 for now.
On my rv530 at least HiZ is causing rendering issues in gears.
2010-08-05 20:32:06 +10:00
Dave Airlie
6eb2a7fbaf r300g: implement hyper-z support. (v4)
This implements fast Z clear, Z compression, and HiZ support for r300->r500
GPUs.

It also allows cbzb clears when fast Z clears are being used for the ZB.

It requires a kernel with hyper-z support.

Thanks to Marek Olšák <maraeo@gmail.com>, who started this off, and Alex Deucher at AMD for providing lots of hints.

v2:
squashed zmask ram size fix]
squashed r300g/blitter: fix Z readback when compressed]

v3:
rebase around texture changes in master - .1 fix more bits

v4:
migrated to using u_mm in r300_texture to manage hiz/zmask rams consistently
disabled HiZ when using OQ
flush z-cache before turning hyper-z off
update hyper-z state on dsa state change
store depthclearvalue across cbzb clears and replace it afterwards.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-05 20:32:05 +10:00
Keith Whitwell
ccbd9ae7cc docs: clarify point sprite discussion
Plagiarizes email explanation from Roland.
2010-08-05 11:09:14 +01:00
Vinson Lee
5e56c8907b st/mesa: Remove unnecessary header from st_gl_api.h. 2010-08-05 01:38:46 -07:00
Vinson Lee
ea1744a664 mesa: Include missing header in st_get_mipmap.h.
Include mtypes.h for GLcontext symbol.
Add forward declaration for st_context.
2010-08-05 01:23:46 -07:00
Vinson Lee
ad4d27c6d1 st/mesa: Include missing headers in st_format.h. 2010-08-05 00:59:44 -07:00
Vinson Lee
2febc491bc st/mesa: Add forward delcaration in st_extensions.h. 2010-08-05 00:54:27 -07:00
Vinson Lee
4f9ca250d6 st/mesa: Add missing headers to st_draw.h. 2010-08-05 00:52:30 -07:00
Chris Wilson
66708fd8a9 intel: Check for a NULL src buffer prior to blt
This can only happen along a malloc failure path, but check anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:39:15 +01:00
Chris Wilson
85cfe32180 intel: Check for region allocation failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:38:55 +01:00
Kenneth Graunke
f4239872c9 glcpp: Ignore #if and #elif expressions when skipping.
Fixes glcpp test cases 073 and 074, as well as piglit test
xonotic-vs-generic-diffuse.vert.
2010-08-04 23:37:19 -07:00
Kenneth Graunke
d65135a766 glcpp/tests: Add a corollary to testcase 073 for testing #elif. 2010-08-04 23:37:19 -07:00
Kenneth Graunke
c52b2be166 glcpp/tests: Fix 073-if-in-ifdef.c to use #ifdef, not #if.
The original intention was to use #ifdef.
2010-08-04 23:37:19 -07:00
Kenneth Graunke
16b4eed59a glcpp: Refactor HASH_IF and HASH_ELIF expansion to reuse code. 2010-08-04 23:37:18 -07:00
Vinson Lee
9c98e9e6b5 st/mesa: Add missing header in st_context.c. 2010-08-04 21:17:13 -07:00
Vinson Lee
a0989e9437 st/mesa: Add missing header in st_atom_pixeltransfer.c. 2010-08-04 21:13:33 -07:00
Vinson Lee
1525fb4afe st/mesa: Clean up header file inclusion in st_context.h. 2010-08-04 21:09:27 -07:00
Vinson Lee
6f8b6661ce st/mesa: Add missing header in st_cb_xformfb.h. 2010-08-04 20:58:22 -07:00
Eric Anholt
046bef2357 glsl2: Remove the shader_in/shader_out tracking separate from var->mode.
I introduced this for ir_dead_code to distinguish function parameter
outvals from varying outputs.  Only, since ast_to_hir's
current_function is unset when setting up function parameters (they're
needed for making the function signature in the first place), all
function parameter outvals were marked as shader outputs anyway.  This
meant that an inlined function's cloned outval was marked as a shader
output and couldn't be dead-code eliminated.  Instead, since
ir_dead_code doesn't even look at function parameters, just use
var->mode.

The longest Mesa IR coming out of ir_to_mesa for Yo Frankie drops from
725 instructions to 636.
2010-08-04 20:52:33 -07:00
Eric Anholt
a08f27940a glsl2: Remove a dead cut and paste member from ir_variable_refcount_visitor. 2010-08-04 20:52:33 -07:00
Eric Anholt
72fd0568db i965: Settle on printing our program debug to stdout.
Mixing stderr (_mesa_print_program, _mesa_print_instruction,
_mesa_print_alu) with stdout means that when writing both to a file,
there isn't a consistent ordering between the two.
2010-08-04 20:52:33 -07:00
Eric Anholt
455290e428 ir_to_mesa: Print shader source and compiled IR under MESA_GLSL=dump.
While the Mesa IR dumping includes some corresponding GLSL IR for
correlating Mesa IR to GLSL IR, it doesn't completely express it.
This printing includes things like variable declarations and control
flow structure that is hard to read otherwise.
2010-08-04 20:52:33 -07:00
Eric Anholt
e3a90b8e38 glsl2: Use linked ir_constant_variable after linking, instead of unlinked. 2010-08-04 20:52:33 -07:00
Eric Anholt
022f79e496 glsl2: Return progress from ir_vec_index_to_swizzle. 2010-08-04 20:52:33 -07:00
Vinson Lee
cb7638579e st/mesa: Clean up st_cb_viewport.h.
Add inclusion guard.
Add forward declaration.
2010-08-04 17:04:38 -07:00
Vinson Lee
e857293299 st/mesa: Add missing headers in st_cb_texture.h. 2010-08-04 17:00:23 -07:00
Francisco Jerez
bc578caefb dri/nouveau: Don't try to validate uninitialized teximages. 2010-08-05 01:48:14 +02:00
Francisco Jerez
d03f04bfb5 dri/nv20: Fix some PGRAPH_ERRORs seen with DATA_CHECK enabled. 2010-08-05 01:48:14 +02:00
Francisco Jerez
e96a52e993 dri/nouveau: Fix up software mipmap generation. 2010-08-05 01:48:14 +02:00
Ian Romanick
83cb310dbb glsl2: Generate masked assignments in some expanded matrix operations 2010-08-04 16:47:28 -07:00
Ian Romanick
3d58be6135 glsl2: Generate masked assignments in vector and matrix constructors
Previously the in-line matrix and vector constructors would generate
swizzles in the LHS.  The code is actually more clear if it just
generates the masked assignments instead of relying on the
ir_assignment constructor to convert the swizzles to write masks.
2010-08-04 16:47:28 -07:00
Ian Romanick
6235c6a838 glsl2: Additional validation of write masks 2010-08-04 16:47:28 -07:00
Ian Romanick
5a7758efbe glsl2: Add ir_assignment::write_mask and associated methods
Replace swizzles on the LHS with additional swizzles on the RHS and a
write mask in the assignment instruction.  As part of this add
ir_assignment::set_lhs.  Ideally we'd make ir_assignment::lhs private
to prevent erroneous writes, but that would require a lot of code
butchery at this point.

Add ir_assignment constructor that takes an explicit write mask.  This
is required for ir_assignment::clone, but it can also be used in other
places.  Without this, ir_assignment clones lose their write masks,
and incorrect IR is generated in optimization passes.

Add ir_assignment::whole_variable_written method.  This method gets
the variable on the LHS if the whole variable is written or NULL
otherwise.  This is different from
ir->lhs->whole_variable_referenced() because the latter has no
knowledge of the write mask stored in the ir_assignment.

Gut all code from ir_to_mesa that handled swizzles on the LHS of
assignments.  There is probably some other refactoring that could be
done here, but that can be left for another day.
2010-08-04 16:47:27 -07:00
Ian Romanick
8e9ce2eb56 glsl2: Don't try to construct an ir_assignment with an invalid LHS 2010-08-04 16:47:27 -07:00
Vinson Lee
060a95c3a9 st/mesa: Add forward declaration in st_cb_strings.h. 2010-08-04 16:46:42 -07:00
Vinson Lee
e9d6f2fc8a st/mesa: Add missing header in st_cb_readpixels.h.
Include mtypes.h for GLcontext symbol.
2010-08-04 16:40:04 -07:00
Vinson Lee
a25ac9b526 st/mesa: Clean up header file inclusion in st_cb_rasterpos.h. 2010-08-04 16:33:10 -07:00
Eric Anholt
8dbdcb0b43 glsl2: Constant fold the children of many more ir_instruction types. 2010-08-04 16:25:56 -07:00
Eric Anholt
6ecf62f673 glsl2: Return a real progress value from constant folding. 2010-08-04 16:25:56 -07:00
Eric Anholt
3d23f0a90c glsl2: Refactor constant folding of rvalues to a function. 2010-08-04 16:25:56 -07:00
Vinson Lee
2bb3bfa943 st/mesa: Add missing header in st_cb_program.h.
Include mtypes.h for GLcontext symbol.
2010-08-04 16:13:15 -07:00
Kenneth Graunke
0ef79a5f11 glcpp: Refresh autogenerated lexer and parser. 2010-08-04 15:57:20 -07:00
Kenneth Graunke
1ffc1cd861 glcpp: Remove xtalloc wrappers in favor of plain talloc.
Calling exit() on a memory failure probably made sense for the
standalone preprocessor, but doesn't seem too appealing as part of
the GL library.  Also, we don't use it in the main compiler.
2010-08-04 15:57:20 -07:00
Kenneth Graunke
ad98aa9d93 glsl2: Remove uses of deprecated TALLOC_CTX type. 2010-08-04 15:57:19 -07:00
Vinson Lee
7f7bbf0d5b r300/compiler: Remove unnecessary header. 2010-08-04 15:45:41 -07:00
Vinson Lee
81bc4f4cbf intel: Remove unnecessary header. 2010-08-04 15:38:24 -07:00
Vinson Lee
9f7e7ce757 st/mesa: Add missing headers in st_cb_flush.h.
Add forward declarations.
Include p_compiler.h for uint symbol.
2010-08-04 15:32:53 -07:00
Vinson Lee
85dbb2904b st/mesa: Clean up header inclusion in st_cb_feedback.h.
Replace mtypes.h with forward declaration.
Include compiler.h for INLINE symbol.
2010-08-04 15:26:37 -07:00
Aras Pranckevicius
ea3a9eb53a glsl2: add gl_LightModel built-in uniform. 2010-08-04 14:41:01 -07:00
Eric Anholt
b6ceddc371 glsl2: Don't try to assign locations for samplers during linking.
Mesa will do the mapping at _mesa_add_sampler() time.  Fixes assertion
failures in debug builds, which might have caught real problems with
multiple samplers linked in a row.
2010-08-04 14:28:57 -07:00
Eric Anholt
fe1918c71c ir_to_mesa: Clean up the mapping of samplers to Mesa's sampler uniforms.
Instead of using a linker-assigned location (since samplers don't
actually take up uniform space, being a link-time choice), use the
sampler's varaible pointer as a hash key.
2010-08-04 14:21:01 -07:00
Eric Anholt
8e181b629f mesa: Don't null deref looking for Mesa IR code at compile time.
The new compiler doesn't generate Mesa IR at compile time, and that
compile time code previously wouldn't have reflected the link time
code that actually got used.  But do dump the info log of the compile
regardless.
2010-08-04 14:13:08 -07:00
Jerome Glisse
12dac449fb r600g: force flush on map as temporary fix to readpixel
Should allow more piglit test to pass. Need to plugin
proper flushing.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:29:56 -04:00
Vinson Lee
2e85117b5f st/mesa: Add missing headers to st_cb_fbo.h. 2010-08-04 13:18:55 -07:00
Jerome Glisse
9a78e790dc r600g: always perform texture perspective divide + fix blending
quake3 engine seems to run fine at this point (ioquake)

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:11:39 -04:00
Vinson Lee
19bfb55fb5 st/mesa: Clean up header file inclusion in st_cb_eglimage.h.
Replace dd.h and mtypes.h with a forward declaration.
Include compiler.h for INLINE symbol.
2010-08-04 13:04:36 -07:00
Eric Anholt
952d0f88e1 glsl2: Skip talloc_parent in constant_expression of non-constant arrays. 2010-08-04 12:57:58 -07:00
Vinson Lee
988e86762f draw: Fix return type of draw_translate_vinfo_size.
Fixes typo from commit b609cfc7c9.
2010-08-04 12:55:21 -07:00
Vinson Lee
137c510097 st/mesa: Clean up header file inclusion in st_cb_drawtex.h.
Replace mtypes.h with forward declarations.
Include compiler.h for INLINE symbol.
2010-08-04 12:46:38 -07:00
Eric Anholt
8273bd4687 glsl2: Make the clone() method take a talloc context.
In most cases, we needed to be reparenting the cloned IR to a
different context (for example, to the linked shader instead of the
unlinked shader), or optimization before the reparent would cause
memory usage of the original object to grow and grow.
2010-08-04 12:42:47 -07:00
Vinson Lee
dce63cf431 st/mesa: Clean up header file inclusion in st_cb_drawpixels.h.
Replace mtypes.h with forward declarations.
Include compiler.h for INLINE symbol.
2010-08-04 12:29:26 -07:00
Vinson Lee
7fdf6d5c28 st/mesa: Add forward declaration in st_cb_condrender.h. 2010-08-04 12:24:51 -07:00
Vinson Lee
ed810ba724 st/mesa: Add forward declarations in st_cb_clear.h. 2010-08-04 12:22:31 -07:00
Vinson Lee
6bc17324da st/mesa: Include missing headers in st_cb_bufferobjects.h.
Include compiler.h for INLINE symbol.
Include mtypes.h for gl_buffer_object symbol.
2010-08-04 12:13:29 -07:00
Vinson Lee
eb4f2d4b02 st/mesa: Clean up header file inclusion in st_cb_blit.h.
Replaced mtypes.h and st_context.h with forward declarations.
Added compiler.h for INLINE symbol.
2010-08-04 12:08:17 -07:00
Vinson Lee
e6902afeee st/mesa: Clean up header file inclusion in st_cb_bitmap.h.
Removed mtypes.h.
Include compiler.h for INLINE symbol.
Added forward declarations.
2010-08-04 12:00:19 -07:00
Kristian Høgsberg
2542d8e0c2 glx: Move deref after NULL check 2010-08-04 12:51:26 -04:00
Aras Pranckevicius
84ee01f40a glsl2: Set ir_discard::ir_type when cloning it
Fixes unset ir_type after inlining.
2010-08-04 08:57:02 -07:00
Kristian Høgsberg
e3a0e468bc glx: Fix use after free in drisw error path 2010-08-04 08:57:02 -04:00
Kristian Høgsberg
e71c44cedd glx: We no longer need screen extensions for drisw
https://bugs.freedesktop.org/show_bug.cgi?id=29177
2010-08-04 08:52:26 -04:00
Kristian Høgsberg
9da1c9da13 glx: dri2InvalidateBuffers() needs the X drawable XID not the GLX one
This never ceases to entertain.
2010-08-04 08:47:36 -04:00
Andre Maasikas
8ad5b76d52 r600: relax stride/alignment requirements for vertices
seems hw can do unaligned accesses and unaligned strides
removes extra conversion when using vbo's

however I needed to switch 3 component byte format to 4 component formats
for tests to pass. Somewhat sililar to GL_SHORT fix done earlier

removes assert and gains +2 piglit especially draw-vertices
2010-08-04 12:49:39 +03:00
Chia-I Wu
5c2f01bbb0 draw: Fix the edge flags of flatshade_first polygons.
This bug can be triggered by rendering polygons with

   glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT);
   glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
2010-08-04 14:03:05 +08:00
Tom Stellard
09c8fa570e r300/compiler: Always unroll loops when doing loop emulation. 2010-08-03 20:17:00 -07:00
Tom Stellard
2824d5687a r300/compiler: r500 hw support for break and continue in loops.
The BGNLOOP and ENDLOOP instructions are now being used correctly, which
makes break and continue possible.  The deadcode pass has been modified to
handle breaks, and the compiler is more careful about which loops are
unrolled.
2010-08-03 19:11:08 -07:00
Tom Stellard
9dcc500666 r300/compiler: KILP may not always be inside an IF statement. 2010-08-03 19:11:08 -07:00
Tom Stellard
680f486ffd r300/compiler: Don't unroll loops with continue or break. 2010-08-03 19:11:08 -07:00
Vinson Lee
a3ff6c2697 st/mesa: Clean up header file inclusion in st_cache.h. 2010-08-03 17:55:53 -07:00
Vinson Lee
279926859e st/mesa: Add forward declarations in st_atom_shader.h. 2010-08-03 17:35:29 -07:00
Dave Airlie
8bc5fe1ad6 r300g: disable multisample visuals until the state tracker bits catch up.
This stops us advertising lots of ms visuals we can't actually use.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-04 09:37:43 +10:00
Brian Paul
48268e0f2a draw: check for instance divisors in vcache_check_run()
When we have instance divisors we don't really know which vertex
elements we'll be fetching ahead of time.

This fixes a bug in instanced drawing which was exposed by the new
draw_vbo() code because of max_index not being ~0 as often as it used
to be.  The test for max_index >= DRAW_PIPE_MAX_VERTICES often hid
this problem before.
2010-08-03 16:37:58 -06:00
Brian Paul
e89e47e6d0 gallium/translate: make generic_run() and generic_run_elts() more alike
Plus more debug code and do clamping in generic_run().
2010-08-03 16:37:58 -06:00
Brian Paul
8c3cc83432 draw: added a comment 2010-08-03 16:37:58 -06:00
Brian Paul
0e7b53c75b draw: use instance divisor in draw_print_arrays() 2010-08-03 16:37:58 -06:00
Brian Paul
f94e7e25d1 draw: add assertion, rearrange debug code 2010-08-03 16:37:58 -06:00
Marek Olšák
afbf446de5 st/dri: fix crash when dri2_drawable_get_buffers fails
It's easily reproducible with Compiz with its Resize window mode
set to Normal (which is usually not the default mode).

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

This is actually a workaround to prevent Compiz crashes.
Instead, a completely white titlebar might show up during resizing
transparent windows (a rare case).

The underlying cause should be fixed by someone who has more knowledge
about the code. (dri2_drawable_get_buffers should not return NULL)

Acked-By: Jakob Bornecrantz <jakob@vmware.com>
2010-08-04 00:07:28 +02:00
Marek Olšák
0614006d09 mesa: increase the relative address offset limit to 4096 in ARB_vp/fp
Even though the spec says that the limits should be -64/+63, proprietary
drivers support much larger relative offsets and some applications do
depend on this non-standard behavior.

Also program_parse.tab.c has been regenerated.

This fixes the parser error:

  ARB_vp: error: relative address offset too large

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

4096 * sizeof(vec4) is the maximum size of the constant buffer on NV50.
It is not supposed to be a definite hardware limit, it is for the parser
not to get in the way and let the underlying driver decide whether it can
run the shader or not.
2010-08-04 00:07:28 +02:00
Jerome Glisse
dd863bf5e7 r600g: add polygon offset support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 17:45:51 -04:00
Jerome Glisse
a0b3944c30 r600g: flush and resubmit if we reach limit
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 17:02:48 -04:00
Jerome Glisse
3a8d4a8979 r600g: fix color target mask
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 16:16:01 -04:00
Zack Rusin
6f9d3516a4 gallium/draw: forgot about PIPE_PRIM_LINE_STRIP_ADJACENCY 2010-08-03 16:02:09 -04:00
Zack Rusin
1fd84b10f2 gallium/util: add extra primitives to the trimmer 2010-08-03 15:56:49 -04:00
Jerome Glisse
8f6341d421 r600g: fix stencil
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 15:49:21 -04:00
Eric Anholt
c22dee7216 glsl2: Fix ir_validate validating null variable names.
An unnamed variable in a prototype will have a NULL ->name, so don't
worry about storage then.

Fixes:
CorrectFunction1.vert
CorrectParse1.frag
2010-08-03 11:47:02 -07:00
Eric Anholt
900ab2f564 glsl2: No need to strdup the name passed in to ir_variable constructor.
ir_variable always strdups the incoming name so that it matches the
lifetime of the ir_variable.
2010-08-03 11:40:26 -07:00
Jerome Glisse
7e42b7e5d2 r600g: fix LIT + fix multiple constant one ALU + fix ALU block splitting
Make sure LIT fills all slot for instruction (can't do W instruction
without having the Z slot filled with at least a NOP).

ALU instruction can't access more than 4 constant, move constant to
temporary reg if we reach the limit.

Fix ALU block splitting, only split ALU after ALU with last instruction
bit sets.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 14:31:49 -04:00
Marek Olšák
57438adf32 r300g: handle polygon offset correctly
https://bugs.freedesktop.org/show_bug.cgi?id=29372
2010-08-03 15:53:26 +02:00
Vinson Lee
9c6b5a4407 st/mesa: Add forward declarations in st_atom_constbuf.h. 2010-08-03 01:20:13 -07:00
Vinson Lee
df66c641e3 st/mesa: Include glheader.h in st_atom.h.
Include glheader.h for GLenum symbol.
2010-08-03 01:14:37 -07:00
Vinson Lee
816ad9bc23 mesa: Clean up header file inclusion in m_xform.h.
Include compiler.h for CONST symbol.

Remove config.h as m_xform.h uses no additional symbols from config.h.
2010-08-03 00:51:51 -07:00
Vinson Lee
19f7db9c9c mesa: Reduce header file inclusion in m_translate.h.
m_translate.h does not use any additional symbols added by config.h.
2010-08-03 00:41:19 -07:00
Vinson Lee
29495bbb84 mesa: Include missing header in m_matrix.h. 2010-08-03 00:33:04 -07:00
Vinson Lee
d356ad349b mesa: Reduce header file inclusion in texgen.h.
texgen.h doesn't use any symbols additionally added by mtypes.h.
2010-08-03 00:19:26 -07:00
Vinson Lee
b5ce878fa7 mesa: Reduce header file inclusion in texcompress_fxt1.h.
texcompress_fxt1.h doesn't use any additional symbols added by mtypes.h.
2010-08-03 00:04:14 -07:00
Vinson Lee
f7d29d5881 mesa: Reduce header file inclusion in syncobj.h.
syncobj.h doesn't use any additional symbols that is added by context.h.
2010-08-02 23:53:23 -07:00
Eric Anholt
c8babd5d9b glsl2: Fix typo in clamp() constant builtin using uint instead of int.
I take back the bad things I've said about the signed/unsigned
comparison warning now.
2010-08-02 17:50:20 -07:00
Eric Anholt
47f305a4fc ir_to_mesa: Add support for 1.20 uniform initializers.
Fixes:
glsl-uniform-initializer-1
glsl-uniform-initializer-2
glsl-uniform-initializer-3
glsl-uniform-initializer-4
glsl1-GLSL 1.20 uniform array constructor
2010-08-02 17:47:35 -07:00
Eric Anholt
5704ed27dd glsl2: Don't consider uniform initializers as constant expressions.
We were happily optimizing away the body of
glsl-uniform-initializer-* to never use the uniforms.
2010-08-02 17:47:35 -07:00
Eric Anholt
b10bb527ea Initialize a couple of HasIndex2 fields on Mesa IR src regs. 2010-08-02 17:47:35 -07:00
Eric Anholt
26675e37bc ir_to_mesa: Support for struct uniforms.
Fixes glsl-uniform-struct.
2010-08-02 17:47:35 -07:00
Eric Anholt
9c02412cdc ir_to_mesa: Add a constructor for ir_to_mesa_src_reg.
This helps makes sure we don't miss any new fields, and makes totally
uninitialized src_regs be PROGRAM_UNDEFINED.
2010-08-02 17:47:35 -07:00
Carl Worth
1575070bfe glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects.
This is a zero-ing function, (like calloc), to avoid bugs due to
accessing uninitialized values. Thanks to valgrind for noticing the
use of uninitialized values.
2010-08-02 17:27:56 -07:00
Jerome Glisse
f031817450 r600g: split alu block to conform to limit + RCP opcode
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02 17:41:52 -04:00
Ian Romanick
42f3e7b6d7 glsl_type: Use string key for array type hash 2010-08-02 13:53:33 -07:00
Ian Romanick
955ceef47f Keep a local copy of the symbol name in the symbol table
The symbol_header structure that tracks symbols with a particular name
may have a different (longer) life time than the symbols it tracks.
Not keeping a local copy of the name can lead to use-after-free
errors.  For example, the following sequence would trigger such an
error:

    char *copy = strdup(name);

    _mesa_symbol_table_push_scope(st);
    _mesa_symbol_table_add_symbol(st, 0, name, NULL);
    _mesa_symbol_table_pop_scope(st);
    free(name);
    _mesa_symbol_table_find_symbol(st, 0, copy);

With this change, the symbol table keeps a local copy of the name that
has the same life time as the symbol_header for that name.  This
resolves some use-after-free errors with built-in functions in the
GLSL compiler.
2010-08-02 13:53:32 -07:00
Ian Romanick
7ffe40532f glsl2: Clean-up two 'unused variable' warnings 2010-08-02 13:53:32 -07:00
Ian Romanick
cf41c8a0d8 glsl2: Make glsl_types::ctx private again 2010-08-02 13:53:32 -07:00
Eric Anholt
eb7e120f0f glsl2: Fix expression type in builtin tan().
Fixes glsl-fs-tan-1.
2010-08-02 12:33:18 -07:00
Eric Anholt
ee7666b5ac glsl2: Add validation that talloc ownership of ir_* names is right. 2010-08-02 12:08:52 -07:00
Eric Anholt
e75dbf66d0 glsl2: Fix validation for ir_unop_not.
We use vector ir_unop_not to implement builtin not(), and that seems fine.
2010-08-02 12:06:34 -07:00
Eric Anholt
47f3f22311 glsl2: Add support for floating constants like "1f".
Fixes glsl-floating-constant-120.
2010-08-02 11:26:43 -07:00
Jerome Glisse
313df41562 r600g: add autogenerated reg definition + debug print cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02 14:22:58 -04:00
Eric Anholt
960ba0014a glsl2: Initialize the ARB_fcc fields of ir_variable.
Fixes intermittent failure in glsl-arb-fragment-coord-conventions.
2010-08-02 11:20:32 -07:00
Eric Anholt
b8db38e1c4 glsl2: Also initialize the identifier field of parameter_declarator.
The non-named parameter grammar understandably doesn't set the
identifier field.  Fixes intermittent failures about void main(void)
{} having a named void parameter.
2010-08-02 11:04:54 -07:00
Eric Anholt
004e924014 glsl2: Fix spelling of "precision" in error output. 2010-08-02 10:59:46 -07:00
Eric Anholt
f311d8e9e9 glsl2: Don't add mesa/program/ as an include dir. Let includes say program/. 2010-08-02 10:59:46 -07:00
Aras Pranckevicius
31747155ea glsl2: Give the path within src/mesa/ for headers instead of relying on -I. 2010-08-02 10:59:46 -07:00
Aras Pranckevicius
b35703df10 glsl2: initialize is_array and array_size of ast_parameter_declarator
The non-array path of glsl_parser.ypp wasn't setting is_array to false.
2010-08-02 10:59:42 -07:00
Mario Kleiner
646d2e9fbc radeon: Add DRI2 flush extension support, so we synchronize properly.
When a DRI2 swap buffer is pending we need to make sure we
have the flush extension so radeon doesn't resume rendering to
or reading from the not yet blitted front buffer.

This fixes:

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

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-08-02 13:29:44 -04:00
Jerome Glisse
3d39f56a87 Revert "radeon: Add DRI2 flush extension to so we synchronize properly."
This reverts commit 8446f257b3.
2010-08-02 13:28:15 -04:00
Marek Olšák
afa925066c r300g: fix hardlock when using more than one stuffed sprite coords
If texture coordinates come from the vertex shader, there are always
4 components in the rasterizer input packet, but if the coordinates
are stuffed (like for point sprites), there are only 2 or 3 components
(based on GB_ENABLE) and if we rasterize more, it locks up.
2010-08-02 17:26:23 +02:00
Mario Kleiner
8446f257b3 radeon: Add DRI2 flush extension to so we synchronize properly.
When DRI2 swap buffer is pending (copy buffer not pageflipping)
we need to make sure we have the flush extension so radeon doesn't
resume rendering on the not yet blitted front buffer.

Modified version of Jerome's patch to add flush extension
in the correct place.

This prepares a possible fix for:

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

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-08-02 10:43:51 -04:00
Kristian Høgsberg
1f1928db00 glx: Drop _Xglobal_lock while we create and initialize glx display 2010-08-02 09:53:44 -04:00
Andre Maasikas
d6a5f94ea4 r600: fix sin,cos functions on r600
r600 doesnt need the same normalization as r700 - instead it requires
range to be truncated to -pi..pi

I left the range trunc also effective on r700 althouch according the docs
it has sufficent range (-512*PI, +512*PI). The instructions seem
to be used not too often to cause perf loss because of this

Based on patches and testing by Conn Clark and Alain Perrot
2010-08-02 15:11:22 +03:00
Michal Krol
c1f33097f4 util: Fix unpacking of R8G8Bx_SNORM format.
Apparently, we must always use integers to perform calculations,
otherwise the results won't match D3D's CxV8U8 definition.
2010-08-02 14:06:37 +02:00
Dave Airlie
4af5f11c32 r600g: add stencil op/func translation 2010-08-02 16:27:15 +10:00
Dave Airlie
3f4ec394b0 r600g: initial alpha test state 2010-08-02 16:27:15 +10:00
Dave Airlie
7bcd39ce50 r600g: add initial blend state.
migrates cb_cntl to be regenerated
2010-08-02 16:27:01 +10:00
Dave Airlie
01984cf34f r600g: set correct tex coord type for rect textures. 2010-08-02 14:56:20 +10:00
Dave Airlie
919750a557 r600g: make r600_db_format static.
this isn't used anywhere else yet.
2010-08-02 14:31:49 +10:00
Eric Anholt
6a41626e90 glsl2: Make non-square matrix keywords not keywords pre-120.
Fixes glsl-mat-110.
2010-08-01 19:11:10 -07:00
Dave Airlie
aef4500ca4 draw: fix warning in sse code.
Not sure if this will actually fix the issue, but it fixes the warning.
2010-08-02 08:57:14 +10:00
Marek Olšák
a87cedbde0 r300g: fix microtiling on RS6xx
Getting tiling right has always been tricky.
There are so many subtle details...
2010-08-01 22:16:57 +02:00
Eric Anholt
b42519108d ir_to_mesa: Add support for MESA_GLSL=log.
This is the option that dumps shader source to files in the current
directory.
2010-08-01 11:41:02 -07:00
Eric Anholt
93b10bd353 glcpp: Add a testcase for the failure in compiling xonotic's shader.
gcc and mesa master agree that this is OK.
2010-08-01 11:40:07 -07:00
Vinson Lee
9846b06271 mesa: Remove inclusion of compiler.h from mtypes.h.
mtypes.h does not use any symbols from compiler.h.

Also add the required headers for files that depended on symbols from
compiler.h but were indirectly including compiler.h through mtypes.h.
2010-07-31 23:04:41 -07:00
Vinson Lee
e7242b6e8a mesa: Remove unnecessary header from mm.h. 2010-07-31 20:53:42 -07:00
Vinson Lee
ca2ceca5b1 mesa: Add headers containing sybmols used by mm.c. 2010-07-31 20:51:13 -07:00
Vinson Lee
1d74a1674c r600g: Remove unnecessary header. 2010-07-31 19:23:14 -07:00
Vinson Lee
8b909144a1 mesa: Reduce header file inclusion in get.h.
get.h only needs the GL headers.
2010-07-31 16:28:13 -07:00
Vinson Lee
9e75ac7d25 mesa: Include missing headers in vtxfmt.h.
Include compiler.h for INLINE symbol.
Include mtypes.h for GLcontext symbol.
2010-07-31 16:15:08 -07:00
Vinson Lee
dda9b80d07 mesa: Include missing header in shared.h.
Include mtypes.h for GLcontext symbol.
2010-07-31 16:13:05 -07:00
Vinson Lee
da93fba85d mesa: Include missing header in restart.h. 2010-07-31 16:10:14 -07:00
Eric Anholt
f6b03f3235 glsl2: Do algebraic optimizations after linking as well.
Linking brings in inlining of builtins, so we weren't catching the
(rcp(/sqrt(x)) -> rsq(x)) without it.
2010-07-31 15:52:24 -07:00
Eric Anholt
784695442c glsl2: Add new tree grafting optimization pass. 2010-07-31 15:52:21 -07:00
Eric Anholt
d72edc4ddd glsl2: Factor out the variable refcounting part of ir_dead_code.cpp. 2010-07-31 15:52:21 -07:00
Vinson Lee
e4ad42d421 mesa: Include missing headers in renderbuffer.h. 2010-07-31 15:45:40 -07:00
Vinson Lee
6d86b0116e mesa: Include missing header in remap.h.
Include compiler.h for INLINE symbol.
2010-07-31 15:39:35 -07:00
Vinson Lee
5fa1af0905 r600g: Remove unnecessary header. 2010-07-31 14:56:53 -07:00
Vinson Lee
245d5a8913 mesa: Remove unnecessary headers. 2010-07-31 14:37:32 -07:00
Vinson Lee
dba7875cda swrast: Remove unnecessary headers. 2010-07-31 13:35:17 -07:00
Vinson Lee
db71bdc31c egl: Fix '_eglAddAtExitCall' implicit declaration warning. 2010-07-31 13:28:32 -07:00
Aras Pranckevicius
1c325af4d6 glsl2: Fix stack smash when ternary selection is used. 2010-07-31 12:00:01 -07:00
Chia-I Wu
6c7e0b95a4 egl: Add checks for EGL_MESA_screen_surface.
This allows Mesa EGL to be compiled with eglext.h that does not define
EGL_MESA_screen_surface.
2010-07-31 17:49:32 +08:00
Vinson Lee
3cc471e429 tnl: Remove unnecessary headers. 2010-07-31 00:55:13 -07:00
Vinson Lee
ca0b0899d8 st/dri: Remove unnecessary headers. 2010-07-31 00:41:43 -07:00
Vinson Lee
2f30a83ea8 mesa: Include missing header in pixelstore.h.
Include mtypes.h for GLcontext symbol.
2010-07-30 23:32:32 -07:00
Vinson Lee
378b8df47a mesa: Include missing headers in nvprogram.h. 2010-07-30 23:30:38 -07:00
Eric Anholt
3fa1b85196 glsl2: Fix the implementation of atan(y, x).
So many problems here.  One is that we can't do the quadrant handling
for all the channels at the same time, so we call the float(y, x)
version multiple times.  I'd also left out the x == 0 handling.  Also,
the quadrant handling was broken for y == 0, so there was a funny
discontinuity on the +x side if you plugged in obvious values to test.

I generated the atan(float y, float x) code from a short segment of
GLSL and pasted it in by hand.  It would be nice to automate that
somehow.

Fixes:
glsl-fs-atan-1
glsl-fs-atan-2
2010-07-30 15:19:00 -07:00
Jerome Glisse
094d66f459 r600g: add KIL opcode support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 18:05:07 -04:00
Carl Worth
ec9675ec53 ast: Initialize location data in constructor of all ast_node objects.
This prevents using uninitialized data in _msea_glsl_error in some
cases, (including at least 6 piglit tests). Thanks to valgrind for
pointing out the problem!
2010-07-30 15:03:37 -07:00
Eric Anholt
40f57c2bec ir_to_mesa: Add the function name as a comment to BGNSUB and ENDSUB. 2010-07-30 14:57:44 -07:00
Eric Anholt
5e5583ee06 glsl2: Update the callee pointer of calls to newly-linked-in functions.
Otherwise, ir_function_inlining will see the body of the function from
the unlinked version of the shader, which won't have had the lowering
passes done on it or linking's variable remapping.
2010-07-30 14:57:22 -07:00
George Sapountzis
873ddf547d st/dri: move backend hooks to appropriate object 2010-07-30 23:43:26 +03:00
George Sapountzis
a30b966f83 st/dri: drop dri1_helper 2010-07-30 23:43:26 +03:00
George Sapountzis
2e4ad14a52 st/dri: mv driDriverAPI to backends 2010-07-30 23:43:26 +03:00
Kenneth Graunke
939a1807fe glsl2: Initialize ir_function_signature::is_built_in.
Fixes a valgrind error.
2010-07-30 13:30:11 -07:00
Brian Paul
b3e3d0da58 st/mesa: better handling of indirect addressing of temp/const register files
With gl_program::IndirectRegisterFiles we can distinguish between indirect
addressing of constants vs. temporaries.  In the case of temporaries,
declare all temps up front sequentially.

Fixes fd.o bug 29305.
2010-07-30 14:29:19 -06:00
Brian Paul
56643096f1 mesa: added gl_program::IndirectRegisterFiles field
Now drivers, etc. can know which register files are accessed with
indirect addressing.  Before we just checked gl_program::NumAddressRegs
but didn't know if that was the constant buffer, temp regs, or what.

The only user of this new field so far will be the gallium state tracker.
2010-07-30 14:29:19 -06:00
Kenneth Graunke
805cbf3922 glcpp: Don't look for backslashes before the beginning of the string.
Fixes a valgrind error.
2010-07-30 13:26:14 -07:00
Vinson Lee
79ab5b9798 llvmpipe: Silence unused value warning. 2010-07-30 13:11:14 -07:00
Vinson Lee
c4c2897367 mesa: Add missing header to multisample.h.
Include mtypes.h for GLcontext symbol.
2010-07-30 13:00:13 -07:00
Zack Rusin
dd406cf341 draw: actually a noop, rather than not implemented
we just have nothing to do in it right now
2010-07-30 15:42:50 -04:00
Vinson Lee
dbfe11c7c3 mesa: Remove unnecessary header from colormac.h. 2010-07-30 12:32:47 -07:00
Brian Paul
ce1fed1659 tgsi: remove incorrect assertion 2010-07-30 13:28:42 -06:00
Vinson Lee
1a537b639e mesa: Remove unnecessary headers. 2010-07-30 12:13:17 -07:00
Vinson Lee
078eff659a llvmpipe: Fix implicit declaration of lp_func_delete_body warnings. 2010-07-30 11:48:48 -07:00
Chia-I Wu
0e7d7d3051 util: Fix the range of util_draw_elements_instanced.
Keep min_index and max_index at their defaults (0 and ~0).
2010-07-30 23:45:56 +08:00
Zack Rusin
042018a943 llvmpipe: delete function bodies after generating machine code 2010-07-30 16:25:29 +01:00
Jerome Glisse
6c288d06ac r600g: fix typo in tex instruction + shader semantic id fix
It seems we never get semantic id from TGSI so fallback
to use output number as id.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 11:12:10 -04:00
Li Peng
c33c1912dd configure: fix wrong variable name GLESv1_LIB_DEPS
GLESv1_CM_LIB_DEPS is defined in "configs/autoconf.in",
but configure.ac uses GLESv1_LIB_DEPS.

Signed-off-by: Li Peng <peng.li@linux.intel.com>
2010-07-30 08:52:58 -04:00
Keith Whitwell
f623d06c49 util: more helpers for old draw code 2010-07-30 10:47:20 +01:00
Vinson Lee
3fdd9fa556 mesa: Include macros.h in files that use symbols from macros.h.
Don't rely on inclusion of other files that already include macros.h.
2010-07-30 00:41:08 -07:00
Vinson Lee
bddbdd624f mesa: Include macros.h in attrib.c for COPY_4FV symbol. 2010-07-30 00:18:09 -07:00
Vinson Lee
11fce3a821 intel: Add missing header to intel_context.c.
Fixes "implicit declaration of function
_mesa_get_incomplete_framebuffer" warning.
2010-07-30 00:06:40 -07:00
Vinson Lee
5264615b52 mesa: Reduce clip.h header file inclusion. 2010-07-30 00:00:22 -07:00
Vinson Lee
95e3832b53 mesa: Add missing header to framebuffer.h.
Include mtypes.h for GLvisual and GLcontext symbols.
2010-07-29 23:53:13 -07:00
Vinson Lee
c6466f599c mesa: Add missing header to fboject.h.
Add mtypes.h for GLcontext symbol.
2010-07-29 23:50:32 -07:00
Vinson Lee
f58ec9dc4d mesa: Add missing header to texgetimage.h. 2010-07-29 23:41:46 -07:00
Vinson Lee
b5de2be8e0 mesa: Add missing header to texrender.h.
Add mtypes.h for GLcontext symbol.
2010-07-29 23:38:17 -07:00
Vinson Lee
1978247f85 mesa: Add missing header and forward declarations to uniforms.h. 2010-07-29 23:04:50 -07:00
Vinson Lee
3ef2a490d2 mesa: Add missing headers to viewport.h. 2010-07-29 22:57:54 -07:00
Vinson Lee
86abec0294 mesa: Add missing header to depthstencil.h.
Add mtypes.h for GLcontext symbol.
2010-07-29 22:43:42 -07:00
Vinson Lee
989c60bc92 mesa: Add missing headers to debug.h. 2010-07-29 22:41:03 -07:00
Vinson Lee
dfc7b7212f intel: Add missing header.
Add context.h for NEED_SECONDARY_COLOR symbol.
2010-07-29 19:10:14 -07:00
Vinson Lee
ebdc537ff7 dri: Add missing header to dri_metaops.c.
Add context.h for FLUSH_VERTICES symbol.
2010-07-29 19:04:43 -07:00
Vinson Lee
7e54c4a646 mesa: Reduce clear.h header file inclusion. 2010-07-29 18:15:41 -07:00
Vinson Lee
e5c128379a mesa: Reduce bufferobj.h header file inclusion.
Directly include mtypes.h instead of including context.h to include
mtypes.h.
2010-07-29 18:03:20 -07:00
Vinson Lee
bbe1385201 mesa: Remove unnecessary headers. 2010-07-29 17:14:32 -07:00
Brian Paul
e75da1a8d6 llvmpipe: fix on-debug build breakage 2010-07-29 17:49:49 -06:00
Brian Paul
6c1625cc40 llvmpipe: added some jit debug code
If we crash in the jitted function we can examine jit_line and
jit_state in gdb to learn more about the shader.
2010-07-29 17:31:18 -06:00
Brian Paul
b4c8de1ff2 draw: do bounds checking of array elements (debug only)
Make sure that all the element indexes actually lie inside the vertex
buffer.

Also, rename pipe_run() to pipe_run_elts() to be more specific.

And assert/check the vertex count for the non-indexed case.
2010-07-29 17:25:54 -06:00
Brian Paul
d88b6e19c1 draw: assorted clean-ups in clipper code 2010-07-29 17:25:54 -06:00
Brian Paul
ba2cc3b8e6 gallium: implement bounds checking for constant buffers
Plumb the constant buffer sizes down into the tgsi interpreter where
we can do bounds checking.  Optional debug code warns upon out-of-bounds
reading.  Plus add a few other assertions in the TGSI interpreter.
2010-07-29 17:25:54 -06:00
Brian Paul
8a2933f366 draw: add vertex buffer offset in draw_print_arrays() 2010-07-29 17:25:54 -06:00
Brian Paul
d1f38baa01 llvmpipe: silence warnings in lp_test_sincos.c 2010-07-29 17:25:54 -06:00
Jerome Glisse
7a73390f91 r600g: mipmap early support + EX2/ABS instruction + culling
Add mipmap support (demos/src/redbook/mipmap is working)
Add EX2/ABS shader instruction support.
Add face culling support.

Misc fixes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-29 19:05:57 -04:00
Eric Anholt
0cf545ec69 glsl2: Do ir_if_return on the way out, not the way in.
The problem with doing it on the way in is that for a function with
multiple early returns, we'll move an outer block in, then restart the
pass, then move the two inside returns out, then never move outer
blocks in again because the remaining early returns are inside an else
block and they don't know that there's a return just after their
block.  By going inside-out, we get the early returns stacked up so
that they all move out with a series of
move_returns_after_block().

Fixes (on i965):
glsl-fs-raytrace-bug27060
glsl-vs-raytrace-bug26691
2010-07-29 15:56:17 -07:00
Kristian Høgsberg
e3e25dee20 glx: Fix copy/paste bug in glXWaitX and glXWaitGL
https://bugs.freedesktop.org/show_bug.cgi?id=29304
2010-07-29 18:49:10 -04:00
Kristian Høgsberg
f485ee724d glx: Compare old ctx against dummyCtx, not NULL
https://bugs.freedesktop.org/show_bug.cgi?id=29302
2010-07-29 18:49:10 -04:00
Eric Anholt
a62ef12ef2 glsl2: Make sure functions end with a return before doing ir_if_return.
This catches a few remaining functions that weren't getting inlined,
generally operating on global or out variables and using an early
return to skip work when possible.

Fixes for i965:
glsl1-function with early return (3)
2010-07-29 15:19:44 -07:00
Eric Anholt
18964618a1 glsl2: Make ir_if_return handle if () { return } else { not return }
This makes many remaining functions inlinable.

Fixes for i965:
glsl1-function with early return (1)
glsl1-function with early return (2)
2010-07-29 15:19:37 -07:00
Eric Anholt
92a3768cef glsl2: Refactor a bit of ir_if_return for the next changes. 2010-07-29 15:19:37 -07:00
Eric Anholt
806cb9f952 ir_to_mesa: Don't emit a duplicate return at the end of a function.
It was harmless, but ugly.
2010-07-29 15:19:37 -07:00
Eric Anholt
0e19922558 glsl2: Allow use of _mesa_print_ir without a parse state on hand. 2010-07-29 15:09:31 -07:00
Eric Anholt
ee4b4bab68 ir_constant_variable: Don't mark variable from outside our scope as constant.
Fixes (with software, except for alpha):
glsl1-function with early return(3)
2010-07-29 15:09:28 -07:00
Eric Anholt
bf496862be glsl2: When dumping IR for debug, indent nested blocks.
No more trying to match parens in my head when looking at the body of
a short function containing an if statement.
2010-07-29 14:38:04 -07:00
Eric Anholt
9a8eb684d4 glsl2: When dumping IR for debug, skip all the empty builtin prototypes. 2010-07-29 14:38:04 -07:00
Eric Anholt
62c4763b70 glsl2: Fix spelling of "sentinel." 2010-07-29 14:02:19 -07:00
Eric Anholt
fa33d0b854 glsl2: Fix spelling of "initializer." 2010-07-29 14:02:19 -07:00
Eric Anholt
4285247f12 glsl2: Remove an inlined unvalued return statement.
We already have asserts that it was the last call in the function, so
it's safe to remove after it got cloned in.

Fixes:
glsl-fs-functions-4.
2010-07-29 14:02:10 -07:00
Kristian Høgsberg
cd601513f5 glx: Fix linked list deletion in __glXCloseDisplay()
I hate single linked lists.
2010-07-29 16:03:44 -04:00
Kristian Høgsberg
32ea539417 intel: Declare the various tracked state variables using "extern" 2010-07-29 15:45:49 -04:00
Kristian Høgsberg
be9276d912 intel: Don't depend on context config values when picking texture formats 2010-07-29 15:45:48 -04:00
Kristian Høgsberg
e8a72460b7 egl_dri2: Set API version for DRM display 2010-07-29 15:08:00 -04:00
Marek Olšák
d8d7a3e0f9 r300g/swtcl: fix crash in ETQW and minor fixups
The Draw flush inside r300_flush was the culprit.

Also, no need to flush Draw when changing a state since the flush is
already inside swtcl_draw_vbo.
2010-07-29 20:57:18 +02:00
Marek Olšák
3f4680d8e2 r300g/swtcl: fix crash after the draw_vbo merge 2010-07-29 20:57:17 +02:00
Brian Paul
330852b3b3 llvmpipe: also test the new lp_build_assert() function 2010-07-29 12:51:45 -06:00
Brian Paul
d05cb9f018 llvmpipe: don't call LLVMCreateJITCompiler() twice
Fixes a failed assertion with LLVM 2.6:

<unnamed>::JITResolver::JITResolver(llvm::JIT&): Assertion
`TheJITResolver == 0&&  "Multiple JIT resolvers?"' failed.

Though, not everyone seems to experience this problem.
2010-07-29 12:51:45 -06:00
Brian Paul
8f3fe7e2f0 gallivm: added lp_build_assert() function to make assertions in LLVM code 2010-07-29 12:51:45 -06:00
José Fonseca
02da55676b Revert "gallivm: fix lp_build_sample_offset() crash when indexing a 1-D texture"
This reverts commit 5f90e76c54.

Bad cherry-pick.
2010-07-29 19:38:02 +01:00
Brian Paul
5f90e76c54 gallivm: fix lp_build_sample_offset() crash when indexing a 1-D texture
If y==NULL and y_stride==NULL it means the texture is 1D.  Return
zero for out_i and the offset instead of garbage.
2010-07-29 19:19:05 +01:00
Keith Whitwell
a258701cd9 util: add uint version of pack_z_stencil
Useful for packing mask values.
2010-07-29 19:15:10 +01:00
José Fonseca
bdaa8be5b7 scons: Use the current python executable for code generation.
Less susceptible to be broken.
2010-07-29 19:11:50 +01:00
José Fonseca
111902f2c4 draw: Also emit EMMS on generated LLVM IR. 2010-07-29 19:11:06 +01:00
José Fonseca
e3d2ebac11 llvmpipe: Avoid corrupting the FPU stack with MMX instructions on 32bit OSes.
Unfortunately LLVM doesn't emit EMMS itself, and there is no
easy/effective way to disable MMX.

http://llvm.org/bugs/show_bug.cgi?id=3287
2010-07-29 19:10:59 +01:00
José Fonseca
38f5b1bc38 util: Don't include xmmintrin.h.
Unnecessary.
2010-07-29 19:10:56 +01:00
Brian Paul
b4ad7c2843 mesa: implement RCC opcode 2010-07-29 08:23:59 -06:00
Brian Paul
275bae875d mesa: update table of opcodes used by GLSL 2010-07-29 08:23:33 -06:00
Andre Maasikas
9b3bf392e1 r600: since 8744c36e added asserts - use another random register for shader with no output 2010-07-29 15:18:19 +03:00
Chia-I Wu
ab25c1597d st/python: Adapt to interface change.
This is only compile tested.
2010-07-29 19:40:21 +08:00
Chia-I Wu
d4d62b6178 graw/tests: Use pipe_context::draw_vbo.
The other drawing variants such as draw_arrays or
draw_elements_instanced were removed.

This fixes fdo bug #29287.
2010-07-29 16:21:10 +08:00
Chia-I Wu
92f9b05499 gallium: Avoid void pointer arithmetic.
This fixes fdo bug #29286.
2010-07-29 15:55:14 +08:00
Vinson Lee
2bff1a08d9 mesa: Reduce arrayobj.h header file inclusion.
Directly include mtypes.h instead of including context.h to include
mtypes.h.
2010-07-28 23:16:31 -07:00
Vinson Lee
97b416eb67 mesa: Remove unnecessary header. 2010-07-28 23:07:44 -07:00
Chia-I Wu
e7f69c459a gallium/docs: Document draw_vbo and set_index_buffer.
Document the new unified drawing method and remove references to old
ones.
2010-07-29 13:45:31 +08:00
Chia-I Wu
a57f842519 gallium: Keep only pipe_context::draw_vbo.
That is, remove pipe_context::draw_arrays, pipe_context::draw_elements,
pipe_context::draw_arrays_instanced,
pipe_context::draw_elements_instanced,
pipe_context::draw_range_elements.
2010-07-29 13:45:31 +08:00
Chia-I Wu
cd3ef7592c gallium: Use unified pipe_context::draw_vbo.
Update u_draw_quad, st/vega, and st/mesa to use pipe_context::draw_vbo.
2010-07-29 13:45:31 +08:00
Chia-I Wu
6d28bf917f gallium: Implement draw_vbo and set_index_buffer for all drivers.
Some drivers define a generic function that is called by all drawing
functions.  To implement draw_vbo for such drivers, either draw_vbo
calls the generic function or the prototype of the generic function is
changed to match draw_vbo.

Other drivers have no such generic function.  draw_vbo is implemented by
calling either draw_arrays and draw_elements.

For most drivers, set_index_buffer does not mark the state dirty for
tracking.  Instead, the index buffer state is emitted whenever draw_vbo
is called, just like the case with draw_elements.  It surely can be
improved.
2010-07-29 13:45:30 +08:00
Chia-I Wu
c5e9d3114a gallium: Add pipe_context::draw_vbo and pipe_context::set_index_buffer.
This commit adds a new unified draw_vbo method to pipe_context.  Unlike
other draw methods, draw_vbo treats the index buffer as a state which is
set with set_index_buffer.
2010-07-29 13:45:30 +08:00
Vinson Lee
7e4e79be6b mesa: Remove unnecessary header. 2010-07-28 22:27:52 -07:00
Kristian Høgsberg
2c343af098 egl: Fix deref before NULL-check 2010-07-28 23:54:16 -04:00
Kristian Høgsberg
9456e22c7a intel: Implement EGL_KHR_surfaceless extension 2010-07-28 23:07:09 -04:00
Kristian Høgsberg
efd4a8cffd egl_dri2: Implement EGL_KHR_surfaceless_* extensions 2010-07-28 23:07:09 -04:00
Kristian Høgsberg
b90a3e7d8b egl: EGL_KHR_surfaceless_* extensions
These extensions allow an application to make a context current by
passing EGL_NO_SURFACE for the write and read surface in the call to
eglMakeCurrent.  The motivation is that applications that only want to
render to client API targets (such as OpenGL framebuffer objects)
should not need to create a throw-away EGL surface just to get a
current context.
2010-07-28 23:07:00 -04:00
Kristian Høgsberg
aa44bd9189 Untangle gallium/egl/glx source sharing mess and make it compile again 2010-07-28 22:18:58 -04:00
Eric Anholt
d6942460ce glsl2: Actually fix glsl-version-define. 2010-07-28 17:36:07 -07:00
Eric Anholt
d4a04f3155 glcpp: Add __VERSION__ define to the current language version.
Fixes:
glsl-version-define
glsl-version-define-110
glsl-version-define-120
2010-07-28 17:32:39 -07:00
Eric Anholt
8605c297cf glcpp: Print integer tokens as decimal, not hex. 2010-07-28 17:32:11 -07:00
Eric Anholt
192b57df8c glsl2: Make lowp, mediump, highp, and precision identifiers pre-1.20.
Fixes glsl-precision-110.
2010-07-28 17:32:11 -07:00
Jerome Glisse
42c1f27149 r600g: state context ptr in sampler_view & add I8/L8 buffer format
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 20:09:15 -04:00
Jerome Glisse
35e044ab56 r600g: switch btw flat/linear interpolation
I am not sure how to properly handle flat shading regarding
non color parameter to fragment shader. It seems we should
still interpolate non color using linear interpolation and
flat shade only apply to color.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:59:38 -04:00
Kenneth Graunke
35cc8b98ec glsl2/Makefile: Append to DEFINES rather than replacing them.
Otherwise, we lose DEBUG, which causes mtypes.h to set NDEBUG, which
causes assertions to not happen, which is no fun for anyone.
2010-07-28 16:48:04 -07:00
Jerome Glisse
6f0f6c6459 r600g: split pipe state creating/binding from hw state creation
Split hw vs pipe states creation handling as hw states group doesn't
match pipe state group exactly. Right now be dumb about that and
rebuild all hw states on each draw call. More optimization on that
side coming.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:36:16 -04:00
Eric Anholt
859fd56245 ir_to_mesa: Respect the driver if it rejects a shader. 2010-07-28 15:51:36 -07:00
Kenneth Graunke
56af4e56e3 glsl2: Fix outerProduct builtin.
The type signatures were completely backwards.
2010-07-28 15:46:29 -07:00
Kenneth Graunke
7ddee6a535 ir_constant_expression: Add support for the "outerProduct" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
5d255e24b2 ir_constant_expression: Add support for the "mix" builtin.
Both 1.10 and 1.30 variants.
2010-07-28 15:46:29 -07:00
Kenneth Graunke
b09ae5dd3f ir_constant_expression: Add support for the "transpose" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
546f3a2754 ir_constant_expression: Add support for the "smoothstep" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
a4ca1cfb66 ir_constant_expression: Add support for the "clamp" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
ff58b7c9b6 ir_constant_expression: Add support for the "step" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
3d5c2f0adb ir_constant_expression: Add support for the "faceforward" builtin. 2010-07-28 15:46:29 -07:00
Kenneth Graunke
04b3643dbf ir_constant_expression: Add support for the "refract" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
d60b2b03da ir_constant_expression: Add support for the "reflect" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
53f306d573 ir_constant_expression: Add support for the "normalize" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
8fe5f30645 ir_constant_expression: Add support for the "matrixCompMult" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
a7650af706 ir_constant_expression: Simplify code that implements the "dot" builtin.
There's no need to use an ir_expression; we have a handy C function.
2010-07-28 15:46:28 -07:00
Kenneth Graunke
5489ad086f ir_constant_expression: Add support for the "length" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
ffcec13599 ir_constant_expression: Extract dot product calculation for reuse. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
4b1d77ea96 ir_constant_expression: Remove support for dot products of integers.
This shouldn't be required since dot is only defined for floating point
types, even in GLSL 4.0.
2010-07-28 15:46:28 -07:00
Kenneth Graunke
557827340a ir_constant_expression: Add support for the "greaterThanEqual" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
7f042b9812 ir_constant_expression: Add support for the "greaterThan" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
319f4949e0 ir_constant_expression: Add support for the "lessThanEqual" builtin. 2010-07-28 15:46:28 -07:00
Kenneth Graunke
6d897f07cf ir_constant_expression: Add support for the "lessThan" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
48a69ba057 ir_constant_expression: Add support for the "notEqual" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
0b6ef6ef6e ir_constant_expression: Add support for the "equal" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
2eaf31642c ir_constant_expression: Add support for the "distance" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
7bcaa3828f ir_constant_expression: Add support for the "degrees" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
0afe349322 ir_constant_expression: Add support for the "radians" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
20970f7dea ir_constant_expression: Add support for the "tanh" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
9c9f8b2d69 ir_constant_expression: Add support for the "tan" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
5d551daf38 ir_constant_expression: Add support for the "sinh" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
ba4178345a ir_constant_expression: Add support for the "cosh" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
13f8758e9c ir_constant_expression: Add support for "atan" builtins. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
f6ea9dfe47 ir_constant_expression: Add support for "acos" builtin. 2010-07-28 15:46:27 -07:00
Kenneth Graunke
3b6c29b8f0 ir_constant_expression: Add support for "asin" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
d6792a7f7c ir_constant_expression: Add support for "any" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
aca7e95222 ir_constant_expression: Add support for "all" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
8b1680acc3 ir_constant_expression: Implement builtins that wrap an expression.
These builtin functions are represented by ir_expression_operations, so
we can just create one of those and ask for its value.
2010-07-28 15:46:26 -07:00
Kenneth Graunke
38cb1b273f ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth.
These always return zero (the derivative of a constant).
2010-07-28 15:46:26 -07:00
Kenneth Graunke
46d91615a2 ast_function: Set constant_value on return value temporaries in 1.20+. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
bafd89fa0f ir_constant_expression: Stub out support for constant builtins. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
f914915d8e ir_constant_expression: Use Mesa's MIN2/MAX2 instead of our own. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
f7b94f32a2 ir_algebraic: Use ir_constant::zero. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
ee9a3a51b6 glsl2: Add new ir_constant::zero static method.
This conveniently creates a zero value of whatever type you want.
2010-07-28 15:46:26 -07:00
Eric Anholt
0c7b37c836 glsl2: Add the define for ARB_fragment_coord_conventions when present.
Fixes:
glsl-arb-fragment-coord-conventions-define
2010-07-28 15:00:29 -07:00
Eric Anholt
4a962170d7 glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.
Fixes:
glsl-arb-fragment-coord-conventions
2010-07-28 15:00:09 -07:00
Ian Romanick
8d8469eb2a glsl2: Perform some semantic checking of ARB_fcc layout qualifiers
The rest cannot be handled until built-in variables (i.e.,
gl_FragCoord) can be redeclared to add qualifiers.
2010-07-28 14:16:12 -07:00
Ian Romanick
f50f06552e glsl2: Parser support for GL_ARB_fragment_coord_conventions 2010-07-28 14:14:38 -07:00
Eric Anholt
b706283c79 glsl2: Fail linking where the FS reads a varying that the VS doesn't write.
Fixes:
glsl1-varying read but not written
glsl1-varying var mismatch
2010-07-28 14:04:54 -07:00
Eric Anholt
a6c7606ab6 glsl2: Unmark unwritten varyings as varying.
This fixes an assertion failure in ir_to_mesa, and the varying won't
take up varying space.
2010-07-28 14:04:54 -07:00
Carl Worth
667173e362 glcpp: Add generated source files.
This is now consistent with other usage of flex/bison througout mesa,
(which is that these generated files are added to source control so
that the build system does not require external tools like flex/bison
for non-developers).
2010-07-28 13:48:32 -07:00
Carl Worth
f8a04b3877 glsl: Ignore glsl_compiler and glsl_parser.output files.
These are generated files where we can do the sane thing, and keep
them out of version control.
2010-07-28 13:48:32 -07:00
Carl Worth
e8a8f0f278 glsl: Add generated files from flex/bison.
The mesa build environment does not (currently) accept external
dependencies such as flex and bison. The compromise is to commit the
generated output files, (in spite of the pain that comes from having
generated files under version control).
2010-07-28 13:48:32 -07:00
Carl Worth
279cc22dbc glcpp: Add expected output for a recently-added test.
I simply forgot to add this file when adding the test case originally.
2010-07-28 13:48:32 -07:00
Kristian Høgsberg
6849916170 glx: Split indirect and applegl implementations into different files 2010-07-28 16:45:25 -04:00
Kristian Høgsberg
c491e585e4 glx: Move bind and unbind to context vtable 2010-07-28 16:45:25 -04:00
Kristian Høgsberg
c356f5867f glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types. 2010-07-28 16:45:25 -04:00
Kristian Høgsberg
66fc35cde9 glx: Rename __GLXscreenConfigs to struct glx_screen
Because double underscores in private type names is painful.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg
38c51a7653 glx: Use _X_EXPORT instead of our own PUBLIC macro
We're an X client library, so we can use Xfuncproto.h.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg
65d98e2577 glx: Rename glcontextmodes.[ch] to glxconfig.[ch] 2010-07-28 16:42:00 -04:00
Kristian Høgsberg
6ddf66e923 glx: Rename __GLcontextModes to struct glx_config
With this rename, we use 'config' consitently to refer to GLX configurations
instead of the modes/configs/visual mess before.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg
4f9f066485 glx: Delete unused glcontextmodes.c functions 2010-07-28 16:41:59 -04:00
Kristian Høgsberg
38765fe4c2 glx: Stop using glcore.h and glxint.h in glx
We'd like to get rid of these header files.
2010-07-28 16:41:59 -04:00
Eric Anholt
dc27e73569 ir_to_mesa: Add remaining state variable (builtin uniforms) support.
Fixes:
glsl1-GL state variable reference (diffuse product)
glsl1-GL state variable reference (gl_FrontMaterial.ambient)
glsl1-GL state variable reference (gl_LightSource[0].diffuse)
glsl1-GL state variable reference (point attenuation)
glsl1-GL state variable reference (point size)
glsl1-linear fog
2010-07-28 12:34:20 -07:00
Eric Anholt
85b5dba593 glsl2: Add the remaining builtin uniforms. 2010-07-28 12:34:08 -07:00
Eric Anholt
73df636e04 glsl2: Size builtin arrays according to the context constants.
Cleans up some of the FINISHMEs in this file.
2010-07-28 11:16:19 -07:00
Carl Worth
efef950f39 glcpp: Explicitly expect 0 shift/reduce conflicts.
The "%expect 0" construct will make bison emit an error if any future
changes to the grammar introduce shift/reduce conflicts, (without also
increasing the number after "%expect").
2010-07-28 11:10:52 -07:00
Carl Worth
2233d10442 glcpp: Remove 2 shift/reduce conflicts from the grammar.
Since we have productions to turn "defined FOO" and "defined ( FOO )"
into a conditional_token we don't need to list DEFINED as an operator
as well. Doing so just introduces the shift/reduce ambiguity with no
benefit.
2010-07-28 11:07:46 -07:00
Carl Worth
db011c8141 Avoid a compiler warning about a potentially unused variable.
There is no assignment to the "ret" variable if X_DRI2SwapBuffers is
not defined. In this case, the earlier explicit "return 0" is likely
to be used, but the compiler can't be sure of that, (nor can I for
that matter).

We cover this case by explicitly initializing "ret" to 0.
2010-07-28 10:42:46 -07:00
Carl Worth
14a3d61ea3 Avoid compiler warning for unused glx_dpy variable.
My earlier attempt to eliminate this warning (c0ca2bfb2a) was
invalid as it removed the variable declaration. Jerome correctly
reverted that (600c85efdb) since the variable is used when
X_DRI2SwapBuffers is defined.

Here, instead of removing the declaration, we move it to inside the
correct #ifdef.
2010-07-28 10:33:27 -07:00
Jerome Glisse
742ee7935d r600g: cleanup resource buffer/texture mess
Use a common function, fix the mess it was before.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 12:18:19 -04:00
Jerome Glisse
b346c4205d r600g: add lrp instruction support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 10:35:32 -04:00
Jerome Glisse
9961a0b92d r600g: actualy fix the literal emission
Previous patch added literal emission to wrong place, we
want to emit literal before emitting a new alu group.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 09:11:14 -04:00
Vinson Lee
9b85818698 glapi: Fix VMware spelling. 2010-07-28 01:11:34 -07:00
Vinson Lee
8bae190f18 gallium/docs: Fix VMware spelling. 2010-07-28 01:09:40 -07:00
Vinson Lee
da30209afd draw: Fix VMware spelling. 2010-07-28 01:07:03 -07:00
Dave Airlie
2ab24a6fae r600g: fix up segfault with variation between views and count.
For some reason gallium hands us something with lots of empty views, and
we are expected to deal with it, just do what r300g does for this bit.
2010-07-28 15:28:18 +10:00
Corbin Simpson
0a663bb4db gallium/docs: Fix VMware spelling. 2010-07-27 21:43:00 -07:00
Dave Airlie
f514ad0a9b r600g: use gallium util for float->ui conversion 2010-07-28 11:55:09 +10:00
Vinson Lee
b172aebfdf scons: Fix sunos5 build. 2010-07-27 18:13:47 -07:00
Jerome Glisse
641c9adb09 r600g: texture support
Add texture mapping support, redbook/texbind works if
you comment out glClear and second checkboard. Need to
fix :
 - texture overwritting
 - lod & mip/map handling
 - unormalized coordinate handling
 - texture view with first leve > 0
 - and many other things

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 20:18:32 -04:00
Brian Paul
25472942c9 llvmpipe: pass face+slice to llvmpipe_unswizzle_cbuf_tile()
Cube map faces and 3D texture slices are treated the same in llvmpipe
textures.  Need to pass the sum of these fields to
llvmpipe_unswizzle_cbuf_tile() as we do elsewhere.

Fixes piglit fbo-3d test (fd.o bug 29135).
2010-07-27 17:42:27 -06:00
Vinson Lee
6a20539580 r600g: Move declaration before code.
Fixes SCons build.
2010-07-27 15:33:45 -07:00
Eric Anholt
f9b0e5e322 glsl2: When stealing var->constant_value, steal its children as well.
Fixes:
glsl1-GLSL 1.20 uniform array constructor
2010-07-27 15:25:07 -07:00
Eric Anholt
9a670c2e9b ir_to_mesa: Provide a restricted type size to _mesa_add_uniform.
Fixes:
glsl-uniform-out-of-bounds.
2010-07-27 15:10:38 -07:00
Eric Anholt
59c45e9e6c glsl2: Actually use the linked dead code eliminator.
I managed to revert the change from unlinked at some point while
cleaning up the changes.  glsl-fs-raytrace-bug27060 drops from 389
instructions to 370.
2010-07-27 14:34:53 -07:00
Jakob Bornecrantz
cc09dc2773 swrastg: Add SWRAST_NO_PRESENT option to not send updates to X server
There seem to be a problem with this path and freeglut where
the window wont open if SWRAST_NO_PRESENT is set to true.
2010-07-27 13:54:37 -07:00
Kristian Høgsberg
7d349f588a intel: Remove unused intel/server files 2010-07-27 15:22:07 -04:00
Eric Anholt
54f583a206 glsl2: Don't dereference a NULL var in CE handling during a compile error.
If an undeclared variable was dereferenced in an expression that
needed constant expression handling, we would walk off a null ir->var
pointer.

Fixes:
glsl1-TIntermediate::addUnaryMath
2010-07-27 12:10:50 -07:00
Eric Anholt
20c074ae28 ir_to_mesa: Add support for array constants.
Fixes:
glsl1-GLSL 1.20 array constructor 1
glsl1-GLSL 1.20 array constructor 2
glsl1-GLSL 1.20 array.length()
glsl1-GLSL 1.20 const array constructor 1
glsl1-GLSL 1.20 const array constructor 2
2010-07-27 12:02:11 -07:00
Eric Anholt
bf6ad0ab3d glsl2: Use ir_dead_code's linked version after linking.
glsl-fs-raytrace-bug27060 goes from 485 Mesa IR instructions to 389
before Mesa IR optimization.
2010-07-27 11:49:27 -07:00
Eric Anholt
5532c4ca69 glsl2: Fix the linked version of ir_dead_code.
If we don't walk into functions, we won't see any usage of variables
in the functions.
2010-07-27 11:46:06 -07:00
Eric Anholt
66d4c65ee2 glsl2: Make the dead code handler make its own talloc context.
This way, we don't need to pass in a parse state, and the context
doesn't grow with the number of passes through optimization.
2010-07-27 11:46:05 -07:00
Eric Anholt
8bbdf6e7cd mesa: Allow large temporary indices coming into the temporary reg allocator.
This gets glsl-vs-raytrace, glsl-fs-raytrace running on the new
compiler.
2010-07-27 11:45:27 -07:00
Eric Anholt
85cd64ee17 glsl2: Talloc type names.
Otherwise, we end up losing structure names after compile time, and
dumping IR often ends up reporting some other mysterious string.
2010-07-27 11:14:59 -07:00
Jerome Glisse
2b3b76a4a0 r600g: always emit literal after emiting an alu instruction
Make sure we always fill in the literal after alu instruction.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 13:50:11 -04:00
Eric Anholt
9a770ee49f ir_to_mesa: Set the swizzle on constant struct src regs.
MESA_GLSL=nopt now produces believable output for glsl-fs-raytrace.
2010-07-27 10:41:01 -07:00
Eric Anholt
fdbaca931a ir_to_mesa: Fix stray "break" that broke functions of >1 argument. 2010-07-27 10:08:38 -07:00
Eric Anholt
832aad989e glsl2: Add optimization pass for algebraic simplifications.
This cleans up the assembly output of almost all the non-logic tests
glsl-algebraic-*.  glsl-algebraic-pow-two needs love (basically,
flattening to a temporary and squaring it).
2010-07-27 09:43:52 -07:00
Eric Anholt
5533c6e380 ir_validate: Check the types of expression operations. 2010-07-27 09:43:52 -07:00
José Fonseca
4fbffb7d90 llvmpipe: Use lp_build_select_bitwise() where appropriate.
Fixes fdo 29269.
2010-07-27 13:09:47 +01:00
José Fonseca
2a45972fb2 gallivm: Add lp_build_select_bitwise() alternative to lp_build_select_bitwise
When

  (mask & a) | (~mask & b)

is meant instead of

   mask ? a : b
2010-07-27 13:09:46 +01:00
Eric Anholt
6a1401eb88 glsl2: Fix missing visit_continue return in ir_validate. 2010-07-27 00:18:57 -07:00
Brian Paul
fef5ae949f cell: comment-out unused fields, functions 2010-07-26 20:50:17 -06:00
Brian Paul
dd0cf2e1f5 cell: make functions static 2010-07-26 20:49:54 -06:00
Brian Paul
0315c00f58 cell: fix segfault when freeing samplers 2010-07-26 20:49:35 -06:00
Brian Paul
2a8021667d cell: comment-out unneeded padding field 2010-07-26 20:49:09 -06:00
Brian Paul
d2c714627c cell: added const qualifier 2010-07-26 20:48:46 -06:00
Brian Paul
b17ee335e3 util: fix unused function warning on non-x86 2010-07-26 20:48:29 -06:00
Eric Anholt
576d01ad8c ir_to_mesa: Fix up handling of void function returns.
void functions have a type of glsl_type::void_type, not a null type.
2010-07-26 19:41:39 -07:00
Eric Anholt
c91809e1e4 ir_to_mesa: Actually allocate the right size for constant matrix temps. 2010-07-26 19:41:23 -07:00
Eric Anholt
5b6890a388 ir_to_mesa: Add support for structure constants.
Fixes:
TPPStreamCompiler::assignOperands
2010-07-26 19:40:47 -07:00
Eric Anholt
fbaca31352 glsl2: Also steal the constant components of aggregate-typed ir_constants. 2010-07-26 19:30:19 -07:00
Kenneth Graunke
eb2cc4f1b1 glsl2: Steal ir_variable's constant_value field.
Fixes a link-time crash in glsl-vs-cross-3.
2010-07-26 19:09:10 -07:00
Eric Anholt
e2130d4e39 glsl2: Remove old .gitignore file from when we were out of tree. 2010-07-26 17:54:35 -07:00
Eric Anholt
afe125e0a1 Merge remote branch 'origin/master' into glsl2
This pulls in multiple i965 driver fixes which will help ensure better
testing coverage during development, and also gets past the conflicts
of the src/mesa/shader -> src/mesa/program move.

Conflicts:
	src/mesa/Makefile
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderobj.h
2010-07-26 17:53:27 -07:00
Eric Anholt
d64343f1ae ir_to_mesa: Flag when we use the address reg.
Hardware backends will get angry otherwise.
2010-07-26 17:45:37 -07:00
Kristian Høgsberg
5403ca79b2 glx: Remove function prototypes no longer necessary 2010-07-26 17:37:59 -04:00
Eric Anholt
2621100458 i965: Fix reversed naming of the operations in compute-to-mrf optimization.
Also fix up comments, so that the difference between the two passes is
clarified.
2010-07-26 13:08:25 -07:00
Eric Anholt
b3ea15f12b i965: Clean up a few magic numbers to use brw_defines.h defs. 2010-07-26 13:08:25 -07:00
Eric Anholt
ca0f4e2c10 i965: Use MIN2, MAX2 instead of rolling our own. 2010-07-26 13:08:25 -07:00
Eric Anholt
9e31adfa46 i965: Fold the "is arithmetic" bit of 965 opcodes into the opcode list. 2010-07-26 13:08:25 -07:00
Eric Anholt
b9c84515a5 i965: Remove some duped register size/count definitions 2010-07-26 13:08:25 -07:00
Eric Anholt
22f839292f i965: Move the GRF-to-MRF optimizations to brw_optimize.c. 2010-07-26 13:08:25 -07:00
Benjamin Segovia
a64def5f2a i965: Improve (i.e. remove) some grf-to-mrf unnecessary moves
Several routines directly analyze the grf-to-mrf moves from the Gen
binary code. When it is possible, the mov is removed and the message
register is directly written in the arithmetic instruction

Also redundant mrf-to-grf moves are removed (frequently for example,
when sampling many textures with the same uv)

Code was tested with piglit, warsow and nexuiz on an Ironlake
machine. No regression was found there

Note that the optimizations are *deactivated* on Gen4 and Gen6 since I
did test them properly yet. No reason there are bugs but who knows

The optimizations are currently done in branch free programs *only*.
Considering branches is more complicated and there are actually two
paths: one for branch free programs and one for programs with branches

Also some other optimizations should be done during the emission
itself but considering that some code is shader between vertex shaders
(AOS) and pixel shaders (SOA) and that we may have branches or not, it
is pretty hard to both factorize the code and have one good set of
strategies
2010-07-26 13:08:25 -07:00
Kristian Høgsberg
e4aa9440d9 glx: Drop debug fprintf that snug in with the previous commit 2010-07-26 16:06:05 -04:00
Kristian Høgsberg
2235b1c72d glx: Enable copy subbuffer patch when GLX_DIRECT_RENDERING is #defined
Depending on __DRI_COPY_SUB_BUFFER doesn't work when we no longer include
dri_interface.h.

https://bugs.freedesktop.org/show_bug.cgi?id=29264
2010-07-26 15:52:45 -04:00
nobled
c88fc26ac9 st/egl: Fix debug line
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:27:21 -07:00
nobled
3cef6c42bc util: fix CPU detection on OS X
s/PIPE_OS_DARWIN/PIPE_OS_APPLE, since there is no PIPE_OS_DARWIN.

Acked-by: Vinson Lee <vlee@vmware.com>
2010-07-26 12:27:01 -07:00
nobled
b1ef3e0863 st/xorg: fix use-after-free
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:26:58 -07:00
Jakob Bornecrantz
0697d41fce i965g: Enable llvm in dri driver if built 2010-07-26 12:26:53 -07:00
nobled
4830237660 i915g: Fix llvm build
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:25:05 -07:00
Kristian Høgsberg
bc34aa6128 glx: Drop duplicate psc field in dri context struct
Same problem as fixed for drisw in 4d58b5b482.
2010-07-26 15:18:56 -04:00
Eric Anholt
941b893032 i965: Allow VS MOVs to use immediate constants.
Clarifies program assembly, and with a little tweak to always use
constant_map, we could cut down on constant buffer payload.
2010-07-26 10:11:31 -07:00
Stephan Schmid
0bebdc230f r600g: implememt the LIT instruction 2010-07-26 10:34:05 -04:00
Marek Olšák
a3a42e4696 util: fix another mutex leak in mempool
By fixing one, I introduced another. Crap.
2010-07-26 14:56:48 +02:00
Marek Olšák
d26fb69169 util: fix mutex leaks in mempool 2010-07-26 14:53:27 +02:00
Dave Airlie
8c26dc2bfe r300g: fix macro substitution problem
isn't a problem yet, but have issues in hiz branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-26 12:02:14 +10:00
Marek Olšák
6f2936c654 r300g: implement D24X8 texture sampling for r3xx-r4xx
Because the hw can't sample it, I reinterpret the format as G16R16 and
sample the G component. This gives 16 bits of precision, which should be
enough for depth texturing (surprisingly, the sampled values are exactly
the same as in D16 textures).

This also enables EXT_packed_depth_stencil on those old chipsets, finally.
2010-07-25 23:40:51 +02:00
Marek Olšák
451a0ddb19 r300g: make sure a texture is large enough for the CBZB clear
The number of macrotiles in the Y direction must be even, otherwise memory
corruption may happen (e.g. broken fonts). Basically, if we get a buffer
in resource_from_handle, we can determine from the buffer size whether it's
safe to use the CBZB clear or not.
2010-07-25 10:33:09 +02:00
Marek Olšák
49330fc5ac r300g: do not use TXPITCH_EN if the width is POT and the height is NPOT 2010-07-25 10:25:21 +02:00
Marek Olšák
c92d232061 r300g: do not use TXPITCH_EN for power-of-two textures from the DDX
We were using TXPITCH_EN for textures from the DDX since ever, for nothing.
2010-07-25 10:25:21 +02:00
Marek Olšák
d779a5d16a r300g: cleanup texture creation code
This decouples initializing a texture layout/miptree description
from an actual texture creation, it also partially unifies texture_create
and texture_from_handle.

r300_texture inherits r300_texture_desc, which inherits u_resource.

The CBZB clear criteria are moved to r300_texture_desc::cbzb_allowed[level].

And other minor cleanups.
2010-07-25 10:25:21 +02:00
Marek Olšák
065e3f7ff2 r300g: reject resources from handles which are not large enough
The driver gets a buffer and its size in resource_from_handle.
It computes the required minimum buffer size from given texture
properties, and compares the two sizes.

This is to early detect DDX bugs.
2010-07-25 10:25:21 +02:00
Marek Olšák
4ce2621084 r300g: cleanup texture debug logging 2010-07-25 10:25:21 +02:00
Marek Olšák
3adb5c7d45 r300g: do not align texture height to 2^n for 1D and 2D non-mipmapped textures
I don't remember why the alignment was there, but it seems to be
no longer needed. I guess it was a dirty fix for some other bug.
2010-07-25 10:25:21 +02:00
Vinson Lee
5603d2e4c4 nvfx: Move declaration before code. 2010-07-24 21:10:45 -07:00
Kristian Høgsberg
4d58b5b482 glx: Drop duplicate psc field in drisw context struct
Causing a crash in drisw MakeCurrent.
2010-07-24 21:43:25 -04:00
Eric Anholt
af6a2aede6 glx: Fix another case of confusing driContext and dri2_context * 2010-07-23 20:58:12 -07:00
Eric Anholt
566373967a glx: Correctly look up the dri2 context pointer for SetTexBuffer.
gc->driContext points at the second member of the dri2 context.  The
dri2 context is just a subclass of the GLX context.

Fixes piglit tfp testcase.
2010-07-23 20:58:12 -07:00
Kristian Høgsberg
d77bb8e059 glx: Don't destroy context with XID 0
We use XID 0 to indicate the context has already been destroyed, but it's
currently bound.
2010-07-23 22:05:53 -04:00
Kristian Høgsberg
6739d52fdc glx: Fix use after free case when destroying screens 2010-07-23 22:05:53 -04:00
Kristian Høgsberg
6393a33944 glx: zero out drawable structs after allocation 2010-07-23 22:05:53 -04:00
Kristian Høgsberg
6ec39db726 glx: Refactor and simplify context creation
This lets us better separate context creation between the different
backends.
2010-07-23 22:05:53 -04:00
Kristian Høgsberg
b5dedd7c3b glx: Fix indirect screen initialization
https://bugs.freedesktop.org/show_bug.cgi?id=29225
2010-07-23 22:05:53 -04:00
Kristian Høgsberg
c796bb0cc3 glx: Move context destroy to context vtable 2010-07-23 22:05:52 -04:00
Vinson Lee
80b331c7f6 util: Add PIPE_OS_CYGWIN to u_network. 2010-07-23 18:50:04 -07:00
Jerome Glisse
33241134e6 r600g: first pass at texture support
This add texture support to the assembler, generated code is
wrong (tested against working dump).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 20:57:21 -04:00
Vinson Lee
ac11bdd831 scons: Add sunos5 to list of accepted platforms. 2010-07-23 17:53:35 -07:00
Vinson Lee
bd27db400a r600g: Fix SCons build. 2010-07-23 17:50:35 -07:00
Vinson Lee
32502b0eeb scons: Use '-Wmissing-field-initializers' on GCC 4.0 and greater only. 2010-07-23 17:24:21 -07:00
Vinson Lee
658fc7539d mesa: Fix Cygwin build with llvm enabled.
On Cygwin locale_t in not available but 'llvm-config --cppflags' adds
the compiler flag -D_GNU_SOURCE to the build.
2010-07-23 16:24:35 -07:00
Christopher James Halse Rogers
1874cb7e82 gallium: Fix build with llvm installed in non-standard location
The es1, es2 and gl state trackers include draw_pipe.h, which includes
the llvm headers if MESA_LLVM is true, so we also need to add the
llvm seachpaths.

Similarly, gallivm and other gallium drivers need LLVM_CFLAGS to build when enabled.

Also fix xorg drivers, they didn't include LDFLAGS.
2010-07-23 23:38:07 +01:00
Jerome Glisse
cf864fd58b r600g: fix dp2, dp3, dp4 tokens
We need to make sure dp are all mirror accross the alu unit.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 18:19:13 -04:00
Jerome Glisse
5cc2974dff r600g: add RSQ token support
Could serve as an example on how to add more token
support.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 17:49:26 -04:00
Jerome Glisse
de553d906b r600g: drop compiler stuff and switch over dumb tgsi assembler
Writing a compiler is time consuming and error prone in
order to allow r600g to further progress in the meantime
i wrote a simple tgsi assembler, it does stupid thing but
i would rather keep the code simple than having people
trying to optimize code it does.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 17:35:36 -04:00
Eric Anholt
9a12a3925a glx: Don't try to swap a front buffer if we don't have one.
Fixes glean glsl1 since 7b7845a076
2010-07-23 13:59:22 -07:00
Brian Paul
a2eb8bdcc7 st/mesa: get rid of unneeded ureg_writemask() 2010-07-23 13:50:09 -06:00
Brian Paul
e393350904 st/mesa: fix bug in emit_adjusted_wpos()
If we bias x,y we still need to pass through z,w in case the shader
reads gl_FragCoord.z or .w.

Fixes fd.o bug 29183 (piglit glsl-bug-22603).

NOTE: This is a candidate for the 7.8 branch.
2010-07-23 13:42:06 -06:00
Eric Anholt
c65f4fd5ae i965: Cleanly fail programs with unsupported array access.
This should be more useful for developers and for bug triaging than
just generating wrong code.
2010-07-23 10:54:08 -07:00
Eric Anholt
35bbbf4742 i965: Add support for VS relative addressing of temporary arrays.
Fixes glsl-vs-arrays.  Bug #27388.
2010-07-23 10:46:42 -07:00
Brian Paul
41e7347a17 draw: add small ybias factor for drawing wide points
Fixes minor rasterization error detected by some tests.
2010-07-23 10:32:58 -06:00
Brian Paul
6c3b9fa5fd docs: document new extensions for Gallium 2010-07-23 10:32:58 -06:00
Michal Krol
8122baf8ba softpipe: Check for NULL pointer in sp_destroy_tile_cache(). 2010-07-23 16:20:37 +02:00
Michal Krol
a0fc83b277 softpipe: Check for NULL pointer in sp_destroy_tex_tile_cache(). 2010-07-23 16:20:36 +02:00
Christoph Bumiller
0811b09669 nv50: implement depth clamp 2010-07-23 15:53:15 +02:00
Thomas Hellstrom
a96feddddb xorg/vmwgfx: Implement early mode pruning based on max fb size.
Also move some initialization from screen init to pre-init, now
that it is possible.

Also import a new vmwgfx drm (1.3) header.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:33 +02:00
Thomas Hellstrom
cec7d6a4de st/xorg: Init the Gallium3D / libkms resources in pre-init.
This makes it possible to prune modes already in pre-init.
We also keep these resources alive across server generations, and
they are implicitly closed on server exit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Thomas Hellstrom
f3ddffc392 st/xorg: Kill a couple of compilation warnings
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Thomas Hellstrom
6ffa23b8fe st/xorg vmwgfx/xorg: Add a pre-init customizer callback
Add a customizer callback just before initial config setting, so that the
customizer code can initialize the mode validator using the drm
file-descriptor.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Thomas Hellstrom
a7a126bdfa st/xorg: Add a possibility to prune modes and limit fb allocation size based on max fb size.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:32 +02:00
Jakob Bornecrantz
2299ff4c6b llvmpipe: Partially fix resource texture from_handle 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
dc544d87a2 llvmpipe: Don't align values already aligned 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
095e99ddf6 i915g: Rename winsys debug options 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
5ccab575fd i915g: Allow wrapping with software pipes 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
37dabfeef7 i915g: Set total_nblocksy in from_handle 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
5de2678b4e i915g: Add some debug prints in texture code 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
4eaa671052 i915g: Ifdef out debug code on non-debug builds 2010-07-22 20:26:35 -07:00
Jakob Bornecrantz
e36a082214 tgsi: Fix error message on invalid swizzle parse 2010-07-22 20:26:35 -07:00
Kristian Høgsberg
eeaab2047c glx: Drop screen argument to GetGLXDRIDrawable
We'll just get it from the returned drawable when we need it.
2010-07-22 22:36:37 -04:00
Kristian Høgsberg
7b7845a076 glx: Move WaitGL, WaitX, UseXFont to context vtable functions 2010-07-22 22:24:00 -04:00
Kristian Høgsberg
31819830b6 glx: Allocate the __GLXcontext in the DRI drivers 2010-07-22 22:16:32 -04:00
Kristian Høgsberg
ab434f6b76 glx: Use _Xglobal_lock for protecting extension display list
Avoids double locking glXLock in the X wire to event handlers.
2010-07-22 21:11:20 -04:00
Kenneth Graunke
3e882ec84a ir_constant_expression: Fix broken code for floating point modulus.
It's supposed to be x - y * floor(x/y), not (x - y) * floor(x/y).
2010-07-22 17:45:45 -07:00
Kenneth Graunke
0a71527dab glsl2: Refresh autogenerated file builtin_function.cpp. 2010-07-22 16:54:20 -07:00
Kenneth Graunke
0b8e5f384c glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin. 2010-07-22 16:54:19 -07:00
Kenneth Graunke
5304c251fc glsl2/builtins: Fix 1.30 sign implementation for ints. 2010-07-22 16:50:56 -07:00
Kenneth Graunke
63a92c975d glsl2/builtins: Fix "mod" builtin to use scalar/vector operations. 2010-07-22 16:50:56 -07:00
Kenneth Graunke
0a89175a35 glsl2: Initialize ir_instruction::type and ir_rvalue::type.
Top-level instructions now get NULL as their default type (since type is
irrelevant for things like ir_function), while ir_rvalues get error_type
by default.

This should make it easier to tell if we've forgotten to set a type.  It
also fixes some "Conditional jump or move depends on uninitialized
value" errors in valgrind caused by ir_validate examining the type of
top level ir_instructions, which weren't set.
2010-07-22 16:50:37 -07:00
Kenneth Graunke
3c033637de glsl2: Make ir_assignment derive from ir_instruction, not ir_rvalue.
Assignments can only exist at the top level instruction stream; the
residual value is handled by assigning the value to a temporary and
returning an ir_dereference_variable of that temporary.
2010-07-22 16:50:37 -07:00
Kenneth Graunke
aa9f86ae8b glsl2: Fix standalone compiler to not crash horribly.
ir_to_mesa was updated for the _mesa_glsl_parse_state constructor
changes, but main.cpp was not.
2010-07-22 16:50:36 -07:00
Kenneth Graunke
40c4298a6e ir_print_visitor: Add "temporary" to mode string printing.
Variables with mode ir_var_temporary were causing an out of bounds array
access and filling my screen with rubbish.  I'm not sure if "temporary"
is the right thing to print.
2010-07-22 16:50:36 -07:00
Carl Worth
fbe4240626 glcpp: Fix function-like macros with an argument used multiple times.
It's really hard to believe that this case has been broken, but apparently
no test previously exercised it. So this commit adds such a test and fixes
it by making a copy of the argument token-list before expanding it.

This fix causes the following glean tests to now pass:

	glsl1-Preprocessor test 6 (#if 0, #define macro)
	glsl1-Preprocessor test 7 (multi-line #define)
2010-07-22 16:38:12 -07:00
Eric Anholt
a0879b9dd4 glsl2: Put side effects of the RHS of logic_or in the right branch.
Kind of missing the point to only do the side effects if the LHS
evaluates as true.

Fixes:
glsl1-|| operator, short-circuit
2010-07-22 16:34:36 -07:00
Eric Anholt
432b787b29 glsl2: Validate that ir_if conditions are actually bool. 2010-07-22 16:24:49 -07:00
Eric Anholt
85e93da18c ir_to_mesa: Fix the swizzles on record and array dereferences.
Fixes:
glsl1-struct (1)
glsl1-struct (2)
glsl1-struct (3)
glsl1-struct (4)
2010-07-22 16:17:57 -07:00
Eric Anholt
9703ed05e6 glsl2: When setting the size of an unsized array, set its deref's size too. 2010-07-22 15:56:07 -07:00
Brian Paul
c20a3628c7 glsl: remove invalid _mesa_problem() call
Fixes fd.o bug 29206.
2010-07-22 16:35:46 -06:00
Eric Anholt
c3081e6273 glsl2: Set the type on cloned tex instructions. 2010-07-22 15:34:01 -07:00
Eric Anholt
a711ad6bf2 glsl2: Add the API defines to the glsl2 build so we get the right GLcontext
Fixes:
draw_buffers-08.frag
draw_buffers-09.frag
glsl-vs-texturematrix-2
2010-07-22 15:22:57 -07:00
Brian Paul
815e79e72c draw: re-order optimization passes depending on LLVM version, 32/64-bit
This is a work-around for an apparent bug in LLVM seen with piglit's
glsl-vs-sqrt-zero test.
2010-07-22 16:09:03 -06:00
Eric Anholt
1bef4c8c4b glsl2: Fix builtin prototypes defined in multiple glsl/builtins/* files
If we put the protos in separate ir_functions, they wouldn't be found
at lookup time for linking.

Fixes:
glsl-fs-texture2d-bias
glsl-fs-texture2dproj-bias
glsl-fs-texture2dproj-bias-2
glsl-lod-bias
glsl1-texture2D(), computed coordinate
2010-07-22 15:03:40 -07:00
Carl Worth
47c90b1447 glsl2: Fix expected type for multiplying vector with non-square matrix.
Previously, the compiler expected the result of the multiplication to
be of the same type as the vector. This is correct for square
matrices, but wrong for all others.

We fix this by instead expecting a vector with the same number of rows
as the matrix (for the case of M*v with a column vector) or the same
number of columns as the matrix (for v*M with a row vector).

This fix causes the following four glean tests to now pass:

	glsl1-mat4x2 * vec4
  	glsl1-vec2 * mat4x2 multiply
  	glsl1-vec3 * mat4x3 multiply
  	glsl1-vec4 * mat3x4 multiply
2010-07-22 14:59:06 -07:00
Eric Anholt
e65dfa89ee glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float).
Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0).

Fixes:
glsl1-mix(vec4) function
2010-07-22 14:25:26 -07:00
Eric Anholt
8ec0b8187e glsl2: When inlining, don't clone and assign sampler arguments.
Instead, just use the incoming sampler param.  Fixes many texture-using
piglit tests since the linker rework.
2010-07-22 13:58:32 -07:00
Eric Anholt
2d1ed7b1b1 glsl2: When a "continue" happens in a "for" loop, run the loop expression.
Fixes:
glsl1-for-loop with continue

Bug #29097
2010-07-22 13:02:40 -07:00
Eric Anholt
748c343f8b ir_to_mesa: Pretty up the printing of MESA_GLSL=dump 2010-07-22 12:37:43 -07:00
Eric Anholt
cc15ef07e0 mesa: Only complain about an infinite loop in a swrast program once.
Chances are, if one fragment looped badly, others will too, and
debugging output gets overwhelmed by the looping complaints.
2010-07-22 12:16:11 -07:00
Eric Anholt
c8d0a9f006 ir_to_mesa: Add support for MESA_GLSL=dump environment var. 2010-07-22 12:11:36 -07:00
Brian Paul
ca3238f3fc draw: added new assertions to clipping code 2010-07-22 11:18:54 -06:00
Eric Anholt
63ba1ec3c1 i965: Respect VS/VP point size result when enabled.
Fixes glsl-vs-point-size.
2010-07-22 10:06:55 -07:00
Eric Anholt
4ea71cbd0e i965: Fix the disasm output for da16 src widths.
This has confused me twice now.  It's a fixed width of 4 (usually a
region description of <4,4,1>), not 1.  If it was 1, we'd have been
skipping all over register space.
2010-07-22 10:06:55 -07:00
Eric Anholt
86fb92f59c i965: Avoid extra MOV in VS indirect register reads. 2010-07-22 10:06:55 -07:00
Eric Anholt
b69ef5744a i965: Fix up VS temporary array access for fixed index offset != 0. 2010-07-22 10:06:55 -07:00
Henri Verbeet
2fdff50999 r600: Flip point sprite coordinates when rendering to an FBO.
This supersedes http://lists.freedesktop.org/archives/mesa-dev/2010-July/001442.html.
2010-07-22 11:10:11 -04:00
Eric Anholt
7095e2f860 glsl2: Use talloc on InfoLog handling in ValidateProgram
Fixes a segfault in Regnum Online.
2010-07-21 23:21:23 -07:00
Eric Anholt
c686ee0fa7 i965: In the VS, multiply the address reg by the appropriate register size.
The ARL value is increments of vec4 in the register file.  But
PROGRAM_TEMPORARY or PROGRAM_INPUT are stored as vec4s interleaved
between the two verts being executed (thus a vec8 each), compared to
PROGRAM_STATE_VAR being packed vec4s.

Fixes:
glsl-vs-arrays-2
glsl-vs-mov-after-deref
(without regressing glsl-vs-arrays-3)
2010-07-21 22:05:30 -07:00
Eric Anholt
21eaa62ba4 i965: Clean up brw_dp_READ_4_vs() now that it has fewer options to support. 2010-07-21 20:17:24 -07:00
Eric Anholt
96b11f1e3e i965: Support relative addressed VS constant reads using the appropriate msg.
The previous support was overly complicated by trying to use the same
1-OWORD message for both offsets.
2010-07-21 20:17:24 -07:00
Eric Anholt
9e9e87a9b2 i965: Fix the DP read msg_control definitions other than plain OWORD. 2010-07-21 20:17:24 -07:00
Eric Anholt
d0326e0e4e i965: Clean up dead code from the VS get_constant/get_reladdr_constant split. 2010-07-21 20:17:24 -07:00
Eric Anholt
04de6861c1 i956: Set the execution size correctly for scratch space writes.
Otherwise, the second half isn't written, and we end up reading back
black.

Fixes the remaining junk drawn in glsl-max-varyings, and will likely
help with a number of large real-world shaders.
2010-07-21 20:17:24 -07:00
Eric Anholt
ff81a1dd92 i965: Set the GEM domain flags for the scratch space.
They go into the render cache, so while we don't care about their
contents after execution, failing to note them could cause the writes
to be flushed over important buffer contents later.
2010-07-21 20:17:24 -07:00
Eric Anholt
a3bfb2f755 i965: Use the pretty define for 4-oword DP reads. 2010-07-21 20:17:24 -07:00
Eric Anholt
d2f3eac8ff i965: Set the send commit bit on register spills as required pre-gen6.
Otherwise, the subsequent read may not get the written value.
2010-07-21 20:17:24 -07:00
Eric Anholt
0ecf5128a4 i965: Add disasm for dataport reads (register unspilling). 2010-07-21 20:17:24 -07:00
Kristian Høgsberg
7a66e54958 glx: Move last few dri_interface.h types out of glxclient.h and drop include 2010-07-21 22:17:24 -04:00
Kristian Høgsberg
f679640868 glx: Move __driContext field out of __GLXcontextRec 2010-07-21 22:17:24 -04:00
Kenneth Graunke
e9384d1d7f glsl2: Update TODO. 2010-07-21 16:38:33 -07:00
Kenneth Graunke
9a6d40fbfb ir_constant_expression: Add support for array == and !=.
Piglit parser tests const-array-03.frag and const-array-04.frag now
generate the correct code.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
a096fa7476 ir_constant_expression: Add support for constant arrays.
Fixes piglit test const-array-02.frag.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
ef2c38b245 ir_reader: Add support for reading constant arrays. 2010-07-21 16:38:33 -07:00
Kenneth Graunke
9930d18c2a ir_print_visitor: Print out constant arrays. 2010-07-21 16:38:33 -07:00
Kenneth Graunke
7ea977a15c ir_print_visitor: Remove commas between ir_constant's components.
The IR reader does not expect commas.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
74e1802f5d glsl2: Extend ir_constant to store constant arrays, and generate them.
Since GLSL permits arrays of structures, we need to store each element
as an ir_constant*, not just ir_constant_data.

Fixes parser tests const-array-01.frag, const-array-03.frag,
const-array-04.frag, const-array-05.frag, though 03 and 04 generate the
wrong code.
2010-07-21 16:38:33 -07:00
Kenneth Graunke
13a19745d4 glsl2: Emit array constructors inline. 2010-07-21 16:38:32 -07:00
Kenneth Graunke
e1d71850fa ast_to_hir: Fix bug in constant initializers.
Implicit conversions were not being performed, nor was there any
type checking - it was possible to have, say, var->type == float
and var->constant_value->type == int.  Later use of the constant
expression would trigger an assertion.

Fixes piglit test const-implicit-conversion.frag.
2010-07-21 16:38:32 -07:00
Kenneth Graunke
46d6b8d1ba ir_constant_expression: Add support for ir_unop_u2f.
Also make ir_unop_i2f only operate on signed integers.
2010-07-21 16:38:32 -07:00
Kenneth Graunke
3163f87463 ir_constant_expression: Remove open coded equality comparisons.
The ir_constant::has_value method already does this.
2010-07-21 16:38:32 -07:00
Kenneth Graunke
0048c7aef8 glsl2: Add some comments. 2010-07-21 16:37:57 -07:00
Kenneth Graunke
c7a18da690 glsl2: Replace insert_before/remove pairs with exec_node::replace_with. 2010-07-21 16:37:57 -07:00
Ian Romanick
d5be2acae3 linker: Link built-in functions instead of including them in every shader
This is an invasive set of changes.  Each user shader tracks a set of other
shaders that contain built-in functions.  During compilation, function
prototypes are imported from these shaders.  During linking, the
shaders are linked with these built-in-function shaders just like with
any other shader.
2010-07-21 15:52:58 -07:00
Ian Romanick
4ccd3c548b glsl2: Add function to import function prototypes from one IR tree to another 2010-07-21 15:52:58 -07:00
Brian Paul
7cd6a6cc99 softpipe: add missing support for PIPE_FORMAT_S8_USCALED surfaces
And remove checks of surface depth bits.  The state tracker should
not turn on depth/stencil testing if the framebuffer doesn't have
depth/stencil.
2010-07-21 16:52:01 -06:00
Brian Paul
ef2d10cd45 softpipe: fix sp_tile_cache_flush_clear() regression 2010-07-21 16:00:52 -06:00
Jerome Glisse
600c85efdb Revert "dri2: Remove an unused variable."
glx_info is used if X_DRI2SwapBuffers is defined
This reverts commit c0ca2bfb2a.
2010-07-21 17:40:37 -04:00
Jerome Glisse
0bca8fbfda r600g: add support for all R6XX/R7XX asic
This configure some of the value properly based on
asic so others asic than RV710 works too.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-21 17:05:37 -04:00
Dave Airlie
4b2820534e r600g: add r600 compile mode to compiler.
some of the ALU instructions are different on r6xx vs r7xx,
separate the alu translation to separate files, and use family
to pick which compile stage to use.
2010-07-21 17:05:37 -04:00
Dave Airlie
9433d0e801 r600g: add family retrival
allow pipe driver to get the family of the gpu.
2010-07-21 17:05:36 -04:00
Marek Olšák
1a3fa3e910 llvmpipe: say no to depth clamp
The other drivers just return 0 without the assert.
2010-07-21 22:54:34 +02:00
Marek Olšák
ca7ead03da r300g: implement depth clamp
Depth clamping seems to be implicit if clipping is disabled.

It's not perfect, but it's good enough for wine and passes
the corresponding piglit tests.
2010-07-21 22:54:34 +02:00
Marek Olšák
5725738ef6 r300g: cleanup clip state emission 2010-07-21 22:54:34 +02:00
Marek Olšák
9ca48de106 draw: disable depth clipping if depth clamp is enabled 2010-07-21 22:54:34 +02:00
Marek Olšák
c304869ec0 st/mesa: implement depth clamp 2010-07-21 22:54:34 +02:00
Marek Olšák
4460e9f0a1 cso: handle depth clamp 2010-07-21 22:54:34 +02:00
Marek Olšák
f47c9b0880 gallium: add depth clamp to the interface 2010-07-21 22:54:34 +02:00
Carl Worth
56d33f8e2b ir_to_mesa: Add missing initializion of lod_info variable.
To quiet a compiler warning.
2010-07-21 13:52:33 -07:00
Carl Worth
a0cfe8c440 glsl: Fix missing initialization of yylloc.source
In both the preprocessor and in the compiler proper, we use a custom
yyltype struct to allow tracking the source-string number in addition
to line and column. However, we were previously relying on bison's
default initialization of the yyltype struct which of course is not
aware of the source field and leaves it uninitialized.

We fix this by defining our own YYLLOC_DEFAULT macro expanding on the
default version (as appears in the bison manual) and adding
initialization of yylloc.source.
2010-07-21 13:52:33 -07:00
Carl Worth
19e3771cff Add missing initialization of inOutFlags pointer.
This quiets a compiler warning, (and ensures a segmentation fault rather
than memory corruption if this variable is written through before being
initialized elsewhere).
2010-07-21 13:26:26 -07:00
Carl Worth
9d1a61efbe Makefiles: Don't complain if depend file to be included doesn't exist.
While bootstrapping the dependencies, make will see the "include depend"
directive before the depend file has been created. To avoid a spurious
warning in this case we use "-include" instead, (which differs precisely
in the fact that it will not emit a diagnostic if the named file does
not exist).
2010-07-21 13:19:33 -07:00
Carl Worth
171a25eaba i965: Remove an unused variable.
To quiet a compiler warning.
2010-07-21 13:17:22 -07:00
Carl Worth
c0ca2bfb2a dri2: Remove an unused variable.
To quiet a compiler warning.
2010-07-21 13:17:05 -07:00
Carl Worth
349fa9ced7 Regenerate program/lex.yy.c
Based on the two recent changes to program_lexer.l.
2010-07-21 13:13:46 -07:00
Carl Worth
b4a08a0d87 Avoid more warnings in flex-generated code.
This avoids two "function defined but not used" warnings. For the yyinput
function we define YY_NO_INPUT which tells flex to simply not generate this
function.

For unput, we add a call to this function, but inside a while(0) so
that it will quiet the warning without actually changing any
functionality.
2010-07-21 13:11:46 -07:00
Carl Worth
3c716a7ec2 Avoid warnings in flex-generated code.
Add declarations for two functions generated in the flex ouput. It
would be nicer if flex simply declared these generated functions as
static, but for now we can at least avoid the warning this way.
2010-07-21 12:49:01 -07:00
Carl Worth
c24bcad9f8 glsl: Correctly handle unary plus operator.
Previously, any occurence of the unary plus operator would trigger a
bogus type mismatch error. Fix this by making the ast_plus case look
more like the ast_neg case as far as type-checking is concerned.

With this change the shaders/CorrectPreprocess8.frag test in piglit
now passes.
2010-07-21 11:42:27 -07:00
Brian Paul
aa9003e20e draw: tweak aa line width threshold and sampling
Set sampler max_lod to avoid sampling the 1x1 and 2x2 mipmap levels.

Fixes piglit line-aa-width test, fd.o bug 29160.
2010-07-21 11:38:43 -06:00
Patrice Mandin
c052213fb3 nouveau/nvfx: Add new PIPE_CAP values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-07-21 19:28:45 +02:00
Brian Paul
3662afd87d gallivm: replace has_indirect_addressing field with indirect_files field
Instead of one big boolean indicating indirect addressing, use a
bitfield indicating which register files are accessed with indirect
addressing.

Most shaders that use indirect addressing only use it to access the
constant buffer.  So no need to use an array for temporary registers
in this case.
2010-07-21 10:16:32 -06:00
Brian Paul
85206e56a1 tgsi: added tgsi_shader_info::indirect_files field
Indicates which register files are accessed with indirect addressing.
2010-07-21 10:16:32 -06:00
Brian Paul
0115f07507 gallivm: refactor code into get_indirect_offsets() function 2010-07-21 10:16:32 -06:00
Brian Paul
890976e02d gallivm: added comment 2010-07-21 10:16:32 -06:00
Brian Paul
be22e1e781 gallivm: remove extraneous braces 2010-07-21 10:16:32 -06:00
Brian Paul
f674ed6b06 gallivm: no longer do indirect addressing in get_temp_ptr() 2010-07-21 10:16:32 -06:00
Brian Paul
105ed7dfd4 gallivm: implement correct indirect addressing of temp registers
As with indexing the const buffer, the ADDR reg may have totally
different values for each element.  Need to use a gather operation.
2010-07-21 10:16:32 -06:00
Brian Paul
695814a15b gallivm: re-org, comments for get_temp_ptr() 2010-07-21 10:16:31 -06:00
Brian Paul
6921a6dd4e draw: whitespace clean-up 2010-07-21 10:16:31 -06:00
Keith Whitwell
d350695a6b gallium: remove pointless bitfield restrction in pipe_vertex_element
This used to be a somewhat packed struct, but no longer.  Remove the
last remaining bitfield tag.
2010-07-21 16:30:38 +01:00
Brian Paul
ec0e7b16bb gallivm: rename a var to avoid compiler warnings 2010-07-21 08:08:12 -06:00
Brian Paul
4363d4d0b9 gallivm: fix indirect addressing of constant buffer
The previous code assumed that all elements of the address register
were the same.  But it can vary from pixel to pixel or vertex to
vertex so we must use a gather operation when dynamically indexing
the constant buffer.

Still need to fix this for the temporary register file...
2010-07-20 18:50:35 -06:00
Brian Paul
b0636f78aa gallivm: added lp_build_const_int32() helper 2010-07-20 18:50:35 -06:00
Ian Romanick
f38d15b80d glsl2: glsl_type has its own talloc context, don't pass one in 2010-07-20 17:48:25 -07:00
Ian Romanick
a7ba9a7919 linker: Do post-link lowering and optimization
The lowering code should probably be moved elsewhere.
2010-07-20 17:48:24 -07:00
Ian Romanick
60e2d06d1c glsl2: Implement utility routine to talloc reparent an IR tree 2010-07-20 17:48:24 -07:00
Ian Romanick
2462a536ea glsl2: Add a constructor for _mesa_glsl_parse_state
Coming changes to the handling of built-in functions necessitate this.
2010-07-20 17:48:24 -07:00
Ian Romanick
7e2aa91507 glsl2: Add and use new variable mode ir_var_temporary
This is quite a large patch because breaking it into smaller pieces
would result in the tree being intermitently broken.  The big changes
are:

    * Add the ir_var_temporary variable mode

    * Change the ir_variable constructor to take the mode as a
      parameter and correctly specify the mode for all ir_varables.

    * Change the linker to not cross validate ir_var_temporary
      variables.

    * Change the linker to pull all ir_var_temporary variables from
      global scope into 'main'.
2010-07-20 17:48:24 -07:00
Eric Anholt
1124e5a3cb ir_to_mesa: Validate the linked shaders as well.
This caught the failure in cloning of ir_dereference_record.
2010-07-20 17:30:11 -07:00
Eric Anholt
f141fa63a4 glsl2: Check that nodes in a valid tree aren't error-type.
We're good at propagating error types around, but finding when the
first one was triggered can be painful if we aren't paying attention.
2010-07-20 17:30:10 -07:00
Eric Anholt
fade78edcb glsl2: strdup the field names used in dereference_record.
Otherwise, after linking and freeing the old data, the pointer would
dangle.  Partial fix for glsl1-struct*.
2010-07-20 17:30:10 -07:00
Eric Anholt
21b0dbd799 glsl2: talloc the glsl_struct_field[] we use to look up structure types.
Since the types are singletons across the lifetime of the compiler,
repeatedly compiling a program with the same structure type defined
would drop a copy of the array on the floor per compile.

This is a bit tricky because the static GLSL types are not called with
the talloc-based new, so we have to use the global type context, which
may not be initialized yet.
2010-07-20 17:30:10 -07:00
Eric Anholt
b6e92ad7da glsl2: Don't claim a match on structure types with different field names.
We regularly do lookups on the field names of the structure to find
the types within the struct, so returning a structure type with bad
names will lead to lots of error types being found.
2010-07-20 17:30:10 -07:00
Kenneth Graunke
094cf8c199 glsl2: Add support for the .length() method on arrays.
Fixes piglit test glsl-array-length, and provides proper error messages
for negative piglit tests array-length-110.frag, array-length-unsized.frag,
and array-length-args.frag.
2010-07-20 17:13:17 -07:00
Kenneth Graunke
1036a7ebae glsl2: Remove incorrect assertion in the parser.
This assertion is triggered by method calls (i.e. array.length()), where
subexpressions[1] is an ast_function_call expression.  Since the
assertion itself had a comment saying it could be removed eventually,
simply do so.

Causes negative glslparser tests array-length-110.frag,
array-length-args.frag, and array-length-unsized.frag to pass, but only
because the length() method is not supported yet.
2010-07-20 17:13:17 -07:00
Kenneth Graunke
2b7c42b40a glsl2: Disallow non-constant array indexing for unsized arrays.
Fixes piglit test unsized-array-non-const-index.vert.
2010-07-20 17:13:17 -07:00
Kenneth Graunke
e4768eecd5 ir_constant_expression: Remove pointless use of variable_referenced.
ir_dereference_variable always references an ir_variable, so there's no
point in calling a function and NULL-checking the result.
2010-07-20 17:10:05 -07:00
Kenneth Graunke
98f32a13be ir_constant_expression: Use "this" pointer directly.
In ir_expression's signature, I replaced ir->operands[i] with op[i] as
it is more concise; an assertion already ensures these are equal.
2010-07-20 17:10:05 -07:00
Kenneth Graunke
fb2ffd2846 ir_constant_expression: Convert from a visitor to a virtual function.
The constant_expression_wrapper was already the only external API, and
much of the internal code used it anyway.  Also, it wouldn't ever visit
non-rvalue ir_instructions, so using a visitor seemed a bit unnecessary.

This uses "ir_foo *ir = this;" lines to avoid code churn.  These should
be removed.
2010-07-20 17:10:05 -07:00
Kenneth Graunke
e340854115 glsl2: Move constant_expression_value method to ir_rvalue.
This prevents top-level callers from asking for the value of something
that is guaranteed not to have one.
2010-07-20 17:10:05 -07:00
Carl Worth
e1acbfca32 glcpp: Avoid accidental token pasting in preprocessed result.
Consider this test case:

	#define EMPTY
	int foo = 1+EMPTY+4;

The expression should compile as the sequence of tokens 1, PLUS,
UNARY_POSITIVE, 4. But glcpp has been failing for this case since it
results in the string "1++4" which a compiler correctly sees as a
syntax error, (1, POST_INCREMENT, 4).

We fix this by changing any macro with an empty definition to result
in a single SPACE token rather than nothing. This then gives "1+ +4"
which compiles correctly.

This commit does touch up the two existing test cases which already
have empty macros, (to add the space to the expected result).

It also adds a new test case to exercise the above scenario.
2010-07-20 17:01:12 -07:00
Carl Worth
942ccc5170 glcpp: Add missing include in xtalloc.c
Without this, the compiler was legitimately complaining about missing
declarations for all of the functions being defined here.
2010-07-20 17:01:12 -07:00
Carl Worth
d80dcaf427 glcpp: Add static keyword to several functions in the parser.
This quiets warnings about missing declarations otherwise.
2010-07-20 17:01:11 -07:00
Carl Worth
fb90560744 glcpp: Avoid warnings in generated flex code.
We define the YY_NO_INPUT macro to avoid one needless function being
generated.

for the other needless functions, (yyunput and yy_top_state), we add a
new UNREACHABLE start condition and call these functions from an
action there. This doesn't change functionality at all, (since we
never enter the UNREACHABLE start condition), but makes the compiler
stop complaining about these two functions being defined but not used.
2010-07-20 17:01:11 -07:00
Carl Worth
a9bb4bcde3 glcpp-lex: Declare some generated functions to eliminate compiler warnings.
It's really a bug in flex that these functions are generated with neither
a declaration nor the 'static' keyword, but we can at least avoid the
warnings this way.
2010-07-20 17:01:11 -07:00
Carl Worth
1d7e03e48e glcpp: Fix support for nested #ifdef and nested #ifndef
Previously, if the outer #ifdef/#ifndef evaluated to false, the inner
directive would not be parsed correctly, (the identifier as the subject
of the #ifdef/#ifndef would inadvertently be skipped along with the other
content correctly being skipped).

We fix this by setting the lexing_if state in each case here.

We also add a new test to the test suite to ensure that this case is tested.
2010-07-20 17:01:11 -07:00
Carl Worth
17f9beb6c3 glcpp: Support #if(expression) with no intervening space.
And add a test case to ensure that this works.
2010-07-20 17:01:11 -07:00
Carl Worth
61ebc01dfe glcpp: Fix use-after-free error from #undef directive.
By taking advantage of the recently-added hash_table_remove function.

With this change, all existing tests are now valgrind-clean.
2010-07-20 17:01:11 -07:00
Carl Worth
d4f239de6e hash_table: Add new hash_table_remove function.
To allow for the removal of a single element from a hash table.
2010-07-20 17:01:11 -07:00
Carl Worth
d1500f8a19 glcpp: Make test suite test for valgrind cleanliness.
As it turns out, 4 of our current tests are not valgrind clean,
(use after free errors or so), so this will be helpful for
investigating and fixing those.
2010-07-20 17:01:11 -07:00
Carl Worth
3a530b8ef6 glcpp: Make test suite report final count of passed/total tests.
And report PASS or FAIL for each test along the way as well.
2010-07-20 17:01:11 -07:00
Carl Worth
41d525f2df Build a standalone glcpp binary.
This is convenient for testing the preprocessor independent of the rest of
mesa, (just run glcpp-test in the src/glsl/glcpp/tests).
2010-07-20 17:01:11 -07:00
Carl Worth
f15e27ec1d glcpp: Delete copies of hash_table.c, hash_table.h, and other headers.
These were only ever intended to exist in the original, standalone
implementation of glcpp, (with the idea of dropping them as soon as
the code moved into mesa). The current build system wasn't compiling
this C file, but the presence of the header files could cause problems
if the two copies diverge in the future.

We head those problems off by deleting al of these redundant files.
2010-07-20 17:01:11 -07:00
Eric Anholt
325a49701f glsl2: Fix handling of out values in function inlining.
The parameters[i] is our inlined variables representing the
parameters, so they are always ir_var_auto.  Walk the signature params
in handling "out" values like we do for "in" values to find the mode.

Fixes (with the previous 2 commits):
glsl1-function call with in, out params
glsl1-function call with inout params
2010-07-20 16:21:07 -07:00
Eric Anholt
2927c81ed1 glsl2: Don't mark a variable as constant if it was used as an out param. 2010-07-20 15:59:04 -07:00
Eric Anholt
02d3711a21 glsl2: Always insert function calls into the instruction stream.
If they have a return value, this means putting it into a temporary
and making a deref of the temp be the rvalue, since we don't know if
the rvalue will be used or not.
2010-07-20 15:59:04 -07:00
Vinson Lee
c4889fa5f0 radeon: Remove unnecessary header. 2010-07-20 14:18:42 -07:00
Eric Anholt
f8946699ec glsl2: Add definitions of the builtin constants present in GLSL 1.10.
Fixes:
glsl1-built-in constants
2010-07-20 14:03:35 -07:00
Eric Anholt
1245babe0c glsl2: Fix asin() implementation.
I'd flipped around the order of two operations in paren-balancing
adventures, and left out the multiply by sign(x) required for negative x.

Fixes:
glsl1-acos(vec4) function
glsl1-asin(vec4) function
glsl1-atan(vec4) function
2010-07-20 12:24:01 -07:00
Jerome Glisse
62f8b56dc6 r600g: split trans unit computation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-20 15:07:32 -04:00
Eric Anholt
117d154b4d glsl2: notEqual() produces a boolean value, not the base type of the args.
Fixes:
glsl1-vector relational (bvec2 ==,!=)
glsl1-vector relational (vec4 !=)
2010-07-20 12:01:40 -07:00
Eric Anholt
14f8e16132 glsl2: Constant-fold assignment conditions. 2010-07-20 12:01:40 -07:00
Ian Romanick
5a2e0b8ce5 glsl2: Don't validate IR if there were compilation errors 2010-07-20 11:38:54 -07:00
Eric Anholt
18ab797d3a ir_to_mesa: Fix swizzled writemasks with swapped component ordering.
I hadn't noticed you could do this, but glsl1 tests caught it.  Fixes:
glsl1-Swizzled writemask
glsl1-Swizzled writemask (2)
glsl1-Swizzled writemask (rgba)
glsl1-Swizzled writemask (stpq)
2010-07-20 11:28:33 -07:00
Marek Olšák
5ed6627ceb st/mesa: implement and advertise GL_ARB_draw_elements_base_vertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-07-20 11:53:43 -06:00
Brian Paul
691c1fb074 draw: correctly handle max_index=0xffffffff case in vcache code
If max_index=0xffffffff and elt_bias > 0 the test for
elt_bias + max_index >= DRAW_PIPE_MAX_VERTICES
was wrong.  Check earlier if max_index=0xffffffff and do the
"fail" case.

This fixes the piglit draw-elements-base-vertex test (and probably
some other things).
2010-07-20 11:53:43 -06:00
Marek Olšák
e794fac35a st/mesa: implement depth texture modes 2010-07-20 18:09:12 +02:00
Brian Paul
bab484a59b mesa: call ctx->Driver.ChooseTextureFormat() only when necessary.
When defining mipmap level 'L' and level L-1 exists and the new level's
internalFormat matches level L-1's internalFormat, then use the same hw
format.  Otherwise, do the regular ctx->Driver.ChooseTextureFormat() call.

This avoids a problem where we end up choosing different hw formats for
different mipmap levels depending on how the levels are defined (glTexImage
vs. glCopyTexImage vs. glGenerateMipmap, etc).

The root problem is the ChooseTextureFormat() implementation in some
drivers uses the user's glTexImage format/type parameters in the choosing
heuristic.  Later mipmap levels might be generated with different calls
(ex: glCopyTexImage()) so we don't always have format/type info and the
driver may choose a different format.

For more background info see the July 2010 mesa-dev thread "Bug in
_mesa_meta_GenerateMipmap"
2010-07-20 08:50:32 -06:00
Brian Paul
895086467e graw/tests: pass -e option to test draw_elements_instanced() 2010-07-20 08:50:32 -06:00
Michal Krol
3b2ca688a7 softpipe: Support non-depth-stencil formats in sp_tile_cache_flush_clear(). 2010-07-20 15:01:25 +02:00
Kristian Høgsberg
c1cbdbfde0 glx: #ifdef DRI specific prototype
https://bugs.freedesktop.org/show_bug.cgi?id=29162
2010-07-20 07:43:50 -04:00
Michel Dänzer
bd3d2724f5 glx/dri2: Fix dri2CopySubBuffer() again.
Only refresh the fake front buffer if there is one, and only destroy the region
once.

Fixes X11 protocol errors reported by 'mcgreg' on IRC.
2010-07-20 12:21:17 +02:00
Marek Olšák
bdde9d2fce util: mempool: initialize last block's magic number in a page 2010-07-20 10:23:54 +02:00
Chia-I Wu
87290a383b st/egl: Fixes for recent GLX cleanup.
Mainly, the type of __GLXdisplayPrivateRec::screenConfigs has changed
from "__GLXscreenConfigs *" to "__GLXscreenConfigs **".
2010-07-20 12:39:23 +08:00
Chia-I Wu
c7ad2a4e79 st/dri: Remove driFrameTrackingExtension.
The extension has been removed in
22266c391f.
2010-07-20 12:37:13 +08:00
Kristian Høgsberg
a7292f2920 glx: Move DRI CopySubBuffer extension to DRI1 code
We do this in the X server for DRI2.
2010-07-19 22:45:51 -04:00
Kristian Høgsberg
bab13969d8 glx: Move driver_configs to DRI screen privates 2010-07-19 22:45:51 -04:00
Kristian Høgsberg
e3e8196c02 glx: Move drawHash to display private
The XIDs are display wide so the natural location of the hash is here.
This way we don't have to lookup in each of the screen hashes.
2010-07-19 22:45:51 -04:00
Kristian Høgsberg
037755122e glx: Don't use __glXInitialize() when we might be holding __glXLock() 2010-07-19 22:45:51 -04:00
Kristian Høgsberg
8d0228912b glx: Workaround mismatch in signedness between extensions and protocol
The DRI2 protocol for ust, msc and sbc are unsigned but the extensions
talk about int64_t.  Do a little dance to make the compiler shut up.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
271c3c3a90 glx: Move __DRIdrawable pointers to DRI drawable privates 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
22266c391f glx: Remove support for MESA_swap_frame_usage
The extension never worked, the implementation returns GLX_BAD_CONTEXT
when enabling the frame tracking.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
70887d5172 glx: Move __driScreen into the dri screen privates 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
089fc37c6f glx: Move DRI1 specific extensions and code to DRI1 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
9e546ecfd4 glx: Move DRI2 extensions to DRI2 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
cb2a66fd0c glx: Drop support for GLX_MESA_allocate_memory
Only r200 implemented it.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
f972115d33 glx: Add screen privates for dri drivers and moved some fields there
GLXscreenConfigs is badly named and a dumping ground for a lot of stuff.
This patch creates private screen structs for the dri drivers and moves
some of their fields over there.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
a296d96de4 glx: Rename various DRI structs away from obnoxious __GLXfooRec convention
Enough is enough.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg
308e13ecd1 glx: Factor out common code from dri2WaitGL() and dri2WaitX() 2010-07-19 22:45:50 -04:00
Kristian Høgsberg
b006d465ea glx: Dont use dri2WaitX() to update fake front
This saves a superfluous flush and a create/destryo region.
2010-07-19 22:45:50 -04:00
Eric Anholt
f9d11b8cee i965: Mostly fix glsl-max-varyings.
There was confusion on both the size of message we can send, and on
what the URB destination offset means.

The remaining problems appear to be due to spilling of regs in the
fragment shader being broken.
2010-07-19 19:29:48 -07:00
Eric Anholt
e179fa9a0a i965: Clean up message register setup in emit_vertex_write(). 2010-07-19 19:29:03 -07:00
Eric Anholt
09788ce10e i965: Reduce repeated calculation of the attribute-offset-in-VUE.
This cleans up some chipset dependency sprinkled around, and fixes a
potential overflow of the attribute offset array for many vertex
results.
2010-07-19 19:29:03 -07:00
Eric Anholt
e29cff6273 i965: Clarify the nr_regs calculation in brw_clip.c 2010-07-19 19:29:03 -07:00
Eric Anholt
bdcaaed6ff i965: Don't set up VUE space for the disabled user clip distances on gen6. 2010-07-19 19:29:03 -07:00
Brian Paul
37692e5dc9 draw: fix incorrect instancing divisor in LLVM code 2010-07-19 18:29:12 -06:00
Ian Romanick
cd6764ed6e linker: Remove the FINISHME comment for intrastage linking 2010-07-19 14:50:43 -07:00
Ian Romanick
1a03a644d2 linker: Remove redundant check for 'main' in shaders
This is now handled in link_intrastage_shaders.
2010-07-19 14:50:43 -07:00
Ian Romanick
25f51d3b9b linker: Track and validate GLSL versions used in shaders 2010-07-19 14:50:43 -07:00
Ian Romanick
b64e979971 glsl2: Use Elements macro 2010-07-19 14:50:43 -07:00
Ian Romanick
fc9ae101b4 linker: Recursively resolve function calls in imported functions 2010-07-19 14:50:43 -07:00
Ian Romanick
532c2d3085 linker: look up function signatures during linking instead of using callee
Instead of using ir_call::callee, search for the signature in the
linked shader.  This will allow resolving calls from functions
imported from other shaders.  The ir_call::callee pointer in the
imported function will still reference a signature in the original shader.
2010-07-19 14:50:43 -07:00
Ian Romanick
5adbf0bff1 linker: Pull find_matching_signature out of call_link_visitor
The list of shaders to search needs to be provided as an explicit
parameter to support coming changes.  At that point there is no reason
for it to be in the class.  Also, fix some of the 'const' decorators.
2010-07-19 14:50:43 -07:00
Ian Romanick
b95897b89d glsl2: Explicitly walk lists in ir_function::parameter_lists_match
Give ir_function::parameter_lists_match_exist similar treatment.  Make
the parameters const, and propogate the constness as far as it will
trivially go.
2010-07-19 14:50:43 -07:00
Ian Romanick
de415b7f4b linker: Add comment about bug in initializer handling 2010-07-19 14:50:43 -07:00
Ian Romanick
8fe8a814b0 linker: First bits of intrastage, intershader function linking
This handles the easy case of linking a function in a different
compilation unit that doesn't call any functions or reference any
global variables.
2010-07-19 14:50:43 -07:00
Ian Romanick
a48a2b66e8 ir_function_signature: Make actual_parameters public 2010-07-19 14:50:43 -07:00
Ian Romanick
3880d07f4b linker: Remove some unnecessary includes 2010-07-19 14:50:43 -07:00
Kenneth Graunke
61a44ccaef exec_list: Fix foreach_list_safe.
It now works correctly when nodes are removed, as it was originally
intended to do; it no longer processes nodes added to the list before
the current node, nor those added immediately after the current node.

This matches the behavior of Linux's list_for_each_safe.
2010-07-19 14:49:34 -07:00
Brian Paul
374c74f4c4 mesa: remove restart.c from build 2010-07-19 15:29:03 -06:00
Ian Romanick
303c99f12f linker: Use foreach_list_safe in move_non_declarations
The node being processed may be removed from the list and put in a
different list.  Not using the safe version caused list processing to
change streams after moving a node.
2010-07-19 12:36:32 -07:00
Ian Romanick
9303e358cb linker: Move global instructions from the linked shader first
For the shader containing 'main', use the linked shader (i.e., the
clone of the original shader that contained main) as the source for
global instructions to move into main.
2010-07-19 12:36:32 -07:00
Marek Olšák
3b189d888a r300g: fix possible crash in destroy_context
The problem is destroy_context is almost NEVER called.
The only test for destroy_context I know is compiz.

Reported by Vinson Lee.

FDO bug #29150.
2010-07-19 21:12:52 +02:00
Marek Olšák
fd03dd203f util: remove the dummy field in mempool
It should allocate less memory now.
2010-07-19 21:05:47 +02:00
Eric Anholt
5304493c40 glsl2: Fix lexing of octal values, including "0".
When faced with a constructor like 'ivec4(0, 2, 0, 0)', we would
manage to get a value of 2 instead of 0 for the first "0".  Usually 2
characters past "0" would point at some junk and lex as 0 anyway.

Fixes glsl-octal and glsl-unused-varyings.
2010-07-19 11:58:03 -07:00
Vinson Lee
95ca22001a scons: Fix Mac OS X SCons build on 32-bit CPUs.
The Mac OS X SCons build failed on 32-bit CPUs starting with commit
2f6d47a7c8 during linking of graw-null.
The build succeeds though on a 64-bit CPU. See FDO bug 29117.

This was the compiler error.
scons: building associated VariantDir targets: build/darwin-x86-debug
  Linking build/darwin-x86-debug/gallium/targets/graw-null/libgraw.dylib ...
Undefined symbols:
  "_lp_swizzled_cbuf", referenced from:
      _lp_swizzled_cbuf$non_lazy_ptr in libllvmpipe.a(lp_rast.os)
      _lp_swizzled_cbuf$non_lazy_ptr in libllvmpipe.a(lp_rast_tri.os)
     (maybe you meant: _lp_swizzled_cbuf$non_lazy_ptr)
  "_lp_dummy_tile", referenced from:
      _lp_dummy_tile$non_lazy_ptr in libllvmpipe.a(lp_rast.os)
      _lp_dummy_tile$non_lazy_ptr in libllvmpipe.a(lp_rast_tri.os)
      _lp_dummy_tile$non_lazy_ptr in libllvmpipe.a(lp_setup.os)
     (maybe you meant: _lp_dummy_tile$non_lazy_ptr)

The patch adds -fno-common to all Mac OS X builds to work around this issue.
2010-07-19 11:31:44 -07:00
Eric Anholt
82d4b9593b glsl2: Fix the expression type for atan's pi * sign(y).
Fixes CorrectFunction.vert.
2010-07-19 10:47:12 -07:00
Eric Anholt
95c08920ea i915: Ask the compiler to flatten out all the if statements that it can. 2010-07-19 10:47:08 -07:00
Eric Anholt
29ce44ad2b glsl2: Add a pass for converting if statements to conditional assignment.
This will be used on 915 and similar hardware of that generation.
2010-07-19 10:21:38 -07:00
Eric Anholt
d16044ad4d glsl2: Give IR nodes a type field.
This is a big deal for debugging if nothing else ("what class is this
ir_instruction, really?"), but is also nice for avoiding building a
whole visitor or an if (node->as_whatever() || node->as_other_thing())
chain.
2010-07-19 09:50:29 -07:00
Eric Anholt
ee7b2b3f44 ir_to_mesa: Do validation on the IR tree. 2010-07-19 09:50:26 -07:00
Brian Paul
369e9272de util: add dummy field to empty structure types
Empty structure types aren't allowed with MSVC.
I haven't tested this change.  Hope I haven't broken it...
2010-07-19 10:50:11 -06:00
Eric Anholt
4802fd905a ir_to_mesa: Don't do lowering passes on an errored-out shader. 2010-07-19 09:44:30 -07:00
Marek Olšák
d1671ceb71 r300g: fix typo 2010-07-19 17:33:40 +02:00
Marek Olšák
7b31b235d0 r300g: use memory pools for buffer_create and get_transfer
The improvement in Tremulous: 68.9 fps -> 71.1 fps.
2010-07-19 17:12:11 +02:00
Marek Olšák
ad44b775e3 util: add a memory pool for equally sized memory allocations
malloc/free are in O(1).
2010-07-19 17:12:11 +02:00
Marek Olšák
4fd39a8d69 st/mesa: fix FRAMEBUFFER_UNSUPPORTED with the D24S8 format
Fixes FDO bug #29116.

NOTE: this is a candidate for the 7.8 branch
2010-07-19 17:11:23 +02:00
Kristian Høgsberg
3750ebd540 glx: Fix drawable lookup in DRI2 event handler
DRI2 events are sent to the X drawable ID used to create the DRI2 drawable,
not the GLX drawable ID.  So when an event comes in, we need to look up
the __GLXDRIdrawable by its X drawable ID, which needs a new hash table.
2010-07-19 09:37:38 -04:00
Eric Anholt
b29d31cd67 ir_to_mesa: Rename struct temp_entry, which is used for all variables now. 2010-07-18 18:13:07 -07:00
Eric Anholt
7b13014942 ir_to_mesa: Add support for function calls.
Unlike the previous compiler, in this case we emit only one copy of
the function regardless of how many times it's called.
2010-07-18 18:13:06 -07:00
Eric Anholt
1f47245bdd glsl2: Remove the const disease from function signature's callee. 2010-07-18 18:13:06 -07:00
Eric Anholt
9be7f63813 glsl2: Make cross() be an expression operation.
ARB_fp, ARB_vp, Mesa IR, and the 965 vertex shader all have
instructions for cross.  Shaves 12 Mesa instructions off of a
66-instruction shader I have.
2010-07-18 18:12:12 -07:00
Eric Anholt
87a2ee8db6 glsl2: Fix warning from always-false assert not being known to not return. 2010-07-18 17:49:15 -07:00
Dave Airlie
4eaf591d15 r300g: u_upload optimisation
fix vb/ib uploads
2010-07-18 18:11:29 +02:00
Sven Arvidsson
14e362c79a gallium/st/dri2: add dri2 vblank query extension support
from bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=28771

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-18 19:18:49 +10:00
Vinson Lee
f3a2f458a3 llvmpipe: Remove dead initialization. 2010-07-18 01:14:36 -07:00
Marek Olšák
70b27be923 r300g: final fix for r3xx constant buffer emission 2010-07-17 17:18:59 +02:00
Marek Olšák
f7d6cab6cd r300g: fix typo in r3xx constant buffer emission
Ooops.
2010-07-17 14:40:41 +02:00
Marek Olšák
f92d1a54e9 r300g: fix constant buffer emission on r3xx
FDO bug #29128.
2010-07-17 13:37:14 +02:00
Vinson Lee
184abe8e26 llvmpipe: Remove unused variable in lp_test_sincos. 2010-07-17 00:35:10 -07:00
Vinson Lee
e02edab1a1 nv50: s/__func__/__FUNCTION__/ 2010-07-16 18:41:32 -07:00
Vinson Lee
b5fcab976f nouveau: s/__func__/__FUNCTION__/ 2010-07-16 18:14:11 -07:00
Vinson Lee
37648b86b1 nouveau: s/snprintf/util_snprintf/ 2010-07-16 18:03:03 -07:00
Vinson Lee
68744f9325 r300g: Remove unnecessary header. 2010-07-16 17:55:57 -07:00
Vinson Lee
e02c1e215e nouveau: s/inline/INLINE/ 2010-07-16 17:49:18 -07:00
José Fonseca
65ba566ff1 glut: Remove duplicate symbol definition. 2010-07-16 21:48:36 +01:00
José Fonseca
6f81b78cb4 scons: Make PIPE_ALIGN_VAR() of static/global vars work on MinGW.
Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
2010-07-16 21:27:14 +01:00
Vinson Lee
5cf0789f91 scons: Fix Cygwin build.
The Cygwin SCons build needed several file names to be fully qualified.
2010-07-16 12:34:22 -07:00
Marek Olšák
5862b6ed61 r300g: inline winsys_buffer_destroy 2010-07-16 21:13:21 +02:00
Marek Olšák
3eb5577783 r300g: do not make copies of constant buffers, emit them directly 2010-07-16 21:13:21 +02:00
Brian Paul
80e07c4190 draw: updated debug/dump code 2010-07-16 11:10:25 -06:00
Brian Paul
959a458ea0 draw: added array element debug / bounds checking code (disabled) 2010-07-16 11:09:32 -06:00
Keith Whitwell
2f6d47a7c8 llvmpipe: use single swizzled tile
Use a single swizzled tile per colorbuf (and per thread) to avoid
accumulating large amounts of cached swizzled data.

Now that the SSE3 code has been merged to master, the performance delta
of this change is minimal, the main benefit is reduced memory usage
due to no longer keeping swizzled copies of render targets.

It's clear from the performance of the in-place version of this code
that there is still quite a bit of time being spent swizzling &
unswizzling, but it's not clear exactly how to reduce that.
2010-07-16 17:24:21 +01:00
José Fonseca
b7fff13d58 llvmpipe: Describe _mm_shuffle_epi8() with gcc extended inline assembly when -mssse3 is not supported/enabled. 2010-07-16 17:24:21 +01:00
José Fonseca
0a36a064a1 llvmpipe: Only use -mssse3 on gcc 4.3+ 2010-07-16 17:24:21 +01:00
Zack Rusin
fab4ac9e94 draw/llvm: adjust the instance id at run time
fixes instancing in draw llvm
2010-07-16 12:19:26 -04:00
Zack Rusin
b77f5024ca draw: use the instance id when fetching vertex data 2010-07-16 11:58:20 -04:00
Brian Paul
41bcd8cb1e mesa: return retval in _mesa_RenderObjectUnpurgeable()
Found by Vinson with static analysis.

NOTE: This is a candidate for the 7.8 branch.
2010-07-16 07:37:30 -06:00
Chia-I Wu
08f4bc07e4 st/egl: Fix build on FreeBSD.
There is no libdl on FreeBSD.  Based on patch from Thinker
<thinker@branda.to>, which is against 7.8.

This fixes fdo bug #29093.
2010-07-16 20:19:13 +08:00
Chia-I Wu
39ae965783 egl: Build egl_dri2 only when DRI drivers are built.
That is, build egl_dri2 only when --with-driver=dri is given (the
default).
2010-07-16 19:50:16 +08:00
Chia-I Wu
bb217ba76a egl: Build egl_dri2 only when xcb-dri2 is available.
The driver does not build when xcb-dri2 is not available.
2010-07-16 19:41:29 +08:00
Vinson Lee
6f6c8ec7b7 glu/sgi: Remove dead initialization in extract565rev. 2010-07-16 01:11:03 -07:00
Vinson Lee
4b387ee087 i965g: Remove dead initialization in precalc_tex. 2010-07-16 01:07:13 -07:00
Marek Olšák
fe3caa91d3 r300g: rebuild winsys and command submission to support multiple contexts 2010-07-16 08:51:16 +02:00
Vinson Lee
5f9d7bb242 mesa: Add error path in compressed_texture_error_check.
Add error path for unhandled dimensions in
compressed_texture_error_check.
2010-07-15 23:45:25 -07:00
Vinson Lee
643f5ea1e0 glsl/apps: Handle ftell errors in non-debug builds. 2010-07-15 18:45:20 -07:00
Brian Paul
5824fbf674 llvmpipe: implement instanced drawing functions
And express all the other drawing functions in terms of
llvmpipe_draw_range_elements_instanced().
2010-07-15 15:56:09 -06:00
Brian Paul
839608a8be draw: update comments for drawing functions 2010-07-15 15:42:36 -06:00
Brian Paul
5c0f6bf13b draw: move prototype, update comment 2010-07-15 15:42:36 -06:00
Brian Paul
7fce75ed29 softpipe: re-order drawing functions to get rid of prototype 2010-07-15 15:42:36 -06:00
Brian Paul
77e651db07 graw: new tri-instanced.c program to test instanced drawing 2010-07-15 15:42:36 -06:00
Alex Deucher
2bd69080a2 r600: fix typo in r700 assembler
Noticed by Henri Verbeet on IRC.

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 17:03:58 -04:00
Henri Verbeet
fef9b532cd radeon: Also flush if it's not the current context that's being destroyed.
This avoids calling radeonFlush() during context destruction, when
ctx->DrawBuffer would be NULL.

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 14:54:25 -04:00
Alex Deucher
0a7803cbac radeon: allow driconf vblank settings with dri2
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28771

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 14:47:06 -04:00
Brian Paul
3fde89e439 st/mesa: fix quad strip trimming bug
The translate_prim() function tries to convert quad strips into
tri strips.  This is normally OK but we have to check for an odd
number of vertices so that we don't accidentally draw an extra
triangle.  The mesa-demos/src/samples/prim.c demo exercises that.
With this fix the stray yellow triangle is no longer drawn.

Use the u_trim_pipe_prim() function to make sure that prims have
the right number of vertices and avoid calling gallium drawing
functions when the prim has a degenerate number of vertices.

Plus add comments, clean-up formatting, etc.

NOTE: This is a candidate for the 7.8 branch.
2010-07-15 10:49:56 -06:00
José Fonseca
0eaccb30de llvmpipe: Remove redundant statement.
Thanks to Vinson for spotting this.
2010-07-15 10:59:03 +01:00
Vinson Lee
4f6aa567c0 glu/sgi: Remove dead initialization in extract565. 2010-07-15 01:42:02 -07:00
Vinson Lee
3471ac9569 tgsi: Remove dead assignment in uprcase function. 2010-07-15 01:26:09 -07:00
Vinson Lee
cc2f337d06 mesa: Fix potential out-of-bounds access by _vbo_Materialf.
_vbo_Materialf calls _vbo_Materialfv, which uses the params argument as
an array.
2010-07-15 00:53:07 -07:00
Vinson Lee
5c9e54f2ff glx: Move dereference and initialization to after NULL check. 2010-07-15 00:20:41 -07:00
Chia-I Wu
d7284b45e2 egl: Return the correct array size in _eglFlattenArray.
The function is used by _eglGetConfigs and _eglGetScreens.  The array
size should not be limited by the buffer size when the buffer is NULL.

This fixes fdo bug #29052.
2010-07-15 10:05:46 +08:00
Kenneth Graunke
17a307d154 ast_function: Actually do type conversion on function arguments. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
1fdcdb2dca exec_list: Add a new replace_with method. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
53120805a8 Refresh autogenerated file builtin_function.cpp. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
d5316aeb38 glsl2/builtins: Rework clamp to use scalar/vector combinations. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
8984203abb glsl2/builtins: Rework min/max to use scalar/vector combinations. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
ce5ae5f49d ir_constant_expression: Add support for ir_binop_mod. 2010-07-14 16:49:24 -07:00
Kenneth Graunke
79fed377f4 ir_constant_expression: Add support for ir_binop_min and ir_binop_max.
These now work on scalar/vector combos. Semantically, if a is a scalar,
min(a, vec2(x,y)) == vec2(min(a,x), min(a,y))
2010-07-14 15:50:28 -07:00
Kenneth Graunke
891a0647e4 ir_constant_expression: Add support for ir_binop_pow. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
3fab376bef ir_constant_expression: Add support for ir_unop_cos. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
908afd16d1 ir_constant_expression: Add support for ir_unop_sin. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
074720477c ir_constant_expression: Add support for ir_unop_floor. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
c1ee30a145 ir_constant_expression: Add support for ir_unop_ceil. 2010-07-14 15:50:28 -07:00
Kenneth Graunke
323d909ab2 ir_constant_expression: Add support for ir_unop_trunc.
This uses a C99 function.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
cb63929df4 ir_constant_expression: Add support for ir_unop_log2.
This uses a C99 function.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
aca01edc83 ir_constant_expression: Add support for ir_unop_exp2.
This uses a C99 function.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
14b7b2660c ir_constant_expression: Add support for ir_unop_sign. 2010-07-14 15:50:27 -07:00
Kenneth Graunke
5e840dba44 ir_constant_expression: Remove bogus assert in ir_unop_abs case.
abs is defined for integral types; it's even implemented.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
7d19bf2ec3 glsl2: Remove ir_program bong hits. 2010-07-14 15:50:27 -07:00
Brian Paul
2f4ce25645 mesa: fix _mesa_Texture/Render/BufferObjectUnpurgeable() return values
Fixes piglit object_purgeable-api-pbo, object_purgeable-api-vbo
and object_purgeable-api-texture failures with swrast.

NOTE: This is a candidate for the 7.8 branch.
2010-07-14 15:13:55 -06:00
Brian Paul
f2bfc2b7d2 mesa: update assertions and fix refcounting in depth/stencil renderbuffer code 2010-07-14 15:13:54 -06:00
Brian Paul
4beea12f17 mesa: silence a printf warning 2010-07-14 15:13:54 -06:00
Brian Paul
871feeb165 llvmpipe: delete lp_test_*.o files with make clean 2010-07-14 15:13:54 -06:00
Brian Paul
1957bef995 gallium: added CLEAN_EXTRA var for make clean target 2010-07-14 15:13:54 -06:00
Nick Bowler
f8d81c31ce dri2: Track event mask in client code.
When direct rendering is being used, DRI2 BufferSwapComplete events are
sent unconditionally to clients, even if they haven't been requested.
This causes error messages to be printed by every freeglut application
of the form

  freeglut (./gears): Unknown X event type: 104

and might confuse other clients.

This is a fixed up version of the patch by Jesse Barnes, which drops
BufferSwapComplete events if they are not requested by clients.

Fixes fdo bug 27962.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-07-14 10:23:09 -07:00
José Fonseca
467928c6e0 gallium: Ensure prototypes are wrapped in extern "C".
Fixes MSVC build failure due to inconsistent _ReadWriteBarrier
prototype.
2010-07-14 16:15:56 +01:00
José Fonseca
d023fb3928 llvmpipe: Remove redundant alignments.
The lp_rast_shader_inputs' alignment is irrelevant now that it contains
pointers instead of actual data.

Likewise, lp_rast_triangle's size alignment is meaningless.
2010-07-14 14:53:35 +01:00
Chris Li
bed78862d4 llvmpipe: Addi ssse3 swizzling for B8G8R8A8_UNORM. 2010-07-14 14:38:02 +01:00
José Fonseca
c6c62164c3 gallium: Add a macro for memory barriers. 2010-07-14 14:38:02 +01:00
José Fonseca
5e2437a232 gallium: Add a new PIPE_ARCH_SSSE3 define for SSSE3 compiler support. 2010-07-14 14:38:02 +01:00
Zack Rusin
582132aaef Merge branch 'mesa-2d-registers' 2010-07-13 21:54:14 -04:00
Zack Rusin
1491c6aa2d mesa: add comments and change Index2D to just Index2 2010-07-13 21:49:53 -04:00
Marek Olšák
9fa64ea675 r300/compiler: fix swizzling in the transformation of Abs modifiers 2010-07-14 02:01:03 +02:00
Eric Anholt
021222c6a8 ir_to_mesa: Add convenience function for opcodes with no src/dst reg.
Most of flow control is like this.
2010-07-13 12:24:39 -07:00
Jakob Bornecrantz
20a3dda726 i965g: Fix scons build of dri driver 2010-07-13 19:32:16 +01:00
Eric Anholt
c10a68522c glsl2: When linking makes a variable not a varying output, make it ir_var_auto.
This almost fixes glsl-unused-varying, except that the used varying
gets assigned to the first varying slot (position).
2010-07-13 11:07:16 -07:00
Roland Scheidegger
217926f350 llvmpipe: fix comment typo 2010-07-13 19:59:38 +02:00
Roland Scheidegger
edac740095 llvmpipe: move rasterizer to screen instead of setup context
there's no point of having this per context, so move to screen
(and protect with a mutex).
2010-07-13 19:58:58 +02:00
Eric Anholt
4d5da50b94 ir_to_mesa: Add support for variable array indexing of builtin varyings.
That is to say, gl_TexCoord[i] now works, fixing glsl-texcoord-array
on swrast.
2010-07-13 09:52:20 -07:00
Eric Anholt
f8a2b65bc9 ir_to_mesa: Add support for array dereferences on the LHS of assignments.
The big change is to delay address reg setup until the instruction
that needs the deref.  It was hard to use the deref chain support for
the LHS because it does the copy of the dereffed value to a temporary
(to avoid problems when two src regs are array derefs), so we wouldn't
haev a pointer to actual storage in the end.

Fixes glsl-vs-arrays on swrast.
2010-07-13 09:52:20 -07:00
José Fonseca
962da13ba3 llvmpipe: Align texture data to the cache line. 2010-07-13 17:32:44 +01:00
Keith Whitwell
e21e7ab4da llvmpipe: eliminate the set_state rasterizer command
Just put a pointer to the state in the tri->inputs struct.  Remove
some complex logic for eliminating unused statechanges in bins at the
expense of a slightly larger triangle struct.
2010-07-13 17:28:54 +01:00
Keith Whitwell
d4b64167b5 llvmpipe: pass mask into fragment shader
Move this code back out to C for now, will generate separately.

Shader now takes a mask parameter instead of C0/C1/C2/etc.

Shader does not currently use that parameter and rasterizes whole
pixel stamps always.
2010-07-13 17:23:49 +01:00
Keith Whitwell
3bd9aedbac llvmpipe: move fences from per-bin to per-thread
Rather than inserting an lp_rast_fence command at the end of each
bin, have each rasterizer thread call this function directly once
it has run out of work to do on a particular scene.

This results in fewer calls to the mutex & related functions, but more
importantly makes it easier to recognize empty bins.
2010-07-13 17:23:48 +01:00
José Fonseca
6d17f00600 llvmpipe: Always swizzle/unswizzle whole tiles.
This was already the case, but the generated (un)swizzling code was not
benefiting of that knowledge.
2010-07-13 17:23:48 +01:00
Ian Romanick
4e6a3e0d2d glsl2: Remove unnecessary casts of clone return values 2010-07-13 09:22:35 -07:00
Jakob Bornecrantz
654009f7f8 llvmpipe: Ignores! 2010-07-13 07:49:00 -07:00
Jakob Bornecrantz
04453a32b4 targets: Link xorg drivers with LLVM if built 2010-07-13 07:49:00 -07:00
Jakob Bornecrantz
433a08445c targets: Clean up xorg make files a bit 2010-07-13 07:49:00 -07:00
Jakob Bornecrantz
4f956889b7 st/xorg: When selecting st via configure make sure to test for xorg-server 2010-07-13 07:49:00 -07:00
Brian Paul
271af2a874 libgl-xlib: add depend to make clean list 2010-07-13 07:46:22 -06:00
Brian Paul
672f6cdc19 glapi: use _mesa_snprintf()
Note that the enums.c file is generated with this script.
This will preserve the change from commit
c4066b78c0.
2010-07-13 07:44:35 -06:00
Marek Olšák
56da2403fc r300/compiler: implement the Abs source operand modifier for vertex shaders 2010-07-13 15:06:22 +02:00
Marek Olšák
b5fc699b1e r300/compiler: emulate SIN/COS/SCS in r3xx-r4xx vertex shaders
Despite the docs, the corresponding hardware instructions are r5xx-only.
2010-07-13 15:06:22 +02:00
Vinson Lee
c4066b78c0 mesa: s/snprintf/_mesa_snprintf/ 2010-07-13 00:31:37 -07:00
Marek Olšák
2470750b4e r300g: do not advertise half_float_vertex on rv3x0
rv3x0 can't do it.
2010-07-13 06:31:36 +02:00
Eric Anholt
4ca07882af ir_to_mesa: Rely on ir_mat_op_to_vec for matrix multiplication support. 2010-07-12 19:50:49 -07:00
Eric Anholt
15ded63279 glsl2: Add matrix multiplication to ir_mat_op_to_vec. 2010-07-12 19:50:49 -07:00
Eric Anholt
3f08989267 ir_to_mesa: Emit OPCODE_MAD when we find an ADD of a MUL.
Bug #27914.
2010-07-12 19:50:49 -07:00
Eric Anholt
562c3d0cb1 glsl2: Flatten expression that appear as the parameters of ir_call as well. 2010-07-12 19:50:49 -07:00
Eric Anholt
94da2abfd4 glsl2: Flatten expressions that appear as the children of ir_return as well. 2010-07-12 19:50:49 -07:00
Ian Romanick
31a97868fc linker: Merge global-scope instructions into main
Find instructions in all shaders that are not contained in a function
(i.e., initializers for global variables).  "Move" these instructions
to the top of the main function in the linked shader.  As a
side-effect, many global variables will also be copied into the linked
shader.
2010-07-12 19:12:28 -07:00
Ian Romanick
15ce87e9f2 linker: Detect the shader that contains "main" during intrastage linking 2010-07-12 18:51:55 -07:00
Ian Romanick
11fc7beb2f ir_function: Make matching_signature not return const
The linker needs to use this function to get specific function signatures, but
it also needs to modify the returned signature.  Since this method isn't itself
const (i.e., const this pointer), there is no value in making a const and
non-const version.
2010-07-12 18:51:55 -07:00
Ian Romanick
13f782c4ae linker: Implement first bits of intrastage linking
This currently involves an ugly hack so that every link doesn't result
in all the built-in functions showing up as multiply defined.  As soon
as the built-in functions are stored in a separate compilation unit,
ir_function_signature::is_built_in can be removed.
2010-07-12 18:51:55 -07:00
Ian Romanick
e2e5d0def4 linker: Refactor cross_validate_uniforms into cross_validate_globals
The later, more generic function will be used in the intra-stage linker.
2010-07-12 18:51:55 -07:00
Marek Olšák
50db6dba65 r300g: extend and clean up debug logging 2010-07-13 01:34:21 +02:00
Marek Olšák
499022c282 r300g/swtcl: do not emit texcoords if they are also stuffed in GA 2010-07-13 01:34:21 +02:00
Marek Olšák
f5804e64b4 r300g: rework the draw_rectangle hook
It is a lot simplier, cleaner, and more stable now.
2010-07-13 01:34:09 +02:00
Eric Anholt
d74c9ff046 glsl2: Use a better talloc context for ir_expression_flattening.
The instruction can be hung off of any other in the tree, even if the
other one will be deleted, since it'll get stolen to the shader's
context later if it's still live.
2010-07-12 16:07:02 -07:00
Eric Anholt
7b96b474e0 glsl2: Add support for variable vector indexing on the LHS of assignments.
Fixes glsl-vs-vec4-indexing-3.
2010-07-12 16:07:02 -07:00
Eric Anholt
b87259d3ef glsl2: Fix copy propagation in the presence of derefs in array indexes.
We would clear the in_lhs flag early, avoiding copy propagation on the
array index variable (oops) and then copy propagating on the array
variable (ouch).  Just avoid all copy propagation on the LHS instead.
2010-07-12 16:07:02 -07:00
Eric Anholt
8258a6a2c3 ir_to_mesa: Add support for dereferencing matrices from arrays. 2010-07-12 16:07:02 -07:00
Ian Romanick
506880bc32 ir_validate: Also perform usual checks on ir_dereference_variable nodes 2010-07-12 15:46:16 -07:00
Ian Romanick
8baf21b1a4 ir_validate: Validate that varibles are declared before used in IR 2010-07-12 15:43:50 -07:00
Ian Romanick
3fb878722e linker: Stub-out intrastage linker 2010-07-12 15:19:30 -07:00
Ian Romanick
ffd7bb031e Make shader_api.h be C++ friendly 2010-07-12 15:19:30 -07:00
Ian Romanick
c67016de96 ir_validate: Additional function related invariant checks
Add two invariant checks related to functions and function signatures:

1. Ensure that function definitions (ir_function) are not nested.

2. Ensure that the ir_function pointed to by an ir_function_signature
is the one that contains it in its signatures list.
2010-07-12 15:19:29 -07:00
Ian Romanick
df05ad4e1a ir_function_signature: Add method to get the function owning a signature
There is no setter function, the getter returns a constant pointer,
and ir_function_signature::_function is private for a reason.  The
only way to make a connection between a function and function
signature is via ir_function::add_signature.  This helps ensure that
certain invariants (i.e., a function signature is in the list of
signatures for its _function) are met.
2010-07-12 15:19:29 -07:00
Ian Romanick
f3235eb37f glsl2: Add utility function clone_ir_list 2010-07-12 15:19:29 -07:00
Ian Romanick
792e01c1e2 ir_call: Add method to set the function signature being called 2010-07-12 15:19:29 -07:00
Ian Romanick
b500981226 glsl2: Implement ir_function::clone and ir_function_signature::clone 2010-07-12 15:19:29 -07:00
Ian Romanick
81d664f099 glsl2: Move temp declaration to correct side of if-statement in IR 2010-07-12 15:19:29 -07:00
Ian Romanick
10d222b702 glsl2: Add missing fields in ir_variable::clone 2010-07-12 14:56:21 -07:00
Ian Romanick
0b9ae3befb glsl2: Add declarations for temporaries to instruction stream
Temporary variables added for &&, ||, and ?: were not being added to
the instruction stream.  This resulted in either test failures or
Valgrind being angry after the original IR tree was destroyed by
talloc_free.  The talloc_free caused the ir_variables to be destroyed
even though they were still referenced.
2010-07-12 14:56:21 -07:00
Maciej Cencora
7facb8f2c8 Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa 2010-07-12 23:42:06 +02:00
Vinson Lee
c6b7aa96f9 r600: Fix include recursion.
Fix r600_context.h -> r700_oglprog.h -> r600_context.h include
recursion.
2010-07-12 14:23:51 -07:00
Vinson Lee
5ba0ba72d9 r300g: Remove unnecessary header. 2010-07-12 14:12:02 -07:00
Eric Anholt
288733f600 glsl2: Store the gl_type of the array's element type in the array.
Fixes glsl-fs-uniform-array-1, glsl-vs-uniform-array-1, and the -2
tests on software.
2010-07-12 14:05:20 -07:00
Eric Anholt
7b48843ecd Revert "ir_to_mesa: Add support for adding/subtracting matrices."
This reverts commit b4d0c0e0ee.
Now that ir_mat_op_to_vec is landed, this change is no longer needed.
2010-07-12 13:26:49 -07:00
Eric Anholt
6d8a0a0aad glsl2: Add a new pass at the IR level to break down matrix ops to vector ops.
This will be used by the Mesa IR and likely most HW backends, as it
allows other optimizations to occur that might not otherwise.

Fixes glsl-vs-mat-sub-1, glsl-vs-mat-div-1.
2010-07-12 13:26:46 -07:00
Maciej Cencora
ba03a0b5ba radeon: fix some wine d3d9 tests
Need to flush command stream before mapping texture image
that is referenced by current cs.

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-12 21:48:43 +02:00
Eric Anholt
5723e5bb8b glsl2: Flatten out expressions that are the child of an assignment rhs.
This feels a little odd, but it will be useful for ir_mat_to_vec,
where I want to see a plain assignment of the expression to a
variable, not to a writemasked array dereference with a call as the
array index.
2010-07-12 12:02:32 -07:00
Eric Anholt
d2afc87445 glsl2: Check when inlining a bare function call that it actually is.
It would be easy to miss an entry either of the two visitors involved
that would result in trying to ir->remove() the call to remove it from
the instruction stream when really it's part of an expression tree
that wasn't flattened.
2010-07-12 12:02:11 -07:00
José Fonseca
cd629c28d7 llvmpipe: Re-enable threading on windows. 2010-07-12 15:40:33 +01:00
nobled
209009d75f os: remove gratuitous pipe_barrier placeholder code
There's already an implementation of pipe_barrier using
the other pipe_* primitives; just use that on Windows, too.

Now Windows passes pipe_barrier_test.
2010-07-12 15:40:33 +01:00
nobled
7ce9a3adc5 os, rbug: remove PIPE_THREAD_HAVE_CONDVAR
The new default implementation of pipe_condvar makes it
unnecessary.
2010-07-12 15:40:33 +01:00
nobled
f321d5c38a os: Implement pipe_condvar on Windows Vista and later
Unfortunately compiling with these defines enabled would mean
Gallium can't run on Windows XP/2003 or older.

Todo: Need a macro to declare if we don't care about WinXP
compatibililty.
2010-07-12 15:40:32 +01:00
nobled
9795a60a8f os: Implement pipe_condvar on win32
Or at least a little of it. This version will sleep
for a fixed amount of time instead of just deadlocking,
which is a slight improvement.

Also do the same thing on any unrecognized platform.
2010-07-12 15:40:32 +01:00
Marek Olšák
8c836f7f74 r300g: implement fast color clear
An initial implementation made by Dave Airlie.

For it to be used, a color-only clear must be invoked and exactly one
point-sampled render target must be set. The render target must be
macrotiled (for us to overcome alignment issues) and bpp must be either
16 or 32.

I can't see a difference in performance. :(

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2010-07-12 13:26:00 +02:00
Marek Olšák
78e8a8765f r300g: clear and copy a resource with a rectangular point sprite
With an ordinary quad, the pixels on the main diagonal are computed
and stored twice, which is somewhat inefficient and might not work well
with specialized clear codepaths.
2010-07-12 13:06:45 +02:00
Marek Olšák
0864851e27 r300g: do not use immediate mode if there is a VBO in VRAM
And other minor fixups.
2010-07-12 06:52:06 +02:00
Marek Olšák
9be8f7d226 u_blitter: add draw_rectangle callback which can be overridden by a driver 2010-07-12 06:32:52 +02:00
Marek Olšák
749e24521a u_blitter: clean up the texcoord computations 2010-07-12 05:32:42 +02:00
Marek Olšák
3bd15a9e43 u_blitter: simplify blitter_set_rectangle 2010-07-12 05:16:19 +02:00
Marek Olšák
9b03da9bdd u_blitter: rename blitter->base, add a way to get a pipe context from blitter 2010-07-12 02:06:39 +02:00
Marek Olšák
9cdd481f8e r300g: ugly fix of a hardlock in the cubestorm xscreensaver
FDO bug #28563.
2010-07-12 00:04:52 +02:00
Maciej Cencora
72e6a1e72f radeon: lower texture memory consumption is some cases
When searching for valid miptree check images in range
of [BaseLeve, MaxLevel] not [MinLod, MaxLoad].
Prevents unnecessary miptree allocations in cases when during
every rendering operation different texture image level
was selected using MIN_LOD = MAX_LOD = level (for every level
new miptree for whole texture was allocated).

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-11 15:39:48 +02:00
Maciej Cencora
ad24ea37bb radeon: fix teximage migration failure in rare case
Always store selected miptree in texObj->mt so get_base_teximage_offset returns correct data.
Found with piglit/mipmap-setup.

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-11 15:34:17 +02:00
Maciej Cencora
452a7d5a9d r300c: Fix vertex data setup for named buffer objects with unaligned offset
Candidate for 7.8 branch

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-11 14:25:35 +02:00
Vinson Lee
932e4e65e3 r600: Remove unnecessary headers. 2010-07-11 00:14:53 -07:00
Zack Rusin
79b643dd02 mesa: make uniform work with geometry shaders 2010-07-10 19:21:42 -04:00
Zack Rusin
748d8d4613 Revert "mesa: temporarily enable printing of Mesa's GPU instructions"
This reverts commit 7b8726a99d.
2010-07-10 18:24:22 -04:00
Zack Rusin
df0831f375 mesa: GL_TRIANGLE_STRIP_ADJACENCY_ARB is the last valid primitive 2010-07-10 18:14:47 -04:00
Zack Rusin
cc426b8132 tgsi: make sure that we print out the adjacency prims correctly 2010-07-10 18:14:14 -04:00
Zack Rusin
f52f8e9a8c draw: fix decomposition to work with adjacency primitives 2010-07-10 18:13:48 -04:00
Marek Olšák
d63cb78ddd r300g: do not print a rejected CS if RADEON_DUMP_CS is not set
Also print relocation failures on non-debug builds too.
2010-07-10 20:46:26 +02:00
Vinson Lee
8dc6d7610f r600: Fix GCC 'implication declaration of function' warnings.
Fix GCC 'implicit declaration of function' compiler warnings resulting
from commit 00fb58ed5d.
2010-07-10 00:15:27 -07:00
Zack Rusin
425870c5fd mesa: get the translation from mesa 2d regs to tgsi working
first working version of arb_geometry_shader4
2010-07-10 02:02:35 -04:00
Zack Rusin
9808308f9a mesa: initial support for emitting 2D registers from slang 2010-07-09 22:40:04 -04:00
Vinson Lee
00fb58ed5d r600: Remove unnecessary header.
Fixes r600_emit.h -> r600_cmdbuf.h -> r600_emit.h include recursion.
2010-07-09 18:59:01 -07:00
Zack Rusin
7b8726a99d mesa: temporarily enable printing of Mesa's GPU instructions 2010-07-09 21:20:50 -04:00
Zack Rusin
b4855288e4 mesa: add basic support for 2D register arrays to mesa
just like in Gallium it's a basic functionality needed by a lot
of modern graphcis extensions
2010-07-09 21:19:28 -04:00
Vinson Lee
308f52d573 r600: Fix include recursion.
r700_chip.h included r600_context.h, which included r700_chip.h.

Remove the unnecessary r600_context.h inclusion and add missing
headers.
2010-07-09 18:09:26 -07:00
Vinson Lee
0c767b9ae6 glslcompiler: Fix GCC warn_unused_result warning. 2010-07-09 17:34:40 -07:00
Vinson Lee
16def30870 glslcompiler: Fix memory leaks on error paths. 2010-07-09 16:20:32 -07:00
Vinson Lee
011e6794e3 glslcompiler: Remove unnecessary headers. 2010-07-09 16:05:42 -07:00
Vinson Lee
343b38a692 mesa: Move [UN]CLAMPED_FLOAT_TO_UBYTE from imports.h to macros.h.
The other similar integer/float conversion macros are in macros.h.
2010-07-09 15:06:19 -07:00
Marek Olšák
347c00c46e r300g: allow the GTT domain for samplers
This fixes sluggishness in vdrift.
2010-07-09 20:28:13 +02:00
Kenneth Graunke
284d821206 ast_function: Fix non-float constructors with matrix arguments.
Previously, code like ivec4(mat2(...)) would fail because the compiler
would naively try to convert a mat2 to an imat2...which doesn't exist.
Now, a separate pass breaks such matrices down to their columns, which
can be converted from vec2 to ivec2.

Fixes piglit tests constructor-11.vert, constructor-14.vert,
constructor-15.vert, and CorrectConstFolding2.frag.
2010-07-09 09:46:29 -07:00
Kenneth Graunke
f58bbd134e ast_function: Move error return earlier and don't indent the world.
This has no functional changes.
2010-07-09 09:46:29 -07:00
Kenneth Graunke
59df3385e1 ast_function: Remove unnecessary check for empty constructors.
This case is already caught by a later check that ensures sufficient
components were provided, based on the type.
2010-07-09 09:46:29 -07:00
Kenneth Graunke
a4dde28ee6 glsl2: Use new foreach_list_safe abstraction. 2010-07-09 09:46:29 -07:00
Kenneth Graunke
f3290e950c glsl2: Add foreach_list_safe which works even when mutating the list.
In particular, with foreach_list_safe, one can remove and free the current
node without crashes; if new nodes are added after the current node,
they will be properly visited as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-07-09 09:46:07 -07:00
Tom Stellard
8a8e311d8c r300/compiler: Add a register rename pass.
This pass renames register in order to make it easier for the pair
scheduler to group TEX instructions together.

This fixes fdo bug #28606
2010-07-08 21:11:03 -07:00
Tom Stellard
3724a2e65f r300/compiler: Fix scheduling of TEX instructions.
The following instruction sequence will no longer be emitted in separate
TEX blocks:

0: TEX temp[0].xyz, temp[1].xy__, 2D[0];
1: TEX temp[1].xyz, temp[2].xy__, 2D[0];

This fixes fdo bug #25109
2010-07-08 21:11:03 -07:00
Marek Olšák
75d0e95a3a r300g/swtcl: fix out-of-bounds write
This is a typo fix, the generated code should be the same.
2010-07-09 03:53:47 +02:00
Vinson Lee
f8f1c629d6 draw: Fix off-by-one error in assert.
textures is an array of size PIPE_MAX_VERTEX_SAMPLERS.
2010-07-08 17:54:47 -07:00
Brian Paul
41f66915ab glsl: fix indirect addressing of gl_TextureMatrix[] arrays
The code to emit an array of OpenGL state vars lacked the code
to handle the gl_TextureMatrix[] array.

Fixes fd.o bug 28967

NOTE: this is a candidate for the 7.8 branch.
2010-07-08 18:42:45 -06:00
Kristian Høgsberg
2168b87b51 egl_dri2: Support _EGL_PLATFORM_DRM
This lets the egl_dri2 driver initialize on just a DRM fd.
2010-07-08 20:10:37 -04:00
Vinson Lee
7595733677 glslcompiler: Fix build. 2010-07-08 16:06:01 -07:00
Vinson Lee
6dd7d654db Merge branches 'master' and 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2010-07-08 15:58:23 -07:00
Kenneth Graunke
dfd30ca6a9 glsl2: Remove generate_temporary and global temporary counter.
Most places in the code simply use a static name, which works because
names are never used to look up an ir_variable.  generate_temporary is
simply unnecessary (and looks like it would leak memory, and isn't
thread safe...)
2010-07-08 15:44:19 -07:00
Marek Olšák
392a2515c0 r300g: fix texturing with negative lod bias
This should fix FDO bugs #28437 and #28625.
2010-07-09 00:16:49 +02:00
Marek Olšák
61a26cdfdc r300g: store/return the stride for winsys_handle in winsys 2010-07-08 22:39:52 +02:00
Eric Anholt
8a3f2eb9e6 i965: Add disasm for SEND mlen/rlen on Sandybridge. 2010-07-08 13:30:56 -07:00
Zhenyu Wang
20be3ff576 i965: Add 'wait' instruction support
When EU executes 'wait' instruction, it stalls and sets notification
register state. Host can issue MMIO write to clear notification
register state to allow EU continue on executing again.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-07-08 12:50:53 -07:00
Eric Anholt
a3cc7585ea i965: Fix disasm of a SEND's mlen and rlen on Ironlake. 2010-07-08 12:50:53 -07:00
Zhenyu Wang
3f906621da i965: Add decode for Sandybridge DP write messages. 2010-07-08 12:50:53 -07:00
Zhenyu Wang
0446679551 i965: Add definitions for Sandybridge DP write/read messages. 2010-07-08 12:50:53 -07:00
Marek Olšák
9cc6b5b043 r300g: fix transfering compressed textures 2010-07-08 21:37:04 +02:00
Eric Anholt
e72b87736d intel: Update intel_decode.c from intel-gpu-tools.
This came from commit cf255e382d147fe3ca450f0dcec3525190e7dcbc
2010-07-08 12:12:54 -07:00
Brian Paul
b273928140 gallium: bump PIPE_MAX_SHADER_INPUTS/OUTPUTS to 32 2010-07-08 11:03:54 -06:00
Marek Olšák
62c631b205 r300g: add a function for marking framebuffer atoms as dirty 2010-07-08 18:02:30 +02:00
Marek Olšák
f9e8cdc145 r300g: minor fixups 2010-07-08 18:02:30 +02:00
Brian Paul
3751e6e1fc glsl: fix 'if ((x=foo()) > 1.0)' bug
Fixes fd.o bug 27216.  May also be the root cause of fd.o bug 28950.

We weren't propogating the storage info for the x=foo() expression up
through the IR tree to the inequality expression.

NOTE: This is a candidate for the Mesa 7.8 branch.
2010-07-08 09:22:54 -06:00
Brian Paul
7c6a897275 st/mesa: additional assertions in st_translate_mesa_program() 2010-07-08 08:51:22 -06:00
Eric Anholt
25cda5039d mesa: Extend register lifetimes to the end of the largest loop required.
Previously, a register defined at main scope and used in a loop in a
loop could end up getting marked as needed only from the definition
outside of the loops to the end of the inner loop, and we would
cleverly slot in something else in its register in the end of the
outer loop.

Fixes glsl-vs-loop-nested and glsl-fs-loop-nested on glsl2.  This
doesn't happen much on master because the original compiler does its
own register allocation, so we find little we can do with linear scan
register (re)allocation.
2010-07-07 21:33:38 -07:00
Zack Rusin
396f2cd94f slang: fix typos 2010-07-08 00:33:31 -04:00
Zack Rusin
f11e25ee95 slang: add some comments related to geometry shaders 2010-07-08 00:28:29 -04:00
Zack Rusin
7c42390453 gs: inject const int gl_VerticesIn at link time 2010-07-08 00:28:29 -04:00
Eric Anholt
f632a330ec mesa: Fix documentation of BranchTarget for BRK.
It was changed in 2009 and the comment wasn't updated.
2010-07-07 21:00:32 -07:00
Eric Anholt
152b55e74d glsl2: Add support for gl_PointCoord in 1.20.
Fixes glsl-fs-pointcoord on swrast (remains broken on 965, like master)
2010-07-07 19:45:22 -07:00
Brian Paul
6988f65e43 mesa: initial support for new GL 3.0 texture formats 2010-07-07 20:26:33 -06:00
Eric Anholt
ea2a03f0a5 ir_to_mesa: Fix the assertion on LHS array derefs to DWIM.
This allows array derefs of matrices now, which makes idr's GLSL demo
happy.
2010-07-07 17:59:50 -07:00
Eric Anholt
ffd24b0a68 ir_to_mesa: Add support for constant matrices (untested). 2010-07-07 17:49:05 -07:00
Eric Anholt
b4d0c0e0ee ir_to_mesa: Add support for adding/subtracting matrices.
This isn't really tested, but didn't break normal vector add/sub.
2010-07-07 17:27:06 -07:00
Eric Anholt
69676fc6a3 ir_to_mesa: Don't assert that we can't assign matrices. It should work now. 2010-07-07 17:27:04 -07:00
Eric Anholt
9968f1b23c ir_to_mesa: Only allocate a vector per column of a matrix. 2010-07-07 16:37:48 -07:00
Eric Anholt
7d8091f7cc ir_to_mesa: Add support for assignment of aggregates. 2010-07-07 16:37:48 -07:00
Eric Anholt
9b68b88e43 ir_to_mesa: Add support for matrix * matrix. 2010-07-07 16:37:48 -07:00
Kenneth Graunke
e024c5c690 ir_reader: Don't emit ir_function multiple times. 2010-07-07 16:37:48 -07:00
Brian Paul
d95b40759e gallivm: restore const qualifier 2010-07-07 17:36:43 -06:00
Brian Paul
b17fba92db gallivm: fix cube map LOD computation
First, this undoes commit e503af4baa
so we use iround() in lp_build_nearest_mip_level().

Second, in lp_build_sample_general() we need to check if we're sampling
a cube map before anything else.  Choose the cube face and then recompute
the partial derivatives of (S,T) with respect to the chosen cube face.
Before, we were using the directional (S,T,R) derivatives to compute
the LOD.

Third, work around an apparent bug in LLVM 2.7 where setting the lod
variable to a const(0) value results in bad x86 code.  See comments in
the code.
2010-07-07 17:33:43 -06:00
Ian Romanick
35c89204e5 linker: Use bit-0 instead of VERT_BIT_GENERIC0
Uses of the bits for allocation are offset by 16, and
VERT_BIT_GENERIC0 already has the 16 offset.  As a result, it was
preventing the wrong thing from being allocated.
2010-07-07 16:28:39 -07:00
Eric Anholt
0b74bbb3dc glsl: Fix the setup of refract()'s output for vec3/vec4 and k < 0.0.
caught by valgrind.
2010-07-07 14:55:33 -07:00
Eric Anholt
9cbd8a1d5a glsl2: Fix ir_div_to_mul_rcp for integer division.
rcp of an integer value did not produce the result you're looking for.
Instead, do the a * rcp(b) as float and truncate after.  This mostly
fixes glsl-fs-loop-nested.
2010-07-07 14:06:26 -07:00
Eric Anholt
43b5b03d67 glsl2: Actually add the declaration of _post_incdec_temp. 2010-07-07 14:06:26 -07:00
Kenneth Graunke
acf88f2769 ir_constant_expression: Fix loop increments. 2010-07-07 12:41:26 -07:00
Kenneth Graunke
388ab9fa6b glsl2: Initialize yylineno and yycolumn so line numbers are sane. 2010-07-07 12:41:26 -07:00
Ian Romanick
e78e0fa42b glsl2: Put the initializer in the instruction stream after the declaration 2010-07-07 12:41:26 -07:00
Ian Romanick
c44556317a exec_list: Add method to append one complete list to another 2010-07-07 12:41:26 -07:00
Ian Romanick
2e85f993d8 Revert "glsl2: Put the declaration in the instruction stream before its initializer."
This change causes segfaults in other tests.  A fix for both sets of
segfaults is coming.

This reverts commit d4d630b72c.
2010-07-07 12:41:26 -07:00
Brian Paul
9755539116 st/mesa: fix sampler max_lod computation
This change makes gallium behave like other GL implementations and fixes
a conformance failure.
2010-07-07 13:05:35 -06:00
Eric Anholt
76101f7c04 ir_to_mesa: Add support for gl_TextureMatrix access.
Fixes glsl-vs-texturematrix-1, and glsl-vs-texturematrix-2 on swrast.
2010-07-07 11:51:36 -07:00
Eric Anholt
8bb15c1ed5 ir_to_mesa: Fill in some uninitialized fields that sometimes contained junk. 2010-07-07 11:39:21 -07:00
Andre Maasikas
51c438feb7 r600: workaround 3 comp GL_SHORT vertex attribute format on r700
guess it's a hw errata?
2010-07-07 21:32:07 +03:00
Eric Anholt
d674ebcee0 glsl2: Add a pass to simplify if statements returning from both sides.
This allows function inlining making the following tests work even
without function calls implemented:
glsl-fs-functions-2
glsl-fs-functions-3
glsl-vs-functions
glsl-vs-functions-2
glsl-vs-functions-3
glsl-vs-vec4-indexing-5

(Note that those tests were designed to trigger actual function calls,
and this defeats them.  However, those testcases ended up catching the
bug in the previous commit.)
2010-07-07 09:10:48 -07:00
Eric Anholt
6de882334a glsl2: Clean up vec_index_to_cond_assign after the clone return type change. 2010-07-07 09:07:52 -07:00
Eric Anholt
773025b92c glsl2: Don't forget to walk the parameters to a function in the hv.
Fixes segfaults from use after free after the steal of ir nodes and
free of the compile context.
2010-07-07 09:07:52 -07:00
Eric Anholt
570dc0d400 glsl2: Avoid null deref in scalar constant unop expressions. 2010-07-07 09:07:52 -07:00
Brian Paul
84a5f27b9b glsl: use Elements() in arrays instead of sentinal values
The _slang_*_output_name() functions had one too many loop iterations
because of the sentinal end-of-list values in the vertOutput array.
Just use Elements() everywhere.
2010-07-07 09:00:00 -06:00
Eric Anholt
d4d630b72c glsl2: Put the declaration in the instruction stream before its initializer.
This fixes a regression in the generated code from when I did the
ir_validate.cpp-driven rework of assignments.
2010-07-06 18:49:24 -07:00
Eric Anholt
a36334be02 glsl2: Add pass for supporting variable vector indexing in rvalues.
The Mesa IR needs this to support vector indexing correctly, and
hardware backends such as 915 would want this behavior as well.

Fixes glsl-vs-vec4-indexing-2.
2010-07-06 18:49:24 -07:00
Eric Anholt
2d1789e667 ir_to_mesa: Add support for conditional moves.
Nothing generates conditional moves yet.
2010-07-06 18:49:24 -07:00
Ian Romanick
ca088cc277 glsl2: Clone methods return the type of the thing being cloned
This is as opposed to returning the type of the base class of the hierarchy.
2010-07-06 17:44:37 -07:00
Kenneth Graunke
f14e596f11 ir_constant_expression: Declare loop counting variables in the loops.
Fixes "name lookup of 'c' changed" warning.
2010-07-06 17:43:56 -07:00
Vinson Lee
c89ea8f213 llvmpipe: Don't build lp_test_round when using MSVC.
lp_test_round uses the math functions round and trunc, which aren't
available with MSVC.

Fixes the MSVC build for now.
2010-07-06 17:25:39 -07:00
Vinson Lee
2e423ac074 llvmpipe: Add lp_test_round to SCons build. 2010-07-06 16:18:32 -07:00
Kenneth Graunke
f2dfac6d74 glsl2: Update TODO. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
3f4a0b8bb0 ir_constant_expression: Add support for dot products. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
cf80a4d177 ir_constant_expression: Add support for matrix multiplication.
Also handles matrix/vector and vector/matrix multiplication.

Fixes piglit tests const-matrix-multiply-01.frag,
const-matrix-multiply-02.frag, and const-vec-mat.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
37b3f9d0ed ir_constant_expression: Support scalar * vector and scalar * matrix.
The test here is slightly different since we need to keep matrix
multiplication separate.

Fixes piglit tests const-vec-scalar-03.frag and const-mat-scalar-03.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
dad35eb8b0 ir_constant_expression: Support scalar / vector and scalar / matrix.
Fixes piglit tests const-vec-scalar-04.frag and const-mat-scalar-04.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
97b44f040a ir_constant_expression: Support scalar - vector and scalar - matrix.
Fixes piglit tests const-vec-scalar-02.frag and const-mat-scalar-02.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
e74dcd7924 ir_constant_expression: Support scalar + vector and scalar + matrix.
Fixes piglit tests const-vec-scalar-01.frag, const-vec-scalar-05.frag,
and const-mat-scalar-01.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
6fc983b9bb ir_constant_expression: Assert that both operands share a base type. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
6bc432e14e ir_constant_expression: Initialize op[0] and op[1] to NULL.
This makes it easy to check if there is a second argument.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
c63a1db81f ir_constant_expression: Initialize all components of constant data to 0.
This is probably just a good idea, and will come in useful when
implementing things like matrix multiplication.
2010-07-06 16:03:32 -07:00
Vinson Lee
ff318c45ec egl: Remove unnecessary headers. 2010-07-06 16:02:49 -07:00
Vinson Lee
9ead6c129f draw: Remove unnecessary header. 2010-07-06 15:49:40 -07:00
Vinson Lee
01985390be gallivm: Remove unnecessary header. 2010-07-06 15:45:31 -07:00
Marek Olšák
98cb202444 util: print help for debug options on non-debug builds
I'd like to see the help when I request it.
2010-07-07 00:12:49 +02:00
Ian Romanick
d1a1ee583e Add hash table helper functions for using pointers as hash keys 2010-07-06 15:00:46 -07:00
Ian Romanick
e45a982313 Make hashtable.h be C++ friendly 2010-07-06 15:00:46 -07:00
Eric Anholt
a0b3b93029 ir_to_mesa: Use the compiler-assigned locations for builtin attrs/varyings.
The previous table didn't distinguish gl_Color for the VS and FS, so
we would use the FS's attribute index for the VS and read undefined.
This partially fixes glsl-routing to match its behavior on master.
2010-07-06 14:05:51 -07:00
Brian Paul
e503af4baa gallivm: use trunc, not round in lp_build_nearest_mip_level()
Fixes fd.o bug 28036 (piglit fbo-cubemap.c regression)
2010-07-06 13:22:57 -06:00
Brian Paul
7743791da0 llvmpipe: add test program for round(), trunc(), floor(), ceil() 2010-07-06 11:36:37 -06:00
Brian Paul
e834c48100 gallivm: finish implementation of lp_build_iceil()
Plus fix minor error in lp_build_iceil() by tweaking the offset value.
And add a bunch of comments for the round(), trunc(), floor(), ceil()
functions.
2010-07-06 11:36:37 -06:00
Zack Rusin
99c8d9b6da llvmpipe: disconnect vertex texture sampling from the setup
it was wrong to put this in the fs paths, but it was easier to just
stuff it along the fragment texture sampling paths. the patch
disconnects vertex texture sampling and just maps the textures
before the draw itself and unmaps them after.
2010-07-06 13:29:04 -04:00
Zack Rusin
ca88683459 draw: make sure softpipe doesn't crash with vertex tex sampling
softpipe doesn't implement the draw's llvm tex sampling interface
so make sure draw can handle the cases where the driver doesn't
implement the interface
2010-07-06 13:29:04 -04:00
Zack Rusin
01eebfe1b6 draw: implement vertex texture sampling using llvm 2010-07-06 13:29:04 -04:00
Tom Stellard
ce929d8210 r300/compiler: Implement KILP opcode.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-07-06 18:45:32 +02:00
José Fonseca
88b6abfba5 gallivm: Use SSE4.1's BLENDV instructions for lp_build_select(). 2010-07-06 11:53:15 +01:00
José Fonseca
b3d4e5bd26 gallivm: Fix 8bit comparisons. 2010-07-06 11:53:15 +01:00
Alan Hourihane
5a723afabb llvmpipe: ensure all bins are reset avoids memory corruption. 2010-07-06 11:42:18 +01:00
Chia-I Wu
32a9b2799e mesa: Always initialize transform feedback state.
Assert ctx->Driver.NewTransformFeedback if the feature is enabled;  Use
the default callbacks otherwise.  The rest of core mesa expects the
state to be initialized.
2010-07-06 17:03:32 +08:00
Chia-I Wu
f2aa361f3b egl: Rework driver loading.
Driver loading is now splitted into two stages.  In the first stage, an
_EGLModule is created for each driver: user driver, default drivers, and
all files in the search directories that start with "egl_".  Modules are
not loaded at this stage.

In the second stage, each module is loaded to initialize a display.  The
process stops at the first module that can initialize the display.

If eglGetProcAddress is called before eglInitialize, the same code path
will be taken to find the first module that supports
EGL_DEFAULT_DISPLAY.  Because we do not want to initialize the display,
drv->Probe is used instead in this case.
2010-07-06 16:16:39 +08:00
Chia-I Wu
cf588ab3f1 st/egl: Add support for !GLX_DIRECT_RENDERING.
st/egl uses GLX code for DRI2 support.  It should honor
GLX_DIRECT_RENDERING.

Also updates configure.ac to define GLX_DIRECT_RENDERING for st/egl.
2010-07-06 15:27:09 +08:00
Brian Paul
abd5627a6a mesa: initial support for unnormalized integer texture formats
As defined by GL_EXT_texture_integer.
2010-07-05 20:14:39 -06:00
Corbin Simpson
e54164b4e3 auxiliary/util: Add SM3 meta-cap list. 2010-07-05 14:59:12 -07:00
Roland Scheidegger
3ed0a099c7 llvmpipe: wait for queries being finished when asked for it or before deletion
This fixes bug #28757, though does not yet address the issue that fences aren't
always emitted.
2010-07-05 17:17:50 +02:00
Vinson Lee
a3b0aaf26f i915g: Remove unnecessary header. 2010-07-04 11:34:15 -07:00
Jakob Bornecrantz
2d818ed0f8 i915g: Add flag to not send commands to hw 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
34bd0569d3 i915g: If the kernel reject the batchbuffer print it then assert 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
50f17a001f i915g: Minor cleanups 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
57fc2ad7a1 i915g: Make batchbuffer flush function not be inline 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz
ded664b1ac i915g: Rename texture state to map state 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
8b122bdf6c i915g: Move fragment state to its own file 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
d64561472b i915g: Move static state to its own file 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
7174038e29 i915g: Don't dirty dynamic state if it hasn't changed 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
22d4d5fc3f i915g: Don't flush after blit 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
62bcf2e6ad i915g: Don't flush empty batchbuffers 2010-07-04 13:32:01 +01:00
Jakob Bornecrantz
ed5ce78b81 gallium: Make trivial examples use target helpers 2010-07-04 13:31:55 +01:00
Jakob Bornecrantz
abbb96b2fe gallium: Fix compilation of trivial quad-tex 2010-07-04 13:09:13 +01:00
Vinson Lee
1f0bcce6be st/egl: Remove unnecessary headers. 2010-07-03 19:28:31 -07:00
Chia-I Wu
b365b150a1 docs: Update EGL doc.
Updated for the reorganization of st/egl targets.
2010-07-03 17:20:52 +08:00
Chia-I Wu
40ef298641 mesa: Fix OpenGL ES-only builds.
Check FEATURE_GL in _mesa_init_shader_dispatch and
_mesa_init_shader_uniform_dispatch.  OpenGL ES can not and does not use
_mesa_init_<...>_dispatch.  This is supposed to be temporary.  Ideally,
a more flexible way for initializing dispatch tables should be
developed.
2010-07-03 16:48:36 +08:00
nobled
c43ab4fe1f egl: Always use EGLAPIENTRY in api function prototypes
Fixes the build on Windows.
2010-07-03 16:36:43 +08:00
Vinson Lee
fbc4b88e76 gallivm: Remove unnecessary headers. 2010-07-03 01:04:50 -07:00
Marek Olšák
0e6d7ce017 r300g: fix warnings 2010-07-03 04:32:41 +02:00
Tom Stellard
7da9e1e61b r300/compiler: Fix loop unrolling 2010-07-03 04:32:41 +02:00
Tom Stellard
f381c52081 r300/compiler: Use hardware flow control instructions for loops on r500. 2010-07-03 04:32:31 +02:00
Tom Stellard
3c3b7e02eb r300g: Fix typo in r300_reg.h 2010-07-03 04:27:09 +02:00
Tom Stellard
0dbdcb4321 r300/compiler: Don't continue copy propagation inside loops. 2010-07-03 04:27:09 +02:00
Tom Stellard
7f57530943 r300/compiler: Print debug info for flow control instructions. 2010-07-03 04:27:09 +02:00
Tom Stellard
82d0602c1f r300/compiler: Enable hardware IF statements for r500 cards. 2010-07-03 04:27:09 +02:00
Tom Stellard
1732751242 r300/compiler: In the peephole optimizer, ELSE should mark the end of a
block.
2010-07-03 04:27:09 +02:00
Tom Stellard
29a1d6aee7 r300/compiler: Correctly calculate the max number of iterations for loops. 2010-07-03 04:27:09 +02:00
Tom Stellard
697d666d78 r300/compiler: Handle loops in deadcode analysis.
This also allows us to split the loop emulation into two phases.  A
tranformation phase which either unrolls loops or prepares them to be
emulated, and the emulation phase which unrolls remaining loops until the
instruction limit is reached.  The second phase is completed after the
deadcode analysis in order to get a more accurate count of the number of
instructions in the body of loops.
2010-07-03 04:27:09 +02:00
Kenneth Graunke
83035574db Refresh autogenerated file builtin_function.cpp. 2010-07-02 18:20:19 -07:00
Kenneth Graunke
7e908a6a27 glcpp: Add #error support. 2010-07-02 18:03:58 -07:00
Kenneth Graunke
2070f9f5be glsl2: Fix for dead strings being stored in the symbol table. 2010-07-02 18:03:58 -07:00
Kenneth Graunke
e2a358348b ir_to_mesa: Fix uninitalized value. 2010-07-02 18:03:58 -07:00
Kenneth Graunke
ddc3aa0783 glsl2/builtins: Use vector ops in the 130 version of "sign." 2010-07-02 18:03:58 -07:00
Kenneth Graunke
9a7ac272fb glsl2/builtins: Use vector ops in "smoothstep." 2010-07-02 18:03:58 -07:00
Brian Paul
91c37599f6 osmesa: remove old renderbuffer before adding new
Fixes fd.o bug 10966 when OSMesaMakeCurrent() was called twice.

NOTE: This is a candidate for the 7.8 branch.
2010-07-02 18:22:53 -06:00
Brian Paul
7cc58c1992 mesa: updated instruction comments 2010-07-02 18:22:53 -06:00
Eric Anholt
b0ac07e3de ir_to_mesa: Fix up implementation of ir_unop_exp.
OPCODE_EXP is not to ir_unop_exp what OPCODE_EX2 is to ir_unop_exp2.
It's the weird VP approximation helper opcode.  Just implement it with
OPCODE_POW instead.

Fixes glsl-fs-exp.
2010-07-02 17:06:32 -07:00
Eric Anholt
4e7d5d0e74 i965: Add support for the DP2 opcode, which we use for dot(vec2, vec2).
The original glsl compiler would generate a.x * b.x + a.y * b.y, which
we would do mul+mul+add for instead of this mul+mac.

Fixes glsl-fs-dot-vec2.
2010-07-02 17:06:23 -07:00
Eric Anholt
8f25d198e5 ir_to_mesa: Add support for scalar * mat, vec * mat.
This is not tested by piglit currently.
2010-07-02 17:06:08 -07:00
Eric Anholt
b61f4241f3 ir_to_mesa: Add support for shadow comparison to texture instructions.
piglit lacks tests for this currently.
2010-07-02 17:06:06 -07:00
Eric Anholt
d3983ca032 ir_to_mesa: Move projection handling out of ir_tex so txb and txl get it.
Fixes:
glsl-fs-texture2dproj-bias
glsl-fs-texture2dproj-bias-2
2010-07-02 17:06:05 -07:00
Ian Romanick
4d962e66e3 glsl2: Print the linking info log in the stand-alone compiler 2010-07-02 14:57:07 -07:00
Eric Anholt
de75dfac4e ir_to_mesa: Add support for projected non-shadow/bias/lod texturing.
Fixes:
glsl-fs-texture2dproj
glsl-fs-texture2dproj-2
2010-07-02 14:50:02 -07:00
Brian Paul
ae8164a67b mesa: add geometry shader fields to gl_shader_program
These 3 fields are per shader-program.  Copy them into the geometry
program at link time for convenient access later.

Also, add some missing glGetProgramiv() queries.
2010-07-02 15:36:14 -06:00
Eric Anholt
cab95c228b ir_to_mesa: Fix sparse swizzling of src regs when a writemask is present.
Fixes glsl-fs-texture2d-masked.
2010-07-02 14:08:20 -07:00
Eric Anholt
28faa12dc2 ir_to_mesa: Don't forget to run the Mesa IR optimization passes.
With how we generate assignments, the trivial copy propagation in it
is really important, and some drivers will really want the register
allocation, too.
2010-07-02 11:38:02 -07:00
Eric Anholt
9a0e421983 glsl2: Add a pass to break ir_binop_div to _mul and _rcp.
This results in constant folding of a constant divisor.
2010-07-02 11:27:06 -07:00
José Fonseca
d981bde384 gallivm: Do 4ubyte AoS texture filtering for any format that can be expressed.
Except if it has only one channel, as it would take the same number of
instructions.
2010-07-02 18:45:49 +01:00
José Fonseca
e70b20fa83 gallivm: Use util_format_description::fetch_rgba_8unorm() when available. 2010-07-02 18:45:49 +01:00
José Fonseca
a2d360b915 util: Add a fetch_rgba_8unorm.
Not always implemented, but useful in situations where we want 8unorms
and the samples comes as 8unorms as we needlessly convert to/from
floats.
2010-07-02 18:45:49 +01:00
José Fonseca
7071eefdb2 gallivm: Support multiple pixels in lp_build_fetch_rgba_aos().
This allows to do the unpacking of formats that fit in 4 x unorm8 in
parallel, 4 pixels at a time.
2010-07-02 18:45:49 +01:00
José Fonseca
eb20c57f03 gallivm: Move lp_build_rgba8_to_f32_soa() to lp_bld_format_soa.c
It will be more useful here.
2010-07-02 18:45:49 +01:00
José Fonseca
bb1546f55b gallivm: Move gather functions to its own module.
They need to grow, and they provide basic functionality which is not
specific to sampling.
2010-07-02 18:45:49 +01:00
José Fonseca
e29ef44cf1 gallivm: Check inputs/outputs in lp_build_conv() 2010-07-02 18:45:49 +01:00
José Fonseca
9b69545c42 util: Expose util_format_fits_8unorm(). 2010-07-02 18:45:48 +01:00
Brian Paul
6e83420ee0 mesa: fix texenv generation when num color bufs == 0
Before, if there were no color buffers enabled (with glDrawBuffers(GL_NONE))
when the texenv program was generated, we'd emit writes to OUTPUT[1] but
the OutputsWritten mask was 0.  This inconsistency caused an assertion to
fail later in the Mesa->TGSI translation.

Fixes fd.o bug 28169

NOTE: this is a candidate for the 7.8 branch (and depends on commit
b6b9b17d27).
2010-07-02 10:16:08 -06:00
Brian Paul
7a5a0b205e softpipe: fix incorrect blend func index passed to blend_quad()
Need to pass the index indicating which blend terms to use, not which
color buffer we're blending into.

Rename the parameter to blend_quad() and add comments to be more clear
about this.
2010-07-02 09:56:57 -06:00
Brian Paul
fbc6c316d2 softpipe: better assertions 2010-07-02 09:53:08 -06:00
Brian Paul
291bcfd831 mesa: add missing error checks in _mesa_program_parameteri() 2010-07-02 09:09:06 -06:00
Brian Paul
e3c961de36 main: change some GS field types, added comments 2010-07-02 09:07:36 -06:00
Brian Paul
b6b9b17d27 mesa: make the number of draw buffers part of the texenv program key state
All the state that effects the program should be in the key.
This didn't help with bug 28169 but is a good fix anyway.

NOTE: this is a low-priority candidate for the 7.8 branch.  In practice,
this issue might never be hit.
2010-07-02 08:14:54 -06:00
Brian Paul
e845765f0f gallium/cso: check for set_vertex_sampler_views != NULL before calling it
Not all drivers implement this method.
Fixes regression reported by Chris Rankin and bug 28889.
2010-07-02 08:08:22 -06:00
José Fonseca
53d3f0c788 mesa: Silence warning. 2010-07-02 11:50:01 +01:00
José Fonseca
3cc4301c14 gallivm: Code generate YUV format unpacking. 2010-07-02 11:50:01 +01:00
José Fonseca
37f4c2f906 gallivm: Fix 4 x unorm8 -> 4 x float conversion.
Also fix the test.
2010-07-02 11:50:00 +01:00
Dave Airlie
8556b77c56 r600: use gallium list macros instead of making our own.
before this change, r600 glxinfo segfaulted in the list code, and I wasn't
debugging another linked list implementation, its 2010 after all.

So add the two missing list macros to the gallium header from X.org list header file (after fixing them), then port all r600 lists to the new header.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-02 15:27:17 +10:00
Ian Romanick
667f4e1940 glsl2: Conditionally allow optional extensions to be enabled
The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
2010-07-01 20:40:08 -07:00
Ian Romanick
efb6b24223 glsl2: Append _TOK to some parser tokens
This prevents conflicts with defines elsewhere in Mesa and allows
including mtypes.h in the compiler.
2010-07-01 20:40:08 -07:00
Ian Romanick
06143ea094 glsl2: Conditionally define preprocessor tokens for optional extensions
The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
2010-07-01 20:40:08 -07:00
Ian Romanick
2d12236117 glsl2: Define preprocessor tokens for extensions
Currently only GL_ARB_draw_buffers and GL_ARB_texture_rectangle are
defined because those extensions are always enabled.  This make
tex_rect-03.frag pass.
2010-07-01 20:40:08 -07:00
Ian Romanick
6f0823da09 glsl2: Support AST-to-IR translation of invariant keyword 2010-07-01 20:39:08 -07:00
Brian Paul
44732103b2 mesa: extension flags and version testing for GL 3.x features 2010-07-01 20:03:32 -06:00
Brian Paul
120a9f46cd mesa: entrypoints for GL 3.1 primitive restart 2010-07-01 20:03:31 -06:00
Ian Romanick
3832706f81 glsl2: Initialize ast_declarator_list::invariant in constructor 2010-07-01 17:10:11 -07:00
Ian Romanick
12873fa4e3 glsl2: Don't bounds check unsize array redeclarations
This along with several previous commits fix test CorrectUnsizedArray.frag.
2010-07-01 14:10:19 -07:00
Ian Romanick
127308b4be glsl2: Add gl_MaxTextureCoords 2010-07-01 13:30:50 -07:00
Ian Romanick
cd00d5b88c glsl2: Default delcaration of gl_TexCoord is unsized 2010-07-01 13:17:54 -07:00
Dan Nicholson
442c37e2ef Use GLW_CFLAGS when building libGLw
We check for libX11 and libXt, so we might as well use the CFLAGS
pkg-config tells us about.
2010-07-01 13:00:02 -07:00
John Hein
9617254a1e Use GLUT_CFLAGS when building glut
Fix this build error (in MesaGLUT-7.6.1)...
glut_cmap.c:23:66: error: X11/Xmu/StdCmap.h: No such file or directory

...by not preventing the cflags that pkg-config finds for glut dependencies
(including 'xmu') from being used.

Defining GLUT_CFLAGS before running the pkg-config prevents the
cflags found by pkg-config from being used.

This patch lets GLUT_CFLAGS that configure & pkg-config work
so hard to set actually get used.

Also make sure the generated configs/autoconf defines GLUT_CFLAGS
used in (at least) src/glut/glx/Makefile.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-07-01 13:00:02 -07:00
Ian Romanick
5466b63968 glsl2: Change order of semaintic checks on variable declarations
This will make it easier to support more (valid) kinds of redeclarations.
2010-07-01 12:56:49 -07:00
Fernando Carrijo
d2fe97a209 mesa: Purge macros NEED_EVENTS and NEED_REPLIES
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-07-01 13:07:07 -06:00
Brian Paul
1d298a3764 gallium/cso: unbind sampler views in cso_release_all() 2010-07-01 13:07:07 -06:00
Brian Paul
5b90f83aee mesa: free xform feedback hash table 2010-07-01 13:07:07 -06:00
Brian Paul
30f46e7b4c st/mesa: fix comment 2010-07-01 13:07:07 -06:00
Eric Anholt
411fb36b7c ir_to_mesa: Fill in remaining ops, remove default case for expression types.
We should now have support for all the expression types we need for
GLSL 1.20.
2010-07-01 11:24:38 -07:00
Eric Anholt
8761fcc2bf ir_to_mesa: Add support for ir_unop_rcp.
This isn't used at the moment, but will be soon.
2010-07-01 11:23:02 -07:00
Eric Anholt
d1b07167b9 glsl2: Update README for what I've been thinking about with expr types work. 2010-07-01 11:07:58 -07:00
Eric Anholt
8a1f186cc5 glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).
This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
2010-07-01 11:07:23 -07:00
Eric Anholt
9acf618f24 glsl2: Remove dead member from dead code visitor. 2010-07-01 11:07:22 -07:00
Eric Anholt
d925c91730 glsl2: Add ir_unop_fract as an expression type.
Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
2010-07-01 11:07:22 -07:00
Brian Paul
17c176eb73 llvmpipe: silence pointer type warnings 2010-07-01 09:15:31 -06:00
José Fonseca
8d93f360c5 gallivm: Support 4 x unorm8 in lp_build_fetch_rgba_aos().
Uses code and ideas from Brian Paul.
2010-07-01 15:02:17 +01:00
José Fonseca
b919bb7f61 gallivm: Allow to conversions to/from registers of different sizes.
Allow for example to convert from 4 x float32 to 4 x unorm8 and vice versa.

Uses code and ideas from Brian Paul.
2010-07-01 15:02:15 +01:00
José Fonseca
a70ec096aa gallivm: Support extended swizzles in lp_build_swizzle1_aos().
And rename to lp_build_swizzle_aos().
2010-07-01 15:02:12 +01:00
José Fonseca
e277d5c1f6 gallivm: Setup a global optimization pass.
Modules are still free to setup their own optimization passes, but for the
normal case it should not be necessary.
2010-07-01 15:02:10 +01:00
José Fonseca
83ced5a918 llvmpipe: Remove lp_build_swizzle2_aos().
Unnecessary special case.
2010-07-01 15:02:04 +01:00
Eric Anholt
5e4dd061d1 ir_to_mesa: Add support for discard instructions.
Fixes glsl-fs-discard-01.
2010-06-30 17:31:06 -07:00
Eric Anholt
f5b3b2a01a glsl2: Don't break sign() down by vector components. 2010-06-30 17:29:12 -07:00
Eric Anholt
3acd92a91f ir_to_mesa: Add support for ir_unop_sign.
Fixes glsl-fs-sign, glsl-vs-sign.
2010-06-30 17:29:12 -07:00
Eric Anholt
e558786a3e i965: Add support for OPCODE_SSG.
The old compiler didn't use SSG, and instead emitted SGT/SGT/SUB.  We
can do a little better for SSG than we do for the SGT series.
2010-06-30 17:29:09 -07:00
Eric Anholt
d6ebe9b16b ir_to_mesa: Add missing no-op type conversions.
Fixes glsl-fs-step.
2010-06-30 16:23:32 -07:00
Eric Anholt
02d615306e glsl2: Fix reversed value of step().
It's 0.0 if x < edge, not 1.0.  Partial fix for glsl-fs-step.
2010-06-30 16:23:15 -07:00
Eric Anholt
e64a4aaacb ir_to_mesa: Note which of our expr ops are unsupported 1.30 features. 2010-06-30 16:18:06 -07:00
Eric Anholt
4e16a7b526 glsl2: Fix up the implementation of fract() for vector types.
There's no need to split each vector component out, just do vector ops.
2010-06-30 15:59:07 -07:00
Eric Anholt
285ff93819 ir_to_mesa: Initialize the (we never use it) abs field of Mesa src regs. 2010-06-30 15:49:04 -07:00
Eric Anholt
ea6b34cce4 ir_to_mesa: Send the negate field on to Mesa IR.
Fixes glsl-fs-neg.
2010-06-30 15:47:11 -07:00
Eric Anholt
698b844443 ir_to_mesa: When generating a swizzle, respect the reg's current swizzle.
Fixes depth-tex-modes-glsl.
2010-06-30 15:30:00 -07:00
Kenneth Graunke
77049a702a glsl2: Implement AST->HIR support for the "discard" instruction. 2010-06-30 14:54:58 -07:00
Kenneth Graunke
16efab1c4d glsl2: Define new ir_discard instruction. 2010-06-30 14:54:58 -07:00
Eric Anholt
88c20c46b8 ir_to_mesa: Support gl_FragDepth.
Fixes glsl-bug-22603.
2010-06-30 14:55:45 -07:00
Eric Anholt
97eba76b8c glsl2: Allow a fragment shader to not write a color.
I can't find any text justifying this check, and it caused a
reasonable-looking shader in glsl-bug-22603 (which writes only
gl_FragDepth) to fail.
2010-06-30 14:51:50 -07:00
Eric Anholt
3e2127b9de mesa: Don't look in unallocatd param slots for parameter values.
glsl-derivs would add 40.0, 0.0, and 1.0 in order.  When we went
looking for 0.0, we'd find it in the second slot of the param, and use
it, but param->Size would still be 1.  When we went to add 1.0 and
didn't find it, we'd put allocate it to that second slot and the 0.0
would actualy end up being 1.0.

Fixes glsl-derivs, glsl-deriv-varyings.
2010-06-30 14:46:06 -07:00
Eric Anholt
c64da87611 ir_to_mesa: Fix the indexing of attributes in the program's Attributes.
This fixes GetAttribLocation returning VERT_ATTRIB_GENERIC1 instead of 1,
caught by glsl-dlist-getattriblocation.
2010-06-30 14:44:14 -07:00
Kenneth Graunke
c7f4ff193a glsl2: Fix storing of dead memory in the symbol table.
decl->identifier is part of the AST, so it doesn't live very long.
Instead, add var->name which is owned by var.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
629198b96a glsl2: Preprocessed source doesn't need to live past compile time. 2010-06-30 13:52:24 -07:00
Kenneth Graunke
c6099a65f8 glsl2: Create new talloc contexts the "right" way. 2010-06-30 13:52:24 -07:00
Kenneth Graunke
953ff1283d glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.
_mesa_glsl_parse_state should be the parent for all temporary allocation
done while compiling a shader.  glsl_shader should only be used as the
parent for the shader's final IR---the _result_ of compilation.

Since many IR instructions may be added or discarded during optimization
passes, IR should not ever be allocated to glsl_shader directly.

Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g.

This also removes a ton of talloc_parent calls, which may help performance.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
116f1d4f95 glsl2: Steal the live IR and free the rest of the junk. 2010-06-30 13:52:24 -07:00
Brian Paul
fb06b543a5 llvmpipe: another null pointer check 2010-06-30 14:05:45 -06:00
Brian Paul
2b3e1ad731 llvmpipe: use dummy tile when out of memory 2010-06-30 14:05:45 -06:00
Ian Romanick
ef5f194831 linker: Don't dynamically allocate slots for linked shaders
The can be at most one shader per stage.  There are currently only two
stages.  There is zero reason to dynamically size this array.
2010-06-30 12:20:44 -07:00
Eric Anholt
edcb9c2b06 ir_to_mesa: Tell Mesa about our choices for vertex attribute locations. 2010-06-30 12:02:31 -07:00
Ian Romanick
982e3798d8 linker: Don't automatically allocate VERT_ATTRIB_GENERIC0 2010-06-30 12:02:11 -07:00
Eric Anholt
849e18153c glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.
This avoids more allocation and shuffling of data around.
2010-06-30 12:01:42 -07:00
Eric Anholt
0eda9ae0a6 glsl2: Make function names and variable names be children of the node.
This avoids losing their memory when the parser state is freed.
2010-06-30 11:52:40 -07:00
Eric Anholt
16b68b1952 glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.
This saves recompiling at link time.  gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.
2010-06-30 11:30:26 -07:00
Brian Paul
effd33071e llvmpipe: added new lp_memory.[ch] files
Functions for using dummy tiles when we detect OOM conditions.
2010-06-30 12:00:22 -06:00
Brian Paul
87d2c77ed3 draw: fix out of memory handling in polygon stipple stage 2010-06-30 11:46:17 -06:00
Neil Roberts
75acb896c6 glu: Fix some compiler warnings in libtess
When compiled with the more aggressive compiler warnings such as
-Wshadow and -Wempty-body the libtess code gives a lot more
warnings. This fixes the following issues:

* The 'Swap' macro tries to combine multiple statements into one and
  then consume the trailing semicolon by using if(1){/*...*/}else.
  This gives warnings because the else part ends up with an empty
  statement. It also seems a bit dangerous because if the semicolon
  were missed then it would still be valid syntax but it would just
  ignore the following statement. This patch replaces it with the more
  common idiom do { /*...*/ } while(0).

* 'free' was being used as a local variable name but this shadows the
  global function. This has been renamed to 'free_handle'

* TRUE and FALSE were being unconditionally defined. Although this
  isn't currently a problem it seems better to guard them with #ifndef
  because it's quite common for them to be defined in other headers.

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

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-06-30 07:59:39 -06:00
Chia-I Wu
a8815b754d egl: Update MaxSize when a dynamic array is grown. 2010-06-30 18:52:00 +08:00
Chia-I Wu
98ebc8165c egl: Make _eglUnloadDrivers no-op on Windows.
Windows unloads DLLs before atexit.  Make _eglUnloadDrivers no-op on
Windows for now.
2010-06-30 18:32:48 +08:00
Chia-I Wu
c5bc0a8d66 st/egl: Manually free configs on terminate.
The configs should be FREE()ed, not free()ed.  We cannot rely on
_eglCleanupDisplay here.
2010-06-30 18:32:48 +08:00
Chia-I Wu
8b0c6c4a8d egl: Store screens in a dynamic array. 2010-06-30 18:32:48 +08:00
Chia-I Wu
6717a313f2 egl: Store configs in a dynamic array. 2010-06-30 18:32:48 +08:00
Chia-I Wu
106466783f egl: Add dynamic array.
Dynamic arrays will be used to store configs and screens of a display.
2010-06-30 18:32:48 +08:00
Chia-I Wu
2d8e70fcd5 st/vega: Match MALLOC/FREE for vg_shader.
A vg_shader is destroyed with FREE.
2010-06-30 18:32:48 +08:00
José Fonseca
a2311400fe llvmpipe: Add a new scene state to describe scenes which only have state changes.
It's a rare condition, but it may happen if all primitives are
clipped/culled.

For now we just do a no-op rasterization, but we could bypass it.
2010-06-30 11:10:33 +01:00
José Fonseca
4ca3e0d84b llvmpipe: Don't reset the bin when there's a zsbuf bound.
The previous rendering may have secondary effects on the zsbuf.

Fixes the missing tiles on gearbox.
2010-06-30 10:19:50 +01:00
nobled
f914cd1796 st/vega: s/free/FREE for matching MALLOC/CALLOC
[Manually fix a conflict in vg_context.c by Chia-I Wu]
2010-06-30 14:25:43 +08:00
nobled
78215b02e4 st/xorg: s/free/FREE for matching MALLOC/CALLOC 2010-06-30 14:16:20 +08:00
Chia-I Wu
8977879ec9 st/egl: Add egl-gdi target.
The target supports OpenVG on Windows with software rasterizer.  The
egl_g3d_loader defined by the target supports arbitrary client APIs and
window systems.  It is the SConscript that limits the support to OpenVG
and GDI.

This commit also fixes a typo in gdi backend.
2010-06-30 14:00:43 +08:00
Chia-I Wu
2f0b01826d mesa: Use fpclassify for GL_OES_query_matrix on OpenBSD and NetBSD.
Patch from Brad Smith <brad@comstyle.com>

  The attached patch allows the GL_OES_query_matrix function to use the
  systems fpclassify() for OpenBSD and NetBSD.
2010-06-30 13:01:10 +08:00
Zack Rusin
0d68d01347 mesa: make the arguments in the asm statemants optional
geometry shaders emit/end functions don't take any arguments
2010-06-29 21:45:41 -04:00
Eric Anholt
524745bc55 ir_to_mesa: Add support for ir_unop_abs. 2010-06-29 17:18:28 -07:00
Eric Anholt
ba9bd708cb ir_to_mesa: Add support for dFdx, dFdy. 2010-06-29 17:18:28 -07:00
Eric Anholt
d4f7e660dd ir_to_mesa: Start adding support for texture instructions.
Fixes:
glsl-fs-bug25902
glsl-fs-sampler-numbering
glsl-lod-bias
2010-06-29 17:18:28 -07:00
Kenneth Graunke
506199b852 glsl2: Keep the same number of components in implicit conversions.
Fixes piglit test glsl-implicit-conversion-01.
2010-06-29 16:31:52 -07:00
Ian Romanick
22971e922a glsl2: Make gl_MaxDrawBuffers available in the vertex shader 2010-06-29 15:32:19 -07:00
Ian Romanick
e2f84f04e5 glsl2: Make gl_MaxDrawBuffers available in the fragment shader 2010-06-29 15:32:15 -07:00
Ian Romanick
9c4b1f2bad glsl2: Make gl_FragData be available in GLSL 1.10 too 2010-06-29 15:19:42 -07:00
Ian Romanick
5e18b051c0 glsl2: Pass MaxDrawBuffers from core Mesa into the GLSL compiler 2010-06-29 15:19:38 -07:00
Marek Olšák
b939f83eb7 r300g: add workaround for multiple contexts 2010-06-30 00:03:04 +02:00
Marek Olšák
6a34287bb5 r300g: move one flush from winsys to the context
This flush happens when changing the tiling flags, and it should really be
done in the context.

I hope this fixes FDO bug #28630.
2010-06-30 00:03:04 +02:00
Brian Paul
3d6101245b llvmpipe: don't crash/assert on out of memory
Check for null pointers and return early, etc.
2010-06-29 15:40:19 -06:00
Brian Paul
249c6735dd llvmpipe: restore call to lp_setup_update_state()
This undoes part of commit 8be645d53a
and fixes fd.o bug 28822 as well as other regressions.

The 'draw' module may issue additional state-change commands while
we're inside the draw_arrays/elements() call so it's important to
check for updated state at this point.
2010-06-29 15:19:01 -06:00
Ian Romanick
efc15f862b glsl_type: Add _mesa_glsl_release_types to release all type related storage 2010-06-29 11:15:40 -07:00
Ian Romanick
e1374d48de glsl_type: All glsl_type objects live in their own talloc context 2010-06-29 11:15:40 -07:00
Ian Romanick
72e627d02a glsl_type: Record type constructors are private 2010-06-29 11:15:39 -07:00
Ian Romanick
49e3577b91 glsl_type: Add get_record_instance method 2010-06-29 11:15:39 -07:00
Ian Romanick
31bcce04b1 glsl_type: Vector, matrix, and sampler type constructors are private 2010-06-29 11:15:39 -07:00
Ian Romanick
e94642eb0d glsl_type: Make all static objects be class private 2010-06-29 11:15:39 -07:00
Ian Romanick
4b6feb0398 glsl2: Use talloc_strdup when generating constructor temporary names 2010-06-29 11:15:26 -07:00
Ian Romanick
12681610f5 glsl_type: Remove vector and matrix constructor generators
All scalar, vector, and matrix constructors are generated in-line
during AST-to-HIR translation.  There is no longer any need to
generate function versions of the constructors.
2010-06-29 11:15:26 -07:00
Ian Romanick
699b247661 glsl2: Don't flatten constructor parameters to scalars
Now that all scalar, vector, and matrix constructors are emitted
in-line, the parameters to these constructors should not be flattened
to a pile of scalars.  Instead, the functions that emit the in-line
constructor bodies can directly write the parameters to the correct
locations in the objects being constructed.
2010-06-29 11:15:26 -07:00
Ian Romanick
81c7e94466 glsl2: Always emit matrix constructors inline 2010-06-29 11:15:26 -07:00
Ian Romanick
c31dcdf57e glsl2: Always emit vector constructors inline 2010-06-29 11:15:26 -07:00
Ian Romanick
6315b68f5f ir_swizzle: Add new constructor, refactor constructors
Adds a new constructor that takes an array of component values.  Refactors
the meat of the two constructors to an init_mask method.
2010-06-29 11:15:26 -07:00
Kenneth Graunke
50577b96ac glsl2: Update TODO. 2010-06-29 11:12:54 -07:00
Kenneth Graunke
6de8256505 glsl2: Check for non-void functions that don't have a return statement.
This doesn't do any control flow analysis to ensure that the return
statements are actually reached.

Fixes piglit tests function5.frag and function-07.vert.
2010-06-29 11:12:54 -07:00
Kenneth Graunke
ac04c257e3 glsl2: Reject return types with qualifiers.
Fixes piglit test return-qualifier.frag.
2010-06-29 11:12:54 -07:00
Kenneth Graunke
28527ed557 glsl2: Add a method for querying if an AST type has any qualifiers. 2010-06-29 11:12:53 -07:00
Kenneth Graunke
18707eba1c glsl2: Check that returned expressions match the function return type.
From my reading of the specification, implicit conversions are not
allowed.  ATI seems to agree, though nVidia allows it without warning.
2010-06-29 11:12:53 -07:00
Ian Romanick
153eca9806 glsl2: Invoke preprocessor before calling the compiler proper 2010-06-29 11:00:58 -07:00
Jakob Bornecrantz
172f3f5eac egl: Check for drm winsys not just the driver name
Also fix pipe_radeon.so not building
2010-06-29 18:25:49 +01:00
José Fonseca
bb6ca7b3f7 draw: Add inline keyword to inline function.
Otherwise gcc will warn about unusued functions.
2010-06-29 14:30:44 +01:00
Jakob Bornecrantz
218da1ef34 i915g: Fix copy pasto 2010-06-29 12:36:40 +01:00
Jakob Bornecrantz
006d02a911 egl: Fix gallium build when EGL is not installed on system 2010-06-29 12:28:41 +01:00
Jakob Bornecrantz
eebb048753 i915g: Add missing egl pipe file 2010-06-29 12:28:15 +01:00
Chia-I Wu
4cb853402b egl: Remove st/egl probe code.
It is no longer needed.
2010-06-29 17:16:20 +08:00
Chia-I Wu
afcea9b115 egl: Do not call drv->Initialize with global mutex locked. 2010-06-29 17:16:20 +08:00
Chia-I Wu
a81ef14228 st/egl: Build a single EGL driver.
This change makes st/egl build a single egl_gallium.so and multiple
st_<API>.so and pipe_<HW>.so.  When a display is initialized, the
corresponding pipe driver will be loaded.  When a context is created,
the corresponding state tracker will be loaded.

Unlike DRI drivers, no ABI compatibility is maintained.  egl_gallium,
pipe drivers and state trackers should always be distributed as a single
package.  As such, there is only a single src/gallium/targets/egl/ that
builds everything for the package.
2010-06-29 17:16:20 +08:00
Chia-I Wu
d5ab243d5a st/egl: Move module loading code to targets.
Several changes are made.  libegl.a no longer defines _eglMain.  It
defines functions to create and destroy a _EGLDriver instead.  The
creation function is called by the targets.  It takes an egl_g3d_loader
as its argument.  The loader is defined by the targets and is in charge
of creating st_api and pipe_screen.  This allows us to move the module
loading code to targets.  Lastly, the modules are now loaded as the
respective contexts are created.
2010-06-29 17:16:20 +08:00
Chia-I Wu
d8e0e11456 st/egl: Reorganize targets.
Merge all targets into targets/egl/.  The target produces
egl_gallium_<HW>.so for each pipe driver and st_<API>.so for each client
APIs.  This enables us to further merge egl_gallium_<HW>.so into
egl_gallium.so later.
2010-06-29 17:16:20 +08:00
Chia-I Wu
ea05299ce5 st/egl: One driver per hardware.
Merge multiple egl_<platform>_<pipe>.so into a single
egl_gallium_<pipe>.so.  The environment variable EGL_PLATFORM is now
used to modify the return value of _eglGetNativePlatform.
2010-06-29 17:16:19 +08:00
Chia-I Wu
f66a4e20c1 st/egl: Introduce native_platform.
Move native_get_name, native_create_probe, native_get_probe_result, and
native_create_display into struct native_platform, and add
native_get_platform to get a handle to the struct.
2010-06-29 17:16:19 +08:00
Chia-I Wu
f9574c5f89 st/egl: Make api_OpenGL support OpenGL ES.
This allows api_OpenGL.so to support OpenGL ES.
2010-06-29 17:16:19 +08:00
Chia-I Wu
57c654324f st/mesa: Add support for multiple APIs.
Add st_gl_api_create_es1 and st_gl_api_create_es2 to create OpeGL ES 1.1
and OpenGL ES 2.0 contexts respectively.
2010-06-29 17:16:19 +08:00
Chia-I Wu
982aba97c5 st_api: Remove st_context::is_visual_supported.
The callback is used by st/vega to check if a visual specifies the
depth/stencil format.  It forces st/vega to be loaded by st/egl to
perform the check.  As noted in EGL spec, the depth/stencil format of a
visual should not affect OpenVG.  It should be better to ignore the
field and always allocate the depth/stencil texture.
2010-06-29 17:16:19 +08:00
Zack Rusin
da7bd6a90e mesa: initial support for ARB_geometry_shader4
laying down the foundation for everything and implementing most of the
stuff.
linking, gl_VerticesIn and multidimensional inputs are left.
2010-06-28 22:53:21 -04:00
Marek Olšák
0b50fcbd55 util: reference surfaces and sampler views in blitter when saving them
Ooops. This should possibly fix some bugs...
2010-06-29 01:54:26 +02:00
Eric Anholt
59a23d7fb9 ir_to_mesa: Actually initialize the undef register for scalar_op1.
Fixes glsl-sin, glsl-cos on 965, where we rely on unused src arguments
in the VS having a file of PROGRAM_UNDEFINED.
2010-06-28 15:07:19 -07:00
Eric Anholt
f9ffccb06b ir_to_mesa: Support user-defined varyings using the linker's locations.
Fixes glsl-reload-source.
2010-06-28 14:49:59 -07:00
Eric Anholt
ad8ad338f4 ir_to_mesa: Actually add the header file for the interface. 2010-06-28 13:45:43 -07:00
Jakob Bornecrantz
7e1ce791c7 i915g: Add Galahad to targets 2010-06-28 22:33:39 +02:00
Jakob Bornecrantz
77cd1a989b r300g: Galahad for scons as well 2010-06-28 22:27:51 +02:00
Jakob Bornecrantz
2da9d80a4b r300g: Add target defines for Galahad 2010-06-28 22:27:08 +02:00
Jakob Bornecrantz
40d4b414d9 glhd: Build with scons 2010-06-28 22:27:06 +02:00
Eric Anholt
8f62ad6d0f ir_to_mesa: Fix binop_sqrt for multi-channel and negative source channels.
Fixes glsl-fs-sqrt-branch.
2010-06-28 13:03:10 -07:00
Jakob Bornecrantz
d12c4c5a62 glhd: Re-integrate with the debug system 2010-06-28 21:52:03 +02:00
Eric Anholt
d5a5df45a4 ir_to_mesa: Fix indexes of temps used in expressions.
It looks like I managed to horribly mangle this in some rebase of the
branch.  Fixes:
glsl-fs-fragcoord
glsl-fs-mix
2010-06-28 12:49:28 -07:00
Eric Anholt
7dc1e0b326 ir_to_mesa: Notify the driver when we generate new Mesa programs for GLSL.
Fixes glsl-fs-if-*.
2010-06-28 12:38:19 -07:00
Jakob Bornecrantz
2932dd6374 glhd: Remove leftover file 2010-06-28 21:37:03 +02:00
Eric Anholt
904b5bfe99 ir_to_mesa: Add support for the pow expression.
Fixes glsl-algebraic-pow-two.
2010-06-28 12:26:19 -07:00
Eric Anholt
cbe52c8012 ir_to_mesa: Fix EmitCondCodes for boolean vars as condition.
Fixes glsl-vs-if-bool.
2010-06-28 12:17:25 -07:00
Jakob Bornecrantz
a01e0afd9f Merge branch 'gallium-drm-driver-drescriptor'
Conflicts:
	src/gallium/state_trackers/egl/x11/native_dri2.c
	src/gallium/state_trackers/egl/x11/native_x11.c
	src/gallium/state_trackers/egl/x11/native_x11.h
	src/gallium/state_trackers/xorg/xorg_driver.c
	src/gallium/winsys/radeon/drm/radeon_drm.c
2010-06-28 21:14:45 +02:00
Eric Anholt
854fd66cbb ir_to_mesa: Respect EmitCondCodes for IF statements.
Fixes glsl-vs-if-* for the 965 driver.
2010-06-28 12:01:23 -07:00
Eric Anholt
0a52e8b691 ir_to_mesa: Traverse the "else" instrs after "else", instead of "then" again. 2010-06-28 11:45:10 -07:00
Eric Anholt
3f3f41357d ir_to_mesa: Fix matrix * scalar multiplication.
We're accessing in terms of columns, so we need to do MUL/MAD/MAD/MAD
instead of DP4s.

Fixes:
glsl-fs-exp2
glsl-fs-log2
glsl-fs-mix-constant
glsl-fs-sqrt-zero
glsl-vs-sqrt-zero
2010-06-28 11:14:47 -07:00
Eric Anholt
ad2dc740b9 ir_to_mesa: Check the right element for matrix * scalar multiplication. 2010-06-28 11:14:47 -07:00
Eric Anholt
bd3b835e7c glsl2: Add support for some builtin matrices. 2010-06-28 11:14:47 -07:00
Eric Anholt
81b7b79c47 ir_to_mesa: Fix copy and wasted InputsRead/OutputsWritten setup. 2010-06-28 11:14:47 -07:00
Kenneth Graunke
5f3fe44595 Use a more sensible context in copy propagation. 2010-06-28 11:14:47 -07:00
Kenneth Graunke
a815f7fb83 Use more sensible contexts in ir_dead_code_local. 2010-06-28 11:14:47 -07:00
Ian Romanick
22c23dedad glsl2: Add option to stand-alone GLSL compiler to dump IR before optimizations 2010-06-28 10:04:22 -07:00
Ian Romanick
26b5d33dce glsl2: Use i2b and f2b IR opcodes for casting int or float to bool 2010-06-28 10:04:18 -07:00
José Fonseca
250b92f3bb llvmpipe: set WRITE_ALL only a per-tile basis in lp_resource_copy(). 2010-06-28 16:33:52 +01:00
José Fonseca
a9e0fda070 llvmpipe: Actually flush in lp_resource_copy()
The cpu_access is redundant in a software rasterizer.
2010-06-28 16:33:21 +01:00
José Fonseca
8be645d53a llvmpipe: Ensure outdated framebuffer state is not reused in lp_setup_bind_framebuffer().
We were starting a scene whenever lp_setup_get_vertex_info() was called by
the draw module. So when when all primitives were culled/clipped, not only
did we create a new scene for nothing, but we end up using the old scene
with the old framebuffer state instead of a new one.

Fix consists in:
- don't call lp_setup_update_state() in lp_setup_get_vertex_info() -- no
  longer necessary
- always setting the scene state before binning a command -- query
  commands were bypassing it
- assert no old scene is reused in lp_setup_bind_framebuffer()
2010-06-28 16:33:05 +01:00
Marek Olšák
ce7a70b8b4 r300g: fix a compile error on non-debug builds 2010-06-27 17:15:23 +02:00
Marek Olšák
57c3f70018 util: fix a memory leak in blitter 2010-06-27 15:13:14 +02:00
Marek Olšák
0a19d57b84 r300g: separate the hyperz state and pipelined FB regs out of the FB state 2010-06-27 15:13:14 +02:00
Marek Olšák
808ad22592 r300g: release referenced objects in destroy_context 2010-06-27 15:13:13 +02:00
Marek Olšák
639a7daa85 r300g: reference surfaces in set_framebuffer_state 2010-06-27 15:13:13 +02:00
Marek Olšák
408a886127 r300g: group debug messages 2010-06-27 15:13:13 +02:00
Marek Olšák
0a9510814e r300g: turn rasterizer state into a command buffer 2010-06-27 15:13:13 +02:00
Marek Olšák
c200c47e6c r300g: move emission of the MSPOS regs into the framebuffer state
Now the question is whether we are allowed to ignore gl_rasterization_rules and
pipe_rasterizer_state::multisample. The former is invariant anyway and
I think the latter would need re-emitting the AA state which is quite costly,
considering that it implicitly flushes the whole pipeline (all AA regs
in the AA state are *unpipelined*).
2010-06-27 15:13:13 +02:00
Marek Olšák
bb47d1c26f r300g: turn invariant state into a command buffer 2010-06-27 15:13:12 +02:00
Marek Olšák
8959f48bce r300g: initialize some crucial state in the first CS 2010-06-27 15:13:08 +02:00
Marek Olšák
fcacc6a076 r300g: introduce VAP invariant state
Unlike other invariant states, this one must be emitted after VAP flush.
2010-06-26 17:57:20 +02:00
Marek Olšák
8350d1d6f1 r300g: immediate mode cleanup 2010-06-26 17:47:32 +02:00
Marek Olšák
5acdfdbf42 r300g: update my notes about fastfill and zbuffer compression 2010-06-26 17:43:58 +02:00
Marek Olšák
f39800b339 r300g: enum r300_blitter_op is a bitmask 2010-06-26 17:35:56 +02:00
Marek Olšák
8924201530 draw: fix build with llvm and make 2010-06-26 14:01:41 +02:00
Vinson Lee
ecd8c66d6a mesa: Remove unnecessary header. 2010-06-26 00:47:52 -07:00
Vinson Lee
2943f1ed8c st/mesa: Remove unnecessary headers. 2010-06-26 00:38:05 -07:00
Vinson Lee
3443b581fb draw: Remove unnecessary header. 2010-06-26 00:31:57 -07:00
Eric Anholt
0bef5b97a9 glsl2: Add support for non-float constants in Mesa IR.
Fixes glsl-vs-vec4-indexing-4.
2010-06-25 18:01:20 -07:00
Eric Anholt
6152fa16a1 glsl2: Take out the spamming of debug flags I'd added. 2010-06-25 17:23:31 -07:00
Eric Anholt
b2d7ed2aba glsl2: Don't clear swizzles for Mesa IR constants after fetching them.
Missed this while hacking in constants support.  Fixes:
glsl-algebraic-mul-*
glsl-algebraic-rcp-*
glsl-vs-swizzle-swizzle-lhs
glsl-vs-vec4-indexing-6
2010-06-25 17:20:46 -07:00
Kenneth Graunke
78062273de ir_reader: Free memory for S-Expressions earlier.
There's no point in keeping it around once we've read the IR.

Also, remove an unnecessary talloc_parent call.
2010-06-25 17:07:42 -07:00
Zack Rusin
4503bd33da draw: deleted by mistake 2010-06-25 20:06:53 -04:00
Zack Rusin
a5c44986a3 draw: initialize headers in the none post paths as well 2010-06-25 19:58:09 -04:00
Eric Anholt
85c978f38c glsl2: Start trying to hook up uniforms.
This should be resolved with linker.cpp's location assignment, as
currently we drop that location assignment on the ground.  However,
this gets basic programs using uniforms working for now.
2010-06-25 16:35:36 -07:00
Eric Anholt
0fd97db8b0 glsl2: Associate the GLenum for the type with builtin GLSL types. 2010-06-25 16:35:22 -07:00
Zack Rusin
8ebfcf31eb draw: limit the number of vertex shader variants kept around
we used to create and cache unltimited number of variant, this
change limits the number of variants kept around to a fixed number.
the change is based on a similar patch by Roland for llvmpipe fragment
shaders.
2010-06-25 19:33:27 -04:00
Zack Rusin
5cf1921e6d draw: initialize vertex header 2010-06-25 19:33:27 -04:00
Eric Anholt
bda27424cf glsl2: Use the parser state as the talloc context for dead code elimination.
This cuts runtime by around 20% from talloc_parent() lookups.
2010-06-25 13:38:38 -07:00
Eric Anholt
abc4e52992 glsl2: Emit OPCODE_END at the end of the Mesa program.
The 965 driver can now run a glsl2-generated shader!
2010-06-25 13:28:16 -07:00
Eric Anholt
582b73fe69 glsl2: Hook up constant parameters in ir_to_mesa. 2010-06-25 13:27:57 -07:00
Brian Paul
4ae530370d gallium/util: fix pipe_sampler_view_reference() calls
The conditionals aren't needed.
2010-06-25 14:12:34 -06:00
Eric Anholt
ffc845a50a glsl2: Set InputsRead and OutputsWritten on the generated programs. 2010-06-25 12:52:01 -07:00
Eric Anholt
364fcd8ee1 glsl2: Start integrating ir_to_mesa.cpp into shader_api.h
The compiler is now called by the driver, and generates program
instructions.  Parameter lists are still not set up, so the driver
chokes on it shortly thereafter.
2010-06-25 12:37:21 -07:00
Eric Anholt
7f2bf62d25 glsl2: Use Mesa types instead of duping them into our program.h. 2010-06-25 12:25:19 -07:00
Eric Anholt
2a3d46dd46 glsl2: Fix dependencies. (at least partially) 2010-06-25 12:23:20 -07:00
Brian Paul
e099ed2c64 softpipe: rename a var 2010-06-25 09:56:22 -06:00
Chia-I Wu
7a9246c5d7 draw: Work around an invalid write.
SSE vertex shader does not seem to honor the execution mask.  Pad the
output array as a workaround.
2010-06-25 23:17:18 +08:00
Brian Paul
a879d14ecf mesa: initialize extension string when context is first bound
...instead of waiting until glGetString(GL_EXTENSIONS) is called.
This fixes a problem where the MESA_EXTENSION_OVERRIDE env var is
ignored if the app never calls glGetString(GL_EXTENSIONS).

NOTE: this is a candidate patch for the 7.8 branch.
2010-06-25 08:47:33 -06:00
Brian Paul
cc8c142e2a llvmpipe: fix comment typo 2010-06-25 08:47:22 -06:00
Brian Paul
fd60bf8e33 softpipe: fix comment typo 2010-06-25 08:47:22 -06:00
Eric Anholt
0a1b54df7a glsl2: Replace the GLSL compiler with the glsl2 project. 2010-06-24 17:23:21 -07:00
Eric Anholt
3d6012303c glsl2: Wrap includes of C interfaces with extern "C". 2010-06-24 17:23:19 -07:00
Eric Anholt
f4869f3326 glsl2: Remove files that had been imported for standalone. 2010-06-24 17:14:00 -07:00
Eric Anholt
e82ddb781a glsl2: Stop .gitignoring the old standalone build system. 2010-06-24 15:52:56 -07:00
Eric Anholt
9aa0b6d728 glsl2: Move the Mesa IR codegen into mesa/shader/ 2010-06-24 15:49:18 -07:00
Eric Anholt
bcc13b7444 Merge branch 'glsl2-head' into glsl2
This brings in the standalone GLSL compiler that we are planning on
replacing the existing Mesa GLSL compiler.  It currently targets GLSL
1.20 and the Mesa IR.
2010-06-24 15:47:40 -07:00
Eric Anholt
e5cf3aadb8 glsl2: Add a README file for the new compiler. 2010-06-24 15:46:53 -07:00
Eric Anholt
2928588267 glsl2: Move the compiler to the subdirectory it will live in in Mesa. 2010-06-24 15:36:00 -07:00
Eric Anholt
0ee7d80269 Merge branch 'mesa'
This brings in the ir_to_mesa.cpp code I've been developing to codegen
to the Mesa IR.  It does not actually generate a complete Mesa
fragment/vertex program yet.
2010-06-24 15:27:10 -07:00
Eric Anholt
6b01b50888 Move the talloc_parent lookup down in a few hot paths.
talloc_parent is still 80% of our runtime, but likely talloc_parent
lookups will be reduced as we improve the handling of memory
ownership.
2010-06-24 15:18:39 -07:00
Eric Anholt
e33c10328c Merge remote branch 'cworth/master'
Conflicts:
	ast_to_hir.cpp
	ir.cpp

This brings in the talloc-based memory management work, so that the
compiler (almost) no longer leaks memory.
2010-06-24 15:13:03 -07:00
Eric Anholt
8364fc85b8 ir_to_mesa: Handle a limited subset of matrix multiplication.
glsl-mvp.vert now generates believable code, and mesa mode fails only
5 tests that master doesn't.  I must have left out some asserts...
2010-06-24 15:05:21 -07:00
Eric Anholt
7672064756 ir_to_mesa: Handle constant matrices.
There's not much to it since we're not actually storing constant data yet.
2010-06-24 15:05:21 -07:00
Eric Anholt
f4bd7f262e ir_to_mesa: Fix copy-and-wasted second argument to compare expresssion ops.
Fixes CorrectParse2.vert assertion due to uninitialized values.
2010-06-24 15:05:21 -07:00
Eric Anholt
4006424f5b ir_to_mesa: Don't allocate temps for swizzles.
We do them in place by actually, you know, swizzling.
2010-06-24 15:05:21 -07:00
Eric Anholt
a9b619bb3b ir_to_mesa: Set up storage for uniform vars. 2010-06-24 15:05:21 -07:00
Eric Anholt
554dbcce77 ir_to_mesa: Move the classes into the file now that we don't have the burg.
At 1kloc, it doesn't look like I'll want to split the ir_to_mesa file
up even once it's feature-complete.  Move definitions closer to usage,
and prevent rebuilding the world when changing the definitions.
2010-06-24 15:05:21 -07:00
Eric Anholt
2401338ef8 ir_to_mesa: Remove old monoburg structure. 2010-06-24 15:05:21 -07:00
Eric Anholt
9cd8cad9f3 ir_to_mesa: Restrict dst writemasks like we did in the monoburg setup. 2010-06-24 15:05:21 -07:00
Eric Anholt
9d2b8e0b70 ir_to_mesa: Fix copy-and-wasted DIV instruction sequence. 2010-06-24 15:05:21 -07:00
Eric Anholt
0161515c39 ir_to_mesa: Remove the BURG code.
The promise of the BURG was to recognize multi-instruction sequences
and emit reduced sequences for them.  It would have worked well for
recognizing MUL+ADD -> MAD and possibly even MIN(MAX(val, 0), 1) ->
MOV_SAT with some grammar changes.  However, that potential benefit in
making those optimizations easy is outweighed by the fragility of
monoburg, the amount of (incorrect, as I wrote it) code for using it,
and the burden it was going to cause for handling operations on
aggregate types.
2010-06-24 15:05:21 -07:00
Eric Anholt
224f712950 ir_to_mesa: Fix mapping of FS texcoord inputs and color output. 2010-06-24 15:05:21 -07:00
Eric Anholt
ab386f18b0 ir_to_mesa: Try to fix up the dereference handling for the visitor rework.
One of the gstreamer shaders I play with now compiles, but input
mappings are wrong.
2010-06-24 15:05:21 -07:00
Eric Anholt
c23c6c773a ir_to_mesa: Implement min and max expressions.
fixes glsl-orangebook-ch06-bump.frag.
2010-06-24 15:05:21 -07:00
Eric Anholt
346daeca07 ir_to_mesa: Don't assert over assignments with a constant-true condition. 2010-06-24 15:05:21 -07:00
Eric Anholt
c2014f03e8 ir_to_mesa: Add support for trunc/ceil/floor. 2010-06-24 15:05:20 -07:00
Eric Anholt
c45b615a37 ir_to_mesa: Implement neg expression. 2010-06-24 15:05:20 -07:00
Eric Anholt
3c5979565f ir_to_mesa: Add sin/cos. 2010-06-24 15:05:20 -07:00
Eric Anholt
2c432637d0 ir_to_mesa: Start trying to support struct storage. 2010-06-24 15:05:20 -07:00
Eric Anholt
4a1bd916e7 ir_to_mesa: Fix up array indexing.
The grammar for array_reference_vec4_vec4 was set up wrong, so we
weren't generating instructions if necessary for the array index.
2010-06-24 15:05:20 -07:00
Eric Anholt
2ee85e20c8 ir_to_mesa: Remove stale comment about monoburg. 2010-06-24 15:05:20 -07:00
Eric Anholt
bdbd9f112e ir_to_mesa: Add support for variable indexing of temporary arrays.
Fixes loop-01.vert, loop-02.vert.
2010-06-24 15:05:20 -07:00
Eric Anholt
4e5e0f018b ir_to_mesa: Clean up some handling of builtins and arrays.
Constant-index dereferences of arrays should work now.  One test is
regressed, but it should have been failing before this commit, too.
2010-06-24 15:05:20 -07:00
Eric Anholt
64fcbbca9c ir_to_mesa: Add support for loops.
Fixes CorrectParse1 and the glsl2 loop tests that don't use arrays.
2010-06-24 15:05:20 -07:00
Eric Anholt
0c005bd773 Make loop jump mode public so I can switch on it. 2010-06-24 15:05:20 -07:00
Eric Anholt
4380099c98 ir_to_mesa: Add logic_or and logic_and to get CorrectFunction1.vert working. 2010-06-24 15:05:20 -07:00
Eric Anholt
763cd75863 ir_to_mesa: add logic_xor to get CorrectParse2.vert working. 2010-06-24 15:05:20 -07:00
Eric Anholt
1d20862c8a ir_to_mesa: add logic_not and f2b to get CorrectParse2.frag working. 2010-06-24 15:05:20 -07:00
Eric Anholt
c5ca73e72c ir_to_mesa: Add support for ir_if. 2010-06-24 15:05:20 -07:00
Eric Anholt
3831507957 ir_to_mesa: Add support for comparison operations. 2010-06-24 15:05:20 -07:00
Eric Anholt
bf99533350 ir_to_mesa: Introduce shorthand for common Mesa IR emit patterns. 2010-06-24 15:05:20 -07:00
Eric Anholt
423a75c5d6 ir_to_mesa: Add ir_unop_f2i -> OPCODE_TRUNC. 2010-06-24 15:05:20 -07:00
Eric Anholt
878740bedf ir_to_mesa: Add codegen for rsq expression operation. 2010-06-24 15:05:20 -07:00
Eric Anholt
8c29a1d84d ir_to_mesa: Add exp/log expression operations. 2010-06-24 15:05:20 -07:00
Eric Anholt
829e0a8eff ir_to_mesa: Add (almost) the rest of the builtin varyings. 2010-06-24 15:05:20 -07:00
Eric Anholt
110d5cc83c ir_to_mesa: Support gl_Position output. 2010-06-24 15:05:20 -07:00
Eric Anholt
8041bce333 ir_to_mesa: Support gl_FragData[] output. 2010-06-24 15:05:20 -07:00
Eric Anholt
48e282d8a2 ir_to_mesa: Support gl_FragData[] output. 2010-06-24 15:05:20 -07:00
Eric Anholt
50ad96ebce ir_to_mesa: Start doing some int support. 2010-06-24 15:05:20 -07:00
Eric Anholt
315c638b8c ir_to_mesa: Fix bugs in swizzle handling for scalar operations.
Looking at a vec2 / float codegen, the writemasks on the RCPs were wrong and
the swizzle on the multiply by the RCP results was wrong.
2010-06-24 15:05:20 -07:00
Eric Anholt
f30100c19c ir_to_mesa: Fix copy'n'paste bug where divide multiplied left by 1/left.
Multiply left by 1/right, please.
2010-06-24 15:05:20 -07:00
Eric Anholt
3d70d1f4d6 ir_to_mesa: Emit more reduced writemasks for ops on small types.
This should help prevent Mesa from having to be smart to give
channel-wise drivers better information.
2010-06-24 15:05:19 -07:00
Eric Anholt
b07cc372c6 ir_to_mesa: Handle swizzles on LHS of assignment (writemasks). 2010-06-24 15:05:19 -07:00
Eric Anholt
12f654c63b ir_to_mesa: Produce multiple scalar ops when required to produce vec4s.
Fixes the code emitted in a test shader for vec2 texcoord / vec2 tex_size.
2010-06-24 15:05:19 -07:00
Eric Anholt
b2ed4dd7b0 ir_to_mesa: Get temps allocated at the right times.
The alloced_vec4/vec4 distinction was an experiment to expose the cost
of temps to the codegen.  But the problem is that the temporary
production rule gets called after the emit rule that was using the
temp.  We could have the args to emit_op be pointers to where the temp
would get allocated later, but that seems overly hard while just
trying to bring this thing up.  Besides, the temps used in expressions
bear only the vaguest relation to how many temps will be used after
register allocation.
2010-06-24 15:05:19 -07:00
Eric Anholt
ae252d3613 ir_to_mesa: Make the first temp index we use 1 to show off bugs.
Regs aren't allocated at the right times yet, so we see TEMP[0] a lot.
2010-06-24 15:05:19 -07:00
Eric Anholt
7aa0b034f7 ir_to_mesa: Fix up the assign rule to use left and right correctly.
The destination of assign is in left, not in the node itself.
2010-06-24 15:05:19 -07:00
Eric Anholt
f14913d4b7 ir_to_mesa: Do my best to explain how the codegen rules work. 2010-06-24 15:05:19 -07:00
Eric Anholt
b7abce770f ir_to_mesa: Print out the ir along with the Mesa IR.
Ideally this would be hooked up by ir_print_visitor dumping into a
string that we could include as prog_instruction->Comment when in
debug mode, and not try keeping ir_instruction trees around after
conversion to Mesa.  The ir_print_visitor isn't set up to do that for
us today.
2010-06-24 15:05:19 -07:00
Eric Anholt
3419583266 ir_to_mesa: Fix up src reg swizzling. 2010-06-24 15:05:19 -07:00
Eric Anholt
c554d7cede ir_to_mesa: Remove dead code from when this was an ARB_fp printer. 2010-06-24 15:05:19 -07:00
Eric Anholt
8197eeee3b ir_to_mesa: Fill in more bits of dest resg. 2010-06-24 15:05:19 -07:00
Eric Anholt
aaee40e107 ir_to_mesa: Print out the resulting program. 2010-06-24 15:05:19 -07:00
Eric Anholt
b5039eff3f Add missing dist file. 2010-06-24 15:05:19 -07:00
Eric Anholt
182b623de3 Ignore the generated codegen files for now.
Later we'll throw them in revision control.
2010-06-24 15:05:19 -07:00
Eric Anholt
84771df82e ir_to_mesa: Start building GLSL IR to Mesa IR conversion.
There are major missing pieces here.  Most operations aren't
supported.  Matrices need to be broken down to vector ops before we
get here.  Scalar operations (RSQ, RCP) are handled incorrectly.
Arrays and structures are not even considered.
2010-06-24 15:05:19 -07:00
Eric Anholt
9290e0dd28 Make inlined function variables auto, not in/out. 2010-06-24 15:05:11 -07:00
Ian Romanick
84341f4b20 Make sure that symbols aren't multiply defined in the same scope.
The assembly parser is already checking this, but we're relying on the
symbol table handling it in glsl2.
2010-06-24 14:56:26 -07:00
Eric Anholt
ebefeb2bdd Attach a pointer to variable names in LIR dumping.
Since variable names are not unique, and we like to make lots of
__retvals and assignment_tmps and a,b,c,d this helps in debugging.
2010-06-24 13:32:35 -07:00
Eric Anholt
9ca0a022e6 Quiet unused arg warning for ir_constant cloning. 2010-06-24 13:32:35 -07:00
Eric Anholt
5f38408833 Move ir_constant cloning alongside the other cloning functions. 2010-06-24 13:32:35 -07:00
Eric Anholt
ae805922b7 Don't forget to add the declaration of our temporary variable for assigns.
Otherwise, dead code elimination gets confused since it relies on
seeing decls.
2010-06-24 13:32:35 -07:00
Eric Anholt
f66ba4f357 ir_function_inlining: Re-add the "s/return/retval =/" functionality.
I ripped it out with the cloning changes yesterday, and should have
tested and noticed that there were now returns all over.
2010-06-24 13:32:35 -07:00
Eric Anholt
1b2bcf7913 Fix variable remapping in function cloning.
It's (ht, data, key) not (ht, key, data).
2010-06-24 13:32:35 -07:00
Marek Olšák
5d1cc93077 r300g: a couple more chipsets do not have HiZ RAM 2010-06-24 22:24:22 +02:00
Corbin Simpson
474dc40fb4 gallium/docs: Vertex data formats.
I'm not sure if I really got it right. This seems like one of those
"Duh, of course it works that way" things, but I'd like the
documentation to be readable by people not acquainted with OGL/D3D.
2010-06-24 07:57:30 -07:00
Corbin Simpson
484bb0ea58 glhd: Add test for logicop enable.
Only for first RT at the moment, as there is no trivial way in galahad
to look at framebuffer state and (sadly) people don't usually calloc
their CSOs, so flags could be wrongly set.

On the other hand, of course, galahad will hopefully encourage more
people to calloc their CSOs. :3
2010-06-24 07:22:29 -07:00
Corbin Simpson
49735d1c6c gallium/docs: Lops override the rest of the blending state when enabled. 2010-06-24 07:22:29 -07:00
Brian Paul
05a18f48e5 gallium/docs: updated remaining semantic label docs 2010-06-24 07:50:29 -06:00
nobled
fd7de146f6 pipe: Add PIPE_OS_HURD
One tiny step toward porting Gallium to the GNU/Hurd kernel
(and fixing Debian bug #585618).

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-06-24 06:45:36 -07:00
Corbin Simpson
06a75bd873 gallium/docs: Add lop table.
Was feeling kind of weird without it.
2010-06-24 06:43:50 -07:00
Corbin Simpson
1e10464557 gallium/docs: Slight clarification and formatting for Blend. 2010-06-24 06:43:50 -07:00
Brian Paul
ca12aefdac Merge branch 'shader-file-reorg'
1. Move all GL entrypoint functions and files into src/mesa/main/
This includes the ARB vp/vp, NV vp/fp, ATI fragshader and GLSL bits
that were in src/mesa/shader/

2. Move src/mesa/shader/slang/ to src/mesa/slang/ to reduce the tree depth

3. Rename src/mesa/shader/ to src/mesa/program/ since all the
remaining files are concerned with GPU programs.

4. Misc code refactoring.  In particular, I got rid of most of the
GLSL-related ctx->Driver hook functions.  None of the drivers used
them.

Conflicts:
	src/mesa/drivers/dri/i965/brw_context.c
2010-06-23 22:30:26 -06:00
Marek Olšák
f2122d4724 r300g: remove an XXX comment 2010-06-24 06:15:45 +02:00
Marek Olšák
69adebf594 r300g: move AA registers into the new AA state 2010-06-24 06:10:47 +02:00
Marek Olšák
93bce03b27 r300g: separate the cache flush from the framebuffer state 2010-06-24 06:10:47 +02:00
Marek Olšák
a2f14153cc r300g: reorder and cleanup register writes everywhere 2010-06-24 06:10:47 +02:00
Marek Olšák
6b15a8d2af r300g: add "has HiZ" flag, add ZMask regs 2010-06-24 06:10:47 +02:00
Carl Worth
26bbfb7917 glsl2 main: Switch from realloc to talloc_realloc to construct program source.
This closes 1 leak in the glsl-orangebook-ch06-bump.frag test leaving
4 to go, (all of which are inside hash_table.c).
2010-06-23 19:09:56 -07:00
Carl Worth
b3bd77da56 glsl_type: Add a talloc-based new
And hook it up at the two sites it's called.

Note that with this change we still don't use glsl_type* objects as
talloc contexts, (see things like get_array_instance that accept both
a talloc 'ctx' as well as a glsl_type*). The reason for this is that
the code is still using many instance of glsl_type objects not created
with new.

This closes 3 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 55,618

Leaving only 5 leaks to go.
2010-06-23 19:04:45 -07:00
Carl Worth
12c411504c Close memory leaks in glsl_type (constructor and get_array_instance)
Add a talloc ctx to both get_array_instance and the glsl_type
constructor in order to be able to call talloc_size instead of
malloc.

This fix now makes glsl-orangebook-ch06-bump.frag 99.99% leak free:

	total heap usage: 55,623 allocs, 55,615

Only 8 missing frees now.
2010-06-23 19:00:42 -07:00
Carl Worth
dc5811fd0c Close memory leak in lexer.
Simply call talloc_strdup rather than strdup, (using the talloc_parent
of our 'state' object, (known here as yyextra).

This fix now makes glsl-orangebook-ch06-bump.frag 99.97% leak free:

	total heap usage: 55,623 allocs, 55,609 frees

Only 14 missing frees now.
2010-06-23 19:00:42 -07:00
Carl Worth
a9696e79fb main: Close memory leak of shader string from load_text_file.
Could have just added a call to free() to main, but since we're using
talloc everywhere else, we might as well just use it here too. So pass
a new 'ctx' argument to load_text_file.

This removes a single memory leak from all invocations of the
standalone glsl compiler.
2010-06-23 19:00:42 -07:00
Carl Worth
007efe50fd s_symbol: Close memory leak of symbol name.
Easily done now that s_expression is allocated with talloc. Simply
switch from new to talloc_strdup and the job is done.

This closes the great majority (11263) of the remaining leaks in the
glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 55,546 frees
	(was 44,283 frees)

This test is now 99.86% leak-free.
2010-06-23 19:00:42 -07:00
Carl Worth
e01193af32 Close memory leak in ir_call::get_error_instruction.
By propagating a 'ctx' parameter through these calls.

This fix happens to have no impact on glsl-orangebook-ch06-bump.frag,
(since it doesn't trigger any errors).
2010-06-23 19:00:42 -07:00
Carl Worth
522de3f5ec Close memory leaks from generate_constructor_intro
By simply propagating a 'ctx' parameter through these function
calls. (We do this because these function are otherwise only receiving
an exec_list, which is not a valid talloc context.)

This closes 1611 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 44,283 frees
	(was 42,672 frees)
2010-06-23 19:00:42 -07:00
Carl Worth
1660a29547 exec_node: Add new talloc-based new()
And fix all callers to use the tallbac-based new for exec_node
construction. We make ready use of talloc_parent in order to get
valid, (and appropriate) talloc owners for everything we construct
without having to add new 'ctx' parameters up and down all the call
trees.

This closes the majority of the memory leaks in the
glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 42,672 frees
	(was 14,533 frees)

Now 76.7% leak-free. Woo-hoo!
2010-06-23 18:59:35 -07:00
Carl Worth
8f52c9b5fc ast_node: Add new talloc-based new()
And use the talloc-based new for all of the ast objects created by the
parser.  This closes a lot of memory leaks, and will allow us to use
these ast objects as talloc parents in the future, (for things like
exec_nodes, etc.).

This closes 164 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 14,553 frees
	(was 14,389 frees)
2010-06-23 18:15:28 -07:00
Jakob Bornecrantz
9ca563a9a8 nouveau: Remove reference to drm_api 2010-06-24 02:36:30 +02:00
Jakob Bornecrantz
09b73b2a5f i965g: Remove last references to drm_api 2010-06-24 02:30:00 +02:00
Jakob Bornecrantz
44c64596d1 swrastg: Use target-helpers 2010-06-24 02:19:44 +02:00
Jakob Bornecrantz
57d14f2fbb gallium: Use debugging helper in all drm targets 2010-06-24 02:19:43 +02:00
Jakob Bornecrantz
ea1786ec5b gallium: Add debug target helper 2010-06-24 02:19:38 +02:00
Jakob Bornecrantz
59981d418f gallium: Fix scons build 2010-06-24 02:15:50 +02:00
Jakob Bornecrantz
e47d32d721 gallium: Remove drm_api and all references to it 2010-06-24 02:15:50 +02:00
Jakob Bornecrantz
92fde20de3 r600g: Move bootstrap code to target 2010-06-24 02:15:50 +02:00
Brian Paul
7315300fa5 gallium/docs: document TGSI_SEMANTIC_EDGEFLAG 2010-06-23 17:38:58 -06:00
Brian Paul
a544a8a82a gallium/docs: update TEXTURE_SHADOW_MAP MAX_PREDICATE_REGISTERS 2010-06-23 17:38:42 -06:00
Carl Worth
015b3a5115 exec_node: Remove destructor from exec_node and all descendants.
Two of these destructors are non-empty, (s_symbol and s_list), so this
commit could potentially introduce memory leaks, (though, no additional
leaks are found in glsl-orangebook-ch06-bump.frag at least---perhaps
the current code is never calling delete on these classes?).

Going forward, we will switch to talloc for exec_node so we won't need
explicit destrcutors to free up any memory used.
2010-06-23 16:38:05 -07:00
Carl Worth
f961e4458f glsl_symbol_table: Add new talloc-based new()
We take advantage of overloading of the new operator (with an
additional parameter!) to make this look as "C++ like" as possible.

This closes 507 memory leaks when compiling glsl-orangebook-ch06-bump.frag
when measured with:

	valgrind ./glsl glsl-orangebook-ch06-bump.frag

as seen here:

	total heap usage: 55,623 allocs, 14,389 frees
	(was 13,882 frees before)
2010-06-23 16:35:45 -07:00
Carl Worth
2d2561ef96 glsl2 main: Use talloc to allocate _mesa_glsl_parse_state
This is a short-lived object. It exists only for the duration of the
compile_shader() function, (as opposed to the shader and whole_program
which live longer).

The state is created with the same talloc parent as the shader, so
that other allocation can be done with talloc_parent(state) as the
owner in order to attach to a long-lived object.
2010-06-23 16:18:13 -07:00
Carl Worth
be83eb8671 glsl2 main: Use talloc to allocate whole_program struct.
This way, whole_program can be our top-level talloc context object,
allowing us to free the lot with a single talloc_free in the end.
2010-06-23 16:18:13 -07:00
Carl Worth
4b2d32b5b5 ast_node: Remove empty destructor.
This wasn't serving any purpose. So delete it.
2010-06-23 16:16:32 -07:00
Carl Worth
c42e64099b preprocessor: Initialize a potentially uninitialized variable.
My current reading of the relevant static functions suggests that last
is never used without being uninitialized, (we only use it if the
expansion function returned non-NULL and the expansion functions
always set it before returning non-NULL).

Apparently gcc isn't coming to the same conclusion. Initializing this
to NULL nicely quites gcc and will guarantee a nice, early segfault if
my anaylsis turns out to be wrong.
2010-06-23 16:13:31 -07:00
Carl Worth
726faddda2 preprocessor: Remove dead code _token_list_length
As gcc noticed, this function is not currently being used. Good-bye.
2010-06-23 16:13:31 -07:00
Carl Worth
45cbc08438 preprocessor: Remove dead code _string_list_append_list
As gcc noticed, this function is not currently being used. Good-bye.
2010-06-23 16:13:31 -07:00
Carl Worth
60c67e46b1 configure: Ensure that config.h can be safely included multiple times.
Use AH_TOP and AH_BOTTOM macros so that the standard include guard
mechanisms are emitted by autoheader into the generated config.h file.
2010-06-23 16:13:31 -07:00
Carl Worth
a32305a8bd configure: Remove some dead code.
This block of code is useless because a (nearly-equivalent) assignment
is made immediately after. The only difference is the omission of
-Wunreadchable-code in the assignment being used. Presumably, that was
intended to be -Wunreachable-code (without the first 'd'), but since
this hasn't been being used we just drop it.
2010-06-23 16:13:31 -07:00
Carl Worth
a22426dc4c Fix typos of "variable" as "varaible"
One of these was just in a comment. But ther other was in an enum
tag, (which is apparently not being used anywhere yet).
2010-06-23 16:12:53 -07:00
Carl Worth
7fd7104fbb ir_variable: Add some missing initialization to the constructor.
Thanks to valgrind for noticing this problem.
2010-06-23 16:12:53 -07:00
Brian Paul
50b3f2e789 gallium/docs: fix definitions of TGSI_SEMANTIC_POSITION, COLOR 2010-06-23 17:00:23 -06:00
Brian Paul
bf2d2772a2 draw: use gallium's TRUE/FALSE 2010-06-23 17:00:22 -06:00
Eric Anholt
a9d58ad6c9 Fix double usage of the post-inc/dec's temporary pre-inc/dec copy.
Fixes CorrectSwizzle3.frag.
2010-06-23 15:20:29 -07:00
Eric Anholt
2731a739d0 Avoid using the RHS of an assignment twice.
This would fix double-evaluation of assignment RHS expressions,
including possible side effects.
2010-06-23 15:20:29 -07:00
Eric Anholt
959a9ecdd8 get_lvalue_copy doesn't need all the checking of do_assignment(). 2010-06-23 15:20:29 -07:00
Eric Anholt
3e24ef68a9 ast_to_hir: Clone LHS derefs of assignment expressions. 2010-06-23 15:20:29 -07:00
Eric Anholt
8006576b36 ir_function_inlining: Allow inlining of loops and conditionals.
The new cloning code handles them.
2010-06-23 15:20:29 -07:00
Eric Anholt
4b6fd39c89 Add a virtual clone() method to ir_instruction.
This will be used by function inlining, the linker, and avoiding double
usage of the LHS deref chains in ++, *=, and similar operations.
2010-06-23 15:20:29 -07:00
Eric Anholt
02fc4b34e4 Avoid using the same ir_constant 0.0 multiple times in mat constructors. 2010-06-23 15:20:29 -07:00
Vinson Lee
fddd5834ff llvmpipe: Remove unnecessary header. 2010-06-23 15:17:00 -07:00
Jakob Bornecrantz
cf91accc93 nouveau: Move bootstrap code to targets
Well sorta, at least I removed the drm_api dependancy and the
target can layer anything it wants to now.
2010-06-23 23:15:07 +02:00
Kenneth Graunke
bc1097d151 glcpp: Support line continuations within preprocessor directives.
Fixes CorrectPreprocess5.frag.
2010-06-23 14:14:57 -07:00
Kenneth Graunke
186e2634bf glcpp: Make standalone binary use preprocess().
This prevents the two code paths from getting out of sync.  Also, future
work will need the shader source as a string anyway.

Unfortunately, this copies and pastes load_text_file from main.cpp, with
small changes (support for reading from stdin, talloc).
2010-06-23 14:14:57 -07:00
Kenneth Graunke
12a820c9d8 glcpp: Fix "dangerous trailing context" warning.
Flex couldn't be sure whether "def" and "ndef" were part of the #ifdef
and #ifndef patterns or the trailing context of the #if pattern.
2010-06-23 14:14:57 -07:00
Kenneth Graunke
d07bb7b83a Remove comment support from the main lexer.
Now handled by the preprocessor.
2010-06-23 14:14:57 -07:00
Kenneth Graunke
e6ae7afc0c glcpp: Recognize plain "//" as a comment.
Found in glsl-orangebook-ch06-bump.(frag|vert).  This was resulting in
the comments getting passed through to the main compiler's lexer.
2010-06-23 14:14:57 -07:00
Ian Romanick
fa455fc2a5 Generate errors for empty constructors instead of asserting
This causes the following tests to pass:

     glslparsertest/glsl2/constructor-10.vert
2010-06-23 13:58:34 -07:00
Jakob Bornecrantz
10e3b9f4d0 nouveau: Rename winsys file 2010-06-23 22:49:11 +02:00
Ian Romanick
3ed850e91c linker: Update some comments, remove a couple FINISHMEs 2010-06-23 12:18:21 -07:00
Ian Romanick
553dcdcaaf linker: Use InfoLog in assign_attribute_locations
Since the program is now passed in, refactor the parameter list to the
function as well.
2010-06-23 12:14:02 -07:00
Ian Romanick
ed1fe3db3b linker: Refactor parameters to cross_validate_uniforms 2010-06-23 12:09:14 -07:00
Ian Romanick
f36460e1a7 linker: Write errors to info log instead of stdout 2010-06-23 12:07:22 -07:00
Corbin Simpson
e6ee4e1bdf glhd: Simple rasterizer checks.
From the documentation.
2010-06-23 11:34:51 -07:00
Corbin Simpson
666fdc01c4 id, glhd: Unbreak texturing.
Argfl.
2010-06-23 11:25:52 -07:00
Ian Romanick
0e59b2698a linker: Initial implementation of varying slot allocation 2010-06-23 11:24:26 -07:00
Ian Romanick
9342d269a4 linker: Limit attribute allocation to MAX_VERTEX_ATTRIBS 2010-06-23 11:24:26 -07:00
Ian Romanick
6984670f97 linker: Support matrix and array vertex inputs 2010-06-23 11:24:26 -07:00
Ian Romanick
0ad22cd1ce linker: Initial implementation of attribute slot allocation 2010-06-23 11:24:26 -07:00
Ian Romanick
a8ca9cbc69 Import some bits Mesa's mtypes.h 2010-06-23 11:24:26 -07:00
Ian Romanick
4485c5ae78 Import gl_program_parameter and gl_program_parameter_list types from Mesa 2010-06-23 11:24:26 -07:00
Ian Romanick
abee16e8cb linker: Store the par-linked per-stage shaders in the glsl_program 2010-06-23 11:24:26 -07:00
Ian Romanick
019a59b264 linker: Initial implementation of uniform slot allocation 2010-06-23 11:24:21 -07:00
Corbin Simpson
9526305834 glhd: Use an environment variable (GALAHAD) to enable. Off by default. 2010-06-23 11:06:42 -07:00
Ian Romanick
5edf6f98d8 Import gl_uniform and gl_uniform_list types from Mesa 2010-06-23 10:56:04 -07:00
Ian Romanick
8b80e9f9e3 ir_variable: Add query to get number of slots used by a variable 2010-06-23 10:56:04 -07:00
Ian Romanick
57bb893a46 glsl_type: Add method to get number of slots used by a type 2010-06-23 10:56:04 -07:00
Ian Romanick
13e10e43c3 linker: Document what remains to be done 2010-06-23 10:56:04 -07:00
Ian Romanick
ed0626ebc7 ir_variable: Set locations for shader built-in variables 2010-06-23 10:56:03 -07:00
Ian Romanick
69a079aee8 ir_variable: Track the location of uniforms, varings, attributes, etc. 2010-06-23 10:56:03 -07:00
Ian Romanick
371019248e linker: Initial implementation of interstage input / output validation 2010-06-23 10:56:03 -07:00
Ian Romanick
950ceb2bd6 ir_variable: Add method to get string representing interpolation qualifier 2010-06-23 10:56:03 -07:00
Ian Romanick
cc22c5a544 linker: Initial implementation of interstage uniform validation 2010-06-23 10:56:03 -07:00
Ian Romanick
1e8b7a714e ir_constant: Add method to determine if two constants have the same value 2010-06-23 10:56:03 -07:00
Eric Anholt
53e48d3f63 Fix multiple usage of an rvalue in constructor component splitting.
Store the thing in a variable and deref it for each swizzle if we have to.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-06-23 10:55:25 -07:00
Keith Whitwell
64682da8ab draw: don't try to precalculate the pipeline output primitive
We were previously calculating a value which was either the geometry
shader output primitive or the application's input primitive, and
passing that to the various front/middle/back components for use as
the ultimate rendering primtive.

Unfortunately, this was not correct -- if the vcache decomposition
path is active and geometry shaders are *not* active, we can end up
with a third primitive -- specifically the decomposed version of the
input primitive.

Rather than trying to precalculate this, just let the individual
components inform their successors about which primitive type they are
recieving.
2010-06-23 18:10:20 +01:00
Ian Romanick
865cf2d1f5 ir_validate: Use callback functionality in ir_hierarchical_visitor 2010-06-23 09:25:33 -07:00
Ian Romanick
7c09576a97 ir_hierarchical_visitor: Add generic callback functionality 2010-06-23 09:25:28 -07:00
Brian Paul
292eecca8c draw: mask off DRAW_PIPE_FLAG_MASK bits in prim decompose code
Any elt may potentially have flags bits set so mask off those bits
everywhere.

Fixes crashes with demos/gamma.c, redbook/polys.c, etc. but polygon
stippling is still broken.
2010-06-23 09:20:02 -06:00
Chia-I Wu
985c2fca10 egl: Add a test for MESA_EGL_NO_X11_HEADERS.
When the macro is defined, X11 headers will not be included.
2010-06-23 15:15:00 +08:00
Chia-I Wu
78d70ddbbd egl: Add support for EGL_MESA_drm_display.
The extension defines eglGetDRMDisplay that creates an EGLDisplay from a
DRM fd.  Calling eglCreateWindowSurace or eglCreatePixmapSurface with
such displays will generate EGL_BAD_NATIVE_WINDOW or
EGL_BAD_NATIVE_PIXMAP.
2010-06-23 15:14:59 +08:00
Chia-I Wu
f22665df95 egl: Introduce platform displays internally.
This commit introduces type-safe platform displays internally.  A
platform display consists of a generic pointer and an enum that
specifies the platform.

An EGLDisplay is created from a platform display.  Native displays
become platform displays whose platform is determined by
_eglGetNativePlatform().  Platform windows and pixmaps may also be
introduced if needed.
2010-06-23 15:14:59 +08:00
Corbin Simpson
7dc1cf19ac radeong: Disable Galahad for now; breaks texturing. 2010-06-23 00:11:42 -07:00
Corbin Simpson
ee2c6d748d id, glhd: Fix malloc/calloc of struct.
( >&)
2010-06-22 23:40:11 -07:00
Corbin Simpson
a6cc914874 glhd: Add query protection.
Not quite copied from r300g. This is slightly more API-compliant.
2010-06-22 23:11:01 -07:00
Corbin Simpson
aa451d509d glhd: Grab framebuffer state checks from r300g. 2010-06-22 23:00:44 -07:00
Corbin Simpson
3f758d4ed4 glhd: Grab resource_copy_region from r300g. 2010-06-22 22:49:13 -07:00
Corbin Simpson
de7b181e99 glhd: Grab is_format_supported warning from r300g. 2010-06-22 22:49:13 -07:00
Corbin Simpson
7d551eb03d glhd: Add glhd_warn for unconditional stderr output.
Design decision. Bad API errors should never be silenced.

Of course, you can always not use galahad.
2010-06-22 22:49:13 -07:00
Corbin Simpson
75612aa199 id, glhd: Fix segfault with misreferenced pipe member.
And remove the offending member to keep that from happening again.
2010-06-22 22:49:13 -07:00
Corbin Simpson
40faedfe7b targets, radeong: Add Galahad.
Currently unconditional and causes segfaults.
2010-06-22 22:49:13 -07:00
Corbin Simpson
2560978588 configure: Add galahad to default build. 2010-06-22 22:49:13 -07:00
Corbin Simpson
d3ad6fa579 gallium/drivers: Create Galahad from identity.
Galahad is a sanity-checking layer meant to replace the crufty and
scattered sanity checks inside drivers with a robust, non-silenceable,
useful set of warnings and errors that can be used to keep misbehaving
state trackers from going unnoticed.
2010-06-22 22:49:13 -07:00
Brian Paul
61ec205816 mesa: fix attachment error checking for glGetFramebufferAttachmentParameteriv()
This is a follow-on to commit 80dfec3e53.

The valid attachments for glGetFramebufferAttachmentParameteriv() depends
on whether we're querying the default FBO or a user-created FBO.
2010-06-22 21:55:51 -06:00
Marek Olšák
a20fa67448 r300/compiler: allow 1024 instructions in r5xx vertex shaders 2010-06-23 03:58:46 +02:00
Marek Olšák
dd90c3040e r300/compiler: allow 32 temporaries in vertex shaders 2010-06-23 03:57:27 +02:00
Marek Olšák
2f6b4187eb r300/compiler: emulate loops in vertex shaders
It is not perfect, but it is the best we got.
2010-06-23 03:55:20 +02:00
Jakob Bornecrantz
23a915e2cf gallium: Drop sw drm winsys
Last user went away
2010-06-23 03:43:52 +02:00
Jakob Bornecrantz
41e0f6bc2f i965g: Move bootstrap code to targets 2010-06-23 03:43:48 +02:00
Jakob Bornecrantz
0106be903a i965g: Rename winsys file 2010-06-23 03:20:45 +02:00
Jakob Bornecrantz
2b15e37348 i965g: Moved pci_id to winsys struct 2010-06-23 03:20:45 +02:00
Jakob Bornecrantz
bd739e9576 target-helpers: Add inline helpers 2010-06-23 03:20:40 +02:00
Eric Anholt
53cdb7e51d ir_validate: New pass for checking our invariants. 2010-06-22 18:18:30 -07:00
Eric Anholt
e46a454305 ir: Give ir_instruction a print visitor helper.
This avoids spamming each file with includes of ir_print_visitor.h
because someone was doing debugging at some point, and is less typing
when doing debugging.
2010-06-22 18:18:30 -07:00
Eric Anholt
216580dbd7 Hook up texturing in the hierarchical visitor. 2010-06-22 18:18:30 -07:00
Marek Olšák
cbd33e7d3a mesa: fix assertion failure for GL_ALPHA FBOs 2010-06-23 01:39:26 +02:00
Marek Olšák
9ed7325848 r300g: attempt to fix texture corruption on RV505 2010-06-23 01:35:11 +02:00
Marek Olšák
d84bf6d44d r300g: index buffer range checking 2010-06-23 00:20:11 +02:00
Jakob Bornecrantz
e130f524a9 i915g: Revert debug hunks from last commit 2010-06-22 22:55:13 +02:00
Eric Anholt
ac95f2f8c8 Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL. 2010-06-22 12:30:55 -07:00
Ian Romanick
b302359394 Add missing build products to gitignore 2010-06-22 12:24:42 -07:00
Jakob Bornecrantz
ca43b6ec9d i915g: Reduce state emission by using a index bias 2010-06-22 20:04:56 +02:00
Jakob Bornecrantz
255d4f24e0 i915g: Drop fifo code in vbuf 2010-06-22 20:04:56 +02:00
Jakob Bornecrantz
4dd742cec3 i915g: Change state code in vbuf code 2010-06-22 20:04:56 +02:00
Jakob Bornecrantz
abbb1bde06 i915g: Rework debug print code 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
e694f3fd48 i915g: Switch to state atoms 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
ed675bb460 i915g: i915_state_sampler.c code style 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
2e7a90546d i915g: i915_state_immediate.c code style 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
f93e378bfb i915g: i915_state_dynamic.c code style 2010-06-22 20:04:55 +02:00
Jakob Bornecrantz
7dce4f3c27 i915g: Create seperate option for i915g and i965g 2010-06-22 20:04:54 +02:00
Jakob Bornecrantz
ed3d17e14c u_math: Add align function npot alignments 2010-06-22 20:04:54 +02:00
Jakob Bornecrantz
3a3e80ff96 llvmpipe: Ignores 2010-06-22 20:04:32 +02:00
Zack Rusin
b5e381d978 llvmpipe: make geometry shaders and stream output work 2010-06-22 12:58:04 -04:00
Zack Rusin
e433b73dd2 gallium: add a timestamp disjoint query
allows application to not only request the frequency of the TIME_ELAPSED
clock but also to detect if that frequency was consistent throughout the
entire bracketed range of graphics commands.
2010-06-22 12:58:04 -04:00
Zack Rusin
b6c360b46c gallium: add a new query
to figure out if gpu is finished with all of the previously issues commands
2010-06-22 12:58:04 -04:00
Roland Scheidegger
583f241716 st/mesa: remove bogus assertions st_CompressedTexSubImage2D
width/height may not be a multiple of blocksize (small mip levels / npot
textures). This should be handled just fine.
Fixes #28530.
2010-06-22 13:32:25 +01:00
Marek Olšák
eb7ef433bb r300g: optimize the immediate mode emission path a bit 2010-06-22 06:50:23 +02:00
Marek Olšák
bd52246248 r300g: do not emit ZTOP every draw call 2010-06-22 06:50:22 +02:00
Tim Evans
64e32ffb6e swrast: fix incorrect specular highlights on backfaces
See bug 28577 for details.
NOTE: this is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-06-21 17:19:59 -06:00
Brian Paul
b875c02668 docs: add link to 7.9 relnotes 2010-06-21 17:19:59 -06:00
Marek Olšák
59df6725af r300g: fix crash when destroying the context on r3xx-r4xx
FDO bug #28652,
2010-06-21 23:46:38 +02:00
Kenneth Graunke
1b85c46bcf glcpp: Initialize error state. 2010-06-21 13:55:12 -07:00
Kenneth Graunke
332fc47dc0 glcpp: Accept #elif without an expression if the expression doesn't matter.
Issue a warning.  nVidia's compiler seems to accept this; apparently
GCC < 4.4 did as well: http://gcc.gnu.org/gcc-4.4/porting_to.html
2010-06-21 12:41:05 -07:00
Kenneth Graunke
74704e80c6 glcpp: Print to the main compiler's infolog, not stdout. 2010-06-21 12:41:05 -07:00
Kenneth Graunke
4a2bbdacfc Use yy_scan_string and stop caring about shader->SourceLen.
We had to call strlen on the preprocessed source, which seemed a bit
pointless; also, we updated shader->SourceLen but not shader->Source,
which was even more confusing.  Just leave both untouched.
2010-06-21 12:41:05 -07:00
Kenneth Graunke
26e761edb2 glcpp: Rework handling of "defined" operator.
It's now done in the grammar, and as a result, can easily handle
parenthesis.  defined ( identifier ) is now supported.

Fixes glcpp/tests/065-if-defined-parens.c.
2010-06-21 12:41:05 -07:00
Kenneth Graunke
bac0e371e3 glcpp/tests: Add a test for #if defined (identifier)
Previously we only tested #if defined identifier (without parenthesis).
2010-06-21 12:41:05 -07:00
Kenneth Graunke
6587574354 glcpp: Ignore junk tokens at end of #ifdef/#ifndef (with warning)
Both nVidia's compiler and GCC accept this.
Fixes CorrectPreprocess11.frag.
2010-06-21 12:41:05 -07:00
Kenneth Graunke
c9529c4d77 glcpp: Add glcpp_warning for printing warnings to the info log. 2010-06-21 12:41:05 -07:00
Kenneth Graunke
62b4b7785a glcpp: Add boolean 'error' flag.
We used to check if the info log is non-empty, but when we print
warnings, this will no longer be valid.
2010-06-21 12:39:49 -07:00
Kenneth Graunke
33eaa3e0b3 glcpp: Rename "errors" to "info_log."
Eventually, we'll want to be be able to print out warnings as well.
2010-06-21 12:38:39 -07:00
Kenneth Graunke
03ee33809f glcpp: Don't include newlines as part of #version-passthrough.
Fixes glcpp/tests/064-version.c.
2010-06-21 12:31:04 -07:00
Kenneth Graunke
214632f527 glcpp/tests: Add a test for #version followed by #define.
This isn't really a C file, but...that's probably okay.
2010-06-21 12:31:04 -07:00
Kenneth Graunke
8f32221638 glcpp: Fix line and column numbering.
Lines were off by one, and column numbering was completely daft.
2010-06-21 12:31:03 -07:00
Kenneth Graunke
e8e93a4543 glcpp: Remove calls to exit().
Calling exit() would be really bad once integrated into mesa.  Even in
the standalone binary, we want to print the error log first.

Since each case already flags an error, compilation will still fail,
but it may go on (with something fudged) and generate more errors.
2010-06-21 12:31:03 -07:00
Kenneth Graunke
0774523d18 glcpp: Add line locations to "Unterminated #if" error message. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
8a132aa08b glcpp: Add line locations to various mismatched #if error messages. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
dcdf62f1c6 glcpp: Add line locations to "reserved name" error messages. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
ca9e5fce25 glcpp: Print locations in error messages where possible. 2010-06-21 12:31:03 -07:00
Kenneth Graunke
f1e6c069fa glcpp: Introduce new glcpp_error function. 2010-06-21 12:31:02 -07:00
Kenneth Graunke
b78c9ddfbf glcpp: Set locations on tokens. 2010-06-21 11:31:56 -07:00
Kenneth Graunke
db938103c7 glcpp: Set line locations in the lexer. 2010-06-21 11:31:56 -07:00
Kenneth Graunke
465e03ee07 glcpp: Add plumbing to support line locations. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
f70f60739a glcpp: Add %error-verbose. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
77260fc0a0 glcpp: Actually support #ifdef and #ifndef.
Strangely, the lexer never created these tokens, even though the parser
already had code to handle them.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
e0e429fca3 glcpp: Build a reentrant parser. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
b673ff91ab glcpp: Print errors on stdout instead of stderr (non-standalone version).
Otherwise, piglit marks tests as "warn" when the shader was (correctly)
failing.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
3370c5f90b glcpp/tests: Add extra newline at the end of expected output.
This newline at EOF is harmless and generated by the previous commit.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
f82d673648 glcpp: Handle missing newline at EOF.
Fixes CorrectFuncOverload.vert.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
739ba06680 glcpp: Complain about unrecognized directives. 2010-06-21 11:31:55 -07:00
Kenneth Graunke
3b73ea36c4 glcpp: Pass #version, #extension, and #pragma directives through unchanged.
Let the main compiler's lexer/parser handle them.
2010-06-21 11:31:55 -07:00
Kenneth Graunke
04ba86a536 Make the main compiler call the preprocessor.
By using a single function, the main compiler doesn't need to include
glcpp.h, which currently has a lot of details about the preprocessor
internals.  In particular, this prevents the two yacc grammars from
seeing each other, which would be rather messy to sort out.
2010-06-21 11:31:54 -07:00
Kenneth Graunke
2848c4c183 Complain and exit if the given shader file doesn't exist. 2010-06-21 11:27:33 -07:00
Kenneth Graunke
1b1f43e608 glcpp: Add support for lexing from a string.
The standalone binary still reads from stdin, however.
2010-06-21 11:25:50 -07:00
Kenneth Graunke
4c8a1af811 glcpp: Output to a buffer and error log rather than directly printing.
In the standalone case, simply print the buffers when done.
2010-06-21 11:25:50 -07:00
Kenneth Graunke
0656f6b875 glcpp: Fix a case of == where = probably ought to be.
Caught by a GCC warning.
2010-06-21 11:25:50 -07:00
Kenneth Graunke
cbaab7093c Add glcpp to the build. 2010-06-21 11:25:48 -07:00
Kenneth Graunke
254a485c33 Specify %option prefix="glcpp_" in the source code, not the Makefile. 2010-06-21 11:25:30 -07:00
Kenneth Graunke
6f510a49d2 Merge Carl's preprocessor into the glcpp subdirectory. 2010-06-21 11:22:11 -07:00
José Fonseca
197636814e llvmpipe: s/lpfs/shader/ 2010-06-21 14:11:15 +01:00
Marek Olšák
d82f625333 r300g: fix the KIL opcode for r3xx-r4xx (v4) 2010-06-21 04:07:11 +02:00
Marek Olšák
646e9c2fd7 r300g: fix assigning the texture cache region for 1 texture 2010-06-20 14:06:14 +02:00
Vinson Lee
7f6754af25 mapi: Add missing stdlib.h header for malloc declaration. 2010-06-20 01:03:00 -07:00
Vinson Lee
d05e848035 i965g: Fix setup of immediate types for gen4 disasm.
Caught by clang.

Follow-up to commit 070bbd4fcd.
2010-06-20 00:58:52 -07:00
Marek Olšák
e8f2adf8e3 r300g: manually assign texture cache regions
This should fix corrupted texturing on r3xx-r4xx.
2010-06-20 05:30:04 +02:00
Marek Olšák
c85e53bebf r600g: handle DRM_API_HANDLE_TYPE_KMS in buffer_get_handle 2010-06-20 03:59:32 +02:00
Marek Olšák
e4fe18a620 r300g: cleanup buffer_{from, get}_handle 2010-06-20 03:59:32 +02:00
Marek Olšák
6e96cfa39a r300g: cleanup includes 2010-06-20 03:59:31 +02:00
Marek Olšák
a916669468 r300g: texture alignment code cleanup + use special alignment for AA textures 2010-06-20 03:59:28 +02:00
Will Dyson
c674a7eb7f Revert "Fix image_matches_texture_obj() MaxLevel check"
This reverts commit a9ee956511.
It was based on a failure to understand how ther driver allocates
memory, and causes a regression with Celestia.

Set MaxLevel to dstLevel before allocating new mipmap level.

The radeon driver will fail to allocate space for a new level that
is outside of BaseLevel..MaxLevel. Set MaxLevel before allocating.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-06-19 22:09:24 +02:00
Kenneth Graunke
f3eb42d200 Print out the info log if compilation fails. 2010-06-19 11:44:22 -07:00
Kenneth Graunke
b2ba6fac09 Change error/warning functions to print to the info log. 2010-06-19 11:44:21 -07:00
Ian Romanick
ca97bd395f Initialize the shader info log
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-06-19 11:36:15 -07:00
Kenneth Graunke
32cf482215 Make shader a talloc context. 2010-06-19 11:36:15 -07:00
Kenneth Graunke
57d0fc4139 Link against talloc. We're going to be using it. 2010-06-19 11:36:15 -07:00
Marek Olšák
9b2ebcaf4b r300g: fix random pixels appearing / incomplete rendering
This should fix the FDO bug #28612.

Also, these piglit tests have been fixed:
- fbo-copypix
- scissor-copypixels
- copytexsubimage
- texredefine

Finally, 2 flushes in the transfer path are no longer needed.
2010-06-19 20:26:16 +02:00
Marek Olšák
4c76184305 r300g: output floats instead of halfs when passed through translate 2010-06-19 17:20:40 +02:00
Kenneth Graunke
c186b3fbe0 Fix crash when running glsl on a signle fragment shader. 2010-06-19 01:29:17 -07:00
Kenneth Graunke
29e6087481 Rename prog to shader. Less confusing. 2010-06-19 01:29:17 -07:00
Kenneth Graunke
520aad2c3e Fix compile on 64-bit. 2010-06-19 01:29:17 -07:00
Marek Olšák
ce4c9a7f25 r300g: fix clamp and mirror_clamp wrap modes when used with nearest filtering 2010-06-19 06:18:17 +02:00
Marek Olšák
6acd2117c1 r300g: more informative warning in END_CS 2010-06-19 05:15:07 +02:00
Marek Olšák
371ca689ec r300g: improve the ZTOP condition
The real difference here is that ZTOP is now enabled if all stencil ops
are set to KEEP. This improves performance.
2010-06-19 05:14:31 +02:00
Marek Olšák
8ea45a2c0e r300g: fix up the CS size of the rasterizer state 2010-06-19 05:14:18 +02:00
Ian Romanick
c96822cf31 Ensure that shader_in and shader_out are correctly set in declarations 2010-06-18 19:02:45 -07:00
Ian Romanick
93dad36844 glsl_lexer: centroid and invariant are not reserved words in GLSL 1.10 2010-06-18 19:02:45 -07:00
Ian Romanick
8655b7e78a glsl_lexer: Handle interpolation qualifiers 2010-06-18 19:02:45 -07:00
Eric Anholt
6dd6830e6f intel: Finalize the miptree before mapping it for fallbacks.
Fixes segfault in mipmap_view.c demo.  Bug #27212.
2010-06-18 17:44:47 -07:00
Eric Anholt
1ea7a6a44d i965: Fix the name of aa_coverage_slope in the improved AA line params. 2010-06-18 17:44:47 -07:00
Zack Rusin
0ea927b3ad graw: add two examples using new register files 2010-06-18 13:46:44 -04:00
Zack Rusin
101f792a2a gallium: add a temporary array register file
like normal temporaries, but allows to define a number of distinct
arrays, all of which make it explicit that they contain /indexable/
registers.
as a side-effect we're adding support for multi-dimensional destination
registers.
The whole thing looks like this:
DCL TEMPX[0][0..128]  # 0 array with 128 registers

ADD TEMPX[0][0], IN[0], IMM[0]
ADD TEMPX[0][1], IN[0], IMM[0]
ABS OUT[0], TEMPX[0][TEMP[0]]
2010-06-18 13:46:44 -04:00
Zack Rusin
2b221e11da gallium: add a new register file - immediate array
allows one to specify a safe (bound checked) array
filled with immediates. it works just like a const
array and declares much like our current immediates.
2010-06-18 13:46:44 -04:00
José Fonseca
d7f4250333 llvmpipe: Fix pointer dereference after free. 2010-06-18 17:37:37 +01:00
Roland Scheidegger
17c9d7eea7 llvmpipe: limit the number of fragment shader variants kept around
llvmpipe can create a large number of shader variants for a single shader
(which are quite big), and they were only ever deleted if the shader itself
was deleted. This is especially apparent in things like glean
blendFunc where a new variant is created for every different subtest, chewing
up all memory.
This change limits the numbers of fragment shader variants (for all shaders)
which are kept around to a fixed number. If that would be exceeded a fixed
portion of the cached variants is deleted (since without tracking the used
variants this involves flushing we don't want to delete only one).
Always the least recently used variants (from all shaders together) are
deleted.
For now this is all per-context.
Both the number of how many variants are cached (1024) as well as how many
will be deleted at once (1/4 of the cache size) are just rough guesses and
subject to further optimization.
2010-06-18 13:52:17 +01:00
Ian Romanick
c93b8f1d2c linker: Add some function header comments 2010-06-17 20:37:38 -07:00
Ian Romanick
4230cfdb42 TODO: Add note about initializers for constants 2010-06-17 20:37:17 -07:00
Ian Romanick
ce03088406 Allow initializers for uniforms 2010-06-17 20:09:34 -07:00
Ian Romanick
c648a124b2 Don't link shaders by default
Add a command line option to trigger linking.  This "fixes" all the
failing test cases.  Oops.
2010-06-17 19:51:48 -07:00
Marek Olšák
ff8e1452df r300g: fix hardlocks in occlusion queries
Early Z test (=ZTOP) must be disabled before a query is started,
otherwise the GPU is dead. The order of emitted registers matters more
than you might think.

This fixes hardlocks in sauerbraten.
2010-06-18 02:17:29 +02:00
Marek Olšák
3c351e2c83 r300g: debug option for fake occlusion queries 2010-06-18 02:17:17 +02:00
Ian Romanick
832dfa58b2 linker: Initial bits of the linker
No linking is done yet, but some of the semantic checking is done.
2010-06-17 15:04:20 -07:00
Ian Romanick
705fb01b59 Use glsl_program instead of an open-coded vector of shaders 2010-06-17 12:59:45 -07:00
Ian Romanick
3f09c2508a Add glsl_program that is similar to Mesa's gl_shader_program 2010-06-17 12:59:27 -07:00
Ian Romanick
f8fe53ca2e Change glsl_program to glsl_shader 2010-06-17 12:54:24 -07:00
Ian Romanick
6fd9fb23de Compile multiple shaders listed on the command line 2010-06-17 12:22:16 -07:00
Ian Romanick
8ce55dbd92 Extract compilation to a separate routine
Pull all of the code that actually compiles shaders into a separate
function.  Use a glsl_program to track data about the compiled shader.
2010-06-17 12:01:18 -07:00
Ian Romanick
869b6f680f Add glsl_program that is similar to Mesa's gl_program
This will be used as the header for individual compilation units.
2010-06-17 12:00:25 -07:00
Zack Rusin
4320a451a3 draw: implement triangle strips with adjacency in geometry shader 2010-06-17 13:21:38 -04:00
Zack Rusin
f542a2770a draw: implement triangle lists with adjacency support in gs 2010-06-17 12:05:15 -04:00
Zack Rusin
06b854752f draw: fix a silly error 2010-06-17 11:13:18 -04:00
Zack Rusin
eb33dd6954 draw: implement line strip adjacency 2010-06-17 10:54:44 -04:00
Zack Rusin
dc8f64c537 draw: implement lines with adjacency in geometry shaders 2010-06-17 10:48:23 -04:00
Zack Rusin
91862051f9 draw: validate stream output buffers
fixes a crash.
2010-06-17 10:47:10 -04:00
Zack Rusin
c85971da31 draw: fix some unsigned issue
spotted by Vinson
2010-06-17 05:00:50 -04:00
Chia-I Wu
da39d5d3b4 egl: s/EGL_DISPLAY/EGL_PLATFORM/.
A platform is already used to mean a window system in EGL.  No need to
use a different term.
2010-06-17 16:30:26 +08:00
Chia-I Wu
6f690caddc egl: s/_EGL_PLATFORM/_EGL_OS/ and s/POSIX/UNIX/.
A platform means a native window system in EGL.  Use OS that follows
Gallium instead.
2010-06-17 16:05:18 +08:00
Chia-I Wu
8f3e48ee2c st/egl: Build sw/fbdev winsys for fbdev backend.
Target egl_fbdev_swrast.so needs sw/fbdev/libfbdev.a.
2010-06-17 14:13:30 +08:00
Marek Olšák
c3c2023323 r300g: more reasonable MSPOS defaults in error path 2010-06-17 05:14:24 +02:00
Marek Olšák
6771622e22 r300g: fix surface leaks 2010-06-17 05:11:07 +02:00
Corbin Simpson
1e6d51e805 gallium/docs: GLSL glossary entry. 2010-06-16 18:58:18 -07:00
Corbin Simpson
f98c462770 gallium/docs: Explain DFRACEXP/DLDEXP. 2010-06-16 18:58:18 -07:00
Corbin Simpson
dbc95e8edc gallium/docs: Remove unneeded "doubles", add double blurb. 2010-06-16 18:58:18 -07:00
Corbin Simpson
9d4cb6ea36 gallium/docs: Label opcodes by capability bits. 2010-06-16 18:58:18 -07:00
Corbin Simpson
92867dcc42 gallium/docs: R and RG texture swizzles.
We *did* reach an agreement on this a few months ago, and now the docs
reflect it. However, we never got around to UV and Z...
2010-06-16 18:58:18 -07:00
Corbin Simpson
e7d05f1f0d gallium/docs: Flesh out the distro information.
I'm not sure I picked the best voice here. I might come back to this
later.
2010-06-16 18:58:18 -07:00
Corbin Simpson
517a4fb051 gallium/docs: Fix RST error. 2010-06-16 18:58:18 -07:00
Vinson Lee
2412188453 r300g: Fix uninitialized variable warnings in error path. 2010-06-16 17:56:00 -07:00
Vinson Lee
84178547df intel: Remove unnecessary headers. 2010-06-16 17:44:26 -07:00
Zack Rusin
638a80bc07 draw: make sure we correctly iterate over output buffers on stream out
we kept overwriting the first attribute of a vertex in a single-stream-
out-buffer case
2010-06-16 15:56:17 -04:00
Zack Rusin
509ff13d06 graw: remove wrong test 2010-06-16 15:10:21 -04:00
Zack Rusin
0b8e198027 draw: add stream output decomposition file 2010-06-16 15:03:55 -04:00
Zack Rusin
287531772c draw: rewrite stream output to handle all the dark corners
register masks, multiple output buffers, multiple primitives,
non-linear vertices (elts) and stride semantics.
2010-06-16 14:43:56 -04:00
Zack Rusin
668fa68019 translate: don't crash on elts paths with instances 2010-06-16 14:43:56 -04:00
Corbin Simpson
e41ad8d2c5 r300g: Fix up resolve.
Yay for old code.
2010-06-16 11:01:34 -07:00
Corbin Simpson
61145c0d5c r300g: Fix MSAA state size. 2010-06-16 10:54:09 -07:00
Corbin Simpson
8ecca392da r300g: Don't multisample non-32-bpp render targets. 2010-06-16 10:54:09 -07:00
Corbin Simpson
68cefb423a r300g: Finish resolve function. 2010-06-16 10:54:08 -07:00
Corbin Simpson
e163fc0b15 r300g: Add resource resolve function. 2010-06-16 10:54:08 -07:00
Corbin Simpson
a91fea65dc r300g: Moar MSAA setup.
Need to just add the resolve, then go switch to new DRM and test.
2010-06-16 10:54:08 -07:00
Corbin Simpson
3784b0fa69 r300g: Fix indentation.
I could *not* let this slide since I'm on a 78-char-wide terminal.
2010-06-16 10:54:08 -07:00
Corbin Simpson
5c58618406 r300g: Old MSAA code from before gallium-msaa. 2010-06-16 10:54:06 -07:00
Alan Hourihane
867478b6f6 util: add alloc check 2010-06-16 18:10:34 +01:00
Alan Hourihane
51729b5119 draw: add alloc check 2010-06-16 18:02:21 +01:00
Henri Verbeet
71646528da r600: GL_COORD_REPLACE state is only relevant when point sprites are enabled. 2010-06-16 12:47:28 -04:00
Marc
5552dffa39 r600: fix warnings 2010-06-16 12:47:28 -04:00
Dan Nicholson
cbf30fce32 osmesa: always build standalone for internal symbols
When building OSMesa and xlib GL, the resulting OSMesa would be linked
against libGL instead of the internal mesa libraries. However, when
building with -fvisibility=hidden, some of the internal functions used
in OSMesa could not be resolved through libGL.

Instead, always build OSMesa standalone without linking against libGL.
This has the advantage that OSMesa is always built the same way, but it
means that disk space is wasted when libGL is installed since both
libraries will contain the internal objects.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Tom Fogal <tfogal@alumni.unh.edu>
2010-06-16 09:23:17 -07:00
Alan Hourihane
1c377cea10 draw: handle some out of memory conditions 2010-06-16 12:27:53 +01:00
Zack Rusin
9829ec2ad8 graw: add a gs test for non-sequential inputs 2010-06-16 05:33:46 -04:00
Ian Romanick
298586fd6c Add TODO list
Don't want to forget anything, no do we?
2010-06-15 17:42:16 -07:00
Vinson Lee
88308ea173 draw: Remove unnecessary headers. 2010-06-15 17:34:59 -07:00
Zack Rusin
3560652ccf gs: make sure we end primitives when finishing executing shaders 2010-06-15 16:37:32 -04:00
Zack Rusin
215e10ac26 draw/gs: make sure gs works with elts and doesn't overrun the buffer 2010-06-15 16:10:18 -04:00
Ian Romanick
81e1747ac5 Printing LIR is optional 2010-06-15 12:51:38 -07:00
Ian Romanick
7babbdbd82 Printing the AST is optional 2010-06-15 12:50:53 -07:00
Ian Romanick
fc0ef6451c Minor bits of code rearranging 2010-06-15 12:20:49 -07:00
Ian Romanick
2b36895f0c Infer shader type from suffix on filename 2010-06-15 12:00:37 -07:00
Kristian Høgsberg
80dfec3e53 mesa: Allow querying the system FBO in GetFramebufferAttachmentParameteriv
If the default framebuffer is bound to <target>, then
        <attachment> must be one of FRONT_LEFT, FRONT_RIGHT, BACK_LEFT,
        BACK_RIGHT, AUXi, DEPTH_BUFFER, or STENCIL_BUFFER, identifying a
        color buffer, the depth buffer, or the stencil buffer, and
        <pname> may be FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE or
        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.

as well as these <pname> values

        FRAMEBUFFER_ATTACHMENT_RED_SIZE,
        FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
        FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
        FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
        FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
        FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
        FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, or
        FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.

https://bugs.freedesktop.org/show_bug.cgi?id=28551
2010-06-15 13:28:38 -04:00
Zack Rusin
726f18ee69 graw: test multiple cb's in geometry shaders 2010-06-15 12:14:18 -04:00
Zack Rusin
ec82e9fbfa graw: fix setup for multiple constant buffers 2010-06-15 12:01:47 -04:00
Zack Rusin
bf577393c7 draw: run the pipeline with the correct number of verts
verts per primitive, not total count
2010-06-15 09:12:20 -04:00
Zack Rusin
9cf5e814b9 draw: fix primitive indexing in the pipeline
spotted by Keith
2010-06-15 09:12:20 -04:00
Zack Rusin
a192b5eeaf draw: finish the new pipeline setup
Keith came up with a new way of running the pipeline which involves passing
a few info structs around (for fetch, vertices and prims) and allows us
to correctly handle cases where we endup with multiple primitives generated
by the pipeline itself.
2010-06-15 09:12:20 -04:00
Zack Rusin
92e521a799 softpipe/gs: fix a crash when a gs isn't present 2010-06-15 09:12:19 -04:00
Keith Whitwell
b85a361ccb draw wip 2010-06-15 09:12:19 -04:00
Vinson Lee
5d4d4b2134 i965: Remove unnecessary header. 2010-06-14 17:50:15 -07:00
Ian Romanick
54992c30b0 Remove ability to read "IR shaders" from stand-alone compiler 2010-06-14 14:47:26 -07:00
Ian Romanick
61d4aa041f Move stand-alone compiler main routine to main.cpp 2010-06-14 14:46:09 -07:00
Marek Olšák
0452d52ae3 r300g: initialize US_CODE_BANK on r4xx 2010-06-14 23:39:56 +02:00
Eric Anholt
7dcba1af9d i965: Fix surface state dumping with INTEL_DEBUG=batch.
I broke this with the state streaming changes.
2010-06-14 14:03:56 -07:00
Zhenyu Wang
9a1ce46fce i965: correct the gen6 line stipple enable define. 2010-06-14 14:03:56 -07:00
Eric Anholt
44ad62b86c intel: Remove long-dead comment about releasing texture heaps.
BOs are stored in the bufmgr, which is freed as part of the screen
structure.
2010-06-14 14:03:56 -07:00
José Fonseca
4b383054d3 gallivm: Omit references to NoFramePointerElimNonLeaf
It was added after 2.7.
2010-06-14 17:36:17 +01:00
José Fonseca
27fafa2587 util: Use int type for format field width.
As suggested by gcc warning.
2010-06-14 17:11:21 +01:00
José Fonseca
4d2407699b gallivm: Override some of the default target options.
In particular:
- enable LLVM <-> GDB integration for JIT code
- disable frame-pointer elimination on debug/profile builds
- enable fast-math.
2010-06-14 16:51:47 +01:00
José Fonseca
21a9ef12bf gallivm: Use func_to_pointer(). 2010-06-14 16:50:40 +01:00
José Fonseca
91bbe466c7 util: Add a func_to_pointer util function too. 2010-06-14 16:50:39 +01:00
Jakob Bornecrantz
0ee7a17d0c swrastg: Fix glue file 2010-06-14 17:37:21 +02:00
Zack Rusin
5d5fa34757 graw: small fixups for the gs examples 2010-06-14 10:49:16 -04:00
Marek Olšák
8ad410dc13 r300g: fix uploading RC state shader constants on r3xx
I've messed this up in one of my previous commits.

Reported-by: Igor Murzov
2010-06-14 13:03:13 +02:00
Marek Olšák
1c0e5ba9f1 r300g: drop begin_cs/end_cs
I have had a look at the libdrm sources and they just contain more or less
the same checking we do in macros, and begin_cs may realloc the CS buffer
if we overflow it, which never happens with r300g. So these are pretty
much useless.

There is a small but measurable performance increase by dropping the two
functions.
2010-06-14 12:46:38 +02:00
Marek Olšák
cf3778bae0 r300g: rewrite occlusion queries
The previous implementation had issues with queries spanning over several
command streams as well as using a very large number of queries.

This fixes flickering in Enemy Territory: Quake Wars. The driver now renders
everything correctly in this game and the graphics is awesome.
2010-06-14 12:46:38 +02:00
Marek Olšák
824c1f6a4a r300g: emit viewport state as a dword table 2010-06-14 12:46:37 +02:00
Marek Olšák
8874c9d7a3 r300g: subclass pipe_surface 2010-06-14 12:46:37 +02:00
Marek Olšák
39826a2036 r300g: simplify reloc macros 2010-06-14 12:46:37 +02:00
Marek Olšák
c1f18bff3e r300g: count CS dwords on debug builds only 2010-06-14 00:52:11 +02:00
Marek Olšák
f558bcb397 r300g: optimize emission of fragment shader constants 2010-06-13 17:43:39 +02:00
Marek Olšák
3da6487115 r300g: turn fragment shader into a CB 2010-06-13 17:43:39 +02:00
Marek Olšák
0a44efaeb9 r300g: turn depth stencil state into a CB 2010-06-13 17:43:39 +02:00
Marek Olšák
f803211629 r300g: turn clip state into a CB 2010-06-13 17:43:39 +02:00
Marek Olšák
9dd50993c6 r300g: turn blend color into a CB 2010-06-13 17:43:38 +02:00
Marek Olšák
cd891648d4 r300g: turn blend state into a CB 2010-06-13 17:43:38 +02:00
Marek Olšák
a062156bb2 r300g: add API for building command buffers
The idea is to build a hardware command buffer for every CSO and memcpy
the buffer to a command stream at bind time (or dirty-state-emission time,
to be precise).
2010-06-13 17:43:38 +02:00
Marek Olšák
7ca24dfa6d r300g: inline FLUSH_CS
The fewer macros, the better.
2010-06-13 17:43:38 +02:00
Marek Olšák
98f67a6bbd r300g: reorder CS macros and document them a little 2010-06-13 17:43:38 +02:00
Marek Olšák
8f13e2bda1 r300g: drop DBG_CS
I'd like the CS macros to be as lightweight as possible for performance
reasons.
2010-06-13 17:43:38 +02:00
Marek Olšák
7005feabcd r300g: inline CHECK_CS 2010-06-13 17:43:38 +02:00
Marek Olšák
ae182296ce r300g: replace r300_cs_info with simplier get_cs_free_dwords 2010-06-13 17:43:38 +02:00
Marek Olšák
7d5230ce90 r300g: fix multiple render targets
This fixes tests/drawbuffers.
2010-06-13 17:43:38 +02:00
Marek Olšák
ea0ec0b48e r300g: remove r300_state.h 2010-06-13 17:43:38 +02:00
Marek Olšák
cb17f5ee75 r300g: move two-sided stencilref fallback to its own file 2010-06-13 17:43:37 +02:00
Marek Olšák
aa5422327d r300g: move index buffer translate functions to their new home 2010-06-13 17:43:37 +02:00
Marek Olšák
028459b0bf r300g: add fallback for unaligned/unsupported vertex stride/offset/format
There is a problem though, the translate module cannot emit half float
vertices.
2010-06-13 17:43:37 +02:00
Marek Olšák
1384a7bcca r300g: upload only vertex buffers referenced by vertex elements 2010-06-13 17:43:37 +02:00
Eric Anholt
1dc573a881 i965: Fix gen6 front cull mode. 2010-06-12 21:47:32 -07:00
Zhenyu Wang
5dbbb48f46 i965: Use the new message header format for FF_SYNC on gen6. 2010-06-12 21:47:32 -07:00
Zhenyu Wang
881ec3a814 i965: Add support for math instructions in the gen6 WM. 2010-06-12 21:47:32 -07:00
Zhenyu Wang
7ba2ecb32b i965: Set the correct WM GRF start reg on gen6. 2010-06-12 21:47:31 -07:00
Eric Anholt
0f59b9a95d i965: Update gen6 paths for the streaming rework. 2010-06-12 21:47:31 -07:00
Eric Anholt
7ad26b0030 i965: Stream out CC unit state.
before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   31.791   32.287   1.11%    6/6
after:
[  0]       gl            firefox-talos-gfx   31.198   31.675   0.96%    6/6
2010-06-12 21:47:31 -07:00
Zack Rusin
db05972807 draw/gs: copy the outputs only if we emitted something 2010-06-12 10:45:42 -04:00
Zack Rusin
1551b4da8c softpipe: small cleanup 2010-06-12 10:45:42 -04:00
Joakim Sindholt
60cfed6c70 r300/compiler: fix scons build 2010-06-12 15:40:14 +02:00
Vinson Lee
b6cfca42e3 i965: Remove unnecessary header. 2010-06-12 01:44:43 -07:00
Vinson Lee
e0b211d07c scons: Disable i965g build if using MSVC.
i965g uses C99 constructs that are not supported by MSVC.
2010-06-11 18:43:58 -07:00
Vinson Lee
de51485000 scons: Disable i915g build if using MSVC.
i915g uses C99 constructs that are not supported by MSVC.
2010-06-11 18:42:57 -07:00
Ian Romanick
824b659d91 ir_constant: Eliminate 'void *' constructor
All of the places that had been using the (glsl_type *, void *)
constructor were actually passing an ir_constant_data for the
'void *'.  The code can be greatly simplified by replacing this
constructor with a (glsl_type *, ir_constant_data *) constructor.
This should also help prevent one class of invalid uses of the old
constructor.
2010-06-11 17:12:40 -07:00
Ian Romanick
b74b43e4ba Use statically typed ir_constant constructors wherever possible 2010-06-11 17:12:23 -07:00
Ian Romanick
4976e57448 ir_reader: Use 'union ir_constant_data' in read_constant 2010-06-11 17:12:23 -07:00
Ian Romanick
f8b88bea0f ir_constant_visitor: Type of constant result is same as original expression
The type of the resulting constant must be the same as the type of the
original expression.  The changes to the code require that the case
where an unhandled expression is received, and there really shouldn't
be any of these, must be an exit point.
2010-06-11 17:12:12 -07:00
Ian Romanick
083d75a942 ir_constant_visitor: Types of ir_binop_{equal,nequal} must match
The types must match exactly, so there is no reason to check the types here.
2010-06-11 17:11:14 -07:00
Ian Romanick
4daaab6040 ir_constant_visitor: Use 'union ir_constant_data' in expression handler 2010-06-11 17:11:06 -07:00
Ian Romanick
0bb70a30d5 ir_constant_visitor: Use 'union ir_constant_data' instead of open-coded version 2010-06-11 15:49:49 -07:00
Ian Romanick
be1d2bfdea Matrix and vector constructors with a single constant scalar are constant 2010-06-11 15:48:26 -07:00
Ian Romanick
39d6dd3537 ir_constant_visitor: Handle bool-to-int and int-to-bool 2010-06-11 15:43:59 -07:00
Ian Romanick
7825d3d157 Treat ?: with all constant subexpressions as a constant expression 2010-06-11 15:43:59 -07:00
Ian Romanick
0ad76c6767 Rearrange code in HIR conversion of ?: operator
There are no functional changes.  Code is just moved arround.  This
prepares for the next set of changes that do change the functionality.
2010-06-11 15:43:59 -07:00
Ian Romanick
c2ba619092 ir_constant_visitor: Handle constant swizzles 2010-06-11 15:43:59 -07:00
Ian Romanick
9b92af9ebc ir_constant_visitor: Handle array access of constant vectors and matrices 2010-06-11 15:43:56 -07:00
Ian Romanick
2cf0969de5 Remove redundant type checks for constant constructors
All of the cases (e.g., arrays and structures) that were being
filtered by these tests were already filtered by the earlier
is_numeric and is_boolean tests.
2010-06-11 15:37:34 -07:00
Ian Romanick
1a872b1af3 Do simple constant folding while processing function call parameters 2010-06-11 15:37:34 -07:00
Ian Romanick
253dedeb6c ir_constant_visitor: Handle dereferences of constant records 2010-06-11 15:37:27 -07:00
Ian Romanick
b94c29a47b ir_constant: Add get_record_field query 2010-06-11 15:36:05 -07:00
Ian Romanick
eeedd355cf Add glsl_types::field_index to get the location of a record field 2010-06-11 13:51:42 -07:00
Ian Romanick
ab92d0e53e Detect and process constant record constructors 2010-06-11 13:51:42 -07:00
Ian Romanick
c077131c0f Move parameter processing out of match_function_by_name
Eventually code that processes constant structure constructors will
need to use the processed list of parameters.
2010-06-11 13:51:42 -07:00
Ian Romanick
d4b33edbd0 ir_constant_visitor: Use clone to create a constant from a variable reference 2010-06-11 13:51:42 -07:00
Ian Romanick
710919fd7c ir_constant: Support constant structures in clone 2010-06-11 13:51:42 -07:00
Ian Romanick
7f1ab834d7 ir_constant: Add storage for multiple constants for arrays and records 2010-06-11 13:51:42 -07:00
Ian Romanick
93073551f9 Add glsl_type::is_record query 2010-06-11 13:51:42 -07:00
Ian Romanick
7dc2b71a89 Add float/bool conversion to ir_constant_expression.cpp. 2010-06-11 13:51:42 -07:00
Ian Romanick
00eb466e38 Constant-fold constructor parameters after type conversion
This causes the following tests to pass:

         glslparsertest/shaders/CorrectMatComma2.frag

One of the incorrect errors in glslparsertest/shaders/CorrectComma.frag
is also eliminated.
2010-06-11 13:51:42 -07:00
Ian Romanick
9e08d019ce Make constructors with all constant parameters generate in-line constants 2010-06-11 13:51:09 -07:00
Ian Romanick
756a3fac4f Construct an ir_constant from a list of ir_constant values 2010-06-11 13:51:09 -07:00
Ian Romanick
7c40a32054 Add queries to determine if a node is a list sentinal 2010-06-11 13:51:09 -07:00
Ian Romanick
31881908eb Add methods to ir_constant to get scalar components in a particular type 2010-06-11 13:51:09 -07:00
Ian Romanick
c9cb1032be Derefence components of constants smarter
During generation of calls to constructors, derefernce constants by creating
new constants instead of creating dereferences.
2010-06-11 13:51:09 -07:00
Ian Romanick
989cfc432e Construct an ir_constant from a scalar component of another ir_constant 2010-06-11 13:51:09 -07:00
Ian Romanick
565185cd8f Use ir_unop_b2i when converting a bool-to-int and add a missing break
The previous code just had dumb cut-and-paste errors.
2010-06-11 13:49:00 -07:00
Tom Stellard
3eca311b72 r300/compiler: Handle more complex conditionals in loops. 2010-06-11 22:06:59 +02:00
Tom Stellard
bde34a76b5 r300/compiler: Fix warning. 2010-06-11 22:06:59 +02:00
Tom Stellard
f7269cf26a r300/compiler: Handle SGT and SLE at the beginning of loops. 2010-06-11 22:06:59 +02:00
Tom Stellard
0125f5270b r300/compiler: Verify assumptions about opcode types. 2010-06-11 22:06:59 +02:00
Tom Stellard
6f1b6814bc r300/compiler: Unroll loops that decrement the counter.
e.g. for(i=10; i>0; i--)
2010-06-11 22:06:58 +02:00
Tom Stellard
0f1109ce36 r300/compiler: Unroll loops that have a constant number of iterations.
This only works with for loops that increment the counter.
e.g. for(i=0; i<10; i++)
2010-06-11 22:06:58 +02:00
Tom Stellard
622fd4d061 r300/compiler: Implement simple loop emulation
The loop emulation unrolls loops as may times as possbile while still
keeping the shader program below the maximum instruction limit.  At this
point, there are no checks for constant conditionals.  This is only enabled
for fragment shaders.
2010-06-11 22:06:58 +02:00
Eric Anholt
108264e859 i965: Remove the surface key used to generate constant surfaces.
We had to fill out all that junk when using the cache, but no more.
2010-06-11 12:21:23 -07:00
Eric Anholt
34c82804ed i965: Warning fixes from the i965-streaming merge. 2010-06-11 12:09:26 -07:00
Zack Rusin
53bd9796a1 gallium/softpipe/draw: support samplers in geometry shaders 2010-06-11 13:31:52 -04:00
Zack Rusin
2396967038 tgsi: support 2d indirect addressing 2010-06-11 10:35:24 -04:00
Eric Anholt
27bc2de546 i965: Use the state base address to avoid relocations.
This makes the binding table code simpler, and is required for gen6,
which requires binding table addresses to be under 64k offset from the
surface state base addr.

No significant change in performance on firefox-talos-gfx.
2010-06-11 00:16:15 -07:00
Eric Anholt
8ad3fdc967 i965: GC the last two arguments to brw_cache_data.
Now that the binding table is streamed indirect state, they were
always NULL/0.
2010-06-11 00:16:15 -07:00
Eric Anholt
309c011641 i965: Remove brw_state_cache_bo_delete now that it's unused again. 2010-06-11 00:16:09 -07:00
Eric Anholt
178414eba4 i965: Remove caching of surface state objects.
It turns out that computing a 56 byte key to look up a 20-byte object
out of a hash table was some sort of a bad idea.  Whoops.

before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   37.799   38.203   0.39%    6/6
after:
[  0]       gl            firefox-talos-gfx   34.761   34.784   0.17%    5/6
2010-06-11 00:15:59 -07:00
Eric Anholt
73de09f265 i965: Convert the binding table to streamed indirect state.
This slightly reduces reduces cairo-gl firefox-talos-gfx runtime on my
Ironlake:
before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   38.236   38.383   0.43%    5/6
after:
[  0]       gl            firefox-talos-gfx   37.799   38.203   0.39%    6/6

It turns out the cost of caching these objects and looking them up in
the cache again is greater than the cost of just computing the object
again, particularly when the overhead of having a separate BO to pin
is removed.

(Those that are paying close attention will note that this is a
reversal of the path I was moving the driver in a couple of years ago.
The major thing that has changed is that back then all state was
recomputed when we wrapped the streaming state buffer, including
recompiling our precious programs.  Now, we're uncaching just the
objects that are cheap to compute, and retaining caching of expensive
objects)
2010-06-11 00:15:56 -07:00
Eric Anholt
118a47623a i965: Split constant buffer setup from its surface state/binding state.
This was bothering me when redoing the binding tables.
2010-06-11 00:15:56 -07:00
Eric Anholt
321014156b i965: Add support for streaming indirect state rather than caching objects. 2010-06-11 00:15:56 -07:00
Eric Anholt
f5bb775fd1 i965: Set the CC VP state immediately on state change.
The cache lookup of these two little floats was .12% of total CPU time
on firefox-talos-gfx because we did it any time commonly-changed state
changed.  On the other hand, updating the CC VP bo immediately whenver
CC VP state changes is a .07% overhead due to putting a driver hoook
in glEnable().
2010-06-11 00:15:56 -07:00
Eric Anholt
315ef0312a i965: Update old comment about state cache sizing. 2010-06-11 00:15:56 -07:00
Eric Anholt
3b3278519a i965: Move no_batch_wrap assertion out across the area we're trying to verify.
It's more likely that we wrap badly in state setup than in the little
primitive packet.
2010-06-11 00:15:55 -07:00
Brian Paul
0a48949a11 i965: remove UseProgram driver callback
It just duplicated the default/core Mesa behaviour.
2010-06-10 23:33:51 -06:00
Brian Paul
ec2b92f98c mesa: rename src/mesa/shader/ to src/mesa/program/ 2010-06-10 23:23:13 -06:00
Chia-I Wu
411bba3446 docs: Update EGL doc.
Update for recent removal of demos and additions of new displays and
functions.
2010-06-11 12:55:09 +08:00
Chia-I Wu
ebed500fae st/egl: Do not build non-working driver combinations.
The KMS backend requires a hardware pipe driver.  Do not build
egl_kms_swrast.  Also, only build egl_fbdev_swrast for fbdev backend.
It is a pure software backend.
2010-06-11 12:55:09 +08:00
Chia-I Wu
71580edc01 st/egl: Add fbdev backend.
The backend is pure software.  It implements EGL_MESA_screen_surface
extension, and is kept simple by only exporting the current mode.
2010-06-11 12:55:09 +08:00
Brian Paul
f1c5043f94 mesa: move shader/slang/* sources to main/slang/*
Reduce the source tree depth a bit.
2010-06-10 22:48:16 -06:00
Brian Paul
7936e06657 mesa: move nvprogram.[ch] to main/ 2010-06-10 22:37:31 -06:00
Brian Paul
412cddf954 mesa: move arbprogram.[ch] to main/ 2010-06-10 22:32:21 -06:00
Brian Paul
70c8d29b6b mesa: move atifragshader.[ch] to main/ 2010-06-10 22:24:45 -06:00
Brian Paul
936605fc8a mesa: move uniforms.c to main/ 2010-06-10 22:24:37 -06:00
Chia-I Wu
ce0c837f60 winsys: Add fbdev software winsys.
This is a simple winsys that mmap()s the framebuffer device and
memcpy()s the contents of display targets to the framebuffer device for
displaying.
2010-06-11 12:23:38 +08:00
Brian Paul
a37b2219d6 mesa: refactor shader api / object code
Remove the unneeded ctx->Driver hooks for shader-related functions.
Move state and API-related things into main/.
2010-06-10 20:32:57 -06:00
Brian Paul
050eed095a i965: remove UseProgram driver callback
It just duplicated the default/core Mesa behaviour.
2010-06-10 20:06:45 -06:00
Vinson Lee
628cf02d67 st/egl: Remove unnecessary header. 2010-06-10 15:52:04 -07:00
Vinson Lee
77cbf32e61 intel: Remove unnecessary header. 2010-06-10 15:47:37 -07:00
Zack Rusin
9896b7ebeb draw: forgot to add a file 2010-06-10 15:25:30 -04:00
Zack Rusin
29639932f7 draw: rewrite geometry shader pipeline
done to handle strips correctly as inputs - we need to decompose
the strips
2010-06-10 15:23:01 -04:00
Zack Rusin
226ff53e63 gs: give our test an option of rendering a strip 2010-06-10 13:20:15 -04:00
Zack Rusin
4d0baa73c9 draw: geometry shader fixes
don't overwrite the inputs and make sure the correct primitive
is used on entry
2010-06-10 13:07:27 -04:00
Zack Rusin
9ef6d34f7e draw: make sure that the gs never outputs more data than we allocated for 2010-06-10 05:15:55 -04:00
Vinson Lee
9be40de087 r300g: Fix memory leak on error path. 2010-06-10 00:33:25 -07:00
Eric Anholt
6383428588 i965: Add support for GL_ALPHA framebuffer objects. 2010-06-10 00:40:00 -07:00
Eric Anholt
262cdbd957 mesa: Allow GL_ALPHA FBOs with ARB_framebuffer_object.
Drivers still reject them today, but cairo would like to use these.
2010-06-10 00:22:01 -07:00
Eric Anholt
ceba688cb5 swrast: When reading from a 0-bits r,g,b channel, return 0 not 1.
It looks like we were reading a fractional value, multiplying by an
enormous negative value, then stuffing that value into a bitfield
assuming it was already clamped.  This becomes relevant for GL_ALPHA
or R/RG FBOs.
2010-06-10 00:22:00 -07:00
Kenneth Graunke
332920a940 Remove linux_list in favor of exec_list. 2010-06-09 17:05:14 -07:00
Kenneth Graunke
75393ee16b Add forgotten autogenerated EXT_texture_array_fs folder. 2010-06-09 16:46:09 -07:00
Kenneth Graunke
af05703826 Implement 1.30 int/uint variants of min/max/clamp. 2010-06-09 16:14:45 -07:00
Kenneth Graunke
c3bf0cbefc texture_builtins.py: The unsigned integer type is "uint", not "unsigned"
This doesn't actually affect anything yet, but is good to fix anyway.
2010-06-09 16:11:36 -07:00
Kenneth Graunke
c9aabc866f Implement 1.30 hyperbolic trig builtins (sinh, cosh, tanh). 2010-06-09 16:08:36 -07:00
Kenneth Graunke
1d0e07c420 Implement 1.20 'transpose' builtin. 2010-06-09 15:56:46 -07:00
Kenneth Graunke
43ff6fc4ae Implement 1.20 'outerProduct' builtin. 2010-06-09 15:47:34 -07:00
Kenneth Graunke
0c8ffadc8c Implement matrixCompMult builtin - the last of the 110 builtins. 2010-06-09 15:35:54 -07:00
Kenneth Graunke
d6a32d4b54 ir_constant_visitor: Add support for dFdx and dFdy operations.
If the argument is a constant expression...it's not changing per pixel,
so the result is simply 0.
2010-06-09 15:23:40 -07:00
Kenneth Graunke
b843c7a20c Implement dFdx, dFdy, and fwidth via new expression opcodes. 2010-06-09 14:44:39 -07:00
Kenneth Graunke
cbd881da3f Implement 'refract' builtin. 2010-06-09 14:44:39 -07:00
Eric Anholt
94731797c6 intel: Use the blitter to upload TexSubImage data to busy textures.
This avoids many pipeline stalls in cairo-gl.
[ # ]  backend                         test   min(s) median(s) stddev. count
Before:
[  0]       gl            firefox-talos-gfx   36.799   36.851   2.34%    3/3
[  0]       gl            firefox-talos-svg   33.429   35.360   3.46%    3/3
After:
[  0]       gl            firefox-talos-gfx   35.895   36.250   0.48%    3/3
[  0]       gl            firefox-talos-svg   26.669   29.888   5.34%    3/3

This doesn't avoid all the pipeline stalls because the kernel reports
!busy for buffers on the flushing list.  That should be fixed in .36.
2010-06-09 14:23:46 -07:00
Eric Anholt
503eb57a00 i965: Avoid calloc/free in the CURBE upload process.
In exchange we end up with an extra memcpy, but that seems better than
calloc/free.  Each buffer is 4k maximum, and on the i965-streaming
branch this allocation was showing up as the top entry in
brw_validate_state profiling for cairo-gl.
2010-06-09 14:17:52 -07:00
Kenneth Graunke
3ffedf1249 Fix some typing issues in asin.
CorrectFunction.vert now passes.
2010-06-09 14:15:04 -07:00
Kenneth Graunke
c476ba8fe2 Add a completely bogus implementation of the noise[1234] builtins.
idr suggested this.  Eventually we will need a real one.
2010-06-09 14:07:35 -07:00
Kenneth Graunke
855fcb22c1 Implement 'acos' builtin.
This is tacked on to the end of the 'asin' file because acos calls asin,
whech means asin needs to be defined first.  Alphabetical order fail.
2010-06-09 13:52:32 -07:00
Carl Worth
2fb30a2e49 Merge remote branch 'kwg/fixes' 2010-06-09 13:29:37 -07:00
Kenneth Graunke
539f29323f Implement 'faceforward' builtin. 2010-06-09 13:27:16 -07:00
Kenneth Graunke
29b22287fe Implement 'distance' builtin. 2010-06-09 13:17:00 -07:00
Kenneth Graunke
cdf1726ffd Add remaining signatures for 'clamp' builtin. 2010-06-09 13:10:00 -07:00
Kenneth Graunke
76796ed66f Add remaining signatures for 'max' builtin. 2010-06-09 13:05:40 -07:00
Kenneth Graunke
47d44c877e Add remaining signatures for 'min' builtin. 2010-06-09 13:04:16 -07:00
Kenneth Graunke
2438f64e63 Add remaining signatures for 'mod' builtin. 2010-06-09 13:04:03 -07:00
Marek Olšák
45fb47d50c r300g: try harder to create a transfer object
I was told this wouldn't help to fix the FDO bug #28443, but still,
it's a harmless last resort.

Also, linear textures safely fallback to an unpipelined transfer here.
2010-06-09 21:43:31 +02:00
Zack Rusin
1d11eac93f draw: make sure geometry shader correctly iterates the output buffer 2010-06-09 15:02:08 -04:00
Marek Olšák
f571a569a0 r300g: debug output texture size 2010-06-09 20:22:52 +02:00
Marek Olšák
950be3fa3c r300g: return NULL texture early if buffer_create fails 2010-06-09 20:17:27 +02:00
Kenneth Graunke
b97efa5db5 ir_function_cloning_visitor: Add support for ir_texture. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
8331d48948 Don't call _mesa_glsl_initialize_types for every builtin function.
This was clearly wrong; types are now only initialized once.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
57503a22d7 Only initialize types after #extension directives have been processed.
Since _mesa_glsl_initialize_types add types for various extensions, we
can't call it until after processing "#extension foo : disable" lines.

Fixes tex_rect_02.frag.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
4b0029a97d Commit output of texture_builtins.py and refresh builtin_function.cpp. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
5e65c1ccae texture_builtins.py: Support the EXT_texture_array extension. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
0d80f71867 Add EXT_texture_array support. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
cc249f79e7 generate_builtins.pl: Support stage-specific builtins even for extensions. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
c34a624c9f texture_builtins.py: Fixes for Array variants.
The array layer is now included as part of the texture coordinate.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
538da12092 texture_builtins.py: Add support for 130 Proj variants. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
b3bcea7db6 Add a python script to generate texture builtins. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
9aefbe838c generate_builtins.pl: Support directiories for each extension. 2010-06-09 11:14:58 -07:00
Kenneth Graunke
9d1fc46f0c generate_builtins.pl: Support _fs directories as well as _vs. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
56d3f6ad78 Set the type of ir_texture properly; infer it from the sampler type. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
dd5b4a544b ir_reader: Add support for reading ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
3c7934bfaa ir_reader: Refactor reading of dereferences for later reuse. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
26d74cd1d1 Add stub visitor support for ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
be298063b5 ir_print_visitor: Add support for ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
c30f6e5dea Add mappings between ir_texture_opcode and strings. 2010-06-09 11:14:57 -07:00
Ian Romanick
81377c012c Define IR instruction for texture look-ups 2010-06-09 11:14:57 -07:00
Zack Rusin
da4185ca77 draw: make sure the buffer is big enough to fit everything emitted by the gs 2010-06-09 14:11:43 -04:00
Ian Romanick
2f8b0435b0 Use array delete operator to delete an array
This was detected by valgrind.  I think GCC still does the right
thing, but the C++ spec allows the compiler to do something
stupid... like crash or only delete the first entry in the array.
2010-06-09 11:00:23 -07:00
Roland Scheidegger
26d5d4d995 llvmpipe: fix copy & paste bug in clear logic
fixes bug 28450.
2010-06-09 18:46:52 +02:00
Zack Rusin
04490ad31d draw: fix geometry shader which emit multiplie primitives 2010-06-09 11:59:53 -04:00
Zack Rusin
d27d45a2df graw: add a multiple primitive geometry shader test 2010-06-09 11:44:19 -04:00
Zack Rusin
db7ed20730 nv: fix compile after the latest gs changes 2010-06-09 11:29:45 -04:00
Zack Rusin
d4ef0f6c67 geometry shaders: make gs work with changable primitives and variable number of vertices
lots and lots of fixes for geometry shaders. in particular now we work when the gs
emits a different primitive than the one the pipeline was started with and also
we work when gs emits more vertices than would fit in the original buffer.
2010-06-09 11:13:34 -04:00
Thomas Hellstrom
cec9955acc xorg/vmwgfx: Disable 3D by default.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-06-09 07:40:07 +02:00
Thomas Hellstrom
2e27bf8b7c st/xorg: Add a customizable option to disable 3D.
If no customizer is present, 3D will be enabled by default.
Otherwise the option will default to the customizer value.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-06-09 07:40:07 +02:00
Ben Skeggs
ebd98b3496 nvfx: fix typo from gallium-msaa merge 2010-06-09 11:59:49 +10:00
Ben Skeggs
851ca2f7f9 nv50: fix typo from gallium-msaa merge 2010-06-09 11:59:01 +10:00
Ben Skeggs
7bf678f7ec nv50: use MARK_RING correctly 2010-06-09 11:59:01 +10:00
Vinson Lee
c217d94cca draw: Remove unnecessary headers. 2010-06-08 17:40:23 -07:00
Marek Olšák
eee570a0fe r600g: save vertex buffers in blitter 2010-06-09 02:26:44 +02:00
Marek Olšák
26f3f13fa1 r300g: save vertex buffers in blitter 2010-06-09 02:26:44 +02:00
Marek Olšák
8f17e011c3 util: reference vertex buffers in blitter 2010-06-09 02:26:24 +02:00
Marek Olšák
89dc925150 r300g: report that transfers are always supported 2010-06-09 00:26:28 +02:00
Marek Olšák
25470dcbb1 r300g: fix loading compressed textures 2010-06-09 00:18:28 +02:00
Marek Olšák
fccfb7b165 r300g: skip rendering for unsupported vertex formats instead of aborting
The next step is to replace skipping by an actual fallback.
2010-06-08 23:50:05 +02:00
Eric Anholt
bcf63dbbd8 intel: Flag NEW_BUFFERS when changing draw buffers.
There were entries to this function (most imporantly, prepare_render
-> update_renderbuffers) that wouldn't have had NEW_BUFFERS set, but
brw_wm_surface_state (the i965 state tracking the drawing regions)
expected this to change.
2010-06-08 13:42:02 -07:00
Eric Anholt
df3c1a563f intel: Convert remaining dri_bo_emit_reloc to drm_intel_bo_emit_reloc.
The new API makes so much more sense, I'd like to forget how the old
one worked.
2010-06-08 13:42:02 -07:00
Eric Anholt
34474fa411 intel: Change dri_bo_* to drm_intel_bo* to consistently use new API.
The slightly less mechanical change of converting the emit_reloc calls
will follow.
2010-06-08 13:42:02 -07:00
Eric Anholt
22409756d4 intel: Clean up stale comments in intel_batchbuffer.c. 2010-06-08 13:42:02 -07:00
Eric Anholt
754fcd605b intel: Remove the non-gem paths for batchbuffer upload. 2010-06-08 13:42:02 -07:00
Eric Anholt
4527faa344 intel: Update comment in intel_tex_copy from before miptree x/y rework. 2010-06-08 13:42:02 -07:00
Zack Rusin
551467d4ef softpipe: make sure we don't fallback to assert on so stats query
spotted by Vinson
2010-06-08 16:20:25 -04:00
Zack Rusin
38b13459be softpipe: make sure that invalid calls to sosettargets don't crash us 2010-06-08 16:18:38 -04:00
Henri Verbeet
8744c36ea4 r600: Make next_inst() static. 2010-06-08 15:40:25 -04:00
Henri Verbeet
1bf75a921b r600: Assert output registers have a valid export index. 2010-06-08 15:40:25 -04:00
Henri Verbeet
1ec492a366 r600: Process exports for all written fragment outputs. 2010-06-08 15:40:25 -04:00
Henri Verbeet
1f7bc87391 r600: Fill uiFP_OutputMap for all written fragment outputs. 2010-06-08 15:40:25 -04:00
Keith Whitwell
e3c6d4108c SConscript: don't build mesa components if mesa not in state trackers 2010-06-08 17:38:56 +01:00
Brian Paul
10379e4edf softpipe: added sp_state_so.c to file list 2010-06-08 08:21:27 -06:00
Zack Rusin
b5d2fc2b48 gallium: scream when one of two unimplemented features in draw is used
plus used the correctly specified stride
2010-06-08 06:28:11 -04:00
Zack Rusin
be7d8ddf0c gallium: add basic support for stream output queries 2010-06-08 06:28:11 -04:00
Zack Rusin
34f7681669 gallium: adjust the query interface to support custom types
we need to change it to support composite types
2010-06-08 06:28:11 -04:00
Zack Rusin
3a7fc2e4f3 gallium: rename draw_auto to draw_stream_output, plus fix a comment
Brian spotted those
2010-06-08 06:28:11 -04:00
Zack Rusin
2c22b8e61d gallium: make draw auto work and add relevant caps and docs 2010-06-08 06:28:11 -04:00
Zack Rusin
ba5975dd32 gallium: add interface for DrawAuto and implement it in softpipe 2010-06-08 06:28:11 -04:00
Zack Rusin
c9db97c822 gallium: a lot more complete implementation of stream output
interface wise we have everything needed by d3d10 and gl transform feedback.
the draw module misses implementation of some corner cases (e.g. when stream
output wants different number of components per output than normal rendering
paths)
2010-06-08 06:28:10 -04:00
Zack Rusin
a45b7f47ee gallium: basic and initial implementation of the stream output interface
aka transform feedback
2010-06-08 06:28:10 -04:00
Dave Airlie
a2817f6ae5 st/mesa: attempt to fix TFP by using sampler views (v1)
Okay I think this is good enough for now, I can't see any other reason
for mesa to want to use a sampler view so lets just leave it at all the A->X conversions for now.

I've been running gnome-shell under r300g with this for day or so and it seems fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-06-08 19:08:36 +10:00
Jakob Bornecrantz
3a876e8473 llvmpipe: Add geom shader file to make build 2010-06-08 04:46:52 +02:00
Ian Romanick
cfb3536f10 Bump GL_MAX_TEXTURE_COORDS from 2 to 4
Every platform that supports GLSL sets GL_MAX_TEXTURE_COORDS to at
least 4, so hard-code 4 for now.

This causes the following tests to pass:

    glslparsertest/glsl2/norsetto-bumptbn_sh_fp.vert
    glslparsertest/glsl2/xreal-lighting-d-omni.vert
    glslparsertest/glsl2/xreal-lighting-db-omni.vert
    glslparsertest/glsl2/xreal-lighting-dbs-omni.vert
2010-06-07 19:10:33 -07:00
Ian Romanick
19eb5896c4 Only allow global precision qualifier for int and float
This causes the following tests to pass:

    glslparsertest/glsl2/precision-03.vert
2010-06-07 19:03:03 -07:00
Ian Romanick
9bcb67bdc4 Fix parsing of precision qualifiers
This causes the following tests to pass:

     glslparsertest/glsl2/precision-02.vert
     glslparsertest/glsl2/precision-04.vert
     glslparsertest/glsl2/precision-06.vert

This causes the following test to fail.  This shader was previously
failing to compile, but it was failing for the wrong reasons.

     glslparsertest/glsl2/precision-03.vert
2010-06-07 18:56:16 -07:00
Ian Romanick
15d162d7b1 Don't process empty shaders
Some valid shaders, such as 'precision highp float;', evaluate to
empty sets of instructions.  This causes some of the optimization
stages to enter infinite loops.  Instead, don't bother processing the
empty ones.
2010-06-07 18:53:06 -07:00
Ian Romanick
6cd2a5cc4b Generate an error on empty declaration lists
This causes an error for code such as 'float;'
2010-06-07 18:49:48 -07:00
Vinson Lee
380f08f4ec graw: Fix file handle leaks. 2010-06-07 18:34:13 -07:00
Vinson Lee
d09271d6ef graw: Remove unnecessary headers. 2010-06-07 18:14:34 -07:00
Vinson Lee
b0acaaac53 sw: Remove unnecessary header. 2010-06-07 18:08:33 -07:00
Jakob Bornecrantz
0528106cc7 glew: Drop glew now that we don't need it for the progs
configs/beos           |    2 +-
 configs/darwin         |    2 +-
 configs/default        |    4 +-
 configs/freebsd-dri    |    2 +-
 configs/linux-cell     |    2 +-
 configs/linux-dri-xcb  |    2 +-
 configs/linux-indirect |    2 +-
 configure.ac           |    2 +-
 include/GL/glew.h      |14435 ------------------------------------------------
 include/GL/glxew.h     | 1476 -----
 include/GL/wglew.h     | 1247 -----
 src/SConscript         |    1 -
 src/glew/LICENSE.txt   |   73 -
 src/glew/Makefile      |   54 -
 src/glew/SConscript    |   69 -
 src/glew/glew.c        |14320 -----------------------------------------------
 src/glew/glewinfo.c    | 8441 ----------------------------
 src/glew/visualinfo.c  | 1173 ----
 18 files changed, 8 insertions(+), 41299 deletions(-)

Revert "glew: update to version 1.5.4"
This reverts commit a189b1c53b.

Revert "glew: Include X11 headers and libraries in SCons build."
This reverts commit efdd33985c.

Revert "scons: Fix GLEW build on Mac OS X."
This reverts commit 8f81769148.

Revert "scons: Use static glew library on Unices to avoid binary compatability issues"
This reverts commit de22c940a1.

Revert "glew: Update to version 1.5.2."
This reverts commit aaf7ecfd81.

Revert "scons: Build glew on all platforms."
This reverts commit 52eb3e4235.

Revert "scons: Put glut and glew shared libraries into build/xxx/bin or lib."
This reverts commit 8a318edd08.
Didn't revert scons/gallium.py

Revert "scons: Fix glew build on MSVC."
This reverts commit 14a8c9dac7.

Revert "scons: Build progs together with everything else."
This reverts commit 7bbf7f94ea.
Only changed src/glew/SConscript

Revert "mesa: include glew headers in MesaDemos tarballs"
This reverts commit c57d81ddc9.

Revert "mesa: include GLEW sources in MesaDemos tarball"
This reverts commit b9e2e32daf.

Revert "glew: correct misspelling of glFramebufferTextureLayer"
This reverts commit 1b05b5b4fe.

Revert "glew: fix GLEW_LIB_NAME"
This reverts commit c10df26a31.

Revert "Add dummy install target for glew to fix 'make install'"
This reverts commit c273dfe6a2.

Revert "autoconf: Add GLEW needed by progs when building GLUT"
This reverts commit 2977cee38e.

Revert "glew: Build it as a static lib."
This reverts commit fcf9353fea.

Revert "glew: Initial import."
This reverts commit 57d00016ca.
2010-06-08 02:07:24 +02:00
Vinson Lee
1574fb7846 r600g: Remove unnecessary header. 2010-06-07 16:54:18 -07:00
Vinson Lee
29dfb2f8f0 llvmpipe: Remove unnecessary header. 2010-06-07 16:44:22 -07:00
Vinson Lee
4af8d48a9f graw: Add gallium library to SCons build.
Fixes MSVC SCons build.
2010-06-07 16:34:03 -07:00
Marek Olšák
c1d91c4901 r300g: fix hardlock caused by an incompatible vertex format
The drivers aborts instead, I am working on a real fix...
2010-06-07 22:11:58 +02:00
Keith Whitwell
d095d95e77 graw: add gs-test.c and some simple geometry shader examples 2010-06-07 19:53:01 +01:00
Roland Scheidegger
a3dffd76d3 softpipe: use util_clear_render_target/depth_stencil fallbacks 2010-06-07 20:49:16 +02:00
Roland Scheidegger
f92879576e llvmpipe: use util_clear_render_target/depth_stencil fallbacks 2010-06-07 20:49:16 +02:00
Roland Scheidegger
a2bf4817bb util: implement util_clear_depth_stencil fallback
this doesn't really look terribly useful for drivers to use, but until
drivers use their own implementation provide this since some state trackers
really want to use these functions.
2010-06-07 20:49:16 +02:00
Keith Whitwell
9d343f4ba1 graw: add parse_geometry_shader helper 2010-06-07 19:38:30 +01:00
Keith Whitwell
eb430046de tgsi: null-terminate string in parse_identifier
Hit this parsing geometry shader properties.
2010-06-07 19:38:30 +01:00
Keith Whitwell
045174b685 draw: don't use llvm engine when geometry shaders active
They aren't implemented for llvm.
2010-06-07 19:38:30 +01:00
Keith Whitwell
c9c6b56e48 graw: trivial geometry shader test 2010-06-07 19:38:30 +01:00
Keith Whitwell
8a778d7bcf graw: add symlinks to shader test directories 2010-06-07 19:38:30 +01:00
Jakob Bornecrantz
6e3fc2de2a r300g: Move bootstrap code to targets 2010-06-06 13:02:56 +01:00
Jakob Bornecrantz
c7015877be i915g: Move bootstrap code to targets 2010-06-06 13:02:49 +01:00
Jakob Bornecrantz
9ff10b67bc svga: Move bootstrap code to targets 2010-06-06 13:02:43 +01:00
Jakob Bornecrantz
16fa300d55 swrastg: Use new drm_driver interface in EGL
The EGL state tracker is really weird in how it does software,
in the past we would just not return a drm_api struct but now,
there is no callback to get a function so we just set the
create_screen hock to NULL to make it switch to software.
2010-06-06 12:29:40 +01:00
Jakob Bornecrantz
c1a19689b8 gallium: Make all drm drivers use the new drm compat helper 2010-06-06 12:29:29 +01:00
Jakob Bornecrantz
27c49b16d3 i965g: Use Xorg template makefile 2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
e72b15aa47 gallium: drm api compat helper
This is temporary untill all drivers have moved
to the new drm driver descriptor interface.
2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
f9d9574913 gallium: Convert state trackers to drm driver interface 2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
76aed4b070 gallium: Add drm driver interface
This interfacre replaces the drm_api api it works very much the same
way as drm_api but with the exception that its meant for the target
to implement it. And it does not export a get function and neither a
destroy function.
2010-06-06 12:29:28 +01:00
Jakob Bornecrantz
def70b17d4 nouveau: Use Xorg template makefile 2010-06-06 12:29:27 +01:00
Jakob Bornecrantz
20ef3a793f nouveau: Remove left over argument in drm api 2010-06-06 12:12:54 +01:00
Jakob Bornecrantz
77bfdb3530 r300g: Use Xorg template makefile 2010-06-06 12:07:48 +01:00
Keith Whitwell
149e709701 graw: remove references to unistd.h 2010-06-07 17:53:43 +01:00
Keith Whitwell
df2d5dd61d util: new file u_dirty_flags.h 2010-06-07 17:25:45 +01:00
Keith Whitwell
f38b2cf63f tests/graw: missing file tri.c 2010-06-07 17:22:53 +01:00
Keith Whitwell
edda7fd745 graw_xlib: build fixes 2010-06-07 16:44:40 +01:00
Keith Whitwell
00fe54a879 graw: update graw_null after interface changes and build graw tests again 2010-06-07 16:43:49 +01:00
Keith Whitwell
14ce1860d4 softpipe: remove assert on setting constbufs greater than zero 2010-06-07 16:40:05 +01:00
Keith Whitwell
a6d9d18fae llvmpipe: hook up basic gs and multiple constant buffer support 2010-06-07 16:39:02 +01:00
Keith Whitwell
0cdc0a702c cell/spu: divorce from tgsi_exec.h 2010-06-07 16:37:21 +01:00
Keith Whitwell
d6861be9cc util: add u_box_3d 2010-06-07 16:34:55 +01:00
Keith Whitwell
5a91620417 gallivm: eliminate tgsi_exec.h include 2010-06-07 16:34:55 +01:00
Keith Whitwell
cd73360e48 include/st: new file swrast_screen_create.h 2010-06-07 16:34:55 +01:00
Keith Whitwell
258f433fff util: add util_framebuffer_min_size 2010-06-07 16:34:55 +01:00
Keith Whitwell
ac7c8f7dd3 util: allocate larger tmp_row in util_format_translate
The tmp_row storage allocation took into account the format's y block
size by allocating y_step rows of data.  However, the x block size was
not being taken into account when deciding how wide those rows need to
be.

Now make sure that tmp_row is at least x_step by y_step in size.
2010-06-07 16:34:55 +01:00
Keith Whitwell
69faf5b48f tgsi: reject interpolation and semantics on vs inputs 2010-06-07 16:34:55 +01:00
Keith Whitwell
81cb6ac042 regress: remove interpolation and semantic info from vs inputs 2010-06-07 16:34:55 +01:00
Keith Whitwell
ebdb43fd98 test/graw: add vp-test 2010-06-07 16:34:55 +01:00
Keith Whitwell
78e6e081a1 tests/graw: add fp-test 2010-06-07 16:34:55 +01:00
Kristian Høgsberg
0c2bac0718 .gitignore: Ignore emacs .dir-locals.el files 2010-06-07 10:23:55 -04:00
Kristian Høgsberg
56c3cce2a1 Remove last bits of progs/ infrastructure 2010-06-07 10:08:48 -04:00
Marek Olšák
b4483823d9 r300g: fix 24-bit depth texturing
This is a secret texture format, do not tell anybody.
And it looks like we can read stencil in the shader too.
2010-06-07 04:26:16 +02:00
Jerome Glisse
c6131879eb r600g: add shader literal constant support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-06-06 22:16:47 +02:00
Marek Olšák
aeffba454f st/mesa: advertise GL_ARB_fragment_program_shadow
There is nothing driver-specific about this one.
I've also tested it just to be sure.
2010-06-06 20:50:29 +02:00
Marek Olšák
eb2a1521cf r300g: workaround index bias on chipsets that do not support it 2010-06-06 19:44:58 +02:00
Marek Olšák
31a74a6df7 st/mesa: trivially enable GL_ATI_texture_env_combine3
This extension is implemented in the texenv program.
Gallium drivers pass patched glean/texCombine.
(I am going to send the patch soon)

Catalyst9.3 advertises this extension too so I don't see a reason we shouldn't.
2010-06-05 19:39:16 +02:00
Marek Olšák
a7fa91b658 mesa: add ARB_texture_swizzle as alias of EXT_texture_swizzle, update relnotes
The specifications are identical.
2010-06-05 17:43:38 +02:00
Kenneth Graunke
2ab0b13dd9 Disallow defining macros whose names start with "__" or "GL_".
The GLSL specification reserves these for future use.
2010-06-04 14:53:58 -07:00
Kenneth Graunke
603b8fc4b2 Check variable mode when comparing qualifier lists.
Fixes function-05.vert.
2010-06-04 12:57:20 -07:00
Jakob Bornecrantz
c0b66f471c i915g: Use template Xorg makefile 2010-06-04 19:54:11 +01:00
Jakob Bornecrantz
94d5239511 gallium: Use correct defines in Xorg template makefile 2010-06-04 19:54:11 +01:00
Jakob Bornecrantz
30456f775c gallium: Add winsys to include path to Xorg template makefile 2010-06-04 19:54:11 +01:00
Joakim Sindholt
fb08e03ae1 gallium: always build drivers/sw 2010-06-05 17:19:46 +02:00
Joakim Sindholt
4a329c67bc r300compiler: fix scons build 2010-06-05 17:19:46 +02:00
Jerome Glisse
0db388eedd r600g: split instruction into scalar
Split instruction into scalar in core compiler this simplify
the way we translate the instruction in latter stage.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-06-05 17:13:25 +02:00
Roland Scheidegger
7643f45b10 Revert "llvmpipe: handle PIPE_CAP_TEXTURE_SWIZZLE query"
This reverts commit acb20e7208.
Oops should check commits after rebase...
2010-06-05 16:55:51 +02:00
Roland Scheidegger
b6cd0712e9 i915g: fix bug in ds clear logic (still disabled) 2010-06-05 16:54:36 +02:00
Roland Scheidegger
c00065e5c2 st/mesa: fix bug in depthstencil optimizing clear logic 2010-06-05 16:54:36 +02:00
Roland Scheidegger
acb20e7208 llvmpipe: handle PIPE_CAP_TEXTURE_SWIZZLE query
asserts on unknown caps
2010-06-05 16:54:36 +02:00
José Fonseca
9881b5c2df llvmpipe: Expose PIPE_CAP_TEXTURE_SWIZZLE. 2010-06-05 14:48:39 +01:00
Chris Wilson
6d741627b0 i915: Only emit a MI_FLUSH when the drawing rectangle offset changes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-05 11:37:23 +01:00
Chris Wilson
add3260157 i915: Fix off-by-one for drawing rectangle.
The drawing rectangle is given in *inclusive* pixel values, so the range
is only [0,2047]. Hence when rendering to a 2048 wide target, such as an
extended desktop, we would issue an illegal instruction zeroing the draw
area.

Fixes:

  Bug 27408: Primary and Secondary display blanks in extended
             desktop mode with Compiz enabled
  https://bugs.freedesktop.org/show_bug.cgi?id=27408

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-05 09:33:58 +01:00
Chris Wilson
ff74c2ced5 i915: Inhibit render cache flush when changing drawing rectangle offset.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-05 09:32:28 +01:00
Dave Airlie
42ebe3dfd9 mesa/st: add support for EXT_texture_swizzle.
This passes on r300g, the only bit I'm not really sure about is the handling
of the sampler_view in st_atom_texture.c, I unreference it there if the swizzle
value changes and I also have to create a new set of functions to create a new
one since the u_sampler.c ones don't handle swizzle so much.

adds r300g + softpipe enables, I think other drivers could pass easily enough.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-06-05 16:53:43 +10:00
Marek Olšák
f855e16afa r300/compiler: implement SIN+COS+SCS for vertex shaders 2010-06-05 07:03:15 +02:00
Marek Olšák
722db9fa77 r300/compiler: implement SNE unwound for r3xx VS, natively for r5xx VS 2010-06-05 07:03:15 +02:00
Marek Olšák
df36bc8dad r300/compiler: implement SEQ unwound for r3xx VS, natively for r5xx VS
Fixes piglit/glsl-vs-vec4-indexing-4.
2010-06-05 07:03:15 +02:00
Marek Olšák
e629de94b5 r300/compiler: implement SFL for vertex shaders
And sort the "case" statements alphabetically.
2010-06-05 07:03:14 +02:00
Brian Paul
89cb314f26 docs: note that the Mesa demos are in a new repo 2010-06-04 17:47:54 -06:00
Brian Paul
7ba1a879ef docs: links to the Mesa demos git repo 2010-06-04 17:47:53 -06:00
Brian Paul
3d07060ae3 mesa: remove PROGRAM_DIRS from config files 2010-06-04 17:47:53 -06:00
Brian Paul
0a401b5d2f mesa: remove old references to demo files and progs subdir 2010-06-04 17:47:53 -06:00
Brian Paul
74bea8d21f progs: remove rbug subdir 2010-06-04 17:47:53 -06:00
Brian Paul
06e911a757 demos: remove fbdev subdir 2010-06-04 17:47:53 -06:00
Brian Paul
db3b92b42f progs: remove beos subdir 2010-06-04 17:47:53 -06:00
Brian Paul
700717175c progs: remove tools subdir 2010-06-04 17:47:53 -06:00
Brian Paul
ca10ab6da8 progs: remove slang subdir 2010-06-04 17:47:53 -06:00
Brian Paul
8585c01265 vbo: misc clean-ups 2010-06-04 17:47:53 -06:00
Vinson Lee
f5b9ad9a7d i915g: Rename winsys c file.
This was missed in commit e7f0f6bb72.
Fixes i915g SCons build.
2010-06-04 16:19:08 -07:00
Brian Paul
4f067ada47 llvmpipe: new -s option to run single test
Put specific test code in the test_single() function and pass -s to
execute that code.
2010-06-04 17:01:24 -06:00
Eric Anholt
f0ff214bee i915: Don't use XRGB8888 on 830 and 845.
The support for XRGB8888 appeared in the 855 and 865, and this format
is reserved on 830/845.  This should fix a regression from
b4a6169412 that caused hangs in etracer
on 845s.

Bug #26557.
2010-06-04 13:40:48 -07:00
Eric Anholt
b80a728f8a i915: Clamp minimum lod to maximum texture level too.
Otherwise, we'd run into minlod > maxlod, and the sampler would give
us the undefined we asked for.

Bug #24846.  Fixes OGLC texlod.c.
2010-06-04 13:28:48 -07:00
Eric Anholt
18a6e5ee73 intel: Fix intel_compressed_num_bytes for FXT1 after I broke it.
Fixes piglit fxt1-teximage since
7554b83a21, and also OGLC tests that hit
FXT1 with a million other things.

Bug #28184.
2010-06-04 12:43:15 -07:00
Kristian Høgsberg
a663a63718 glsl: Recject rect samplers when GL_ARB_texture_rectangle is disabled 2010-06-04 09:06:34 -04:00
José Fonseca
be5a514d4e llvmpipe: Do unswizzling in parallel when flushing for transfers. 2010-06-04 13:05:59 +01:00
José Fonseca
e5a48fcabd progs: Remove forked/dead files. 2010-06-04 13:05:59 +01:00
Chia-I Wu
0cfb5ffe30 st/egl: Fix compiler warnings.
Forgot to stage this chunk in last commit.
2010-06-04 12:56:06 +08:00
Chia-I Wu
22c2e57cbb st/egl: Move sw screen creation to native helper.
The code is shared by ximage and gdi backend.
2010-06-04 12:12:50 +08:00
Vinson Lee
27910c42a9 scons: Add cygwin to list of accepted platforms. 2010-06-03 18:41:19 -07:00
Marek Olšák
8819421a3b r600g: implement clear_{render_target, depth_stencil}, resource_copy_region
resource_copy_region uses a software fallback because it relies on texture
samplers which haven't been implemented yet.
2010-06-04 03:04:16 +02:00
Marek Olšák
7d0418d3dc r600g: make blit functions static (private) 2010-06-04 03:04:16 +02:00
Marek Olšák
ffd0a2e215 r600g: use cast wrappers 2010-06-04 03:04:16 +02:00
Vinson Lee
42aad574f2 r600g: Move declaration before code.
Fixes SCons build.
2010-06-03 17:41:57 -07:00
Vinson Lee
1687ef2be6 util: Remove unnecessary header. 2010-06-03 17:30:55 -07:00
Vinson Lee
9cdcabbb2b nv50: Remove unnecessary header. 2010-06-03 17:29:59 -07:00
Vinson Lee
16009b6a40 svga: Remove unnecessary header. 2010-06-03 17:29:30 -07:00
Vinson Lee
a52f577270 llvmpipe: Fix uninitialized variable on non-debug builds. 2010-06-03 17:24:22 -07:00
Bas Nieuwenhuizen
d6ba70c658 r600g: added code for depthtesting
- added code to configure the depth buffer and to set up depth testing.
2010-06-03 21:38:53 +02:00
Roland Scheidegger
c674ce5e3a r600g: adapt to interface changes
r600g should be able to handle separate depth stencil clears as well.
Also adapt surface_fill/copy stubs to new interface (not that it matters).
2010-06-03 17:46:47 +02:00
Roland Scheidegger
992382762a Merge branch 'gallium-newclear'
Conflicts:
	src/gallium/state_trackers/python/p_context.i
2010-06-03 17:46:14 +02:00
Roland Scheidegger
a6e5c6c000 gallium: rename clearRT / clearDS to clear_render_target / clear_depth_stencil
more consistent with rest of gallium naming conventions.
Also rename driver-internal names for these the same.
2010-06-03 16:33:25 +02:00
Carl Worth
5ae88af988 test suite: Add expected output for every test.
Rather than using the (munged) output of "gcc -E" we now capture
precisely the output we expect from every test case. This allows us to
stay immune from strange output from gcc (unpredictable whitespace
output---aprticularly with different gcc versions).

This will also allow us to write tests that capture expected error
messages from the preprocessor as well.
2010-06-02 15:59:45 -07:00
Carl Worth
14c98a5644 Restore error message for a macro with unbalanced parentheses.
We had to remove this earlier because our recursive function calls
caused the same nodes to be examined for expansion more than once.
And in the test suite, one node would be examined before it had
its closing parenthesis and then again later after the parenthesis
was added.

So we removed this error message to allow the test case to pass.
Now that we've removed the unnecessary recursive function call
we can catch this error case and report it as desired.
2010-06-02 15:49:54 -07:00
Carl Worth
22b3aced03 Eliminate some recursion from children of _expand_token_list
Previously, both _expand_node and _expand_function would always make
mutually recursive calls into _expand_token_list. This was unnecessary
since these functions can simply return unexpanded results, after which
the outer iteration will next attempt expansion of the results.

The only trick in doing this is to arrange so that the active list is
popped at the appropriate time. To do this, we add a new token_node_t
marker to the active stack. When pushing onto the active list, we set
marker to last->next, and when the marker is seen by the token list
iteration, we pop from the active stack.
2010-06-02 15:32:03 -07:00
Carl Worth
c7c95fe51f Remove dead code: _glcpp_parser_expand_token_list_onto
This function simply isn't being called anymore.
2010-06-02 14:43:03 -07:00
Ian Romanick
384c051b8c ir_dereference_array always operates on an r-value
ir_dereference_array::array is always an r-value.  If the dereference
is of a varaible, that r-value will be an ir_dereference_variable.
This simplifies the code a bit.
2010-06-02 13:50:27 -07:00
Ian Romanick
35159b542c There is no class ir_label, so there's no need for ir_instruction::as_label 2010-06-02 13:39:45 -07:00
Ian Romanick
c8021ee01d Remove some cruft from the Makefile
This was affecting the build, but the files don't actually exist.
2010-06-02 13:13:40 -07:00
Carl Worth
111e25bd84 Factor out common sub-expression from multi-line-comment regular expression.
In two places we look for an (optional) sequence of characters other
than "*" followed by a sequence of on or more "*". Using a name for
this (NON_STARS_THEN_STARS) seems to make it a bit easier to
understand.
2010-06-02 12:54:15 -07:00
Carl Worth
e4b2731a25 Make the multi-line comment regular expression a bit easier to read.
Use quoted strings for literal portions rather than a sequence of
single-character character classes.
2010-06-02 10:59:08 -07:00
Carl Worth
4c22f4dba7 Fix multi-line comment regular expression to handle (non) nested comments.
Ken reminded me of a couple cases that I should be testing. These are
the non-nestedness of things that look like nested comments as well as
potentially tricky things like "/*/" and "/*/*/".

The (non) nested comment case was not working in the case of the
comment terminator with multiple '*' characters. We fix this by not
considering a '*' as the "non-slash" to terminate a sequence of '*'
characters within the comment. We also fix the final match of the
terminator to use '+' rather than '*' to require the presence of a
final '*' character in the comment terminator.
2010-06-02 10:57:18 -07:00
Eric Anholt
aa5794384f Add builtin gl_LightSource[].
Fixes gst-gl-bumper.vert parsing.
2010-06-01 15:36:01 -07:00
Eric Anholt
5b9ac87941 builtins: Add support for reflect().
Fixes glsl-orangebook-ch06.frag parsing.
2010-06-01 15:15:05 -07:00
Eric Anholt
da46e5f534 builtins: Add ftransform().
Fixes glsl-orangebook-ch06-bump.vert.
2010-06-01 15:15:05 -07:00
Eric Anholt
0ca171908d Allow arrays of floats as varyings.
The comment just above the code said arrays were OK, then it didn't
handle arrays.  Whoops.  Partially fixes CorrectUnsizedArray.frat.
2010-06-01 15:15:04 -07:00
Eric Anholt
cd512b0063 gl_Normal is a vec3 not a vec4.
Fixes CorrectSwizzle1.vert.
2010-06-01 15:15:04 -07:00
Eric Anholt
f03acfc7d7 builtins: Add the mix(gentype, gentype, float) variant.
The broken-in-mesa Regnum Online shader now parses, except for its
preprocessor usage.
2010-06-01 15:15:04 -07:00
Eric Anholt
336b4ad8c7 Handle GLSL 1.20 implicit type conversions.
We were nicely constructing a new expression for the implicit type
conversion, but then checking that the previous types matched instead
of the new expression's type.  Fixes errors in Regnum Online shaders.
2010-06-01 15:15:04 -07:00
Eric Anholt
60fa1a9458 builtins: Add atan(). 2010-06-01 15:15:04 -07:00
Eric Anholt
5e58e541e0 builtins: Add asin(). 2010-06-01 15:15:04 -07:00
Eric Anholt
43ad37aa88 ir_constant_expression: Handle several floating point unops.
Cleans up a bunch of pointless operations in a GStreamer fragment shader.
2010-06-01 15:15:04 -07:00
Eric Anholt
65122e9e80 ir_constant_variable: New pass to mark constant-assigned variables constant.
This removes a bunch of gratuitous moving around of constant values
from constructors.  Makes a shader ir I was looking at for structure
handling almost readable.
2010-06-01 15:15:04 -07:00
Eric Anholt
f389862006 ir_constant_folding: Look at instructions in functions.
This was broken in the ir_label -> ir_function rework.
2010-06-01 15:15:04 -07:00
Eric Anholt
49a5d5c4f5 ir_swizzle_swizzle: Reduce swizzle chains to a single swizzle. 2010-06-01 15:15:04 -07:00
Eric Anholt
b145e90369 ir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.
This should remove the burden of handling constant vector indexing
well from backend codegen, and could help with swizzle optimizations.
2010-06-01 15:15:04 -07:00
Eric Anholt
f8bb17260a ir_expression_flattening: Handle flattening values out of swizzles, too.
Fixes an uninlined normalize() in CorrectSwizzle2.vert.
2010-06-01 15:15:04 -07:00
Eric Anholt
459e4a286c ir_expression_flattening: Fix breakage from hierarchichal visitor.
Similar to other situations where the visitor pattern doesn't fit, in
this case we need the pointer to the base instruction in the
instruction stream for where to insert any new instructions we
generate (not the instruction in the tree we're looking at).  By
removing the code for setting the base_ir, flattened expressions would
end up, for example, before the function definition where they had appeared.
2010-06-01 15:15:04 -07:00
Carl Worth
2571415d1a Implement comment handling in the lexer (with test).
We support both single-line (//) and multi-line (/* ... */) comments
and add a test for this, (trying to stress the rules just a bit by
embedding one comment delimiter into a comment delimited with the
other style, etc.).

To keep the test suite passing we do now discard any output lines from
glcpp that consist only of spacing, (in addition to blank lines as
previously). We also discard any initial whitespace from gcc output.
In neither case should the absence or presence of this whitespace
affect correctness.
2010-06-01 12:18:43 -07:00
Carl Worth
a771a40e22 Fix #if-skipping to *really* skip the skipped group.
Previously we were avoiding printing within a skipped group, but we
were still evluating directives such as #define and #undef and still
emitting diagnostics for things such as macro calls with the wrong
number of arguments.

Add a test for this and fix it with a high-priority rule in the lexer
that consumes the skipped content.
2010-06-01 11:23:08 -07:00
Jakob Bornecrantz
05863c4877 gallium: Don't depend directly on staging dir in Xorg template makefile 2010-06-01 10:30:27 +01:00
Brian Paul
b297b14d30 tgsi: we don't support indirect input/output registers in SSE codegen yet
Extend the check for indirect addressing of temp regs to include
input/output regs.

Fixes failure with piglit glsl-texcoord-array.shader_test test when using
SSE codegen.
2010-06-03 09:01:32 -06:00
Brian Paul
d4afee9202 tgsi: whitespace cleanup 2010-06-03 08:58:31 -06:00
Brian Paul
d18fb4822b gallium: add interpolation parameter to simple shader functions
This lets us specify linear interpolation instead of perspective
interpolation for blit operations.  Might be a bit faster.
2010-06-03 08:54:15 -06:00
Jakob Bornecrantz
35d75e4930 gallium: Don't always copy the dri driver to the staging dir
So something in the build keept updating the timestamp on the
staging directory causing us to always copy the library to it.
2010-06-01 09:41:01 +01:00
Jakob Bornecrantz
d212a4d414 gallium: Create a Xorg driver template Makefile 2010-06-01 09:41:00 +01:00
Brian Paul
6cc51b982e util/u_debug: use MAX2 macro 2010-06-03 07:52:46 -06:00
José Fonseca
81862bbbc8 llvmpipe: Number shaders/variants for more reproducible function names in the IR. 2010-06-03 14:32:56 +01:00
José Fonseca
55948247eb gallivm: Register the JIT engine with oprofile on debug/profile builds. 2010-06-03 14:32:56 +01:00
José Fonseca
ef81779850 gallivm: Factor out the quad derivative code into a single place. Fix ddy.
For ddy it should be (bottom - top).
2010-06-03 14:32:56 +01:00
Joakim Sindholt
9eb730a735 r300g: use util/u_debug 2010-06-03 13:45:05 +02:00
Joakim Sindholt
8413b92a6f gallium: silence all debug_named_value related warnings 2010-06-03 13:45:05 +02:00
Joakim Sindholt
fbeab4cbce util/u_debug: add description field to debug_named_value 2010-06-03 13:45:05 +02:00
Vinson Lee
d062d21416 scons: Handle Python OSError exception when missing libdrm_radeon.
Instead of crashing when libdrm_radeon is unavailable, the SCons build
just does not build r600g.
2010-06-03 00:08:22 -07:00
Marek Olšák
128190e4a9 r300/compiler: print opcode names instead of numbers 2010-06-03 05:15:10 +02:00
Marek Olšák
e0d72814be r300g: set the minimum texture stride to 64 bytes on RS600, RS690, and RS740
I hope I've done it right. No way to test it here...
2010-06-03 03:46:34 +02:00
Vinson Lee
88008dfaa4 dri/swrast: Remove unnecessary header. 2010-06-02 17:54:10 -07:00
Brian Paul
dfe9dec04f st/mesa: fix indirect addressing of input/output regs
This fixes an issue that was missed with commit
9f544394c1.
Fixes piglit glsl-texcoord-array.shader_test
2010-06-02 17:43:39 -06:00
Brian Paul
14b7fdb8ac gallivm: bump up LP_BUILD_FLOW_MAX_VARIABLES
Fixes failed assertion with piglit fbo-drawbuffers-fragcolor.c
See fd.o bug 28358.

With 8 color buffers + Z we need to declare 33 vars, at least.
2010-06-02 16:23:20 -06:00
Kristian Høgsberg
890b3c61e3 intel: Remove a leftover DRI1/DRI2 conditional 2010-06-02 18:07:14 -04:00
Brian Paul
2c30a8d8f9 glx: fix indentation and remove extraneous break 2010-06-02 16:04:10 -06:00
Brian Paul
fc72452b97 glx: reformat and silence unused expression warning 2010-06-02 16:03:22 -06:00
Brian Paul
398e046efd glsl: handle indirectly indexed input registers in linker
For example, if the fragment shader reads gl_TexCoord[i] with a
dynamic index we need to set all the InputsRead bits for all
texcoords.  We were already doing this for shader outputs.
Refactored the later code so inputs and outputs are handled with
similar code.

Fixes a swrast failure with piglit's glsl-texcoord-array.shader_test
2010-06-02 15:34:49 -06:00
Brian Paul
e57689c6ba mesa: use BITFIELD64_BIT() macro 2010-06-02 15:34:49 -06:00
Brian Paul
7a156476e4 glsl: fix bad sanity-check assertion 2010-06-02 15:34:49 -06:00
Brian Paul
23c5b21c16 mesa: whitespace and 80 column wrapping 2010-06-02 15:34:49 -06:00
Eric Anholt
84db95bfcd shaders: Don't lose the param binding swizzle for single params.
Multiple item params are OK because we don't allow swizzles for them
(in case you do array access to hit their elements, for example).  For
singles, though, using the swizzle can cut down on storage, we do want
to allow a swizzled use of another param.

Fixes OGLC texRect.c.
2010-06-02 14:06:41 -07:00
José Fonseca
a33b5ef7d0 llvmpipe: Fix bad logic.
Courtesy of Vinson and coverity.
2010-06-02 21:32:49 +01:00
Vinson Lee
fae7bee475 llvmpipe: Remove unnecessary header. 2010-06-02 12:09:23 -07:00
José Fonseca
92cbbba7fb llvmpipe: Fix typo in assert. 2010-06-02 20:00:30 +01:00
José Fonseca
ead58101f9 llvmpipe: Per quad interpolation.
First interpolate the 4 quads upper left corners, then sub-interpolate
each quad pixel. Do the perspective divide once per quad.

Saves some muls and reciprocates. But doesn't seem to make a
noticeable improvement.

It make the code simpler and more compact, so commiting anyway.
2010-06-02 18:43:35 +01:00
José Fonseca
5871b7ebc9 llvmpipe: Minor cleanup to the interpolator. 2010-06-02 16:09:21 +01:00
José Fonseca
952d188c3c gallivm: Add a lp_build_const_elem(). 2010-06-02 16:00:40 +01:00
José Fonseca
21a6bf8624 llvmpipe: Store often used LLVM types in the lp_build_context. 2010-06-02 16:00:15 +01:00
José Fonseca
baf4393105 gallivm: Zero min_lod and max_lod when only one view is selected and min/mag filter are equal. 2010-06-02 13:24:26 +01:00
José Fonseca
804e76ac4f gallivm: Make lp_build_sample_wrap_int usage more accurate.
Fixes mesa texwrap demo border with GL_CLAMP.
2010-06-02 13:24:26 +01:00
José Fonseca
a37de72967 gallivm: Don't use reciprocate in lp_build_sample_wrap_linear().
Always clamp the scaled coordinates.
2010-06-02 13:24:26 +01:00
José Fonseca
6463dcbc01 gallivm: Avoid fp arithmetic in lp_build_sample_wrap_nearest(). 2010-06-02 13:24:25 +01:00
José Fonseca
e3d3f30440 gallivm: Don't use lp_build_sample_wrap_nearest()
Always clamp with scaled coordinates.
2010-06-02 13:24:25 +01:00
José Fonseca
147dc2354c llvmpipe: Centralize all position interpolation in lp_bld_interp.c. 2010-06-02 13:24:25 +01:00
Marek Olšák
53beea574f r300g: use the stored GEM domain in add_buffer/write_reloc
I admit blitting to/from GTT is actually enforced in this commit,
texture transfers are now damned fast!
2010-06-02 07:09:51 +02:00
Marek Olšák
b6b76cbb20 r300g: store the GEM domain in buffer and texture structs 2010-06-02 07:01:08 +02:00
Marek Olšák
bb45a15168 r300g: use r300_buffer_domain everywhere 2010-06-02 06:26:15 +02:00
Marek Olšák
19498be935 r300g: blit directly to/from GTT when transfering textures 2010-06-02 06:07:53 +02:00
Marek Olšák
37f3454eb3 r300g: let the driver determine the GEM domain for buffer_create 2010-06-02 06:01:22 +02:00
Marek Olšák
ae3063066c r300g: make texture transfers more pipelined
Mostly based on Michel Dänzer's patch.
2010-06-02 04:59:00 +02:00
Marek Olšák
d614541d52 r300g: better describe another flush and move it closer to the real problem
I haven't been able to get rid of this one, see the comments in the code.
2010-06-02 04:59:00 +02:00
Marek Olšák
9f8dbd3396 r300g: remove one flush
Looks like it's not needed now.
2010-06-02 04:59:00 +02:00
José Fonseca
489f637741 llvmpipe: Obey color interpolation.
Don't force color to be linearly interpolated when that's not being
requested.
2010-06-01 21:30:57 +01:00
José Fonseca
6ce68ad3ca llvmpipe: Use struct lp_shader_input in the interpolator.
Eliminates all this identical yet slightly different code to decide how
shader inputs should be interpolated.

As bonus, don't interpolate the position twice when it is listed in the
TGSI shader inputs.
2010-06-01 21:30:57 +01:00
Kristian Høgsberg
c7c64d9783 intel: Fallback to meta if we're asked to CopyTexImage2D from RGB to RGBA
The pixel transfer rules state that we must set alpha to 1.0 in this case
which we can't easily do with the blitter.  We can do to passes: one that
sets the alpha to 0xff and one that copies the RGB bits or we can just
use the 3D engine.  Neither approach seems worth it for this case.
2010-06-01 14:33:43 -04:00
Thomas Hellstrom
d12f2bb9c0 st/xorg, vmware: Make throttling configurable.
The xorg state tracker gets two new options to let the user choose
whether to enable / disable dirty throttling and swapbuffer throttling.
The default value of these options are enabled, unless the winsys
supplies a customizer with other values. The customizer record has been
extended to allow this, and also to set winsys-based throttling on a per-
context basis.

The vmware part of this patch disables the dirty throttling if the kernel
supports command submission throttling, and also in that case sets kernel
based throttling for everything but swapbuffers. The vmware winsys does not
set throttling per context, even if it theoretically could, but instead
sets throttling per screen. This should perhaps be changed, should the
xorg state tracker start to use multiple rendering contexts. Kernel throttling
is off by default for all new screens/contexts, so the dri state tracker
is not affected.

This significantly improves interactivity of the vmware xorg driver.

Cherry-picked from commit a8f3b3f88a

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2010-05-31 22:34:59 +01:00
Thomas Hellstrom
cd151effe6 svga: Add a winsys callback to get the svga_winsys_context
The winsys may need to extract the svga_winsys_context from a
pipe_context. Add a function to enable that functionality.

Cherry-picked from commit e8a8c5e339

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2010-05-31 22:34:59 +01:00
José Fonseca
056ae405b6 tgsi: Drop uses_fogcoord and uses_frontfacing from tgsi_scan.
It was not used anywhere; the code was buggy (it didn't take care of
indirect registers and could potential cause buffer underflows) and the
same effect can now be easily achieved by just by looking at
input_semantic_name[] and input_usage_mask[].
2010-06-01 16:39:04 +01:00
José Fonseca
2c67e754cf tgsi: Remove tgsi-instruction-set.txt.
Deprecated by tgsi.rst, and no point in keeping it around if it's not
being updated.
2010-06-01 16:39:04 +01:00
José Fonseca
149cb7682e llvmpipe: Don't waste time interpolating unused input channels. 2010-06-01 16:39:03 +01:00
José Fonseca
abe4f3d1aa tgsi: Determine which shader input channels are effectively.
TGSI's UsageMask flag is never set. We can move this logic into
tgsi_ureg, but there there are still cases where's not used, so this
seems a better place for now.
2010-06-01 16:39:03 +01:00
José Fonseca
d9c6ebb4fe gallium/docs: Update FRAC -> FRC. 2010-06-01 16:39:03 +01:00
Brian Paul
1bbf803e3b mesa: use split_location_offset() in GetUniform() functions
Commit 5d0e136eff exposed a long-standing
bug in the glGetUniform*() code paths.  We weren't properly decoding
the location parameter.

Fixes fd.o bug/regression 28344

Note: this patch should go into the 7.8 branch after the above-mentioned
commit.
2010-06-01 09:02:10 -06:00
Thomas Hellstrom
7356d1c140 st/xorg: Fix Xv cliprect scaling.
Due to a quantization error, different cliprects of scaled video windows may
not have identical x / y scale.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-05-31 18:33:09 +01:00
Thomas Hellstrom
195c476f9f st/xorg Avoid advertizing rotation / reflection support.
We don't support it yet since we don't implement the shadow allocate
functions.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-05-31 18:33:05 +01:00
Chia-I Wu
79e5bea3cb vgapi: Generate PIC objects.
Fixes "...; recompile with -fPIC" error on x86-64.  See fdo 28336.
2010-06-01 07:33:29 +08:00
José Fonseca
4e6c880ea2 glapi: Generate PIC objects.
Fixes fdo 28336.
2010-05-31 22:11:38 +01:00
José Fonseca
524ec6464d llvmpipe: Show fs's TGSI when LP_DEBUG=tgsi is set. 2010-05-31 21:58:38 +01:00
Chia-I Wu
a27690931b st/egl: Use stamps only to avoid unnecessary geometry update.
resource_surface_add_resources should still be called even when the
stamps match.  For example, a caller may ask for two different sets of
attachments.
2010-05-31 20:06:59 +08:00
Chia-I Wu
593cf8b54c mesa: Fix excess initializers in get.c table. 2010-05-31 17:37:42 +08:00
Dave Airlie
8d789be034 swrast: add TFP support to swrast.
This adds TFP support to the swrast driver, with this I can run gnome-shell inside Xephyr slowly. I've no idea why I did it, and g-s has other rendering issues under swrast, but it might be useful to hook up llvmpipe later. I've no idea if I even want to commit it at this point.

An enhanced version might just pass the pointer in the indirect rendering case
and avoid the memcpy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-31 19:28:08 +10:00
Dave Airlie
47de9adece gallium: fix TFP on gallium
This fixes an uninitialised value use in the dri2 st when doing TFP.

It uses the driContextPriv which isn't initialised at alloc time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-31 19:28:08 +10:00
Chia-I Wu
7ede18abac st/egl: Update KMS backend to use resource_surface. 2010-05-31 17:03:58 +08:00
Chia-I Wu
e4400a48a6 st/egl: Update GDI backend to use resource_surface. 2010-05-31 17:03:58 +08:00
Chia-I Wu
f38a20b461 st/egl: Update ximage backend to use resource_surface. 2010-05-31 17:03:58 +08:00
Chia-I Wu
e1e0307c91 st/egl: Add helper functions for use by backends.
There is only resource_surface for now.  It helps manage the resources
of a software-based native surface such as XImage or GDI.
2010-05-31 17:03:58 +08:00
Chris Wilson
8accf0a891 intel: Initialize batch->reserved_space on allocation
Fixes the assert (and buffer overrun):

  glknots: intel_batchbuffer.c:164: _intel_batchbuffer_flush: Assertion
  'used >= batch->buf->size' failed.

Reported in bug:

  Bug 28274 - xscreensaver's glknots hangs GPU (945GME/Pineview)
  https://bugs.freedesktop.org/show_bug.cgi?id=28274

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31 09:58:25 +01:00
Chia-I Wu
636f7becfd targets/egl: Add SConscript for egl-apis.
It will build api_OpenVG.dll on Windows.
2010-05-31 13:28:03 +08:00
Chia-I Wu
e5b5d84e8a st/vega: Use SConscript for Windows build.
Fix several portability issues and add SConscript for Windows build.
2010-05-31 13:28:01 +08:00
Chia-I Wu
a2f3115307 gallium/util: Define isfinite and isnan for MSVC.
Define isfinite and isnan to _finite and _isnan respectively for MSVC.
Those macros are needed by st/vega.
2010-05-31 13:27:58 +08:00
Chia-I Wu
60558b1594 mapi/vgapi: Add SConscript for Windows build. 2010-05-31 13:27:53 +08:00
Chia-I Wu
f6f9d1014b st/egl: Use OS-specific module suffices.
At least, .dll is used on Windows.
2010-05-31 13:27:48 +08:00
Chia-I Wu
ec0bab3a51 targets/egl: Add SConscript for egl_gdi_swrast.
egl_gdi_swrast uses st/egl/gdi and winsys/sw/gdi to provide an EGL
driver for Windows.
2010-05-31 13:27:46 +08:00
Chia-I Wu
a8e195ec24 st/egl: Add GDI backend.
The backend uses Windows GDI driver to provide a software EGL
implementation on Windows.
2010-05-31 13:27:44 +08:00
Chia-I Wu
1e6c10f4be egl: Use SConscript for Windows build.
Fix several portability issues and add SConscript for Windows build.
2010-05-31 13:27:41 +08:00
Chia-I Wu
0d820fc203 egl: Use khronos types for EGL_MESA_screen_surface.
That is, use khronos_uint32_t instead of uint32_t.
2010-05-31 11:31:08 +08:00
Chia-I Wu
ba26631d0d Define PUBLIC to dllexport on MSVC.
Define PUBLIC to __declspec(dllexport) when _MVC_VER is defined.
2010-05-31 11:31:07 +08:00
Chia-I Wu
14f1157a2e Update KHRONOS_APICALL for _WIN32 platform.
Use __declspec(dllexport) when KHRONOS_DLL_EXPORTS is defined.
2010-05-31 11:31:07 +08:00
Chia-I Wu
d2cb999045 Always define int32_t in compiler headers.
eglplatform.h no longer defines int32_t.
2010-05-31 11:00:01 +08:00
Chia-I Wu
fa97399f42 glapi: Update SConscript for Windows.
Define macros to enable dllexport and thread support.  Adjust the output
path of mapi sources.
2010-05-31 10:53:29 +08:00
Chia-I Wu
59f8dca7cf Update OpenGL ES headers. 2010-05-31 10:43:17 +08:00
Chia-I Wu
8e1b375a8d autoconf: Remove unused APIS.
It was used by glapi, which has been moved to mapi.
2010-05-31 10:43:00 +08:00
Chia-I Wu
c08449b78e mesa: Fix/add feature test to shader.c.
Those macros used by _mesa_init_shader_dispatch are not available when
FEATURE_GL is not defined.
2010-05-31 10:40:56 +08:00
Marek Olšák
21dfcde3ff r300g: set correct pitch in libdrm
to match what DDX sets. This prevents some flushes from occuring.
2010-05-31 04:16:24 +02:00
Marek Olšák
7a4601db52 r300g: remove texture usage transfer flag 2010-05-31 04:16:24 +02:00
Marek Olšák
4182d3ea00 r600g: remove unused struct r600_state
What was the purpose of it?
2010-05-31 04:16:24 +02:00
Vinson Lee
33c2dbe5b0 vbo: Remove unnecessary header. 2010-05-30 15:47:21 -07:00
Vinson Lee
1202f17063 r600g: Remove unnecessary headers. 2010-05-30 15:30:05 -07:00
Alex Deucher
3b869b4cdb r600g: RS880 is r6xx-based
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-30 16:08:55 -04:00
José Fonseca
7f1c007840 llvmpipe: Remove unused framebuffer stuff from the rasterizer. 2010-05-30 16:39:14 +01:00
José Fonseca
2b7fbccfdc llvmpipe: Don't force a linear to tiled conversion after rasterization on debug builds.
Only do this if runtime debugging flags to show subtiles/tiles are set.
2010-05-30 16:39:06 +01:00
José Fonseca
82715bb227 llvmpipe: Call llvmpipe_set_texture_tile_layout only when necessary.
Like the other places.
2010-05-30 16:38:46 +01:00
José Fonseca
b57e18c35c util: Add inline function for approximate floating point comparison. 2010-05-30 16:38:41 +01:00
José Fonseca
f503b3dd9d llvmpipe: Use pointer_to_func() instead of custom wrappers. 2010-05-30 16:38:23 +01:00
José Fonseca
4b29da1226 draw: Use pointer_to_func() instead of custom wrappers. 2010-05-30 16:38:03 +01:00
José Fonseca
6f67a71aad util: Generic pointer to func conversion helper.
That observes strict-aliasing rules.
2010-05-30 16:36:08 +01:00
José Fonseca
18fb9ff6d8 llvmpipe: Pass the fs variant to the rasterizer. 2010-05-30 10:30:01 +01:00
José Fonseca
dc10943038 python/retrace: Interpret resource_copy_region. 2010-05-30 10:30:01 +01:00
José Fonseca
311227abbb st/python: Expose region_copy/fill_region instead of deprecated surface_copy/fill 2010-05-30 10:30:01 +01:00
Chia-I Wu
0f37f242dd st/vega: Use FREE.
Match MALLOC with FREE.  Otherwise, it causes weird segfaults when built
with memory debugging.
2010-05-30 11:11:27 +08:00
Chia-I Wu
a5183a38c2 st/egl: Hook eglCreatePbufferFromClientBuffer.
This is some refactoring works.  Creating a pbuffer from an
EGL_OPENVG_IMAGE is still not supported.
2010-05-30 11:09:30 +08:00
Chia-I Wu
9d7219c560 st/egl: Fix eglCopyBuffers.
It was broken since surface_copy -> resource_copy_region transition.
2010-05-30 11:05:15 +08:00
Chia-I Wu
20c3d7190e st/egl: Initialize KMS backend from an fd.
Check if the native native is EGL_DEFAULT_DISPLAY.  If not, treat it as
an fd.
2010-05-30 10:52:50 +08:00
Marek Olšák
b202c78586 r300: fix blits for textures of width/height greater than 2048 on r5xx
Yes I am fixing r300c ... who knew?
2010-05-29 17:44:20 +02:00
Marek Olšák
b5c147caba r600g: remove unused variable 2010-05-29 15:41:22 +02:00
Marek Olšák
7d9396d7cf r600g: fix gallium function parameters 2010-05-29 15:41:22 +02:00
Marek Olšák
1d57b6ebd1 r600g: make a local copy of viewport state 2010-05-29 15:41:22 +02:00
Carl Worth
96d3994881 Merge branch 'take-2'
The take-2 branch started over with a new grammar based directly on
the grammar from the C99 specification. It doesn't try to capture
things like balanced sets of parentheses for macro arguments in the
grammar. Instead, it merely captures things as token lists and then
performs operations like parsing arguments and expanding macros on
those lists.

We merge it here since it's currently behaving better, (passing the
entire test suite). But the code base has proven quite fragile
really. Several of the recently added test cases required additional
special cases in the take-2 branch while working trivially on master.

So this merge point may be useful in the future, since we might have a
cleaner code base by coming back to the state before this merge and
fixing it, rather than accepting all the fragile
imperative/list-munging code from the take-2 branch.
2010-05-29 06:03:40 -07:00
Carl Worth
ae3fb09cd2 Add three more tests cases recently added to the take-2 branch.
The 071-punctuator test is failing only trivially (whitespace change only).

And the 072-token-pasting-same-line.c test passes just fine here, (more
evidence perhaps that the approach in take-2 is more trouble than it's
worth?).

The 099-c99-example test case is the inspiration for much of the rest
of the test suite. It amazingly passes on the take-2 branch, but
doesn't pass here yet.
2010-05-29 06:01:32 -07:00
Carl Worth
75ef1c75dd Add killer test case from the C99 specification.
Happily, this passes now, (since many of the previously added test
cases were extracted from this one).
2010-05-29 05:57:22 -07:00
Carl Worth
b06096e86e Add test and fix bugs with multiple token-pasting on the same line.
The list replacement when token pasting was broken, (failing to
properly update the list's tail pointer). Also, memory management when
pasting was broken, (modifying the original token's string which would
cause problems with multiple calls to a macro which pasted a literal
string). We didn't catch this with previous tests because they only
pasted argument values.
2010-05-29 05:54:19 -07:00
Carl Worth
631016946c Fix pass-through of '=' and add a test for it.
Previously '=' was not included in our PUNCTUATION regeular expression,
but it *was* excldued from our OTHER regular expression, so we were
getting the default (and hamful) lex action of just printing it.

The test we add here is named "punctuator" with the idea that we can
extend it as needed for other punctuator testing.
2010-05-29 05:07:24 -07:00
Jakob Bornecrantz
e7f0f6bb72 i915g: Rename winsys c file 2010-05-29 13:31:30 +02:00
Jakob Bornecrantz
835f5a65a1 i915g: Move pci id to winsys struct 2010-05-29 13:30:25 +02:00
Jakob Bornecrantz
bbaaf823fa targets/egl: Give egl targets a good build enviroment 2010-05-29 13:19:13 +02:00
Kristian Høgsberg
0defc25977 egl_dri2: Split driver loading out into its own function 2010-05-28 21:31:22 -04:00
Kristian Høgsberg
c5ddaa2cd7 egl_dri2: Check for xcb_connect() failure the right way
It always returns a valid xcb_connection_t, but if connection failed, it's in the
error state.
2010-05-28 21:31:22 -04:00
Marek Olšák
ba10b2732b r600g: fix build 2010-05-29 02:31:44 +02:00
Roland Scheidegger
1e17178fc4 llvmpipe: adapt to clear interface changes
with some newfangled code, should support separate depth/stencil clears.
Needs some testing.
2010-05-29 01:31:01 +02:00
Roland Scheidegger
837d32062e i965g: adapt to clear interface changes
just like i915g, should in theory support separate depth/stencil clears
(untested), with the same 2d blitter hacks.
2010-05-29 01:29:31 +02:00
Roland Scheidegger
4bc7b14224 i915g: adapt to clear interface changes
should in theory support separate depth/stencil clears (untested).
Also fix some format omissions?
2010-05-29 01:28:21 +02:00
Roland Scheidegger
10baf7ec1d r300g: adapt to clear interface changes
should support separate depth/stencil clears just fine with changed u_blitter.
2010-05-29 01:26:22 +02:00
Roland Scheidegger
e5b82c8222 nv50: adapt to clear interface changes
should support separate depth/stencil clears just fine.
2010-05-29 01:25:09 +02:00
Roland Scheidegger
c5cccf8a49 nvfx: adapt to clear interface changes 2010-05-29 01:24:25 +02:00
Roland Scheidegger
d1998962ef svga: adapt to clear interface changes
this should support separate stencil/depth clears just fine.
2010-05-29 01:22:23 +02:00
Roland Scheidegger
72c77d472b softpipe: adapt to clear interface changes 2010-05-29 01:21:15 +02:00
Roland Scheidegger
9d596ea492 rbug: adapt to clear interface changes 2010-05-29 01:20:11 +02:00
Roland Scheidegger
e4de4b0755 trace: adapt to clear interface changes 2010-05-29 01:19:59 +02:00
Roland Scheidegger
25296a3ed3 identity: adapt to clear interface changes 2010-05-29 01:19:48 +02:00
Roland Scheidegger
9eae3fd992 fo: adapt to clear interface changes 2010-05-29 01:19:24 +02:00
Roland Scheidegger
821498bd6f cell: adapt to clear interface changes 2010-05-29 01:18:47 +02:00
Roland Scheidegger
c350068720 st/python: adapt to clear interface changes 2010-05-29 01:18:17 +02:00
Carl Worth
614a9aece0 Add two more (failing) tests from the take-2 branch.
These tests were recently fixed on the take-2 branch, but will require
additional work before they will pass here.
2010-05-28 15:15:59 -07:00
Carl Worth
b1249f69fd Add two (passing) tests from the take-2 branch.
These two tests were tricky to make work on take-2, but happen to
already eb working here.
2010-05-28 15:15:00 -07:00
Carl Worth
792bdcbeee Tweak test 25 slightly, (so the non-macro doesn't end the file).
This isn't a problem here, but on the take-2 branch, it was trickier
at one point to make a non-macro work when the last token of the file.

So we use the simpler test case here and defer the other case until
later.
2010-05-28 15:13:11 -07:00
Carl Worth
c7144dc2e0 Remove some blank lines from the end of some test cases.
To match what we have done on the take-2 branch to these test cases.
2010-05-28 15:12:36 -07:00
Carl Worth
681afbc855 Perform macro by replacing tokens in original list.
We take the results of macro expansion and splice them into the
original token list over which we are iterating. This makes it easy
for function-like macro invocations to find their arguments since they
are simply subsequent tokens on the list.

This fixes the recently-introduced regressions (tests 55 and 56) and
also passes new tests 60 and 61 introduced to strees this feature,
(with macro-argument parentheses split between a macro value and the
textual input).
2010-05-28 15:10:27 -07:00
Roland Scheidegger
783083c3b8 st/mesa: use new ability to clear only depth or stencil 2010-05-29 00:04:14 +02:00
Roland Scheidegger
a1d5131d2e util: adapt to clear interface changes 2010-05-29 00:02:05 +02:00
Roland Scheidegger
0cd70b554c gallium: clear interface changes
clears were a bit limited in gallium:
- no scissoring (OGL only) nor explicit rectangle list (d3d9)
- no color/stencil masks (OGL only)
- no separate depth/stencil clears (d3d9/d3d10/OGL)
- cannot really clear single color buffer (only with resource_fill_region)

Additionally, d3d can clear surfaces not currently bound to the framebuffer.

It is, however, not easy to find some common ground what a clear should be able
to do, due to both API requirements and also hw differences (a case which might
be able to use a special clear path on one hw might need a "normal" quad render
on another).

Hence several clear methods are provided, and a driver should implement all of
them.
- clear: slightly modified to also be able to clear only depth or stencil in a
  combined depth/stencil surface. This is however optional based on driver
  capability though ideally it wouldn't be optional. AFAIK this is in fact
  something used by applications quite a bit.
  Otherwise, for now still doesn't allow clearing with scissors/mask (or single
  color buffers)
- clearRT: clears a single (potentially unbound) color surface. This was formerly
  roughly known as resource_fill_region. mesa st will not currently use this,
  though potentially would be useful for GL ClearBuffer.
- clearDS: similar to above except for depth stencil surfaces.

Note that clearDS/clearRT currently handle can handle partial clear. This might
change however.
2010-05-28 23:57:47 +02:00
Eric Anholt
828f648ac3 i965: Add cache unit -> bo name mapping for more gen6 state objects.
This will help in bufmgr debugging and aub dumping.
2010-05-28 12:51:48 -07:00
Zou Nan hai
9390af0d96 i965: fix PIPE_CONTROL command for gen6.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-05-28 12:51:48 -07:00
Brian Paul
e6d8b4090f llvmpipe: add PIPE_BUFFER to assertion
Fixes regression from commit f2e05acac9.
2010-05-28 13:31:23 -06:00
Brian Paul
f57edc58b5 softpipe: add PIPE_BUFFER to assertion
Fixes regression from commit f2e05acac9.
2010-05-28 13:30:24 -06:00
Brian Paul
151b3bb3af llvmpipe: add out of memory checking to triangle setup path 2010-05-28 12:52:41 -06:00
Brian Paul
5d0e136eff glsl: change uniform location/offset encoding
This lets Mesa work like other OpenGL implementations with regard
to indexing uniform arrays.  See comments for details.

Note: this is a candidate for the 7.8 branch.
2010-05-28 12:52:34 -06:00
Carl Worth
3c93d39705 Simplify calling conventions of functions under expand_token_list_onto.
We previously had a confusing thing where _expand_token_onto would
return a non-zero value to indicate that the caller should then call
_expand_function_onto. It's much cleaner for _expand_token_onto to
just do what's needed and call the necessary function.
2010-05-28 08:17:46 -07:00
Carl Worth
9b519f9c79 Stop interrupting the test suite at the first failure.
This behavior was useful when starting the implementation over
("take-2") where the whole test suite was failing. This made it easy
to focus on one test at a time and get each working.

More recently, we got the whole suite working, so we don't need this
feature anymore. And in the previous commit, we regressed a couple of
tests, so it's nice to be able to see all the failures with a single
run of the suite.
2010-05-28 08:04:13 -07:00
Carl Worth
95ec433d59 Revert "Add support for an object-to-function chain with the parens in the content."
This reverts commit 7db2402a80

It doesn't revert the new test case from that commit, just the
extremely ugly second-pass implementation.
2010-05-28 08:02:07 -07:00
Marek Olšák
f4bcd0cab0 r300g: remove unnecessary breaks 2010-05-28 03:30:11 +02:00
Marek Olšák
ebe2b54663 r300g: report vertex format support in is_format_supported 2010-05-28 03:30:11 +02:00
Marek Olšák
f2e05acac9 st/mesa: advertise ARB_half_float_vertex when available
Both softpipe and llvmpipe pass the piglit half float test.
2010-05-28 03:30:11 +02:00
Marek Olšák
3262554bb3 r300g/swtcl: fix WPOS
There you are! r300->viewport_state is undefined when using SW TCL.

Piglit score (r300g.tests):
HW TCL: 231/275
SW TCL: 233/275
2010-05-28 03:30:11 +02:00
Marek Olšák
49244df5a8 r300g/swtcl: avoid an infinite loop if an occl. query doesn't return anything 2010-05-28 03:30:11 +02:00
Carl Worth
baa17c8748 Remove blank lines from output files before comparing.
Recently I'm seeing cases where "gcc -E" mysteriously omits blank
lines, (even though it prints the blank lines in other very similar
cases). Rather than trying to decipher and imitate this, just get rid
of the blank lines.

This approach with sed to kill the lines before the diff is better
than "diff -B" since when there is an actual difference, the presence
of blank lines won't make the diff harder to read.
2010-05-27 14:53:51 -07:00
Carl Worth
886e05a35a Add test for token-pasting of integers.
This test was tricky to make pass in the take-2 branch. It ends up
passing already here with no additional effort, (since we are lexing
integers as string-valued token except when in the ST_IF state in the
lexer anyway).
2010-05-27 14:45:20 -07:00
Carl Worth
050e3ded1e Implement token pasting of integers.
To do this correctly, we change the lexer to lex integers as string values,
(new token type of INTEGER_STRING), and only convert to integer values when
evaluating an expression value.

Add a new test case for this, (which does pass now).
2010-05-27 14:38:20 -07:00
Jerome Glisse
6a143b8424 r600g: disable rendering
Disable rendering to avoid GPU lockup.
Use radeondb to debug shader compiler :
radeondb -c gallium.bof
radeondb -s gallium.json
Will print shader generated, best is to use fp demos to test
the compiler.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-05-27 23:24:26 +02:00
Bas Nieuwenhuizen
9e8a6f801d r600g: various fixes
- enabled flushing a buffer more than once
- enabled the blitter for r600_clear
- added some more colors to r600_is_format_supported (copied from r600_conv_pipe_format)
- r600_set_framebuffer_state now sets rctx->fb_state
- more states are saved before a blit (had to add some accounting for the viewport and the vertex elements state)
- fixed a few errors with reference counting
2010-05-27 23:24:22 +02:00
Jerome Glisse
e68b4e5053 r600g: fix driver + shader compiler backend change
Change the way we translate from c_compiler to the
asic specific representation. Should make things
simpler.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-05-27 23:24:17 +02:00
Jakob Bornecrantz
aeee52691c r600g: Integrate into build
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:12 +02:00
Jakob Bornecrantz
9abfc5ef60 r600g: Fix buffer offsets
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:07 +02:00
Marek Olšák
b8fb1d75ce r600g: adapt to latest interfaces changes
- Wrapped the buffer and texture create/destroy/transfer/... functions
  using u_resource, which is then used to implement the resource functions.
- Implemented texture transfers.
  I left the buffer and texture transfers separate because one day we'll
  need a special codepath for textures.
- Added index_bias to the draw_*elements functions.
- Removed nonexistent *REP and *FOR instructions.
- Some pipe formats have changed channel ordering, so I've removed/fixed
  nonexistent ones.
- Added stubs for create/set/destroy sampler views.
- Added a naive implementation of vertex elements state (new CSO).
- Reworked {texture,buffer}_{from,to}_handle.
- Reorganized winsys files, removed dri,egl,python directories.
- Added a new build target dri-r600.
2010-05-27 23:24:02 +02:00
Jerome Glisse
72128962d6 r600g: Initial import 2010-05-27 23:23:56 +02:00
Carl Worth
85b50e840d Add placeholder tokens to support pasting with empty arguments.
Along with a passing test to verify that this works.
2010-05-27 14:01:18 -07:00
Brian Paul
3d41dd7934 llvmpipe: s/bool/boolean/ 2010-05-27 14:55:58 -06:00
Brian Paul
bd024ce2b1 llvmpipe: s/bool/boolean 2010-05-27 14:54:21 -06:00
Carl Worth
fb48fcdf9b Add test for macro invocations with empty arguments.
This case was recently solved on the take-2 branch.
2010-05-27 13:44:13 -07:00
Carl Worth
a19297b26e Provide support for empty arguments in macro invocations.
For this we always add a new argument to the argument list as soon as
possible, without waiting until we see some argument token. This does
mean we need to take some extra care when comparing the number of
arguments with the number of expected arguments. In addition to
matching numbers, we also support one (empty) argument when zero
arguments are expected.

Add a test case here for this, which does pass.
2010-05-27 13:29:19 -07:00
Brian Paul
0faefb194e sw/xlib: avoid dereferencing a null pointer 2010-05-27 13:40:16 -06:00
Brian Paul
c3b62bc86c gallivm: add assertions to check type of phi variables 2010-05-27 13:40:16 -06:00
Brian Paul
a504f2387e mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
We want to check the incoming renderbuffer format, not the (potentially
non-existant) current attachment.

Fixes segfault w/ fbotexture -ds2.

NOTE: this will be applied to the 7.8 branch too.
2010-05-27 13:11:08 -06:00
Marek Olšák
90e5a37d12 r300g/swtcl: fix secondary color and back-face color outputs
These piglit tests have been fixed:
- bgra-sec-color-pointer
- glsl-routing

See comments at the beginning of r300_vs_draw.c

WPOS is implemented too but it doesn't work yet. I'm still working on it.
2010-05-27 20:56:32 +02:00
Carl Worth
a65cf7b1d2 Make two list-processing functions do nothing with an empty list.
This just makes these functions easier to understand all around.  In
the case of _token_list_append_list this is an actual bug fix, (where
append an empty list onto a non-empty list would previously scramble
the tail pointer of the original list).
2010-05-27 11:55:36 -07:00
José Fonseca
8bd3a4c1aa llvmpipe: Refer to my personal udis86 repository.
As it has a bunch of fixes/additions not merged by upstream yet.
2010-05-27 19:40:10 +01:00
José Fonseca
571ee049f2 util: Also add a define for the dynamic library's prefix. 2010-05-27 19:37:56 +01:00
Brian Paul
057f7e8140 egl/mks: remove extra param from function call 2010-05-27 12:04:43 -06:00
Brian Paul
462bccef4f egl_g3d: add missing param to egl_g3d_st_manager_get_egl_image() 2010-05-27 12:04:08 -06:00
Carl Worth
602a34769a Add test 56 for a comma within the expansion of an argument.
This case was tricky on the take-2 branch. It happens to be passing already
here.
2010-05-27 10:14:38 -07:00
Carl Worth
dd7490093d Avoid treating an expanded comma as an argument separator.
That is, a function-like invocation foo(x) is valid as a
single-argument invocation even if 'x' is a macro that expands into a
value with a comma. Add a new COMMA_FINAL token type to handle this,
and add a test for this case, (which passes).
2010-05-27 10:12:33 -07:00
Brian Paul
df64122c30 fbdev: some hacking to get the driver to compile (untested) 2010-05-27 09:46:32 -06:00
Brian Paul
a4bd52adba update linux-fbdev config 2010-05-27 09:46:21 -06:00
Brian Paul
3644dbbdbd vbo: comments and whitespace 2010-05-27 09:40:33 -06:00
Brian Paul
4225c4e1b0 vbo: remove unused prototype 2010-05-27 09:40:33 -06:00
Brian Paul
9aae67ca3a vbo: remove dead code 2010-05-27 09:40:33 -06:00
Brian Paul
b6187057be vbo: update/add comments 2010-05-27 09:40:33 -06:00
Vinson Lee
f49a65628f mesa: Remove unnecessary headers. 2010-05-27 08:10:31 -07:00
Kristian Høgsberg
6e9da8ab60 egl: Return NULL if we fail to load a default driver 2010-05-27 09:59:27 -04:00
Brian Paul
7d7bdee50d mesa: remove unused includes 2010-05-26 22:42:13 -06:00
Brian Paul
eb88c02a4b mesa: rewrite _mesa_get_handle() and add some comments 2010-05-26 22:40:38 -06:00
Brian Paul
69861ae497 mesa: move GLSL uniform functions into new source file 2010-05-26 22:30:10 -06:00
Vinson Lee
655c9a0533 st/mesa: Remove unnecessary headers. 2010-05-26 20:12:33 -07:00
Ian Romanick
e668c2a9ee Reimplement ir_function_inlining_visitor using ir_hierarchical_vistor 2010-05-26 18:58:27 -07:00
Ian Romanick
2fd22486d4 Reimplement ir_copy_propagation_visitor using ir_hierarchical_vistor 2010-05-26 17:04:19 -07:00
Carl Worth
7db2402a80 Add support (and test) for an object-to-function chain with the parens in the content.
That is, the following case:

	#define foo(x) (x)
	#define bar
	bar(baz)

which now works with this (ugly) commit.

I definitely want to come up with something cleaner than this.
2010-05-26 17:01:57 -07:00
Carl Worth
a8ea26d7c9 Add two tests developed on the take-2 branch.
The define-chain-obj-to-func-parens-in-text test passes here while the
if-with-macros test fails.
2010-05-26 16:18:05 -07:00
Ian Romanick
4b389492b9 Reimplement ir_expression_flattening_visitor using ir_hierarchical_vistor 2010-05-26 16:07:49 -07:00
Carl Worth
95951ea7bb Treat newlines as space when invoking a function-like macro invocation.
This adds three new pieces of state to the parser, (is_control_line,
newline_as_space, and paren_count), and a large amount of messy
code. I'd definitely like to see a cleaner solution for this.

With this fix, the "define-func-extra-newlines" now passes so we put
it back to test #26 where it was originally (lately it has been known
as test #55).

Also, we tweak test 25 slightly. Previously this test was ending a
file function-like macro name that was not actually a macro (not
followed by a left parenthesis). As is, this fix was making that test
fail because the text_line production expects to see a terminating
NEWLINE, but that NEWLINE is now getting turned into a SPACE here.

This seems unlikely to be a problem in the wild, (function macros
being used in a non-macro sense seems rare enough---but more than
likely they won't happen at the end of a file). Still, we document
this shortcoming in the README.
2010-05-26 16:04:31 -07:00
Carl Worth
0324cad796 All macro lookups should be of type macro_t, not string_list_t.
This is what I get for using a non-type-safe hash-table implementation.
2010-05-26 15:53:05 -07:00
Kenneth Graunke
13e1b6b725 ir_reader: Read record_refs.
Also changes the print visitor to not emit extraneous parenthesis.
2010-05-26 15:24:53 -07:00
Kenneth Graunke
350bd70348 ir_reader: Fix reading of array deferences and correct error messages.
Previously, the syntax was (array_ref <variable name> <index>), but the
subject is now a general rvalue (not a name).  In particular, it might
be a (var_ref ...).

Also, remove "expected ... or (swiz)" from error messages; swiz is not
allowed inside a var_ref.
2010-05-26 15:24:40 -07:00
Ian Romanick
a9159f9e87 Fix setting the maximum accessed array element
Array dereferences now point to variable dereferences instead of
pointing directly to variables.  This necessitated some changes to the
way the variable is accessed when setting the maximum index array element.
2010-05-26 15:23:25 -07:00
Ian Romanick
fd55da2147 ir_dereference::mode is no longer used, kill with fire 2010-05-26 15:23:25 -07:00
Ian Romanick
b067db2e25 Refactor whole-variable assigment checking into member function 2010-05-26 15:23:25 -07:00
Ian Romanick
36ea28646c Refactor ir_dereference data fields to subclasses 2010-05-26 15:23:25 -07:00
Ian Romanick
7fe3de6fde Replace open coded deref navigation with hierarchical visitors 2010-05-26 15:23:25 -07:00
Ian Romanick
c7b1046a9f Refactor ir_dereference support for ir_visitor
Move the accept method for visitors from ir_dereference to the derived
classes.
2010-05-26 15:23:25 -07:00
Ian Romanick
f3a002b503 Refactor ir_dereference support for ir_hierarchical_visitor
Move the accept method for hierarchical visitors from ir_dereference
to the derived classes.  This was mostly straight-forward, but I
suspect that ir_dead_code_local may be broken now.
2010-05-26 15:23:25 -07:00
Ian Romanick
70fe8b6663 Begin refactoring ir_dereference
Create separate subclasses of ir_dereference for variable, array, and
record dereferences.  As a side effect, array and record dereferences
no longer point to ir_variable objects directly.  Instead they each
point to an ir_dereference_variable object.

This is the first of several steps in the refactoring process.  The
intention is that ir_dereference will eventually become an abstract
base class.
2010-05-26 15:23:19 -07:00
Will Dyson
055750fafb Enable hardware mipmap generation for radeon.
Use _mesa_meta_GenerateMipmap. It is Fast Enough(tm).

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 18:17:28 -04:00
Will Dyson
a9ee956511 Fix image_matches_texture_obj() MaxLevel check
When generating or uploading a new (higher) mipmap level for an image,
we can need to allocate a miptree for a level greater than
texObj->MaxLevel.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 18:17:28 -04:00
Will Dyson
f49da110a8 Fallback to software render if there is no miptree for an image
This can happen when checking if a software fallback for a higher level
operation (such as GenerateMipmap) is needed.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 18:17:28 -04:00
Marek Olšák
76034aaf65 r300g: decouple drawing code and two-sided stencil refvalue fallback
It's now more separate from the rest of the driver and it can be disabled
by commenting out just 1 line. Well, I couldn't make the previous version
work with SW TCL reliably, that's the reason of this little rework.
2010-05-27 00:08:42 +02:00
Marek Olšák
1345c5bf94 r300g/swtcl: handle large index count properly
This fixes piglit/draw-elements.
2010-05-26 22:39:19 +02:00
Marek Olšák
3a6fd21917 r300g/swtcl: force vertex prefetching for non-indexed primitives 2010-05-26 22:22:52 +02:00
Marek Olšák
55a6d37434 r300g/swtcl: move emitting AOS to prepare_for_rendering 2010-05-26 22:22:52 +02:00
Marek Olšák
500160a3c9 r300g/swtcl: vbo transfer sanity checks 2010-05-26 22:22:52 +02:00
Marek Olšák
a81730cb32 r300g: add get_cs_info winsys entrypoint, abandon check_cs 2010-05-26 22:22:52 +02:00
Marek Olšák
6ca3f86bdc r300g/swtcl: do not use u_upload_mgr and do not compute max_index 2010-05-26 22:22:52 +02:00
Marek Olšák
bbfd785259 r300g: remove unnecessary includes 2010-05-26 22:22:52 +02:00
Eric Anholt
3b68b6c83e i965: Add support for EXT_timer_query on Ironlake.
We could potentially do this on G45 as well, though the units are
different.  On 965, the timestamp is tied to hclk, which would make
supporting it harder.
2010-05-26 12:14:44 -07:00
Eric Anholt
fd3425fdff intel: Handle decode of PIPE_CONTROL instructions. 2010-05-26 12:13:54 -07:00
Eric Anholt
ddb10c3e60 i965: Move Gen6 debugging emit_mi_flush into the Gen6 block. 2010-05-26 12:13:54 -07:00
Eric Anholt
8f61114907 i965: Don't PIPE_CONTROL instruction cache flush.
This is a workaround for Ironlake errata.  The emit_mi_flush is used
for a few purposes:
1) Flushing write caches for RTT (including blit to texture)
2) Pipe fencing for sync objects
3) Spamming cache flushes to track down cache flush bugs

Spamming cache flushes seems less important than following the docs,
and we should probably do that with a different mechanism than the one
for render cache flushes.
2010-05-26 12:13:54 -07:00
Eric Anholt
6e2330daa6 i965: Emit MI_FLUSH before PSP on Ironlake for clip max threads errata. 2010-05-26 12:13:54 -07:00
Carl Worth
8e82fcb070 Implement (and test) support for macro expansion within conditional expressions.
To do this we have split the existing "HASH_IF expression" into two
productions:

First is HASH_IF pp_tokens which simply constructs a list of tokens.

Then, with that resulting token list, we first evaluate all DEFINED
operator tokens, then expand all macros, and finally start lexing from
the resulting token list. This brings us to the second production,
IF_EXPANDED expression

This final production works just like our previous "HASH_IF
expression", evaluating a constant integer expression.

The new test (54) added for this case now passes.
2010-05-26 11:15:21 -07:00
Vinson Lee
80689ae615 gallivm: Remove unnecessary headers. 2010-05-26 11:13:23 -07:00
Vinson Lee
2966a25d3b st/xorg: Remove unnecessary headers. 2010-05-26 10:59:57 -07:00
Vinson Lee
3fa8a8ea28 util: Remove unnecessary headers. 2010-05-26 10:53:54 -07:00
Vinson Lee
67d5a51021 st/dri: Remove dri.c from SCons build.
This was missed in commit f501230db3.
Fixes SCons build.
2010-05-26 10:24:36 -07:00
Carl Worth
16c1e980e2 Fix lexing of "defined" as an operator, not an identifier.
Simply need to move the rule for IDENTIFIER to be after "defined" and
everything is happy.

With this change, tests 50 through 53 all pass now.
2010-05-26 09:37:14 -07:00
Carl Worth
f6914fd37b Implement #if and friends.
With this change, tests 41 through 49 all pass. (The defined operator
appears to be somehow broken so that test 50 doesn't pass yet.)
2010-05-26 09:33:23 -07:00
Carl Worth
8fed1cddae stash 2010-05-26 09:32:12 -07:00
Carl Worth
ad0dee6bb0 Implement token pasting.
Which makes test 40 now pass.
2010-05-26 09:04:50 -07:00
Kristian Høgsberg
cee4220f16 Revert the 'make static' part of 962f926112
The es1 and es2 dispath table initialization code is generated from the
API XML files and we can't easily share the dispatch table code setup.
Keep the _mesa_init_shader_dispatch() part of the patch, but roll back
the static-ization of shader entrypoints so es1 and es2 dispatch
initialization still works.
2010-05-26 11:32:36 -04:00
Carl Worth
ce540f2571 Rename identifier from 'i' to 'node'.
Now that we no longer have nested for loops with 'i' and 'j' we can
use the 'node' that we already have.
2010-05-26 08:30:36 -07:00
Carl Worth
63909fc196 Remove some stale token types.
All the code referencing these was removed some time ago.
2010-05-26 08:16:56 -07:00
Carl Worth
ec4ada01c0 Prevent unexpanded macros from being expanded again in the future.
With this fix, tests 37 - 39 now pass.
2010-05-26 08:15:49 -07:00
Carl Worth
c9dcc08d45 README: Document some known limitations.
None of these are fundamental---just a few things that haven't been
implemented yet.
2010-05-26 08:11:08 -07:00
Carl Worth
b1ae61a2ee Fix a typo in a comment.
Always better to use proper grammar in our grammar.
2010-05-26 08:10:38 -07:00
Carl Worth
d5cd40343f Expand macro arguments before performing argument substitution.
As required by the C99 specification of the preprocessor.

With this fix, tests 33 through 36 now pass.
2010-05-26 08:09:29 -07:00
Carl Worth
0197e9b64f Change macro expansion to append onto token lists rather than printing directly.
This doesn't change any functionality here, but will allow us to make
future changes that were not possible with direct printing.
Specifically, we need to expand macros within macro arguments before
performing argument substitution. And *that* expansion cannot result
in immediate printing.
2010-05-26 08:05:55 -07:00
Carl Worth
c0607d573e Check active expansions before expanding a function-like macro invocation.
With this fix, test 32 no longer recurses infinitely, but now passes.
2010-05-26 08:01:42 -07:00
Carl Worth
039739b2da Defer test 26 until much later (to test 55).
Supporting embedded newlines in a macro invocation is going to be
tricky with our current approach to lexing and parsing. Since this
isn't really an important feature for us, we can defer this until more
important things are resolved.

With this test out of the way, tests 27 through 31 are passing.
2010-05-26 08:00:43 -07:00
Marek Olšák
1bdbc0e38f r300g: fix fence referencing 2010-05-26 16:39:32 +02:00
Brian Paul
d3f598a506 mesa: move all vertex array functions into varray.c 2010-05-25 21:42:13 -06:00
Carl Worth
10ae438399 Avoid getting extra trailing whitespace from macros.
This trailing whitespace was coming from macro definitions and from
macro arguments. We fix this with a little extra state in the
token_list. It now remembers the last non-space token added, so that
these can be trimmed off just before printing the list.

With this fix test 23 now passes. Tests 24 and 25 are also passing,
but they probbably would ahve before this fix---just that they weren't
being run earlier.
2010-05-25 20:39:33 -07:00
Brian Paul
a830eef8c2 mesa: added _mesa_GetVertexAttribIiv / AttribIuiv()
Refactor the code for all the glGetVertexAttrib() functions.
2010-05-25 21:38:02 -06:00
Brian Paul
e00d07cff6 mesa: added _mesa_VertexAttribIPointer() 2010-05-25 21:18:33 -06:00
Brian Paul
e793a24d7c mesa: new GL 3.0 VertexAttrib commands
Still need to plug in API dispatch...
2010-05-25 21:18:33 -06:00
Brian Paul
962f926112 mesa: make a bunch of shader API functions static 2010-05-25 21:18:33 -06:00
Brian Paul
a017c7ecb7 mesa: display list support for uint uniforms
Still need to plug into dispatcher...
2010-05-25 21:18:33 -06:00
Brian Paul
09c7d7bf2a mesa: consolidate some glUniform code 2010-05-25 21:18:32 -06:00
Brian Paul
07b0529e55 mesa: unsigned int uniform functions (GL3) 2010-05-25 21:18:32 -06:00
Brian Paul
91f841aefc mesa: support for unsigned int uniforms 2010-05-25 21:18:32 -06:00
Marek Olšák
f0896e7f80 r300/compiler: implement SGT+SLE opcodes
Reported-by: Gianluca Anzolin <gianluca@sottospazio.it>
2010-05-26 04:47:55 +02:00
Marek Olšák
49bac3ccd8 r300/compiler: fix dumping r5xx vertex shaders 2010-05-26 04:47:27 +02:00
Marek Olšák
5c067a6304 r300/compiler: move hardware caps to the radeon_compiler base struct
Needed for vertex shaders too.
2010-05-26 04:47:26 +02:00
Marek Olšák
f2582da3bb r300/compiler: shorten swizzle expressions 2010-05-26 04:47:26 +02:00
Dave Airlie
15496e06b7 rbug: add set sample mask passthrough.
This at least stops rbug segfaulting at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-26 11:45:32 +10:00
Carl Worth
5aa7ea0809 Remove a bunch of old code and give the static treatment to what's left.
We're no longer using the expansion stack, so its functions can go
along with most of the body of glcpp_parser_lex that was using it.
2010-05-25 18:39:43 -07:00
Carl Worth
652fa272ea Avoid swallowing initial left parenthesis from nested macro invocation.
We weren't including this left parenthesis in the argument's token
list so the nested function invocation wasn not being recognized.

With this fix, tests 21 and 22 now pass.
2010-05-25 17:45:22 -07:00
Carl Worth
c7581c2e6e Ignore separating whitespace at the beginning of a macro argument.
This causes test 16 to pass. Tests 17-20 are also passing now, (though
they would probably have passed before this change and simply weren't
being run yet).
2010-05-25 17:41:07 -07:00
Carl Worth
9ce18cf983 Implement substitution of function parameters in macro calls.
This makes tests 16 - 19 pass.
2010-05-25 17:32:21 -07:00
Carl Worth
e9397867dd Collapse multiple spaces in input down to a single space.
This is what gcc does, and it's actually less work to do
this. Previously we were having to save the contents of space tokens
as a string, but we don't need to do that now.

We extend test #0 to exercise this feature here.
2010-05-25 17:08:07 -07:00
Carl Worth
f8ec4e0be8 Add a test #0 to ensure that we don't do any inadvertent token pasting.
This simply ensures that spaces in input line are preserved.
2010-05-25 17:06:17 -07:00
Carl Worth
f34a0009dd Pass through literal space values from replacement lists.
This makes test 15 pass and also dramatically simplifies the lexer.

We were previously using a CONTROL state in the lexer to only emit
SPACE tokens when on text lines. But that's not actually what we
want. We need SPACE tokens in the replacement lists as well. Instead
of a lexer state for this, we now simply set a "space_tokens" flag
whenever we start constructing a pp_tokens list and clear the flag
whenever we see a '#' introducing a directive.

Much cleaner this way.
2010-05-25 17:06:08 -07:00
Marek Olšák
e6a8513a86 r300g: more efficient finish + fix comments 2010-05-26 01:41:32 +02:00
Carl Worth
b1854fdfb6 Implement simplified substitution for function-like macro invocation.
This supports function-like macro invocation but without any argument
substitution. This now makes test 11 through 14 pass.
2010-05-25 16:28:26 -07:00
Marek Olšák
2c072c8f72 r300g: implement fake but compliant fences 2010-05-26 01:23:11 +02:00
Carl Worth
e6fb7827c9 Implement #undef.
Which is as simple as copying the former action back from the git
history.

Now all tests through test 11 pass.
2010-05-25 15:28:58 -07:00
Carl Worth
ae6517f4a8 Implement expansion of object-like macros.
For this we add an "active" string_list_t to the parser. This makes
the current expansion_list_t in the parser obsolete, but we don't
remove that yet.

With this change we can now start passing some actual tests, so we
turn on real testing in the test suite again. I expect to implement
things more or less in the same order as before, so the test suite now
halts on first error.

With this change the first 8 tests in the suite pass, (object-like
macros with chaining and recursion).
2010-05-25 15:24:59 -07:00
Carl Worth
9fb8b7a495 Make the lexer pass whitespace through (as OTHER tokens) for text lines.
With this change, we can recreate the original text-line input
exactly. Previously we were inserting a space between every pair of
tokens so our output had a lot more whitespace than our input.

With this change, we can drop the "-b" option to diff and match the
input exactly.
2010-05-25 15:04:32 -07:00
Carl Worth
808401fd79 Store parsed tokens as token list and print all text lines.
Still not doing any macro expansion just yet. But it should be fairly
easy from here.
2010-05-25 14:52:43 -07:00
Carl Worth
80dc60b9c3 Delete some trailing whitespace.
This pernicious stuff managed to sneak in on us.
2010-05-25 14:42:00 -07:00
Carl Worth
9bb796f33a Add xtalloc_reference.
Yet another talloc wrapper that should come in handy.
2010-05-25 14:40:47 -07:00
Carl Worth
3ff8167084 Starting over with the C99 grammar for the preprocessor.
This is a fresh start with a much simpler approach for the flex/bison
portions of the preprocessor. This isn't functional yet, (produces no
output), but can at least read all of our test cases without any parse
errors.

The grammar here is based on the grammar provided for the preprocessor
in the C99 specification.
2010-05-25 14:38:15 -07:00
Marek Olšák
e1c117d87b r300g: add r300_init_render_functions, remove r300_render.h 2010-05-25 23:32:25 +02:00
Marek Olšák
73ee4e7eb2 r300g: remove r300_query.h 2010-05-25 23:32:25 +02:00
Marek Olšák
d1dac36004 r300g: remove r300_flush.h 2010-05-25 23:32:25 +02:00
Marek Olšák
85eede1b2f r300g: add r300_init_blit_functions, remove r300_blit.h 2010-05-25 23:32:25 +02:00
Marek Olšák
4d70a25964 util: update comments at blitter 2010-05-25 23:32:25 +02:00
Marek Olšák
16d1fb30a9 util: fix indentation in blitter 2010-05-25 23:32:25 +02:00
Marek Olšák
876de34c91 r300g,util: remove pipe_surface from the util_blitter_copy interface and clean up 2010-05-25 23:32:25 +02:00
Marek Olšák
59e51d9640 r300g,util: remove pipe_surface from the util_blitter_fill interface and clean up 2010-05-25 23:32:25 +02:00
Marek Olšák
85c55f2cf4 util: remove unused util_blitter_copy_surface 2010-05-25 23:32:25 +02:00
Jakob Bornecrantz
b9706886db drm_api: Remove type argument from create screen callback
With the removal of DRI1 support there where no use of this argument,
some drivers didn't even properly check it.
2010-05-25 19:05:07 +01:00
Jakob Bornecrantz
395b605e19 gallium: Remove dri1_api.h and winsys support for DRI1
Since DRI1 support was dropped from st/dri it
makes no sense to keep this code around.
2010-05-25 19:04:11 +01:00
Jakob Bornecrantz
f501230db3 st/dri: Remove DRI1 support
Nobody used it and the current code had been trough so many
changes yet never once being tested.
2010-05-25 19:03:19 +01:00
José Fonseca
378796fe11 llvmpipe: Stop relying on PIPE_FLUSH_TEXTURE_CACHE/PIPE_FLUSH_RENDER_CACHE magic.
Flush means flush, i.e., all previous operations should be visible from
other contexts.

This does not imply unswizzling tiles, since unswizzling should be done on
a needed basis for any context.
2010-05-25 14:39:25 +01:00
José Fonseca
ba404c8f2a gallivm: Choose an appropriate code generation optimization level.
'Default' unless GALLIVM_DEBUG=nopt option is set.
2010-05-25 11:48:00 +01:00
Brian Paul
e5d0c730d1 sw/xlib: NULL-out pointers after freeing image data
This fixes a double-free() error when not using a shared memory XImage.
The XDestroyImage() function frees the ximage->data buffer if non-NULL.
If we free it ourselves, we also need to NULL-out the pointer.
2010-05-24 16:21:55 -06:00
Brian Paul
8cbc1517c1 st/glx: check if deleting head of buffer list 2010-05-24 16:21:55 -06:00
Brian Paul
a949558430 meta: Convert Z value from normalized to object-space in meta code
Convert Z from a normalized value in the range [0, 1] to an
object-space Z coordinate in [-1, +1] so that drawing at the new Z
position with the default/identity ortho projection results in the
original Z value.  Used by the meta-Clear, Draw/CopyPixels and Bitmap
functions where the Z value comes from the clear value or raster
position.

Fixes piglit tests fdo23670-depth_test, quad-invariance and
glsl-orangebook-ch06-bump as well as oglc zbfunc.c.

https://bugs.freedesktop.org/show_bug.cgi?id=23670
2010-05-24 17:22:35 -04:00
Kristian Høgsberg
e88cef3c9d mesa: Reenable check for GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
The check was disabled when FEATURE_OES_framebuffer_object was enabled,
since that used to mean we weren't implementing regular OpenGL semantics.
Now that we can compile in support for multiple APIs, change the #ifdef to
compile the check in when FEATURE_GL is enabled and enable the check for
contexts that implement OpenGL at runtime.
2010-05-24 16:56:56 -04:00
Carl Worth
00f1ec421e Add test for '/', '<<', and '>>' in #if expressions.
These operators have been supported already, but were not covered in
existing tests yet. So this test passes already.
2010-05-24 11:41:36 -07:00
Carl Worth
bb9315f804 Add test of bitwise operators and octal/hexadecimal literals.
This new test covers several features from the last few commits.

This test passes already.
2010-05-24 11:33:07 -07:00
Carl Worth
03f6d5d2d4 Add support for octal and hexadecimal integer literals.
In addition to the decimal literals which we already support. Note
that we use strtoll here to get the large-width integers demanded by
the specification.
2010-05-24 11:29:02 -07:00
Carl Worth
35419095f8 Switch to intmax_t (rather than int) for #if expressions
This is what the C99 specification demands. And the GLSL specification
says that we should follow the "standard C++" rules for #if condition
expressions rather than the GLSL rules, (which only support a 32-bit
integer).
2010-05-24 11:27:23 -07:00
Carl Worth
89b933a243 Add the '~' operator to the lexer.
This was simply missing before, (and unnoticed since we had no test of
the '~' operator).
2010-05-24 11:26:42 -07:00
Brian Paul
c10154a298 glsl: silence unused var warnings 2010-05-24 11:43:55 -06:00
Carl Worth
bcbd587b0f Implement all operators specified for GLSL #if expressions (with tests).
The operator coverage here is quite complete. The one big thing
missing is that we are not yet doing macro expansion in #if
lines. This makes the whole support fairly useless, so we plan to fix
that shortcoming right away.
2010-05-24 10:37:38 -07:00
José Fonseca
6460ba5eeb llvmpipe: Also test compressed formats in lp_test_format() 2010-05-24 16:41:28 +01:00
José Fonseca
f7b57245cc llvmpipe: Fix lp_test_format on 32bit OSes. 2010-05-24 16:38:09 +01:00
Carl Worth
b20d33c5c6 Implement #if, #else, #elif, and #endif with tests.
So far the only expression implemented is a single integer literal,
but obviously that's easy to extend. Various things including nesting
are tested here.
2010-05-20 22:27:07 -07:00
Carl Worth
d8327e575d Implement (and add test) for token pasting.
This is *very* easy to implement now that macro arguments are pre-expanded.
2010-05-20 15:18:54 -07:00
Carl Worth
c10a51ba13 Pre-expand macro arguments at time of invocation.
Previously, we were using the same lexing stack as we use for macro
expansion to also expand macro arguments. Instead, we now do this
earlier by simply recursing over the macro-invocations replacement
list and constructing a new expanded list, (and pushing only *that*
onto the stack).

This is simpler, and also allows us to more easily implement token
pasting in the future.
2010-05-20 15:15:26 -07:00
Carl Worth
b894583fd0 Add xtalloc_asprintf
I expect this to be useful in the upcoming implementation of token pasting.
2010-05-20 15:02:03 -07:00
Carl Worth
876e510bda Finish cleaning up whitespace differences.
The last remaining thing here was that when a line ended with a macro,
and the parser looked ahead to the newline token, the lexer was
printing that newline before the parser printed the expansion of the
macro.

The fix is simple, just make the lexer tell the parser that a newline
is needed, and the parser can wait until reducing a production to
print that newline.

With this, we now pass the entire test suite with simply "diff -u", so
we no longer have any diff options hiding whitespace bugs from
us. Hurrah!
2010-05-20 14:38:06 -07:00
Carl Worth
5a6b9a27fd Avoid printing a space at the beginning of lines in the output.
This fixes more differences compared to "gcc -E" so removes several
cases of erroneously failing test cases. The implementation isn't very
elegant, but it is functional.
2010-05-20 14:29:43 -07:00
Carl Worth
005b32061f Fix bug of consuming excess whitespace.
We fix this by moving printing up to the top-level "input" action and
tracking whether a space is needed between one token and the next.

This fixes all actual bugs in test-suite output, but does leave some
tests failing due to differences in the amount of whitespace produced,
(which aren't actual bugs per se).
2010-05-20 14:19:57 -07:00
Carl Worth
ff13cfed81 Remove unused function _print_string_list
The only good dead code is non-existing dead code.
2010-05-20 14:08:19 -07:00
Carl Worth
323421db65 Remove "unnecessary" whitespace from some tests.
This whitespace was not part of anything being tested, and it
introduces differences (that we don't actually care about) between the
output of "gcc -E" and glcpp.

Just eliminate this extra whitespace to reduce spurious test-case
failures.
2010-05-20 14:05:37 -07:00
Carl Worth
660bda057a Stop ignoring whitespace while testing.
Sometime back the output of glcpp started differing from the output of
"gcc -E" in the amount of whitespace in emitted. At the time, I
switched the test suite to use "diff -w" to ignore this. This was a
mistake since it ignores whitespace entirely. (I meant to use "diff
-b" which ignores only changes in the amount of whitespace.)

So bugs have since been introduced that the test suite doesn't
notice. For example, glcpp is producing "twotokens" where it should be
producing "two tokens".

Let's stop ignoring whitespace in the test suite, which currently
introduces lots of failures---some real and some spurious.
2010-05-20 14:01:59 -07:00
Carl Worth
805ea6afe6 Add test (and fix) for a function argument of a macro that expands with a comma.
The fix here is quite simple (and actually only deletes code). When
expanding a macro, we don't return a ',' as a unique token type, but
simply let it fall through to the generic case.
2010-05-20 12:06:33 -07:00
Carl Worth
9f3d2c4e3d Add support for commas within parenthesized groups in function arguments.
The specification says that commas within a parenthesized group,
(that's not a function-like macro invocation), are passed through
literally and not considered argument separators in any outer macro
invocation.

Add support and a test for this case. This support makes a third
occurrence of the same "FUNC_MACRO (" shift/reduce conflict appear, so
expect that.

This change does introduce a fairly large copy/paste block in the
grammar which is unfortunate. Perhaps if I were more clever I'd find a
way to share the common pieces between argument and argument_or_comma.
2010-05-20 08:46:54 -07:00
Carl Worth
b569383bbd Avoid re-expanding a macro name that has once been rejected from expansion.
The specification of the preprocessor in C99 says that when we see a
macro name that we are already expanding that we refuse to expand it
now, (which we've done for a while), but also that we refuse to ever
expand it later if seen in other contexts at which it would be
legitimate to expand.

We add a test case for that here, and fix it to work. The fix takes
advantage of a new token_t value for tokens and argument words along
with the recently added IDENTIFIER_FINALIZED token type which
instructs the parser to not even look for another expansion.
2010-05-20 08:01:44 -07:00
Carl Worth
472524413d Use new token_list_t rather than string_list_t for macro values.
There's not yet any change in functionality here, (at least according
to the test suite). But we now have the option of specifying a type
for each string in the token list. This will allow us to finalize an
unexpanded macro name so that it won't be subjected to excess
expansion later.
2010-05-19 13:54:37 -07:00
Carl Worth
aaa9acbf10 Perform "re lexing" on string list values rathern than on text.
Previously, we would pass original strings back to the original lexer
whenever we needed to re-lex something, (such as an expanded macro or
a macro argument). Now, we instead parse the macro or argument
originally to a string list, and then re-lex by simply returning each
string from this list in turn.

We do this in the recently added glcpp_parser_lex function that sits
on top of the lower-level glcpp_lex that only deals with text.

This doesn't change any behavior (at least according to the existing
test suite which all still passes) but it brings us much closer to
being able to "finalize" an unexpanded macro as required by the
specification.
2010-05-19 13:28:24 -07:00
Carl Worth
71c59ec66b Remove unused NEWLINE token.
We fixed the lexer a while back to never return a NEWLINE token, but
negelcted to clean up this declaration.
2010-05-19 10:07:31 -07:00
Carl Worth
66df1c262a Remove unneeded YYLEX_PARAM define.
I'm not sure where this came from, but it's clearly not needed.
2010-05-19 10:06:56 -07:00
Carl Worth
0293b2e2dd Rename yylex to glcpp_parser_lex and give it a glcpp_parser_t* argument.
Much cleaner this way, (and now our custom lex function has access to
all the parser state which it will need).
2010-05-19 10:05:40 -07:00
Carl Worth
8f38aff9b5 Add a wrapper function around the lexer.
We rename the generated lexer from yylex to glcpp_lex. Then we
implement our own yylex function in glcpp-parse.y that calls
glcpp_lex. This doesn't change the behavior at all yet, but gives us a
place where we can do implement alternate lexing in the future.

(We want this because instead of re-lexing from strings for macro
expansion, we want to lex from pre-parsed token lists. We need this so
that when we terminate recursion due to an already active macro
expansion, we can ensure that that symbol never gets expanded again
later.)
2010-05-19 10:01:29 -07:00
Carl Worth
5d21142545 Like previous fix, but for object-like macros (and add a test).
The support for an object-like amcro within a macro-invocation
argument was also implemented at one level too high in the
grammar. Fortunately, this is a very simple fix.
2010-05-19 07:57:03 -07:00
Carl Worth
59ca98990f Fix bug as in previous fix, but with multi-token argument.
The previous fix added FUNC_MACRO to a production one higher in teh
grammar than it should have. So it prevented a FUNC_MACRO from
appearing as part of a mutli-token argument rather than just alone as
an argument. Fix this (and add a test).
2010-05-19 07:49:47 -07:00
Carl Worth
69f390d609 Fix bug (and test) for an invocation using macro name as a non-macro argument
This adds a second shift/reduce conflict to our grammar. It's basically the
same conflict we had previously, (deciding to shift a '(' after a FUNC_MACRO)
but this time in the "argument" context rather than the "content" context.

It would be nice to not have these, but I think they are unavoidable
(withotu a lot of pain at least) given the preprocessor specification.
2010-05-19 07:42:42 -07:00
Carl Worth
be0e2e9b2a Fix bug (and add tests) for a function-like macro defined as itself.
This case worked previously, but broke in the recent rewrite of
function- like macro expansion. The recursion was still terminated
correctly, but any parenthesized expression after the macro name was
still being swallowed even though the identifier was not being
expanded as a macro.

The fix is to notice earlier that the identifier is an
already-expanding macro. We let the lexer know this through the
classify_token function so that an already-expanding macro is lexed as
an identifier, not a FUNC_MACRO.
2010-05-19 07:29:22 -07:00
Carl Worth
a807fb72c4 Rewrite macro handling to support function-like macro invocation in macro values
The rewrite her discards the functions that did direct, recursive
expansion of macro values. Instead, the parser now pushes the macro
definition string over to a stack of buffers for the lexer. This way,
macro expansion gets access to all parsing machinery.

This isn't a small change, but the result is simpler than before (I
think). It passes the entire test suite, including the four tests
added with the previous commit that were failing before.
2010-05-18 22:10:04 -07:00
Carl Worth
d476db38fe Add several tests where the defined value of a macro is (or looks like) a macro
Many of these look quite similar to existing tests that are handled
correctly, yet none of these work. For example, in test 30 we have a
simple non-function macro "foo" that is defined as "bar(baz(success))"
and obviously non-function macro expansion has been working for a long
time.  Similarly, if we had text of "bar(baz(success))" it would be
expanded correctly as well.

But when this otherwise functioning text appears as the body of a
macro, things don't work at all.

This is pointing out a fundamental problem with the current
approach. The current code does a recursive expansion of a macro
definition, but this doesn't involve the parsing machinery, so it
can't actually handle things like an arbitrary nesting of parentheses.

The fix will require the parser to stuff macro values back into the
lexer to get at all of the existing machinery when expanding macros.
2010-05-18 22:09:57 -07:00
Ian Romanick
461c294ac5 Use ir_rvalue::variable_referenced instead of open coding it 2010-05-18 13:53:20 +02:00
Carl Worth
1a29500e72 Fix (and add test for) function-like macro invocation with newlines.
The test has a newline before the left parenthesis, and newlines to
separate the parentheses from the argument.

The fix involves more state in the lexer to only return a NEWLINE
token when termniating a directive. This is very similar to our
previous fix with extra lexer state to only return the SPACE token
when it would be significant for the parser.

With this change, the exact number and positioning of newlines in the
output is now different compared to "gcc -E" so we add a -B option to
diff when testing to ignore that.
2010-05-17 13:21:13 -07:00
Carl Worth
796e1f0ead Expect 1 shift/reduce conflict.
The most recent fix to the parser introduced a shift/reduce
conflict. We document this conflict here, and tell bison that it need
not report it (since I verified that it's being resolved in the
direction desired).

For the record, I did write additional lexer code to eliminate this
conflict, but it was quite fragile, (would not accept a newline
between a function-like macro name and the left parenthesis, for
example).
2010-05-17 12:46:35 -07:00
Ian Romanick
c65cfef317 ir_visit_tree is no longer used, remove ir_visit_tree.{cpp,h} 2010-05-17 12:03:13 -07:00
Ian Romanick
551c9c0deb Reimplement kill_for_derefs using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
77dd4f3536 Reimplement has_call_callback using ir_hierarchical_vistor
This has the added advantage that it will stop traversing the tree as
soon as the first call is found.

The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
a0b4f3d631 Reimplement ir_if_simplicifation_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
458d5c61ef Make visit_list_elements safe against node removals 2010-05-17 12:03:13 -07:00
Ian Romanick
671e4f6321 Reimplement ir_function_can_inline_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
b5a7cf9344 Reimplement ir_dead_code_visitor using ir_hierarchical_vistor
The output of all test cases was verified to be the same using diff.
2010-05-17 12:03:13 -07:00
Ian Romanick
8895bae55b Add ir_hierarchical_visitor base class and associated infrastructure
This type of visitor should eventually replace all or almost all
current uses of ir_visitor.
2010-05-17 12:03:13 -07:00
Ian Romanick
86790dd43f Replace find_dead_code with visit_exec_list
find_dead_code appears to be an open-coded version of visit_exec_list
that was implemented first.
2010-05-17 12:03:13 -07:00
Carl Worth
acf87bc034 Fix bug (and add test) for a function-like-macro appearing as a non-macro.
That is, when a function-like macro appears in the content without
parentheses it should be accepted and passed on through, (previously
the parser was regarding this as a syntax error).
2010-05-17 10:34:29 -07:00
Carl Worth
420d05a15b Add test and fix bug leading to infinite recursion.
The test case here is simply "#define foo foo" and "#define bar foo"
and then attempting to expand "bar".

Previously, our termination condition for the recursion was overly
simple---just looking for the single identifier that began the
expansion. We now fix this to maintain a stack of identifiers and
terminate when any one of them occurs in the replacement list.
2010-05-17 10:15:23 -07:00
Ian Romanick
5d82e239f9 Use ir_rvalue::variable_referenced instead of open-coding it 2010-05-14 17:36:00 -07:00
Ian Romanick
2b3c476fa0 Add ir_rvalue::variable_referenced 2010-05-14 17:35:42 -07:00
Carl Worth
e36a4d5be9 Fix two whitespace bugs in the lexer.
The first bug was not allowing whitespace between '#' and the
directive name.

The second bug was swallowing a terminating newline along with any
trailing whitespace on a line.

With these two fixes, and the previous commit to stop emitting SPACE
tokens, the recently added extra-whitespace test now passes.
2010-05-14 17:29:24 -07:00
Carl Worth
81f01432bd Don't return SPACE tokens unless strictly needed.
This reverts the unconditional return of SPACE tokens from the lexer
from commit 48b94da099 .

That commit seemed useful because it kept the lexer simpler, but the
presence of SPACE tokens is causing lots of extra complication for the
parser itself, (redundant productions other than whitespace
differences, several productions buggy in the case of extra
whitespace, etc.)

Of course, we'd prefer to never have any whitespace token, but that's
not possible with the need to distinguish between "#define foo()" and
"#define foo ()". So we'll accept a little bit of pain in the lexer,
(enough state to support this special-case token), in exchange for
keeping most of the parser blissffully ignorant of whether tokens are
separated by whitespace or not.

This change does mean that our output now differs from that of "gcc -E",
but only in whitespace. So we test with "diff -w now to ignore those
differences.
2010-05-14 17:13:00 -07:00
Carl Worth
4eb2ccf261 Add test with extra whitespace in macro defintions and invocations.
This whitespace is not dealt with in an elegant way yet so this test
does not pass currently.
2010-05-14 17:03:43 -07:00
Carl Worth
3596bb149e Provide implementation for macro arguments containing parentheses.
We were correctly parsing this already, but simply not returning any
value (for no good reason). Fortunately the fix is quite simple.

This makes the test added in the previous commit now pass.
2010-05-14 16:53:52 -07:00
Carl Worth
f6ae186cfd Add test invoking a macro with an argument containing (non-macro) parentheses.
The macro invocation is defined to consume all text between a set of
matched parentheses. We previously tested for inner parentheses from a
nested function-like macro invocation. Here we test for inner
parentheses occuring on their own, (not part of another macro
invocation).
2010-05-14 16:51:54 -07:00
Kenneth Graunke
67e07ad3a3 Refresh autogenerated builtin_function.cpp. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
c8de850dd5 Implement "tan" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
57e7da173e Implement "sin" and "cos" builtins via new expression operators. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
6a9b1e1f06 Implement "cross" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
d9bda3c29d Implement "fract" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
a4b7b5a654 Implement "sign" builtin via a new expression operator. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
c2de187523 Implement "smoothstep" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
a2b63d3ed1 Implement "step" builtin. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
9287ecc3aa Integrate generate_builtins.pl into the build process.
make will now regenerate builtin_function.cpp whenever you
change/add/remove files in the builtins/* folders.
2010-05-14 16:34:46 -07:00
Kenneth Graunke
b3262128fe Replace old builtin_function.cpp with new autogenerated one. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
4c7367b3f9 Add a perl script to generate builtin_function.cpp.
Usage: ./builtins/tools/generate_builtins.pl > builtin_function.cpp
2010-05-14 16:34:46 -07:00
Kenneth Graunke
a40e68b256 Fix bogus expression typing in various builtins. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
e4afc64290 Initial commit of IR for builtins.
These were all generated by Eric's existing builtin_functions.cpp; I split
the uvec* signatures out of 110 into the 130 folder.
2010-05-14 16:34:46 -07:00
Kenneth Graunke
f6c90d8b34 ir_reader: Set function signatures as defined. 2010-05-14 16:34:46 -07:00
Eric Anholt
c05bc5b7cc FS gl_FragCoord and and gl_FrontFacing are FS ins, not outs. 2010-05-14 16:11:37 -07:00
Ian Romanick
2384937835 Fix function call parameter printer to omit extraneous leading comma
The output of all test cases was verified to be the same using diff.
2010-05-14 16:07:04 -07:00
Carl Worth
38bd27b444 Fix expansion of composited macros.
This is a case such as "foo(bar(x))". The recently added test for this
now passes.
2010-05-14 12:05:37 -07:00
Carl Worth
92e7bf0f50 Add test for composed invocation of function-like macros.
This is a case like "foo(bar(x))" where both foo and bar are defined
function-like macros. This is not yet parsed correctly so this test
fails.
2010-05-14 11:50:33 -07:00
Carl Worth
ac070e8bf5 Eliminate a shift/reduce conflict.
By simply allowing for the argument_list production to be empty rather
than the lower-level argument production to be empty.
2010-05-14 11:50:32 -07:00
Carl Worth
8f6a828e4a Support macro invocations with multiple tokens for a single argument.
We provide for this by changing the value of the argument-list
production from a list of strings (string_list_t) to a new
data-structure that holds a list of lists of strings
(argument_list_t).
2010-05-14 11:50:27 -07:00
Carl Worth
db272e6e6f Add test for function-like macro invocations with multiple-token arguments.
These are not yet parsed correctly, so these tests fail.
2010-05-14 11:50:27 -07:00
Carl Worth
2be8be0f74 Make macro-expansion productions create string-list values rather than printing
Then we print the final string list up at the top-level content
production along with all other printing.

Additionally, having macro-expansion productions that create values
will make it easier to solve problems like composed function-like
macro invocations in the future.
2010-05-14 11:50:27 -07:00
Carl Worth
04af13539a Move most printing to the action in the content production.
Previously, printing was occurring all over the place. Here we
document that it should all be happening at the top-level content
production, and we move the printing of directive newlines.

The printing of expanded macros is still happening in lower-level
productions, but we plan to fix that soon.
2010-05-14 11:50:27 -07:00
Carl Worth
c5e9855f13 Remove _list suffix from several identifiers.
Instead of "parameter_list" and "replacement_list" just use
"parameters" and "replacements". This is consistent with the existing
"arguments" and keeps the line length down in the face of the
now-longer "string_list_t" rather than "list_t".
2010-05-14 11:50:27 -07:00
Carl Worth
610053b2c6 Rename list_t and node_t to string_list_t and string_node_t.
We'll soon be adding other types of lists, so it will be helpful to
have a qualified name here.
2010-05-14 11:50:27 -07:00
Carl Worth
7f9aa36bbc Fix case of a macro formal parameter matching a defined macro.
Simply need to allow for a macro name to appear in the parameter list.

This makes the recently-added test pass.
2010-05-14 09:53:50 -07:00
Carl Worth
3014073311 Add test where a macro formal parameter is the same as an existing macro.
This is a well-defined condition, but something that currently trips up
the implementation. Should be easy to fix.
2010-05-14 09:53:50 -07:00
Carl Worth
dcc2ecd30d Implement substitution of macro arguments.
Making the two recently-added tests for this functionality now pass.
2010-05-14 09:53:50 -07:00
Carl Worth
af71ba41bd Add tests exercising substitution of arguments in function-like macros.
This capability is the only thing that makes function-like macros
interesting. This isn't supported yet so these tests fail for now.
2010-05-14 09:53:50 -07:00
Carl Worth
48b94da099 Make the lexer return SPACE tokens unconditionally.
It seems strange to always be returning SPACE tokens, but since we
were already needing to return a SPACE token in some cases, this
actually simplifies our lexer.

This also allows us to fix two whitespace-handling differences
compared to "gcc -E" so that now the recent modification to the test
suite passes once again.
2010-05-14 09:48:14 -07:00
Carl Worth
462cce1852 Makefile: Make "make test" depend on the main program.
Otherwise, running "make test" can run an old version of the code,
(even when new changes are sitting in the source waiting to be
compiled).
2010-05-14 09:20:13 -07:00
Carl Worth
27bc8930ba Add some whitespace variations to test 15.
This shows two minor failures in our current parsing (resulting in
whitespace-only changes, oso not that significant):

  1. We are inserting extra whitespace between tokens not originally
     separated by whitespace in the replacement list of a macro
     definition.

  2. We are swallowing whitespace separating tokens in the general
     content.
2010-05-14 09:20:13 -07:00
Carl Worth
0a93cbbe4f Fix parsing of object-like macro with a definition that begins with '('.
Previously our parser was incorrectly treating this case as a
function-like macro. We fix this by conditionally passing a SPACE
token from the lexer, (but only immediately after the identifier
immediately after #define).
2010-05-14 09:20:13 -07:00
Carl Worth
67c27afc16 Add test for an object-like macro with a definition beginning with '('
Our current parser sees "#define foo (" as an identifier token
followed by a '(' token and parses this as a function-like macro.

That would be correct for "#define foo(" but the preprocessor
specification treats this whitespace as significant here so this test
currently fails.
2010-05-14 09:20:13 -07:00
Carl Worth
db35d557a4 Eliminate a reduce/reduce conflict in the function-like macro production.
Previously, an empty argument could be parsed as either an "argument_list"
directly or first as an "argument" and then an "argument_list".

We fix this by removing the possibility of an empty "argument_list"
directly.
2010-05-14 08:47:32 -07:00
Carl Worth
fcbbb46886 Add support for the structure of function-like macros.
We accept the structure of arguments in both macro definition and
macro invocation, but we don't yet expand those arguments. This is
just enough code to pass the recently-added tests, but does not yet
provide any sort of useful function-like macro.
2010-05-13 09:36:23 -07:00
Carl Worth
4abc3dec72 Add tests for the structure of function-like macros.
These test only the most basic aspect of parsing of function-like
macros.  Specifically, none of the definitions of these function like
macros use the arguments of the function.

No function-like macros are implemented yet, so all of these fail for
now.
2010-05-13 09:35:50 -07:00
Carl Worth
9f62a7e9e2 Make the lexer distinguish between identifiers and defined macros.
This is just a minor style improvement for now. But the same
mechanism, (having the lexer peek into the table of defined macros),
will be essential when we add function-like macros in addition to the
current object-like macros.
2010-05-13 07:38:29 -07:00
Carl Worth
8bcb6f1777 Remove some redundancy in the top-level production.
Previously we had two copies of all top-level actions, (once in a list
context and once in a non-list context). Much simpler to instead have
a single list-context production with no action and then only have the
actions in their own non-list contexts.
2010-05-12 13:21:20 -07:00
Carl Worth
012295f94c Simplify lexer significantly (remove all stateful lexing).
We are able to remove all state by simply passing NEWLINE through
as a token unconditionally (as opposed to only passing newline when
on a driective line as we did previously).
2010-05-12 13:20:31 -07:00
Carl Worth
a68e668b17 Add test case to define, undef, and then again define a macro.
Happily, this is another test case that works just fine without any
additional code.
2010-05-12 13:14:08 -07:00
Carl Worth
cd27e6413a Add support for the #undef macro.
This isn't ideal for two reasons:

1. There's a bunch of stateful redundancy in the lexer that should be
   cleaned up.

2. The hash table does not provide a mechanism to delete an entry, so
   we waste memory to add a new NULL entry in front of the existing
   entry with the same key.

But this does at least work, (it passes the recently added undef test
case).
2010-05-12 13:11:50 -07:00
Carl Worth
7bdd1f36d9 Add test for #undef.
Which hasn't been implemented yet, so this test fails.
2010-05-12 13:11:23 -07:00
Carl Worth
39cd7c2f2e Add test for an empty definition.
Happily this one passes without needing any additional code.
2010-05-12 12:49:07 -07:00
Carl Worth
5070a20cd1 Convert lexer to talloc and add xtalloc wrappers.
The lexer was previously using strdup (expecting the parser to free),
but is now more consistent, easier to use, and slightly more efficent
by using talloc along with the parser.

Also, we add xtalloc and xtalloc_strdup wrappers around talloc and
talloc_strdup to put all of the out-of-memory-checking code in one
place.
2010-05-12 12:47:29 -07:00
Carl Worth
33cc400714 Fix defines involving both literals and other defined macros.
We now store a list of tokens in our hash-table rather than a single
string. This lets us replace each macro in the value as necessary.

This code adds a link dependency on talloc which does exactly what we
want in terms of memory management for a parser.

The 3 tests added in the previous commit now pass.
2010-05-12 12:25:34 -07:00
Carl Worth
df2ab5b992 Add tests defining a macro to be a literal and another macro.
These 3 new tests are modeled after 3 existing tests but made slightly
more complex since now instead of definining a new macro to be an
existing macro, we define it to be replaced with two tokens, (one a
literal, and one an existing macro).

These tests all fail currently because the replacement lookup is
currently happening on the basis of the entire replacement string
rather than on a list of tokens.
2010-05-11 12:39:29 -07:00
Carl Worth
34db0d332e Add a couple more tests for chained #define directives.
One with the chained defines in the opposite order, and one with the
potential to trigger an infinite-loop bug through mutual
recursion. Each of these tests pass already.
2010-05-11 12:35:06 -07:00
Carl Worth
c6d5af3351 Fix to handle chained #define directives.
The fix is as simple as adding a loop to continue to lookup values
in the hash table until one of the following termination conditions:

	1. The token we look up has no definition

	2. We get back the original symbol we started with

This second termination condition prevents infinite iteration.
2010-05-11 12:30:09 -07:00
Carl Worth
49206ef4c8 Add test for chained #define directives.
Where one macro is defined in terms of another macro. The current
implementation does not yet deal with this correctly.
2010-05-11 12:29:22 -07:00
Carl Worth
beb26e8ac3 Add README file describing glcpp.
Mostly this is a place for me to write down the URLs of the GLSL and
C99 specifications that I need to write this code.
2010-05-11 12:20:15 -07:00
Ian Romanick
2b97dc657a Replace many uses of foreach_list with foreach_list_typed 2010-05-10 17:42:05 -07:00
Ian Romanick
4cfbad9e4d exec_list: Add foreach_list_typed and foreach_list_typed_const
These variations are parameterized by the type of the nodes in the
list.  This enables skipping the explicit usage of exec_node_data in
the loop body.
2010-05-10 17:40:41 -07:00
Carl Worth
e8c790b3ce Add a very simple test for the pre-processor.
Validate desired test cases by ensuring the output of glcpp matches
the output of the gcc preprocessor, (ignoring any lines of the gcc
output beginning with '#').

Only one test case so far with a trivial #define.
2010-05-10 16:21:10 -07:00
Carl Worth
0b27b5f051 Implment #define
By using the recently-imported hash_table implementation.
2010-05-10 16:16:06 -07:00
Carl Worth
725c17a926 Makefile: Enable debugging of parser.
This compiles the debugging code for teh parser. It's not active
unless the yydebug variable is set to a non-zero value.
2010-05-10 16:14:59 -07:00
Carl Worth
633a692225 Add hash table implementation from glsl2 project.
The preprocessor here is intended to become part of the glsl2 codebase
eventually anyway.
2010-05-10 13:36:26 -07:00
Carl Worth
a70e7bab2b Add .gitignore file.
To ignore generated source files (and glcpp binary).
2010-05-10 13:32:42 -07:00
Carl Worth
a1e32bcff0 Add some compiler warnings and corresponding fixes.
Most of the current problems were (mostly) harmless things like
missing declarations, but there was at least one real error, (reversed
argument order for yyerrror).
2010-05-10 13:32:29 -07:00
Carl Worth
38aa83560b Make the lexer reentrant (to avoid "still reachable" memory).
This allows the final program to be 100% "valgrind clean", (freeing
all memory that it allocates). This will make it much easier to ensure
that any allocation that parser actions perform are also cleaned up.
2010-05-10 11:52:29 -07:00
Carl Worth
3a37b8701c Add the tiniest shell of a flex/bison-based parser.
It doesn't really *do* anything yet---merlely parsing a stream of
whitespace-separated tokens, (and not interpreting them at all).
2010-05-10 11:46:34 -07:00
Ian Romanick
304ea90233 Convert ast_node use of simple_node to exec_list and exec_node 2010-05-10 11:17:53 -07:00
Ian Romanick
752c905b8c exec_list: Add simpler exec_list for-each macros 2010-05-10 11:17:23 -07:00
Ian Romanick
43bfc2b6b5 exec_list: Add macros to get ptr to structure containing a node
This has some ugly hackery to work-around C++ fail.  I have
emperically determined that it works in all the cases that matter.
2010-05-10 11:16:24 -07:00
Ian Romanick
4f9d72fa9e Loop bodies, then-statements, and else-statements are not lists
The statement making up a loop body, a then-statement, or an
else-statement are single nodes.  If the statement is a block, the
single node will be an ast_compound_statement.  There is no need to
loop at the top level when processing these statements.
2010-05-10 11:10:26 -07:00
Ian Romanick
f4e06981cc Remove unnecessary include of simple_list.h 2010-05-10 11:04:22 -07:00
Ian Romanick
3521f0bdd5 Store AST function call parameters in expressions
Previously the list of function call parameters was stored as a
circular list in ast_expression::subexpressions[1].  They are now
stored as a regular list in ast_expression::expressions.
2010-05-10 11:04:02 -07:00
Eric Anholt
bdd9b1f3ff Move optimization pass prototypes to a single header. 2010-05-05 11:47:33 -07:00
Eric Anholt
6255a1f4c6 ir_dead_code_local: Remove redundant assignments within basic blocks.
This cleans up a bunch of junk code in some of the GLSL parser tests,
and could potentially help real-world too (particularly after copy
propagation has happened).
2010-05-05 11:08:18 -07:00
Eric Anholt
dc1dbd65e1 ir_visit_tree: Make sure we visit dereference targets, too.
Found this with the local dead code pass, which never saw variable
dereferences occurring.
2010-05-05 11:08:18 -07:00
Eric Anholt
aef0aaee67 ir_copy_propagation: Fix up the doxygen about the file. 2010-05-05 09:38:09 -07:00
Eric Anholt
8e75de3164 ir_copy_propagation: Return true if we optimized out any assignments.
This may trigger other optimization phases to make more progress themselves.
2010-05-05 09:32:44 -07:00
Eric Anholt
4e2c0b99d9 ir_copy_propagation: Handle swizzles and array derefs on LHS of assign.
This improves the ACP to not get cleared when more complicated assignments
occur, cleaning up more redundant copies in programs.
2010-05-05 09:27:50 -07:00
Eric Anholt
5c89f0ecb9 ir_copy_propagation: New pass to rewrite dereferences to avoid copies.
This is pretty basic.  Right now it only handles pure assignments --
same type on each side, no swizzling, and only within basic blocks.
2010-05-04 17:00:42 -07:00
Eric Anholt
05a4e59c24 ir_to_mesa.cpp: Fix missing types on some ir_swizzles.
Debugging this took forever as I only looked at constructors in ir.cpp
to find who wasn't setting up ->type.  I dislike hiding code (as
opposed to prototypes and definitions) in C++ header files, but in
this case I have only myself to blame.
2010-05-03 17:09:31 -07:00
Eric Anholt
3bc8b68436 Remove the pedantic C junk.
Mesa doesn't use pedantic ANSI C89, so I have no idea why we would.
2010-05-03 11:41:00 -07:00
Eric Anholt
3623df68fa Store warnings and errors in a parser state infolog.
Cleans up compile warning about unused state in _mesa_glsl_warning.  We
would want infolog handling roughly like this anyway.
2010-05-03 11:40:26 -07:00
Eric Anholt
81f49a774e Quiet warnings about ir_shader not being handled in places it's not needed. 2010-05-03 11:40:26 -07:00
Eric Anholt
7f436a837c Use the AM_SILENT_RULES when available. 2010-05-03 11:40:26 -07:00
Eric Anholt
a35e62d97a glsl_lexer: Quiet warning about unused unput(). 2010-05-03 11:40:25 -07:00
Ian Romanick
970353e047 Merge branch 'fixes' 2010-05-03 10:15:02 -07:00
Kenneth Graunke
b0e0da5f07 Use %p rather than %08x when printing pointers to fix compile. 2010-05-01 00:38:36 -07:00
Kenneth Graunke
05ddebac0a Fix ir_return cloning to actually use the cloned subexpression.
This caused a nasty bug where the function inliner would create new
variables for each of the formal parameters, but the body would still
reference the old copies.

This was highly visible since the dead code eliminator (rightly) removed
the new declarations, leading to printed IR that referenced non-existent
variable names.
2010-05-01 00:31:35 -07:00
Kenneth Graunke
c07fdae33f Fix incorrect comments in function inliner. 2010-04-30 23:38:50 -07:00
Jakob Bornecrantz
734522acee xorg-vmwgfx: Add vmwctrl proto 2010-04-30 11:47:27 +01:00
Kristian Høgsberg
f67b020a94 mesa: Handle FEATURE_es2_glsl differences at runtime too
Now that we can support different APIs at runtime, we need to check the
context for the API we're currently providing as well.

https://bugs.freedesktop.org/show_bug.cgi?id=28194
2010-05-24 10:02:13 -04:00
José Fonseca
740c8ea6d3 llvmpipe: Delete extraneous arugment too. 2010-05-24 14:24:06 +01:00
José Fonseca
5a0b4627fc llvmpipe: Remove unused sincos_test_case struct. 2010-05-24 13:56:53 +01:00
Qicheng Christopher Li
80ee3a440c llvmpipe: Unit test for sin/cos that compares against reference implementation.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-24 13:45:26 +01:00
Qicheng Christopher Li
3c929e5544 gallivm: Efficient implementation of sin/cos.
Based on Julien Pommier's SSE and SSE2 algorithms.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-24 13:45:21 +01:00
Eric Anholt
9b775c1e58 i965: Add support for all 8 possible ARB_draw_buffers in Mesa.
We should be able to do 16, but are limited by Mesa's static buffer
allocations.
2010-05-23 16:59:43 -07:00
Eric Anholt
08b42bc97d i965: Fix bit allocation for number of color regions for ARB_draw_buffers.
If you used all 4 color targets we currently support, we would see 0
and end up just writing the first output.  Give enough bits that we
can do the maximum of 16.

Fixes piglit fbo-drawbuffers-maxtargets.
2010-05-23 16:59:07 -07:00
Marek Olšák
fa552261ea util/blitter: allow NULL clear color 2010-05-23 19:01:11 +02:00
Marek Olšák
a650d7068a r300g: extend compile error message 2010-05-23 18:34:04 +02:00
Marek Olšák
7d602b3651 r300g: fix dummy vertex shader compilation 2010-05-23 17:13:31 +02:00
Marek Olšák
98630a900e r300g: fix warnings 2010-05-23 17:13:31 +02:00
José Fonseca
a3ef2fb9c4 llvmpipe: Fill in slice_stride. 2010-05-22 16:14:20 +01:00
Chia-I Wu
e8d8ea2a39 progs: Remove remaining EGL demos.
They have been moved to git+ssh://git.freedesktop.org/git/mesa/demos.
2010-05-21 22:13:32 -06:00
Kristian Høgsberg
ab780bccb7 glx: Invalidate drawable in glXBindTexImageEXT() if we don't get events
When we don't get invalidate events, we need to invalidate a drawable
before using it for tfp to make sure we have uptodate buffers.
2010-05-21 23:24:37 -04:00
Kristian Høgsberg
643b2af020 glx: Split tfp functions out to context vtable
This introduces a new per-context vtable, which lets us clean up all the
#ifdef's a bit and move the DRI2 specific implementation into dri2_glx.c.
2010-05-21 23:24:37 -04:00
Jakob Borncrantz
4db0c76019 st_api: Give get_egl_image arguments directly to the function 2010-05-21 23:29:05 +01:00
Brian Paul
ffd2bc3dfb mesa: fix warnings about missing initializers in get.c table 2010-05-21 14:57:29 -06:00
Brian Paul
0a2e963ce3 st/mesa: remove unused var 2010-05-21 14:57:06 -06:00
Brian Paul
83adf8c3a4 st/glx: fix incorrect parameter type 2010-05-21 14:51:36 -06:00
Jakob Bornecrantz
a93f9f343a gallium: Fix invalidate framebuffer with old libGL libraries 2010-05-21 21:25:07 +01:00
Jakob Bornecrantz
5f66363f8e st_api: Add get param function to st_manager 2010-05-21 21:25:07 +01:00
Jakob Bornecrantz
0853401805 nouveau: Fix build after msaa merge 2010-05-21 21:25:07 +01:00
Brian Paul
7c226d0ab8 mesa: disable building the removed demos with scons 2010-05-21 14:12:16 -06:00
Brian Paul
6af41a5edc mesa: disable building the removed demos
This is a quick fix.
2010-05-21 14:11:42 -06:00
Eric Anholt
1a8b1277c5 Fix test for MESA_LLVM. 2010-05-21 12:20:40 -07:00
Eric Anholt
68fc4b415e Remove demos that have moved to git+ssh://git.freedesktop.org/git/mesa/demos.
The remaining programs are ones I've had difficulty finding a build
environment for to make the build system or are unit tests that should
probably live next to their code instead.  Hopefully people can bring
over the build for remaining pieces they care about.
2010-05-21 12:20:39 -07:00
Roland Scheidegger
e4f4489e3f rbug: fix breakage due to interface changes 2010-05-21 20:52:01 +02:00
Roland Scheidegger
3293bcdc80 Merge branch 'gallium-msaa'
Conflicts:
	src/mesa/state_tracker/st_gen_mipmap.c
	src/mesa/state_tracker/st_texture.c
2010-05-21 20:02:22 +02:00
Patrice Mandin
8504c5d931 nouveau/nvfx: Fill more PIPE_CAP_MAX_ values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-05-21 19:10:31 +02:00
David Shao
d2fa95a4c0 Add __DragonFly__ in querymatrix for fpclassify()
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-21 09:59:52 -06:00
Brian Paul
3bd5888584 progs/tests: print more info in copypixrate.c 2010-05-21 09:58:39 -06:00
Brian Paul
b7f8f176f1 docs: update 7.8.2 relnotes with Cell driver fixes 2010-05-21 09:51:42 -06:00
Brian Paul
2c6882f8c1 cell: assorted compilation fixes 2010-05-21 09:47:00 -06:00
Brian Paul
6e0efad38b cell: fix breakage from earlier draw module changes 2010-05-21 09:36:07 -06:00
Keith Whitwell
519694e0fc gallium: remnants of old ccw state 2010-05-21 16:05:16 +01:00
Keith Whitwell
ef9b4d20d7 Merge branch 'gallium-front-ccw' 2010-05-21 15:41:06 +01:00
Keith Whitwell
0ff2373131 docs: update rasterizer for ccw changes
Also rearrange some of the fields into point/line/polygon categories.
2010-05-21 15:40:36 +01:00
Vinson Lee
0293b1abf5 scons: Remove debug print statement.
Fixes Python IndexError exception with default SCons build.
2010-05-20 21:03:03 -07:00
Eric Anholt
6f77b751b6 Make TLS EGL dri2 driver search path behavior match TLS GLX dri2 behavior. 2010-05-20 14:44:43 -07:00
Eric Anholt
111dce90c1 Fix a substitution in glesv1_cm.pc 2010-05-20 13:57:10 -07:00
Eric Anholt
f716063ad1 i965: remove disabled code for cycling through MRF registers in clipping.
The idea would be that you could have multiple send messages going on
if nothing depended on the previous message's results and you used a
different send message.  The problem is that the later send requires
the VUE handle returned by the first send's allocate anyway.
2010-05-20 13:42:27 -07:00
Xavier Chantry
f2b80e5679 nv50: fixed other void pointer arithmetic errors 2010-05-20 19:47:12 +02:00
Xavier Chantry
828053726b nv50: fix too long shader uploads by splitting them 2010-05-20 19:47:09 +02:00
Christoph Bumiller
9886293eb8 nv50: fill in shader limits 2010-05-20 19:47:01 +02:00
Brian Paul
6ca6189e09 scons: add comments and whitespace 2010-05-20 10:27:12 -06:00
Brian Paul
5c682485b8 scons: fix llvm detection
The test for env['platform'] caused an exception since 'env' is not
defined at that point.  Instead, determine the target platform by
scanning sys.argv[].
2010-05-20 10:27:12 -06:00
Brian Paul
846b2fccc2 gallivm: rename a var: s/val/array_size/ 2010-05-20 10:27:12 -06:00
Brian Paul
3b7914c364 gallivm: fix spelling in comment 2010-05-20 10:27:12 -06:00
Brian Paul
9226d427c3 gallivm: handle pointer types in lp_dump_llvmtype() 2010-05-20 10:27:11 -06:00
Brian Paul
d574ffbb4d llvmpipe: more tweaks to dump_fs_variant_key() 2010-05-20 10:27:11 -06:00
Brian Paul
b2119e4b2f gallium: fix/update tex target dumping 2010-05-20 10:27:11 -06:00
Brian Paul
75189ef960 llvmpipe: use util_dump_logicop() 2010-05-20 10:27:11 -06:00
Brian Paul
df61404dae gallium: added util_dump_logicop() 2010-05-20 10:27:11 -06:00
Brian Paul
c2a036d4ef llvmpipe: put variant print/debug code into separate function 2010-05-20 10:27:11 -06:00
Kristian Høgsberg
e67c338b41 intel: Throttle after doing copyregion/swapbuffers round trip
Before we would throttle in the flush callback prior to round-tripping
to the server to do copyregion or swapbuffer.  Now, instead just note
that we need to throttle and do it in intel_prepare_render(), which
will be called after receiving the response from the server but before
we start rendering the next frame.  Even if the server also throttles
us in swapbuffer, this just makes the throttling a no-op when we hit
intel_prepare_render().  With that we can drop the
using_dri2_swapbuffers hack and just always throttle.
2010-05-20 11:39:28 -04:00
Vinson Lee
f490525685 graw-null: Remove unnecessary header. 2010-05-20 07:36:53 -07:00
Roland Scheidegger
ce65caba84 util: fix obvious util_blitter_copy bugs... 2010-05-19 18:34:01 +02:00
Brian Paul
23808f1b5e nv50: fix typo: s/_/./ 2010-05-19 09:30:35 -06:00
Roland Scheidegger
5be35de0fb util: util_blitter_fill no longer needs to handle overlap 2010-05-19 17:20:26 +02:00
Roland Scheidegger
1adbe2c82d i915g: remove unused flip parameter 2010-05-19 17:14:06 +02:00
Roland Scheidegger
db0ddb7c01 docs: update differences to d3d11 2010-05-18 21:42:09 +02:00
Roland Scheidegger
f4ad68a528 util: fix some leftover util_surface_fill/copy calls 2010-05-18 21:41:15 +02:00
Roland Scheidegger
6f3721a8ec st/mesa: fix wrong argument order 2010-05-18 18:03:37 +02:00
Roland Scheidegger
43234cee40 gallium: implement set_sample_mask() in all drivers
prevents segfault when state trackers try to set default mask.
Other option would be to make this required only for drivers
supporting multisampling, but this seems more clean.
Only dummy implementations (for normal drivers) provided (no driver
supports multisampling yet neither).
2010-05-18 16:20:44 +02:00
Roland Scheidegger
2a15553e43 st/egl: adapt to interface changes 2010-05-17 21:34:30 +02:00
Roland Scheidegger
bf3c8ed481 st/dri: adapt to interface changes 2010-05-17 21:34:03 +02:00
Roland Scheidegger
685bb69416 st/glx: adapt to interface changes 2010-05-17 21:33:53 +02:00
Roland Scheidegger
a127e4709d st/wgl: adapt to interface changes 2010-05-17 21:33:45 +02:00
Roland Scheidegger
c36c3d86b6 st/vega: adapt to interface changes 2010-05-17 21:33:37 +02:00
Roland Scheidegger
48780ec9f9 st/xorg: adapt to interface changes 2010-05-17 21:33:27 +02:00
Roland Scheidegger
8bd87b662f st/python: adapt to interface changes
compile tested only.
Should probably change the python surface_copy/fill functions
also into resource_copy/fill_region functions and adapt the code
using them.
2010-05-17 21:32:41 +02:00
Roland Scheidegger
eb2b668b37 svga: adapt to interface changes
might need further cleanup. Using surfaces internally just to be able to use
the existing code might cause unnecessary copies afaict.
2010-05-17 21:30:01 +02:00
Roland Scheidegger
39b4bf71b5 r300g: adapt to interface changes
might need further cleanup. Using surfaces internally for the u_blitter code
seems nonoptimal.
2010-05-17 21:29:17 +02:00
Roland Scheidegger
b59b23a51d nouveau: adapt to interface changes
this probably needs further cleanup (just getting a surface for the resource
seems quite nonoptimal and potentially cause unnecessary copies I think)
2010-05-17 21:28:14 +02:00
Roland Scheidegger
433701a721 fo: adapt to interface changes 2010-05-17 21:25:27 +02:00
Roland Scheidegger
fd578be828 identity: adapt to interface changes 2010-05-17 21:25:16 +02:00
Roland Scheidegger
bd771cda8e trace: adapt to interface changes 2010-05-17 21:25:07 +02:00
Roland Scheidegger
a02ddd48c5 i965g: adapt to interface changes 2010-05-17 21:24:50 +02:00
Roland Scheidegger
bccf31bf5f i915g: adapt to interface changes 2010-05-17 21:24:04 +02:00
Roland Scheidegger
6c32670706 softpipe: adapt to interface changes 2010-05-17 21:23:46 +02:00
Roland Scheidegger
e121a73d62 llvmpipe: adapt to interface changes 2010-05-17 21:23:31 +02:00
Roland Scheidegger
57a0171225 cell: adapt to interface changes
not even compile tested but fairly trivial
2010-05-17 21:22:23 +02:00
Roland Scheidegger
127328bfad mesa/st: adapt to interface changes
adapt to blit changes, and also handle a bit more msaa state in theory
(incomplete, doesn't handle resolves in any way for now).
2010-05-17 21:19:03 +02:00
Roland Scheidegger
815b75705f gallium/util: adapt util code to interface changes
The util blit functions change their interface (apart from some rename) too
(in particular util_blit_pixels now also takes a pipe_resource as the src blit
argument instead of a surface, as it might just call resource_copy_region).
Maybe the blit util code might need a bit more cleanup, it still doesn't feel
very clean. In particular it seems that util_blit_pixels_tex should probably
disappear, and I think it would be great if the code called by drivers for
blitting (u_blitter.c, which isn't really touched by this change) could somehow
be merged with the u_blit code.
2010-05-17 21:15:20 +02:00
Roland Scheidegger
379db6a36b gallium: clean up resource_copy_region function
Previously, surface_copy was said to allow overlapping blits, and it was
"optional". However, some state trackers actually assumed it is always present,
and quite some code (like in u_blit) assumed overlapping isn't allowed.
Hence, resource_copy_region (and in the same spirit, resource_fill_region) is
now mandatory, but overlapping blits are no longer allowed. A driver can plug
in the cpu fallback util_resource_copy_region if it does not want to provide its
own implementation, though this is not optimal.
2010-05-17 21:02:24 +02:00
Roland Scheidegger
6272d7632a gallium: another interface change for multisampling
due to popular request, use nr_samples parameter in is_format_supported()
instead of new is_msaa_supported() query.
This makes it easily possible to query if a format with a given sample count
is also supported not only as render target, but for sampler views (note that
texture sampling from multisampled resources isn't supported yet).
It is not quite how dx10 format msaa queries work, but we might need to revisit
format queries completely in the future anyway.
2010-05-17 20:52:08 +02:00
Brian Paul
e5ee8b4fae llvmpipe: fix front/back tri culling mix-up 2010-05-17 11:43:43 -06:00
Keith Whitwell
5ebd2fa7da draw: fix front/back error in unfilled pipeline stage 2010-05-14 23:47:05 +01:00
Keith Whitwell
7813d12e05 draw: fix typo checking for unfilled polygons 2010-05-14 23:46:43 +01:00
Keith Whitwell
4ff1274e23 softpipe: restore culling code 2010-05-14 20:36:08 +01:00
Keith Whitwell
9c264642c3 gallium: more work on ccw flag removal
The linux-debug target builds...
2010-05-14 19:20:25 +01:00
Keith Whitwell
0bd1cbcd0d gallium: convert rasterizer state to use gl-style front/back concepts
Use front/back instead of cw/ccw throughout.
Also, use offset_point/line/fill instead of offset_cw/ccw.

Brings gallium representation of this state into line with its main
user, and also what turns out to be the most common hardware
representation.

This fixes a long-standing bias in the interface towards the
architecture of the software rasterizer.
2010-05-14 13:04:42 +01:00
Keith Whitwell
fc4d1b9ba9 util: fix copy_rect stride in default transfer_inline_write 2010-05-14 12:19:28 +01:00
Kristian Høgsberg
52c554a79d egl: Implement EGL_NOK_swap_region
This extension adds a new function which provides an alternative to
eglSwapBuffers. eglSwapBuffersRegionNOK accepts two new parameters in
addition to those in eglSwapBuffers. The new parameters consist of a
pointer to a list of 4-integer blocks defining rectangles (x, y,
width, height) and an integer specifying the number of rectangles in
the list.
2010-05-13 20:30:45 -04:00
Marek Olšák
13ef7a4be8 r300g: fix for piglit/fp-indirections2 2010-05-14 00:27:52 +02:00
Brian Paul
f667526016 rtasm: fix void * / func * casting warnings 2010-05-13 14:15:44 -06:00
Brian Paul
56da0cb7ac draw: silence casting warnings 2010-05-13 14:15:44 -06:00
Brian Paul
415c40735d gallivm: silence uninitialized var warning 2010-05-13 14:15:44 -06:00
Brian Paul
d9096926f8 llvmpipe: silence casting warnings 2010-05-13 14:15:44 -06:00
Brian Paul
17542c1e3e gallivm: silence casting warning 2010-05-13 14:15:44 -06:00
Brian Paul
c91d9cb563 gallivm: silence uninitialized var warning 2010-05-13 14:15:44 -06:00
Brian Paul
77ee438e61 llvmpipe: silence uninitialized var warnings 2010-05-13 14:15:44 -06:00
Brian Paul
966d28cb2e llvmpipe: silence cast warnings in test programs 2010-05-13 14:15:44 -06:00
Brian Paul
45d6289fab gallivm: added lp_dump_llvmtype() debug helper 2010-05-13 14:15:44 -06:00
Brian Paul
adc6e73538 llvmpipe: additional comments 2010-05-13 14:15:44 -06:00
Brian Paul
5b5ce16da5 gallivm: rename a var 2010-05-13 14:15:44 -06:00
Kristian Høgsberg
681fd73f1e egl: Allow a prioritized list of default drivers
When there is no user driver or any matching display drivers we fall
back to the default driver.  This patch lets us have a list of default
drivers instead of just one.  The drivers are loaded in turn and we
attempt to initialize the display.  If it fails we unload the driver
and move on to the next one.

Compared to the display driver mechanism, this avoids loading a number
of drivers and then only using one.  Also, we call Initialize to see
if the driver will work instead of relying on Probe.  To know for sure
that a driver will work, Probe really have to do a full Initialize, so
we will just use Initialize directly.
2010-05-13 16:14:07 -04:00
Kristian Høgsberg
7413d9ae9f egl_dri2: Downgrade initialization errors to warnings
Don't want to shutdown everything if egl_dri2 fails to initialize.
2010-05-13 16:14:07 -04:00
José Fonseca
f19b202556 util: Fix ptr -> int conversion. 2010-05-13 21:14:39 +01:00
José Fonseca
c5c0e0172f Conditionally revert "gallivm: Use a more compact approach for lp_build_broadcast_scalar()."
This reverts commit a09e46c724.
2010-05-13 21:14:39 +01:00
Eric Anholt
c67d9d84f5 i965: Reduce a single GL_QUADS to GL_TRIANGLE_FAN.
This is similar to the GL_QUAD_STRIP -> TRIANGLE_STRIP optimization --
the GS usage to split the quads into tris is a huge bottleneck, so a
quick check improves glean blendFunc time massively (width * height of
the window of single-pixel GL_QUADS, many many times).  This may also
end up helping with cairo performance, which sometimes ends up drawing
a single quad.
2010-05-13 13:02:09 -07:00
Eric Anholt
61aa9c86c2 intel: Don't update window system renderbuffers on TexImage.
While sometimes rendering occurs in the form of blits for TexImage, it
doesn't interact with the window system renderbuffers, so skip it.
2010-05-13 13:02:09 -07:00
Eric Anholt
165694ad65 mesa: Remove no-op wrappers around trig functions. 2010-05-13 13:02:09 -07:00
Eric Anholt
fef303bc94 mesa: Remove _mesa_pow(), which is always just pow(). 2010-05-13 13:02:09 -07:00
Marek Olšák
60a0535101 r300g: fix texture transfers
The regression has first shown up after this state tracker change:
b0427bedde.

FDO bug #28082.
2010-05-13 21:11:20 +02:00
Alan Hourihane
8b3bf9c299 mesa: silence compiler warning 2010-05-13 18:49:02 +01:00
José Fonseca
f379e7df4b llvmpipe: Update instructions for MSVC builds. 2010-05-13 16:18:05 +01:00
Kristian Høgsberg
021a68b7e8 egl: Drop broken _EGL_PLATFORM_NO_OS code
It would do strlen(library_suffix()) in _eglLoaderFile(), with
library_suffix() returning NULL.  So obviuosly not used or tested.
2010-05-13 08:59:56 -04:00
Kristian Høgsberg
41797e1659 egl: Don't try to load driver basename if the platform needs a suffix
That is, don't dlopen(egl_glx) when we know we need to append .so.
2010-05-13 08:28:45 -04:00
Vinson Lee
8230ead0cf trace: Add missing header.
Fixes GCC implicit function declaration warning.
2010-05-13 01:47:31 -07:00
Vinson Lee
3f168eef09 st/mesa: Remove unnecessary header. 2010-05-13 01:37:44 -07:00
Vinson Lee
1775829f8c gallium: Add tokens for Cygwin. 2010-05-13 01:25:07 -07:00
Vinson Lee
65e82f0404 trace: Remove unnecessary headers. 2010-05-13 01:18:35 -07:00
Marek Olšák
0ccc1367d7 r300g: re-order caps 2010-05-13 02:37:56 +02:00
Marek Olšák
dca2a9fcd4 r300g: fill out the shader limits 2010-05-13 02:37:56 +02:00
Jakob Bornecrantz
617c51daf2 trace: Update README 2010-05-12 23:07:17 +01:00
Jakob Bornecrantz
5d2e24fe18 rbug: Update and add READMEs 2010-05-12 23:06:54 +01:00
Jakob Bornecrantz
2ebe0277d4 scons: Add -fvisibility=hidden to CFLAGS for gcc builds 2010-05-12 22:49:32 +01:00
Jakob Bornecrantz
0f9b496916 graw: Make functions public 2010-05-12 22:47:15 +01:00
Jakob Bornecrantz
9f7f711020 rbug: No need to have rbug as a input 2010-05-12 21:12:31 +01:00
José Fonseca
07d741926b gallivm: Ensure PIPE_OS_xxx are defined. 2010-05-12 20:48:27 +01:00
José Fonseca
a09e46c724 gallivm: Use a more compact approach for lp_build_broadcast_scalar().
It produces exactly the same machine code, but it cuts 5% of the
number of instructions generated for a typical shader.

Also, preserve the scalar when length is 1.
2010-05-12 20:40:31 +01:00
José Fonseca
648c9d5247 llvmpipe: Dump fs key's stencil state. 2010-05-12 20:40:14 +01:00
José Fonseca
994e45de49 util: Add function to dump PIPE_STENCIL_OP_xxx 2010-05-12 20:40:07 +01:00
José Fonseca
5326e1846d llvmpipe: Enable mem2reg pass even with LP_DEBUG=nopt.
Otherwise things start crashing.
2010-05-12 20:18:32 +01:00
Jakob Bornecrantz
53cbb81576 rbug: Add to all targets that link against trace
Also added calls to the create function in target helpers and in
tr_drm.c the latter being a hack and should be replaced with the
wrap screen target helper. But at least this way we don't regress.
2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
5494332128 trace: Remove rbug from trace 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
395e9449ca rbug: Use container of macro 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
f6946c9214 rbug: Fix draw blocking 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
73684216ba rbug: Fix sampler views and surfaces in context info 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
21b668e11e rbug: Fix shaders 2010-05-12 20:15:23 +01:00
Jakob Bornecrantz
2c3fb4ecce rbug: Break out of trace 2010-05-12 20:15:23 +01:00
Brian Paul
92b1908db8 gallivm: additional comments 2010-05-12 12:43:09 -06:00
Brian Paul
c722029f3a llvmpipe: s/bool/boolean/ in test progs 2010-05-12 12:43:09 -06:00
Brian Paul
f81ec062c2 gallivm: s/bool/boolean 2010-05-12 12:43:09 -06:00
Brian Paul
5b876241a0 gallivm: rename vars, update comments, etc 2010-05-12 12:43:09 -06:00
Kristian Høgsberg
880acbe177 egl_dri2: Zero out driver struct
Otherwise testing ->Probe for non-NULL and calling it goes boom.
2010-05-12 14:34:55 -04:00
Corbin Simpson
5f161261c7 r300g: Correct viewport setup for SW TCL.
glxgears now renders in the right place on-screen, although it is still
rather...psychedelic.
2010-05-12 10:16:19 -07:00
Corbin Simpson
3bb1724f37 r300g: Add VBO dumper for SW TCL.
Commented out, not easily enabled. *Very* noisy.
2010-05-12 10:16:19 -07:00
Corbin Simpson
505bea8355 r300g: Immediate mode won't work with SW TCL right now.
This could be done later of course. SW TCL should have a much different
threshold because it's much more worth it.
2010-05-12 10:16:19 -07:00
Corbin Simpson
c037c376fb r300g: Fix indentation. 2010-05-12 10:16:19 -07:00
Brian Paul
fcf532ce6f gallivm: comment out LLVMUnionTypeKind case 2010-05-12 10:54:45 -06:00
Brian Paul
1cd31459af gallivm: rename texel result param
Be clear that this parameter returns four texel channel results.
2010-05-12 10:38:00 -06:00
Brian Paul
0a0d176163 gallivm: add a few comments 2010-05-12 10:38:00 -06:00
Brian Paul
3f6dc8e79d gallivm/llvmpipe: add const qualifiers 2010-05-12 10:38:00 -06:00
Brian Paul
3dcb25364f gallivm: added lp_typekind_name() util function 2010-05-12 10:37:59 -06:00
Brian Paul
6080e567f0 tgsi: also count instructions in tgsi_scan_shader() 2010-05-12 10:37:59 -06:00
José Fonseca
cf9baf68cb llvmpipe: Handle PIPE_CAP_GUARD_*.
Without asserting.
2010-05-12 17:25:17 +01:00
José Fonseca
4c4f98c6fc llvmpipe: Use RAST_WHOLE/EDGE_TEST in more places. 2010-05-12 17:24:34 +01:00
José Fonseca
10fdbb9298 llvmpipe: Move the opaque flag computation into the variant. 2010-05-12 17:12:59 +01:00
José Fonseca
686215d9e5 svga: Advertise shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
a1b3ca6a14 llvmpipe: Advertise (gallivm's) shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
7b5931b313 softpipe: Adverstise (tgsi_exec's) shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
6ac93e469a mesa/st: Expose pipe driver's shader limits. 2010-05-12 14:11:28 +01:00
José Fonseca
bfc702d1e7 gallium: Add new fine grained PIPE_CAP_xx for shader limits.
PIPE_CAP_GLSL and PIPE_CAP_SM3 not removed yet, as opcode support is not
yet covered.
2010-05-12 14:11:28 +01:00
José Fonseca
e1238b5cad gallium: Make PIPE_CAP_xxx enums. 2010-05-12 14:11:28 +01:00
Chia-I Wu
084eadac88 st/egl: Link egl-apis to LLVM when enabled.
This is required when a client API (i.e. OpenGL) uses the draw module.
2010-05-12 15:48:11 +08:00
Chia-I Wu
d9f38e1a71 st/mesa: Do not use draw module in OpenGL ES build.
This removes references to symbols in draw module for OpenGL ES build.
As OpenGL ES does not support feedback/selection mode, draw module is
used in pathes that will never be reached.  However, if the symbols are
referenced, it will bloat the final shared libraries unnecessarily.
This is serious when LLVM is enabled.
2010-05-12 15:46:28 +08:00
Chia-I Wu
87cc2da16e mesa/es: Merge back to core mesa.
With the omit list gone, there are not too many differences in building
core mesa and ES overlay.  Remove the mesa/es and build both of them in
src/mesa/Makefile.
2010-05-12 15:03:42 +08:00
Chia-I Wu
8d5c83c467 mesa/es: Remove omit list.
vbo/vbo_save* are the last members on the omit list.  Test FEATURE_dlist
in the sources and remove the omit list.
2010-05-12 13:50:29 +08:00
Chia-I Wu
eb5100accc mesa: Make FEATURE_ATI_fragment_shader more modular.
This allows atifragshader.h to be used without knowing if
FEATURE_ATI_fragment_shader is enabled.  As a result, atifragshader.c is
removed from the omit list in ES overlay.
2010-05-12 13:46:53 +08:00
Chia-I Wu
82c6c31f55 mesa/es: Remove sources.mak.
All ES overlay sources have been merged into core Mesa.  Not much is
left in sources.mak so merge it into Makefile.
2010-05-12 13:08:09 +08:00
Chia-I Wu
cc289e2221 mesa/es: Update sources.mak and fix the build.
Remove sources that are feature-aware from the omit list.  x86 -O0 build
is ~12KiB smaller afther making those sources feature-aware.

Also, remove get.c from the omit list as get_es[12].c have been merged
to it.
2010-05-12 12:30:22 +08:00
Chia-I Wu
1975208919 st/mesa: Make st_cb_drawtex.h FEATURE_OES_draw_texture aware.
This change allows st_cb_drawtex.h to be used without knowing if
FEATURE_OES_draw_texture is enabled.
2010-05-12 12:12:58 +08:00
Chia-I Wu
278bca0db9 mesa: Add dummy _mesa_lookup_query_object to queryobj.h.
This allows condrender.c to be compiled without FEATURE_queryobj.
2010-05-12 12:12:58 +08:00
Chia-I Wu
e76e17d569 st/mesa: Make st_cb_blit.h FEATURE_EXT_framebuffer_blit aware.
This change allows st_cb_blit.h to be used without knowing if
FEATURE_EXT_framebuffer_blit is enabled.
2010-05-12 12:12:58 +08:00
Chia-I Wu
16775f4951 st/mesa: Make st_cb_queryobj.h FEATURE_queryobj aware.
This change allows st_cb_queryobj.h to be used without knowing if
FEATURE_queryobj is enabled.
2010-05-12 12:12:57 +08:00
Chia-I Wu
bcce57c2e9 st/mesa: Make FEATURE_feedback and FEATURE_rastpos more modular.
Make st_cb_feedback.h FEATURE_feedback aware and st_cb_rastpos.h
FEATURE_rastpos aware.  Move creation of selection/feedback draw context
to st_init_draw.
2010-05-12 12:12:57 +08:00
Chia-I Wu
14a92b26ff st/mesa: Make st_cb_{bitmap,drawpixels}.h FEATURE_drawpix aware.
This change allows st_cb_{bitmap,drawpixels}.h to be used without
knowing if FEATURE_drawpix is enabled.
2010-05-12 12:12:57 +08:00
Chia-I Wu
e33ad4999e st/mesa: Make st_cb_accum.h FEATURE_accum aware.
This change allows st_cb_accum.h to be used without knowing if
FEATURE_accum is enabled.
2010-05-12 12:12:57 +08:00
Chia-I Wu
b093016bd0 mesa: Make FEATURE_EXT_transform_feedback more modular.
This allows transformfeedback.h and st_cb_xformfb.h to be included and
used without knowing if FEATURE_EXT_transform_feedback is enabled.  Fix
build of ES overlay.
2010-05-12 12:12:56 +08:00
Brian Paul
903986ca12 glapi: fix generator scripts w.r.t. GLX_USE_APPLEGL
Commit 80b280db88 changed the .c files
instead of the .py generator scripts.
2010-05-11 21:40:56 -06:00
Brian Paul
6c06e2f053 glapi: added GL_ARB_transform_feedback2 entrypoints 2010-05-11 21:31:08 -06:00
Brian Paul
92a8ba844c progs/tests: disable invalid 3D texture compression tests 2010-05-11 21:27:31 -06:00
Brian Paul
67a27b82f5 progs/tests: fix a couple bugs in the getprocaddress.c test 2010-05-11 21:21:26 -06:00
Brian Paul
2236a301c3 mesa: fix error message strings 2010-05-11 21:13:21 -06:00
Brian Paul
0dc18841f5 progs/tests: update getprocaddress test since moving glapi files 2010-05-11 21:09:20 -06:00
Brian Paul
42d31bf390 mesa: added glGet code for GL_ARB_transform_feedback2 2010-05-11 21:08:08 -06:00
Brian Paul
d6164a2ef3 mesa: remove unused header 2010-05-11 21:07:16 -06:00
Brian Paul
19913a1a7c mesa: remove unused header 2010-05-11 21:07:00 -06:00
Brian Paul
a189b1c53b glew: update to version 1.5.4 2010-05-11 21:06:31 -06:00
Brian Paul
1e0afa695b st/mesa: update query code for transform feedback 2010-05-11 21:04:43 -06:00
Brian Paul
d35c2ca345 docs: update GL3.txt w/ GL 3.3, 4.0 lists 2010-05-11 21:03:53 -06:00
José Fonseca
edbc302ad6 mesa/st+tgsi: Provide a free callback to match with ureg_get_tokens().
This fixes crashes with the memory debugging routines on Windows.

NOTE: This is a candidate for the 7.8 stable branch
2010-05-11 21:27:22 +01:00
Vinson Lee
48f8a76549 autoconf: Also strip '\r' character in version scrape.
Fixes autoconf GCC conftest.c test on Cygwin.
2010-05-11 12:33:30 -07:00
Kristian Høgsberg
199b0894b5 mesa: Optimize get.c by using a table-driven approach 2010-05-11 14:06:22 -04:00
Brian Paul
08e443a1c8 llvmpipe: fix texture image size calculation
We were allocating too much memory for linear layouts.  The block_size
factor is already included in the row_stride and should not be used in
the img_stride calculation.  This is typically a 4x savings!
2010-05-11 11:52:06 -06:00
Brian Paul
fea189d6e4 llvmpipe: add a simple resource tracking/debug feature
If debug build, keep a linked list of all allocated resources (textures).
The llvmipe_print_resources() function can be called from a debugger to
print a list of all resources, their sizes, total size, etc.
2010-05-11 11:52:06 -06:00
Brian Paul
f70d900b80 llvmpipe: remove trailing whitespace, rewrap comment 2010-05-11 11:52:06 -06:00
José Fonseca
30a44ee4c5 scons: Export shouldn't be part of the if stanza. 2010-05-11 17:50:09 +01:00
Vinson Lee
4d374bf7eb st/mesa: Remove unnecessary header. 2010-05-11 09:03:42 -07:00
Kristian Høgsberg
f829e76d88 intel: Don't update renderbuffers in intelSetTexBuffer2 if we have invalidate 2010-05-11 10:32:40 -04:00
Kristian Høgsberg
db2993faa0 intel: Drop viewport hack when we can 2010-05-11 10:23:53 -04:00
Kristian Høgsberg
4258e3a2e1 glx: Provide the __DRI_USE_INVALIDATE extension to the driver when we can
When we have DRI2 protocol at least 2.3, we get an event from the
server when the back buffers get invalidated.  When that's the case
let the driver know that it can rely on invalidate instead of the
glViewport polling.
2010-05-11 10:23:53 -04:00
Kristian Høgsberg
97a6cbc6dd dri_interface.h: Add new __DRI_USE_INVALIDATE extension
The presence of this extension indicates to the DRI driver that the
loader will call invalidate in the __DRI2_FLUSH extension, whenever
the needs to query for new buffers.  This means that the DRI driver
can drop the polling in glViewport().
2010-05-11 10:23:53 -04:00
Michel Dänzer
1f6648418d st/xorg: Fix SCons build. 2010-05-11 16:02:42 +02:00
José Fonseca
b0427bedde mesa/st: Remove internal flushes from Mesa state tracker.
Now that transfers are context operations it is the driver's
responsibility to ensure that transfers happen in order with all other
context operations, so flushes and finishes inside Mesa should be no
longer necessary. The attached patch implements that.

This should proportionate significant improvements for hardware drivers
which are able to stream transfers in the command buffers.

You can use the softpipe/llvmpipe_flush_resource() as reference
implementation of the worst case scenario, where the driver is not able
to streamline transfers. But the expectation is that driver
implementators will want to avoid flushing as much as possible.
2010-05-11 14:00:01 +01:00
José Fonseca
d99a7497ed tests/graw: raw -> graw
for consistency
2010-05-11 07:03:27 +01:00
Vinson Lee
d74f525060 mesa: s/uint/GLuint/ in _mesa_BindTransformFeedback prototype.
From http://www.opengl.org/registry/api/glext.h
GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);

Fixes MinGW build.
2010-05-10 22:58:23 -07:00
Chia-I Wu
3ecb8c20f8 gallium: Add llvmpipe support to st/egl.
Update Makefile rules for st/egl.
2010-05-11 12:42:22 +08:00
Brian Paul
fef6e36e07 mesa: more transform feedback infrastructure
Includes GL_ARB_transform_feedback2 which encapsulates transform feedback
state in objects.
2010-05-10 21:11:25 -06:00
Kristian Høgsberg
12bc39f30c intel: Also flush front buffer in glFinish() 2010-05-10 21:10:24 -04:00
Brian Paul
7b937cf47f llvmpipe: enable PIPE_CAP_INDEP_BLEND_ENABLE
This enables the GL_EXT_draw_buffers2 extension.
Tested with progs/tests/drawbuffers2.
2010-05-10 17:04:20 -06:00
Brian Paul
f795735f42 llvmpipe: fix up indexing of blend/colormask state for render targets 2010-05-10 17:04:19 -06:00
Brian Paul
47ecb51eb4 llvmpipe: update image dump/debug code 2010-05-10 17:04:19 -06:00
Brian Paul
bd34f61a7a llvmpipe: add, update, rewrap comments 2010-05-10 17:04:19 -06:00
Brian Paul
e0b5c6f921 gallivm/llvmpipe: move an old comment to a better location 2010-05-10 17:04:19 -06:00
Brian Paul
4e9c3bbc60 st/mesa: rename vars, added comments 2010-05-10 17:04:19 -06:00
Vinson Lee
0bf1ddd60a i915: Drop intelFlush().
This was missed in commit c4775a27e3.
Fixes i915 build.
2010-05-10 15:42:15 -07:00
Kristian Høgsberg
c4775a27e3 intel: Drop intelFlush()
Now that intel_flush() deosn't use the needs_mi_flush argument, we can
finally drop one of the two flush functions.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
a86e4852f4 intel: Only flush fake front buffer on API level glFlush()
Without this patch, any old intel_flush() call will cause a round trip to
the server and do a copy from fake to real front.  We only actually
guarantee that frontbuffer results show up when glFlush() ia called, so
move the flushing to intel_glFlush().

We also need to flush fake to front before getting new buffers, but
we just handle that manually.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
d8cfdbe894 intel: Don't mark front buffer dirty if we're only reading
When we call intel_prepare_render() from intelReadPixels(), we'll mark
the front buffer dirty.  That's silly, since we're only reading from it
and marking it dirty will cause us to copy from fake front to front
eventually.

Just clear the dirty flag after doing the read.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
32942d2b1c intel: Mark frontbuffer dirty in intel_prepare_render()
Now that we have intel_prepare_render() in place, we can use it to mark
the front buffer dirty if we're rendering to the front buffer once we
get there.
2010-05-10 17:48:11 -04:00
Kristian Høgsberg
2d00d16da7 glx: Only call DRI2 invalidate when necessary
We only need this when the server may have swapped the buffers or
when we receive an invalidate event from the server.  The default
behaviour is still that the DRI driver will invalidate its own buffers
when glViewport is called.

https://bugs.freedesktop.org/show_bug.cgi?id=27277
2010-05-10 17:48:11 -04:00
José Fonseca
7c5152c199 svga: Fill in is_resource_referenced callback. 2010-05-10 21:23:39 +01:00
José Fonseca
533ec3f667 gallivm: Silent warning. 2010-05-10 21:23:39 +01:00
José Fonseca
54b94ee96a gallivm: Add missing lvalue. 2010-05-10 21:23:38 +01:00
Brian Paul
3b2bdde1b2 st/mesa: only set prevInstWrotePsiz if translating a vertex program 2010-05-10 12:35:52 -06:00
Brian Paul
adbbaae7b9 st/mesa: additional assertions in dst_register() 2010-05-10 12:35:52 -06:00
Jakob Bornecrantz
a1cc4c1924 i965g: link with software- wrapper winsys and drm api helper 2010-05-10 17:06:02 +01:00
Jakob Bornecrantz
40faa56efb gallium: Add software drm api helper to scons build 2010-05-10 17:06:02 +01:00
Jakob Bornecrantz
8ff59f0987 gallium: Add pipe wrapper software winsys to scons build 2010-05-10 17:06:02 +01:00
Roland Scheidegger
bb7205895e i965g: fix resource creation recursion bug 2010-05-10 17:42:28 +02:00
Roland Scheidegger
804daedd75 i965g: add brw_state_debug.c to SConscript 2010-05-10 17:42:12 +02:00
Roland Scheidegger
433bdb1601 i965g: avoid void * arithmetic 2010-05-10 17:40:44 +02:00
José Fonseca
2e524fd8bc gallivm: Temporarily disable custom LLVMDumpValue on MSVC.
Seeing very weird crashes during std::cout initialization.

The fault probably lies in the way I build LLVM on MSVC, but disable for
now to allow more time to investigate.
2010-05-10 14:43:47 +01:00
José Fonseca
e3205b0540 gallivm: cosf/sinf are macros on MSVC.
So taking the function address does not work.
2010-05-10 08:31:54 +01:00
Vinson Lee
7c5e2672f0 mesa: Update comments in get_gen_es.py. 2010-05-09 22:22:53 -07:00
Brian Paul
e3d8d25ebf swrast: fix 16-bit/channel rendering
NOTE: This is a candidate for the 7.8 stable branch
2010-05-09 22:08:56 -06:00
Brian Paul
9b990c81c0 osmesa: use unsigned 16-bit/channel format 2010-05-09 22:08:33 -06:00
Brian Paul
980df845a3 osmesa: add mapi/glapi to SRC_DIRS to fix build 2010-05-09 21:19:42 -06:00
Brian Paul
969103124b mesa: fix typos, comment in signed 16-bit tex fetch code 2010-05-09 21:19:42 -06:00
Brian Paul
17e9671894 mesa: added unsigned 16-bit/channel tex format 2010-05-09 21:19:42 -06:00
Brian Paul
7a57af6d11 mesa: added comments for signed 16-bit formats 2010-05-09 21:19:42 -06:00
Brian Paul
8ea614832d mesa: use GL_RGBA16_SNORM for accum buffer 2010-05-09 21:19:42 -06:00
Brian Paul
279056f803 mesa: added texstore function for signed 16-bit formats 2010-05-09 21:19:42 -06:00
Brian Paul
6274bb865f mesa: added UNCLAMPED_FLOAT_TO_SHORT macro 2010-05-09 21:19:42 -06:00
Brian Paul
880e04ba74 mesa: add missing cases for signed 16-bit formats 2010-05-09 21:19:41 -06:00
Chia-I Wu
913d7c388d st/mesa: Ignore internal_format in st_context_teximage.
When internal_format and tex->format differ, st_finailize_texture will
surface_copy between surfaces with different formats.  This commit works
around the issue by ignoring internal_format.  A sane fix is needed
here.
2010-05-09 16:23:28 +08:00
José Fonseca
8ad3e0b55d gallivm: Add an alternative to LLVMDumpValue that works with Windows GUI apps. 2010-05-08 23:29:05 +01:00
José Fonseca
08b3179f48 gallivm: Fix mipfiltering with negative lod bias.
In particular, don't use the clamped lod to compute level + 1, or
lod in [-1, 0] range will actually interpolate with level 1.

This makes Mipfilter DCT pass 100%.
2010-05-08 23:29:05 +01:00
José Fonseca
ff7542ab90 gallivm: Actually do floor/ceil/trunc for scalars.
Also start axing the code duplication for scalar case. The olution is to
treat the scalar case specially in a few innermost functions, and leave
outer functions untouched.
2010-05-08 23:29:05 +01:00
José Fonseca
ffebc7f2a7 gallivm: Import the code to compute the minimax polynomials.
It's quite a pain to remember the details after a while, and it is quite
likely we'll want to use this again, either for different polynomial
orders or different functions, so commit it here.
2010-05-08 23:29:05 +01:00
José Fonseca
c376dadbb0 gallivm: Use a minimax polynomial for exp2 in range [0,1] instead [-0.5,5].
The advantage of range[-0.5, 0.5] is that it doesn't require floor (for
which intrinsics are only available in SSE4.1).

But the EXP opcode pretty much forces us to use floor, and there is a
good floor approximation around truncation available anyway.

This fixes EXP failures in VShader DCT.
2010-05-08 23:29:05 +01:00
José Fonseca
de088c6ae4 gallivm: Don't hardcode number of args twice. 2010-05-08 23:29:05 +01:00
Marek Olšák
d044ecbe76 r300g: follow pipe_rasterizer_state::light_twoside 2010-05-08 23:19:33 +02:00
Marek Olšák
084580fa43 r300g: follow pipe_rasterizer_state::point_size_per_vertex 2010-05-08 23:19:30 +02:00
Marek Olšák
34a5109bc2 r300g: move GA_POINT_MINMAX back to rs_state
This basically reverts commit 74f94e8fdf.
2010-05-08 23:03:45 +02:00
Marek Olšák
ceafb391e6 r300g: fix glean/pointSprite using lodbias correction 2010-05-08 23:03:45 +02:00
Marek Olšák
71584d0cc7 r300g: pass depth texture swizzle to the compiler if compare mode is enabled 2010-05-08 23:03:45 +02:00
Marek Olšák
78e881368b r300g: respect compare mode regardless of sampler type 2010-05-08 23:03:45 +02:00
Marek Olšák
e812c0439c r300/compiler: fake equal/notequal for shadow samplers
This is actually better than a real implementation, which would be useless
due to inaccuracy (I know because I've tried to implement it).
2010-05-08 23:03:45 +02:00
Marek Olšák
35a6df5730 r300/compiler: use perspective division only for TXP in shadow samplers 2010-05-08 23:03:44 +02:00
Marek Olšák
0cbe1e6c14 r300/compiler: make shadow sampler codegen more readable, add comments 2010-05-08 23:03:44 +02:00
Marek Olšák
39d0ece5f5 r300/compiler: shorten RC_*SWIZZLE* expressions 2010-05-08 23:03:44 +02:00
Marek Olšák
eb9dc2595f r300/compiler: generalize depth texture mode to support arbitrary swizzles 2010-05-08 23:03:44 +02:00
Marek Olšák
c637f38e70 r300/compiler: fix LIT instruction case 0^0 = 1 2010-05-08 23:03:44 +02:00
Marek Olšák
da180a8d34 r300g: consolidate common render code into one function
This reduces redundant code by moving:
- CS space reservation
- buffer validation
- dirty state emission
- index bias emission
- AOS emission
into r300_prepare_for_rendering.
2010-05-08 23:03:44 +02:00
José Fonseca
e9fc5b463f gallivm: The the JIT engine to use our sinf()/cosf() on Windows.
A quick hack to get the right results, as there are many DCT tests
which use these opcodes to generate data to test other opcodes.
2010-05-08 18:36:22 +01:00
José Fonseca
2d91903882 gallivm: Fix BREAK/CONT translation.
The cont_mask must be restored and exec mask recomputed in order to decide
whether to repeat the loop or not.

Unlike the continue mask, the break_mask must be preserved across loop
iterations.

Fixes several VShader DCT cases, and no regressions with glean.
2010-05-08 16:17:09 +01:00
José Fonseca
852f735236 llvmpipe: Cover more formats in unit test. 2010-05-08 13:18:14 +01:00
José Fonseca
36e28d42b3 gallivm: Fix segfaul when inserting allocas in an empty function. 2010-05-08 13:02:46 +01:00
José Fonseca
2c2debaea7 gallivm: Centralize SoA swizzling into a single place. 2010-05-08 12:52:50 +01:00
José Fonseca
ff6c78f44f gallivm: Support predicates. 2010-05-08 12:50:52 +01:00
José Fonseca
6e47d4f889 llvmpipe: Match p_screen.h's function prototype. 2010-05-08 10:14:35 +01:00
Chia-I Wu
238f782982 Update file list for the tarballs.
Mainly for the recent work on mapi and gles.  The latter adds some
sources to src/mesa/main that are generated on the fly.  This makes
python a requirement for building Mesa.  An alternative is to package
those sources into the tarballs.  That may be done in another commit.
2010-05-08 16:14:52 +08:00
Vinson Lee
cc346b51fa llvmpipe: Remove unnecessary header. 2010-05-08 00:37:38 -07:00
Chia-I Wu
2e3c4e4784 docs: Update EGL and OpenGL ES docs.
Update to reflect recent gles and mapi works.
2010-05-08 14:58:59 +08:00
Chia-I Wu
56530c9097 egl: Build drivers in $(TOP)/$(LIB_DIR)/egl.
There are enough EGL modules that they deserve a subdirectory, to avoid
polluting $(TOP)/$(LIB_DIR).
2010-05-08 14:58:59 +08:00
Chia-I Wu
63ab2509bf gallium: Add egl-apis target.
The new target installs client API modules to EGL_DRIVER_INSTALL_DIR.
They are used by st/egl.

The client APIs are built from OpenGL and OpenVG state trackers.  For
this to work, st/vega is modified to produce a static library,
libvega.a, instead.  st/es is also not needed any more.  It is removed
and --with-state-trackers=es is replaced by --enable-gles-overlay.

As st/egl now has its own client API modules, this solves the ABI issue
between st/egl and client APIs, as long as the client API modules are
distributed with st/egl.  Plus, this allows st/egl to support OpenGL
with non-Gallium libGL.so.
2010-05-08 14:57:21 +08:00
Chia-I Wu
559046e791 mapi: Add install rules for OpenGL ES.
Move the install rules for OpenGL ES from src/mesa/Makefile to mapi.
2010-05-08 14:55:57 +08:00
Chia-I Wu
bc918efb56 mapi: Install .pc file for OpenVG. 2010-05-08 14:55:57 +08:00
Chia-I Wu
b0749fd09b mapi: Update vgapi to build libOpenVG.so.
Unlike the one produced by st/vega, this is a dispatch-only library.
2010-05-08 14:55:57 +08:00
Chia-I Wu
3e1ccb2508 mapi: Merge src/gles/.
Remove src/gles and have mapi/{es1api,es2api} build libGLESv1_CM.so and
libGLESv2.so.
2010-05-08 14:55:57 +08:00
Chia-I Wu
874ccd5d83 Define OpenGL ES and OpenVG library names.
Define <API>_LIB, <API>_LIB_NAME, <API>_LIB_GLOB, and some other
variables in the configs.  Fix a typo in glesv1_cm.pc.in where an
inexistent variable is used.
2010-05-08 14:55:52 +08:00
Chia-I Wu
2773f888dc egl_g3d: Check external modules for client APIs first.
dlopen api_<API>.so before dlopening the process itself in case the
client APIs are implemented in external modules.
2010-05-08 14:54:13 +08:00
Chia-I Wu
e8ba2812e6 egl: Add _eglSearchPathForEach.
The function can be used by a driver to check each search path of EGL.
2010-05-08 14:54:13 +08:00
Brian Paul
74fb08018a gallium/draw: additional comments in the clipping code 2010-05-07 17:13:16 -06:00
Brian Paul
3965bc5d22 mesa: remove driver hooks for GetFloat/Integer/Doublev, etc
Once upon a time some drivers hooked into these for GL_HP_occlusion_test
and GL_OES_read_format.  They're not being used anymore so get rid of them.
2010-05-07 17:10:05 -06:00
Kristian Høgsberg
db178af09d glx: Get GLX_SCREEN first in __glXQueryContextInfo()
And lookup the GLX screen for the context.  Otherwise we'll end up
jumping through a NULL-pointer once we try to look up the visual
or config for the shared context.

https://bugs.freedesktop.org/show_bug.cgi?id=14245
2010-05-07 18:40:54 -04:00
Jon TURNEY
f350b10617 mesa: fpclassify dummy definition is not needed on cygwin
fpclassify is provided by math.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-07 14:36:13 -06:00
Brian Paul
12d74d6ba1 tgis: fix SOA aliasing for MUL instruction in SSE codegen
Part of a fix for piglit trinity-fp1 test failure.
2010-05-07 10:40:59 -06:00
Vinson Lee
50c940707e apple: Move glapi to mapi.
This was missed in commit 296adbd545.
Fixes darwin build.
2010-05-06 23:39:33 -07:00
José Fonseca
5065d33276 mapi/glapi: Don't allocate a page for every function on windows. 2010-05-07 07:31:44 +01:00
José Fonseca
5569faf05a mapi: Avoid Data Execution Prevention on windows. 2010-05-07 06:57:11 +01:00
José Fonseca
80c8c891c9 wgl: Add mapi to includes. 2010-05-07 06:45:20 +01:00
Chia-I Wu
de3994076e mapi: Add x86-64 dispatcher. 2010-05-07 10:41:12 +08:00
Chia-I Wu
56eb5d7e85 mapi: Add x86 dispatcher. 2010-05-07 10:41:12 +08:00
Chia-I Wu
75143ef055 st/vega: Use vgapi.
Rename vgFooBar to vegaFooBar and use vgapi as the dispatcher.  This
makes sure there is always a current context when the internal functions
are called.  And eglGetProcAddress is finally supported.
2010-05-07 10:41:12 +08:00
Chia-I Wu
bdc4504252 mapi: Add vgapi.
vgapi is a dispatcher for OpenVG.
2010-05-07 10:41:12 +08:00
Chia-I Wu
d4589d3816 mapi: Add a generic C dispatcher.
The idea is to have an API generate a header using mapi_abi.py.  The API
can then use the header to build a dispatcher.
2010-05-07 10:41:12 +08:00
Chia-I Wu
a73c6540d9 mapi: Add mapi and share the code with glapi.
Specifically, move all or most of

      glapi/glapi.c         to mapi/u_current.c,
      glapi/glapi_execmem.c to mapi/u_execmem.c,
      glapi/glthread.[ch]   to mapi/u_thread.[ch]

and remove their dependencies on core Mesa headers.
2010-05-07 10:41:11 +08:00
Chia-I Wu
296adbd545 glapi: Move to src/mapi/.
Move glapi to src/mapi/{glapi,es1api,es2api}.
2010-05-07 10:41:11 +08:00
Chia-I Wu
73ded0624d glapi: Move assembly dispatchers back into glapi/. 2010-05-07 10:41:10 +08:00
Török Edwin
4d52a25326 gallivm: Require SSE2 for draw_llvm/llvmpipe due to LLVM PR6960.
Note that this also requires X86 for llvm, if llvmpipe/draw_llvm works
on PPC then the condition should be extended to include && x86.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 22:43:37 +01:00
Brian Paul
1fce9d58cc softpipe: fix dangling references to shaders in the TGSI executor
If a shader was bound to the fragment shader TGSI executor and it was
then deleted and a new shader was allocated at the same address as the
old shader, the new fragment shader would not get properly bound to
the TGSI machine and we'd wind up using the old one.

This would not have been a problem if shaders were refcounted.

Now the TGSI machine is owned by the context rather than the quad
pipeline's shader stage so that the softpipe_delete_fs_state()
function can access it.

Fixes sporadic failures of the piglit fp-long-alu test (fd.o bug 27989).
2010-05-06 15:19:02 -06:00
Brian Paul
4b274f311c tgsi: make SSE ADD instruction SOA-safe
To properly execute an instruction such as "ADD tmp, tmp.wzyx, foo;"
with SOA we (sometimes) need to put the results into temporaries before
writing the results to the destination register.

This patch fixes the ADD instruction but this needs to be done for
many more instructions.

Helps to fix piglit fp-long-alu test (fd.o bug 27989).
2010-05-06 15:19:02 -06:00
Brian Paul
895ee712ba tgsi: code refactoring 2010-05-06 15:19:02 -06:00
Brian Paul
92d88ccd9a tgsi: added tgsi_get_processor_name() 2010-05-06 15:19:02 -06:00
Brian Paul
c8f0e805a9 tgsi: fix tgsi_exec_machine_bind_shader() to handle NULL tokens, samplers
This lets us unbind a shader from the tgsi_exec_machine.  Since
shaders aren't ref counted we need this to properly clean up when
deleting shaders elsewhere.
2010-05-06 15:19:02 -06:00
Brian Paul
fbb1ad33a4 gallium/tgsi: remove unused tgsi_exec_labels code 2010-05-06 15:19:02 -06:00
José Fonseca
680071502f llvmpipe: Fix fence wait.
Avoids crashing when fence is NULL (LP_NUM_THREADS=0) and leaking when
it is not.
2010-05-06 21:38:06 +01:00
Brian Paul
c37d8259bb st/mesa: fix compressed mipmap generation for small image sizes
When the mipmap level is smaller than the compression block width, height
we need to fill in / replicate pixels so that we don't get garbage values.

Fixes piglit gen-compressed-teximage test.
2010-05-06 14:26:58 -06:00
Brian Paul
4b59d2ba22 st/mesa: fix bug in compute_num_levels()
Fix more fall-out from the "ignore BaseLevel" change.
This may help with fd.o bug 27991.
2010-05-06 14:26:58 -06:00
Brian Paul
9adebe172d st/mesa: when copying mipmap levels between textures, start at BaseLevel
Saves some work and avoids potential issue with inconsistant mipmap
level sizes.  As long as the mipmap levels from BaseLevel to MaxLevel
are consistant, we don't care about the other levels.
2010-05-06 14:26:58 -06:00
José Fonseca
095a6531a2 scons: Disable graw-null on msvc until linkage works. 2010-05-06 21:19:35 +01:00
José Fonseca
f63672c9ab graw-null: Try to fix MSVC linkage problems. 2010-05-06 21:06:53 +01:00
Jakob Bornecrantz
54f95d20e3 es: Ignores 2010-05-06 20:03:51 +01:00
Jakob Bornecrantz
4cad69a31b svga: Fix scons build 2010-05-06 20:03:51 +01:00
Qicheng Christopher Li
86afe8250e llvmpipe: implement occlusion query
OpenGL occlusion queries work now.  The Mesa demos, glean test and piglit
tests all pass.  A few enhancements are possible in the future. -Brian

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-06 11:45:45 -06:00
Jakob Bornecrantz
f587615e13 util: Recognize FALSE and F in debug_get_bool_option
Concidering that we actually print FALSE when displaying the
option we should also accept that value.
2010-05-06 15:45:20 +01:00
José Fonseca
7ed2f953c0 gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 14:23:04 +01:00
José Fonseca
0f4e61d193 raw/clear: Make it portable. 2010-05-06 14:20:28 +01:00
José Fonseca
d5e741d6d8 graw-null: New target to ensure we always have a graw implementation available. 2010-05-06 14:20:13 +01:00
José Fonseca
2b322ad147 graw-xlib: Remove duplicate graw.h file. 2010-05-06 13:08:39 +01:00
José Fonseca
f58d780b08 Revert "gallium: untrack u_indices_gen.c and u_indices_gen.c"
This incomplete patch got commited by mistake.

This reverts commit 2142c769a4.
2010-05-06 12:47:23 +01:00
Xavier Chantry
b0524d3a8f gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 12:31:39 +01:00
Xavier Chantry
2142c769a4 gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 12:26:54 +01:00
Jeremy Huddleston
a18702f067 darwin: Fix build
This is a regression from e42d84eaba

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

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4d63be67f3)
2010-05-05 18:17:45 -07:00
Brian Paul
fca24899cb gallium: still more provoking vertex fixes
This fixes edge flags for polygons and provoking vertex for
filled quads.
2010-05-05 18:46:11 -06:00
Brian Paul
eaad99d230 gallium: added edge flag print/debug code (disabled) 2010-05-05 18:25:19 -06:00
Brian Paul
740e50c60f gallium: rename draw() to draw_elements() in vbuf code
Now we have draw_elements() and draw_arrays() to be consistent with the
pipe_context drawing functions.
2010-05-05 18:19:37 -06:00
Brian Paul
246d39059e llvmpipe: update driver's provoking vertex code
Note that the lp_setup_vbuf.c code is very, very similar to the
corresponding code in softpipe.  It could probably be shared.
2010-05-05 18:19:30 -06:00
Brian Paul
cb136a93ab gallium: rework provoking vertex code
Builds on commit ddb0e18f6c and fixes
regressions in glean clipFlat test.

We assume that Gallium drivers observe flatshade_first for all triangles
and that all the assorted per-triangle calls in the 'draw' module also
follow flatshade_first.  Everything else builds on those rules.

Gallium does not use follow flatshade_first for GL quads, quad strips
and polygons; the "last" vertex is always the provoking vertex for those
prims.  So now there are separate QUAD_FIRST_PV and QUAD_LAST_PV macros
in the draw primitive decomposition code instead of one QUAD macro.
2010-05-05 18:19:06 -06:00
Marek Olšák
a8bb495629 tgsi: make dumping work on non-debug builds 2010-05-05 23:33:44 +02:00
Marek Olšák
0ad541a684 st/mesa: fix per-vertex point size
This fixes FDO bug #27343.
2010-05-05 23:04:44 +02:00
Brian Paul
5c2f6a3e9f llvmpipe: added a new assertion as a hint to Coverity
Looks like coverity found a false positive for an out of bounds array write.
2010-05-05 08:22:12 -06:00
Xavier Chantry
6ddd640365 nouveau: only advertise PIPE_FORMAT_DXT* if s3tc available 2010-05-05 14:39:59 +02:00
José Fonseca
8ddf93e84c graw-xlib: Revert the output dir lib change. 2010-05-05 09:40:59 +01:00
Vinson Lee
e3ce10f7ac st/mesa: Remove unnecessary headers. 2010-05-05 01:14:25 -07:00
Vinson Lee
8191e5ae65 mesa: fpclassify dummy definition not needed on Mac OS X. 2010-05-05 00:49:25 -07:00
Vinson Lee
bc751b5be0 svga: Remove unnecessary header. 2010-05-04 23:06:34 -07:00
Vinson Lee
e768d11ca0 draw: Remove unnecessary header. 2010-05-04 23:04:13 -07:00
Vinson Lee
57f0a25c27 util: Remove unnecessary headers. 2010-05-04 23:02:05 -07:00
Vinson Lee
dbcd5622d5 llvmpipe: Remove unnecessary headers. 2010-05-04 22:57:24 -07:00
Vinson Lee
3234066be2 r300g: Fix memory leak on error path. 2010-05-04 22:55:00 -07:00
Eric Anholt
ce914fff08 i965: When an RB gets a new region, clear the old from the state cache.
This prevents memory usage explosion in blender due to the state cache
hanging on to old fake frontbuffer regions.  Sigh at blender still
using frontbuffer rendering.

Bug #24119.
2010-05-04 22:06:12 -07:00
Eric Anholt
453f0b1f24 intel: Don't tile textures so small that size is blown up by over 2x.
Noted on the mailing list for an app that puts each glyph for its text
into a separate texture.
2010-05-04 22:06:12 -07:00
Chia-I Wu
781d56eac4 progs/egl: Fix eglut with OpenGL ES 2.0.
EGL_OPENGL_ES2_BIT is not set when choosing OpenGL ES 2.0 configs.
2010-05-05 12:29:19 +08:00
Brian Paul
53a53b2549 osmesa: remove unused var 2010-05-04 21:59:54 -06:00
Brian Paul
d148e25953 mesa: remove some color index code 2010-05-04 21:59:54 -06:00
Brian Paul
00b7dcd27a mesa: remove unused renderbuffer adaptor code 2010-05-04 21:59:54 -06:00
Brian Paul
7f07ac80eb mesa: remove renderbuffer adaptor calls
Was only used for OSMesa but no longer needed.
2010-05-04 21:59:54 -06:00
Brian Paul
36b3a8bd5a osmesa: fix OSMesa for CHAN_BITS=32
CHAN_BITS=16 still broken.

NOTE: this is a candidate for back-porting to the 7.8 stable branch.
2010-05-04 21:59:54 -06:00
Chia-I Wu
719f7049bb st/mesa: Fix texture-from-pixmap.
Remember the size of the level=0 mipmap image.  Do not call
util_format_get_component_bits when st_context_teximage is called to
release a texture image.
2010-05-05 11:58:04 +08:00
Chia-I Wu
a6ec153830 mesa: Fix build of ES overlay.
ES overlay is built with FEATURE_ES1 or FEATURE_ES2, and is built
without FEATURE_GL.  Fix the build by always building OpenGL ES sources,
but test for FEATURE_ES1 or FEATURE_ES2.  Also, define symbols that are
missing because FEATURE_GL is not defined.
2010-05-05 11:57:46 +08:00
Brian Paul
b29b27c118 st/mesa: remove commented-out struct field 2010-05-04 21:19:30 -06:00
Brian Paul
382eb1a728 gallium: remove trailing comma in enum list 2010-05-04 21:18:55 -06:00
Brian Paul
791c3395ab mesa: add a dummy definition for fpclassify() if needed 2010-05-04 21:14:42 -06:00
Brian Paul
bef9460dcd mesa: remove trailing comma in enum list
Some compilers complain about this.
2010-05-04 21:12:01 -06:00
Brian Paul
1169d8619a llvmpipe: predicate LLVMDumpModule() on DEBUG_JIT 2010-05-04 20:46:27 -06:00
José Fonseca
b2e343daab tests/raw: Get it building with scons. 2010-05-05 02:39:08 +01:00
José Fonseca
ddb0e18f6c draw: Preserve the provoking vertex both when decomposing and clipping.
Based on John Lawless' feedback.
2010-05-05 00:46:13 +01:00
Brian Paul
dc1c33b448 draw: Adjust wideline vertex coords for D3D. 2010-05-05 00:46:13 +01:00
José Fonseca
f816937d77 scons: Add support for Mingw64. 2010-05-05 00:46:12 +01:00
Brian Paul
c6fdb950e9 st/mesa: need to pass srcLevel to st_texture_image_copy()
Fixes a regression in mipmap setup.
2010-05-04 17:25:36 -06:00
Brian Paul
87022efb4f llvmpipe: fix broken compressed cube maps
When the cube faces were stored in a compressed format, the img_stride
values were wrong and didn't match the per-face size computed in the
tex_image_face_size() function.  This caused bad rendering or segfaults.
2010-05-04 17:17:04 -06:00
Brian Paul
0f0c0368fa gallium/util: added is_format_compressed() 2010-05-04 17:17:04 -06:00
Brian Paul
477b0d838b llvmpipe: do some null pointer checking 2010-05-04 17:17:04 -06:00
Brian Paul
0671c6b589 llvmpipe: add some tests for malloc() returning NULL.
Start propogating NULL pointers from allocation functions and checks for
NULL in the callers...
2010-05-04 17:17:04 -06:00
Brian Paul
2649d64fee progs/demos: set line width back to 1.0 in DrawBox() 2010-05-04 17:17:04 -06:00
Kristian Høgsberg
6a191b2713 glxinfo: Get visual info when an fbconfig has an associated visual 2010-05-04 15:29:25 -04:00
Kristian Høgsberg
9e4f2da848 Fix gles .pc file generation 2010-05-04 14:13:46 -04:00
Kristian Høgsberg
ceffd7b924 Add egl.pc file 2010-05-04 14:13:46 -04:00
Marek Olšák
88512e837e r300g: advertise S3TC only when it's available in Gallium 2010-05-04 20:09:53 +02:00
Wiktor Janas
677a604556 u_blitter: fix creating fragment shaders
See FDO bug #27887.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-05-04 19:56:44 +02:00
Kristian Høgsberg
06c72da97a intel: Update renderbuffers unconditionally in intelSetTexBuffer2() 2010-05-04 13:35:51 -04:00
Brian Paul
2b53f4a9c6 st/mesa: return success/fail from guess_and_alloc_texture()
Before we looked at stObj->pt to see if we may have run out of memory,
but that's not a good indicator.  This fixes the spurious GL_OUT_OF_MEMORY
errors that could arise before.
2010-05-04 10:32:02 -06:00
Brian Paul
c2b47a7557 st/mesa: improved st_texture_image_copy()
No longer need to search for the src mipmap level.
Added assertions.
Updated comments.
Moved debug code into separate function.
2010-05-04 10:29:42 -06:00
José Fonseca
dad962bafe mesa/st: Fill in native program limits.
In the lack of more fine grained capabilities in Gallium, assume that if
the pipe driver supports GLSL then native limits match Mesa software
limits.
(cherry picked from commit 40a90cd11234a09c2477f5c9984dd6d9fac3f52c)
2010-05-04 15:41:19 +01:00
Roland Scheidegger
0ae2f59c02 Merge commit 'origin/master' into gallium-msaa 2010-05-04 15:58:29 +02:00
Kristian Høgsberg
1c920c6176 intel: Enable GL_EXT_framebuffer_object for gles2 2010-05-04 09:22:35 -04:00
José Fonseca
ec43b2eb45 gallivm: Proper implementation of TXL opcode. 2010-05-04 13:51:54 +01:00
José Fonseca
4554cdc289 gallivm: Fix several glitches introduced in the prev commit. 2010-05-04 13:32:40 +01:00
Kristian Høgsberg
2b1f0e17d8 mesa: Forgot to add .pc.in files for gles
Some day I'll grow up and remember to add new files when I commit.
2010-05-04 07:23:30 -04:00
José Fonseca
962558daae gallivm: Implement TXD. 2010-05-04 10:08:10 +01:00
Chia-I Wu
3c6756d6f5 gles: Add -I$(TOP)/include. 2010-05-04 16:00:55 +08:00
Kristian Høgsberg
e83ca4052b mesa: Only initialize TNL for OpenGL 2010-05-03 21:21:58 -04:00
Kristian Høgsberg
208fdac73a mesa: Only initialize save dispatch table for OpenGL 2010-05-03 21:21:58 -04:00
Kristian Høgsberg
642839824e progs/egl/opengles2: Add es2gears demo
Because every subdirectory under progs has to have a version of gears.
2010-05-03 21:21:58 -04:00
Brian Paul
e2ea69afef mesa: increase MAX_DRAW_BUFFERS to 8
Required for GL 3.x
2010-05-03 17:35:40 -06:00
Brian Paul
8b0c217f2b gallium: move surface utility functions into u_surface.c
This is a better place than in u_rect.c
2010-05-03 17:28:32 -06:00
José Fonseca
6c8c88f02f gallivm: Increase the TGSI translation limits and centralize them in a header. 2010-05-04 00:22:16 +01:00
José Fonseca
a9d1a85f81 gallicm: Newton-Raphson step to improve precision.
Disabled as it doesn't make VS/PSPrecision DCT happy, and it would
unnecessarily slow some cases where it is not needed.
2010-05-04 00:22:16 +01:00
Brian Paul
9b02f41cac cso: use framebuffer utility functions 2010-05-03 17:13:21 -06:00
Brian Paul
1fc5a318a6 gallium: move framebuffer utility functions into a new file 2010-05-03 17:08:17 -06:00
Brian Paul
d8306c9caf st/mesa: remove dead code 2010-05-03 16:13:57 -06:00
Brian Paul
295a87f6c2 st/mesa: remove unused needFlush parameter to st_finalize_texture() 2010-05-03 16:13:20 -06:00
Brian Paul
013b332cbc st/mesa: updated comments and fix some formatting in texture storage code 2010-05-03 16:03:19 -06:00
Brian Paul
e79086865b st/mesa: rename srcImageStride -> srcRowStride and fix-up formatting 2010-05-03 15:51:00 -06:00
Brian Paul
c7d1d34c58 st/mesa: consolidate and clean-up texture memory allocation code 2010-05-03 15:48:00 -06:00
Brian Paul
fe3332da78 st/mesa: updated comments for st_texture_image_map() 2010-05-03 15:47:29 -06:00
Brian Paul
41b8a2e939 st/mesa: move some texture size calculation code 2010-05-03 15:39:40 -06:00
Brian Paul
682fec0dca st/mesa: remove old convolution-related vars and min pitch code 2010-05-03 15:35:21 -06:00
Brian Paul
b02619914e st/mesa: remove unsupported convolution code 2010-05-03 15:31:09 -06:00
Brian Paul
babd71ba45 progs/demos: check for GL_ARB_imaging if convolutions is requested 2010-05-03 15:29:02 -06:00
Brian Paul
4b7812919a st/mesa: updated comment 2010-05-03 15:17:38 -06:00
Brian Paul
a12614362a glsl: change variable declared assertion into conditional
The slang_variable::declared field originated as a debug field but
can be promoted for use during sematic error checking.

Fixes fd.o bug 27921.

NOTE: this is a candidate for back-porting to the 7.8 stable branch.
2010-05-03 13:58:53 -06:00
Brian Paul
6405ecb399 Revert "glapi: s/strcpy/strncpy/"
This reverts commit 9446fd8f69.

It doesn't make sense to replace strcpy(a,b) with strncpy(a,b,strlen(b)).
The preceeding code effectively does bounds checking, btw.
2010-05-03 13:16:11 -06:00
Brian Paul
cc67bd8799 st/mesa: remove dead code 2010-05-03 13:11:22 -06:00
Brian Paul
529b7b355d st/mesa: restore original last_layer comparison
Commit e648d4a1d1 changed the original
less-than test to a not-equal test.  This was an effort to save some
memory by switching the texture layout to a non-mipmapped layout when
we mis-guessed about the original layout (thus saving some memory).

However, this causes us to hit a new (apparently broken) code path
when copying the old texture's data to the new texture.  Simply
undo this change for the time being until the other/new bug is fixed.

Fixes fd.o bug 27933.
2010-05-03 13:10:27 -06:00
Marek Olšák
ac6a26b429 r300g: use util_format_short_name and util_format_is_plain 2010-05-03 20:39:43 +02:00
Marek Olšák
5a6b9f3855 util: add util_format_short_name 2010-05-03 20:39:43 +02:00
Marek Olšák
bc3d9a8b18 util: add util_format_is_plain 2010-05-03 20:39:43 +02:00
Marek Olšák
5cdedaaf29 r300g: refuse to create a texture with size 0 2010-05-03 20:39:40 +02:00
Marek Olšák
0bcb4f1001 r300g: improve texture debug output, split into TEX and TEXALLOC flags 2010-05-03 19:29:32 +02:00
Török Edwin
15af543f10 Reorder LLVM passes, running mem2reg earlier.
This gives a ~30% shader optimization time improvement on blender.
Tested by comparing the dumped LLVM modules.
Current ordering:
time ~/llvm-git/obj/Release-Asserts/bin/opt l.bc  -constprop -instcombine
-mem2reg -gvn  -simplifycfg
real    0m1.126s
user    0m1.108s
sys     0m0.012s

With this patch:
time ~/llvm-git/obj/Release-Asserts/bin/opt l.bc -mem2reg -constprop -instcombine   -gvn  -simplifycfg
real    0m0.885s
user    0m0.880s
sys     0m0.000s

The overall improvement in blender is ~15%.
Blender without the patch takes 1m13s:
edwin     5934 87.6 11.5 729440 458296 pts/5   SLl+ 17:35   1:13 blender

Blender with the patch takes 1m3s:
edwin     5726 94.2 11.2 716424 446168 pts/5   SLl+ 17:32   1:03 blender

It is still slow with the patch, but better (most of the optimization time is
taken up by GVN, see LLVM PR7023).

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-03 17:01:20 +01:00
José Fonseca
723ab664f6 svga: Silent warning. 2010-05-03 17:01:20 +01:00
Kristian Høgsberg
723511bb32 Generate es glapi files when es1 or es2 is enabled 2010-05-03 08:33:23 -04:00
José Fonseca
9db4a211e9 gallivm: Display message instead of crashing when sampler generator was not supplied for tgsi translation. 2010-05-03 13:18:53 +01:00
Kristian Høgsberg
9ab3df4ebb driswrast: Fix more context creation breakage
Pointed out by Colin Harrison.
2010-05-03 08:01:24 -04:00
José Fonseca
4b891234f8 translate: Make translate_generic truly generic.
PIPE_FORMAT_R10G10B10X2_USCALED, half floats, were not supported, so
just rely on u_format for (almost) universal format support.
2010-05-03 12:18:55 +01:00
José Fonseca
caede7528d draw: Remove draw_pt_fetch_prepare call from llvm middle end.
Unneeded since we code generate the vertex fecthes.
2010-05-03 12:15:32 +01:00
José Fonseca
14a0328d4b tgsi: Parse and dump predicates. 2010-05-03 12:13:54 +01:00
José Fonseca
d288698a76 gallium: Remove loop register file.
It was only used for D3D's REP/END/BGNFOR/ENDFOR. D3D's aL register is
just like another address register now.
2010-05-03 10:53:32 +01:00
José Fonseca
e27983bc08 gallivm: Replace predicate assertion failure with warning message. 2010-05-03 09:54:01 +01:00
José Fonseca
d44c8ee568 draw: Disable rtasm compilation when using LLVM.
Saves time and trouble.
2010-05-03 09:53:12 +01:00
Dave Airlie
738cb50237 nouveau: fix nouveau_create_context decleration 2010-05-03 17:09:54 +10:00
Dave Airlie
e8f48b1dc9 softpipe: invalidate cache view when swizzles are different.
Current code only invalidated if the texture was different, however we
store swizzled values in the cache, so we need to invalidate in that case
also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-03 16:27:42 +10:00
Dave Airlie
26a9b7e4c7 glx: fix regression with GLX_USE_GL
update for fbconfig_style_tags
2010-05-03 16:17:25 +10:00
Zack Rusin
d2b6ed7c4d gallivm: fix nested break and continue statements
we were resetting the mask on each new break/continue statement within
the same scope. we always need to and the current execution mask
with the current break/continue mask to get the correct result (the
masks are always ~1 initially)
2010-05-02 21:40:30 -04:00
Jakob Bornecrantz
c2c1f60391 identity: Move sampler view create and destroy to id_objects.c 2010-05-03 00:27:38 +01:00
Jakob Bornecrantz
59b160d286 identity: s/texture/resource/ 2010-05-03 00:27:37 +01:00
Jakob Bornecrantz
eda7c2506a identity: Whitespace & Style 2010-05-03 00:27:37 +01:00
Jakob Bornecrantz
83a1a0bc3e swrast: Correct include for mtypes.h 2010-05-03 00:27:37 +01:00
Luca Barbieri
d0f9e7521c gallium/util: print \n after DXTn printf
Re-add commit 2d65a7caf9

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-03 00:14:20 +01:00
Xavier Chantry
5362f77b47 llvmpipe: add lp_test_* to .gitignore
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-03 00:13:36 +01:00
José Fonseca
b84590994c svga: Remove the screen private context.
All affected operations have already been moved to context.

More cleanup work can be done, in particular with the buffer transfers.
2010-05-03 00:13:36 +01:00
José Fonseca
49e37469bd svga: Remove empty file. 2010-05-03 00:13:36 +01:00
José Fonseca
7e28479c3a svga: Update flags documentation. 2010-05-03 00:13:36 +01:00
José Fonseca
4885cd4ff7 softpipe: Fix alpha blending for formats without alpha channel.
Don't use the dst alpha channel from the tile cache when it does not
exist in the true format.
2010-05-03 00:13:36 +01:00
José Fonseca
59253a79d8 llvmpipe: Fix alpha blending for formats without alpha channel.
Don't use the dst alpha channel from the swizzled tile when it does not
exist in the true format.
2010-05-03 00:13:36 +01:00
Xavier Chantry
b44c52870d Update drisw state tracker to use new API aware context create
Even though swrast defines its own __DriverAPIRec it still shares the
driCreateNewContext() implementation from dri_util.c.  So the CreateContext
prototypes have to match in the two __DriverAPIRecs.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
2010-05-02 17:46:43 -04:00
Vinson Lee
6edb18ee35 svga: Include svga_surface.h in svga_screen.c.
Fixes svga_screen_init_surface_functions implicit declaration warning.
2010-05-02 13:34:50 -07:00
Vinson Lee
1a30d98159 r300g: Remove unnecessary header. 2010-05-02 13:30:40 -07:00
Xavier Chantry
38e3fb23da Update dri state tracker to use new API aware context create 2010-05-02 16:27:42 -04:00
Vinson Lee
801dcd9e8f mesa: Include api_exec.h in dlist.c.
Fixes _mesa_alloc_dispatch_table implicit declaration warning.
2010-05-02 13:22:37 -07:00
Marek Olšák
b08b7b7377 r300g: do not validate buffers in check_cs
It's already done in r300_emit_buffer_validate.
This also fixes Total Annihilation 3D on debug builds at least.
2010-05-02 20:59:47 +02:00
Marek Olšák
3b2cf97c5c r300g: fix surface_copy for compressed formats
No accelerated blitting for these, it's too messy.
2010-05-02 20:59:47 +02:00
Kristian Høgsberg
2df3c361ef configure.ac: Fix test for whether to build src/gles 2010-05-02 14:52:39 -04:00
Kristian Høgsberg
aa8606fb23 mesa: Include mfeatures.h before testing feature macros 2010-05-02 14:19:54 -04:00
Kristian Høgsberg
da76a4d845 mesa: Only compile ES files when ES1 or ES2 are selected
This still requieres manual generation of the es1 and es2 glapis and is
disabled by default.
2010-05-02 14:09:52 -04:00
José Fonseca
559d124ed3 mesa: #ifdef out more remap_table related code when disabled.
Seems to get everything building again here.
2010-05-02 16:10:40 +01:00
José Fonseca
316b6fa509 retrace: Add sampler_view_destroy 2010-05-02 15:32:09 +01:00
José Fonseca
db1ed3da6c trace: Fix typo in method name. 2010-05-02 15:32:09 +01:00
Kristian Høgsberg
0870e4a202 Merge branch 'gles2-2'
Conflicts:
	src/mesa/drivers/dri/common/dri_util.h
2010-05-02 10:17:07 -04:00
Kristian Høgsberg
9fd5fa0512 Hook in install rules for es1 and es2 2010-05-02 10:14:53 -04:00
Kristian Høgsberg
74399d4af5 Add glesv2.pc and glesv1_cm.pc pkg-config files for ES 1 and 2 2010-05-02 09:51:13 -04:00
Kristian Høgsberg
a804af2a1e st/mesa: Create context for API_OPENGL as first priority 2010-05-02 09:27:51 -04:00
Marek Olšák
9d33605673 r300g: always set the pitch of the first miplevel in the tiling flags
This further reduces the number of DRM calls and flushes.
2010-05-02 13:27:57 +02:00
Marek Olšák
82027b2027 Revert "r300g: disable point sprites (again)"
This reverts commit 3e0f1719d4.
2010-05-02 12:56:34 +02:00
Marek Olšák
68e720e12d r300g: merge VS output mapping state (VAP) to rasterizer block state (RS)
These two should be tied together because what's set in VAP or stuffed in GA
should be rasterized in RS. Not doing so causes a hardlock.

The reason for the merge is that if stuffed texture coordinates (e.g. point
sprite texgen) happen to occupy the texcoord slot dedicated to fog or wpos,
the two must be relocated to other free slots, which needs remapping the vertex
shader outputs.

The rasterizer code is now literally a sequence read-rasterize-write.
2010-05-02 12:56:34 +02:00
Marek Olšák
35232172db r300g: inline update_derived_shader_state 2010-05-02 12:56:34 +02:00
Marek Olšák
45d79af644 r300g: fix segfault when resizing a DRI2 framebuffer
Resetting tiling flags might happen after a texture is destroyed...
Looking at the kernel sources, we don't actually need to reset the tiling
flags.
2010-05-02 12:56:34 +02:00
Marek Olšák
5c6ea462be r300g: cache tiling flags to reduce the number of DRM calls 2010-05-02 12:56:33 +02:00
Vinson Lee
fc1be4a994 mesa: s/sprintf/_mesa_snprintf/ 2010-05-02 01:03:59 -07:00
Vinson Lee
3c86e2f1dc i965g: s/sprintf/util_snprintf/ 2010-05-02 00:21:04 -07:00
Vinson Lee
f4874705d9 glsl: s/sprintf/_mesa_snprintf/ 2010-05-01 22:01:28 -07:00
Vinson Lee
9446fd8f69 glapi: s/strcpy/strncpy/ 2010-05-01 15:34:47 -07:00
Vinson Lee
70c7531051 llvmpipe: Remove unused variable. 2010-05-01 15:12:45 -07:00
Vinson Lee
33c34c0806 progs/tests: Remove meaningless const qualifiers. 2010-05-01 15:07:45 -07:00
Jakob Bornecrantz
cd502e5f5c swrastg: Use trace 2010-05-01 11:31:59 +01:00
Vinson Lee
19aa77313c progs/demos: Remove meaningless const qualifier in vao_demo.c. 2010-05-01 01:28:06 -07:00
Christoph Bumiller
f5a4d70189 nv50: raise constant buffers size to maximum
Removed the param heaps, haven't been using them for a long
time now.
2010-04-30 22:57:23 +02:00
Christoph Bumiller
75ee309ca9 nv50: relax restriction on surface_copy format equality a bit 2010-04-30 22:50:42 +02:00
Christoph Bumiller
6df1e5c4aa nv50: don't segfault on OPCODE_END for empty programs 2010-04-30 22:50:31 +02:00
Brian Paul
d225221e70 llvmpipe: fix out-of-bounds texture sampling
If we're using a wrap mode in which border color sampling is possible
it means that texcoords may be outside of the texture image bounds.
Fetching the texel may result in a segfault.

Use the 'use_border' variable to catch such texcoords and replace
the texel offset with zero (which will be in bounds).

Fixes segfault in Lightsmark demo, fd.o bug 27877.
2010-04-30 13:59:07 -06:00
Brian Paul
3a757b722d llvmpipe: added lp_build_sample_nop() for debugging 2010-04-30 13:59:07 -06:00
Roland Scheidegger
7662e3519b Merge commit 'origin/master' into gallium-msaa 2010-04-30 15:27:13 +02:00
Brian Paul
7c769bef05 st/mesa: remove unused/disabled code 2010-04-29 15:50:30 -06:00
Brian Paul
421e9aa71c mesa: added _mesa_print_framebuffer() for debugging 2010-04-29 15:50:30 -06:00
Eric Anholt
438f38c55a ir_dead_code: Fix segfault on handling a return statement with no value. 2010-04-29 13:54:19 -07:00
Eric Anholt
ee29b86129 i965: Reject shaders with uninlined function calls instead of hanging.
Most of the failure from using uninlined function calls ends up being
just bad rendering, but nested function calls in the VS currently hang
the GPU, so reject them and explain why.
2010-04-29 13:37:27 -07:00
Eric Anholt
07a248a366 mesa: Don't overwrite a driver's shader infolog with generic failure message. 2010-04-29 13:37:27 -07:00
Jakob Bornecrantz
f7cf8b4658 util: Update caps after helpfull input
In no particular order:
* Make list const
* Add function comments
* Clearly state that demo lists are not complete
* Fix whitespace
* Use __FUNCTION__ instead of __func__
* Add unimplemented check which always fail

Thanks Brian and Keith.
2010-04-29 17:59:47 +01:00
Jakob Bornecrantz
110a956a64 util: Add small caps checker helper 2010-04-29 17:00:21 +01:00
Jakob Bornecrantz
3865e3abd4 util: Format error format string as the rest of the pipe formats 2010-04-29 17:00:21 +01:00
Jakob Bornecrantz
c4e89d130f softpipe & llvmpipe: Enable SM3 cap 2010-04-29 17:00:21 +01:00
Zack Rusin
b7618c89b1 draw llvm: stay in bounds even if fetch_count % 4 != 0
if fetch_count % 4 != 0 then on the last iteration we fetch garbage.
this patch makes sure we stay within bounds
2010-04-29 11:53:32 -04:00
Brian Paul
4ccee74725 cso: remove commented-out code, update function docs 2010-04-29 09:39:17 -06:00
Brian Paul
60a6bfefd1 gallivm: add some assertions in special-case sampler code 2010-04-29 09:39:17 -06:00
Eric Anholt
7d8f0fc282 i965: Fix cube map layouts on Ironlake.
We were doubling up the offsets for the mipmap levels for CPU access.
Instead of reimplementing i945_miptree_layout_2d with 6 cube images
separated by qpitch, share that function and provide the level offsets
later.

Fixes piglit cubemap and fbo-cubemap.
2010-04-29 08:34:15 -07:00
Eric Anholt
d05c35914d i965: Implement VS MAX in a more obvious way.
This should be functionally equivalent, with the possible exception of
NaN handling.
2010-04-29 08:34:14 -07:00
Eric Anholt
084d8fdd36 i965: Use immediate float operands for some VS instructions.
We could use this to reduce constant register pressure, but for now it
makes the resulting program assembly much more readable.
2010-04-29 08:34:14 -07:00
Brian Paul
ba6d8448e1 llvmpipe: fix texture/display target memory leak 2010-04-29 09:10:05 -06:00
Jakob Bornecrantz
366798ac6f st/xorg: Try hard to not touch hardware after dropping the master 2010-04-29 14:27:35 +01:00
Jakob Bornecrantz
d8f09ddf1e st/xorg: Remove save and restore hw state 2010-04-29 14:27:35 +01:00
Jakob Bornecrantz
71d3961a47 st/xorg: Get new connection status from kernel 2010-04-29 14:27:34 +01:00
Chia-I Wu
70ae8bf26f progs/egl: Fix building on cygwin.
Update the Makefiles to use variables such as EGL_LIB_NAME.  Define M_PI
if it hasn't been defined yet.
2010-05-19 13:39:40 -06:00
Chia-I Wu
bc73a6289f egl: Link drivers back to libEGL.
Drivers need symbols from libEGL.  Without back-linking, the build fails
on Cygwin.
2010-05-19 13:38:57 -06:00
Mathias Fröhlich
7f19b65b1a gallium/docs: s/milli/nano/ 2010-05-19 08:48:28 -06:00
Vinson Lee
da34757cd7 graw: Disable build of tests/graw.
The SCons build is failing in src/gallium/tests/graw.
2010-05-19 07:40:57 -07:00
Alan Coopersmith
beb5e1c807 fpclassify is available on C99-compliant Solaris releases too
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-05-19 08:29:12 -06:00
Vinson Lee
c85aa99904 util: Remove unused imports from Python scripts. 2010-05-19 06:53:49 -07:00
Vinson Lee
82049b9595 util: Remove unnecessary semicolons in Python scripts. 2010-05-19 06:43:14 -07:00
Keith Whitwell
431a51b9af Merge commit 'origin/graw-tests' 2010-05-19 14:04:16 +01:00
Keith Whitwell
a536c204e2 scons: don't set default_llvm on windows unles LLVM is defined
Otherwise we'll raise an error later in llvm.py
2010-05-19 13:36:05 +01:00
Michal Krol
5a5a82d7e8 softpipe: Calculate slice_stride field in get_transfer(). 2010-05-19 08:23:33 +02:00
Michal Krol
83826dac9b tgsi: Implement OPCODE_DIV. 2010-05-19 08:23:33 +02:00
Kristian Høgsberg
4cd259ca59 dri2_glx: Put the invalidate b/c code back in
The backwards compatibility code calls the DRI driver invalidate hook
on swap buffer and flush front buffer.  This lets the DRI driver rely
on invalidate callbacks and drop the glViewport() hack, even if the
server doesn't send invalidate events.  This is essentially a revert
of 2d00d16da7, except that we now also
pass the __DRI_USE_INVALIDATE extension even when the server doesn't
have DRI2 invalidate events.
2010-05-18 22:58:01 -04:00
Kristian Høgsberg
c8f407bcec dri2_glx: Terminate loader extension list outside #ifdef 2010-05-18 22:58:01 -04:00
Nicolai Hähnle
1712643a29 r300/compiler: Implement constant folding
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-05-19 03:15:25 +02:00
Tom Stellard
19ea2eae91 r300/compiler: Emit 0.5 swizzle when necessary.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-05-19 03:08:50 +02:00
Eric Anholt
81951393e1 i965: Remove constant or ignored-by-hw args from FF sync message setup. 2010-05-18 15:08:17 -07:00
Eric Anholt
dfb7b86e63 i965: Revert accidental debug change in 562e2d114e 2010-05-18 10:12:20 -07:00
Michel Dänzer
b0ba8d6f80 st/xorg: Don't advertise DRI2 version we don't actually support yet.
Fixes DRI2 initialization with current xserver Git.
2010-05-18 17:14:47 +02:00
Zou Nan hai
0f88ce1b0a gen6 fix: fix a wrong bit in binding_table_pointer 2010-05-18 16:07:03 +08:00
Eric Anholt
64f5e9059b i965: Fix point coordinate replacement after airlied's ffvertex changes.
This basically restores the previous state, where a vertex result slot
is set up for the texcoord to be replaced with point coord.  Fixes
piglit point-sprite test.

Bug #27625
2010-05-17 17:47:07 -07:00
Eric Anholt
b8b2670fef i965: Add SF program disasm under INTEL_DEBUG=sf. 2010-05-17 17:47:07 -07:00
Jakob Bornecrantz
b3f625f5e4 llvmpipe: Fix link order for test apps
When linking with --as-needed libgallium.a can't find the dl* symbols from
-ldl since order matters more with --as-needed.

Thanks to Nirbheek Chauhan and Adam Jackson
2010-05-17 22:33:35 +01:00
Kristian Høgsberg
2386d41648 intel: Call intel_draw_buffer() again after _mesa_make_current()
The initial call to intel_draw_buffers() happens when
intel->ctx.DrawBuffer is still NULL.  Call it again after
calling _mesa_make_current().

https://bugs.freedesktop.org/show_bug.cgi?id=28112
2010-05-17 16:50:44 -04:00
Corbin Simpson
bb81f65b18 gallium/docs: Fix missing ref.
Can't ref in the middle of a paragraph.
2010-05-17 12:58:29 -07:00
Corbin Simpson
f1cf6b0d37 gallium/docs: Update for timer queries. 2010-05-17 12:05:18 -07:00
Mathias Fröhlich
cdbd5f4203 gallium: EXT_timer_query support.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-05-17 12:05:18 -07:00
Corbin Simpson
fea91ee22d r300g: Add RS block dump.
Shows what's actually going on in the RS block.
2010-05-17 12:01:16 -07:00
Brian Paul
ddf09d20df st/mesa: call st_flush_bitmap_cache() from st_readpixels()
Fixes regression from commit b0427bedde.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2010-05-17 12:43:50 -06:00
Brian Paul
92f88c746c rbug: remove extra semicolon 2010-05-17 12:43:50 -06:00
Eric Anholt
f0fb3aa5d4 i965: Make rasterization of single and multiple quad prims match.
This is trying to follow the spirit of the invariance rules, though
they're not specific on this point.  Fixes quad-invariance piglit test
while retaining the 22s -> 18s win on glean blendFunc.

This was a regression in c67d9d84f5.
2010-05-17 10:42:25 -07:00
José Fonseca
32a7209c0a gallivm: Tweak ret_mask handling. 2010-05-17 15:22:48 +01:00
Zack Rusin
0b7ca2f8fc gallivm: implement function calls by inlining
with this approach we inline the entire function body in the caller
2010-05-17 09:55:23 +01:00
José Fonseca
7234dc19af i965g: Fix printf format specifier. 2010-05-17 09:54:28 +01:00
Eric Anholt
df3590f570 i965: Remove the half-baked code for multiple OQs at the same time.
GL doesn't actually let you begin an OQ while one is active, so the
extra work was pointless.
2010-05-16 15:34:37 -07:00
Eric Anholt
3d8ed332df i965: Remove unused occlusion query struct field. 2010-05-16 15:34:36 -07:00
Tom Stellard
9d3c57281e r300/compiler: fix peephole optimizer
Tested-by: Marek Olšák <maraeo@gmail.com>
2010-05-16 20:20:55 +02:00
Nicolai Hähnle
997f2eac5e r300/compiler: Implement simple peephole optimizer
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-05-16 20:15:53 +02:00
Marek Olšák
0b94c05c28 r300g: implement flush+sync (AKA glFinish)
See comments in the code.
2010-05-16 19:31:23 +02:00
Marek Olšák
581be86342 r300g: expose radeon_bo_wait to the driver 2010-05-16 19:18:10 +02:00
Marek Olšák
06d4339716 r300g: remove unused winsys entrypoints 2010-05-16 19:18:10 +02:00
Jakob Bornecrantz
c882c310cc sw/wrapper: Implement dt_get_handle 2010-05-16 12:22:19 +01:00
Jakob Bornecrantz
d294c349d5 sw/wrapper: Make sure targets are textures 2010-05-16 12:22:19 +01:00
Jakob Bornecrantz
2db4ee0438 i965g: Fix return for resource_get_handle 2010-05-16 12:22:19 +01:00
Marek Olšák
c1ef21833a r300g/swtcl: put emitting max index to the right place
This fixes CS rejections in openarena.
2010-05-16 05:29:58 +02:00
Marek Olšák
412cdcd479 r300g/swtcl: flush draw to avoid the rejection of CS 2010-05-16 04:10:50 +02:00
Marek Olšák
01e5a73b57 r300g/swtcl: update PSC only once when a shader is changed 2010-05-16 04:10:00 +02:00
Marek Olšák
dca9624201 r300g/swtcl: call update_derived_state only once per draw-call 2010-05-16 04:10:00 +02:00
Vinson Lee
7672305da5 st/xlib: Remove unnecessary header. 2010-05-15 18:48:53 -07:00
Vinson Lee
e9072dcd31 st/xorg: Remove unnecessary header. 2010-05-15 18:44:58 -07:00
Vinson Lee
1d6a6d96ae mesa: Remove unnecessary header. 2010-05-15 18:41:52 -07:00
Vinson Lee
b224264c9d r300g: Move code after declarations.
Fixes SCons build.
2010-05-15 17:44:08 -07:00
Marek Olšák
ee6255052c r300g/swtcl: fix provoking vertex 2010-05-16 00:35:51 +02:00
Marek Olšák
87547ac70c r300g/swtcl: fix point sprite texgen (do it in HW) 2010-05-16 00:21:53 +02:00
Marek Olšák
6a0ec833e4 r300g/swtcl: disable converting points/lines to triangles 2010-05-16 00:06:21 +02:00
Marek Olšák
0ab72a5a0a r300/compiler: silence a warning 2010-05-15 23:53:04 +02:00
Marek Olšák
f86ac27bf9 r300g: fix psychedelic colors with SWTCL
r300_vertex_shader::outputs was uninitialized.
Also remove the tokens parameter.
2010-05-15 22:55:17 +02:00
Marek Olšák
cf5dff1f23 r300g: the vertex_stream_state atom for SWTCL should be static
plus whitespace and comment fixes.
2010-05-15 22:27:27 +02:00
Marek Olšák
04882a2947 r300g: remove unused struct r300_vertex_info 2010-05-15 22:15:56 +02:00
Marek Olšák
95ba021105 r300g: fix emission of some non-CSO atoms at the beginning of CS 2010-05-15 21:22:23 +02:00
Marek Olšák
af87ef10dc r300g: remove unused r300_query::active 2010-05-15 19:39:57 +02:00
Marek Olšák
251fae69e5 r300g: fix BO space accounting for occlusion queries 2010-05-15 19:39:57 +02:00
Marek Olšák
00704370e4 r300g: forbid overlapping queries and print error messages 2010-05-15 19:39:11 +02:00
Marek Olšák
16690366e6 r300g: rename a few emit_query functions 2010-05-15 19:38:28 +02:00
Marek Olšák
6c3afad62b r300g: silence warnings 2010-05-15 19:33:39 +02:00
Vinson Lee
6440dcea21 llvmpipe: Remove unnecessary headers. 2010-05-15 08:38:00 -07:00
José Fonseca
55b5806e36 util: Remove unused cruft. 2010-05-15 11:52:03 +01:00
José Fonseca
8a3bcba12c llvmpipe: Use GALLIVM_DEBUG opt where applicable. 2010-05-15 11:48:39 +01:00
José Fonseca
e7c0b4de17 draw: Use GALLIVM_DEBUG opt. 2010-05-15 11:43:16 +01:00
José Fonseca
145fd48b37 gallivm: Centralize some of the LLVM debugging options. 2010-05-15 11:42:02 +01:00
José Fonseca
263e038431 gallivm: Temporarily remove function call support
Commits moved to the gallivm-call feature branch for further
experimentation and stabilization.
2010-05-15 11:31:10 +01:00
Zack Rusin
af75bb4c98 gallivm: use our util_snprintf 2010-05-15 01:24:00 -04:00
Zack Rusin
7458928370 gallivm: implement function calls 2010-05-15 00:58:57 -04:00
Zack Rusin
b93fa7e2e8 vpglsl: add some simple tests with function calls 2010-05-15 00:58:43 -04:00
Eric Anholt
4e84dc8729 i965: Set the correct provoking vertex for clipped first-mode trifans.
Bug #24470: glean clipFlat test.
2010-05-14 15:37:24 -07:00
Brian Paul
18ed479119 gallivm: added some vector length sanity checks 2010-05-14 13:23:41 -06:00
Brian Paul
11b7c4b1ac gallivm: added lp_sizeof_llvm_type() 2010-05-14 13:23:41 -06:00
Brian Paul
9a0ff95425 gallivm: comments, const qualifiers 2010-05-14 13:23:41 -06:00
Brian Paul
85c6799f6e tgsi: clean up in emit_fetch() 2010-05-14 13:23:41 -06:00
Brian Paul
16f8df893c mesa: more info in glUniform error messages 2010-05-14 13:23:41 -06:00
Brian Paul
e22e65d223 mesa: silence void * / func * conversion warnings 2010-05-14 13:23:41 -06:00
Brian Paul
d1f76b1d85 tgsi: add a dummy function to silence warning 2010-05-14 13:23:41 -06:00
Brian Paul
48d3988b82 mesa: enum bitfields are a gcc-only feature, use GLubyte 2010-05-14 13:23:41 -06:00
Kristian Høgsberg
5dc0f49084 egl: Implement EGL_NOK_texture_from_pixmap
This extension allows a color buffer to be used for both rendering and
texturing.  EGL allows the use of color buffers of pbuffer drawables
for texturing, this extension extends this to allow the use of color
buffers of pixmaps too.
2010-05-14 14:47:54 -04:00
Kristian Høgsberg
554e4fc26a egl: Only allow valid config attributes in _eglParseConfigAttribList()
Passing 0x3030, 0 in the chooser list didn't get caught.
2010-05-14 14:47:54 -04:00
Eric Anholt
c1423e34f9 i965: Add program dumping for INTEL_DEBUG=gs. 2010-05-14 11:27:59 -07:00
Eric Anholt
1c25353bc6 i965: Parse the ff_sync URB send opcode on Ironlake disasm. 2010-05-14 11:27:59 -07:00
Eric Anholt
f5bd48cf67 i965: Use R16G16B16A16_FLOAT for 3-component half-float.
The RGBX version isn't supported as a vertex input type, but since we
force the last channel's value anyway, this should be fine.  The only
potential risk I see is in the limiter on VBO reads past the end of
the buffer forcing the whole vertex to 0 when the A channel lands past
the end.

Fixes piglit draw-vertices-half-float.
2010-05-14 11:27:59 -07:00
Eric Anholt
36eda76fea i965: Dump out the correct shared function for SEND on Ironlake. 2010-05-14 11:27:59 -07:00
Eric Anholt
562e2d114e i965: Support INTEL_DEBUG=clip to dump the clip program. 2010-05-14 11:27:59 -07:00
Eric Anholt
7554b83a21 intel: Handle arbitrary compressed formats in intel_compressed_num_bytes.
Note that we don't support arbitrary block size for compressed quite
yet -- block height of 4 is hard-coded all over the place.

Bug #27098 (srgb dxt1 producing a bytes per pixel of 0).
2010-05-14 11:27:59 -07:00
Marek Olšák
07ff65925f gallium: remove forward declarations of non-existent objects 2010-05-14 19:00:56 +02:00
Marek Olšák
93c997a914 r300g: do not abort if a constant buffer is too large
What else can we do with misbehaving apps?
2010-05-14 19:00:55 +02:00
Marek Olšák
fc11653c2b r300g: add framebuffer state debug logging 2010-05-14 19:00:55 +02:00
Marek Olšák
5a397d8e9f r300g: sort out debug flags 2010-05-14 19:00:55 +02:00
Brian Paul
e6a7ee7fbb egl: remove duplicate ARRAY_SIZE() macro declaration 2010-05-14 10:55:19 -06:00
Brian Paul
ffae54ec15 glxinfo: add queries and reporting for float and sRGB buffer types
Check for the GLX_ARB_fbconfig_float and GLX_NV_float_buffer extensions
to determine if color bufs are floating point.

Check for the GLX_EXT_framebuffer_sRGB extension to determine if the
framebuffer is sRGB capable.

Increase field size for some attribs (visual ID and buffer size) to
accomodate today's larger values.

Also print missing caveats info in verbose mode.
2010-05-14 10:55:19 -06:00
Patrice Mandin
33c08202a1 nouveau/nvfx: Define some capabilities for shaders
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-05-14 18:53:05 +02:00
Vinson Lee
12297f1f98 egl: Silence uninitialized variable warnings. 2010-05-14 08:59:42 -07:00
Brian Paul
1fbb50b740 mesa: print enum name instead of hexadecimal value in glGet errors 2010-05-14 08:25:25 -06:00
Brian Paul
39c13a115e mesa: another transform feedback error check, 80-col wrapping 2010-05-14 08:17:02 -06:00
Alex Kozlov
34c20fd4f5 mesa: fpclassify dummy definition is not needed on FreeBSD. 2010-05-14 06:16:14 -07:00
Keith Whitwell
c7ac03d396 graw: add quad-tex graw test for basic texturing 2010-05-14 12:19:57 +01:00
Keith Whitwell
15321a55e5 graw: combine graw_init and graw_create_window functions
Different environments seem to want to create these in different
orders.  Abstract over this by combining the calls.
2010-05-14 12:19:57 +01:00
Keith Whitwell
c267514470 graw: split util code into new file 2010-05-14 12:19:57 +01:00
Keith Whitwell
7375d7a5c9 graw: move towards glut-like interface, add tri.c 2010-05-14 12:19:57 +01:00
Keith Whitwell
39087f636a scons: add 'targets' variable, for specifying ... targets
Ideally scons should be able to work backwards from the list of
targets to figure out which drivers, state trackers and other
convenience libraries need to be built.
2010-05-14 12:19:57 +01:00
Michel Dänzer
7327a84b18 gallium/draw: Fix PPC compiler warning. 2010-04-29 10:05:49 +02:00
Michel Dänzer
63d1134c86 gallium/draw: Fix PPC build failure. 2010-04-29 10:05:48 +02:00
Marek Olšák
9be226c8b5 r300g: fix compiler error
Ouch.
2010-04-29 07:32:56 +02:00
Marek Olšák
18a5da7a65 r300g: use the enum for color swizzles in the rasterizer 2010-04-29 07:18:37 +02:00
Marek Olšák
04c1536bf7 r300g: rasterizer debug logging 2010-04-29 06:57:08 +02:00
Marek Olšák
9dd06b8da4 r300g: fix tests/yuvrect and possibly even rendering to YUV textures 2010-04-29 05:26:41 +02:00
Marek Olšák
2ba0c64c26 r300g: enable the RGBA16F renderbuffer too 2010-04-29 05:07:23 +02:00
Marek Olšák
195160f8e9 r300g: enable float textures
We still need to wait for state tracker support.
2010-04-29 05:00:17 +02:00
Marek Olšák
3b667700a5 r300g: compose swizzles from texture formats and sampler views 2010-04-29 04:39:19 +02:00
Ian Romanick
a2c6df5566 Track and print user defined structure types 2010-04-28 18:22:54 -07:00
Ian Romanick
36d8a64a95 IR print visitor: Move logic for printing the whole program to _mesa_print_ir 2010-04-28 18:22:54 -07:00
Ian Romanick
7d82c765a8 IR print visitor: Just print the name of structures
Treat structure types like other non-array types.  We'll have to print
the structure defintion elsewhere.
2010-04-28 18:22:54 -07:00
Eric Anholt
35e8e461ca ir_function_inlining: Handle inlining of structure dereferences. 2010-04-28 18:22:54 -07:00
Eric Anholt
c0bfe8723e Correctly handle remapping of array dereferences if ->var is a variable. 2010-04-28 18:22:54 -07:00
Ian Romanick
c824e35dd0 Begin handling some varieties of invalid declarations 2010-04-28 18:22:54 -07:00
Ian Romanick
ab89927a91 Reject conflicting struct declarations, generate struct constructor 2010-04-28 18:22:54 -07:00
Ian Romanick
82baaf4283 glsl_type::generate_constructor_prototype now generates the function too
Also, change the name of the method to generate_constructor.
2010-04-28 18:22:54 -07:00
Ian Romanick
85ba37b97d Always return a value from ast_type_specifier::hir 2010-04-28 18:22:54 -07:00
Ian Romanick
8bec5e92e0 Support structures in glsl_type::generate_constructor_prototype 2010-04-28 18:22:54 -07:00
Ian Romanick
ae000fcb2e Implement structures and arrays in ir_dereference::is_lvalue 2010-04-28 18:22:54 -07:00
Ian Romanick
73986a7a26 Ensure that structure fields have non-NULL types 2010-04-28 18:22:54 -07:00
Ian Romanick
1d28b617ba Ensure that anonymous structures have non-NULL names 2010-04-28 18:22:54 -07:00
Ian Romanick
6efaeeea44 Convert structure field dereferences to HIR 2010-04-28 18:22:54 -07:00
Ian Romanick
7ee79fb6b7 Add ir_dereference constructor for structure field dereferences 2010-04-28 18:22:54 -07:00
Ian Romanick
8f755dcb67 Add glsl_type::field_type
Query the type of a structure field
2010-04-28 18:22:54 -07:00
Ian Romanick
3455ce6144 Begin converting structure definitions to IR 2010-04-28 18:22:53 -07:00
Ian Romanick
1f959ab4d6 Use IDENTIFIER instead of TYPE_NAME for structure names
Since there is no track of which names are structure names during parsing,
TYPE_NAME cannot be produced by the lexer.  Use IDENTIFIER and let the AST
processor sort it out.
2010-04-28 18:22:47 -07:00
Marek Olšák
95bfc8f325 r300g: init s3tc fetching functions 2010-04-29 03:18:42 +02:00
Kenneth Graunke
bf783ecea6 ir_reader: Slightly better error message when failing to read swizzles. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
92eb64cd33 ir_reader: Don't print out the S-Expression.
It's no longer useful for debugging.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
b51557fbe2 ir_reader: Read function calls. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
b142aeeb20 ir_reader: Replace function prototypes with the definition.
Previously, we just created a new one, which was wrong.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
21128c23c6 ir_reader: Fix incorrect error message for expressions. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
46a223224c Make ir_read_error print out the given S-Expression, for context. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
951632253f ir_reader: Fix for swizzles. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
8df335d7f9 ir_reader: Preliminary work toward reading functions. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
09cad1339d ir_reader: Perform a preliminary pass to scan for function prototypes. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
ddf5a011e2 ir_reader: Don't initialize globals, builtins, or constructors.
All of these are currently emitted as part of the IR, so by initializing
them, we actually end up with two copies.  For constructors, we may
eventually wish to avoid emitting them as part of the IR output.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
4ec982fb86 Make ir_read_error set state->error. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
396fa9eba6 ir_reader: Add support for "break" and "continue" in loops.
Includes threading the ir_loop * context through various functions.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
32b305207c ir_reader: Add initial loop support; doesn't yet support break/continue. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
451381c220 ir_reader: Add support for reading (var_ref ...) and (array_ref ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
46ef8f19d7 ir_reader: rvalues are instructions too! 2010-04-28 18:14:54 -07:00
Kenneth Graunke
3ea0582803 ir_reader: Add support for reading conditionals: (if ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
5794497542 ir_reader: Add support for reading array types.
Also, constify glsl_type pointers; this was necessary to use
glsl_type::get_array_instance.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
9d2ff7617a ir_reader: Add support for reading (return ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
d1d2ada3c6 ir_reader: Add support for reading variable declarations.
It also now reads a list of instructions, as it should, rather than a
single rvalue.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
f955649af3 Partial IR reader.
Currently reads assignments, constants, expressions, and swizzles.
2010-04-28 18:14:53 -07:00
Kenneth Graunke
e8b399270d Set language_version to 130 (the max currently supported) when reading IR.
This is necessary so _mesa_glsl_initialize_types can create appropriate
glsl_types and add them to the symbol table.

In the future, we'll want to set it to the max GLSL version supported by
the current driver.
2010-04-28 18:14:53 -07:00
Kenneth Graunke
34350be2cd Add stub ir_reader and new 'i' mode for reading IR rather than GLSL. 2010-04-28 18:14:53 -07:00
Kenneth Graunke
1bfe1c3fdd Add a simple S-Expression reader and printer. 2010-04-28 18:14:36 -07:00
Kenneth Graunke
9d290d786d Use "neg" when printing/reading unary negation rather than "-".
"-" is now only used for binary subtraction.
2010-04-28 15:42:07 -07:00
Kenneth Graunke
3b96996b7e Move array of operator strings out of ir_print_visitor.cpp.
Also implement a reverse-lookup function for use in the IR reader.
2010-04-28 15:42:07 -07:00
Kenneth Graunke
bff6013d46 Factor out parameter list replacement for later reuse. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
0d605cb97c Factor out parameter list matching from ast_function::hir for later reuse.
Unfortunately, we still have two kinds of matching - one, with implicit
conversions (for use in calls) and another without them (for finding a
prototype to overwrite when processing a function body).  This commit
does not attempt to coalesce the two.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
abd40b1521 Factor out qualifier checking code for later reuse. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
0e385196f6 ir_print_visitor: Re-parenthesize ir_call output. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
dde9678162 ir_print_visitor: Print return type of ir_function_signatures. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
405e122a47 ir_print_visitor: Print (constant bool (1)) instead of "true"
It might be better to simply handle "true" in the reader, but since
booleans normally aren't printed as "true" or "false", we may as well go
for consistency.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
2bc582d265 ir_print_visitor: Remove unnecessary parens around expression operands. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
668d0a992a ir_print_visitor: Remove unnecessary parens around array size in types. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
aecdefa8c0 ir_print_visitor: Fix unclosed parenthesis in (call... 2010-04-28 15:34:52 -07:00
Kenneth Graunke
c84f636c97 ir_print_visitor: Fix unclosed parenthesis in (assign ...
Also remove useless parens around subexpressions.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
a02c5afce8 Add parens around printed IR so it's an official list of instructions. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
1168d95109 ir_print_visitor: Remove unnecessary parenthesis around variable names. 2010-04-28 15:34:52 -07:00
Kenneth Graunke
7dd6adbe2e Refactor ir_expression::get_num_operands.
A new static version takes an ir_expression_operation enum, and the
original non-static version now uses it.  This will make it easier to
read operations (where the ir_expression doesn't yet exist).
2010-04-28 15:34:52 -07:00
Kenneth Graunke
1a3a096bf5 ir_print_visitor: print the type of expressions.
This can be useful for debugging - it allows us to see that the inferred
type is what we think it should be.  Furthermore, it will allow the IR
reader to avoid complex, operator-specific type inference.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
295bb7ff8d ir_print_visitor: Remove unnecessary parenthesis around type names.
Parenthesis should only be present for compound types (i.e. arrays
or structures).  For atomic types, simply print the symbol.
2010-04-28 15:34:52 -07:00
Kenneth Graunke
1f0cb24f8b Print full type for ir_constant instead of base and component count.
vec4 and mat2x2 have the same base type and number of components;
printing the full type allows us to distinguish the two.
2010-04-28 15:34:52 -07:00
Kristian Høgsberg
9339c1291d gles: Build libGLESv1_CM.so and libGLESv2.so from glapi files 2010-04-28 14:41:21 -04:00
Kristian Høgsberg
a5107b0a5c intel: Only register ES2 extensions for ES2 contexts 2010-04-28 14:36:45 -04:00
Kristian Høgsberg
0f68032a7c configure.ac: Add options to enable GLES1/2 API support 2010-04-28 14:36:28 -04:00
Kristian Høgsberg
5efee4d4e6 intel: Advertise GLES1/2 for i915+ when enabled 2010-04-28 14:05:22 -04:00
Kristian Høgsberg
4b69100bdc dri: Add DRI entrypoints to create a context for a given API 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
e2fd98d794 egl_dri2: Use new DRI API to create a GLES1/2 context when asked to 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
a7a9a91d7b dri: Add DRI entrypoints to create a context for a given API 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
0f5e8f7702 st/mesa: Move st_cb_drawtex.c to the mesa state tracker 2010-04-28 14:05:20 -04:00
Kristian Høgsberg
3bd6e00346 es: Drop es specific enums.c 2010-04-28 14:05:20 -04:00
Kristian Høgsberg
21ad81727c glapi: Regenerate enums.c for all APIs 2010-04-28 14:05:20 -04:00
Kristian Høgsberg
9664f10023 glapi: Update gl_enum.py to generate enum tables for multiple APIs 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
12c46b15d7 mesa: Drop unused _mesa_init_drawtex_dispatch() 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
1904ba7936 mesa: Move drawtex functionality to main/ 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
87eb667759 mesa: Move glQueryMatrixxOES() implementation to core mesa 2010-04-28 14:05:19 -04:00
Kristian Høgsberg
a73eff645f mesa: Move GLES1 texgen functions to texgen.c 2010-04-28 14:05:18 -04:00
Kristian Høgsberg
7179a82262 mesa: Move support for paletted textures to main/teximage.c 2010-04-28 14:05:18 -04:00
Kristian Høgsberg
08fae07f52 mesa: Handle GL_TEXTURE_GEN_STR_OES in _mesa_Enable() 2010-04-28 14:04:49 -04:00
Kristian Høgsberg
7aae8a592a mesa: Move get_es*.c to main/ 2010-04-27 19:28:11 -04:00
Kristian Høgsberg
0034339895 es: Prefix the get* functions with _es1/2 so they don't conflict 2010-04-27 19:28:11 -04:00
Kristian Høgsberg
61d94dd207 mesa: Move GL_RGB565 workaround into fbobject.c 2010-04-27 19:28:10 -04:00
Kristian Høgsberg
44f9aef9ee mesa: Move GLES1/2 vbo entrypoints to vbo_exec_api.c
This let's us drop stubs.c.
2010-04-27 19:28:10 -04:00
Kristian Høgsberg
c90166fd4f mesa: Move GLES2 shader stubs to main/shaders.c 2010-04-27 19:28:10 -04:00
Kristian Høgsberg
ea0c7e7163 mesa: Move api_exec_es*.c into mesa/main
This requires renaming a few functions to have unique names so that
they can all live within the same driver.
2010-04-27 19:27:49 -04:00
Kristian Høgsberg
1741ddb747 mesa: Move references to main/remap_helper.h to api_exec.c 2010-04-27 13:09:31 -04:00
Roland Scheidegger
9a966b93c0 gallium: fix glaring bugs in last commit 2010-04-27 16:25:50 +02:00
Ian Romanick
3eba593f35 Implement gl_TextureMatrix built-in uniform 2010-04-26 14:59:32 -07:00
Ian Romanick
230ade93a6 Make private glsl_type singletons public 2010-04-26 14:59:16 -07:00
Ian Romanick
c11f1a4fb0 Initial implementation of #line
Does not handle comments in #line or line continuation characters, but
it should be good enough for now.
2010-04-26 14:19:49 -07:00
Roland Scheidegger
aac2cccccf gallium: interface changes for multisampling
add function to set sample mask, and state for alpha-to-coverage and
alpha-to-one. Also make it possible to query for supported sample count
with is_msaa_supported().

Use explicit resource_resolve() to resolve a resource. Note that it is illegal
to bind a unresolved resource as a sampler view, must be resolved first (as per
d3d10 and OGL APIs, binding unresolved resource would mean that special texture
fetch functions need to be used which give explicit control over what samples
to fetch, which isn't supported yet).

Also change surface_fill() and surface_copy() to operate directly on resources.
Blits should operate directly on resources, most often state trackers just used
get_tex_surface() then did a blit. Note this also means the blit bind flags are
gone, if a driver implements this functionality it is expected to handle it for
all resources having depth_stencil/render_target/sampler_view bind flags (might
even require it for all bind flags?).

Might want to introduce quality levels for MSAA later.
Might need to revisit this for hw which does instant resolve.
2010-04-26 19:51:25 +02:00
Alan Hourihane
06574e45b4 gallivm: BGNFOR/ENDFOR fallthrough to BGNLOOP/ENDLOOP 2010-04-26 17:42:51 +01:00
José Fonseca
6ecbbc3c05 draw: Always use the llvm middle end when available & enabled. 2010-04-26 16:05:06 +01:00
José Fonseca
7fd9e3cfb0 svga: Pass-through max_index to translate. 2010-04-26 16:05:06 +01:00
José Fonseca
2a30d3d74a draw: Pass-through pipe_buffer::max_index to translate.
max_index must be observed to prevent crashes due to bad index data.

I've been using this patch for some time without regressions.

Some places, where we use internal vertex buffer, it is not entirely
clear what max_index should be, so passing just ~0 to avoid regressions
for now.
2010-04-26 16:05:06 +01:00
José Fonseca
fc431a58dc translate: Take and respect a max_index argument. 2010-04-26 16:05:06 +01:00
Corbin Simpson
b02f1c86f5 r300g: Rudimentary stats, printed on exit.
Whoo!
2010-04-26 07:13:51 -07:00
Corbin Simpson
bf98d61708 r300g: Add stats debug flag. 2010-04-26 07:13:51 -07:00
Andre Maasikas
12172071b5 r600: enable VERT_RESULT_PSIZ - makes point size & attenuation work
doc additions: shader export ARRAY_BASE for EXPORT_POS: 60 is position,
61 is misc vec(VS_OUT_MISC_VEC - used here),
62, 63 are clip distance vectors(VS_OUT_CCDIST#)

sorry for formating - there seem to be so many different styles in r600
2010-04-26 13:30:01 +03:00
Andre Maasikas
04a148629f r600: adjust point sprites after 911fa4a4a1
there's no more vp results for point coords so we cannot iterate
over vp outputs. Use only Point.CoordReplace[i]
2010-04-26 13:30:01 +03:00
Vinson Lee
5fd97573e3 scons: Include headers from the local include directory first.
Certain headers, such as GL/glew.h, are in both the Mesa include and the
default installed include directories. On recent distros the needed
symbols can be found in both places. On older distros the installed
headers could be lacking symbols, so for a header that exists in both
places, the local one should be found first.
2010-04-26 01:08:34 -07:00
Vinson Lee
31db310be4 os: Check for spurious wakeups in pipe_barrier_wait.
The POSIX function pthread_cond_wait can have spurious wakeups when
waiting on a condition variable.

Add a 64-bit counter that is incremented whenever the barrier becomes
full. A woken thread checks the counter. If the counter has not changed
then it has been spuriously woken and goes back to sleep. If the counter
has changed then it was properly signaled and exits the barrier.

Tested on Mac OS X.

This patch was based on ideas from Luca Barbieri.
2010-04-26 00:31:20 -07:00
Corbin Simpson
59fcbc0ac5 r300g: Use table CS writing when applicable.
I just broke the 2000 fps barrier on glxgears. Yay?
2010-04-26 00:24:26 -07:00
Corbin Simpson
c53142c3f4 r300g: Add CS table writing. 2010-04-26 00:24:26 -07:00
Vinson Lee
2d1b95477f et/egl: Remove dead code.
proc_name cannot be NULL after the switch statement. proc_name is
assigned a value or the function has already returned.
2010-04-26 00:19:14 -07:00
Vinson Lee
310ec9a17c nvfx: Add include path to SCons build. 2010-04-25 22:51:14 -07:00
Marek Olšák
671f1e1229 r300g: support index bias on r500 and DRM 2.3.0 2010-04-26 07:22:00 +02:00
Marek Olšák
54bcee1e40 r300g: support rendering more than 65535 vertices in one batch on r500
and disable batch splitting on these chipsets.
2010-04-26 07:22:00 +02:00
Marek Olšák
2579fe4044 r300g: emit MSPOS regs 2010-04-26 07:22:00 +02:00
Marek Olšák
b9e637e8cf r300g: force prefetch for non-indexed vertices 2010-04-26 07:22:00 +02:00
Marek Olšák
537d117ed5 r300g: use the dummy FS shader for shaders with zero instructions 2010-04-26 07:22:00 +02:00
Marek Olšák
52e591383b r300g: allow unaligned vertex formats if the stride is dword-aligned 2010-04-26 07:22:00 +02:00
Marek Olšák
824e2afea0 r300g: abort on unsupported vertex formats 2010-04-26 07:21:59 +02:00
Marek Olšák
d00b2560d5 r300g: abort if a vertex buffer offset is not dword-aligned 2010-04-26 07:21:59 +02:00
Vinson Lee
210218bb96 st/wgl: s/st_manager_create_api/st_gl_api_create/
commit 0c572c6828 replaced
st_manager_create_api with st_gl_api_create.

Fixes MSVC build.
2010-04-25 21:42:19 -07:00
Vinson Lee
78b47c337f nvfx: Add missing header. 2010-04-25 21:22:40 -07:00
Jakob Bornecrantz
1372a8f90d st/dri: Refactor dri_st_api into other files 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
27779ddad5 st/dri: Make st_framebuffer_iface the base for dri_drawable 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
a66b391edf st/dri: Make st_manager the base for dri_screen 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
ea6a52a1f8 st/dri: Add hooks for framebuffer functions 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
ab12d4f647 st/dri: Make lookup_egl_image a hook 2010-04-26 00:40:17 +01:00
Jakob Bornecrantz
0c572c6828 st_api: Remove st_module
The struct st_module isn't needed as it is the same thing as the st_api
struct. That is they both represent the API. Instead just use a single
function entry point to the the API.
2010-04-26 00:40:17 +01:00
José Fonseca
81ab19de04 llvmpipe: Respect pipe_sampler_view::swizzle_r/g/b/a
This allows u_sampler_view_default_dx9_template to do its magic on DX9.
2010-04-26 00:32:13 +01:00
José Fonseca
4dd1a56840 draw: Respect pipe_vertex_buffer::max_index in llvm generated code.
Everybody should respect max_index, specially llvm generated code, which
likes to eat vertices 4 at a time, so it may end up chew a bit a bit more
than actually exists.
2010-04-25 23:41:49 +01:00
José Fonseca
2cd128ab44 llvmpipe: No need to flush the caches for buffers. 2010-04-25 23:41:48 +01:00
José Fonseca
53e94bd4ad softpipe: Make softpipe transfers in-order.
Transfer, being now a context operation, should happen in order with
all other contexts operations. If there is rendering pending on the
resource then the driver must flush and potentially wait itself
internally.

Instead of avoiding using transfers internally (as done in llvmpipe) I've
opted to simply pass PIPE_TRANSFER_UNSYNCHRONIZED in all internal
transfers, to avoid infinite recursion.
2010-04-25 23:41:48 +01:00
José Fonseca
43b85af56e llvmpipe: Cleanup/improve llvmpipe_flush_resource usage.
Recognize PIPE_TRANSFER_UNSYNCHRONIZED and PIPE_TRANSFER_DONTBLOCK.
2010-04-25 23:41:48 +01:00
Vinson Lee
8352983e2a llvmpipe: Remove unused variable. 2010-04-25 13:10:02 -07:00
José Fonseca
7951630d08 llvmpipe: llvmpipe_flush_texture -> llvmpipe_flush_resource 2010-04-25 15:54:32 +01:00
José Fonseca
5745bcb2db llvmpipe: Fix buffer overflow unswizzling several formats.
Array formats without for channels were being advanced as four channels,
causing buffer overflows.
2010-04-25 15:54:32 +01:00
José Fonseca
89f244931f softpipe: Hardcode TILE_CLEAR_OPTIMIZATION to 1.
The un-optimized path relies on surface_fill which can only handle formats
with depth <= 32, so it is pointless to keep it around.
2010-04-25 15:54:32 +01:00
José Fonseca
23df86d851 llvmpipe: Replace tile_read/write with more descriptive swizzle/unswizzle verbs. 2010-04-25 15:54:31 +01:00
José Fonseca
adc7cd6240 llvmpipe: Cleanup llvmpipe_is_format_supported().
It should be just cosmetic.
2010-04-25 15:54:31 +01:00
José Fonseca
7e4ce65d71 softpipe: More accurate softpipe_is_format_supported().
Unfortunately there are some heavy limitations on supported render target
formats due to the way clear values are used internally.
2010-04-25 15:54:31 +01:00
José Fonseca
8a70c47c4c llvmpipe: Remove sp2lp.sh.
Irrelevant now that llvmpipe and softpipe grew so far apart.
2010-04-25 15:54:30 +01:00
José Fonseca
7cebd16fbb llvmpipe: lp_tex_sample_llvm.c -> lp_tex_sample.c
'llvm' suffix unnecessary now that the C sampling version disappeared.
2010-04-25 15:54:30 +01:00
Vinson Lee
7b7a9e8927 st/dri: Add missing header.
Add GL/internal/dri_interface.h for __DRI_TEXTURE_FORMAT_RGB.
2010-04-25 02:18:52 -07:00
Vinson Lee
5d37cebc1b gallivm: Rename variable info to opcode_info.
Avoid hiding existing variable already named info in outer scope.
2010-04-25 02:04:13 -07:00
Vinson Lee
d69ed3a96e radeon: Remove NULL check of bo_legacy->tobj.
bo_legacy->tobj cannot be NULL before the call to driUpdateTextureLRU.
There is a NULL check earlier in the routine, and if bo_legacy->tobj is
NULL, memory is allocated.
2010-04-24 23:44:56 -07:00
Vinson Lee
a1a7738223 gallivm: Remove NULL check of pointer that can't be NULL.
info cannot be NULL at the call to debug_printf. emit_instruction
dereferences info, so at debug_printf it is either not NULL or the
program has already crashed.
2010-04-24 23:31:35 -07:00
Vinson Lee
9bc54ca991 dri: Remove unnecessary header. 2010-04-24 23:14:27 -07:00
Vinson Lee
bd93670bfd nvfx: Add to SCons build. 2010-04-24 16:22:47 -07:00
Dave Airlie
22e8ddc748 llvm: fix configure.ac harder 2010-04-25 07:55:15 +10:00
Vinson Lee
ac942f5aa2 nv50: Add to SCons build. 2010-04-24 14:38:48 -07:00
Vinson Lee
b147aaea4d llvmpipe: Remove unused variable. 2010-04-24 14:29:08 -07:00
Vinson Lee
c7bb271f0d llvmpipe: Remove unnecessary header. 2010-04-24 14:19:47 -07:00
José Fonseca
e54a86c677 llvmpipe: Implement shader bias.
Fixes glean glsl1 test: texture2D(), with bias.
2010-04-24 21:00:45 +01:00
José Fonseca
cca8abe20e mesa: Eliminate multiple va_list usage.
va_list is a mutable iterator. When passed to a function it will likely
point to somewhere else.

This fixes segmentation fault in glean vertProg1 on Ubuntu 9.10.
2010-04-24 20:31:30 +01:00
José Fonseca
1eeae05441 util: Add missing static keyword. 2010-04-24 16:13:54 +01:00
José Fonseca
ee15d5a0c4 util: Fix unsigned <-> ptr conversions. 2010-04-24 16:13:41 +01:00
José Fonseca
aa7a47dcbd llvmpipe: Initialize dummy variable. 2010-04-24 16:13:18 +01:00
José Fonseca
bd6e9e3350 llvmpipe: Don't use fences when not using threads.
lp_setup_flush has effect immediately.
2010-04-24 16:13:04 +01:00
José Fonseca
39be50dcde llvmpipe: Move the determination of the number of threads to the screen. 2010-04-24 13:20:39 +01:00
José Fonseca
e7a8cfc877 gallivm: Centralize the cpu caps detection. 2010-04-24 13:19:10 +01:00
José Fonseca
30a1c36dc8 llvmpipe: Pass flatshade_first to setup.
Fixes piglit provoking-vertex.
2010-04-24 12:00:06 +01:00
José Fonseca
e94a092437 svga: D3DCOLOR actually stands for B8G8R8A8. 2010-04-24 11:39:12 +01:00
José Fonseca
e6c3f594e9 svga: Translate recently added vertex formats. 2010-04-24 11:39:09 +01:00
José Fonseca
53499c64b2 cso_cache: Ensure irrelevant state of the blend state is zeroed.
Otherwise drivers that bake the full blend state in a key end up having
uninitialized memory in their key.

Courtesy of valgrind.
2010-04-24 11:39:09 +01:00
Jakob Bornecrantz
a523b62203 st/dri: DRI2 give proper binding to depth buffer 2010-04-24 11:24:26 +01:00
José Fonseca
94b04d3d1c sw/xlib: Fix bad logic in shm allocation.
Fixes fdo 27823.
2010-04-24 10:15:09 +01:00
José Fonseca
35a920e83b gallivm: LLVMConstBitCast -> LLVMBuildBitCast
As the argument in general might not be a constant.
2010-04-24 10:06:27 +01:00
Dave Airlie
81fe19843a llvmpipe: add initial autoconf support.
allows the swrastg_dri.so to be built with llvmpipe, also links llvm
to all dri drivers

use --enable-gallium-llvm to use it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-24 18:55:50 +10:00
Vinson Lee
e3eed8bf21 nouveau: Add to SCons build. 2010-04-24 01:15:00 -07:00
Vinson Lee
dda8046a64 gallium/docs: Update Gallium version number to 0.4. 2010-04-24 00:21:34 -07:00
Vinson Lee
3ee4ec99ea llvmpipe: Remove unused variable. 2010-04-24 00:02:48 -07:00
Vinson Lee
c3c920ee2c gallium: In option helpers, move assignment outside of if clause.
This silences Coverity assign_where_compare_meant warnings.
2010-04-23 22:06:19 -07:00
Brian Paul
4ff354f281 st/mesa: checkpoint WIP: mipmap generation for compressed textures
Something is wrong with the images strides when compressing/decompressing
images...
2010-04-23 18:12:45 -06:00
Brian Paul
63c9b4f3d2 xlib/sw: remove stray semicolon 2010-04-23 18:12:27 -06:00
Brian Paul
1a4383cd42 softpipe: compressed formats can't be render targets 2010-04-23 18:12:24 -06:00
Brian Paul
b806f2a239 gallium/util: document that pack/unpack strides are in bytes 2010-04-23 18:12:19 -06:00
Eric Anholt
25ebc0459f builtin_functions: Clean up compiler warning about unused name, instructions. 2010-04-23 16:12:44 -07:00
Eric Anholt
d7f6f346be De-obfuscate some of builtin_types.h. 2010-04-23 16:12:44 -07:00
Eric Anholt
e8e9748722 ir_function_inlining: Implement inlining in many more cases.
We still don't inline for control flow in the inlined function, and we
don't have any limits on what we will inline.
2010-04-23 16:12:44 -07:00
Eric Anholt
ec9e73870c Put static pointers to vec[234]_types along with the static float_type.
Otherwise you have to type a lot of get_instance.
2010-04-23 16:12:44 -07:00
Eric Anholt
8d3e59f1f3 Replace builtin_types.h generation with the generated output.
The script to generate it was longer and more obfuscated than the output.
2010-04-23 16:12:44 -07:00
Eric Anholt
82ad90f8cf Fix the swizzling of vector constructors from scalars.
A refactor turned 'i' into '1', meaning everything writemasked into
the y component.
2010-04-23 16:12:44 -07:00
Eric Anholt
22147be898 ir_function_inlining: Avoid NULL dereference on assignment conditions. 2010-04-23 16:12:44 -07:00
Brian Paul
394ff065f3 st/mesa: minor improvements in fallback_generate_mipmap() 2010-04-23 16:04:55 -06:00
Brian Paul
51523f1144 st/mesa: remove unneeded #includes and add/update comments 2010-04-23 15:41:49 -06:00
Brian Paul
76c7ad2e7d st/mesa: clean-up: use st_context() everywhere 2010-04-23 15:41:49 -06:00
Brian Paul
57fc2e7802 mesa: simplify some code in _mesa_generate_mipmap() 2010-04-23 15:41:49 -06:00
Brian Paul
67f928eef3 gallium/failover: include u_memory.h for MALLOC, FREE 2010-04-23 15:39:43 -06:00
Brian Paul
06441af657 gallium/draw: remove old comment 2010-04-23 15:36:14 -06:00
Jakob Bornecrantz
1820d240cd gallium: Convert some uses of get option to static 2010-04-23 21:57:49 +01:00
Jakob Bornecrantz
89aaaab79f gallium: Add static get option helpers 2010-04-23 21:57:49 +01:00
Jakob Bornecrantz
7159303dbf gallium: Add option to not print options 2010-04-23 21:57:49 +01:00
José Fonseca
2ce1d6696b gallium: s/free/FREE/ and same for friends.
Based on Stephen Johnson's feedback.
2010-04-23 21:53:08 +01:00
Ian Romanick
6aeada7966 Zero-out the entire parser state structure at initialization
Among other things, this ensures that all of the extension flags are
initially disabled.

This causes the following tests to pass:

    glslparsertest/glsl2/draw_buffers-02.frag
2010-04-23 13:37:47 -07:00
Ian Romanick
eb56cea3b3 Add missing 'else's to fix extension processing
The missing else-statements caused all of the extensions execpt
GL_ARB_texture_rectangle to be unsupported.

This causes the following tests to pass:

     glslparsertest/glsl2/draw_buffers-04.frag
2010-04-23 13:32:23 -07:00
Brian Paul
4aa4fe8e21 st/mesa: re-do binding flags in st_ChooseTextureFormat(), again
Try to specify render target bindings flags first.  If that fails, try
again with just sampler view binding.  Note that we try to create the
texture resource with render target binding flags later when we allocate
the texture.  Then, in FBO validation, we check if we can actually render
to the textures.  If that fails, we generate GL_FRAMEBUFFER_UNSUPPORTED_EXT.

Changes suggested by Jose.
2010-04-23 13:16:37 -06:00
Brian Paul
8283db8841 st/mesa: replace 'usage' with 'bindings' 2010-04-23 13:16:37 -06:00
Brian Paul
eb2bd2158e st/mesa: replace 'usage' with 'bindings' to be consistent
Plus, update comments and formatting.
2010-04-23 13:16:37 -06:00
Ian Romanick
e4c54d4049 Merge branch '7.8' 2010-04-23 11:52:14 -07:00
Aaron Plattner
ad7d36e919 Fix __glXInitializeVisualConfigFromTags's handling of unrecognized fbconfig tags.
__glXInitializeVisualConfigFromTags doesn't skip the payload of
unrecognized tags.  Instead, it treats the value as if it were the
next tag, which can happen if the server's GLX extension is not
Mesa's.  For example, this falls down when NVIDIA sends a
GLX_FLOAT_COMPONENTS_NV = 0 pair, causing
__glXInitializeVisualConfigFromTags to bail out early.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-23 11:48:11 -07:00
Stephen Johnson
c09f370519 draw: use FREE() instead of free() 2010-04-23 19:34:55 +01:00
Brian Paul
70df04404b st/mesa: don't set RENDER_TARGET/DEPTH_STENCIL flag for compressed textures 2010-04-23 12:29:31 -06:00
Brian Paul
a8c78f3aa1 st/mesa: get rid of default_deep_rgba_format()
This special-case code used to be used for the accum buffer but
the accum buffer implementation was changed some time ago.
2010-04-23 12:29:31 -06:00
Brian Paul
c34feadd1c mesa: make is_compressed_format() non-static 2010-04-23 12:29:31 -06:00
Brian Paul
3643841079 mesa: faster, simpler is_compressed_format() 2010-04-23 12:29:31 -06:00
Brian Paul
f855193796 llvmpipe: rename texture refs to resource refs 2010-04-23 12:29:31 -06:00
Alan Hourihane
00f8e5764d llvmpipe: update for half float formats 2010-04-23 19:26:03 +01:00
José Fonseca
f73feb9cd6 st/xlib: Try to propagate failure to create framebuffer.
Doesn't help much, since it is ignored by st_framebuffer_validate.
2010-04-23 17:08:11 +01:00
José Fonseca
d7996beb4c softpipe: YUV textures should be supported. 2010-04-23 17:08:11 +01:00
José Fonseca
99bee1570b mesa/st: Remove dead members. 2010-04-23 17:08:11 +01:00
José Fonseca
405f925d4e sw/xlib: Fallback to XPutImage when shmget fails.
After continuously running regression tests on Ubuntu for 2 days, shmget
mysteriously starts to fail. Even when the X server is reset.

This allow rendering to proceed, albeit using a slower presentation path.
2010-04-23 17:08:11 +01:00
Brian Paul
158f9d56e0 llvmpipe: increase max 2D texture / surface size to 4K x 4K 2010-04-23 09:13:27 -06:00
Brian Paul
4a72ec49f6 llvmpipe: rename MAXWIDTH, MAXHEIGHT 2010-04-23 09:13:26 -06:00
Brian Paul
2de31f2bf2 llvmpipe: rename lp_tile_size.h to lp_limits.h
Collect the various driver limits in one place since.
2010-04-23 09:13:26 -06:00
Brian Paul
71dfbb608a llvmpipe: move LP_MAX_TEXTURE_x_LEVELS, etc to lp_tile_size.h 2010-04-23 09:13:26 -06:00
Jerome Glisse
ccd13da0fc Merge remote branch 'origin/7.8' 2010-04-23 12:08:36 +02:00
Jerome Glisse
eb4dc54788 r600: don't enable depth test if there is no depth buffer
If there is no depth buffer bound to current context don't
enable depth test. GL states that if depth test is enabled
without depth buffer it's as if depth buffer always pass.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-04-23 11:56:06 +02:00
Michel Dänzer
ff20543c81 Merge branch '7.8' 2010-04-23 11:18:29 +02:00
Michel Dänzer
c37e275e77 glx/dri2: Fix build with dri2proto which doesn't define X_DRI2SwapInterval. 2010-04-23 11:16:03 +02:00
Vinson Lee
749a8825a0 llvmpipe: Remove unused variable. 2010-04-23 00:59:12 -07:00
Eric Anholt
b2e52e7278 i965: Fix assertion for surface tile offset usage on Ironlake.
Fixes assertion failure in fbo-generatemipmap-npot.
2010-04-22 15:37:33 -07:00
Eric Anholt
64516430be i965: Fix scissoring when width or height is 0.
We would run into trouble due to the hardware using inclusive numbers
and the subtraction to handle that producing negative (meaning large
positive) coordinates.

Bug #27643.
2010-04-22 15:37:33 -07:00
Zack Rusin
021e0dc78b gallivm: implement indirect addressing over temporaries
a bit more involved than indirect addressing over consts, but still
fairly reasonable. we allocate an array instead of individual alloca's,
and we do it only if the shader does indirect addressing.
2010-04-22 18:36:07 -04:00
Zack Rusin
ded2374e67 gallivm: implement indirect addressing over constants
implement indirect addressing (ARL and ARR instructions) when used
with CONST's. indirect addressing over other vars (temps, inputs, outputs)
is not supported yet.
2010-04-22 17:33:14 -04:00
Tormod Volden
355370e30b radeon: 9800 SE has only one quadpipe
Although these cards have 2 pipelines on the silicon only
the first passed the QA and the other should be disabled.

http://www.digital-daily.com/video/ati-radeon9800se/
http://www.rojakpot.com/showarticle.aspx?artno=101&pgno=1

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
2010-04-22 17:14:15 -04:00
Brian Paul
d888812324 gallium: use better param name 2010-04-22 14:39:12 -06:00
Brian Paul
19b26cb0a2 gallivm: remove Z/stencil special case code in lp_build_sample_offset()
Fixes progs/tests/zreaddraw.c and progs/demos/shadowtex.c
2010-04-22 14:37:50 -06:00
Brian Paul
17249ae8e0 st/mesa: assert that binding flags are properly set for drawing surfaces 2010-04-22 14:37:50 -06:00
Brian Paul
e9bcad4c33 st/mesa: fix binding flags in st_ChooseTextureFormat()
See comment for more info.
2010-04-22 14:37:50 -06:00
Brian Paul
9f74fa111b progs/tests: asst. improvements to zreaddraw.c 2010-04-22 14:37:50 -06:00
Jesse Barnes
45e2b51c85 DRI2/GLX: check for vblank_mode in DRI2 GLX code
Re-add support for the vblank_mode environment and configuration
variable.  Useful for benchmarking and app control.
2010-04-22 12:49:45 -07:00
Jesse Barnes
234286c0f8 DRI2: add config query extension
Add a new DRI2 configuration query extension.  Allows for DRI2 client
code to query for common DRI2 configuration options.
2010-04-22 12:49:45 -07:00
José Fonseca
c059565054 llvmpipe: Undo zs tiling changes.
tile_w/tile_h have different meaning there.

This partialy reverts commit ccdc6b5913.
2010-04-22 20:38:36 +01:00
José Fonseca
cb384ae8b2 gallium/docs: Unswap PIPE_BIND_SHARED's comment. 2010-04-22 19:51:10 +01:00
Brian Paul
f836a5f60b gallium/docs: many updates to screen.rst
Put PIPE_BIND_ and PIPE_TEXTURE_GEOM_ prefixes on token names so
that they can be found with grep.  This needs to be done in more places.

Corrected/improved a lot of information and grammer.

I don't know how to properly format everything - someone else can take
care of that.
2010-04-22 12:47:10 -06:00
José Fonseca
cdaceaafee llvmpipe: Portability fixes. 2010-04-22 19:25:00 +01:00
José Fonseca
ccdc6b5913 llvmpipe: Fix rendering to non 32bpp formats.
Tiled layout always used 32bpp, therefore linear/tiled strides are not
related.
2010-04-22 19:25:00 +01:00
Zack Rusin
18a4a83dda gallivm: update comments 2010-04-22 13:57:18 -04:00
Zack Rusin
6d2e09fdc2 gallivm: fix nested cont statements 2010-04-22 13:57:18 -04:00
Zack Rusin
3a423dcf9d gallivm: fix nested break statemants 2010-04-22 13:57:18 -04:00
Zack Rusin
63aa9b505a gallivm: make sure we return the correct type when approximating log's 2010-04-22 13:57:18 -04:00
Kristian Høgsberg
fa41610630 mesa: Move struct _glapi_table allocation out of context.c
We now allocate the table from api_exec.c and dlist.c where we fill out
the table.  This way, context.c doesn't need to know the actual contents
of struct _glapi_table.
2010-04-22 13:43:28 -04:00
José Fonseca
8bee4c7718 llvmpipe: Use resource_is_texture() consistently.
Otherwise slightly difference order causes assertion failures.

Also remove mentions of PIPE_BIND_SCANOUT/PIPE_BIND_SHARED. They are not
propoer bind flags and will likely be deprecated. If surfaces should
be passed to the winsys then they should have the DISPLAY_TARGET flag
set, which is a proper bind flag.
2010-04-22 18:42:03 +01:00
Brian Paul
50d77c79fb gallium: fix comment language, remove dangling comment 2010-04-22 11:33:26 -06:00
Brian Paul
1143221cfd st/mesa: consolidate code for finding supported formats 2010-04-22 11:11:26 -06:00
Brian Paul
e65b11525a st/mesa: refactor depth/stencil format selection code 2010-04-22 11:11:26 -06:00
Brian Paul
446062b834 mesa: sort texel fetch/store table by format index 2010-04-22 11:10:42 -06:00
Brian Paul
b4a191e351 Merge branch '7.8'
Conflicts:

	src/mesa/state_tracker/st_format.c
2010-04-22 11:10:19 -06:00
Brian Paul
b1a9c76b57 st/mesa: add cases for MESA_FORMAT_Z24_X8, MESA_FORMAT_X8_Z24 2010-04-22 11:06:19 -06:00
Brian Paul
4d7ef6e06b mesa: fix conversion errors in signed_rgba8888[rev] texel fetch
Without the cast the returned texel colors were wrong.
Also, we don't need the "& 0xff" part anymore.
Bug found by Vinson Lee.
2010-04-22 11:06:19 -06:00
José Fonseca
2eea1714fd llvmpipe: Fix resource_is_texture.
It was missing PIPE_BIND_RENDER_TARGET, causing assertion failures for
pure render targets.

Also bind flags are too variable and complex for a good assessment for
whether the resource is a texture or not. Target is more concise.
2010-04-22 18:06:05 +01:00
Kristian Høgsberg
ade150d667 mesa: Compute extension string according to API
We can now stop special casing glGetString() and drop specials_es*.c.
2010-04-22 12:42:23 -04:00
Kristian Høgsberg
18f7e118a5 es2: Move over es2 code to compute extensions 2010-04-22 12:42:23 -04:00
Kristian Høgsberg
04bf868ad9 main: Report GL_SHADING_LANGUAGE_VERSION according to API 2010-04-22 12:42:23 -04:00
Kristian Høgsberg
29107d4e07 mesa: Compute GL version according to API 2010-04-22 12:42:22 -04:00
Kristian Høgsberg
218ceb3e18 mesa: Move API specific context intialization into context.c 2010-04-22 12:42:17 -04:00
Kristian Høgsberg
38d771c053 st/mesa: Use API-aware context constructor
The mesa state tracker is currently the only place where we create a
context and expect it to implement GLES1/2.  Use the API-aware constructor
to communicate this to core mesa.
2010-04-22 11:44:13 -04:00
José Fonseca
510669cd87 llvmpipe: Do not advertise S3TC rendering support. 2010-04-22 15:12:30 +01:00
José Fonseca
6ae9975ea0 llvmpipe: Fix typo in assert. 2010-04-22 15:11:57 +01:00
José Fonseca
52bc90caa8 u_format: Reduce code duplication. 2010-04-22 15:11:34 +01:00
Kristian Høgsberg
2ab18d63cb mesa: Track the OpenGL API we're implementing in the context
This introduces a new way to create or initialize a context:

  _mesa_create_context_for_api and
  _mesa_initialize_context_for_api

which in addition to the current arguments take an api enum to indicate
which OpenGL API the context should implement.  At this point the
API field in GLcontext isn't used anywhere, but later commits will
key certain functionality off of it.

The _mesa_create_context and _mesa_initialize_context functions are
kept in place as wrappers around the *_for_api versions, passing in
API_OPENGL to get the same behavior as before.
2010-04-22 09:25:51 -04:00
Vinson Lee
bd91f665a7 gallivm: Remove unused variable. 2010-04-22 00:45:27 -07:00
Kenneth Graunke
25851a8d87 Fix illegal (var_ref (array_ref ...)) in matrix constructors. 2010-04-22 00:25:55 -07:00
Kenneth Graunke
67029b13b7 Actually emit temp declaration in vector comparison builtins. 2010-04-21 23:58:13 -07:00
Alex Deucher
48a1806126 r300g: fix vertex unit setup
RV3xx is 2, RV560,RV570 is 8

Noticed by Tormod Volden.
2010-04-22 02:37:34 -04:00
Alex Deucher
986eb4b99f r300: fix vertex unit setup
RV3xx is 2, RV560,RV570 is 8

Noticed by Tormod Volden.
2010-04-22 02:33:10 -04:00
Vinson Lee
7a0b48e349 gallium/util: Fix deviation calculation in u_cache.
The approximate deviation calculation was using the entire cache's total
instead of each cache entry's total.
2010-04-21 18:45:44 -07:00
Vinson Lee
393009a939 gallium/tests: Add test case for u_cache. 2010-04-21 18:31:01 -07:00
Brian Paul
7fe93f831d gallivm: added some assertions in loop-gen code
We're hitting these assertions with nested loops...
2010-04-21 18:22:18 -06:00
Aaron Plattner
2e995cdf25 progs/demos: Fix the progs/demos/rain help text
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-21 18:13:19 -06:00
Brian Paul
bba6a196bb gallivm: fix copy&paste error: s/cont_stack_size/break_stack_size/ 2010-04-21 17:58:32 -06:00
Brian Paul
fc9b8cd9dd gallivm: emit_instruction() is boolean 2010-04-21 17:57:44 -06:00
Kenneth Graunke
6202cbfe36 Fix ir_dead_code for function refactoring. 2010-04-21 16:02:15 -07:00
Kenneth Graunke
7bcd5bedcc Emit body for constructors in the right place.
Previously, the body of some vector constructors were added to the wrong
function signature, and the body of matrix constructors were just being
dumped in the main instruction stream.
2010-04-21 15:37:10 -07:00
Kenneth Graunke
3289886688 Remove ir_label since it is no longer used. 2010-04-21 15:37:10 -07:00
Kenneth Graunke
9fa99f3b6c Refactor IR function representation.
Now, ir_function is emitted as part of the IR instructions, rather than
simply existing in the symbol table.  Individual ir_function_signatures
are not emitted themselves, but only as part of ir_function.
2010-04-21 15:36:36 -07:00
Kenneth Graunke
f96c52ba2e Use ir_function_signature::function_name() rather than direct access. 2010-04-21 15:36:36 -07:00
Kenneth Graunke
67a092ae09 Ensure that both parameter lists are the same length in function overloading.
Fixes new test function-05.glsl, where the second function has matching
parameter types, but less of them.
2010-04-21 15:36:36 -07:00
Brian Paul
5b639cdc3e progs/glsl: better comments 2010-04-21 16:30:13 -06:00
Brian Paul
04c136d5c2 llvmpipe: add missing dependency in Makefile 2010-04-21 16:30:13 -06:00
Brian Paul
feffd259da gallivm: implement TGSI KILP
As in tgsi_exec.c we don't actually rely on condition codes; we do
an unconditional kill.  The only predication comes from the execution
mask which applies inside loops/conditionals.
2010-04-21 16:30:13 -06:00
Ian Romanick
ff236fa9b6 Add missing break statement 2010-04-21 15:08:08 -07:00
José Fonseca
5c364b3ef7 draw: Make LLVM integration work without llvmpipe too (e.g. sofptipe).
Prevents the assertion failure.
2010-04-21 22:58:41 +01:00
Marek Olšák
dab8f6b1d9 radeon: fix warning 2010-04-21 22:57:01 +02:00
Marek Olšák
dd029dcb14 r300g: raise the max index for generic varyings to 32
This should fix an assertion failure in the game Heroes of Newearth.
Yes, the game seems to generate semantic indices greater than 15.
2010-04-21 22:57:01 +02:00
Brian Paul
01c12ed60c softpipe: call draw_wide_point_sprites() 2010-04-21 14:25:28 -06:00
Brian Paul
8cb223eb02 gallium/draw: fix point sprite handling
New draw API function to indicate whether or not to convert points to
quads for sprite rasterization.

Fix point-to-quad conversion regression in the wide-point stage.  We
need to check the pipe_rasterizer_state::point_quad_rasterization flag.
2010-04-21 14:25:28 -06:00
Brian Paul
d30ab4394e gallium/draw: use local var to simplify code 2010-04-21 14:25:28 -06:00
Brian Paul
15d60294d6 llvmpipe: consolidate texture memory allocation code
And fix incorrect allocation of linear memory for display targets.
This fixes fd.o bugs 27761 and 27762.
2010-04-21 10:30:57 -06:00
Brian Paul
867109f311 st/glx: variable 'i' is an enum
Now we can get see 'i' as an enum name instead of a plain integer in gdb.
2010-04-21 09:58:17 -06:00
Jakob Bornecrantz
f9f06f68fb targets: Don't check if we should use trace
Trace does its own checking, and it used the GALLIUM_TRACE variable
as well, but expected a file and not a bool argument.
2010-04-21 14:50:25 +01:00
José Fonseca
86d2383e77 mesa/st: Translate a few more mesa/gallium formats.
These endup used by Xvnc.
2010-04-21 11:19:39 +02:00
Vinson Lee
a85afb9177 llvmpipe: Remove unused variable. 2010-04-20 22:56:39 -07:00
Brian Paul
736a2f2f95 mesa: do version checking for GL 3.x queries 2010-04-20 21:17:35 -06:00
Brian Paul
a40e6f220a mesa: API and state for GL 3.1 primitive restart 2010-04-20 21:02:09 -06:00
Brian Paul
bd1d35fb5d mesa: add GL 3.2 GL_CONTEXT_PROFILE_MASK query 2010-04-20 20:52:56 -06:00
Brian Paul
d3e2f4fa18 mesa: remove some comments 2010-04-20 20:44:54 -06:00
Zhenyu Wang
82abbca692 intel: Add Sandybridge mobile chipset id
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-04-21 10:11:31 +08:00
Zhenyu Wang
cdcef6cbf4 intel: Clean up chipset name and gen num for Ironlake
Rename old IGDNG to Ironlake, and set 'gen' number for
Ironlake as 5, so tracking the features with generation num
instead of special is_ironlake flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-04-21 10:11:02 +08:00
Vinson Lee
9e258fc2bd gallivm: Remove unnecessary headers. 2010-04-20 18:48:04 -07:00
Vinson Lee
83353e3070 i965g: s/inttypes.h/stdint.h/
MSVC doesn't have either but Mesa has stdint.h at include/c99.
2010-04-20 17:22:26 -07:00
Jakob Bornecrantz
58590a112a svga: Fix index offset 2010-04-21 01:14:03 +01:00
Brian Paul
e648d4a1d1 st/mesa: ignore gl_texture_object::BaseLevel when allocating gallium textures
Previously, when we created a gallium texture for a corresponding Mesa
texture we'd only allocate space for mipmap levels >= BaseLevel.

This patch undoes that mechanism.  This fixes a render-to-texture bug
when rendering to level 0 when BaseLevel=1.

Also, it makes sense to allocate the whole texture object memory when
BaseLevel > 0 since a common use of GL_TEXTURE_BASE_LEVEL is to
progressively load/render mipmaps.  Eventually, the app almost always
fills in the level=0 mipmap image.

Finally, the texture image code is bit easier to understand now.
2010-04-30 12:33:40 -06:00
José Fonseca
e9bf09a98a draw: Fix memory leaks in llvm code. 2010-04-30 19:32:20 +01:00
Adam Jackson
124ef03223 x86-64: Make assembly routines .hidden like on x86 2010-04-30 14:09:57 -04:00
Vinson Lee
32f344f443 i965g: Remove unnecessary header. 2010-04-20 17:02:03 -07:00
Vinson Lee
a5460dc6d7 llvmpipe: Change return type of declaration to match code.
Commit 2142108e0e changed the return type
of llvmpipe_get_texture_image_address function but didn't change the
declaration.

Fixes build.
2010-04-20 16:40:55 -07:00
Brian Paul
2142108e0e llvmpipe: code consolidation 2010-04-20 17:28:33 -06:00
Brian Paul
1cb80d31d3 llvmpipe: remove debug code and simplify 2010-04-20 17:19:30 -06:00
Brian Paul
7688a4749e llvmpipe: fix cube face addressing bug
Fixes fd.o bug 27760 (pigit fbo-cubemap).
2010-04-20 17:15:33 -06:00
Brian Paul
c668a97ad5 llvmpipe: whitespace fix 2010-04-20 17:15:33 -06:00
Jakob Bornecrantz
71901594ed gallium: Fix copy typo 2010-04-20 23:59:38 +01:00
Jakob Bornecrantz
b88ba89397 svga: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
997969b067 radeong: Minor clean up of winsys
Also try to wrap trace around driver on non-debug builds, its free.
2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
1d98ce511d nouveau: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
c408942c9c i965g: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
1c68d1aa4c i915g: Minor clean up of winsys 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
fa2d84d2f7 st/egl: No need to use drm_api argument struct 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
71595a5f3f st/egl: Use correct driver_name field to get kernel driver name 2010-04-20 23:53:59 +01:00
Jakob Bornecrantz
8a0c99b379 st/egl: Check for null destroy callback on api struct 2010-04-20 23:53:58 +01:00
Brian Paul
395cec966b mesa: better, smaller error handling code for glGet*()
get.o is about 17% smaller.
2010-04-20 16:17:09 -06:00
Brian Paul
f4dcb5de4e mesa: better, smaller error handling code for glEnable/Disable/IsEnabled()
Use a goto instead of replicating the _mesa_error() call many times.
enable.o is about 15% smaller.
2010-04-20 16:17:09 -06:00
Brian Paul
f86d7af4a0 mesa: raise GL_INVALID_OPERATION for glReadPixels(GL_COLOR_INDEX)
We no longer support CI-mode color buffers so this is always an error.
2010-04-20 16:17:08 -06:00
Jakob Bornecrantz
ed94c26ce8 svga: Init surface functions 2010-04-20 23:16:20 +01:00
Jakob Bornecrantz
f86def5e74 util: Add missing break statement in u_caps.c
Thanks Vinson.
2010-04-30 14:46:18 +01:00
Jakob Bornecrantz
cebfd1a0cf targets: Use a valid winsys include path in Makefile.dri 2010-04-20 22:49:51 +01:00
Corbin Simpson
73c0f9f0f4 r300g: Spill a bit more info about implementation errors in surface_copy.
compiz appears to hit this. Weird.
2010-04-20 13:10:27 -07:00
Christoph Bumiller
3a5b82f335 nv50: make a working check for user memory vertex/index buffers 2010-04-20 22:08:10 +02:00
Christoph Bumiller
03e97e7f8d nv50: fix FP result counting for depth output 2010-04-20 22:08:04 +02:00
Christoph Bumiller
3c9df0bda6 nv50: support vertex index bias 2010-04-20 22:07:58 +02:00
Brian Paul
caa05ef419 llvmpipe: fix depth+stencil logic error
If both Z-test and stencil-test were enabled, we were mis-computing
the vector of updated Z buffer values.
Fixes Z testing bug in progs/demos/fbotexture.c
2010-04-20 13:51:52 -06:00
Brian Paul
48f54ecb0c llvmpipe: fix comment/typo 2010-04-20 13:51:52 -06:00
Eric Anholt
1407daf9bc i915: Map sampler indices to texture units correctly for fragment shaders.
Fixes hang with "gst-launch-0.10 videotestsrc ! video/x-raw-rgb !
glupload !  gleffects effect=heat ! glimagesink" which uses 2 samplers
pointing at GL_TEXTURE1 and GL_TEXTURE2, and piglit
glsl-fs-sampler-numbering.
2010-04-20 12:46:23 -07:00
Eric Anholt
ac3529eec4 i915: Add missing break; after handling the stub NOISE instructions.
Bug #27348
2010-04-20 12:46:23 -07:00
Brian Paul
db4ccc004a llvmpipe: fix incorrect front-facing value for fragment shader
The TGSI convention is +1 for front-facing, -1 for back-facing
Fixes glean glsl1 gl_FrontFacing tests.
2010-04-20 11:44:01 -06:00
Brian Paul
ab065b933b llvmpipe: rename mode -> interp 2010-04-20 11:23:53 -06:00
Brian Paul
3acb2b6b2f llvmpipe: remove dead code/comment 2010-04-20 10:56:01 -06:00
Brian Paul
117bf856d8 nv50: move declaration before code 2010-04-20 10:10:48 -06:00
Brian Paul
4d2804791a nv50: fixed void pointer arithment warning 2010-04-20 10:10:48 -06:00
Brian Paul
d022bddf24 gallium/util: remove bogus return statement
util_surfaces_do_detach() is a void-valued function.
2010-04-20 10:10:48 -06:00
Brian Paul
94c07b1320 progs/tests: asst. changes to antialias.c 2010-04-20 10:01:52 -06:00
Brian Paul
a2a01853f3 gallium: replace pipe_resource::_usage with pipe_resource::usage 2010-04-20 10:00:03 -06:00
Brian Paul
36c9557cae nv50: add missing idxbias param to nv50_push_elements_instanced() 2010-04-20 09:43:45 -06:00
Brian Paul
a00f4e864c llvmpipe: remove call to llvmpipe_set_texture_image_layout()
This would seem to be needed but caused some regressions.
More investigation will be done.
2010-04-20 08:42:32 -06:00
José Fonseca
cc822705e5 llvmpipe: Re-enable half float formats.
They should be working now, both textures and vertex/index/buffers.

This reverts commit efc69ca61c.
2010-04-20 16:27:42 +02:00
José Fonseca
ec8d9523d4 gallivm: Universal format support on lp_build_fetch_rgba_aos via util_format_description::fetch_rgba_float
This therefore adds support to half float vertex buffers.
2010-04-20 16:21:08 +02:00
José Fonseca
fe5a483328 gallivm: Cleanups and bugfixes to aos format translation. 2010-04-20 15:09:02 +02:00
José Fonseca
2cb0a20f67 draw: Fallback to gallivm for translation of A8R8G8B8/B8G8R8A8/R10G10B10X2/R10G10B10X2 and other formats.
These need swizzles, and bitshifts.
2010-04-20 14:02:05 +02:00
José Fonseca
e08d0cc165 gallivm: New function to fetch a pixel into a 4xfloat AoS vector. 2010-04-20 13:58:45 +02:00
José Fonseca
b29fcc7b3a gallivm: Bring aos format back to life.
Useful for fetching vertices for formats that are straight arrays.

This reverts commit aa364d091e.
2010-04-20 13:41:10 +02:00
José Fonseca
a55ead9d01 nvfx: Fix typo. 2010-04-20 13:26:59 +02:00
José Fonseca
373f03efe7 draw: Remove draw_vs_llvm.c.
To silence some warnings.

Super-seeded by Zack's new llvm middle end.
2010-04-20 13:26:59 +02:00
Alan Hourihane
17c560d1a4 llvmpipe: silence warning 2010-04-20 10:33:56 +01:00
José Fonseca
a6171a9dd9 Merge branch 'gallium-index-bias' 2010-04-20 11:07:08 +02:00
José Fonseca
3dcdca433a draw: No need to rebase for elt_bias.
As we are rebasing to min_index + elt_bias, and the vertex buffer has no
elt_bias.

I still don't know how to exercise this code. I hope this is now right.
2010-04-20 11:06:47 +02:00
José Fonseca
4e8154e866 draw: Fix cache elt_bias implementation. 2010-04-20 10:32:06 +02:00
José Fonseca
493a1bb822 gallium/docs: Make it clear that minIndex, maxIndex is exclusively a index buffer characteristic.
Unlike the indexBias which is specific to a draw call.

This are the semantics of both D3D and GL ARB_draw_elements_base_vertex
extension.
2010-04-20 10:22:28 +02:00
José Fonseca
f1d3f42c47 draw: Fix typo resulting from bad regular expression in index bias addition. 2010-04-20 10:19:42 +02:00
Vinson Lee
49ba607aba draw llvm: Move dereference of pointer after NULL check. 2010-04-20 00:00:52 -07:00
Vinson Lee
11913e9798 draw llvm: Remove unnecessary header. 2010-04-19 23:58:23 -07:00
Dan Nicholson
a69ef34640 egl: Fix demos to build with user specified Xlib
Commit 88be2171e7 fixed the egl demos on the stable branch, but now
they're spread out across multiple subdirectories.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19 20:25:17 -07:00
Dan Nicholson
02224ec4e0 Merge branch '7.8'
Conflicts:
	progs/egl/Makefile

progs/egl/Makefile is gone on master with the egl demos split into
subdirectories. Will require an additional commit.
2010-04-19 20:22:48 -07:00
Dan Nicholson
88be2171e7 egl: Pass flags to locate Xlib headers and libraries
eglplatform.h pulls in Xlib.h on X11 platforms. Likewise, the egl glx
driver and egl programs needs to link to libX11. Make sure we use the
locations the user told us about.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19 20:21:57 -07:00
Dan Nicholson
8e5effefc7 progs: Fix linking of Xlib demos for non-autoconf builds
The Xlib demos were fixed to use $(X11_LIBS) so that configure could
detect the proper directory to link the library from, but this broke
the non-autoconf builds. Give X11_LIBS a default value to fallback on.
(cherry picked from commit e40fce13e1)
2010-04-19 20:21:57 -07:00
Dan Nicholson
4e7a4bed37 Change libX11 variables to not conflict with AC_PATH_XTRA
The variable X_LIBS from AC_PATH_XTRA contains only the -L searchdir
parameter and not the -lX11 to link to Xlib. Use X11 prefixed build vars
for linking with Xlib to avoid the conflict.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit e725ef171b)
2010-04-19 20:21:57 -07:00
Dan Nicholson
4f8bf353bd gallium: Respect user's CFLAGS for including X headers
This can break on systems that don't have a system X installation.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit de4ee20578)

Conflicts:

	src/gallium/winsys/xlib/Makefile
2010-04-19 20:21:57 -07:00
Jeff Smith
3b693fd93f Use X_LIBS from pkg-config, instead of libdir, for locating libX11
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 8d86d395dc)
2010-04-19 20:21:57 -07:00
Brian Paul
35e60aed0b glapi: GL 3.x xml file
Some of the entrypoints defined in other .xml files will need to
be removed in favor of these...
2010-04-19 20:43:00 -06:00
Brian Paul
4c93cd13ba llvmpipe: remove dead code 2010-04-19 17:16:15 -06:00
Brian Paul
bd329d42e8 llvmpipe: use llvmpipe_resource_stride() 2010-04-19 17:15:25 -06:00
Brian Paul
079081222a gallivm: pass 3D texture stride as an array
This should have been included with the previous commit.
2010-04-19 17:14:57 -06:00
Brian Paul
f4071e55db llvmpipe: get 3D texture image stride from an array rather than computing it
This fixes broken 3D texture indexing when the height of the 3D texture
was less than 64 (the tile size).  It's simpler to pass this as an array
(as we do with the row stride) than to compute it on the fly.
2010-04-19 17:07:25 -06:00
Brian Paul
2cad62475b llvmpipe: consolidate some code in llvmpipe_set_texture_image_layout() 2010-04-19 17:07:25 -06:00
Brian Paul
202ff7db49 llvmpipe: fix rendering to 3D textures
Treat cube faces and 3D texture slices in the same manner (they're layed
out out continuously in memory).  Additional clean-ups and improvements
coming.
2010-04-19 17:07:25 -06:00
Brian Paul
ee7cf9d80f llvmpipe: checkpoint: fixes for render to 3D texture 2010-04-19 17:07:25 -06:00
Brian Paul
254dd0c23f llvmpipe: another fix for surface memory allocation
The previous patch broke cube maps.
The logic is a bit clearer now.
2010-04-19 17:07:25 -06:00
Marek Olšák
f189caeed0 r300g: add is_rv350 flag 2010-04-20 00:50:39 +02:00
Eric Anholt
7d21104a8b Remove dead code assignments and variable declarations.
This pass only works on assignments where the variable is never
referenced.  There is no code flow analysis, so it can't do a better
job of avoiding redundant assignments.

For now, the optimizer only does do_dead_code_unlinked(), so it won't
trim the builtin variable list or initializers outside of the scope of
functions.  This is because we don't have the visibility into other
functions that might get linked in in order to eliminate work on
global variables.
2010-04-19 15:33:52 -07:00
Jesse Barnes
35489ef285 Merge branch '7.8' 2010-04-19 14:20:58 -07:00
Jesse Barnes
0a18cdb0ed DRI2: check for swapAvailable before using swap interval protocol
This should have been part of the last change...
2010-04-19 14:20:21 -07:00
Jakob Bornecrantz
35d960cc74 svga: More don't recurse 2010-04-19 21:42:49 +01:00
Jakob Bornecrantz
aa857509bd svga: Translate svga reloc flags to pb flags 2010-04-19 21:42:49 +01:00
Jakob Bornecrantz
2a5667a008 svga: Don't recurse 2010-04-19 21:42:49 +01:00
Brian Paul
0e4f0e8725 draw: remove extra semicolons 2010-04-28 15:27:08 -06:00
Brian Paul
aac6d84056 llvmpipe: free vertex buffer memory in lp_setup_vbuf_destroy() 2010-04-28 15:25:50 -06:00
Brian Paul
bdf753a858 llvmpipe: fix scene queue memory leak 2010-04-28 15:25:50 -06:00
Brian Paul
0728db86bc llvmpipe: fix scene queue memory leak 2010-04-28 15:25:50 -06:00
Brian Paul
7dd44ca5f6 llvmpipe: fix mem leak in llvmpipe_resource_destroy() 2010-04-28 15:25:50 -06:00
Brian Paul
5f53ecb97f llvmpipe: fix surface memory leak during tear-down 2010-04-28 15:25:50 -06:00
Brian Paul
1550de98e6 llvmpipe: remove unused psize_slot field 2010-04-28 15:25:50 -06:00
Brian Paul
3a749b5c09 llvmpipe: move/rename llvmpipe_init_surface_functions() 2010-04-28 15:25:50 -06:00
Brian Paul
8975ade13b llvmpipe: make rasterizer-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
965a604306 llvmpipe: update comments, fix formatting 2010-04-28 15:25:50 -06:00
Brian Paul
dd2fd8ae03 llvmpipe: remove old prototypes, fix-up formatting 2010-04-28 15:25:50 -06:00
Brian Paul
9523d78dde llvmpipe: make shader-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
2176cad7dc llvmpipe: make clip-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
f7885f8f1f llvmpipe: make draw-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
e351e82869 llvmpipe: make vertex-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
8fd794db9e llvmpipe: make blend-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
bfd81b4ebb llvmpipe: make sampler-related functions static, clean-up initializations 2010-04-28 15:25:50 -06:00
Brian Paul
a7e2470843 llvmpipe: remove some unneeded shader structure fields 2010-04-28 15:25:50 -06:00
Brian Paul
ac6725b8f9 llvmpipe: dump shaders if LP_DEBUG=tgsi 2010-04-28 15:25:50 -06:00
Brian Paul
18d1d59484 draw: use a cast wrapper 2010-04-28 15:25:50 -06:00
Brian Paul
35883f4296 draw: put 'create' in the vs varient create function names 2010-04-28 15:25:50 -06:00
Joakim Sindholt
2c512085ab radeong: fix scons build 2010-04-28 21:09:30 +02:00
Brian Paul
dd3b98bdf6 draw: add missing function parameter 2010-04-28 11:43:54 -06:00
Brian Paul
2479c3f3ee softpipe: consolidate tex image offset code 2010-04-28 11:37:51 -06:00
Brian Paul
b73c9ba919 llvmpipe: remove unused write_depth 2010-04-28 11:26:37 -06:00
Brian Paul
ce0844b44c st/mesa: move/improve Mesa GPU program debugging
Print the program (plus its parameters) before calling
st_translate_mesa_program() in case we die in that function.
2010-04-28 10:24:58 -06:00
Brian Paul
e0383d7bb6 st/mesa: add missing debug entry for DEBUG_CONSTANTS 2010-04-28 10:23:47 -06:00
Brian Paul
c7f5c9a3dc Merge branch '7.8'
Conflicts:

	src/mesa/state_tracker/st_gen_mipmap.c
2010-04-28 10:10:51 -06:00
Brian Paul
40dcbb87a9 softpipe: use consistant names for local vars 2010-04-28 10:07:23 -06:00
Brian Paul
331c01ea4d progs/demos: added code to test compressed mipmap generation (disabled) 2010-04-28 10:07:23 -06:00
Brian Paul
347f783606 gallium: remove trailing comma 2010-04-28 10:07:23 -06:00
Brian Paul
608cf0c9f7 gallium/util: convert //-style comments 2010-04-28 10:07:23 -06:00
Brian Paul
443fe5e57c gallium/util: convert //-style comments 2010-04-28 10:07:23 -06:00
Brian Paul
7b640f9f70 st/mesa: fix incorrect RowStride computation
Fixes incorrect stride when getting a compressed tex image.
2010-04-28 10:06:08 -06:00
Brian Paul
56f99ee640 st/mesa: fill in stImage->level in st_generate_mipmap()
Before, this field was always zero for all the new mipmap levels.
Fixes problems with glGetTexImage() from a generated mipmap.
2010-04-28 10:05:06 -06:00
Jakob Bornecrantz
6fc532ae05 Merge branch '7.8' 2010-04-28 16:27:51 +01:00
Jakob Bornecrantz
ef9a8fcb1b glx: Fix build 2010-04-28 16:25:28 +01:00
Jakob Bornecrantz
e42d84eaba glx: Fix build 2010-04-28 16:19:41 +01:00
Jakob Bornecrantz
fe0fe67aaf configure.ac: Print some llvm info 2010-04-28 16:06:17 +01:00
Micah Fedke
9cfaaa291f egl: dri2 driver error output
This patch amends the error output string for the case where the
dri2 egl driver could not open the dri dev node.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-28 07:26:01 -06:00
Brian Paul
1fa7789e82 Merge branch '7.8'
Conflicts:

	src/glx/dri2_glx.c
	src/glx/glx_pbuffer.c
2010-04-28 07:21:25 -06:00
Vinson Lee
37e98e5cd2 llvmpipe: Remove unnecessary header. 2010-04-28 00:14:39 -07:00
Pierre Willenbrock
2787a2e731 Disable scissor when begining meta operations
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrock
6ef6cdec2e Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targets
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrock
da498ef41e Fill the padding between entrys in the sampler key
This struct is used to generate a hash, ignoring the entry boundaries.

Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrock
d20fce057e Initialize have_back.
There is a user somewhere that tests it before its initial set.

Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Eric Anholt
edad36cff9 i915: Add debugging for just prorgam compile under INTEL_DEBUG=wm 2010-04-27 17:12:38 -07:00
Eric Anholt
891ad6ec1a i915: Provide counts in the error messages for program limits. 2010-04-27 17:12:38 -07:00
Brian Paul
eecd2a59c1 osmesa: update SRC_DIRS to fix build 2010-04-27 17:06:17 -06:00
Brian Paul
29fc97606b osdemos: replace assertion with error handler 2010-04-27 17:05:56 -06:00
Marek Olšák
20c9675994 r300g: move ZTOP to separate file
Ideally, HiZ should go in r300_hyperz.c next to ZTOP.
2010-04-28 01:05:42 +02:00
Brian Paul
c5bf13c537 osmesa: don't need to link with -lGL
The gl entrypoints are in libOSMesa.so
2010-04-27 16:57:43 -06:00
Marek Olšák
7440fd89b4 radeon: fix warnings 2010-04-28 00:38:27 +02:00
Pierre Willenbrock
c0b41116f1 mesa: Disable scissor when begining meta operations
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:58:58 -06:00
Ian Romanick
aa6489bce9 Add missing _ in extension category name 2010-04-27 14:54:32 -07:00
Pierre Willenbrock
717e86738f mesa: Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targets
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:54:24 -06:00
Pierre Willenbrok
cc806f70b2 glx: Initialize have_back.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:53:28 -06:00
José Fonseca
a5e032853a gallium: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes.
Arcane DX9 opcodes that never were emitted by Mesa and have no DX10
counterpart. Slated for removal for quite some time now.
2010-04-27 21:51:45 +01:00
José Fonseca
84b5f59c97 gallium/docs: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:45 +01:00
José Fonseca
73e1405de0 tgsi: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:45 +01:00
José Fonseca
ec4e67999c r300: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
José Fonseca
42c9137042 cell: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
José Fonseca
e5395f3359 svga: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
José Fonseca
b3ba54a01a gallivm: Drop BGNFOR, ENDFOR, REP, and ENDREP opcodes. 2010-04-27 21:51:44 +01:00
Jeremy Huddleston
a1cb3babbe Buildfixes to work around issues in OpenGL.framework
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 12:37:16 -07:00
Jeremy Huddleston
f64773010d Update OpenGL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
f5aa5377a5 apple: Use mesa gl.h rather than generating one.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
de96d063b1 apple: Integrate our libGL into the existing build system better
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
163901bc7f darwin: Use clientattrib
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
80b280db88 apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
77dc40b289 apple: Remove duplicate headers that already exist in mesa.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-27 11:26:50 -07:00
Jeremy Huddleston
ad503c4155 apple: Initial import of libGL for OSX from AppleSGLX svn repository.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:50 -07:00
Brian Paul
ab3e7861ec llvmpipe: remove lp_scene_map_buffers(), lp_scene_unmap_buffers() 2010-04-27 11:50:23 -06:00
Brian Paul
bb527c0af6 llvmpipe: implement max scene size
When the size of the scene (binned data plus referenced resources/textures)
exceeds LP_MAX_SCENE_SIZE flush/render the scene.  This could be improved
in various ways but is a good start.

Fixes piglit streaming-texture-leak test.
2010-04-27 11:44:36 -06:00
Brian Paul
1db3a55b9c llvmpipe: added llvmpipe_resource_size() 2010-04-27 11:32:25 -06:00
Brian Paul
85ab6d2447 llvmpipe: comment-out unused field for now 2010-04-27 11:31:45 -06:00
Brian Paul
d2f0acc2fb llvmipe: update comments 2010-04-27 10:55:51 -06:00
Brian Paul
e485af774e mesa: move/rename is_depth_or_stencil_format()
Put it with other, similar functions.
2010-04-27 09:31:22 -06:00
Brian Paul
f62c738c62 st/mesa: rename var and update st_choose_format() comments 2010-04-27 09:27:00 -06:00
Chia-I Wu
f1381880a8 glapi: Fix loading of old DRI drivers.
The removal of _glapi_noop_enable_warnings and _glapi_set_warning_func
in e4f168a6f4 prevents DRI drivers built
before the commit from loading.  Add stub versions of the functions to
make them load again.
2010-04-27 23:19:27 +08:00
Brian Paul
a965ef59b5 st/mesa: call is_format_supported() for compressed formats
These compressed format switch cases shouldn't be hit if we don't
support the compressed texture extensions, but let's be safe and
ask the driver if they're supported as we do in other cases.
2010-04-27 09:19:02 -06:00
Brian Paul
85d3687ee7 st/mesa: 80-column wrapping 2010-04-27 09:14:32 -06:00
Brian Paul
29edc2a8b5 st/mesa: try to get actual compressed format for GL_COMPRESSED_RGB[A] formats 2010-04-27 09:11:53 -06:00
Brian Paul
7567f05199 Merge branch '7.8'
Conflicts:

	src/gallium/drivers/nv30/nv30_context.c
	src/gallium/drivers/nv40/nv40_context.c
	src/gallium/drivers/nv40/nv40_state_emit.c
2010-04-27 08:34:06 -06:00
Brian Paul
db14a8022a st/mesa: fix strides in (de)compress_image() functions
Mipmap generation for compressed textures works now.
2010-04-27 08:28:55 -06:00
Brian Paul
15c53d1245 util: fix assorted problems in the image packing functions 2010-04-27 08:28:22 -06:00
Pedro Maia
ea373df069 nv30/40g: fix calls to draw_create(), draw_set_rasterizer_state()
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 08:22:11 -06:00
José Fonseca
992fc62d59 gallivm: Disable llvm.cos.v4f32 and llvm.sin.v4f32 instrinsics on Windows.
Runtime linking doesn't quite work.

Just comment then out for now to prevent crashes. These will go away in
the future because calling 4 times CRT's cosf()/sinf() is over-precise
and under-performing.
2010-04-27 14:27:24 +01:00
José Fonseca
a18c210a95 gallivm: Ensure all allocas are in the first block.
Refactor the code to make this easier.
2010-04-27 13:20:51 +01:00
Jakob Bornecrantz
96df6064b5 i965g: Fix scons build of winsys 2010-04-27 12:17:11 +01:00
Jakob Bornecrantz
8fbd66d75a st/dri: Don't check for null when user ensures non-null 2010-04-27 12:17:11 +01:00
Jakob Bornecrantz
64fa717b18 dri_util: Assume error checking is done properly in glXMakeCurrent
In short what the code did before:

    __DRIscreen *psp = NULL;
    if (pcp)
       psp = pcp->psb;

    assert(psp);
    if (psp->stuff)
       other_stuff();

    return psb->even_more(pcp);

Remove all that stupid checking which still segfaults/asserts later on and
just do what we do in driUnbindContext. Also limited testing show libGL never
call driUnbindContext or driBindContext with cPriv == NULL.
2010-04-27 12:17:11 +01:00
Jakob Bornecrantz
ae79e778f7 st/dri: Use flush function of old context not new 2010-04-27 12:17:11 +01:00
Marek Olšák
b7fa7e8da6 r300g: fix mipmapped texture3D size calculation
I accidentally inverted the condition. :(
Broken since the commit 2579fe4044.
FDO bug #27851.
2010-04-27 12:25:23 +02:00
Marek Olšák
847a24c011 r300g: compensate for non-atomized emit_query_end in the CS
And reserve a little more space just in case.
2010-04-27 12:25:22 +02:00
Vinson Lee
35d52a0626 progs/tests: Remove meaningless const qualifier in arraytexture.c. 2010-04-27 01:22:26 -07:00
Vinson Lee
a7b6a06bf1 nvfx: Move src/gallium/drivers to beginning of SCons include path.
libdrm-2.4.20 and earlier include the nouveau/nouveau_class.h header. A
later version of libdrm will not ship this header. Mesa also has this
header at src/gallium/drivers.

The symbol NV34TCL_VTXFMT_TYPE_HALF is needed by nvfx_vbo.c. This symbol
is not in the libdrm copy of the header but is in the Mesa copy of the
header. This patch moves src/gallium/drivers to the beginning of the
include paths such that when building on hosts with libdrm-2.4.20 or
ealier the build uses the copy in Mesa.
2010-04-27 00:46:00 -07:00
Chia-I Wu
fbfecda6ae progs/egl: Add egl/eglut to PROGRAM_DIRS.
Make sure eglut is built before the demos.  This should work more
reliably with make -j<N>.
2010-04-27 14:19:24 +08:00
Brian Paul
0fcea8a411 docs: update some GL3 status 2010-04-26 20:35:55 -06:00
Brian Paul
84407d7365 mesa: start adding GL 3.1 signed normalized texture formats 2010-04-26 20:35:19 -06:00
Brian Paul
b0e2c5f8aa docs: document updated glext.h and glxext.h files 2010-04-26 20:32:24 -06:00
Brian Paul
4eb803975d glxext.h: upgraded to 2010/02/10 version 2010-04-26 20:32:02 -06:00
Brian Paul
273058b677 glext: upgraded to version 61 2010-04-26 20:31:19 -06:00
Marek Olšák
b1ceadf2ee r300g: reserve CS space for index offset
This has caused CS overflow since the commit
671f1e1229.

TA3D works here again.
2010-04-27 02:45:51 +02:00
Vinson Lee
03b3c10774 llvmpipe: Remove unused variable. 2010-04-26 16:31:05 -07:00
Marek Olšák
307f28cf1e r300g: add support for more unaligned vertex formats
An aligned stride is still needed for it to work.

I am slowly approaching the Sauerbraten milestone!
2010-04-27 00:14:58 +02:00
Marek Olšák
a961431285 r300g: setup PSC first, then align vertex formats
This allows us to put correct swizzles for undefined components in PSC.
2010-04-27 00:06:07 +02:00
Marek Olšák
83b76657b3 r300g: set undefined vertex swizzles to (0,0,0,1) respectively 2010-04-27 00:01:03 +02:00
Zack Rusin
52f145a186 draw/llvm: implement fetch elts paths
we were only running the llvm paths when the input elts were linear,
now we can handle abritrary fetch elts arrays. we do this by generating
two paths - linear and fetch_elts one and just selecting the right one
at run time.
2010-04-26 15:34:16 -04:00
Alex Deucher
3a9717f7c2 r600: add support for more rendering formats 2010-04-26 15:02:13 -04:00
Marek Olšák
3e0f1719d4 r300g: disable point sprites (again)
They cause lockups. The users doesn't seem to like them.
2010-04-26 20:53:17 +02:00
Marek Olšák
304b9e2ccc r300g: fix warnings when printing uint64_t
Though not nice, this is the correct way.
2010-04-26 20:32:38 +02:00
Marek Olšák
7d164fc359 r300g: fix warnings by using the const qualifier
See also the libdrm commit af98ccf4dd5dcb1b904ec32b9bd1521e6bf7dda5.
2010-04-26 20:31:17 +02:00
Matt Turner
30c9bca502 r300g: use CS_OUT_TABLE better
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-04-26 20:30:37 +02:00
Alex Deucher
a53e8b7def r600: avoid setting invalid bit on r7xx for blits 2010-04-26 13:45:01 -04:00
Brian Paul
b695cbd57c docs: add links to old mailing list archives 2010-04-23 15:36:40 -06:00
Eric Anholt
71df19f5ef Mark some variables as having usage beyond the shader's scope.
This will be important to optimization passes.  We don't want to
dead-code eliminate writes to out varyings, or propagate uninitialized
values of uniforms.
2010-04-19 11:13:20 -07:00
Zack Rusin
7dfde3aadc draw llvm: make sure use_llvm isn't used when not defined 2010-04-19 13:33:49 -04:00
Zack Rusin
e3e5faba89 draw llvm: fix typo (boolean, not bool) 2010-04-19 13:30:36 -04:00
Brian Paul
05bf77a2da llvmpipe: fix surface memory allocation bug
We weren't always allocating the right amount of memory for image tiles
for some formats (those < 32bpp).

Fixes fd.o bug 27712.
2010-04-19 11:18:51 -06:00
Jesse Barnes
64644ec3b2 Merge branch '7.8' 2010-04-19 09:56:49 -07:00
Jesse Barnes
385e2896eb DRI2: synchronize swap interval with server at startup time
In the direct rendered case, we need to tell the server our initial swap
interval.  If we don't, the local and server values will be out of sync,
since the server and client defaults may be different (as they were
before this patch).
2010-04-19 09:56:32 -07:00
Zack Rusin
4df3e76949 draw llvm: allow runtime switching of pipelines (yes/no to llvm)
use DRAW_USE_LLVM to disable or enable (default) llvm
2010-04-19 12:53:27 -04:00
Zack Rusin
7c4208c3a0 draw llvm: fix constructor mess
use just one constructor to figure out whether to use llvm.
2010-04-19 12:53:27 -04:00
Zack Rusin
deee152363 llvmpipe: enable draw llvm by default 2010-04-19 12:53:27 -04:00
Brian Paul
653c681ce8 gallium/util: specify binding type for blit src texture
Fixes fd.o bug 27711.
2010-04-19 10:32:25 -06:00
Brian Paul
96b0807253 mesa: unmap the immediate mode VB before destroying it
Fixes failed assertion from fd.o bug 27713.

The assertion was added with the new resource/transfer changes.
This patch could apply to the 7.8 branch but it's not essential.
2010-04-19 10:27:57 -06:00
José Fonseca
dfadf5a579 r300g: Adapt for index bias interface change. 2010-04-19 18:18:45 +02:00
José Fonseca
7c785c0d2c nvfx: Adapt for index bias interface change. 2010-04-19 18:18:28 +02:00
José Fonseca
f6f7324bbf nv50: Adapt for index bias interface change. 2010-04-19 18:17:45 +02:00
José Fonseca
583f51ba4b retrace: Support index bias. 2010-04-19 18:17:11 +02:00
José Fonseca
17a43c1718 mesa/st: Update for index bias interface change. 2010-04-19 18:16:57 +02:00
José Fonseca
5620216c98 st/python: Use index bias. 2010-04-19 18:16:34 +02:00
José Fonseca
8b658580ee trace: Implement index bias. 2010-04-19 18:16:20 +02:00
José Fonseca
9515b78859 svga: Implement index bias.
Untested.
2010-04-19 18:16:08 +02:00
José Fonseca
989861fc5e softpipe: Implement index bias. 2010-04-19 18:15:39 +02:00
José Fonseca
d27a53d469 llvmpipe: Implement index bias. 2010-04-19 18:15:11 +02:00
José Fonseca
382e9cc07b identity: Implement index bias. 2010-04-19 18:15:05 +02:00
José Fonseca
9ca0f45d8a i965g: Implement index bias. 2010-04-19 18:14:58 +02:00
José Fonseca
1e7facdd8f i915: Implement index bias. 2010-04-19 18:14:48 +02:00
José Fonseca
f8d4638a09 failover: Implement index bias. 2010-04-19 18:14:35 +02:00
José Fonseca
150d12679d cell: Implement index bias. 2010-04-19 18:14:23 +02:00
José Fonseca
2197fac47c draw: Implement index bias. 2010-04-19 18:14:04 +02:00
Brian Paul
c060265bdb st/mesa: invert scissor rect depending on FB orientation
Fixes fd.o bug 27715
2010-04-19 10:10:47 -06:00
Matthieu Herrb
cf7d08b443 mesa: Fix build with gcc 3.3.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:53 -06:00
Matthieu Herrb
f4553d99c6 radeon: Let this build with gcc 3.3
Declaring the loop index inside for () is not supported by this version.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:53 -06:00
Owain Ainsworth
c39ab02ae9 radeon: Fix command type for DRM_RADEON_IRQ_EMIT ioctl.
This should be drmCommandWriteRead to avoid an EINVAL error on systems
that strictly check ioctl args. This command has been r/w for ever.
Discussion with airlied agreed that this was the correct course.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:50 -06:00
Matthieu Herrb
7f1ae3a94d mesa: Use __OpenBSD__ to check for OpenBSD.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:42 -06:00
Brian Paul
a59771fb53 llvmpipe: triangle function comments 2010-04-19 08:53:13 -06:00
Brian Paul
62c9587385 gallium/draw: use a local var to simplify some code 2010-04-19 08:53:13 -06:00
Brian Paul
44519e18a4 softpipe: add option to do polygon stipple in softpipe vs. draw module
For debugging purposes.
2010-04-19 08:51:07 -06:00
Brian Paul
8f3bdeaad6 Merge branch '7.8'
Conflicts:

	src/gallium/auxiliary/draw/draw_context.c
	src/gallium/auxiliary/draw/draw_pipe_aaline.c
	src/gallium/drivers/llvmpipe/lp_context.c
2010-04-19 08:45:20 -06:00
Brian Paul
e3a34cc7f6 gallium/draw: use correct rasterization state for wide/AA points/lines
When points or lines are decomposed into triangles, we need to be sure
to disable polygon culling, stippling, "un-filled" modes, etc.

This patch sets the rasterization state to disable those things prior to
drawing points/lines with triangles, then restores the previous state
afterward.

The new piglit point-no-line-cull test checks this problem & solution.
2010-04-19 08:35:53 -06:00
José Fonseca
857c7c7ca2 docs: Document indexBias. 2010-04-19 15:08:14 +02:00
Dave Airlie
f7c2d4fee3 r300c/r300g: add 3155 rv380 pci id 2010-04-19 19:23:19 +10:00
Vinson Lee
7f8676c0b0 gallivm: Remove redundant initialization of dst_vec_type.
dec_vec_type is already initialized to lp_build_vec_type(dst_type) at
its declaration.
2010-04-19 00:35:02 -07:00
Vinson Lee
57e71b8502 nv50: Fix include recursion.
Don't include nv50_context.h and use a forward declaration instead.
nv50_context.h includes nv50_screen.h (itself).
2010-04-19 00:05:57 -07:00
José Fonseca
c184da9505 gallium: Add index bias parameter to draw_elements and friends.
indexBias corresponds to:
- BaseVertexIndex parameter of D3D9's
  IDirect3DDevice9::DrawIndexedPrimitive method
- BaseVertexLocation parameter of ID3D10Device::DrawIndexed

Although a positive indexBias can be easily be implemented in Gallium by
adding indexBias*stride to each vertex buffer base offset, a negative
indexBias cannot, as the final vertex buffer offset could be negative.

I'm not aware of this functionality being exposed to GL drivers, so for
now all hardware drivers will just assert(indexBias == 0).

See also:
- http://msdn.microsoft.com/en-us/library/bb174369.aspx (D3D9)
- http://msdn.microsoft.com/en-us/library/ff556126.aspx (D3D10 DDI)
2010-04-19 08:56:46 +02:00
Vinson Lee
11cea8196c nvfx: Fix include recursion.
Don't include nvfx_context.h and use a forward reference instead.
nvfx_context.h includes nvfx_screen.h (itself).
2010-04-18 23:44:24 -07:00
Vinson Lee
478f19ff49 auxiliary: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-04-18 23:21:07 -07:00
Vinson Lee
c628a2e0c7 nvfx: Add missing header and forward declaration. 2010-04-18 23:09:31 -07:00
Vinson Lee
b2fc623497 nouveau: Add missing header. 2010-04-18 23:00:45 -07:00
Vinson Lee
5b83e0ea04 r300g: Remove unnecessary headers. 2010-04-18 22:51:35 -07:00
Vinson Lee
c61db7d200 i915g: Remove unnecessary header. 2010-04-18 22:49:55 -07:00
Vinson Lee
aa5be94139 auxiliary: Initialize variable. 2010-04-18 22:45:18 -07:00
Vinson Lee
349c168a6e auxiliary: Add util/u_surfaces.c to SCons build.
This was missed in commit ac4b8db62d.
2010-04-18 22:38:53 -07:00
Brian Paul
1aaf41fd8a st/mesa: s/st_get_stobj_texture/st_get_stobj_resource/ 2010-04-18 18:02:42 -06:00
Brian Paul
c3016dcee5 st/mesa: s/st_get_texobj_texture/st_get_texobj_resource/ 2010-04-18 18:02:42 -06:00
Brian Paul
5d3d63d45a st/mesa: remove st_texture_object::pipe field
Just pass the pipe context to st_get_texture_sampler_view()
as is done for st_get_renderbuffer_sampler_view().
2010-04-18 18:02:42 -06:00
Brian Paul
073048c872 st/mesa: s/st_renderbuffer_get_sampler_view/st_get_renderbuffer_sampler_view/ 2010-04-18 18:02:42 -06:00
Brian Paul
ef9a619ba9 st/mesa: s/st_sampler_view_from_texture/st_create_texture_sampler_view/ 2010-04-18 18:02:42 -06:00
Brian Paul
8a7ea577ac st/mesa: s/st_get_stobj_sampler_view/st_get_texture_sampler_view/ 2010-04-18 18:02:42 -06:00
Marek Olšák
ec719ae199 r300g: implement TRUNC as floor 2010-04-19 00:36:20 +02:00
Marek Olšák
394803b2cd r300/compiler: lower CEIL 2010-04-19 00:36:20 +02:00
Marek Olšák
e53a1576dd r300/compiler: enable branch emulation for vertex shaders 2010-04-19 00:36:19 +02:00
Marek Olšák
ebd05a798e r300/compiler: optimize CMP for vertex shaders a bit 2010-04-19 00:35:26 +02:00
Nicolai Hähnle
65fd6fb204 r300/compiler: Use memory_pool_array_reserve in deadcode elimination
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-04-19 00:34:02 +02:00
Nicolai Hähnle
0321f9c6f1 r300/compiler: Use memory_pool_array_reserve in r500-fragprog_emit
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-04-19 00:34:02 +02:00
Marek Olšák
340e5e65dc r300/compiler: enable branch emulation for R500 fragment programs 2010-04-19 00:34:02 +02:00
Nicolai Hähnle
4d7ed84431 r300/compiler: Implement branch emulation for R300 fragment programs
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2010-04-19 00:34:02 +02:00
Luca Barbieri
eeabe9d179 u_inlines: split pipe_surface_init in pipe_surface_reset and *_init 2010-04-18 22:58:09 +02:00
Brian Paul
0490116f96 tgsi: add comment about potential code removal 2010-04-18 10:02:11 -06:00
Brian Paul
8fd0e453d7 softpipe: new comment and assertion for face value 2010-04-18 10:02:11 -06:00
Brian Paul
1673bb38bb tgsi: replace 0xf with TGSI_WRITEMASK_XYZW 2010-04-18 10:02:11 -06:00
Brian Paul
10e4ec448e softpipe: fix computation of fragment[FACE] attribute
In TGSI, front facing is +1 and back-facing is -1.  We were computing
this attribute as +1 and 0 before.  However, the value isn't actually
used anywhere because we machine->Face attribute overrides it in
tgsi_exec.c.  That could be changed, removing some special-case code...
2010-04-18 10:02:11 -06:00
Brian Paul
6756c07b66 softpipe: clean-up and comments 2010-04-18 10:02:11 -06:00
Brian Paul
b806c3056f softpipe: document MAX_QUADS 2010-04-18 10:02:11 -06:00
Marek Olšák
24ceef7a69 r300g: more solid is_buffer_referenced implementation
This fixes crash from 7a1b5c937f,
and also removes the unused "map" pointer.
2010-04-18 17:49:12 +02:00
Luca Barbieri
cea7b9f937 u_surfaces: silence warning 2010-04-18 17:35:17 +02:00
Marek Olšák
69d8b6d5fb Revert "r300g: save vertex buffers around u_blitter calls"
Not sure why it crashes.
2010-04-18 17:02:39 +02:00
Brian Paul
5acee66023 nvfx: move declarations before code 2010-04-18 08:43:42 -06:00
Brian Paul
27322eeb73 nvfx: fix void * arithmetic warning 2010-04-18 08:41:51 -06:00
Brian Paul
b74f4bc6b8 nvfx: move declarations before code 2010-04-18 08:41:25 -06:00
Brian Paul
d84b8cb1a8 llvmpipe: update comment 2010-04-18 08:38:19 -06:00
Brian Paul
d7c336dc49 nvfx: move declarations before code to silence warnings 2010-04-18 08:38:03 -06:00
Luca Barbieri
f9ea7a2ea9 auxiliary: add util_dirty_surfaces to track dirty render temporaries 2010-04-18 16:23:11 +02:00
Luca Barbieri
ac4b8db62d auxiliary: add util_surfaces to track a resource's pipe_surface structs 2010-04-18 16:23:11 +02:00
Luca Barbieri
24af25df2b u_inlines: add function to initialize pipe_surface 2010-04-18 16:23:11 +02:00
Luca Barbieri
2ac088141a nvfx: fix fragment program constant updates 2010-04-18 16:23:11 +02:00
Marek Olšák
7a1b5c937f r300g: do not tell st that a buffer is referenced by hw
It saves a few libdrm calls and unnecessary flushes.
2010-04-18 16:09:21 +02:00
Luca Barbieri
bc8fa67926 r300g: save vertex buffers around u_blitter calls
Not strictly needed by the Mesa state tracker, but needed in general.

Only compile tested.
2010-04-18 15:29:23 +02:00
Luca Barbieri
64aa67a360 u_blitter: add support for saving vertex buffers
Currently r300g does not save vertex buffer on blitter calls.

It gets away with it because the current Mesa state tracker usually
resets vertex buffers on every draw calls.

However, this is wrong.

nvfx won't be lucky because it needs to use the blitter inside draw
calls.
2010-04-18 15:29:23 +02:00
Luca Barbieri
5df6c43061 p_compiler: add likely/unlikely macros
Defined like the Linux kernel.

A explanatory comment is included.
2010-04-18 15:29:21 +02:00
Dave Airlie
851edfe3c9 r300g: fixup 0 stride buffer properly.
Just set the max index to 1, this lets doom3 run and seems correct,
though it would be better to just emit a constant like SVGA does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-18 18:51:10 +10:00
José Fonseca
4b148bcf5e llvmpipe: Emit only the vertex attributes necessary for the FS, and ensure the first one is always position.
With this we correctly handle vertex shaders whose output position is not
in index zero.
2010-04-18 10:36:28 +02:00
José Fonseca
4272c01fbf softpipe: Preserve/check the signal of the number of scanlines in an edge.
It can become negative in some weird triangles.
2010-04-18 10:36:28 +02:00
José Fonseca
b609cfc7c9 draw: Cosmetic cleanups and comments. 2010-04-18 10:36:28 +02:00
José Fonseca
d036e9312f retrace: Fix vertex/index/constant buffer dumping. 2010-04-18 10:36:28 +02:00
José Fonseca
53c3c914a7 trace: Handle transfers with zero strides correctly. 2010-04-18 10:36:28 +02:00
José Fonseca
4b95c9549d st/python: Set the bind flag for the default texture. 2010-04-18 10:36:28 +02:00
José Fonseca
5c898af870 retrace: Remove deprecated code. 2010-04-18 10:36:28 +02:00
José Fonseca
6aae062bdf mesa: Restore comment too. 2010-04-18 10:36:28 +02:00
Vinson Lee
4e98116c23 glsl: Fix handling of OPCODE_PRINT for no registers case.
A register file value is unsigned so could never be -1. A
value of 0 also aliased to PROGRAM_TEMPORARY.

If an OPCODE_PRINT has no registers to print, set the register
file value to PROGRAM_UNDEFINED and check for that value when
executing this instruction.
2010-04-18 00:11:49 -07:00
Vinson Lee
4485dd8a3e i965: Assert that an OPCODE_IF was seen before an OPCODE_ELSE. 2010-04-17 23:48:37 -07:00
Vinson Lee
010f81f32b st/dri: Check for NULL before dereference and assignment. 2010-04-17 23:40:14 -07:00
Vinson Lee
63c6d6add1 nvfx: Initialize variables. 2010-04-17 23:25:47 -07:00
Vinson Lee
0268e8984c r300g: Cast rbuf->user_buffer to 'uint8_t *' before arithmetic.
Fixes this SCons build error.
"pointer of type 'void *' uses in arithmetic"
2010-04-17 22:44:35 -07:00
Vinson Lee
fe52b585f2 nvfx: Remove unused variables. 2010-04-17 22:23:25 -07:00
Vinson Lee
891e9d6f3f nv50: Initialize variables.
Silences GCC uninitialized variable warnings.
2010-04-17 21:21:31 -07:00
Vinson Lee
b054d7912d nv50: Remove unused variable. 2010-04-17 20:39:03 -07:00
Jakob Bornecrantz
5db285b742 i915g: Remove broken power of two function 2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
d14c4ca209 i915g: Add some helper functions
Mostly to make the lines not so long.
2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
ed94e744d3 i915g: Fix cubemap layouts 2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
762ed4db47 i915g: Clean and add some debug printing
Disabled by default
2010-04-18 02:50:35 +01:00
Jakob Bornecrantz
29ff6e87f5 gallium/tests: Make trivial apps depend on libs 2010-04-18 02:50:35 +01:00
Marek Olšák
0b4df63609 r300g: various other cleanups
It seems to me that the resource management code is the most blurry.

Also some of my notes about fastfill are wrong, removing them too.
2010-04-18 02:56:09 +02:00
Marek Olšák
d3e7dfc1fd r300g: inline screen_buffer functions 2010-04-18 02:56:09 +02:00
Marek Olšák
9f2f6096a8 r300g: remove unused declarations 2010-04-18 02:56:09 +02:00
Marek Olšák
5b609badf7 r300g: add debugging options "notiling" and "noimmd" (for testing)
notiling = Disable texture tiling
noimmd = Disable immediate mode (this optimization was really worth it!)
2010-04-18 02:56:09 +02:00
Marek Olšák
4185d9770f r300g: remove r300_transfer::ctx 2010-04-18 02:56:09 +02:00
Marek Olšák
bb4f5fff0c r300g: remove use of c++ keywords 2010-04-18 02:56:09 +02:00
Marek Olšák
c383defdaa r300g: always create microtiled zbuffer regardless of texture dimensions 2010-04-18 02:56:09 +02:00
Vinson Lee
65a3c316ba i915g: Remove unnecessary headers. 2010-04-17 15:47:45 -07:00
Vinson Lee
e68c6be2f6 nvfx: Remove unnecessary headers. 2010-04-17 15:14:47 -07:00
Vinson Lee
c5e4a6dc9d nv50: Remove redundant assignment. 2010-04-17 14:49:40 -07:00
Vinson Lee
f426295521 i965g: Remove redundant assert. 2010-04-17 14:45:49 -07:00
Vinson Lee
35aae6839e os: Implement pipe_barrier for POSIX platforms without pthread_barrier_t.
This patch was tested on Mac OS X.
2010-04-17 14:24:23 -07:00
Jakob Bornecrantz
44bafca1a0 i915g: Add a software only debuging winsys 2010-04-17 21:13:23 +01:00
Jakob Bornecrantz
3e3d6864da gallium/tests: Fix trivial examples 2010-04-17 21:13:23 +01:00
Jakob Bornecrantz
08f2a6cad1 gallium/util: Ignores 2010-04-17 21:13:22 +01:00
Jakob Bornecrantz
a656f2f0f3 progs/tests: Ignores 2010-04-17 21:13:22 +01:00
Vinson Lee
0a2ae64b77 r300/compiler: Remove unnecessary header. 2010-04-17 12:13:19 -07:00
Vinson Lee
f6f78fac9e draw llvm: Remove unnecessary header. 2010-04-16 23:25:25 -07:00
Vinson Lee
d6c024ea3f llvmpipe: Remove unnecessary header. 2010-04-16 23:08:52 -07:00
Vinson Lee
6be186a6fa r300/compiler: Add radeon_program_tex.c to SCons build.
This was missed in commit f8a1418680.
2010-04-16 22:58:49 -07:00
Marek Olšák
411d506332 r300/compiler: add emulation of all mirrored-clamp wrap modes for NPOT textures 2010-04-17 02:43:47 +02:00
Marek Olšák
f91a06eed2 r300/compiler: replace mirrored-repeat emulation with a faster version
Also, the Negate bitfield was 1 instead of RC_MASK_XYZ in the previous
version, causing incorrect rendering.
2010-04-17 02:11:46 +02:00
Ian Romanick
484606610e While-loops also start a new scope. 2010-04-16 16:42:43 -07:00
Marek Olšák
a94942e379 r300/compiler: add handy definitions for XYZ0 and smeared half swizzling 2010-04-17 01:31:25 +02:00
Eric Anholt
44b694e1f6 Avoid generating ir_if for &&, || short-circuiting with constant LHS.
It was breaking constant expression detection for constant
initializers, i.e. CorrectParse2.frag, CorrectParse2.vert.
2010-04-16 13:49:04 -07:00
Marek Olšák
47265e69c8 r300/compiler: make ARB_shadow_ambient optional
This saves constant register space for r300g, which doesn't need
this feature.
2010-04-16 22:35:56 +02:00
Brian Paul
862d014ba9 llvmpipe: fix color masking 2010-04-16 14:08:26 -06:00
Eric Anholt
0d42321ec1 Add support for inlining calls done inside of expressions. 2010-04-16 12:56:18 -07:00
Marek Olšák
b2c1b944c9 r300/compiler: restore r500-specific bits of TEX transformations 2010-04-16 21:55:00 +02:00
Brian Paul
056df21cb1 llvmpipe: fix linking for lp_test_blend 2010-04-16 13:34:41 -06:00
Brian Paul
a57e762c90 llvmpipe: work-around an LLVM bug
The blend combinations ZERO,DST_ALPHA and ZERO,INV_DST_ALPHA seem to
generate bad code which leads to a segfault.
2010-04-16 13:34:28 -06:00
Brian Paul
1a44ec5e36 llvmpipe: clean-up lp_surface_copy()
Remove unreachable code, etc from previous revisions.
2010-04-16 13:07:17 -06:00
Brian Paul
1c4415ddf4 llvmpipe: remove unneeded declaration (which caused a warning) 2010-04-16 13:01:51 -06:00
Brian Paul
4593e0c85e llvmpipe: use unsigned type to avoid warnings 2010-04-16 13:01:18 -06:00
Brian Paul
b7c5e9b336 gallium/draw: fix breakage from moving lp_bld_* files 2010-04-16 12:58:40 -06:00
Brian Paul
23a2166bc5 llvmpipe: remove unneeded break stmt 2010-04-16 12:20:27 -06:00
Brian Paul
92b2af5f9a llvmpipe: fix compilation, linking of lp_test_blend 2010-04-16 11:14:43 -06:00
Brian Paul
39a12a7326 llvmpipe: updated #includes 2010-04-16 10:34:32 -06:00
Brian Paul
d75129dd13 gallivm/llvmpipe: move lp_bld_blend* files to llvmpipe/ directory 2010-04-16 10:28:21 -06:00
Brian Paul
7a05161278 gallivm/llvmpipe: move lp_bld_alpha.c to llvmpipe/ directory 2010-04-16 10:22:33 -06:00
Brian Paul
f17d1513ac gallivm/llvmpipe: move lp_bld_depth.[ch] to llvmpipe/ directory
This is specific to the llvmpipe driver and not re-usable.
2010-04-16 10:20:32 -06:00
Brian Paul
cf88dcf731 gallivm/llvmpipe: move lp_bld_interp.c to llvmpipe/ directory
This file is specific to the llvmpipe driver and not re-usable.
2010-04-16 10:17:38 -06:00
Brian Paul
d293c43c9a llvmpipe: rename vars, update comments for texture->resource changes 2010-04-16 10:01:32 -06:00
Brian Paul
cbe1145011 gallivm: init some vars to silence warnings 2010-04-16 09:56:38 -06:00
Brian Paul
ce4f4d6b2c llvmpipe: plug in draw's polygon stipple stage 2010-04-16 09:49:52 -06:00
Brian Paul
9fae289fcd llvmpipe: check for dirty context state in lp_setup_update_state()
This fixes problems with the draw module's aaline, aapoint and
pstipple stages where we change some driver state after the call
to the draw module's draw_arrays() function.
2010-04-16 09:49:33 -06:00
Brian Paul
b387f74c38 llvmpipe: flush upon PIPE_FLUSH_TEXTURE_CACHE too 2010-04-16 09:43:32 -06:00
Brian Paul
b7bd4b85f3 llvmpipe: make sure state is up to date before getting vertex layout/info
Some of the draw pipeline stages emit additional vertex attributes.
Without this change, we were getting stale vertex info that didn't
include the extra attributes.
2010-04-16 09:43:32 -06:00
Brian Paul
7d5da2370b llvmpipe: additional texture assertion 2010-04-16 09:27:58 -06:00
Brian Paul
8ba14fab9a llvmpipe: print_triangle() func (disabled) 2010-04-16 09:27:58 -06:00
Brian Paul
e960dd7b30 softpipe: rename vars, update comments, etc
Use 'resource' instead of 'texture', etc.
2010-04-16 09:27:58 -06:00
Brian Paul
1f67782afa st/mesa: add prototype for st_bufferobj_validate_usage() 2010-04-16 09:27:58 -06:00
Brian Paul
08e91bbfa1 softpipe: s/template/templat/ to avoid potential C++ issues 2010-04-16 09:27:58 -06:00
Brian Paul
0639765b28 Merge the lp-surface-tiling branch into master.
This branch implemented dual representations of texture/drawing surfaces:
one in the conventional linear layout and the other the tiled layout which
is used by the fragment shader pipe.  Per-tile flags indicate the layout
of each image tile.  In many situations this lets us avoid converting
image data between the two layouts.

Squashed commit of the following:

commit 563a7e3cc552fdcfcaf9ac0d4b1683c3ba2ae732
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 14:48:21 2010 -0600

    llvmpipe: convert points/lines to triangles with draw module

    This isn't the most efficient way to render points/lines but it allows us
    to run more tests.

commit a8aa763e8a717533f2b13bb6ea53cbccbede68c9
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 14:47:28 2010 -0600

    llvmpipe: call llvmpipe_get_texture_tile() for depth/stencil

    The returned pointer isn't used, but the tile status/layout info
    gets updated.  Helps to fix glReadPixels(DEPTH / STENCIL).

commit 463bc64af266194acbea71cd52e26a79b8c8a260
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 10:58:48 2010 -0600

    llvmpipe: add store_color to debug cmd_names list

commit 784cc73fb334a9d7b7c93cbd8a1445cdf742ff58
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 10:57:43 2010 -0600

    llvmpipe: fix debug build

commit 792c93171ec075664f55720ffed397ac2834a4fc
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 10:49:01 2010 -0600

    llvmpipe: fix cube mapping

commit 882b1035db88c3dd8aebe28dc971ac30a9ee39e3
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 09:53:30 2010 -0600

    llvmpipe: remove some older/unused code

commit b807d32b23145301e8842824664d9f06b9c5502e
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 8 09:29:50 2010 -0600

    llvmpipe: silence warning

commit 7b337e64fec92836ccdf9d96216289dd58418e35
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Apr 7 17:06:08 2010 -0600

    llvmpipe: clean-up, comments in lp_surface_copy()

commit c52fa36f249cc652fa8d5fdd94d6574127c08c41
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Apr 7 16:51:42 2010 -0600

    llvmpipe: overhaul tiled/linear memory management

    Now we keep per-tile layout info (linear vs. tiled (or neither or both)
    and convert from one layout to the other on demand.

commit 4a50ccfd470547c9be0704005818a87014e9c0e9
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Apr 7 16:51:27 2010 -0600

    llvmpipe: added tile read/write counters

commit b7d0ea9c687ac8773b083791623826fa604adf21
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 5 14:54:04 2010 -0600

    llvmpipe: rename some functions

commit ee45c6e5b95cbd3c8cccc9aa4d45d8aef11e20c4
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 5 14:42:15 2010 -0600

    llvmpipe: re-org some get block/tile pointer code

commit 26ce97c16c0b6520ff1538803baa772d8c3b1280
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 5 14:34:13 2010 -0600

    llvmpipe: disable bad assertions

commit 5c670481248c4d46f87f13bf3af5655925e7002d
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Apr 2 16:36:11 2010 -0600

    llvmpipe: add a special-case optimization to lp_surface_copy()

    Be more efficient when copying tiled image to linear image.
    Before, the fallback path was always converting the whole source image
    to linear.  Now we can convert just a sub region.

commit faa684645e64d6024b3a11e4e08da825e8220b2e
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Apr 2 16:15:16 2010 -0600

    llvmpipe: assorted texture and tile/line conversion code change s

    The tiled/linear conversion functions take x/y positions now to
    allow converting only sub-regions.

    More texture-related helper functions.

commit baad81ec5318d44bfac1e37c7643afc0836607bb
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 30 13:18:40 2010 -0600

    llvmpipe: convert tiled->linear upon PIPE_FLUSH_SWAPBUFFERS

    If we know we're about to do a swapbuffers we should immediately
    convert the tiled color tiles to linear instead of later in
    llvmpipe_texture_unmap() since we can take advantage of threading/
    parallelism here.

commit 928dd41256811daeddb7506a49a34dbad04beaf8
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 30 09:16:58 2010 -0600

    llvmpipe: polish-up the llvmpipe_flush() code

commit dd6014abcf86c517d159b8175e0eaeb167ea2ef6
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 30 09:15:17 2010 -0600

    llvmpipe: SETUP_x enum clean-up

commit 0b1ce6da2b28a41f3389685ab93e10b43c950f5d
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 26 10:43:37 2010 -0600

    llvmpipe: remove unused vars

commit 4562663480f88162ed4452cb05569eecb67f9f39
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 26 10:31:55 2010 -0600

    llvmpipe: cope with non-existant color/depth buffers

    The fragment jit functions always grab these pointers, even if they're
    not used.

commit df4329edbaf204ed501f1eac0698b8198178f9af
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 15:20:15 2010 -0600

    llvmpipe: do all render target surface mapping/unmapping in the rast code

commit 3d0c25d5ba8b8f61e8366d4c97324e45d526ff41
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 14:31:21 2010 -0600

    llvmpipe: map z/stencil buffer on demand like color buffers

    Plus lots of code clean-up and loose ends taken care of.

commit c3b6fddd788aef09b4b84b843b7b1272231151e8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 13:15:03 2010 -0600

    llvmpipe: remove unused write_zstencil field

commit 63374d97836926a6357e9d6dd24a509a8e155c56
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Mar 25 09:45:59 2010 -0600

    llvmpipe: add missing lp_rast_end() call

    Fixes crash on window resize when LP_NUM_THREADS=0.

commit 92fe9952161cc06f6edc58778e9e5a8b9ea447dc
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Mar 24 10:15:19 2010 -0600

    llvmpipe: add tiled/linear conversion for 16-bit Z images

commit 6605fa28c147f30df351da0e4413cab33e4db5da
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 23 16:06:41 2010 -0600

    llvmpipe: implement tiled/linear conversion for Z/stencil images

commit 804528d84ffa292ef9d49d3666cdd3fa099ff3ff
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 23 16:05:45 2010 -0600

    llvmpipe: added texture stride comment

commit 66a88c012edf670c4ac887a912f02dcff93266dd
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Mar 23 16:04:07 2010 -0600

    llvmpipe: remove unused vars

commit e2ca8d1328316dc8b36d5f688c16d109e49a6870
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 18:53:11 2010 -0600

    llvmpipe: checkpoint WIP: overhaul texture/surface mapping

    Conversion between tiled and linear surfaces is working everywhere now.
    The LP_TEXTURE_READ/READ_WRITE/WRITE_ALL flags let us avoid unnecessary
    image layout conversions.

    Still some loose ends, temporary/debug code, etc.
    Need to implement tiled/linear conversion for depth/stencil images.

commit f2730a03839ee8984c1f537b7cbebba24961397a
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 14:41:58 2010 -0600

    llvmpipe: rename/repurpose lp_rast_store_color()

commit e192a47552c5d20d2caef452ca7697e2cd852c9b
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 14:38:51 2010 -0600

    llvmpipe: remove lp_rast_load_color()

commit 3cff0bde4b4ab980e1c3e812700419091527c76b
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Mar 22 14:11:38 2010 -0600

    llvmpipe: remove/consolidate texture image code

commit 3a2f08b6a550c69ef5e874f482be30252cbf8bfa
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 17:03:14 2010 -0600

    llvmpipe: checkpoint WIP: directly render to tiled texture buffers

    We're now directly writing colors into the tiled texture image buffers.

    This is a checkpoint commit with lots of dead code and temporary hacks.
    Everything will get cleaned up eventually.

commit c5ca987e03870849514d4e3c99af143722a09695
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 16:41:14 2010 -0600

    llvmpipe: refactor code, create tile_pixel_offset()

commit 2133e8273e937cbac09cd7264d6ce53af9764ddb
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 14:55:11 2010 -0600

    llvmpipe: pass LP_TEXTURE_LINEAR/TILED flags around

commit b9b9d4b82b01f4588721fdc8444740f859b4a021
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 14:51:05 2010 -0600

    llvmpipe: checkpoint WIP: hanlde co-existing tiled/linear texture data

    Cube maps are temporarily broken, maybe other things.

commit 4cd322e6889940b5f155fcb69041b685b9ef9273
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 19 11:34:43 2010 -0600

    progs/demos: add other modes/patterns to dissolve demo
2010-04-16 09:25:44 -06:00
Brian Paul
db3b34219e docs: update links for new mesa-users and mesa-announce lists 2010-04-16 08:25:58 -06:00
Tormod Volden
885048232f savage: call _mesa_meta_init/free()
Fixes crash when using _mesa_CopyTexImage2D.
Bug #27652.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-16 08:24:53 -06:00
Brian Paul
97831efdb0 gallium: comments and whitespace fixes 2010-04-16 08:21:49 -06:00
Brian Paul
826f552188 softpipe: formatting fixes and comments 2010-04-16 08:21:49 -06:00
Brian Paul
fe6237719d gallivm: remove some old stuff 2010-04-16 08:21:49 -06:00
Jakob Bornecrantz
53c57191c5 st/drisw: Stop pretending to be drm_api
Reviewed-by: George Sapountzis <gsapountzis@gmail.com>
2010-04-16 10:18:05 +01:00
Jakob Bornecrantz
39c81dada0 st/dri: Refactor init code a bit
Reviewed-by: George Sapountzis <gsapountzis@gmail.com>
2010-04-16 10:17:31 +01:00
Eric Anholt
4950a68bf2 Make && and || only evaluate the RHS when the LHS requires it. 2010-04-16 01:10:32 -07:00
Vinson Lee
6c954dd128 st/mesa: Remove NULL check of pointer that could not be NULL.
cbuf has been dereferenced twice earlier in the same if-block. It is
either not NULL or a crash has already occurred.
2010-04-16 00:55:35 -07:00
Corbin Simpson
b1a89ea1ab r300/compiler: Fix texture instruction readmasks.
No immediate benefit, it was just bugging me.
2010-04-16 00:43:18 -07:00
Corbin Simpson
2c5b35807e r300/compiler: Fix magic numbers in readmasks. 2010-04-16 00:43:17 -07:00
Corbin Simpson
a089fe2816 r300/compiler: Oops, this slipped through. 2010-04-16 00:43:17 -07:00
Corbin Simpson
2e74bc440e r300/compiler: Save Q for mirror and repeat. 2010-04-16 00:43:17 -07:00
Corbin Simpson
f8a1418680 r300/compiler: Split off texture fixes to their own file.
Yes, I'm fully aware this generates subpar code on r500.
2010-04-16 00:43:17 -07:00
Vinson Lee
8c45677588 drisw: Move pointer dereferences to after NULL checks. 2010-04-16 00:36:50 -07:00
Vinson Lee
e0543599b5 st/egl: Remove unnecessary header. 2010-04-16 00:23:25 -07:00
Vinson Lee
c0301af883 st/dri: Remove unnecessary header. 2010-04-16 00:16:08 -07:00
Vinson Lee
7b8c4f22d4 st/mesa: Move dereference and assignment to after NULL check. 2010-04-15 23:15:05 -07:00
Vinson Lee
8978e45e50 mesa: Add missing format specifiers in error strings. 2010-04-15 17:17:29 -07:00
Marek Olšák
80d89aa0d2 r300/compiler: fix repeat wrap mode for TXP and NPOTs
No idea why st/mesa unnecessarily inserts TXP where TEX is sufficient.
Also re-enabling the NPOT fallback for repeat in r300g.
2010-04-16 02:04:18 +02:00
Jakob Bornecrantz
4855b568ba i915g: Create a special 2D layout helper 2010-04-15 23:52:55 +01:00
Jakob Bornecrantz
97c326417c i915g: Fix 2D layouts
This should fix 2D compressed layouts
2010-04-15 23:52:54 +01:00
Jakob Bornecrantz
e17324372b i915g: Remove unused args 2010-04-15 23:52:54 +01:00
Marek Olšák
17b41f80bd r300/compiler: kill off RC_WRAP_CLAMP
A variant thereof might be later reintroduced for the mirrored-clamp modes.
2010-04-15 23:58:38 +02:00
Marek Olšák
85cbff5b60 r300g: mask out the mirrored bit correctly in the registers
It was previously done wrong + now it shouldn't render garbage,
so that the NPOT fallback can get in.
2010-04-15 23:17:35 +02:00
Marek Olšák
a28ee4aa02 r300g: fix the MIRROR_CLAMP_TO_BORDER wrap mode
I guess this was a typo.
2010-04-15 22:06:10 +02:00
Marek Olšák
eee220d65d r300g: add missing r300_state.h
I am very bad at this.
2010-04-15 10:24:06 +02:00
Marek Olšák
6b46df9616 r300g: disable the REPEAT NPOT fallback until it works
It causes regressions. I haven't tested the MIRROR wrap modes,
so not sure about that..
2010-04-15 10:15:42 +02:00
Marek Olšák
948ce60a26 r300g: do not use NPOT fallback for CLAMP wrap modes
These work just fine.
2010-04-15 10:15:34 +02:00
Marek Olšák
6bd6f4cd49 r300g: pick a new fragment shader when either a sampler state or view is changed 2010-04-15 10:10:28 +02:00
Vinson Lee
ebf765a324 st/mesa: Remove unnecessary headers. 2010-04-14 23:49:31 -07:00
Xavier Chantry
a1fdf12160 nvfx: dont swizzle stuff into GART
swzsurf doesn't support GART

Thanks to Marcin Kościelnicki <koriakin@0x04.net> for spotting that !

This fixes corruption in etracer and the following related errors :
[14381.551927] [drm] nouveau 0000:01:00.0: PGRAPH_ERROR - nSource:
PROTECTION_ERROR, nStatus: INVALID_STATE
[14381.551945] [drm] nouveau 0000:01:00.0: PGRAPH_ERROR - Ch 2/2 Class
0x039e Mthd 0x0184 Data 0x00001cd9:0x00001cd9

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>

Adapted by Luca Barbieri for mesa master.
2010-04-15 08:15:22 +02:00
Luca Barbieri
42d9f2bb7b nouveau: replace vtxbuf/idxbuf caps with BO_ flags in nouveau_screen and fix uncached reads on nv3x
Faster, simpler and more flexible.

Also, we set those flags properly on nv3x so that we don't allocate buffers in GART.

Since on AGP GART is uncached, OpenGL doesn't distinguish between vertex and index buffers, and we don't support hardware index buffers for now, this caused uncached reads.

Also check bind and not usage for PIPE_BIND_* flags, got broken in the gallium-resources transition.
2010-04-15 08:13:12 +02:00
Vinson Lee
18dc0f0b1c i915g: Remove unnecessary header. 2010-04-14 22:59:37 -07:00
Dave Airlie
7d93f2bf84 r300g: fix regression in texdepth.
texdepth stopped working when npot went in, this brings it back
to life.

< MostAwesomeDude> That looks like what I was going to do.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-15 14:56:20 +10:00
Vinson Lee
c8efed89ba gallium/tests: Add test case for pipe_barrier. 2010-04-14 18:06:54 -07:00
Eric Anholt
5ba9420608 Add an ir_if simplification pass.
This is relatively simple at the moment, recognizing only constant
values, and not (for example) values that are restricted to a range
that make the branching constant.  However, it does remove 59 lines
from the printout of CorrectParse2.vert.
2010-04-14 17:05:13 -07:00
Eric Anholt
60be7626b8 Check that the return type of function definition matches its prototype.
Doesn't fix any testcases, but fixes a FINISHME.
2010-04-14 16:19:19 -07:00
Eric Anholt
1e7ec3ce12 Check that function definition parameter qualifiers match proto qualifiers.
Fixes function9.frag.
2010-04-14 16:18:19 -07:00
Eric Anholt
8558459512 Return the rvalue of a variable decl to fix while (bool b = condition) {} 2010-04-14 15:38:52 -07:00
Eric Anholt
3b8d2cd779 Fix the type of gl_FogFragCoord. 2010-04-14 15:28:01 -07:00
Jakob Bornecrantz
cb56b31f84 swrastg: Fix defines to be able to load more then one sw driver 2010-04-14 23:10:17 +01:00
Brian Paul
8239fd4baa llvmpipe: comments for fence functions 2010-04-14 14:32:09 -06:00
Brian Paul
4d8f34e909 progs/tests: added stencilreaddraw to SConscript, Makefile 2010-04-14 14:32:09 -06:00
Brian Paul
205253b015 progs/tests: new stencilreaddraw.c test
Based on the zreaddraw.c test.
2010-04-14 14:32:09 -06:00
Brian Paul
816fe9dd09 mesa: add -D__STDC_CONSTANT_MACROS to linux-llvm
This is needed in more places (st_cb_feedback.c) since the new LLVM
code has been added to the gallium/draw module.
2010-04-14 14:32:09 -06:00
Arpad Borsos
b3a68cdc6f softpipe: Fix division by zero
This can be triggered by running the cairo tests using the gl backend
and softpipe.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-14 14:26:37 -06:00
Kristian Høgsberg
3a82c8c562 egl_dri2: Enable KHR_gl_texture_2D_image
Forgot to set the enabled bit when I implemented the extension.
2010-04-14 16:22:48 -04:00
Marek Olšák
d72f1c3b80 r300g: fix possible crash when shader compilation fails
This hopefully fixes the crash in the FDO bug #27634, not the bug itself.
2010-04-14 20:29:42 +02:00
Michael Schmidt
d9793fc3ac Initialize DRI2 swap interval to 0
https://bugs.freedesktop.org/show_bug.cgi?id=27628
2010-04-14 10:15:47 -04:00
Michael Schmidt
0863c7e499 Initialize DRI2 swap interval to 0
https://bugs.freedesktop.org/show_bug.cgi?id=27628
2010-04-14 10:12:42 -04:00
Kristian Høgsberg
a30f7eb064 glxinfo: Print drawable type in verbose mode 2010-04-14 10:07:15 -04:00
Marek Olšák
ef19b2fbab r300g: simplify get_shader_constant to be rc-constant-state specific 2010-04-14 13:25:51 +02:00
Marek Olšák
116c863892 st/mesa: put ATI_texture_mirror_once in the right place 2010-04-14 12:55:25 +02:00
Vinson Lee
30d99ff7e0 progs/gallium: Fix relative path in Makefile. 2010-04-14 01:17:24 -07:00
Corbin Simpson
2ee0d19ccf u_blitter: Coords are normalized.
Thanks to Luca Barbieri for spotting this one.
2010-04-13 23:29:03 -07:00
Marek Olšák
ef745cf95d r300g: remove the CS compenstation for non-atomized states
Now there aren't any. If CS overflow occurs, the fix should go directly
before the problematic BEGIN_CS.
2010-04-14 04:48:19 +02:00
Marek Olšák
905fa3a07b r300g: remove always_dirty flag and correct leftovers 2010-04-14 04:48:19 +02:00
Marek Olšák
eb4e399ef0 r300g: atomize beginning occlusion query 2010-04-14 04:48:19 +02:00
Marek Olšák
3da70606b3 r300g: atomize VS constant buffer 2010-04-14 04:48:19 +02:00
Marek Olšák
abc2f29dd2 r300g: emit VS immediates along with VS code 2010-04-14 04:48:19 +02:00
Marek Olšák
6793506faa r300g: make setting up fragment depth output less hackish 2010-04-14 04:48:19 +02:00
Marek Olšák
075d9698ed st/mesa: trivially enable ATI_texture_mirror_once
This is a strict subset of already-advertised EXT_texture_mirror_clamp and
shares the same enumerants.
2010-04-14 04:48:19 +02:00
Marek Olšák
36e0100e9e r300g: kill off r300_fragment_shader::shadow_samplers and friends 2010-04-14 04:48:19 +02:00
José Fonseca
c57bac1f13 retrace: Update for recent interface changes. 2010-04-14 10:22:57 +09:00
José Fonseca
d2c5a3093f trace: Ignore transfer_flush_region too. 2010-04-14 10:22:57 +09:00
Vinson Lee
ee9ee03cab i915g: Fix winsys SCons build. 2010-04-13 17:17:15 -07:00
Jakob Bornecrantz
4e20781bac i915g: Whitespace & formating 2010-04-13 23:57:43 +01:00
Jakob Bornecrantz
136bcf6cee i915g: Mark shared layouts more clearly 2010-04-13 23:52:26 +01:00
Jakob Bornecrantz
2b64883269 i915: Fix comments about cube layouts 2010-04-13 23:52:26 +01:00
Jesse Barnes
1318848f78 Merge branch '7.8' 2010-04-13 09:40:14 -07:00
Jesse Barnes
157bdd1446 DRI2: report swap events correctly in direct rendered case
In the direct rendered case, we need to convert DRI2 swap complete
events to GLX events for the client to consume.  This path had what
looks like a stray "& 0x75" from some earlier debugging that prevented
clients from seeing the right event code.
2010-04-13 09:39:28 -07:00
Alan Hourihane
efc69ca61c llvmpipe: disable half float formats 2010-04-13 15:40:49 +01:00
Chia-I Wu
1e7f191d3a gallium: Remove pipe_screen::update_buffer.
It has no user after the removal of st_public.  Plus, it has never been
implemented by a pipe driver or winsys.
2010-04-13 21:47:23 +08:00
Alan Hourihane
cd834499eb gallium: disable tests when using embedded build 2010-04-13 12:54:36 +01:00
José Fonseca
cd4e5879eb scons: Fix exception when llvm-config is not present. 2010-04-13 19:42:29 +09:00
Michal Krol
ddc42b6380 util: Fix util_dynarray_trim(). 2010-04-13 09:00:39 +01:00
Luca Barbieri
a79521d497 nvfx: use dynamically sized rotating BO pool for fragment programs
Currently we used a single buffer for each fragment programs, leading to
rendering synchronization. This patch uses a doubly linked list of BOs,
which is dynamically resized if all the BOs are busy.

Note that inline image transfers could be an alternative option: this
will be explored later.

This removes one of the big performance limitations of the current
driver.

We also stop using pipe_resource internally in favor of using nouveau_bo
directly.
2010-04-13 09:55:49 +02:00
Vinson Lee
9f39d3240b draw llvm: Initialize variable. 2010-04-13 00:49:58 -07:00
Vinson Lee
8316da7cd2 r300g: Silence uninitialized variable warning. 2010-04-13 00:35:10 -07:00
Vinson Lee
833e6f0524 st/mesa: Remove state_tracker/st_framebuffer.c from SConscript.
This was missed in commit da8412ec19.
Fixes SCons build.
2010-04-13 00:29:33 -07:00
Chia-I Wu
da8412ec19 st/mesa: Drop st_public support.
There is no user of st_public now.
2010-04-13 15:15:43 +08:00
Chia-I Wu
a1dbd009d4 st/vega: Drop st_public support.
There is no user of st_public now.
2010-04-13 15:15:43 +08:00
Chia-I Wu
76708c665c st/vega: Do not rely on st_resize_framebuffer.
Add vg_context_update_draw_buffer (and helpers) that duplicates the
logic of st_resize_framebuffer.  Use the new function instead of
st_resize_framebuffer in vg_manager.c.
2010-04-13 15:15:43 +08:00
Luca Barbieri
50409dd71b nvfx: fix for 64-bit systems
Thanks to Patrice Mandin for debugging this.
2010-04-13 09:03:15 +02:00
Luca Barbieri
bf7e0e839f gallium/auxiliary: make util_dynarray_trim do nothing if size == capacity 2010-04-13 08:26:00 +02:00
Luca Barbieri
6c31dd1198 gallium/auxiliary: add util_dynarray_resize 2010-04-13 08:25:39 +02:00
Luca Barbieri
c572619817 gallium/auxiliary: fix util_dynarray_trim to 0 to free the data
This works better and preserves the
data != 0 if and only if capacity != 0 invariant.
2010-04-13 08:18:59 +02:00
Luca Barbieri
5f968a64dc util: implement Jose Fonseca's suggestions for u_buffer.h -> u_dynarray.h
Also describe invariants explicitly and use char* for arithmetic.
2010-04-13 06:10:31 +02:00
Corbin Simpson
c2e804a7e1 r300/compiler: Hax around instructions limits in mirroring code.
Stuff's starting to show up in arbnpot.
2010-04-12 18:24:05 -07:00
Brian Paul
497b66094d docs: update name, link for mesa-dev list 2010-04-12 18:45:10 -06:00
Dave Airlie
911fa4a4a1 ffvertex: don't touch tex coords if coord replace is enabled.
The fixed function vertex program shouldn't need to deal or touch tex coords
if stuffing is enabled.

Though I'm not 100% this won't break assumption made elsewhere it seems like
the correct thing to do, and makes r300g point sprites a lot easier to implement.

draw: fix point-sprite when vertex program is used.

This commit regressed draw, so fix it as well to help bisection.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-13 09:19:39 +10:00
Marek Olšák
745c4b5685 r300g: add generating texture coordinates for point sprites
[airlied -
	Convert sprite coord index to a per-coord enable bit
	set the rasteriser block up correctly for point sprites.

The inputs to the RS hw block change for sprite coords, so fix them up
properly - this fixes piglit point-sprite test.
]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-13 09:18:47 +10:00
José Fonseca
6917ef10f2 progs/gallium: Move into src/gallium/tests
Two reasons:
- progs will eventually have its own repository
- it is just to easy to forget updating the
  code for interface changes when it is outside of src
2010-04-13 07:05:46 +09:00
Luca Barbieri
6cd82eb399 gallium/auxiliary: add dynamically sized buffer/array/vector 2010-04-12 23:50:37 +02:00
Luca Barbieri
70fe9fd007 nvfx: add LRP in vertprog
glsl generates these.
2010-04-12 23:43:40 +02:00
Luca Barbieri
b385a31452 nvfx: add SIN and COS in vertprog 2010-04-12 23:43:39 +02:00
Luca Barbieri
d2e3942531 nvfx: add missing vertprog setcond instructions
Trivially adds SEQ, SGT, SLE, SNE, SFL, STR and SSG which were missing.
2010-04-12 23:43:22 +02:00
Luca Barbieri
6f65dcfb9f nvfx: allocate a bigger block for queries
This patch allocates a bigger chunk of memory to store queries in,
increasing the (hidden) outstanding query limit.
2010-04-12 23:36:21 +02:00
Luca Barbieri
9ad385fef9 nvfx: support an unlimited number of occlusion queries
Currently on nv30/nv40 an assert will be triggered once 32 queries are
outstanding.

This violates the OpenGL/Gallium interface, which requires support for
an unlimited number of fences.

This patch fixes the problem by putting queries in a linked list and
waiting on the oldest one if allocation fails.

nVidia seems to use a similar strategy, but with 1024 instead of 32 fences.
The next patch will improve this.
2010-04-12 23:36:21 +02:00
Vinson Lee
202760b437 r300g: Move declaration before code.
Fixes SCons build.
2010-04-12 12:50:41 -07:00
Luca Barbieri
31268d2107 nvfx: fix TXL opcode value
Was broken during unification
2010-04-12 20:48:52 +02:00
Luca Barbieri
7fc7b75995 nvfx: Add support for two sided color
This patch adds support for two-sided vertex color to nv30/nv40.

When set, the COLOR0/1 fs inputs on back faces will be wired to vs outputs BCOLOR0/1.
This makes OpenGL two sided lighting work, which can be tested with progs/demos/projtex.
2010-04-12 20:46:18 +02:00
Luca Barbieri
a2ddae0fc3 nvfx: fix compile error 2010-04-12 20:43:26 +02:00
Luca Barbieri
6d6acaebad nvfx: don't use hw index buffers on nv3x and nv44
They only apparently work on nv40 grclass cards, and this was the
previous behavior of the driver.

This really needs to be investigated more.
2010-04-12 20:39:09 +02:00
Luca Barbieri
f9397f34b6 nvfx: expose PIPE_FORMAT_B8G8R8X8_UNORM support
This is implemented in nvfx_state_fb and fragtex but was missing
in nvfx_screen.

This allows to avoid glCopyTexSubImage CPU fallbacks and makes Doom 3
much faster as a result.
2010-04-12 20:23:02 +02:00
Luca Barbieri
44ef1577be nvfx: add support for ARB_half_float_vertex 2010-04-12 20:20:02 +02:00
Luca Barbieri
d5dcd4ee35 st/mesa: half float vertex support (unexposed)
This was proposed by Marek Olšák and no one objected, so just
pushing it.

The extension is currently not exposed, because the mechanism to
discover if the driver actually supports this is missing.

We probably should change is_format_supported to handle this too.

This will allow to test Gallium drivers anyway in the meantime.

Based on work by Dave Airlie.

Changes by me:
1. Fix assertion in st
2. Change to use unpadded Gallium formats
2010-04-12 20:19:56 +02:00
Luca Barbieri
f9c665e9e6 nvfx: allocate buffers in GART if !NOUVEAU_SWTNL
Should improve performance and fix serious regressions on AGP cards.
2010-04-12 18:53:30 +02:00
Luca Barbieri
8f0d5382e3 nvfx: move check for NOUVEAU_SWTNL 2010-04-12 18:06:06 +02:00
Luca Barbieri
f647f46e03 nvfx: remove #include "nouveau_stateobj.h"
No longer used, finally!
2010-04-12 12:21:25 +02:00
Luca Barbieri
330925d911 nvfx: rework validation logic to use code and avoid stateobjs
This makes the code faster due to the lack of indirect calls and also
makes it much easier to understand what is actually going on.
2010-04-12 12:21:25 +02:00
Luca Barbieri
26e40448be nvfx: add NVFX_NEW_{FRAG,VERT}CONST 2010-04-12 12:13:23 +02:00
Luca Barbieri
5eb6b1a981 nvfx: so->RING_3D: vertprog
We could use an sb here instead, but there is no obvious performance
advantage, and perhaps there could be a disadvantage.
2010-04-12 12:13:23 +02:00
Luca Barbieri
f768528af5 nvfx: so->RING_3D: sr 2010-04-12 12:13:17 +02:00
Luca Barbieri
4b3b54d746 nvfx: so->sb: blend 2010-04-12 12:13:17 +02:00
Luca Barbieri
180654d2bb nvfx: so->sb: zsa 2010-04-12 12:13:17 +02:00
Luca Barbieri
cbe8ed435a nvfx: so->sb: rasterizer 2010-04-12 12:13:17 +02:00
Luca Barbieri
c8201c833c nvfx: so->RING_3D: screen 2010-04-12 12:13:17 +02:00
Luca Barbieri
4dbd029a76 nvfx: so->RING_3D: viewport 2010-04-12 12:13:17 +02:00
Luca Barbieri
f8f29e6191 nvfx: so->RING_3D: stipple 2010-04-12 12:13:17 +02:00
Luca Barbieri
5c89cb0f6c nvfx: so->RING_3D: scissor 2010-04-12 12:13:16 +02:00
Luca Barbieri
6558797f99 nvfx: so->RING_3D: blend 2010-04-12 12:13:16 +02:00
Luca Barbieri
f320176b71 nvfx: so->RING_3D: fb 2010-04-12 12:13:16 +02:00
Luca Barbieri
b3cc1adc14 nvfx: so->RING_3D: fragprog 2010-04-12 12:13:16 +02:00
Luca Barbieri
631f6f5616 nvfx: so->RING_3D: fragtex 2010-04-12 12:13:16 +02:00
Luca Barbieri
f5b6cc6699 nvfx: so->RING_3D: vbo 2010-04-12 12:13:16 +02:00
Luca Barbieri
c0341b22ca nvfx: stop using flush_notify
Rather than emitting relocations on flush notifications, emit them
in nvfx_state_start.
2010-04-12 12:13:16 +02:00
Luca Barbieri
188b579e30 nouveau: add state buffers, lightweight replacement for state objects
Just a dumb buffer, allowed by the RING_3D/fixed subchannel binding and
no support for relocations.

This is *much* faster than state objects.
2010-04-12 12:13:16 +02:00
Luca Barbieri
d75f99ab0c nouveau: don't autobind in state objects relocations
Autobinding creates additional pushbuffer usage which may not be
accounted in callers, and is also slow.

The next relocations patch depends on this for correctness.

Assert instead if the objects are not bound, which should happen at
screen creation time.
2010-04-12 12:13:15 +02:00
Luca Barbieri
e0af5c9b54 nouveau: bind the 3D engine to subchannel 7 and add RING_3D
RING_3D creates a method start for subchannel 7.

Bind the 3D engine to a fixed subchannel to make it work

This is much faster than the old BEGIN_RING, since we don't need
to waste cycles trying to "autobind" stuff, when a fast static binding
is perfectly good.

Subchannel 7 is chosen because the kernel takes up the lowest ones.
2010-04-12 12:13:15 +02:00
Luca Barbieri
507dc546c3 nvfx: avoid flushes in primitives
Currently we miscalculate the space needed to push vertices, causing
flushes where they should not happen.

Use a much more conservative estimate to fix it.

It will be done better in the future (e.g. using the nv50 primitive
splitter).
2010-04-12 12:13:15 +02:00
Corbin Simpson
f0b8677d57 r300/compiler: Comment code, add much better mirror maths. 2010-04-12 03:03:37 -07:00
Luca Barbieri
a57dcef636 nvfx: fix bind flags 2010-04-12 11:49:09 +02:00
Corbin Simpson
d5af1dce8f r300/compiler: Implement texcoord repeat and mirror for NPOT. 2010-04-11 23:39:24 -07:00
Corbin Simpson
f95ff1cf48 r300g: Setup external state for wrap modes. 2010-04-11 23:39:24 -07:00
Corbin Simpson
8f37f910bf r300g: Cleanup fragment program external state setup. 2010-04-11 23:39:23 -07:00
Corbin Simpson
484079d724 r300/compiler: Add NPOT compatibility fields to external state.
Completely unused for now.
2010-04-11 23:38:24 -07:00
José Fonseca
d67e3487ac llvmpipe: Respect pipe_sampler_view::format. 2010-04-12 15:32:23 +09:00
José Fonseca
cd70b6bd9e progs/gallium/raw: Update symbols.
Untested -- just the same changes done to progs/gallium/python.
2010-04-12 15:32:23 +09:00
José Fonseca
19211bb5b8 progs/gallium/python: Try to fix most regressions.
Not enough for retrace to work again though.
2010-04-12 15:32:23 +09:00
José Fonseca
c48f21ea7c st/python: Fix regressions. 2010-04-12 15:32:23 +09:00
José Fonseca
b77583203e trace: Fix several regressions introduced by recent interface changes. 2010-04-12 15:32:22 +09:00
José Fonseca
5a549d8b48 llvmpipe: pipe_target needs now 3 bits to be represented. 2010-04-12 15:32:21 +09:00
José Fonseca
0bddb58d2f stw: Update for pipe_resource interface changes. 2010-04-12 15:32:21 +09:00
José Fonseca
1dc8e08e84 stw: Fix minor st_api migration glitches. 2010-04-12 15:32:21 +09:00
Chia-I Wu
192f06adca st/wgl: Switch from st_public.h to st_api.h. [V2]
This is only compile tested with crossmingw.

V2:
 - reference count stw_framebuffer
2010-04-12 15:32:20 +09:00
Török Edwin
bddb6c7a38 Fix build with --enable-32-bit.
CFLAGS needs to be passed, as you already know.
Commit 3e17a5b047 broke this by adding a new link
command without CFLAGS.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-11 20:57:28 -07:00
Dan Nicholson
4ebed86386 Revert "dri/drivers: fix 32bit builds on 64bit systems"
This reverts commit bd09fce271. Török
Edwin sent the correct fix to the list a couple days ago in
<1270832747-15611-1-git-send-email-edwintorok@gmail.com>.
2010-04-11 20:57:28 -07:00
Luca Barbieri
930bba24e5 nvfx: make NOUVEAU_NO_TRANSFER default off
Otherwise, we read from VRAM...

Yes, again, it should be fixed to tell whether the buffer is in
VRAM or not and behave appropriately.

But this should be in pipebuffer/a generic layer; revisit this later
too.
2010-04-12 05:46:04 +02:00
Luca Barbieri
aa985f339d nvfx: always use M2MF instead of the blitter
Currently we are relocating transfers to VRAM to use the blitter,
which is terrible.

Maybe for ->VRAM the blitter could be better, but we can't be
perfectly sure of that due to relocations.

In other words, just do the simple thing, and defer fine-tuning the
transfer hardware method to a later stage, while making it work
decently now.
2010-04-12 05:46:04 +02:00
Chia-I Wu
927e576284 st/egl: Request the front buffer as needed.
The front buffer is added to support old X servers.  Check the version
of the server so that it can be added as needed.
2010-04-12 11:44:35 +08:00
Luca Barbieri
5060b99418 nvfx: add missing vtbl for shared textures 2010-04-12 04:40:03 +02:00
Marek Olšák
136bd184a2 r300g: atomize FS constant buffer 2010-04-12 04:16:08 +02:00
Marek Olšák
5633392966 r300g: atomize compiler's state variables for fragment shader 2010-04-12 04:16:08 +02:00
Marek Olšák
34092c55d6 r300g: atomize fragment shader 2010-04-12 04:16:08 +02:00
Marek Olšák
13b86fe207 r300g: remove a false comment 2010-04-12 04:16:08 +02:00
Marek Olšák
78257f3e8c r300g: emit FS depth output config with FS code 2010-04-12 04:16:08 +02:00
Marek Olšák
953a309de9 r300g: FS constants emission rework
* The constant buffer emission is separated from RC state variables emission.
* The immediates are emitted with FS code.
2010-04-12 04:16:08 +02:00
Vinson Lee
132a590d5e r300g: Remove unnecessary headers. 2010-04-11 18:27:04 -07:00
Vinson Lee
c7dda49aff r300g: Initialize base.bind member variable.
The base.bind member variable was never initialized.
2010-04-11 18:19:24 -07:00
Vinson Lee
8033d7542b i915g: Fix possible null pointer deference in debug builds.
i915_buffer deferences buf in debug builds. Move declaration and
assignment to inside NULL check of buf.
2010-04-11 18:07:41 -07:00
Vinson Lee
4a796264df i915g: Fix assert. 2010-04-11 17:56:21 -07:00
Vinson Lee
039e77a7d1 progs/trivial: Update .gitignore. 2010-04-11 17:30:44 -07:00
Jakob Bornecrantz
36667036e8 progs/egl: Add lib directories to OpenVG demos 2010-04-12 01:50:52 +02:00
Jakob Bornecrantz
d93c34cf70 st/egl: Fix DRI2 on old X servers 2010-04-12 01:50:52 +02:00
Jakob Bornecrantz
cefe2a1dc2 winsys/sw: Fix error paths 2010-04-12 01:50:52 +02:00
Jakob Bornecrantz
c81f049794 llvmpipe: Fix transfers after resource change 2010-04-12 01:50:51 +02:00
Vinson Lee
b132265f50 util: Remove unnecessary header. 2010-04-11 15:06:07 -07:00
Vinson Lee
3d9199ebf2 i965g: Remove unnecessary header. 2010-04-11 14:59:09 -07:00
Vinson Lee
3601b20c9b r300g: Add r300_resource.c to SCons build.
This was missed in commit 287c94ea49,
the gallium-resources branch merge.
2010-04-11 14:51:14 -07:00
Vinson Lee
0ebf7e34b4 svga: Remove unnecessary headers. 2010-04-11 14:27:16 -07:00
Vinson Lee
e188d1e632 trace: Remove unnecessary header. 2010-04-11 14:03:57 -07:00
Marek Olšák
db1b3e714c r300g: a fix for piglit/texrect-many
Broken since 146879284c.
2010-04-11 19:30:09 +02:00
Marek Olšák
6eae8e4482 r300g: use a dummy replacement vertex shader if the shader compilation fails 2010-04-11 19:29:31 +02:00
Marek Olšák
69019afa67 r300g: use a dummy replacement fragment shader if the shader compilation fails
Better than killing an application.
2010-04-11 19:29:30 +02:00
Maciej Cencora
bd09fce271 dri/drivers: fix 32bit builds on 64bit systems 2010-04-11 16:33:55 +02:00
Maciej Cencora
0203136e69 Merge commit 'origin/7.8' 2010-04-11 14:12:13 +02:00
Maciej Cencora
2657325c4a r300: respect radeon common code fallbacks
Fixes progs/demos/shadowtex under KMS
2010-04-11 13:42:00 +02:00
Maciej Cencora
6a5518861e r300: set proper vertex index limits also in non indexed mode
Fixes #27521, broken menus in UT2004 and broken water refraction in Sauerbraten.
2010-04-11 13:41:38 +02:00
Christoph Bumiller
948e9f7c88 nv50: fix texture relocs
The new address should go to TIC entries 1, 2 instead of entry 0.
Also, using PIPE_SHADER_* for the program type was wrong, they're
ordered like the tesla method now, sorry for the confusion.
2010-04-11 11:44:12 +02:00
Chia-I Wu
870a9d643b st/egl: Follow the portability guide.
Avoid including standard library headers and use MALLOC/FREE if
possible.
2010-04-11 17:12:42 +08:00
Chia-I Wu
5ec4b636c4 st/egl: Factor driver callbacks to a new file.
Factor all callbacks other than Initialize, Terminate, and GetProcAddress
to egl_g3d_api.c.
2010-04-11 17:12:42 +08:00
José Fonseca
47a89e9255 scons: Always build softpipe and llvmpipe (when llvm available).
These are our reference software rasterizers. They can build everywhere
and are a precious debugging tool.

Making them always present immensily simplifies the scons logic.

If people want to avoid building it is still possible to pass
direcotries and target names to scons to narrow the build.
2010-04-11 17:17:35 +09:00
José Fonseca
21780adc2e scons: Make debug build default.
I've been back and forth on this, but I believe it's worth to have debug
by default.

Most humans (developers, testers) will want to use the debug version  by
default.  Many build bots want release but they are bots, and humans >
bots, so I don't care that much.

This is part of my initiative of minimizing the scons option mess many
complain about.
2010-04-11 17:17:34 +09:00
José Fonseca
ea532f0e72 scons: Make LLVM a black-white dependency.
Now that draw depends on llvm it is very difficult to correctly handle
broken llvm installations. Either the user requests LLVM and it needs to
supply a working installation. Or it doesn't, and it gets no LLVM
accelerate pipe drivers.
2010-04-11 17:17:34 +09:00
José Fonseca
9fc93b8041 scons: Use libdrm options only where needed.
Prevents needless recompiles when switching dri=yes to no.
2010-04-11 17:17:34 +09:00
José Fonseca
9faf9529f3 scons: Build glapi regardless of the dri option. 2010-04-11 17:17:34 +09:00
Marek Olšák
146879284c r300g: revisit some assertions and fix potential failures
* Turn some assertions to error messages.
* At most 16 vertex elements can be set, others are ignored.
* Rasterize at most 8 vertex-shader generic outputs, others are ignored.
  This includes fog and WPOS.
* Unknown shader semantic names are ignored.
2010-04-11 10:15:50 +02:00
Marek Olšák
08afcaa56e r300g: use cliprects for scissoring
Cliprects can be disabled, scissors can't. It maps nicely to hardware.
2010-04-11 10:15:50 +02:00
Vinson Lee
f39dcdc70c st/egl: Remove unnecessary header. 2010-04-10 22:20:10 -07:00
Vinson Lee
5c28928c92 i965: Remove unnecessary header. 2010-04-10 22:14:06 -07:00
Vinson Lee
e13e1c068d r300: Remove unnecessary header. 2010-04-10 22:03:29 -07:00
Vinson Lee
68341dcfc0 mach64: Remove unnecessary header. 2010-04-10 21:51:24 -07:00
Vinson Lee
6bd99f1130 radeon: Remove unnecessary header. 2010-04-10 21:43:16 -07:00
Marek Olšák
2e7785be22 r300g: fix mipmapped 3D textures
This is a bug in the CS checker causing CS being rejected.
2010-04-11 06:40:46 +02:00
Marek Olšák
e1208bbeae r300g: support some exotic sampler formats 2010-04-11 06:40:46 +02:00
Vinson Lee
93a6db0779 st/mesa: Silence uninitialized variable warning. 2010-04-10 21:05:40 -07:00
Vinson Lee
8369f2005b nvfx: Silence uninitialized variable warning. 2010-04-10 20:45:03 -07:00
Vinson Lee
ac18b8c44c nvfx: Silence uninitialized variable warnings. 2010-04-10 20:28:24 -07:00
Vinson Lee
95d3bdd338 r300/compiler: Remove unused variable. 2010-04-10 20:12:32 -07:00
Vinson Lee
e19ea63b80 svga: Silence uninitialized variable warnings. 2010-04-10 20:05:10 -07:00
Vinson Lee
a060194519 progs/glsl: Update .gitignore. 2010-04-10 19:51:55 -07:00
Marek Olšák
1c356ac95b r300g: cleanup handling of sampler views
The evolution of TX_FORMAT bits is as follows:
* When a texture is created, set bits independent of pipe_format.
* When a sampler view is created, add format-specific bits.
* When sampler states and views are getting merged, add min/max LOD.
2010-04-11 01:32:15 +02:00
Marek Olšák
26a54ed6fd r300g: pick up some new colorbuffer formats 2010-04-11 01:32:15 +02:00
Dave Airlie
21ba2cd632 r300g: hack around issue with doom3 and 0 stride
This is most likely a bug in the mesa state tracker, but do the quick hack
for now to avoid the divide by 0.

reported and hack generated by almos on #radeon

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-11 08:08:49 +10:00
Chia-I Wu
9b3df661bd st/egl: Remove depth/stencil format from the native interface.
A native display has no interest in depth/stencil format.  Remove it
from the interface and let the common code derive the supported
depth/stencil formats from the pipe screen.
2010-04-11 01:17:47 +08:00
Chia-I Wu
5fdda9d78d st/vega: Require both depth and stencil.
The implementation requires not only a depth buffer, but also a stencil
buffer.
2010-04-11 01:17:47 +08:00
Chia-I Wu
f7730c0740 st/egl: Remove __GLcontextModes from the native interface.
Replace __GLcontextModes by a subset of its attributes that makes sense
to EGL.  This also gets rid of GL headers from the common code.
2010-04-11 01:17:47 +08:00
Christoph Bumiller
51430c21ff nv50: plug in miptree resource vtbl 2010-04-10 19:08:45 +02:00
Marek Olšák
cd499e7612 r300g: use clamp-to-edge instead of repeat/mirrored-repeat for NPOT textures 2010-04-10 19:00:10 +02:00
Keith Whitwell
287c94ea49 Squashed commit of the following:
commit 0189cb2fde9f5d7326fd4bfbc2e52db4cce73b3e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Apr 10 12:48:43 2010 +0100

    gallium: don't use generic get_transfer func for textures

    It doesn't know and can't fill in the stride value.

commit 65bc6f88fd9ce8ff90175b250e580bef2739ea35
Author: Chia-I Wu <olv@lunarg.com>
Date:   Sat Apr 10 13:49:34 2010 +0800

    i915g: Initialize screen surface function.

commit eb56e64986790aa2fa35534ce652b78656b0c3c5
Merge: f8b0a7f e7f1e5c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Apr 10 00:38:43 2010 +0100

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/r300/r300_texture.c

commit f8b0a7f6a3a98fd36ce90a81073ec8c8f09b684c
Merge: a3c9980 f43c679
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Apr 10 00:35:09 2010 +0100

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/r300/r300_texture.c

commit a3c99807de37dc2c072f1d75ed3a11da333bc9a1
Author: unknown <michal@.(none)>
Date:   Fri Apr 9 18:51:39 2010 +0200

    scons: Add missing sources.

commit 927cec79cedb457efa9e6f335727cfcb8e4908e2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 18:07:56 2010 +0200

    gallium: fix another compile warning after merge. Hmpf.

commit 52953cd7b0e51deafecb812bdc40f9e45f9ac62a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 18:02:11 2010 +0200

    gallium: fix comment

commit 7c8763aa6cfc74adf1ea49c2bab25ca17b32575f
Author: unknown <michal@.(none)>
Date:   Fri Apr 9 18:05:20 2010 +0200

    util: Fix type cast.

commit 9d0086411a104b7cc9297aac0d1f82853118d7bf
Author: unknown <michal@.(none)>
Date:   Fri Apr 9 18:04:33 2010 +0200

    libgl-gdi: Use proper unwrap functions for resources.

commit 251a5cdd18ba31c690ef61f133dfc65cd4a45cf8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:51:23 2010 +0200

    gallium: more comments fixup

commit 8f3f9d5e1e9c0de98a3dfb19e81250d2c32ee4e9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:48:18 2010 +0200

    gallium: another fix after merge

commit 41f00a32ee5be91512c048bacb89ede0e04bc08d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:44:30 2010 +0200

    gallium: more pipe_texture/resource fixes after merge

commit faf53328d1154c51d8a59513f2bfcae62272b0bf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 17:44:24 2010 +0200

    gallium: fix comments for changed USAGE flags

commit fdcb17bea4b0798d316b56deea69832f41142adf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 9 16:40:07 2010 +0200

    gallium/pb: pb uses PB_USAGE_ flags, not PIPE_TRANSFER_ (same value anyway)

commit c95f7278ecc6db417ec1053279f2a8172c47aee9
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:44:35 2010 +0100

    llvmpipe: fix merge glitches

commit 28f8b8683175149a381be5eff263d4c20568bce7
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:41:39 2010 +0100

    r300g: update after merge for pipe_resources

commit 248c93cbc066ba6e3fadd94c5fcf3bdbb373d8fd
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:41:20 2010 +0100

    st/mesa: fix old pipe_texture usages

commit a563b1c5c2cb57b3ef28a3654d9b477460d13ced
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:40:56 2010 +0100

    r300g: remove unused variable

commit 734500131d828c9dfd68c5fa26b3e6b07e086d2d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:40:36 2010 +0100

    nv50: fix compiler warning

commit efd402e13037e5c3e29759fa5b1c754c6d65d0e2
Merge: fec8a1d 5452615
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Apr 9 13:33:57 2010 +0100

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/cell/ppu/cell_screen.c
    	src/gallium/drivers/cell/ppu/cell_texture.c
    	src/gallium/drivers/llvmpipe/lp_screen.c
    	src/gallium/drivers/r300/r300_context.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_screen.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/state_trackers/egl/common/egl_g3d.h
    	src/gallium/state_trackers/egl/kms/native_kms.c
    	src/gallium/state_trackers/egl/x11/native_dri2.c
    	src/gallium/state_trackers/egl/x11/native_ximage.c

commit fec8a1db13fac04ef56f6ece799d1f20aa3011db
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Apr 3 07:58:34 2010 +0200

    util: fix assertion failures in pipe_buffer_flush_mapped_range

commit 1ff3984c2edce9927744f3cce3e7b07778990170
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 8 17:44:54 2010 +0200

    docs: fix transfer_map description

commit 20bf14be8ac6438cb1afa38212e306fc06a5ed40
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Apr 8 14:39:13 2010 +0100

    util: fix up several uses of pipe_map_buffer_range

    This function used to return a pointer to where the start of the
    actual buffer would have been, even though only the requested range is
    being mapped.

    In the resources change, the function was modified to use a transfer
    internally, and started returning the pointer to the beginning of the
    transfer, ie the mapped range.

    Some users of the function were changed to reflect this new behaviour,
    some were not.  Since then the function has reverted to its original
    behaviour, matching master.

    This change restores some of the users of the map_buffer_range helper
    to expect the old/original behaviour.

commit 33179a86058b68b518f40971030db337dc26fe6e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Apr 8 14:38:54 2010 +0100

    mesa/st: fix up several uses of pipe_map_buffer_range

    This function used to return a pointer to where the start of the
    actual buffer would have been, even though only the requested range is
    being mapped.

    In the resources change, the function was modified to use a transfer
    internally, and started returning the pointer to the beginning of the
    transfer, ie the mapped range.

    Some users of the function were changed to reflect this new behaviour,
    some were not.  Since then the function has reverted to its original
    behaviour, matching master.

    This change restores some of the users of the map_buffer_range helper
    to expect the old/original behaviour.

commit 3f5363d4dc9d7ad48467ae82d58d5f3d9bd10698
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Apr 7 17:26:52 2010 +0100

    util: map_range and flush_range have offsets relative to start of buffer

commit 7eb1bfb97a790c73188d6b616d54fb3849e69b1e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Apr 7 17:26:08 2010 +0100

    nv50: fix compiler warning

commit d040daff0642dd791ac38e9b353dc251b03fc873
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Apr 7 17:25:58 2010 +0100

    nvfx: fix compiler warning

commit 49ec01dffb8e99ab3ff8f856287db7b4df3efed6
Author: Chia-I Wu <olv@lunarg.com>
Date:   Mon Apr 5 11:58:53 2010 +0800

    mesa/es: Fixes for gallium-resources.

commit 47c87ada452be45766928a01b6d69da63e3a5f5e
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Apr 3 05:19:20 2010 +0200

    r300g: fix transfers for textures created from winsys handles

commit 5f2701fddaef9c18d85c049311c2819c49cc1ae0
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Sat Apr 3 03:52:38 2010 +0200

    nouveau: don't use the staging usage

    Maybe it could make sense, but for now dynamic is enough.

    None of these avoid uncached reads from GART on AGP cards.

commit 0db20fa49e008f35911007fa7ed9be1d678a2161
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Sat Apr 3 03:27:19 2010 +0200

    i965: add brw_resource.c to Makefile

commit b94f3e7389cbd1b6465de3c04e8059ce73f1ea1f
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Sat Apr 3 01:48:33 2010 +0200

    nouveau: fix for gallium-resources

commit a01ff99a19986e6beb7903431e60a074945b09bc
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 19:26:35 2010 +0200

    gallium: fix missing includes

commit 26aeded562ce947a6deeb867fe22bf8daf7b1a1a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 19:19:18 2010 +0200

    gallium: remove video interface and related stuff

    These interfaces weren't quite was needed, and building disabled for a while.
    Some code actually build since some branch merge, and were now not fully
    converted to gallium-resources.
    See http://www.mail-archive.com/mesa3d-dev@lists.sourceforge.net/msg09619.html
    for a discussion of this. Video related work is done in origin/pipe-video
    branch.

commit c64285aea45997a276fb141d7badc8a04f617c7c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 18:45:54 2010 +0200

    python: fixes for resource changes

    doesn't look quite ok yet, but sort of compiles.

commit 03d4d5a41f5cf158a358fd705c695e1c987a328f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 18:34:46 2010 +0200

    gallium: s/u_box_orgin_2d/u_box_origin_2d

commit 2444f023142bcaf7bd310b44794580f273254408
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Apr 1 03:26:50 2010 +0200

    r300g: fix segfault when the transfers functions are used

    Still broken.

commit 6f09bf4066ab651b323c131bb07978e700519805
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 00:05:12 2010 +0200

    r300g: compile fixes

commit 76711ff40d2092f9ef03d452de7458c4e76d9246
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 1 00:04:47 2010 +0200

    nvfx: more compile fixes

commit c5d2e90c9cc119447a447dc04a4bce4ab91fc671
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 23:18:50 2010 +0200

    gallium: more mostly merge fallout fixes...

commit fbc3722696790857f4adc936190406e74dffd969
Merge: 86d9225 d97f696
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 22:09:35 2010 +0200

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/cell/ppu/cell_screen.c
    	src/gallium/drivers/i915/i915_buffer.c
    	src/gallium/drivers/i915/i915_context.h
    	src/gallium/drivers/i915/i915_resource_texture.c
    	src/gallium/drivers/i915/i915_screen.c
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/drivers/i965/brw_resource_texture.c
    	src/gallium/drivers/llvmpipe/lp_screen.c
    	src/gallium/drivers/llvmpipe/lp_setup.c
    	src/gallium/drivers/nvfx/nv30_fragtex.c
    	src/gallium/drivers/nvfx/nv40_fragtex.c
    	src/gallium/drivers/nvfx/nvfx_miptree.c
    	src/gallium/drivers/nvfx/nvfx_screen.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/svga/svga_screen_texture.c
    	src/gallium/state_trackers/dri/common/dri_drawable.c
    	src/gallium/state_trackers/dri/common/dri_screen.c
    	src/gallium/state_trackers/dri/common/dri_st_api.h
    	src/gallium/state_trackers/dri/drm/dri1.c
    	src/gallium/state_trackers/dri/drm/dri1.h
    	src/gallium/state_trackers/dri/drm/dri2.c
    	src/gallium/state_trackers/python/st_device.c
    	src/gallium/state_trackers/python/st_sample.c
    	src/mesa/state_tracker/st_cb_clear.c
    	src/mesa/state_tracker/st_cb_drawpixels.c
    	src/mesa/state_tracker/st_cb_readpixels.c
    	src/mesa/state_tracker/st_cb_texture.c
    	src/mesa/state_tracker/st_extensions.c

commit 86d9225d19d194eebbbe95b059695697c3307d15
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 19:06:06 2010 +0200

    gallium: more fixes for bind changes

commit a215ef0606347e34669a580ec8df93ede7e46399
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 31 18:48:36 2010 +0200

    gallium/docs: some updates for bind changes

commit c6c7e6746cbc7af59f7972719ed76f43e8ac16fc
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 20:24:26 2010 +0200

    gallium: more bind change compile fixes

commit a83fa1504b78180524a5eb454ae186741a27cdf8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 17:37:13 2010 +0200

    compile fixes

commit 30dc8afcd243d6a160571bac5f06d773e54a4196
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 16:56:28 2010 +0200

    fix some merge issues

commit 30aa617fee11fe50c0a9c2f33fcd120a474f5e34
Merge: 1dde609 3a830bc
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 30 16:09:45 2010 +0200

    Merge commit 'origin/gallium-buffer-usage-cleanup' into gallium-resources

    Conflicts:
    	src/gallium/drivers/nouveau/nouveau_screen.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c

commit 1dde609ad6c9d2dfa0a5f7167f3c5bcf023b7c4d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 24 02:35:00 2010 +0100

    docs: some updates for pipe_resource

commit f236f9660d31b936f54b64ae07e569f8637067bd
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Mar 24 01:31:28 2010 +0100

    nvfx: fix for gallium-resources

    It seems to work with basic applications but almost surely needs more work.

    In particular, it probably shouldn't use PIPE_BUFFER_USAGE_* flags
    and should use PIPE_TRANSFER_* in several places.

    Also, we probably don't want the vtable indirect calls and that ought
    to be replaced with something better instead.

commit 5a136ad7b63768cb9a753eff8686c44592e62325
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Mar 24 01:31:19 2010 +0100

    nv50: fix build in gallium-resources

    Not actually tested.

    Also needs next patch tee to actually build, this is just the nv50 part
    split from the rest.

commit 3a830bc4a3f0f60c925b9434845a6bcad9a913c5
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 14:00:52 2010 -0700

    st/egl: fix up for binding flags

commit c6a80dc32ef17bc972d4137ce7444ebed4d28ebb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 13:52:15 2010 -0700

    r300: restore 4k alignment for oqbo buffers

commit e75a8d5ea9e0ffcf67bc858e08937e10b4fc74ba
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 13:00:07 2010 -0700

    gallium: bind flags

commit 1f5b509543a7f399835fd9edf27c18e1643fab7d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 19:32:21 2010 +0100

    i965g: scons compile fixes

commit 2c385f8f905ec794d9119c05c6293e0b1b9b565a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 19:20:33 2010 +0100

    nouveau: drm compile fix

commit b285086ebd5132b47c340897c4622cc9fbd286cb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 18:36:19 2010 +0100

    r300g: pipe_resource compile fixes

    bring back mistakenly deleted radeon_buffer.h
    plus some more

commit 7810606f423ef2f51f0a14b919640c2fd2c931aa
Author: Michal Krol <michal@vmware.com>
Date:   Tue Mar 23 16:21:03 2010 +0100

    softpipe: Map GS constants, too.

commit 366f1176fb89d2b1978da6cfe60000b76bbc7338
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 15:51:52 2010 +0100

    failover: update for pipe_resources

commit 615f44d70d293704ed821bc0b21fcfe6e363895d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 15:51:02 2010 +0100

    identity: remove double is_resource_reference assignment

commit 7008586020395905ddfff333d02b3893de369796
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 23 15:50:32 2010 +0100

    trace: compile fix

commit 058c5697bda4c9cf7b49d26ee27a34586544efaa
Merge: dd7ba13 b33fd3c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 23 06:40:39 2010 -0700

    Merge commit 'origin/gallium-resources' into gallium-buffer-usage-cleanup

    Conflicts:
    	src/gallium/state_trackers/vega/api_filters.c
    	src/mesa/state_tracker/st_cb_drawpixels.c

commit b33fd3ce3daf2921a895367d0ed3fd9c718a8575
Author: Michal Krol <michal@vmware.com>
Date:   Mon Mar 22 21:03:26 2010 +0100

    gallium: Usage parameter of get_transfer/transfer_inline_write is a bitfield.

commit 9c1162d9d656062a490a529997def3f674cc61fc
Author: Michal Krol <michal@vmware.com>
Date:   Mon Mar 22 20:50:49 2010 +0100

    scons: Update file lists after gallium-resources changes.

commit af9793ab9e5386b150d6b25c0d1978fdc67172e4
Author: Michal Krol <michal@vmware.com>
Date:   Mon Mar 22 20:04:39 2010 +0100

    gallium: Do not use `template` for formal parameter names.

commit dc2e12d714c444af9ff1acdd5a7e91408b116c99
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:41:34 2010 +0000

    ws/nouveau: remove pipe_texture reference

commit b94c72329f1be85887d40d49b0586979da469d77
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:40:41 2010 +0000

    ws/xlib: remove pipe_buffer reference in comment

commit 0a2af3eeae7de1d1cb433f0a2c35136b115f9920
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:39:34 2010 +0000

    st/vega: clean up reference to pipe_texture

commit 437ce98daae46be5d532fbb04c7cbf4a503c1623
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:39:02 2010 +0000

    st/python: begin conversion to pipe_resources, much more to do

commit 1b02e1ee3e5e87774f0c9e5f0e1898b7f8de1b16
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:29:34 2010 +0000

    st/xorg: update for pipe_resources

commit eb39977fe7a1d9f0c3f4f2d4303a93c2c613cc3b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:23:51 2010 +0000

    st/dri: update for pipe_resources

commit e447aeff597a4d8c0f5de25854c14c99f2cc138c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:23:36 2010 +0000

    st/egl: update for pipe_resources

commit e4cc48da8fdbd7d521257a6d7cd10e6fc5aa1a65
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:08:44 2010 +0000

    r300: drop use of R300 DONT SYNC flag

commit 129a83ab4d32e44ded5faea3f86ae5e1e62cddb6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:08:17 2010 +0000

    pipebuffer: use transfer flag

commit 575b35ee6b683d77095ef21c573c1de207107e79
Merge: f29ac73 9fc6c8b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 22:03:25 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_texture.c
    	src/gallium/drivers/r300/r300_context.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/winsys/drm/radeon/core/radeon_buffer.h

commit f29ac73f3f626d5779a627b7fa6fecdb60a35aab
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 18:37:25 2010 +0000

    cell: attempt to convert to pipe_resources

    Can't even compile test this driver.

commit 484b1947f4af81bab60b41f21c3c23ea6f67488c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 17:25:50 2010 +0000

    nvfx: restore usage of pipe_winsys

    The interface that cannot be killed...

commit ac76ac6eb30f4f9aa9f5733d60358b357925953a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 17:25:10 2010 +0000

    nv50: fix warning

commit 9683f4423449fa5acf6c019c571223650473bd82
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 17:14:31 2010 +0000

    util: restore u_simple_screen, nouveau still relies on it

commit 961cbcb62232689c959965384c6aa9b8eca697c1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 16:51:54 2010 +0000

    nouveau: convert nvfx and nv50 to pipe_resources

    Compile tested only.

    This was a deeper change than I was hoping for, due to the
    layering of the pipe_texture implementation in each driver on
    top of a shared pipe_buffer implementation in the shared code.

    Have modified the shared code to act as a set of convenience
    routines operating on nouveau_bo objects.

    Each driver now uses the u_resource_vtbl technique to split the
    implementation of pipe_resources between the existing miptree code
    for textures and a new, minimal buffer implementation in each
    driver.

    Eventually these should be combined, not least because APIs are now
    allowing things like binding buffer resources as textures and render
    targets.

commit 18ba74016db13b23282f5033ee37b628a12ee566
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 10:02:54 2010 +0000

    r300: fix compilation after merge

    Also build r300 by default.

commit eb9c0175c8e4baca3fcb0b8364f83ceba9d74e0d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 09:59:49 2010 +0000

    st/vega: fix up after merge

commit ea8dd1d4ae7b58c9315c3491046ef3852ddd3377
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 09:59:44 2010 +0000

    aux: remove unused piperesource helpers

commit be7af29d3ad1a10409b0ea689d882cf30a4e1d62
Merge: d22c2c6 12deb9e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 21 09:54:53 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/auxiliary/cso_cache/cso_context.c
    	src/gallium/auxiliary/cso_cache/cso_context.h
    	src/gallium/drivers/r300/r300_context.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/state_trackers/vega/api_filters.c
    	src/gallium/state_trackers/vega/image.c
    	src/gallium/state_trackers/vega/image.h
    	src/gallium/state_trackers/vega/mask.c
    	src/gallium/state_trackers/vega/mask.h
    	src/gallium/state_trackers/vega/paint.c
    	src/gallium/state_trackers/vega/paint.h
    	src/gallium/state_trackers/vega/renderer.c
    	src/gallium/state_trackers/vega/renderer.h
    	src/gallium/state_trackers/vega/shader.c
    	src/gallium/state_trackers/vega/vg_context.h
    	src/gallium/state_trackers/vega/vg_tracker.c
    	src/mesa/state_tracker/st_manager.c

commit d22c2c6cb23a063e3334a165d0c5c3d73f05d234
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 20 11:48:54 2010 +0000

    drm/r300: update for r300g pipe_resources conversion

    Remove old files that related to pipe_buffers but weren't being
    built.  Hopefully this is correct.

commit f07b2c836958bee5796899123eca4ed05ac6242b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 20 11:47:03 2010 +0000

    r300: convert to pipe_resources

    Do a very shallow conversion - basically keeping the existing
    buffer and texture code intact and using a vtbl struct
    inside our resource struct to select between the two implementations.

    The buffer and texture treatments could be further merged without
    much effort, but try to keep the existing code working at this point.

commit feca9c3ca62daaf0d8745370106d4e3b22340c49
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 06:00:34 2010 +0000

    gallium: update new merges to pipe_resource

commit 1cad983eac77a0c5333e6a3ce92b90ac87407714
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 06:00:19 2010 +0000

    drm/sw: update new merges to pipe_resource

commit 191d39490ed792c569f98d42cf05891b264f71f8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 06:00:01 2010 +0000

    vg: update new merges to pipe_resource

commit b727c59bc44812ad503d9390505c92b738a5b8b0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:59:38 2010 +0000

    llvmpipe: update new merges to pipe_resource

commit 5f4b64b37fdcd70162c382b2ebbd494bef751dbd
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:59:23 2010 +0000

    brw: pipe_resource fixes

commit d4aca209f531f1b65bf706ce1e5fc0375b587eb6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:59:06 2010 +0000

    util: update new merges to pipe_resource

commit cf6bef0afee10763c78509a3d17e9a6e49bcd3c8
Merge: 1997231 6de8e56
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 18 05:38:50 2010 +0000

    Merge commit 'origin/master' into gallium-resources

commit 1997231916144485c3c4a36f53eda39fce460272
Merge: ad88ac7 e1ee3ea
Author: Keith Whitwell <keithw@vmware.com>
Date:   Wed Mar 17 08:46:38 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/auxiliary/Makefile
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/auxiliary/util/u_blit.h
    	src/gallium/auxiliary/util/u_gen_mipmap.c
    	src/gallium/auxiliary/util/u_gen_mipmap.h
    	src/mesa/state_tracker/st_cb_texture.c
    	src/mesa/state_tracker/st_gen_mipmap.c

commit ad88ac79034a91670940276e722bdd398d5c9023
Merge: 77bc770 8cdfd12
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 16 09:13:07 2010 +0000

    Merge branch 'gallium-sampler-view' into gallium-resources

    Conflicts:
    	src/gallium/auxiliary/cso_cache/cso_context.c
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/drivers/llvmpipe/lp_texture.c
    	src/gallium/drivers/softpipe/sp_texture.c
    	src/mesa/state_tracker/st_cb_fbo.c
    	src/mesa/state_tracker/st_framebuffer.c
    	src/mesa/state_tracker/st_texture.c

commit 77bc770c991ea025c82eaa4e0e2390efd825d96d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 15 22:21:48 2010 +0000

    util: missing file

commit f83c91db8ae63a3c3a34ff21492427a5663fb760
Merge: c1d4774 42910eb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 15 09:48:58 2010 +0000

    Merge commit 'origin/gallium-sampler-view' into gallium-resources

    Conflicts:
    	src/gallium/drivers/nv40/nv40_transfer.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/trace/tr_drm.c

commit dd7ba1378fc50710667724d30d6d4cf1125ad61e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 23:54:36 2010 +0000

    gallium: start a cleanup of buffer_usage

    Remove fairly meaningless CPU/GPU READ/WRITE flags and
    replace with proper usages.

commit c1d4774187189f4af8ff421b210824f3d53ceefb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 23:05:45 2010 +0000

    llvmpipe: don't FREE userbuffer data

commit 9bfa07afe179f8060e7beefb754a29c4d9c6e349
Merge: 65757a1 08cddfe
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:54:51 2010 +0000

    Merge commit 'origin/master' into gallium-resources

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_scene.c
    	src/gallium/drivers/llvmpipe/lp_texture.c
    	src/gallium/drivers/llvmpipe/lp_texture.h
    	src/gallium/drivers/softpipe/sp_texture.c
    	src/gallium/drivers/svga/svga_screen_texture.c

commit 65757a143f8e3fcd7afbc1ff92db44a823edf46c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:41:17 2010 +0000

    svga: build fixes

commit 2f5435220501d4b3050cab2bb1dce6174cd13ff6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:39:25 2010 +0000

    gallivm: build fix

commit 42642ec0984107d82b740711f2debbf38457a06e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:38:33 2010 +0000

    llvmpipe: convert to pipe_resources

commit 7bbcb21e20cb545ef8dd5fc61d67ed931c69e813
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 22:19:30 2010 +0000

    gallivm: convert to pipe_resources

commit 88ae0d04610ca52649b42e32141a52af6d5a739b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 21:01:22 2010 +0000

    configs: build svga

commit 0e112bc69828e65085ebfaef895ecd78fe53f1c4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 21:01:17 2010 +0000

    gallium: restore PIPE_BUFFER_USAGE_CUSTOM

commit 102aca688b95c976b7178b84092fba7d041ff9d2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 21:00:41 2010 +0000

    util: more transfer helpers

commit a79f6a4a0836fc64c07f9aeec21d914474fe3649
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 20:59:36 2010 +0000

    svga: convert to use pipe_resrource

    As with others so far, a fairly shallow conversion.

commit 087fb54492fa5e3baf040c5efbf7dacd98a8849b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:38:08 2010 +0000

    brw: fix function name

commit cfc9dd707d16e06fd23b6926da3a6e2269f31dc8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:19:06 2010 +0000

    gallium: enable brw compile

commit 8a5b86d76bdd3c7de63322423f59940a4dc2ee25
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:18:50 2010 +0000

    brw: compiles with pipe_resource

commit 563ca458b548c41ca4dca559354c16ca1a80d009
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 18:18:42 2010 +0000

    i915: hook up userbuffer create

commit b5095b48247b6020e36cc942ac145c3fccbe9a19
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:20:51 2010 +0000

    i915: use helpers for is_resource_referenced

commit d5392bdc6d70002acf9c5bac0fde14ba405c4d84
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:20:38 2010 +0000

    util: helpers for is_resource_referenced

commit 2f3492a5aefbb2e745f6700d8e910ebb5cbb98cf
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:08:50 2010 +0000

    i915: remove buffer.c again

commit 1373a35b65fcc25ec6cdfea2703bbb3417de2c6d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 17:08:34 2010 +0000

    i915: add new files to scons

commit 0251612d70e57fe38e10e75915b394631d224f2c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 16:38:29 2010 +0000

    i915: compiling with pipe_resources

commit 9a0235864252929a8eedd44dbd2fe30fe54c531d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 13:51:16 2010 +0000

    gallium: remove inline_read transfer

commit a6ba315e25793e0c228d3a4ae2f8201634dc9ff0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 13:50:32 2010 +0000

    trace: get running

    Some dumping will be incorrect or disabled, but it runs without
    crashing

commit 2133f1d90aa919662a8420a0cf3b4557e6ec1afd
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 13:49:42 2010 +0000

    gallium: remove the inline_read transfer

    There aren't enough users of this to justify it.

commit bccaf1fa30881f6b4fb189a9b74fc7af79c3b481
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:30:37 2010 +0000

    identity: hook up inline transfer operations

commit e4c152a344f2f53c842b810724a2ae7cb4554f58
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:21:54 2010 +0000

    gallium: build trace and identity

commit 0b5a311db78852fa9fd021e17b5968a1e0436b49
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:21:36 2010 +0000

    gallium: add more of the transfer state to pipe_transfer

    Not really sure if recording all the arguments to the
    create_{transfer,texture,surface,etc} functions in the result of those
    calls is a great idea, but it seems we're fairly dependent on it
    throughout the code.

commit a23985c26eafe76b0a7dacc892e50cb589f211fe
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:19:46 2010 +0000

    identity: compiles with pipe_resources

commit d0d630944304c208f6dade6ef8836763ee2bc7b4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 12:13:02 2010 +0000

    trace: compiles with pipe_resources

commit a4451ea459cc8bfc915fe6aed2891b90854b6c9d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:39:50 2010 +0000

    softpipe: give userbuffers a format other than NONE

    Most mesa demos working

commit 32bb1bd4ba29884a4ecfa11c8441d33dfceabcef
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:39:21 2010 +0000

    util: correct argument order in pipe_buffer_map

commit 7e2696c06445282feb781047277b260308760a33
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:32:55 2010 +0000

    softpipe: transfer flush

commit a0543b13c042e3c1142522d9d136f16fd4cabf78
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:32:13 2010 +0000

    util: noop implementation of transfer_flush_region

commit ce418533be752dbeb164e7ff82a99483048e482b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:26:07 2010 +0000

    gallium: softpipe runs gears with pipe_resources

commit bfda4f2eb34498e4b7f3c608d30fccff6bb9651b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 11:25:48 2010 +0000

    util: get clip_tile working again

commit f5ef219c3bed62b6a0da842e675fae16268e0fbe
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:43:20 2010 +0000

    softpipe: use u_transfer helpers

commit 072957aab25affecf0702e925310e46c694a5ee4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:42:46 2010 +0000

    util: helpers for inline transfers

commit 9c45561fb0d7a52400093bcb2ce5f727fafd7777
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:42:25 2010 +0000

    util: fix typo calculating transfer box

commit f3e98fd47f36804d019a684d49ff230df3ab0cf5
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 09:25:46 2010 +0000

    st/vega: convert to pipe_resource

commit d1b7b00afc944f6499c83d676c7642115d62a62c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sun Mar 14 08:37:56 2010 +0000

    gallium: begin converting drivers to pipe_resource

    Work in progress...

commit 51c25117f5d6da1926a2be5ecc66677952a8abf0
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 20:16:27 2010 +0000

    gallium: work in progress on layering resources on top of old textures

    Helper code in an aux module to avoid rewriting all the drivers.

commit fb6764d3ce95c55aa78af2f1c8cbb17b79ce1ba2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 19:19:09 2010 +0000

    heaps of wip

commit ee6b3bc730fcdaf8da3646d62f04578ec06d36a1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 16:38:02 2010 +0000

    wip2

commit 1830880212445189fe267d615075239ed17c7cc0
Merge: 90b4045 47bfbd4
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 15:14:03 2010 +0000

    Merge branch 'gallium-sampler-view' into gallium-resources

    Conflicts:
    	src/gallium/include/pipe/p_context.h
    	src/mesa/state_tracker/st_atom_texture.c
    	src/mesa/state_tracker/st_cb_bitmap.c
    	src/mesa/state_tracker/st_cb_drawpixels.c
    	src/mesa/state_tracker/st_cb_texture.c
    	src/mesa/state_tracker/st_context.c
    	src/mesa/state_tracker/st_context.h
    	src/mesa/state_tracker/st_texture.h

commit 90b4045fbc0a093fcd04efba7e045ec259c490b8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Sat Mar 13 14:52:43 2010 +0000

    wip
2010-04-10 16:05:54 +01:00
Alex Deucher
edff2e0585 r600: add new r7xx pci ids 2010-04-09 20:20:42 -04:00
Marek Olšák
e7f1e5ca64 r300g: align the height of NPOT textures to POT
Needed by the CS checker.
2010-04-10 01:09:40 +02:00
Marek Olšák
f43c679c0b r300g: do not use tiling for scanout buffers 2010-04-10 00:20:52 +02:00
Kristian Høgsberg
5a43dbac68 glx: Support direct rendering pbuffers
We've supported indirect rendering pbuffers for a while, but not direct
rendering pbuffers.  The way we do this is by creating a hidden pixmap
and wrap that in a GLX pbuffer.  This only works when we have DRI2 on
the server, but if the server doesn't have DRI2, it won't expose configs
with pbuffer bits enabled.
2010-04-09 17:16:33 -04:00
Kristian Høgsberg
394c25133e glx: Fix config chooser logic for 'mask' matching
When matching attributes using the 'mask' matching criteria, the spec
says that

  "Only GLXFBConfigs for which the set bits of attribute include all
   the bits that are set in the requested value are
   considered. (Additional bits might be set in the attribute)."

The current test returns true if the two bit masks have bits in
common, specifically it matches even if the requested value has bits
set that are not set in the fbconfig attribute.  For example, an
application asking for

  GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT | GLX_PBUFFER_BIT,

as glxpbdemo does, will match fbconfigs that don't support pbuffer
rendering, as long as they support pixmap rendering.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-09 15:24:29 -04:00
Kristian Høgsberg
edb5253dfa glx: Fix config chooser logic for 'mask' matching
When matching attributes using the 'mask' matching criteria, the spec
says that

  "Only GLXFBConfigs for which the set bits of attribute include all
   the bits that are set in the requested value are
   considered. (Additional bits might be set in the attribute)."

The current test returns true if the two bit masks have bits in
common, specifically it matches even if the requested value has bits
set that are not set in the fbconfig attribute.  For example, an
application asking for

  GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT | GLX_PBUFFER_BIT,

as glxpbdemo does, will match fbconfigs that don't support pbuffer
rendering, as long as they support pixmap rendering.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-09 15:15:28 -04:00
Chia-I Wu
ba81b0743e Fix copyright headers.
Update the warranty disclaimer to use the more general "THE AUTHORS OR
COPYRIGHT HOLDERS".  This is done manually on files created by me.  Hope
that I do not miss anything.
2010-04-10 01:20:57 +08:00
Chia-I Wu
ad1edb053a st/egl: Fix a typo in determining the render buffer. 2010-04-10 01:19:53 +08:00
Brian Paul
7a01b13324 llvmpipe: fix transposed stencil ref / values comparison 2010-04-09 10:52:51 -06:00
Brian Paul
75b8c4a8f8 Merge branch '7.8' 2010-04-09 10:09:24 -06:00
Brian Paul
4ae2bdcb15 st/mesa: new assertions to check array indexes 2010-04-09 10:08:27 -06:00
Brian Paul
b22a00bff4 mesa: fix instruction indexing bugs
We were looping over instructions but only looking at the 0th instruction's
opcode.

Fixes fd.o bug 27566.
2010-04-09 10:03:36 -06:00
José Fonseca
c2e87d7f07 util: Fix typo in earlier commit. 2010-04-09 16:56:18 +01:00
José Fonseca
142fb27c3b util: ubyte_to_float and float_to_ubyte whenever possible.
More accurate results.

We should probably generalize these functions for more cases.
2010-04-09 16:53:07 +01:00
José Fonseca
866d22ccce util: Get all depth stencil tests passing.
Note the tests don't test all the paths, in particular stride, and
ensuring the old value is preserved.
2010-04-09 16:32:48 +01:00
José Fonseca
f9a0d1e234 util: Add missing break statement. 2010-04-09 16:32:48 +01:00
José Fonseca
7603173774 util: Use consistent symbols in pack generator. 2010-04-09 16:32:48 +01:00
José Fonseca
b1cfc195bb util: Reorder format tests -- group by format. 2010-04-09 16:32:47 +01:00
José Fonseca
d3808b1b1f util: Add dedicated depth-stencil packing/unpacking functions.
Depth-stencil manually written given that each one is very close to
be a special case.

u_format_zs.c's still untested.
2010-04-09 16:32:47 +01:00
José Fonseca
efae8f33f2 gallium/unit: Silence warnings. 2010-04-09 16:32:47 +01:00
José Fonseca
1f014a36f7 scons: Set -gstabs for C++ too. 2010-04-09 16:32:47 +01:00
Corbin Simpson
51c4068051 st/xorg: Fix thinko. 2010-04-09 06:52:18 -07:00
Ben Skeggs
54526154c5 nouveau: Import latest nouveau_class.h from renouveau
And fix nv50_screen.c to compile against the updated header.
2010-04-09 20:59:36 +10:00
Corbin Simpson
8ddb4e2c81 st/xorg: Fix bad paramf.
Should be an integer param, according to docs.
2010-04-09 03:40:11 -07:00
Corbin Simpson
d2cf1e85c8 r300g: Fill out dummy fence functions.
xorg st needs them.
2010-04-09 03:40:11 -07:00
Corbin Simpson
9c2efb071f util: Include u_debug for debug_print_format.
Caused fun linker errors on r600g.
2010-04-09 03:40:11 -07:00
Chia-I Wu
b80b817195 st/egl: Move probe interface to native_probe.h.
native.h is getting a little messy over time.
2010-04-09 17:52:37 +08:00
Chia-I Wu
f69b35fa15 st/egl: Remove pbuffer from the native interface.
A pbuffer is an EGL resource.  It does not need a native display to
create.
2010-04-09 17:52:37 +08:00
Vinson Lee
08100aa444 util: Set DXTN_LIBNAME to libtxc_dxtn.dylib on Mac OS X. 2010-04-09 00:40:15 -07:00
Eric Anholt
a3fa3fbf76 Add an implementation of gentype-only clamp(). 2010-04-08 16:08:15 -07:00
Eric Anholt
cc4ef154e6 Add builtin implementations of vector comparison functions.
Fixes CorrectFunction1.vert, glsl-fs-notequal.frag.
2010-04-08 15:35:34 -07:00
Eric Anholt
cc49cea9ea Add support for builtin gentype mix(gentype a, gentype b)
Fixes glsl-fs-mix.frag, glsl-fs-mix-constant.frag.
2010-04-08 15:10:37 -07:00
Eric Anholt
feeb43b829 Add buitlin functions for any(), all(), not(). 2010-04-08 15:02:59 -07:00
Eric Anholt
925759283a Add builtin normalize() functions.
Fixes CorrectSqizzle2.vert.
2010-04-08 14:38:32 -07:00
Eric Anholt
2a7b2b22f4 Repeat the optimization passes until we stop making progress. 2010-04-08 13:43:56 -07:00
Eric Anholt
6192434ac3 Add inlining support for array dereferences. 2010-04-08 13:42:41 -07:00
Brian Paul
21cf976ad9 docs: link to 7.8.2 release notes 2010-04-08 13:11:30 -06:00
Brian Paul
3ad9a98ec2 docs: initial 7.8.2 release notes 2010-04-08 13:11:30 -06:00
Brian Paul
ffedd28c9c progs/tests: added some debug code (disabled) 2010-04-08 13:11:29 -06:00
Brian Paul
bab6c0a035 st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) regression
Commit 1454f20a99 caused the regression.
When the vertex shader emitted both a texcoord and color we were grabbing
the wrong vertex attributes.  Fix the draw_quad() code to put texcoords
in slot[1] and color in slot[2].  That's a bit cleaner than changing
the vertex shader code.

Tested with progs/tests/zreaddraw.c
2010-04-08 13:11:29 -06:00
José Fonseca
c6781e9c78 util: Support PIPE_FORMAT_B4G4R4X4_UNORM and PIPE_FORMAT_R8G8B8X8_UNORM. 2010-04-08 19:48:02 +01:00
José Fonseca
4459a21e07 gallium: Add a couple more of D3D9 formats forgotten earlier. 2010-04-08 19:47:40 +01:00
Eric Anholt
cad9766118 Inline functions consisting of a return of an expression. 2010-04-08 11:24:06 -07:00
Li Peng
8ac7d7fa05 intel: Call intel_prepare_render() in intelClear()
Make sure we have up to date buffers before we start looking at
the tiling bits to determine how to clear.
2010-04-08 14:20:14 -04:00
José Fonseca
89ceb2f3c7 util: (Almost) universal format translation function.
Untested.
2010-04-08 19:03:41 +01:00
José Fonseca
956b2f74d8 util: Describe, implement, and test the new D3D9 color formats. 2010-04-08 19:03:41 +01:00
José Fonseca
1320017049 gallium: Add missing D3D9 color formats. 2010-04-08 19:03:40 +01:00
José Fonseca
948ac63112 util: is_array/mixed/etc is only meaningful for plain formats. 2010-04-08 19:03:40 +01:00
José Fonseca
350bbc946a util: Keep const keyword when unpacking formats. 2010-04-08 19:03:40 +01:00
José Fonseca
3f62664679 util: Reorder the code generated function so that they are grouped by format.
Makes it easier to copy and paste.
2010-04-08 19:03:40 +01:00
Li Peng
9599da3374 intel: Call intel_prepare_render() in intelClear()
Make sure we have up to date buffers before we start looking at
the tiling bits to determine how to clear.
2010-04-08 13:52:55 -04:00
Zack Rusin
074084d563 draw llvm: hook up the generated function into the draw elts path
we were only using the jited function in the linear case, now drawelts
correctly uses the same path. it results in a significant gain in
real world apps (openarena went from 23fps to 29fps)
2010-04-08 10:53:21 -04:00
José Fonseca
3ceafcf143 draw: Fix vertex buffer indexation. 2010-04-08 11:00:42 +01:00
José Fonseca
d2f8162f91 util: Don't call util_dl_close(library) when util_format_s3tc_init is successful."
Otherwise the library will be unloaded and function pointers become invalid.

This reverts commit bc2bc0306e.
2010-04-08 10:36:16 +01:00
Vinson Lee
bc2bc0306e util: util_dl_close(library) before exiting util_format_s3tc_init. 2010-04-08 00:55:16 -07:00
Vinson Lee
01ec162d53 draw llvm: Remove unnecessary header. 2010-04-08 00:30:40 -07:00
Vinson Lee
94e5bc23e7 llvmpipe: Remove unnecessary header. 2010-04-08 00:18:46 -07:00
Dave Airlie
dff50ff592 Merge remote branch 'origin/7.8'
Conflicts:
	Makefile
	configs/default
	src/mesa/main/version.h
2010-04-08 16:48:41 +10:00
Chia-I Wu
968bf9634e st/dri: Fix setTexBuffer2 with __DRI_TEXTURE_FORMAT_RGB.
When the format is __DRI_TEXTURE_FORMAT_RGB, the texture should be
treated as if there is no alpha channel.
2010-04-08 16:47:11 +10:00
Dave Airlie
4b39a0da89 texenvprogram: fix for ARB_draw_buffers.
piglit has a test called fbo-drawbuffers, this fails for me on r300g,
and fixing the texenv program to use the DATA outputs fixes it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-08 15:19:52 +10:00
Ian Romanick
b427c917ce Remove extraneous base-class constructor calls 2010-04-07 18:03:50 -07:00
Eric Anholt
fbc7c0b8f2 Make function bodies rely on the parameter variable declarations.
Previously, generating inlined function bodies was going to be
difficult, as there was no mapping between the body's declaration of
variables where parameter values were supposed to live and the
parameter variables that a caller would use in paramater setup.
Presumably this also have been a problem for actual codegen.
2010-04-07 17:23:23 -07:00
Eric Anholt
6173312d84 Make dot() take the right number of args. 2010-04-07 17:23:23 -07:00
Eric Anholt
7e78e07ddb Fix the returns of builtin functions to actually return. 2010-04-07 17:23:23 -07:00
Eric Anholt
894ea972a4 Put function bodies under function signatures, instead of flat in the parent.
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
2010-04-07 17:23:23 -07:00
Eric Anholt
f1ddca9f21 Clarify the types of various exec_list in ir.h 2010-04-07 17:23:23 -07:00
Ian Romanick
0c82465395 Treat texture rectangles as an extension that is enabled be default 2010-04-07 17:13:44 -07:00
Ian Romanick
c77b257094 Add support for GL_ARB_draw_buffers extension 2010-04-07 16:59:46 -07:00
Ian Romanick
887a8b07de Clean up error reporting in _mesa_glsl_process_extension 2010-04-07 16:57:56 -07:00
Ian Romanick
c178c74c27 Add tracking for extension based warnings
Using '#extension foo: warn' instructs the compiler to generate a
warning when some feature of the extension 'foo' is used.  This patch
adds some infrastructure needed to support that for variables.

Similar changes will be needed for types and built-in functions.
2010-04-07 16:53:54 -07:00
Ian Romanick
1799a0cd41 Emit a warning when an unknown extension is used with #extension 2010-04-07 16:49:25 -07:00
Ian Romanick
56b8b21410 Add _mesa_glsl_warning to emit warnings to the shader log 2010-04-07 16:49:25 -07:00
Ian Romanick
e701761cc8 Begin processing #extension directive
Nowhere near complete.  It just parses correctly at this point.
2010-04-07 16:49:25 -07:00
Ian Romanick
ae4c4c0795 Use _mesa_glsl_shader_target_name 2010-04-07 16:49:25 -07:00
Ian Romanick
5bfe30a02b Add utility function to get the name of a shader target 2010-04-07 16:49:25 -07:00
Ian Romanick
1b3f47fd36 Call glsl_type::get_instance correctly: the number of rows must be at least 1
This causes the following tests to pass:

    shaders/glsl-tex-mvp.vert
2010-04-07 16:49:25 -07:00
Ian Romanick
b0b8fa4885 Eat whitespace while in the PP state 2010-04-07 16:49:25 -07:00
Ian Romanick
62f62ca3b3 Partially fix comment handling in preprocessor directives.
Multi-line /* */ comments are still broken.  I think this will wait to
be fixed until we have a real preprocessor.
2010-04-07 16:49:25 -07:00
Ian Romanick
77cce649c9 Add support for bool to ir_equal and ir_nequal constant handling 2010-04-07 16:49:25 -07:00
Ian Romanick
8645a955fc Add gl_ClipDistance in fragment shader 2010-04-07 16:49:25 -07:00
Zack Rusin
821abff8c0 draw llvm: highly reduce the compilation times for draw llvm
our code resets pipe_vertex_buffer's with different offsets when rendering
vbo, meaning that we kept creating insane number of shaders even for simple
apps e.g. geartrain had 54 shaders and it was taking almost 27 seconds just to
compile them. this patch passes pipe_vertex_buffer's to the jit function and lets
it to the stride/buffer_offset computation at run time. the slowdown at runtime
is largely unnoticable but the we go from 54 shaders to 3, and from 27 seconds to less
than 1.
2010-04-07 17:50:11 -04:00
José Fonseca
40bac07f9b gallivm: Get the format translation logic write. 2010-04-07 22:17:07 +01:00
José Fonseca
2c06fa4682 util: Support fixed formats conversion. 2010-04-07 22:16:18 +01:00
José Fonseca
783e94243a util: Add copyright header to u_half.h 2010-04-07 21:00:18 +01:00
José Fonseca
f15469039a util: Remove the half typedef from p_compiler.h.
Unnecessary, and doesn't even guarantee size.
2010-04-07 21:00:05 +01:00
José Fonseca
68df294997 llvmpipe: Add missing include. 2010-04-07 20:55:31 +01:00
José Fonseca
d96e87c3c5 util: Use stubs for the dynamically loaded S3TC functions.
Loosely based on Luca Barbieri's commit
52e9b990a1.
2010-04-07 20:47:38 +01:00
José Fonseca
a46ca64562 draw: Fix MSVC build (snprintf->util_snprintf). 2010-04-07 20:41:09 +01:00
José Fonseca
ecdd6bc3e2 util: Remove u_tile.c YCbCr's.
Superseded by u_format_yuv.c. Also PIPE_FORMAT_YUYV's interpretation was
inconsistent: it was being interpreted as VYUY.
2010-04-07 19:58:18 +01:00
José Fonseca
7f9444050f util: Implement YUV and subsampled RGB format conversion. 2010-04-07 19:47:24 +01:00
Ian Romanick
8c46ed2490 Generate correct IR for do-while loops
Previously the same code was generated for a while loop and a do-while
loop.  This pulls the code that generates the conditional break into a
separate method.  This method is called either at the beginning or the
end depending on the loop type.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
2010-04-07 11:42:36 -07:00
Ian Romanick
4cf20cd37c Process ast_jump_statement into ir_loop_jump
Specifically, handle 'break' and 'continue' inside loops.

This causes the following tests to pass:

    glslparsertest/shaders/break.frag
    glslparsertest/shaders/continue.frag
2010-04-07 11:42:36 -07:00
Ian Romanick
01f8de4a87 Add dynamic cast for ir_loop 2010-04-07 11:42:36 -07:00
Ian Romanick
e9d0f265aa Begin tracking the nesting of loops and switch-statements 2010-04-07 11:42:36 -07:00
Ian Romanick
c0e76d8352 Use switch based on mode in ast_jump_statement::hir 2010-04-07 11:42:36 -07:00
Ian Romanick
d6313d7a01 Add some newlines when printing ir_loop instructions 2010-04-07 11:42:36 -07:00
Ian Romanick
9e7d010ee0 Process ast_iteration_statement into ir_loop
This causes the following tests to pass:
     glslparsertest/shaders/dowhile.frag
     glslparsertest/shaders/while.frag
     glslparsertest/shaders/while1.frag
     glslparsertest/shaders/while2.frag
2010-04-07 11:42:36 -07:00
Ian Romanick
f8e31e00b1 Add ir_loop_jump to represent 'break' and 'continue' in loops 2010-04-07 11:42:30 -07:00
Ian Romanick
fad607a9be Add ir_loop to represent loops
This touches a lot of files because everything derived from ir_visitor
has to be updated.  This is the primary disadvantage of the visitor pattern.
2010-04-07 11:41:50 -07:00
Brian Paul
78fd65fd2c draw: init draw->pt.middle.general = NULL just to be safe
This field should be null from the initial calloc() of the draw context,
but let's be safe (and improve understanding of the code).
2010-04-07 07:09:57 -06:00
José Fonseca
da17623c33 llvmpipe: Fix USE_DRAW_LLVM build. Use lp_build_engine. 2010-04-07 13:49:29 +01:00
Michel Dänzer
765dc9fc32 r300: Initialize compiler.max_temp_regs for blits.
Blits were broken since commit e41a64591b
('r300/compiler: make the max number of fragment shader temporaries
adjustable').
2010-04-07 11:21:15 +02:00
Vinson Lee
95bfd0067c draw llvm: Remove unnecessary headers. 2010-04-07 01:04:45 -07:00
Vinson Lee
1e51bbf77f gallium: Add files to Makefile.
This was missed in commit ae69f9fbf0.
New files from the gallium_draw_llvm merge were added to SCons but
not make.
2010-04-07 00:45:40 -07:00
Vinson Lee
88a0d7e1bf llvmpipe: Remove unused variable. 2010-04-06 23:48:00 -07:00
Ben Skeggs
2d606c13ff nouveau: allow multiple simultaneous maps of a pipe_transfer
I'm not entirely convinced we want this behaviour (the underlying nouveau_bo
doesn't support it either), but since certain parts of the mesa state
tracker appear to require it lets make it work for now.
2010-04-07 15:51:13 +10:00
Ben Skeggs
841b327a51 nv50: fix assertion that caused piglit texturing/texrect-many to fail 2010-04-07 15:06:59 +10:00
Zack Rusin
c60a161cc5 scons: define DRAW_LLVM if we're building it 2010-04-06 22:41:11 -04:00
Zack Rusin
1570760a97 draw llvm: disable printing of the LLVM ir 2010-04-06 22:30:22 -04:00
Marc Dietrich
0963099d5e cell: fix build
compile fix for cell driver.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-06 20:23:21 -06:00
Brian Paul
45c8909148 gallium/draw: add additional DRAW_LLVM check
Fixes build breakage.
2010-04-06 20:20:17 -06:00
Zack Rusin
ae69f9fbf0 Merge branch 'gallium_draw_llvm' 2010-04-06 20:09:08 -04:00
José Fonseca
fe130a7e5e llvmpipe: Support S3TC when util_format_s3tc_enabled is set. 2010-04-06 22:52:33 +01:00
José Fonseca
728741a3bd gallivm: Fallback to calling util_format_description::fetch_float for any format we can't code LLVM IR directly. 2010-04-06 22:52:33 +01:00
José Fonseca
306835cc0f gallivm: Move the global LLVM objects (module, engine, provider, target) into here. 2010-04-06 22:52:33 +01:00
Zack Rusin
695a029e9b llvmpipe: use a define to decide whether to use draw llvm paths
right now disabled by default
2010-04-06 17:15:03 -04:00
Zack Rusin
06bda76c08 draw llvm: disable debugging output 2010-04-06 17:14:13 -04:00
Zack Rusin
323fdd8ae5 draw llvm: implement simple pipeline caching using variants 2010-04-06 16:28:48 -04:00
Eric Anholt
b94e402cff Add some linebreaks in the ir_print_visitor of if statement bodies. 2010-04-06 12:13:02 -07:00
Eric Anholt
70b74928a2 Make constant folding descend into if statements. 2010-04-06 11:52:09 -07:00
Eric Anholt
e5a9e70cde Descend down the tree in more locations in constant folding. 2010-04-06 11:42:34 -07:00
Eric Anholt
bae5be356e Perform constant folding on array indices.
Replaces a constant var deref with a constant value in CorrectParse1.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
af18641f0a Add float/int conversion to ir_constant_expression.cpp.
Gives CorrectParse2.frag one more constant folding.
2010-04-06 11:42:34 -07:00
Eric Anholt
326c676236 Handle constant expressions using derefs of const values.
Fixes CorrectParse1.frag and makes for a ton of folding in
CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
3fff009af1 Fold constant expressions in if conditionals.
Fixes up 3 more expressions in CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
ec1949e804 Add support for =, != to ir_constant_expresion.cpp
This results in constant folding of one more expression in CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
85171c2dd8 Add ir_constant_expression.cpp support for <, >, <=, >=.
This results in folding one more constant expression in CorrectParse2.frag.
2010-04-06 11:42:34 -07:00
Eric Anholt
62735694a1 Add a constant folding optimization pass. 2010-04-06 11:42:31 -07:00
Zack Rusin
1e0bf24139 draw llvm: fix iteration for larger vertex arrays
we were trying to store the outputs starting at the same offset we
were using for the input arrays, which was writing beyond the end of
the output array.
2010-04-06 12:37:31 -04:00
Zack Rusin
de0647dbad draw llvm: iterate with the correct stop over the outputs
it's whatever the var step is (4 usually) not an unconditional 1
2010-04-06 12:07:33 -04:00
Michal Krol
859642c655 util: Respect destination stride in pipe_get_tile_swizzle(). 2010-04-06 17:20:09 +02:00
Zack Rusin
aeaf2cf18f draw llvm: fix draw arrays
we don't index within the outputs but only within the inputs
2010-04-06 11:00:35 -04:00
José Fonseca
04ea6f5dd8 util: Make half float lookup tables constant. 2010-04-06 15:38:21 +01:00
José Fonseca
05b494c101 util: Remove the hand written SRGB format support code. 2010-04-06 15:38:21 +01:00
José Fonseca
10dd0cad67 util: Support all SRGB formats.
Based on code from Brian Paul and Michal Krol.
2010-04-06 15:38:21 +01:00
Chia-I Wu
d18d0fdcd8 egl_dri2: Flush before context switch and swap buffers.
DRI does not define any callback to flush the current context.  GLX
loader simply calls glFlush.  Follow the GLX loader here.
2010-04-06 19:54:06 +08:00
Chia-I Wu
7915151f2d st/dri: Implement DRI image extension. 2010-04-06 19:32:27 +08:00
Chia-I Wu
216c76c820 progs/egl: Correctly check GL_OES_EGL_image.
The hack was added because GL_OES_EGL_image was not exported in the
extension string.
2010-04-06 18:54:23 +08:00
Chia-I Wu
2002e4d06e mesa: Add OES_EGL_image to extension list. 2010-04-06 18:01:41 +08:00
Chia-I Wu
0942ed45b3 progs/egl: Fix the blank window in pbuffer demo.
EGL requires eglSwapBuffers to be called on the current surface.
2010-04-06 13:48:59 +08:00
Chia-I Wu
f51f62e8ed progs/egl: Port drawtex and torus to eglut.
This brings the demos also to KMS and removes about 400 duplicated lines
of code.
2010-04-06 13:48:59 +08:00
Brian Paul
7d2db19fe5 st/mesa: reformatting 2010-04-05 22:19:11 -06:00
Brian Paul
489eced800 st/mesa: put fragment wpos code into separate function 2010-04-05 22:19:11 -06:00
Zack Rusin
9dd70e7b85 draw llvm: fix loop iteration and vertex header offsets
the loop was doing a NE comparison which we could have skipped if the prim
was triangles (3 verts) and our step was 4 verts. also fix offsets in conversion
to aos.
2010-04-06 00:13:20 -04:00
Chia-I Wu
848945e5d6 egl: Unbind the old context in _eglBindContext.
The last commit incorrectly moved the code under an "else".
2010-04-06 11:55:40 +08:00
Chia-I Wu
bbe459b14d egl: Fix eglMakeCurrent with different surfaces.
0a82fadcdd seems to trigger a bug in
_eglBindContext.  Rework the logics yet again.  It is simpler, and
hopefully correct this time.
2010-04-06 11:37:58 +08:00
Chia-I Wu
ffb6a8f552 st/es: Remove unnedded --whole-archive.
All public functions in the archives are either directly referenced or
indirectly referenced by _glapi_get_proc_address.  There is no need for
--whole-archive.
2010-04-06 11:19:49 +08:00
Vinson Lee
4b5d488bc2 scons: Link expat in dri builds.
Fixes this i915g error.
i915_dri.so: undefined symbol: XML_ParserCreate
2010-04-05 18:13:09 -07:00
Eric Anholt
271e199673 Add definition of gl_ClipDistance[] 2010-04-05 16:45:02 -07:00
Brian Paul
1fdedf067d mesa: added Makefile.egl to GALLIUM_FILES 2010-04-05 17:33:12 -06:00
Thierry Vignaud
7fc3a766c0 mesa: add missing file to GALLIUM_FILES
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-05 17:31:28 -06:00
Ian Romanick
63f394203a Set lower bound on size implied by whole-array assignment
When an unsized array is accessed with a constant extension index this
sets a lower bound on the allowable sizes.  When the unsized array
gets a size set due to a whole-array assignment, this size must be at
least as large as the implied lower bound.

This causes the following tests to pass:

    glslparsertest/glsl2/array-16.vert
2010-04-05 14:35:47 -07:00
Zack Rusin
1b0bab167c draw llvm: when generating the vertex_header struct adjust its name
change the name to not clash and accuretly represent the number of inputs
we store in the data member
2010-04-05 16:43:53 -04:00
Ian Romanick
63038e18ad Allow dereference of vectors and matrices with []
This causes the following tests to pass:
     glslparsertest/glsl2/matrix-11.vert
     glslparsertest/glsl2/matrix-12.vert
     glslparsertest/shaders/CorrectParse2.vert
     glslparsertest/shaders/CorrectSwizzle2.frag
2010-04-05 13:16:00 -07:00
Ian Romanick
582e292a88 docs: Update 7.8.1 release MD5 sums 2010-04-05 12:45:20 -07:00
Marek Olšák
50074ecd3a st/mesa: trivially enable GL_EXT_gpu_program_parameters 2010-04-05 19:52:16 +02:00
Marek Olšák
b05ada76a5 r300g: enforce microtiled zbuffer from X server
This should be relatively safe, I think.
2010-04-05 19:51:11 +02:00
Ian Romanick
b2deb19dc3 Set correct type for ir_dereference of a matrix or a vector 2010-04-05 10:30:15 -07:00
Brian Paul
5683d77b22 mesa: bump MESA_TINY version 2010-04-05 11:22:32 -06:00
Marek Olšák
a1f85cf689 r300g: typecast using the r300_texture function 2010-04-05 19:21:09 +02:00
Brian Paul
0e0de77f0e docs: added news item for 7.8.1 release 2010-04-05 11:12:59 -06:00
Brian Paul
659669d74c docs: add link to 7.8.1 release notes 2010-04-05 11:10:51 -06:00
Brian Paul
0eea33b069 softpipe: index the correct blend/mask state index
Need to check pipe_blend_state::independent_blend_enable to determine
which render target/index to use when checking blend enable and colormask
state.

This is part of the fix for piglit/fbo-drawbuffers
2010-04-05 11:00:54 -06:00
Ian Romanick
1ad1a51f14 docs: Add 7.8.1 release MD5 sums 2010-04-05 09:51:18 -07:00
Ian Romanick
88b7329cdd mesa: set version string to 7.8.1 2010-04-05 09:49:08 -07:00
Ian Romanick
dcaa2c6e76 Initial 7.8.1 release notes 2010-04-05 09:12:33 -07:00
Henri Verbeet
f820b263db mesa: update_arrays() depends on program state.
It uses ctx->VertexProgram._Current.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-05 09:34:31 -06:00
Brian Paul
df65e64c29 mesa: remove unused var
Fixes a coverity warnings.
2010-04-05 08:10:01 -06:00
Brian Paul
51e6c57054 i965g: change value of VERT_RESULT_PSIZ hack to avoid warnings 2010-04-05 08:01:29 -06:00
Brian Paul
557c8bb748 mesa: check for _NEW_BUFFERS for color read format queries 2010-04-05 08:01:05 -06:00
Brian Paul
3258058d3b util: added util_dl_error() 2010-04-05 07:47:23 -06:00
Ian Romanick
ee30e24f5f Merge branch '7.8' 2010-04-04 23:07:30 -07:00
Ian Romanick
42ea25cb4e Update to final names from GLX_INTEL_swap_event spec
Fixes bug #27454.
2010-04-04 23:06:01 -07:00
Marek Olšák
bba6957da3 r300g: enable OpenGL 2.1 on r3xx-r4xx chipsets 2010-04-05 07:09:46 +02:00
Marek Olšák
a955f86b31 r300g: add fallback for back stencil reference value and masks for r3xx-r4xx
This splits rendering into two passes when front and back stencil
reference value, value mask, or write mask don't match.

The advantages of doing it in the driver instead of in st are:
* SWTCL is executed just once and the resulting vertex buffer is reused
  in the second pass.
* Lower driver overhead due to the fallback being very close to
  the actual draw emission with minimum state change.
2010-04-05 07:09:46 +02:00
Marek Olšák
b71bfc4400 r300g: simplify accessing screen from context 2010-04-05 07:09:46 +02:00
Marek Olšák
32327196f7 r300g: remove some XXXs
We can't have more than 8 texcoord outputs in VS.
2010-04-05 07:09:45 +02:00
Marek Olšák
d2686cdb23 r300g: raise the number of texture units to 16 for all supported chipsets
As per Radeon 9700 Opengl Programming and Optimization Guide [1], there are
16 texture units even on the first r300 chipsets. If you think I am wrong,
feel free to propose a patch.

[1] Here's PDF: http://people.freedesktop.org/~mareko/
2010-04-05 07:09:45 +02:00
Marek Olšák
e41a64591b r300/compiler: make the max number of fragment shader temporaries adjustable 2010-04-05 07:09:45 +02:00
Marek Olšák
4e949271c2 r300g: is_npot -> uses_pitch 2010-04-05 07:09:45 +02:00
Marek Olšák
0179c5a95b r300g: enable conditional rendering also for SWTCL 2010-04-05 07:09:45 +02:00
Vinson Lee
5399c6dfa1 progs: Include X11 headers and libraries in SCons build.
Fixes Mac OS X SCons build.
2010-04-04 19:15:01 -07:00
Vinson Lee
940098e925 glut: Include X11 headers and libraries in SCons build.
Fixes Mac OS X SCons build.
2010-04-04 18:28:03 -07:00
Vinson Lee
efdd33985c glew: Include X11 headers and libraries in SCons build.
Fixes Mac OS X SCons build.
2010-04-04 18:10:20 -07:00
Brian Paul
a437601bee docs: update status of transform feedback and instanced drawing 2010-04-04 19:08:21 -06:00
Brian Paul
bf4c4479dd mesa: don't turn on GL_EXT_transform_feedback yet 2010-04-04 19:05:39 -06:00
Brian Paul
528d100b80 st/mesa: call pipe_context::draw_arrays/elements_instanced() 2010-04-04 19:05:39 -06:00
Brian Paul
3b7ac45162 mesa: implement core Mesa support for GL_ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
cf3193ad1c mesa: new validation functions for GL_ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
3258dfbbbd mesa: new extension flag for GL_EXT/ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
61b21f0c83 glapi: regenerated files for GL_ARB_draw_instanced 2010-04-04 19:05:38 -06:00
Brian Paul
736846b22f glapi: plug in ARB_draw_instanced.xml 2010-04-04 19:05:37 -06:00
Brian Paul
a4e1abd487 glapi: ARB_draw_instanced.xml file 2010-04-04 19:05:37 -06:00
Ian Romanick
4fb2daf42c Merge branch '7.8' 2010-04-04 16:54:00 -07:00
Ian Romanick
f66733e077 gl: updated glxext.h to version 27 2010-04-04 16:53:41 -07:00
Chia-I Wu
ad3575e2dd progs/egl: Add an OpenGL ES demo for EGL_OES_image_pixmap.
The demo uses a Pixmap as its drawing area, and whatever is drawn on the
pixmap will be used as a texture to draw a cube.
2010-04-04 22:07:20 +08:00
Chia-I Wu
a1aa53b2a9 st/mesa: Implement GL_OES_EGL_image driver hooks.
Use st_manager::get_egl_image to look up GLeglImageOES and implement
EGLImageTargetTexture2D and EGLImageTargetRenderbufferStorage.
2010-04-04 21:58:32 +08:00
Chia-I Wu
776dc53f62 st/egl: Implement get_egl_image hook.
This hook may be used by rendering state trackers to implement EGLImage
extensions.
2010-04-04 21:49:24 +08:00
Dave Airlie
d605b0db4d r300g: fix TFP stride override.
We should use pitch for the overriden state, fixes one half of the tfp test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-04 20:31:42 +10:00
Marek Olšák
655fe28155 r300g: add conditional rendering 2010-04-04 08:59:09 +02:00
Marek Olšák
116c99768e r300g: add r4xx fragment shader registers
In case anyone needs it, it's here.
2010-04-04 05:27:12 +02:00
Marek Olšák
6eb892cc12 r300g: do not use the c++ template keyword
It makes life for some code browsing utilites easier.
2010-04-04 03:54:09 +02:00
Marek Olšák
e0848bd903 r300g: properly setup textures from X server
The setup needs be done after querying tiling flags.
2010-04-04 02:46:12 +02:00
Vinson Lee
930838efcd util: Use GCC atomic bultins on GCC 4.1 and higher only. 2010-04-03 12:14:21 -07:00
Jeremy Huddleston
71b2f1d8e6 xdemos: Build object files first
This helps debugging on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-03 11:23:09 -07:00
Dave Airlie
4c26cdbe01 r300g: fix color tiling for buffer from X server.
The tiling setup needs a bit of work, but this should be good enough for now,
when we get buffers from the kernel we need to store their tiling properties.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-03 21:54:49 +10:00
Brian Paul
f618867645 mesa: display list support for GL_EXT_transform_feedback 2010-04-02 22:40:19 -06:00
Brian Paul
808c424b67 mesa: plug in GL_EXT_transform_feedback functions into dispatch 2010-04-02 22:40:19 -06:00
Brian Paul
d2f5d056d8 glapi: regenerated files for EXT_transform_feedback 2010-04-02 22:40:18 -06:00
Brian Paul
0101507ff0 glapi: include/build EXT_transform_feedback.xml 2010-04-02 22:40:18 -06:00
Brian Paul
9bfdd88ac2 glapi: new EXT_transform_feedback.xml file 2010-04-02 22:40:18 -06:00
Brian Paul
d661931fbc glapi: fix error message 2010-04-02 22:40:18 -06:00
Dave Airlie
073bae1ce4 r300 compiler: add target output debugging.
print the output target in the FP debug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-03 12:19:13 +10:00
Ian Romanick
0157f41e5e Propagate sizes when assigning a whole array to an unsized array 2010-04-02 17:44:39 -07:00
Ian Romanick
9d975377ca Track whether whole-arrays are assignable
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is.

This causes the following tests to pass:

    glslparsertest/glsl2/array-09.vert
    glslparsertest/glsl2/array-13.vert
2010-04-02 17:17:47 -07:00
Ian Romanick
2d946634eb Whole structures are assignable
Whole arrays are assignable in GLSL 1.20 and later, but it's not clear
how to handle that within the IR because the IR is supposed to be
shading language version agnostic.
2010-04-02 17:06:57 -07:00
José Fonseca
47e6142658 util: Revert unsolicited, untested, unreviewed, and broken changes to format support.
Not all is bad, but I'm afraid I'll have to throw the baby with the water
given they are all tied to together.
2010-04-03 00:51:19 +01:00
José Fonseca
dd194b6932 python/tests: Output test results in a format that Hudson CI can understand. 2010-04-03 00:20:58 +01:00
Ian Romanick
cb9cba20a0 Use glsl_type::element_type to get the type of array elements 2010-04-02 16:08:44 -07:00
Zack Rusin
cb31d3b5fe draw llvm: fix storing of outputs for the rest of the pipeline
there's no good way of aligning the output's, and since the vertex_header
is variable sized in the first place we need to extract elements from a vector
and store them individually into an array. this gets the basic examples working
again
2010-04-02 18:52:32 -04:00
Ian Romanick
c35bb00130 Ensure that 'in' and 'inout' formal parameters are valid lvalues
This causes the following tests to pass:

    glslparsertest/shaders/function10.frag
2010-04-02 15:51:02 -07:00
Ian Romanick
cf37c9e8da Additional void parameter checks
If there is a void parameter it must not have a name, and it must be
the only parameter.
2010-04-02 15:30:45 -07:00
Ian Romanick
45d8a70c12 Require that function formal parameters have names 2010-04-02 15:09:33 -07:00
Corbin Simpson
73cd1cf7c1 gallium/docs: Dithering might not actually do anything. 2010-04-02 14:25:38 -07:00
Corbin Simpson
21961f6e96 r300g: Expound on dithering comment. 2010-04-02 14:21:50 -07:00
Dave Airlie
f6c7b91165 r300g: make dithering work like fglrx.
From fglrx traces the dithering is never enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-03 07:03:01 +10:00
Yann Droneaud
1d11ba0ba3 gallium: fix dri_destroy_option_cache() when optionCache.info is NULL
With an Intel 855GM handled by intel_drv, there's a crash with Gallium3D
enabled DRI driver for Intel i915 (--enable-gallium-intel).
The Gallium3D driver doesn't support the 855GM as expected by
intel_drv, it failed to open the screen and give an half
initialized screen structure to dri_destroy_option_cache():
optionCache.info is NULL, so it's crashing while trying
to free array content. This patch at least fix the crash in the function.

Here's some logs of the fixed version:

[ 16274.137] LoaderOpen(/opt/mesa/lib/xorg/modules/drivers/intel_drv.so)
[ 16274.139] (II) Loading /opt/mesa/lib/xorg/modules/drivers/intel_drv.so
[ 16274.183] (II) Module intel: vendor="X.Org Foundation"
[ 16274.183]    compiled for 1.8.0, module version = 2.11.0
[ 16274.183]    Module class: X.Org Video Driver
[ 16274.183]    ABI class: X.Org Video Driver, version 7.0
[ 16274.183] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
        i810-dc100, i810e, i815, i830M, 845G, 852GM/855GM, 865G, 915G,
        E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
        965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
        4 Series, G45/G43, Q45/Q43, G41, B43, Clarkdale, Arrandale
[ 16274.382] (II) intel(0): Integrated Graphics Chipset: Intel(R) 855GME
[ 16274.382] (--) intel(0): Chipset: "852GM/855GM"
[ 16276.675] (II) intel(0): [DRI2] Setup complete
[ 16276.675] (II) intel(0): [DRI2]   DRI driver: i915
debug_get_option: GALLIUM_TRACE = (null)
debug_get_bool_option: GALLIUM_RBUG = FALSE
debug_get_bool_option: INTEL_DUMP_CMD = FALSE
i915_create_screen: unknown pci id 0x3582, cannot create screen
dri_init_screen_helper: failed to create pipe_screen
[ 16276.794] (EE) AIGLX error: Calling driver entry point failed
[ 16276.794] (EE) AIGLX: reverting to software rendering
[ 16276.794] (II) AIGLX: Screen 0 is not DRI capable
[ 16276.796] (II) AIGLX: Loaded and initialized /opt/mesa/lib/dri/swrast_dri.so
[ 16276.796] (II) GLX: Initialized DRISWRAST GL provider for screen 0

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-04-02 13:44:31 -07:00
Zack Rusin
557b75248a draw llvm: fix translation of formats with variable components 2010-04-02 15:56:34 -04:00
Ian Romanick
3f9a73d121 Make built-in gl_TexCoord available in vertex and fragment shaders 2010-04-02 11:59:57 -07:00
Ian Romanick
fe1c7ff6c6 Fix matching of integer function parameters
This causes the following tests to pass:

    glslparsertest/shaders/function10.frag
2010-04-02 11:45:06 -07:00
Eric Anholt
c2cb84e17b Add bool/int conversion as IR operations.
Fixes constructor-09.glsl and CorrectParse2.frag.
2010-04-02 11:22:41 -07:00
Eric Anholt
dc58b3f8cc Add conversion of bool to float as an IR operation to match int to float. 2010-04-02 11:22:41 -07:00
Eric Anholt
106d122318 Add PASS / FAIL annotations to tests missing them.
This tricked my import of the tests into piglit.
2010-04-02 11:22:41 -07:00
Eric Anholt
3f15150932 Test that invalid quailfiers aren't used on variables in GLSL 1.10. 2010-04-02 11:22:41 -07:00
Eric Anholt
c7da28b4be Allow array dereferences to be considered as lvalues.
Fixes glsl-vs-arrays.vert and glsl-vs-mov-after-deref.vert.
Regresses parser3.frag which was failing for the wrong reason.
2010-04-02 11:22:41 -07:00
Eric Anholt
5150c567a0 Test for the type being different in parameter_lists_match.
Fixes CorrectFuncOverload.frag.
2010-04-02 11:22:41 -07:00
Eric Anholt
d251b92f8d Add some more operations to ir_constant_expression.cpp. 2010-04-02 11:22:41 -07:00
Eric Anholt
d98da9738e Make ir_constant_expression.cpp support multi-component types. 2010-04-02 11:22:41 -07:00
Eric Anholt
160d092507 Simplify ir_constant_expression.cpp by factoring operand computation out. 2010-04-02 11:22:41 -07:00
Eric Anholt
90b7825b0e Reject non-float varyings.
Fixes varying2.frag.
2010-04-02 11:22:41 -07:00
Eric Anholt
aeab105342 Remove fake ir_binop_logic_not. I think you meant ir_unop_logic_not. 2010-04-02 11:22:41 -07:00
Eric Anholt
528bb85359 Handle logic not in constant expression evaluation. 2010-04-02 11:22:41 -07:00
Eric Anholt
ebbf14b980 Fix error handling of logic operators.
They were always throwing a type error because type wasn't being set.
2010-04-02 11:22:41 -07:00
Eric Anholt
183d8c6394 Emit errors for unfinished ast_to_hir expression operations. 2010-04-02 11:22:41 -07:00
Eric Anholt
a5827fe8d0 Fix ast_logic_not handling to be unary, not binary. 2010-04-02 11:22:41 -07:00
Eric Anholt
65e1a7ac6a Add errors for type results of other expressions. 2010-04-02 11:22:41 -07:00
Eric Anholt
a13bb1490c Emit errors from failure in arithmetic_result_type.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-02 11:22:35 -07:00
Eric Anholt
a576f9d84c Start trying to fill in a few bits of ir_constant_expression.cpp
This makes a little progress on CorrectParse2.frag.
2010-04-02 11:05:16 -07:00
Eric Anholt
307c71bf24 Compute the constant value of a constant initializer.
Fixes constFunc.frag.
2010-04-02 11:05:16 -07:00
Eric Anholt
ac3af37d27 Allow initializers of constant values to succeed.
This regresses constFunc.frag, but that's just unexpectedly passing
because of the FINISHME just above.
2010-04-02 11:05:16 -07:00
Eric Anholt
068c80cfe0 Don't create a parameter declaration for a (void) parameter.
Fixes segfaults in a shader consisting of just:

    void main(void) { }

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-02 11:05:16 -07:00
Ian Romanick
03d3f3ab71 Remove ast_node::type
It isn't a type (is was enum specifying the kind of node), it was
unused, and it was easily confused with actual type fields.  Kill with fire.
2010-04-02 11:05:16 -07:00
Brian Paul
bc50336b6a llvmpipe: limit max texture size to 2Kx2K for now
MAXWIDTH/HEIGHT were 2048 but the max texture size was 4096.
This caused a crash if a 4Kx4K texture was created and rendered to.
See comment about max framebuffer size in lp_scene.h.

Also added assertions to catch this inconsistancy in the future.
2010-04-02 09:20:05 -06:00
Vinson Lee
82e289d355 gallivm: Add fallthrough comment at end of case statement.
The code is correct. Tell Coverity that the fallthrough case is
intentional.
2010-04-02 01:16:13 -07:00
Vinson Lee
c87e6e50ee progs/gallium/unit: Silence uninitialized variable warnings. 2010-04-02 01:08:31 -07:00
Vinson Lee
67776f66c9 glx: Fix compilation errors on non-GLX_DIRECT_RENDERING builds.
Add ifdef guards around variables of types defined only for
GLX_DIRECT_RENDERING.
2010-04-02 00:12:59 -07:00
Luca Barbieri
2d65a7caf9 gallium/util: print \n after DXTn printf 2010-04-02 07:33:12 +02:00
Luca Barbieri
f50247c9aa softpipe: remove S3TC init, since it's done on-demand now 2010-04-02 07:33:12 +02:00
Vinson Lee
36ed9a7f13 progs/gallium/unit: Move declaration before code.
Fixes SCons build.
2010-04-01 22:29:23 -07:00
Brian Paul
3e1a3923f4 glsl: fix bad return value in link_transform_feedback() 2010-04-01 22:32:46 -06:00
Brian Paul
e47d7e8790 gallium/util: remove extraneous semicolon 2010-04-01 22:19:52 -06:00
Brian Paul
361b179720 gallium: remove old comment about return values 2010-04-01 22:17:14 -06:00
Brian Paul
30b9ead229 glsl: remove obsolete comment 2010-04-01 22:17:14 -06:00
Brian Paul
107c72f355 glsl: do extra link checking for transform feedback 2010-04-01 22:17:14 -06:00
Brian Paul
50a75a0b4a docs: update GL3 / GL_ARB_fragment_coord_conventions status 2010-04-01 22:17:14 -06:00
Brian Paul
3100f31b74 mesa: minor fixes in _mesa_GetTransformFeedbackVarying() 2010-04-01 22:17:14 -06:00
Brian Paul
3b49437372 glsl: append built-in, used varying vars to the varying vars list 2010-04-01 22:17:14 -06:00
Brian Paul
1a14866689 mesa: make _mesa_copy_string() non-static 2010-04-01 22:17:13 -06:00
Brian Paul
038aba1f08 glsl: pass datatype to _mesa_add_varying()
Will be needed later for transform feedback support.
2010-04-01 22:17:13 -06:00
Brian Paul
ee91c1e367 glsl: add more vertex/fragment output info helpers 2010-04-01 22:17:13 -06:00
Luca Barbieri
2a090ae80a gallium/util: revert util_format_init addition
Putting calls to util_format_init all over the codebase is infeasible.

Instead, half float tables are pregenerated, and the s3tc library is
loaded on demand.

I believe this is a solution that combines performance, cleanliness,
flexibility and portability.
2010-04-02 06:16:30 +02:00
Luca Barbieri
5126683e3b gallium/util: add util_format_is_supported to check for pack/unpack
This improves the code by making it more readable, and removes
special knowledge of S3TC and other formats from softpipe.
2010-04-02 06:16:30 +02:00
Luca Barbieri
52e9b990a1 gallium/util: load s3tc on demand
This changes the S3TC function pointers to be initialized to stubs
that load the S3TC library and then delegate to the real functions.

If the S3TC library fails to load, the function pointers are replaced
with a "nop" function.

The code is also changed to attempt to load the library only one time.c

Note that unlike checking for a flag, this method has no performance
cost at all.

The use of the "nop" functions also allows to avoid most checks, that
are only preserved when the function does non-trivial work.
2010-04-02 06:16:30 +02:00
Luca Barbieri
6259264c57 progs/gallium: add unit test for u_half 2010-04-02 06:16:30 +02:00
Luca Barbieri
c476305cde gallium/util: pregenerate half float tables
This solution avoids the issue of how to run the initializers and
also allows those pages (and the parts of them in processor caches)
to be shared between multiple processes.

The drawback is slightly higher library size.
2010-04-02 06:16:18 +02:00
Chia-I Wu
154d9242de st/vega: Do not depend on libm.
This fixes the "no rule to make target -lm" error on darwin, reported by
Jeremy Huddleston.
2010-04-02 10:32:36 +08:00
Chia-I Wu
2ae66e9b97 st/egl: Add a missing break.
The swtich in egl_g3d_st_framebuffer_validate misses a break.
2010-04-02 10:20:24 +08:00
Chia-I Wu
c36d15d158 progs/egl: Update .gitignore. 2010-04-02 10:03:31 +08:00
Chia-I Wu
1054f22e48 progs/egl: Link to eglut first.
This moves eglut before EGL so that the symbols can be resolved.
2010-04-02 10:01:00 +08:00
Vinson Lee
87275e8fab gallium/util: s/inline/INLINE/
Fixes MSVC build.
2010-04-01 18:50:31 -07:00
Ian Romanick
b8a21cc6df Track max accessed array element, reject additional out-of-bounds accesses
For unsized arrays, we can't flag out-of-bounds accesses until the
array is redeclared with a size.  Track the maximum accessed element
and generate an error if the declaration specifies a size that would
cause that access to be out-of-bounds.

This causes the following tests to pass:

    glslparsertest/shaders/array10.frag
2010-04-01 18:35:08 -07:00
Ian Romanick
27e3cf8c0d Begin processing ast_array_index nodes
This causes the following tests to pass:

    glslparsertest/shaders/parser3.frag
    glslparsertest/shaders/varying3.frag (also generates spurious error)
2010-04-01 18:34:56 -07:00
Ian Romanick
63af4b0e99 Fix type handling in ir_dereference array dereference constructor 2010-04-01 18:02:48 -07:00
Luca Barbieri
cbf4097b8d nv50: call util_format_init
Needed to fetch static vertex attributes.
2010-04-02 02:36:59 +02:00
Luca Barbieri
aee5bb5b8a gallium/util: add util_format_init that inits s3tc and util_half
Switch from auto-init to explicit init for util_half per Brian Paul's
indication.

NOTE: this is probably broken because not enough things call util_format_init.
Will be fixed shortly
2010-04-02 02:31:43 +02:00
Jesse Barnes
2b4d8616f5 GLX/DRI2: pass GLX drawable ID to dri2InvalidateBuffers
The IDs will be the same in the case where an X window is used directly
as a GLX drawable, but will fail if a new GLX drawable is created
explicitly, as with glxgears_fbconfig.

Fixes fdo bug #27190.
2010-04-01 17:29:19 -07:00
Ian Romanick
a4f308f066 Allow unsized arrays to be redeclared with a size
Test glslparsertest/shaders/array11.frag now passes for the right reason.
2010-04-01 17:25:11 -07:00
Ian Romanick
00e517616b Add glsl_type::element_type and glsl_type::array_size queries
The former gets the type of elements in an array, and the later gets
the declared size, if any, of the array.
2010-04-01 17:17:34 -07:00
Jeremy Huddleston
115203281c Revert accidental commits from the xquartz tree
This reverts commit 9aadc793f3.
This reverts commit 69ea4e7718.
This reverts commit dbe8b01393.
This reverts commit 23215ef4d6.
This reverts commit 9495e37030.
This reverts commit 0594cf7088.
This reverts commit 86a7978d37.
This reverts commit 437902ce97.
2010-04-01 17:01:51 -07:00
Luca Barbieri
ecaaf8c15f gallium/util: add one-time initialization helper 2010-04-02 02:01:25 +02:00
Zack Rusin
ab5c097387 draw llvm: a lot better storing implementation 2010-04-01 18:58:51 -04:00
Luca Barbieri
3040462c10 gallium/util: use #pragma section instead of #pragma data_seg
They apparently both declare the section, but #pragma data_seg
also puts all subsequent definitions in the section, which is
undesirable.

This should be the correct solution, and is actually used by the
reference I cited (but I forgot to do it in my code).

Untested, let me know if it doesn't work.
2010-04-02 00:48:27 +02:00
Luca Barbieri
6c5f444f59 gallium/util: reindent u_half.c and u_half.h with Mesa coding style
Sorry, forgout about that.
2010-04-02 00:48:27 +02:00
Luca Barbieri
7bb54c99a4 Revert "util: Init half-float tables on demand."
This reverts commit 950300eb25.
2010-04-02 00:47:11 +02:00
Dan Nicholson
e40fce13e1 progs: Fix linking of Xlib demos for non-autoconf builds
The Xlib demos were fixed to use $(X11_LIBS) so that configure could
detect the proper directory to link the library from, but this broke
the non-autoconf builds. Give X11_LIBS a default value to fallback on.
2010-04-01 15:03:33 -07:00
Corbin Simpson
950300eb25 util: Init half-float tables on demand.
Gets rid of unnecessary delays on startup and compiler-specific hax.
2010-04-01 14:41:18 -07:00
Jeremy Huddleston
9aadc793f3 apple: Don't build gallium
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:33:48 -07:00
Jeremy Huddleston
69ea4e7718 apple: Use mesa gl.h rather than generating one.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-01 12:33:47 -07:00
Jeremy Huddleston
dbe8b01393 apple: Integrate our libGL into the existing build system better
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:33:47 -07:00
Jeremy Huddleston
23215ef4d6 apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:33:46 -07:00
Jeremy Huddleston
9495e37030 apple: Remove duplicate headers that already exist in mesa.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-01 12:33:46 -07:00
Jeremy Huddleston
0594cf7088 apple: Initial import of libGL for OSX from AppleSGLX svn repository.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:33:45 -07:00
Jeremy Huddleston
86a7978d37 xdemos: Build object files first
This helps debugging on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:33:39 -07:00
Jeremy Huddleston
437902ce97 xdemos: Fix a build failure for non-autoconf configs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:14:45 -07:00
José Fonseca
7e1aceaf0a llvmpipe: Support sampling from PIPE_FORMAT_R32_FLOAT. 2010-04-01 19:01:46 +01:00
Michal Krol
13d2f3c738 util: Declare .CRT$XCU data segment. 2010-04-01 19:25:25 +02:00
Michal Krol
8c519e5f87 scons: Remove `util/u_gctors.cpp'. 2010-04-01 19:06:05 +02:00
Luca Barbieri
4edffe026e gallium/util: rewrite global constructor system for half floats (GCC/MSVC only!)
NOTE: this commit will cause Gallium to fail to build on any compiler
      except GCC, the Microsoft C compiler and compatible compilers that
      claim to be one of those.

This commit removes the u_gctors.cpp mechanism, in favor of using
compiler-specific syntax to add global constructors from C files.

This solves the problem of u_gctors.o not being pulled from static
libraries and avoids using C++.

However, it needs compiler-specific support for every compiler.

The Microsoft C compiler support has not been tested.
2010-04-01 18:52:02 +02:00
José Fonseca
8f38135e28 llvmpipe: Support sampling from signed and mixed siged formats. 2010-04-01 17:46:59 +01:00
José Fonseca
675fcb6cae python/tests: We're using a rgba8 rendertarget so sample only in the [0, 1] range. 2010-04-01 17:46:59 +01:00
José Fonseca
f14c5adbc7 st/python: Allow to sample only in the [0,1] range. 2010-04-01 17:46:59 +01:00
José Fonseca
811e602954 python/tests: Several cleanups. 2010-04-01 17:46:59 +01:00
José Fonseca
e011272fa3 st/python: Always use softpipe as reference driver. 2010-04-01 17:46:58 +01:00
Luca Barbieri
38afd1e445 gallium/util: add copyright header to u_half.c 2010-04-01 17:31:31 +02:00
Chia-I Wu
a49db89326 Update DEMO_FILES for demos using EGL.
Reflect the recent addtion of eglut and reorganization of the EGL demos.
This helps remove ~2k lines of duplicated code

$ git diff --shortstat -M 57cc1db87b
 18 files changed, 298 insertions(+), 2178 deletions(-)
2010-04-01 22:29:48 +08:00
Chia-I Wu
532b7400fd progs/egl: Port OpenVG lion and sp to eglut. 2010-04-01 22:25:50 +08:00
Chia-I Wu
7b48d88407 progs/egl: Port ES1 gears to eglut.
As gears in the last demo under "screen" subdirectory, this also removes
the directory.
2010-04-01 22:25:49 +08:00
Chia-I Wu
dd7276f494 progs/egl: Port ES1 tri to eglut.
This also removes EGL_MESA_screen_surface version of ES1 tri as eglut
supports the extension.
2010-04-01 22:25:49 +08:00
Chia-I Wu
765b30849c progs/egl: Replace egltri by xegl_tri.
With the switch to eglut, xegl_tri supports both X11 and
EGL_MESA_screen_surface.  Have it replace egltri.
2010-04-01 22:25:49 +08:00
Chia-I Wu
02551cab47 progs/egl: Porg xegl_tri to eglut. 2010-04-01 22:25:49 +08:00
Chia-I Wu
589f6740ea progs/egl: Port eglgears to eglut. 2010-04-01 22:25:49 +08:00
Chia-I Wu
57cc1db87b progs/egl: Add eglut.
eglut is a simple library with GLUT-like API.  It is intended to be used
by simple EGL demos.
2010-04-01 22:25:48 +08:00
Chia-I Wu
fc3ddd4b56 progs/openvg: Move OpenVG demos to a subdirectory of progs/egl.
That is, move

  progs/openvg/demos to progs/egl/openvg,
  progs/openvg/trivial to progs/egl/openvg/trivial.
2010-04-01 22:25:48 +08:00
Chia-I Wu
7f231cab2b progs/es: Move OpenGL ES demos to subdirectories of progs/egl.
Move

  progs/es1/xegl -> progs/egl/opengles1,
  progs/es1/screen -> progs/egl/opengles1/screen,
  progs/es2/xegl -> progs/egl/opengles2.
2010-04-01 22:25:48 +08:00
Chia-I Wu
c727ef0108 progs/egl: Move demos a level deeper.
Move the demos to "opengl" subdirectory.
2010-04-01 22:25:48 +08:00
José Fonseca
2da7ef077a llvmpipe: More tweaks to the supported texture formats. 2010-04-01 15:16:26 +01:00
José Fonseca
6b1a8e0f87 gallium/unit: Invoke util_half_init_tables().
half float formats now pass the tests.
2010-04-01 15:15:57 +01:00
José Fonseca
89034b8ae7 util: Declare util_half_init_tables only once. 2010-04-01 15:15:28 +01:00
José Fonseca
982d36667d util: Use u_math.h's union fi instead of redefining it. 2010-04-01 15:11:05 +01:00
José Fonseca
08eb07bc83 util: Add support for other DXTn RGBA formats. 2010-04-01 15:07:14 +01:00
José Fonseca
8548efbe1d util: Get DXT1_RGB format working correctly. 2010-04-01 14:43:35 +01:00
José Fonseca
ca6aacf842 util: Add test case for PIPE_FORMAT_DXT1_RGB. 2010-04-01 13:34:24 +01:00
José Fonseca
9899ebd2fc llvmpipe: Fix build... 2010-04-01 13:20:00 +01:00
José Fonseca
d099554492 util: Allow to have block format test cases 2010-04-01 13:12:43 +01:00
Michal Krol
943408533d util: Generate correct format conversions for half floats. 2010-04-01 13:56:03 +02:00
Michal Krol
b7bca4b28c util: Use u_half to perform half <--> float conversions. 2010-04-01 13:33:08 +02:00
Michal Krol
5a359df219 gallium: Integrate util_half with scons. 2010-04-01 13:33:08 +02:00
Luca Barbieri
3ff175d6de gallium/util: add fast half float conversion functions
This adds a fast half float conversion facility to Gallium.

Mesa already contains such a facility, but using a much worse algorithm.

This one is an implementation of
www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf
and uses a branch-less algorithm with some lookup tables small enough
to fit in the L1 cache.

Ideally, Mesa should start using these functions too, but I'm not sure
how to arrange that with the current build system.

A new "u_gctors.cpp" is added that defines a global C++ constructor
allowing to initialize to conversion lookup tables at library init.
2010-04-01 13:33:07 +02:00
José Fonseca
110e039d0d gallium/unit: Install test in build/xxx/bin 2010-04-01 11:52:54 +01:00
José Fonseca
f706f12bbf util: Add half float test cases. 2010-04-01 11:52:00 +01:00
José Fonseca
898ddd6b00 llvmpipe: Fix (un)swizzling, broken due to use of VOID channels. 2010-04-01 11:31:27 +01:00
Vinson Lee
16f568a183 glx: Fix compilation errors on non-GLX_DIRECT_RENDERING builds.
driContext field for __GLXcontextRec struct is only defined if
GLX_DIRECT_RENDERING is set.
2010-04-01 00:10:28 -07:00
Vinson Lee
bef912abd3 mesa: Remove unnecessary header. 2010-03-31 23:44:29 -07:00
Vinson Lee
e6be593fbf r300g: Remove unnecessary header. 2010-03-31 23:36:06 -07:00
Luca Barbieri
7326851757 util/format: fix big endian compilation by not trying to byteswap single bytes
Conceivably, we could also have a dummy util_bswap8, but it seems better
to not emit it in the first place.
2010-04-01 06:23:30 +02:00
Zack Rusin
b6d052e4fd Merge remote branch 'origin/master' into gallium_draw_llvm 2010-03-31 22:16:09 -04:00
Zack Rusin
ae5487d427 draw llvm: fix iteration over buffers
fetching was converting garbage
2010-03-31 22:15:12 -04:00
Zack Rusin
2fb655d1db gallivm: convert floats to doubles
printf can't handle floats, convert them to doubles so that we can
actually print floats.
2010-03-31 21:30:37 -04:00
Kenneth Graunke
ebfdef7a83 Set source locations on AST nodes so error messages print locations.
I haven't verified that these are all correct, but it's still a lot
better than not having anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-03-31 18:26:27 -07:00
Ian Romanick
92318a9479 Add ast_function::hir
ast_function::hir consists of bits pulled out of
ast_function_definition::hir.  In fact, the later uses the former to
do a lot of its processing.  Several class private data fields were
added to ast_function to facilitate communicate between the two.

This causes the following tests to pass:

    glslparsertest/shaders/CorrectModule.frag

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/function9.frag
    glslparsertest/shaders/function10.frag
2010-03-31 18:23:21 -07:00
Ian Romanick
acce380a3f Fix exec_list::move_nodes_to when the source list is empty 2010-03-31 18:15:50 -07:00
Ian Romanick
e29a585989 Use ir_variable::clone to copy parameters to the function body
Several other code movements were also done.  This partitions this
function into two halves.  The first half processes the prototype
part, and the second have processes the actual function definition.
The coming patch series will parition ast_function_definition::hir
into (at least) two separate functions.
2010-03-31 17:54:26 -07:00
Ian Romanick
2d394d4877 Add ir_variable::clone 2010-03-31 17:52:44 -07:00
Ian Romanick
25711a85c2 Minor cleanups in ast_function_definition::hir 2010-03-31 17:43:33 -07:00
Marek Olšák
2ab7375572 r300g: add RGBA16F colorbuffer support
Disabled by default due to unresolved IP issues.
2010-04-01 02:21:06 +02:00
Marek Olšák
3252651fb2 r300g: add RGTC texture support
The CS checker already knows about this.
2010-04-01 02:14:52 +02:00
Ian Romanick
00aa173c9c Generate array constructor calls 2010-03-31 16:48:48 -07:00
Ian Romanick
0f0ea58264 Add ir_function_signature::function_name 2010-03-31 16:44:12 -07:00
Ian Romanick
a4775823b0 Make ir_function::signatures private 2010-03-31 16:40:58 -07:00
Ian Romanick
95cd6cc195 Add ir_function::iterator to iterate over function signatures 2010-03-31 16:40:26 -07:00
Ian Romanick
6a15d5b514 Use ir_function::add_signature to create link between function and signature
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-31 16:37:10 -07:00
Ian Romanick
4ef183e51d Add glsl_type::generate_constructor_prototype
Generates a symbol table entry and the IR approximation of a prototype for a
type's constructor.  Currently only arrays are supported.
2010-03-31 16:30:56 -07:00
Ian Romanick
68515ee6c2 Refactor parts of match_function_by_name into process_parameters and process_call
These will be used in the functions that implement calls to array constructors.
2010-03-31 16:28:51 -07:00
Ian Romanick
b6326abb85 Reject array constructor calls in GLSL 1.10 2010-03-31 16:25:21 -07:00
Ian Romanick
3e0ef5f81b Use ast_type_specifier::glsl_type to get the type of a constructor
This is the first baby step towards getting array constructors working.
2010-03-31 16:22:56 -07:00
Ian Romanick
d612a127cc Move type_specifier_to_glsl_type to ast_type_specifier::glsl_type
This make is easily accessible from other modules.
2010-03-31 16:22:06 -07:00
Ian Romanick
615adcda8a More array declaration tests 2010-03-31 16:16:54 -07:00
Ian Romanick
299ed08a68 Fix big dumbness in glsl_type::get_array_instance
hash_table_insert needs to keep the key so that it compare keys on a
following hash_table_find call.  Since key was allocated on the stack,
it disappeared out from under the hash table.
2010-03-31 16:13:38 -07:00
Marek Olšák
39e116e3a0 r300g: format handling cleanup 2010-04-01 01:13:26 +02:00
José Fonseca
f45d43a17f softpipe: Use S3TC when avaiilable, 2010-03-31 22:47:11 +01:00
José Fonseca
9388ce4191 util: Hook into libtxc_dxtn.so (WIP). 2010-03-31 22:46:42 +01:00
Ian Romanick
0bf3810165 glsl_type array constructor generate a real name for the type 2010-03-31 14:37:42 -07:00
José Fonseca
b5d073b39d llvmpipe: Don't call unused generate_clamp(). 2010-03-31 21:37:57 +01:00
José Fonseca
36e92a0494 libgl-xlib: Fix missing X11 symbols. 2010-03-31 21:27:47 +01:00
José Fonseca
018aae950d util: Make the accessors bidimensional again.
Otherwise there's no way to unpack blocks with height >1
2010-03-31 21:27:47 +01:00
Eric Anholt
0ed6125725 Test that const declarations include initializers.
Fixes dataType6.frag, and also array2.frag for an unexpected but valid
reason.
2010-03-31 13:17:23 -07:00
Ian Romanick
e0800062da Reject declarations with 'in' or 'out' qualifiers
'in' and 'out' can only be used in function parameter lists or at
global scope (1.30 and later).  This change enforces this.
2010-03-31 13:15:23 -07:00
Ian Romanick
a705d65ccd Add 'in' to some parameters of the function
This goes along with the qualifier-?? tests.
2010-03-31 13:14:37 -07:00
Ian Romanick
d8a2133887 Add some variable declaration qualifier tests 2010-03-31 13:13:12 -07:00
Ian Romanick
d8065d86e8 Fix comment bug and printf bug in previous commit 2010-03-31 13:03:56 -07:00
Michal Krol
b8012643e1 util: First stab at half-float conversion. 2010-03-31 21:55:31 +02:00
Ian Romanick
b168e53452 Require that 'uniform' and 'varying' variables be declared at global scope
This causes the following tests to pass:

    glslparsertest/shaders/uniform.frag
    glslparsertest/shaders/varying.frag
2010-03-31 12:31:18 -07:00
Ian Romanick
e1c1a3f3bd Slightly refector checks for declarations that must be at global scope 2010-03-31 12:26:03 -07:00
José Fonseca
329814c6ee util: Describe PIPE_FORMAT_NONE as PIPE_FORMAT_R8_USCALED.
Avoids the need to special case PIPE_FORMAT_NONE so often.

Conflicts:

	src/gallium/auxiliary/util/u_format_table.py
2010-03-31 20:19:14 +01:00
Eric Anholt
b82c0c31ae Implement logical operators.
Fixes parser9.frag.
2010-03-31 09:17:39 -10:00
Eric Anholt
b97ee2e260 Test that variable names don't use the reserved gl_ prefix.
Fixes identifier2.frag.
2010-03-31 09:17:35 -10:00
José Fonseca
9fcf2b87b3 util: Silence pointer to integer size mismatch errors. 2010-03-31 20:16:15 +01:00
José Fonseca
69895725cf util: Add callback to fetch a single pixel. 2010-03-31 20:15:17 +01:00
José Fonseca
3200e70858 python/tests: Read the number of tests to execute from command line. 2010-03-31 20:05:10 +01:00
José Fonseca
96548d80e5 mesa: Use a consistent name of the external s3tc library for all windows compilers. 2010-03-31 19:53:25 +01:00
José Fonseca
93eee0537f scons: Force to consider the util/u_format_pack.py for util/u_format_table.c. 2010-03-31 19:43:57 +01:00
José Fonseca
cf5cd836de scons: Don't always include/links X11 headers/libs.
Move it into a separate tool.

TODO: Needs to be "tooled" in each SConscript that uses it.
2010-03-31 18:40:10 +01:00
José Fonseca
6047c89a23 scons: Don't always link expat.
Only needed for DRI. Should be linked in DRI specific subdirectories.
2010-03-31 18:38:23 +01:00
José Fonseca
e1c1911435 llvmpipe: Disable threads by default on embedded. 2010-03-31 18:38:12 +01:00
Kurt Daverman
730cd1baaa os: Temporarily use posix thread for embedded too. 2010-03-31 18:38:07 +01:00
José Fonseca
711f6428bc scons: Allow any toolchain to be specified in the command line. 2010-03-31 18:37:38 +01:00
José Fonseca
f1f6370eb4 util: Remove the hand written u_tile.c functions for the ones that are code generated correctly.
Not that the code generated are any better, but to quickly detect any regression
in the code generated ones from now on.
2010-03-31 17:31:14 +01:00
José Fonseca
c5d4a44f44 util: Use u_format_pack.py's code instead of u_format_access.py. 2010-03-31 17:31:14 +01:00
José Fonseca
8e833c7988 llvmpipe: Don't rely on u_format_access.py 2010-03-31 17:30:12 +01:00
Roland Scheidegger
d97f6963ae Merge branch 'gallium-new-formats'
Conflicts:
	src/gallium/auxiliary/util/u_format.csv
	src/gallium/auxiliary/util/u_format_access.py
	src/gallium/auxiliary/util/u_format_pack.py
2010-03-31 16:57:05 +02:00
José Fonseca
96bf4aff5b util: Put the format pack/unpack functions in the description table. 2010-03-31 15:32:16 +01:00
José Fonseca
e245ca74e1 util: Make pack/unpack operate on spans. 2010-03-31 15:32:16 +01:00
Ben Skeggs
e24f4378a1 st/mesa: use BITFIELD64_BIT to access shader OutputsWritten in more places 2010-03-31 23:34:42 +10:00
Ben Skeggs
b46750d601 st/mesa: use BITFIELD64_BIT to access shader OutputsWritten in more places 2010-03-31 23:34:30 +10:00
José Fonseca
325d55303d util: Make util_format_xxx_pack_xxx take pointer as arguments. 2010-03-31 14:31:29 +01:00
José Fonseca
bce109c944 util: Fix PIPE_FORMAT_B5G5R5X1_UNORM test case. 2010-03-31 14:28:54 +01:00
José Fonseca
338b9d71df util: Use VOID type for X channels in format descriptions. 2010-03-31 14:28:34 +01:00
José Fonseca
d0258ca59d python/tests: Run trhough tests randomly. 2010-03-31 14:05:55 +01:00
José Fonseca
213e6584ed gallivm: Fix USCALED translation. Minor Cleanups. 2010-03-31 14:05:21 +01:00
José Fonseca
ead8f82eeb llvmpipe: More accurate format capability exporting. 2010-03-31 14:00:46 +01:00
José Fonseca
aa364d091e llvmpipe: Drop the aos format conversion.
It's unused and incomplete. Still in git history if necessary in future.
2010-03-31 13:59:59 +01:00
José Fonseca
7a26c875a9 util: Generalize lp_format_is_rgba8 into util_format_is_rgba8_variant. 2010-03-31 13:55:12 +01:00
José Fonseca
e566046efc python/tests: Rename test name.
We only test blitting from a surface -- we don't test any sampler state.
2010-03-31 13:28:36 +01:00
José Fonseca
6de8f86ab4 python/tests: Test all existing gallium formats. 2010-03-31 13:27:08 +01:00
José Fonseca
aae63a7109 python/tests: Speed up the tests by reusing the same pipe context. 2010-03-31 13:12:24 +01:00
José Fonseca
fceee46022 python/tests: Get the tests running again. 2010-03-31 13:12:24 +01:00
José Fonseca
52b4691518 st/python: Generate binding for u_format utility functions too. 2010-03-31 13:12:24 +01:00
Eric Anholt
b980207707 Test that discard only appears in the fragment shader.
Fixes fragmentOnly4.vert.
2010-03-30 23:40:14 -10:00
Eric Anholt
174cc03edc Test that main doesn't take any parameters.
Fixes main2.vert.
2010-03-30 23:37:51 -10:00
Eric Anholt
aad7c77937 Test that a non-void function returns a value. 2010-03-30 23:30:11 -10:00
Eric Anholt
ab79d4ec6e Test that a void function doesn't return a value.
Fixes function1.frag.
2010-03-30 23:28:17 -10:00
Vinson Lee
f2463eaccf i965g: Fix assertion that was always true.
surface_format field is a 9-bit field and the value of
BRW_SURFACEFORMAT_INVALID exceeds 9 bits.
2010-03-30 23:46:51 -07:00
Vinson Lee
5123e33863 st/dri: Remove unnecessary header. 2010-03-30 23:35:32 -07:00
Vinson Lee
9b6285c052 identity: Remove unnecessary header. 2010-03-30 22:42:45 -07:00
Vinson Lee
91454fb94d st/dri: Remove unnecessary header. 2010-03-30 22:35:23 -07:00
Eric Anholt
794ea61006 Fix unused variable warning. 2010-03-30 18:31:32 -10:00
Brian Paul
539d03ff36 mesa: added glGet queries for transform_feedback 2010-03-30 20:04:05 -06:00
Brian Paul
86a1ea31ed mesa: added glEnable/Disable state for transform feedback 2010-03-30 20:04:04 -06:00
Brian Paul
423860ac78 mesa: add new query/buffer targets for transform feedback 2010-03-30 20:04:04 -06:00
Brian Paul
a5d7ee929e mesa: plug in transform feedback functions, set limits 2010-03-30 20:04:04 -06:00
Brian Paul
e443d13ab6 mesa: add transformfeedback.c to build 2010-03-30 20:04:04 -06:00
Brian Paul
de8530e154 mesa: initial check-in of transform feedback functions 2010-03-30 20:04:04 -06:00
Brian Paul
e5c69647b0 mesa: add transform feedback queries
And make _mesa_copy_string() non-static.
2010-03-30 20:04:04 -06:00
Brian Paul
4e9f075448 mesa: add EXT_transform_feedback to extension list 2010-03-30 20:04:04 -06:00
Brian Paul
066f009795 mesa: initial data structures for transform feedback 2010-03-30 20:04:03 -06:00
Brian Paul
ed17446d80 mesa: simplify query code with get_query_binding_point() 2010-03-30 20:04:03 -06:00
Zack Rusin
880e3fb09b Merge remote branch 'origin/master' into gallium_draw_llvm 2010-03-30 21:10:33 -04:00
Zack Rusin
93e342574f draw llvm: fix a warning 2010-03-30 21:09:51 -04:00
Ian Romanick
a80cbd6d82 Forbid array comparisons in GLSL 1.10
This causes the following tests to pass:

    glslparsertest/shaders/array3.frag
2010-03-30 17:04:48 -07:00
Ian Romanick
28009cd75c Begin handling array declarations
This causes the following tests to pass:

    glslparsertest/shaders/array4.frag
    glslparsertest/shaders/array5.frag

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/array3.frag
2010-03-30 16:59:47 -07:00
Ian Romanick
548a1b5ab7 Implement array type handling
Since all glsl_type objects are flyweights, support is added to track all
known array types.  This accounts for most of the changes.
2010-03-30 16:58:19 -07:00
Ian Romanick
066304679c Add proper wrappers so that C++ code can use hash_table type 2010-03-30 16:57:29 -07:00
Ian Romanick
1cf43a4331 Initial bits of constant expression evaluator
Currently only works for constants.  The rest will be added later.
2010-03-30 16:56:50 -07:00
Ian Romanick
84960f01cb Add some array declaration tests 2010-03-30 16:56:22 -07:00
Ian Romanick
4afed821ba intel: Bump intel driver date to later than the date on the 7.8 branch 2010-03-30 15:38:03 -07:00
Zack Rusin
b0f946e900 draw llvm: actually set the constant buffers on the context 2010-03-30 17:21:11 -04:00
Kristian Høgsberg
94264994b1 dri: Drop another unused __DRIscreen field 2010-03-30 16:48:51 -04:00
Kristian Høgsberg
4251076590 dri: Drop the unused dummyContext 2010-03-30 16:48:51 -04:00
Kristian Høgsberg
221bc02d29 dri: Drop an unused __DRIcontext field 2010-03-30 16:48:51 -04:00
Kristian Høgsberg
ff6bce552a intel: Remove redundant fields from struct intel_context
All these pointers are in the __DRIcontext struct, which we point to.
2010-03-30 16:48:51 -04:00
Kristian Høgsberg
581c773e81 intel: Use fb->Height when flipping read buffer orientation
With DRI2, x and y are always zero and fb->Height is always up to date
with the drawable height.
2010-03-30 16:48:51 -04:00
Zack Rusin
8bc07fc83e draw llvm: fix some silly mistakes
the vs_type selection isn't ideal, but for now both llvmpipe's fs and vs
do the same thing which is operate on 4xfloat vector as the base type
2010-03-30 16:16:36 -04:00
Corbin Simpson
3623202834 r300/compiler: Unbreak DDX/DDY.
Fixes progs/glsl/deriv.
2010-03-30 10:43:51 -07:00
Zack Rusin
6f34339af4 draw llvm: we translate between pointers, not values directly 2010-03-30 12:52:09 -04:00
Zack Rusin
1963112f9d draw llvm: various fixes for the translation code
the from translation isn't quite right yet
2010-03-30 12:35:40 -04:00
Zack Rusin
dc886ba139 gallivm: cleanup the code (found by coverity)
the condition can't be false, declerations are ok even if we don't
emit any.
2010-03-30 08:55:17 -04:00
George Sapountzis
5cc9387d0d drisw: fix use after free (bug 27370) 2010-03-30 13:10:36 +03:00
Michel Dänzer
e5c7d1e1c8 Merge branch '7.8'
Conflicts:
	Makefile
	src/mesa/main/version.h

Resolved by keeping version strings from master (also in the intel driver).
2010-03-30 12:01:31 +02:00
Michel Dänzer
07c6d94cd7 glx/dri2: Fix debug build with old dri2proto.
Apparently the higher compiler optimization level in non-debug builds was
eliminating the unused functions referencing the unresolved DRI2 symbols...
2010-03-30 11:50:13 +02:00
Chia-I Wu
aa1a790360 st/dri: Fix a memory leak in dri1_init_screen.
Free the returned configs upon errors.
2010-03-30 15:41:50 +08:00
Chia-I Wu
f6f5cba9a6 mesa/es: Use core mesa's mfeatures.h.
Remove mfeatures_es1.h and mfeatures_es2.h.  Build the overlay with
either FEATURE_ES1 or FEATURE_ES2 defined.
2010-03-30 15:39:17 +08:00
Chia-I Wu
066477ab22 mesa: Add missing features.
Add features tested in the code but missing from mfeatures.h.

This also fixes some tests of features.  They should be tested with
"#if", not "#ifdef".
2010-03-30 15:39:17 +08:00
Chia-I Wu
9f0e1be2de mesa: Add umbrella features.
Add FEATURE_GL, FEATURE_ES1, and FEATURE_ES2 for OpenGL, OpenGL ES 1.x,
and OpenGL ES 2.x respectively.  Define individual features through the
new umbrella features.  There is no real change introduced by this
commit.
2010-03-30 15:39:17 +08:00
Vinson Lee
49289007c1 drisw: Remove unnecessary header. 2010-03-29 23:11:26 -07:00
Vinson Lee
f2c55566ee swrastg: Silence unused value warning. 2010-03-29 22:54:35 -07:00
Vinson Lee
ba43b74967 r300g: Remove unused variable. 2010-03-29 22:19:28 -07:00
Vinson Lee
9dc51ad4f7 r300g: Remove unnecessary header. 2010-03-29 22:11:37 -07:00
Corbin Simpson
587c5ef01f r300g: Bind constantbuf to Draw immediately, don't wait for render.
Doesn't hurt, and reduces code duplication.
2010-03-29 21:33:19 -07:00
Chia-I Wu
c1a392ac4c st/glx: Remove a wrong assertion in choose_pixel_format.
There are X visuals that Gallium or the code does not support.  We could
not assert the color format to be supported.  Return PIPE_FORMAT_NONE in
such cases and let the caller handle it.
2010-03-30 11:20:53 +08:00
Ian Romanick
2d816204c8 Arrays are not allowed as vertex shader inputs in GLSL 1.30 either 2010-03-29 17:42:43 -07:00
Ian Romanick
8901eeefc9 Add several tests for vertex shader attributes 2010-03-29 17:19:13 -07:00
Ian Romanick
fb9f5b0675 Add some checking for vertex shader inputs / attributes
This causes the following tests to pass:

     glslparsertest/shaders/attribute.vert
     glslparsertest/shaders/attribute1.vert
     glslparsertest/shaders/attribute2.vert
2010-03-29 17:16:35 -07:00
Brian Paul
8c6f71e01e gallivm: use constant size array, added assertion check 2010-03-29 18:13:31 -06:00
Roland Scheidegger
56b34e54f2 gallium/util: use other layout instead of the old compressed 2010-03-30 02:01:11 +02:00
Roland Scheidegger
733df0059f Merge branch 'master' into gallium-new-formats
Conflicts:
	src/gallium/auxiliary/util/u_format.csv
2010-03-30 01:52:13 +02:00
Ian Romanick
06e5308e29 Add parser support for texture rectangle types 2010-03-29 16:44:29 -07:00
Roland Scheidegger
6fb364a171 gallium: adapt all code to the renamed depth/stencil formats 2010-03-30 01:35:49 +02:00
Roland Scheidegger
4e9690f00c gallium: make the python scripts for format parsing not fail on new formats
they won't generate any useful conversion code for some of the new formats
but at least don't assert. Also needed some more hacks so they don't generate
code for some of the new formats, as gcc was not impressed.
Also declare unused channels as void, and change the scripts to not fail if
the first channel happened to be unused.
Needs serious fixing.
2010-03-30 01:33:28 +02:00
Ian Romanick
bfb09c2a94 Use call-by-reference for apply_implicit_conversion
I'm not sure if this is a win or not.  It makes the code in
apply_implicit_conversion more clear, but it obscures the fact that it
may change the pointers.
2010-03-29 16:32:55 -07:00
Ian Romanick
db9be2e7aa Apply implicit conversions to ?: operator 2010-03-29 16:29:26 -07:00
Ian Romanick
212b0327b4 Apply implicit conversions to equality operators 2010-03-29 16:29:26 -07:00
Ian Romanick
0150f5f20e Apply implicit conversions to relational operators 2010-03-29 16:29:26 -07:00
Ian Romanick
0104536568 Apply implicit conversions to arithmetic operators 2010-03-29 16:29:21 -07:00
Ian Romanick
70348543ac Add glsl_type::is_array and glsl_type::is_float queries 2010-03-29 16:17:15 -07:00
Chris Li
5fa0984661 Add test case for lp_bld_printf() 2010-03-29 16:09:27 -07:00
Chris Li
3b1a8d9d5b gallivm: added lp_bld_printf() function 2010-03-29 16:09:27 -07:00
Ian Romanick
8a24cd5cea Allow single-component constructors
This causes the following tests to pass:

    glslparsertest/shaders/CorrectVersion.V110.frag
    shaders/glsl-vs-sqrt-zero.frag
    shaders/glsl-vs-sqrt-zero.vert

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/attribute1.vert
    glslparsertest/shaders/attribute2.vert
    glslparsertest/shaders/main2.vert
2010-03-29 16:07:34 -07:00
Ian Romanick
32a494586f Add tests for :? operator 2010-03-29 15:34:21 -07:00
Ian Romanick
96f9cea116 Implement HIR conversion for ?: operator 2010-03-29 15:33:54 -07:00
Ian Romanick
5185a5f7d5 Add generate_temporary to generate an anonymous temporary 2010-03-29 15:20:42 -07:00
Ian Romanick
6e659caaa9 Implement HIR conversion for ast_nequal and ast_equal
The following tests now pass:

    shaders/glsl-unused-varying.frag
    shaders/glsl-fs-sqrt-branch.frag
2010-03-29 15:18:31 -07:00
Ian Romanick
251eb75318 Add missing break-statements in ast_expression::hir
The ast_conditional case was flowing right into ast_pre_inc.
2010-03-29 15:17:16 -07:00
Ian Romanick
3c6fea3048 Implement ir_if (for if-statments) and conversion from AST
The following tests now pass:

    glslparsertest/shaders/if1.frag
    glslparsertest/shaders/if2.frag

The following tests that used to pass now fail.  It appears that most
of these fail because ast_nequal and ast_equal are not converted to HIR.

    shaders/glsl-unused-varying.frag
    shaders/glsl-fs-sqrt-branch.frag
2010-03-29 15:17:11 -07:00
Vinson Lee
90075f34e2 progs/glsl: Add workarounds for Apple GLSL compiler crash.
fsraytrace and vsraytrace were crashing on Mac OS X 10.6.3 in the Apple
GLSL compiler function TPPStreamCompiler::assignOperands. Removing some
const qualifers made the crashes go away.
2010-03-29 14:56:12 -07:00
Ian Romanick
721efc04da Add several simple if-statement tests 2010-03-29 14:11:10 -07:00
Vinson Lee
52f7289215 progs/glsl: Remove inline keyword.
Fixes MSVC build.
2010-03-29 13:58:39 -07:00
José Fonseca
bbe6788807 progs/gallium/python: Get tri.py sample working again. 2010-03-29 21:22:23 +01:00
José Fonseca
d0e7aa25a9 st/python: Update for util_draw_vertex_buffer changes. 2010-03-29 21:22:23 +01:00
José Fonseca
69492c3aca st/python: Move surface read/write methods to context. 2010-03-29 21:22:23 +01:00
Zack Rusin
012fabca72 gallivm: make sure that the alloca's are the very first thing in the function
otherwise mem2reg can't put them in registers
2010-03-29 16:18:16 -04:00
Ian Romanick
17d86f4371 Add a variable to the symbol table after processing the initializer 2010-03-29 12:59:02 -07:00
Ian Romanick
521c2983b4 Trivial code cleanup in ir_dereference::is_lvalue 2010-03-29 12:52:00 -07:00
Eric Anholt
d1e31952ed Add support for builtin radians() and degrees(). 2010-03-29 12:48:45 -07:00
Eric Anholt
78fe3c9150 Add definitions for 1.10 built-in uniforms for ff state. 2010-03-29 12:48:45 -07:00
Eric Anholt
a9fafc6504 Don't let swizzles with duplicated components be considered as lvalues.
Fixes swizzle2.frag.
2010-03-29 12:48:45 -07:00
Eric Anholt
ab372dab2a Reject main() declarations with a non-void return value.
Fixes main3.vert.
2010-03-29 12:48:45 -07:00
Eric Anholt
2e063f1adf Reject variables marked with attribute in the fragment shader.
Fixes attribute.frag.
2010-03-29 12:48:45 -07:00
Eric Anholt
3cb4358f38 Add the instruction for the parameter variable declarations of builtin funcs.
Matches constructor setup, but I'm not really sure why we make the
variable twice.
2010-03-29 12:48:45 -07:00
Eric Anholt
76a91e1afb Implement dot() builtin. 2010-03-29 12:48:45 -07:00
Eric Anholt
01665262e5 Implement exp2() and log2(), and make ir_unop_exp and ir_unop_log be base e.
Making the base e functions IR operations is not a clear win.  i965
doesn't support it, it doesn't look like r600 supports it, but r500
does. It should be easily supportable as a lowering pass, though.
2010-03-29 12:48:45 -07:00
Eric Anholt
53afc3609d Implement builtin length() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
44d68fd06f Add sqrt() builtin as an IR operation.
Following a discussion in #dri-devel, I think this makes more sense
than implementing it as RSQ RCP CMP as Mesa did.  The i965 has a
hardware sqrt that should work, and AMD is suppposed to be able to
implement it as RSQ RCP with an alternate floating point mode so that
the 0.0 case is handled like we want.
2010-03-29 12:48:45 -07:00
Eric Anholt
ddd2e83db2 Add builtin pow() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
0f09aea3bf Add support for builtin deprecated fs varyings.
Fixes glsl-color.frag.
2010-03-29 12:48:45 -07:00
Eric Anholt
bfe380a721 Implement some binary gentype builtin functions. 2010-03-29 12:48:45 -07:00
Eric Anholt
2eec73f735 Implement additional unary gentype builtins. 2010-03-29 12:48:45 -07:00
Eric Anholt
c22c40015d Implement the first builtin function: exp(). 2010-03-29 12:48:45 -07:00
George Sapountzis
625e024b18 st/dri/sw: add drisw_api similarly to dri1_api
I am pretty sure that this is in gallium spirit, so commit. Thanks to Chia-I
for suggesting this.
2010-03-29 21:06:54 +03:00
George Sapountzis
6cc5fbd76b ws/sw/dri: s/xm/dri_sw/ 2010-03-29 21:06:53 +03:00
Brian Paul
2aafbd7c2a docs: fix 7.7.1 release date
(cherry picked from commit e6f5ca0fa3)
2010-03-29 12:01:28 -06:00
Roland Scheidegger
9de2ee646a gallium: fix bogus depth/stencil format names (and channel descriptions)
only the depth part is normalized, stencil part isn't.
2010-03-29 20:00:41 +02:00
Roland Scheidegger
d9eae63792 gallium: add new texture formats
These are needed for DX10 and/or OGL3.3.

This just adds the formats nothing handles them yet.
PIPE_FORMAT_R1_UNORM can't be used currently as it requires special filter.
Need to reclassify compressed formats at some point.
2010-03-29 19:52:29 +02:00
Brian Paul
909f0b356e progs/glsl: improve the mouse drag/rotate code a little 2010-03-29 11:47:38 -06:00
RALOVICH, Kristóf
8ca937fc3b progs/glsl: let the mouse rotate the scene 2010-03-29 11:47:38 -06:00
Brian Paul
1cbd510688 glsl: avoid using rcp in length() functions
See prev commit for related info.
2010-03-29 11:47:38 -06:00
Brian Paul
ab0b9f80f4 glsl: remove rcp from sqrt()
Per a patch from Marek Olšák, we can simply multiply the incoming
value by 1/sqrt(x) instead of using rcp.

We're keeping the x==0 check to avoid generating NaN for sqrt(0).
2010-03-29 11:47:38 -06:00
Zack Rusin
f44af927ff draw llvmpipe: lots of fixes for fetch/emit
the values passed are still not right, but the general scheme
is looking good.
2010-03-29 13:19:16 -04:00
Roland Scheidegger
e96147e744 gallium/docs: minor fixes 2010-03-29 19:12:14 +02:00
José Fonseca
588dd187c4 Revert "python: Temporarily disable python state tracker until transfers are done by contexts"
This reverts commit 50a7786619.
2010-03-29 17:52:10 +01:00
José Fonseca
f3cb08f3dd i965g: util_format_is_compressed() -> util_format_is_s3tc(). 2010-03-29 17:31:34 +01:00
José Fonseca
cfbbe244d7 mesa/st: util_format_is_compressed() -> util_format_is_s3tc(). 2010-03-29 17:31:34 +01:00
José Fonseca
bade76191a svga: util_format_is_compressed() -> util_format_is_s3tc(). 2010-03-29 17:31:34 +01:00
José Fonseca
28cf5e1191 r300: UTIL_FORMAT_LAYOUT_COMPRESSED -> UTIL_FORMAT_LAYOUT_S3TC. 2010-03-29 17:31:34 +01:00
José Fonseca
b9ad95d3ee util: Distinguish between the different compression formats.
In particular, all current uses of util_format_is_compressed() actually
mean s3tc.
2010-03-29 17:31:34 +01:00
Michal Krol
37877b192e softpipe: Map GS constants, too. 2010-03-29 16:06:10 +02:00
Marek Olšák
1c2912ee7a r300g: print configurable debugging info on non-debug builds 2010-03-29 03:33:28 +02:00
Ian Romanick
43de172820 Generate more correctly diagnostics from some invalid initializers 2010-03-28 17:03:16 -07:00
Ian Romanick
dec94903d9 mesa: Add 7.8 release MD5 sums 2010-03-28 16:35:56 -07:00
Ian Romanick
ef6736e646 intel: Bump intel driver date to reflect status as 2010Q1 release 2010-03-28 16:33:53 -07:00
Ian Romanick
a6a4613135 mesa: set version string to 7.8
Also set the correct release date.
2010-03-28 16:33:12 -07:00
Ian Romanick
11289924b8 mesa: Add 7.7.1 release MD5 sums
(cherry picked from commit 0c88e34049)
2010-03-28 16:33:12 -07:00
Ian Romanick
cbc99d34b9 mesa: set version string to 7.7.1
Also set the correct release date.
(cherry picked from commit 663642b435)
2010-03-28 16:33:12 -07:00
Vinson Lee
5f1699e9d5 swrast: Remove unnecessary header. 2010-03-28 15:57:23 -07:00
Vinson Lee
21a96a55d6 progs: Comment out gallium/raw/SConscript from progs/SConscript.
Commit db5c2235d1 broke the default SCons
build.
NameError: name 'graw' is not defined:

This patch allows the default SCons build to work again until a proper
fix is available.
2010-03-28 13:52:11 -07:00
Keith Whitwell
1cf669db59 progs/raw: add note about accessing utility functions 2010-03-28 10:42:38 -07:00
Keith Whitwell
d0d73a38da ws/xlib: Call XFlush after PutImage
Want to see the results.
2010-03-28 10:42:38 -07:00
Keith Whitwell
db5c2235d1 gallium: new raw gallium interface to support standalone tests
Provides basic window system integration behind a simple interface,
allowing tests to be written without dependency on either the driver
or window system.

With a lot of work, could turn into something like glut for gallium.
2010-03-28 10:42:38 -07:00
Keith Whitwell
f97f46f269 aux/tgsi: fix some minor glitches in string routines
Not sure why we are open-coding these rather than using standard
library functions.
2010-03-28 10:42:38 -07:00
Keith Whitwell
42ab3f6fd2 st/python: updates for recent interface changes
Still problems at runtime with vertex elements, etc.

Building still disabled.
2010-03-28 10:42:38 -07:00
George Sapountzis
a24fc90703 drisw: probably better hack for stride and some comments 2010-03-28 19:30:54 +03:00
José Fonseca
c42fe8cd27 util: Update MSDN links. 2010-03-28 17:16:34 +01:00
Luca Barbieri
add226ea44 gallium/docs: fix formatting mistakes in d3d11ddi.txt 2010-03-28 16:41:54 +02:00
Ian Romanick
66faec4895 Initial bits to process initializers in variable declarations
As a result, the following tests pass:

    glslparsertest/array3.frag
    glslparsertest/CGStandardLibrary.frag
    glslparsertest/ConstantConversions.frag
    glslparsertest/constructor1.frag
    glslparsertest/constructor2.frag
    glslparsertest/constructor3.V110.frag
    glslparsertest/dataType4.frag
    glslparsertest/dataType5.frag
    glslparsertest/dataType13.frag
    glslparsertest/dataType19.frag
    glslparsertest/matrix.V110.frag
    glslparsertest/parser7.frag
    glslparsertest/swizzle3.frag

The following tests also pass, but it is just by dumb luck.  In these
cases the shader fails to compile, but it fails for the wrong reason:

    glslparsertest/array6.frag
    glslparsertest/comma2.frag
    glslparsertest/conditional1.frag
    glslparsertest/conditional2.frag
    glslparsertest/conditional3.frag
    glslparsertest/constFunc.frag
    glslparsertest/ParseTest3.frag
    glslparsertest/ParseTest4.frag
    glslparsertest/varying3.frag
    glslparsertest/parser8.frag (also segfaults)
    glslparsertest/parser9.frag (also segfaults)

The following tests now fail.  As far as I can tell, these are all
cases where the shader was failing to compile, but it was failing for
the wrong reason.

    glslparsertest/CorrectMatComma.frag
    glslparsertest/CorrectModule.frag
    glslparsertest/CorrectSwizzle2.vert
    glslparsertest/shaders/glsl-fs-bug25902.frag
2010-03-27 18:56:53 -07:00
Luca Barbieri
d142e8f9d3 gallium/docs: add comparison between Gallium and Direct3D 11 DDI interfaces
Feel free to check it and improve it if necessary.
2010-03-28 01:28:24 +01:00
Marek Olšák
4a16d325eb r300g: handle TGSI_OPCODE_RET as END 2010-03-28 00:07:45 +01:00
Marek Olšák
feb8d99593 r300g: disable cliprects
Thanks to Nicolai Hähnle for explaining this register!
2010-03-27 22:41:42 +01:00
Vinson Lee
6abc3501c6 progs/tests: Remove duplicate texcompress2 in SConscript. 2010-03-27 14:40:41 -07:00
George Sapountzis
a7109625aa drisw: update comment 2010-03-27 23:36:18 +02:00
Marek Olšák
4b8d348076 r300g: print errors even on non-debug builds
We really need to get these into bug reports.
2010-03-27 22:28:25 +01:00
Vinson Lee
1bf67a3b3f i965g: Add brw_winsys_debug.c to SCons build. 2010-03-27 14:25:03 -07:00
Vinson Lee
1b5b04de75 identity: Add id_drm.c to SCons build.
This was missed in commit f7cbaae13d.
(cherry picked from commit 02ee7c2950)
2010-03-27 13:43:16 -07:00
Chia-I Wu
0a82fadcdd egl: Make _eglBindContextToSurfaces more readable.
There is no effective changes given how the function is called.  It is
still not trivial, but it should be more readable and resemble
_eglBindContextToThread a lot.
2010-03-28 03:37:28 +08:00
Chia-I Wu
551bfe7a09 egl: Always return the previously bound context.
When a newly bound context is the same as the previously bound one,
_eglBindContextToThread should still return the context instead of NULL.
This gives the driver a chance to flush the context.
2010-03-28 03:37:28 +08:00
George Sapountzis
3bfa23317c drisw: add comment to libGL about stride 2010-03-27 21:35:25 +02:00
George Sapountzis
f4e561ce12 drisw: make stride issue profound 2010-03-27 20:56:36 +02:00
Vinson Lee
02ee7c2950 identity: Add id_drm.c to SCons build.
This was missed in commit f7cbaae13d.
2010-03-27 10:08:54 -07:00
Chia-I Wu
077570c12b st/egl: Fix missing symbols.
ximage backend calls gallium_wrap_screen, which requires libidentity.a
and libtrace.a.  There are also some missing symbols in i965 due to the
use of sw wrapper.
2010-03-27 23:54:24 +08:00
Brian Paul
9903d09f82 mesa: move/update hash function comments
(cherry picked from commit 535742d75f)
2010-03-27 08:59:17 -06:00
Brian Paul
038d2607ab mesa: fix deadlock in _mesa_HashFindFreeKeyBlock()
Fixes fd.o bug 27340.
(cherry picked from commit 8fe3b3f66a)
2010-03-27 08:58:59 -06:00
Mathias Fröhlich
a43618fdc4 r300g: fix macrotiling for non-square textures
FDO bug #27338.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-03-27 14:06:41 +01:00
George Sapountzis
29ec84b0a8 glx: try swrastg_dri, if swrast_dri fails
This needs a patch for xserver/glx also. An enviroment variable will be added
at some point, it chould be for swrastg only or all gallium drivers.
2010-03-27 14:06:05 +02:00
Corbin Simpson
c8844c5549 r300g: Make SWTCL clear work again.
Kind of surprised that this was as little as it took. Worrying.
2010-03-27 01:13:48 -07:00
Vinson Lee
42f14a76a6 r300g: Remove unnecessary header. 2010-03-26 23:54:16 -07:00
Vinson Lee
9503006285 gallium: Fix Windows SCons build. 2010-03-26 18:58:44 -07:00
Ian Romanick
19360152f5 Reject uniform initializers in GLSL 1.10 mode
Now both glslparsertest/dataType3.frag and glslparsertest/dataType2.frag pass.
2010-03-26 18:05:27 -07:00
Vinson Lee
0383288132 st/dri: Fix SCons build.
This was missed in commit 4b722bf9fd.
dri_extensions.c was removed from Makefile but not from SConscript.
2010-03-26 17:56:13 -07:00
Eric Anholt
72fc47f0b0 Set variables with the sampler base type to read only.
Fixes increment3.frag.
2010-03-26 17:51:41 -07:00
Eric Anholt
8518e75d28 Set the var_type for arrays to error_type until it's implemented.
"Fixes" segfaults in array tests.
2010-03-26 17:51:41 -07:00
Eric Anholt
76ea56c007 Add support for ast_to_hir of pre inc/dec. 2010-03-26 17:51:41 -07:00
Eric Anholt
de38f0ed53 Add support for ast_to_hir of post inc/dec. 2010-03-26 17:51:41 -07:00
Eric Anholt
c4f86d3b80 Make read-only variables not be considered lvalues.
This should fix tests trying to assign to builtin "in" variables, and
will also be relied on for post_inc/dec handling.
2010-03-26 17:51:41 -07:00
Eric Anholt
3c36b2df7c Add constructors for immediate hir constants.
This will make ast_to_hir for inc/dec easier.
2010-03-26 17:51:41 -07:00
Eric Anholt
48a0e64b7d Add support for %= in ast_to_hir. 2010-03-26 17:51:41 -07:00
Eric Anholt
10a6852186 Factor out assignment setup in ast_to_hir. 2010-03-26 17:51:40 -07:00
Eric Anholt
e65e12fdbc IR print visitor: Print out something for the operator. 2010-03-26 17:51:40 -07:00
Ian Romanick
d1dfe8b994 IR print visitor: Print expressions a little better 2010-03-26 17:42:10 -07:00
Ian Romanick
0b7dcc80eb Initial implementation of constructor handling code
All of the scalar, vector, and matrix constructors *except* "from
bool" constructors should be handled.  Array and structure
constructors are also not yet handled.
2010-03-26 17:38:58 -07:00
Ian Romanick
5508129fd8 IR print visitor: print function calls 2010-03-26 17:30:30 -07:00
Ian Romanick
93614bc4b9 Add hack ir_call::callee_name to get the name of the called function 2010-03-26 17:29:29 -07:00
Ian Romanick
9f93d24050 Be sure to set ir_function_signature::definition for constructors 2010-03-26 17:28:52 -07:00
Ian Romanick
9878c6518f Add ir_call::iterator to iterate over actual parameters 2010-03-26 17:20:31 -07:00
Ian Romanick
605ff69b0d Add missing parenthesis in foreach_iter
This allows uses like 'foreach_iter(exec_list_iterator, iter, *list_ptr)'.
2010-03-26 17:17:41 -07:00
Ian Romanick
8343550b42 Add some simple constructor tests 2010-03-26 16:47:06 -07:00
Ian Romanick
6c86ea8adc Add unary operator to convert unsigned integer to float 2010-03-26 16:11:48 -07:00
Chris Li
8260e9a821 gallium/llvmpipe: add PROGS target/rule to Makefile.template
So other directory can share it.
Also remove the libllvmpipe.a dependency from test
programs. It is not needed any more.

Signed-Off-By: Christopher Li <chrisl@vmware.com>
2010-03-26 15:56:02 -07:00
Chris Li
d4b103e031 auto detect llvm version 2010-03-26 15:56:02 -07:00
Vinson Lee
e9a25089f9 rtasm: Silence gnu_printf format warnings. 2010-03-26 14:59:06 -07:00
Ian Romanick
738c183cc9 Slightly change the representation of numeric types
For numeric types, vector_elements and matrix_columns must be at least
1.  Previously matrix_columns was 0 for vectors, and both were 0 for
scalars.  This change simplifies things in some places.
2010-03-26 14:43:16 -07:00
Ian Romanick
d811d47609 Add glsl_type::components to query total number of components in a type 2010-03-26 14:43:11 -07:00
Ian Romanick
cef3baecf6 Replace remaining use of is_error_type with glsl_type::is_error 2010-03-26 14:41:32 -07:00
Ian Romanick
a6d653dcbb Replace remaining uses of is_numeric_base_type with glsl_type::is_numeric 2010-03-26 14:40:37 -07:00
Ian Romanick
40176e249f Replace is_integer_base_type macro with glsl_type::is_integer method 2010-03-26 14:38:37 -07:00
Ian Romanick
0471e8b089 Make glsl_*_type glsl_type class static data 2010-03-26 14:33:41 -07:00
Ian Romanick
a43817a483 Use glsl_type::is_error instead of comparison with glsl_error_type pointer 2010-03-26 14:27:23 -07:00
Kenneth Graunke
affc1413ac Move swizzles out of ir_dereference and into their own class.
Also turn generate_swizzle into a static "create" method of the new
class; we'll want to use it for the IR reader as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 14:00:59 -07:00
Kenneth Graunke
fb9fb5f51d Add new abstract ir_rvalue class; rework accordingly.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 13:58:48 -07:00
Kenneth Graunke
44e1dfa2df Replace "mode" type tag with virtual as_foo() downcasting functions.
These should work well even in a non-flat IR hierarchy.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 12:50:40 -07:00
Michel Dänzer
feb619b770 Merge branch '7.8'
Conflicts:
	src/mesa/drivers/dri/intel/intel_mipmap_tree.c - left what was in master
2010-03-26 18:42:16 +01:00
Michel Dänzer
7996f0fc2c dri/swrast: Fix frontbuffer rendering.
Was broken since the endianness fixes.
(cherry picked from commit 4cf14fa80b)
2010-03-26 18:30:56 +01:00
Michel Dänzer
b005e75177 dri/swrast: Fix missed conversion of one pixel pointer increment.
This probably broke the swrast DRI driver when running X in depth 16.
(cherry picked from commit 6ec259eb17)
2010-03-26 18:30:49 +01:00
George Sapountzis
3ae082f00c swrastg: allow for any of the software rasterizers.
This function should be put in targets/common or winsys/sw/common and shared
with targers/libgl-xlib and winsys/sw/drm.

For targets/common, you get layering violations in the build system unless
all of drm_api's are moved under targets.
2010-03-26 18:44:40 +02:00
George Sapountzis
d9b6552d85 dri/common: add comment about DRISW wrt DRI1 / DRI2 2010-03-26 18:44:40 +02:00
George Sapountzis
fc35d203c7 st/dri: add comment about the ifdef in dri_screen.c 2010-03-26 18:44:39 +02:00
George Sapountzis
5b07257fdb st/dri: factor out common init_screen code 2010-03-26 18:44:39 +02:00
George Sapountzis
1fbfc22d85 st/dri mv __driDriverExtensions to drisw.c and dri2.c 2010-03-26 18:44:39 +02:00
George Sapountzis
4b722bf9fd st/dri: fold dri_extensions.c into dri_context.c 2010-03-26 18:44:39 +02:00
Brian Paul
22cd6f2cb4 mesa: only call _mesa_update_state() when necessary in glGet functions
Only a few state vars require state validation before querying them.
This potentially speeds up state queries.
Encode that info into the state tuple table.

Also, use the new tuple field to indicate when FLUSH_CURRENT() must
be called to validate other state vars.

Based on a patch submitted by Robert Bragg on Feb 12, 2010.
2010-03-26 10:14:00 -06:00
Jakob Bornecrantz
e57405e8d5 swrastg: Use llvmpipe if built but only on scons 2010-03-26 14:56:26 +01:00
Jakob Bornecrantz
7f91f2efb5 swrastg: Build with scons 2010-03-26 14:48:36 +01:00
Jakob Bornecrantz
711529153c gallium: Fix DRI driver build warnings under scons
When building more then one dri driver we would get warnings because
we where defining the same build target multiple times.

Also move all the dri scons targets related code into its own file.
2010-03-26 14:48:35 +01:00
Jakob Bornecrantz
fb70f456fc svga/drm: Fix build under scons 2010-03-26 14:48:35 +01:00
Xavier Chantry
ff0987a15d svga: Fix typo in configure script
Introduced in a82e37b9e9
2010-03-26 13:28:29 +01:00
Corbin Simpson
b6df7aed60 r300/compiler: Lower CMP for vertex programs.
I think my maths is right?
2010-03-26 05:24:44 -07:00
Corbin Simpson
38c7a01b6c Revert "r300g: add generating texture coordinates for point sprites (WIP)"
This reverts commit cba6430524.

Breaks celestia with a hardlock. :T

We really need to sit down and study texture stuffing further.
2010-03-26 04:15:53 -07:00
Christoph Bumiller
1f19aba1ea nv50: fix FACE semantic check in FP input slot assignments
Fixes for instance noise with material shaders in FlightGear.
2010-03-26 11:13:01 +01:00
Vinson Lee
b1e3e03d67 rtasm: Fix typos in comments. 2010-03-25 22:51:08 -07:00
Vinson Lee
8edf085c77 identity: Remove unnecessary header. 2010-03-25 22:40:03 -07:00
Ian Romanick
b7592c362b Merge branch 'anholt' 2010-03-25 18:41:41 -07:00
Ian Romanick
7954922473 IR print visitor: Finish printing constants 2010-03-25 18:40:48 -07:00
Ian Romanick
d14642739e IR print visitor: Remove most of the newlines from the printed output
This makes it a lot easier to read... if you have a really wide display.
2010-03-25 18:40:48 -07:00
Ian Romanick
d7388f389d IR print visitor: print expressions
Not quite complete.  The operator is not yet printed.
2010-03-25 18:40:48 -07:00
Ian Romanick
8c70a62193 IR print visitor: print ir_dereference instructions
Also make a slight change to ir_variable.  The ir_dereference tracks
the number of nested dereferences.  If an ir_variable is visited and
the count is non-zero, just print the name of the variable.
2010-03-25 18:40:36 -07:00
Ian Romanick
6e7c278e24 IR print visitor: Less newlines when printing ir_variables 2010-03-25 18:39:59 -07:00
Jakob Bornecrantz
87ac117d67 progs/gallium: Add trivial gallium demos 2010-03-26 01:36:45 +01:00
Eric Anholt
77c30c5915 i965: Fix readpixels from ReadBuffer != DrawBuffer.
Fixes piglit fbo-readdrawpix.
(cherry picked from commit 5782b2a968)
2010-03-25 17:30:37 -07:00
Eric Anholt
63fbae81e0 i965: Fix inversion for glCopyPixels to/from FBOs.
fixes piglit fbo-copypix.
(cherry picked from commit a589da14de)
2010-03-25 17:30:37 -07:00
Eric Anholt
fdbe1ca0bd intel: Rely on allocated region pitch for the miptree pitch.
Bug #26966: 945 miptree pitch disagreement with libdrm.
(cherry picked from commit da011faf48)
2010-03-25 17:30:37 -07:00
Eric Anholt
57e793644f intel: Remove extra tiling setting after allocating a tiled region.
(cherry picked from commit 32f143b432)
2010-03-25 17:30:37 -07:00
Eric Anholt
4980891252 intel: Respect src pitch in _mesa_copy_rect().
If a non-zero src_y was used, this would break piglit
depth-level-clamp.
(cherry picked from commit e1e48ea15c)
2010-03-25 17:30:37 -07:00
Jakob Bornecrantz
fe306e7ea5 draw: Add EMIT_4UB_BGRA format
Needed for i915g, also fixed swizzle in draw_vs_aos_io.
2010-03-26 01:21:52 +01:00
Jakob Bornecrantz
84a8347b9f draw: Use translate function instead of switch cases 2010-03-26 01:21:52 +01:00
Eric Anholt
ece0a51160 Fix assignment operators: *=, /=, +=, -=.
Basically, replace everything different from operator_assign other
than the creation of the rhs value from the lvalue and rvalue with the
contents of operator_assign.  Fixes a segfault in
CorrectSwizzle1.frag, and fixes parser10.frag.
2010-03-25 17:10:44 -07:00
Ian Romanick
a4e92c4b26 Before generating HIR for user code, generate constructors for built-in types 2010-03-25 17:02:22 -07:00
Ian Romanick
9546997736 Add dereference constructor for array element dereferences
This should have gone in before the previous commit.
2010-03-25 17:01:15 -07:00
Ian Romanick
720c88eab9 Add functions to generate constructors for built-in types.
Currently only vector and matrix types are supported.  Structure types will be
added later.
2010-03-25 16:58:45 -07:00
Eric Anholt
2f9ca7dce2 Fix up the operator printing for the logic or and beyond, check array bounds. 2010-03-25 16:47:49 -07:00
Jakob Bornecrantz
bc88c95990 i915g: Rename winsys prefix to i915_ from intel_
Since the winsys isn't shared with i965 and never will be
2010-03-26 00:38:17 +01:00
Jakob Bornecrantz
80672e84cf st/dri: Move common files to common directory
27 files changed, 15 insertions(+), 15 deletions(-)
 rename src/gallium/state_trackers/dri/{ => common}/dri1_helper.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri1_helper.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_context.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_context.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_drawable.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_drawable.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_extensions.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_screen.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_screen.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_st_api.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_st_api.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_wrapper.h (100%)
2010-03-26 00:37:54 +01:00
Jakob Bornecrantz
5b1fc14627 st/dri: Reshuffle files and make it obvious which files are shared
In short:
git mv ../drisw/Makefile dri/sw
git mv drisw.[c|h] sw
git mv dri2.[c|h] dri1.[c|h] Makefile drm
git rm ../drisw
ln -s <common files> drm/*
ln -s <common files> sw/*
2010-03-26 00:37:52 +01:00
Tom Fogal
38cb44516e Regenerate gl_mangle.h 2010-03-25 17:10:51 -06:00
Ian Romanick
acb36240e5 Merge branch 'anholt' 2010-03-25 16:02:41 -07:00
Brian Paul
a6fecdff3e Merge branch '7.8' 2010-03-25 16:12:01 -06:00
Brian Paul
8814bb652a Revert "llvmpipe: optimize the lp_setup_fence() function"
This reverts commit a9063cad0f.

Not too surprisingly, this change caused some regressions.
Revert it for the time being.
See fd.o bug 27320.
2010-03-25 16:10:25 -06:00
Brian Paul
67e377bda6 llvmpipe: disable an assertion
We shouldn't try to clear a non-existant z/stencil buffer, so there's
probably a bug elsewhere.  Disable the assertion for now to allow things
to at least run.
2010-03-25 16:10:25 -06:00
Brian Paul
59258498dc glapi: return int = 0 from NoOpGeneric()
If a GL function is called w/out a current rendering context, this stub
gets called.  It should return 0 so that non-void-valued functions return
0/NULL instead of a random number.
2010-03-25 16:04:47 -06:00
Jakob Bornecrantz
a82e37b9e9 gallium: Add propper sanity checks in configure.ac 2010-03-25 22:54:56 +01:00
Eric Anholt
b3f743ab0b Set up fragment shader builtin variables. 2010-03-25 14:48:25 -07:00
Eric Anholt
7c15bb2465 Make the standalone parser return an exit code so we can automate testing. 2010-03-25 14:37:25 -07:00
Ian Romanick
68507eceea More matrix compilation tests 2010-03-25 13:41:32 -07:00
Ian Romanick
3d303eb59f Merge branch 'kwg' 2010-03-25 13:22:19 -07:00
Ian Romanick
1b4f04124a Fix matrix dimensioning
Newb GL mistake: matrices in GL are column-major.  This means that
vector_elements is the number of rows.  Making these changes causes
matrix-08.glsl to pass.
2010-03-25 13:19:13 -07:00
Ian Romanick
c1bd3a1a61 Use glsl_type::row_type and glsl_type::column type in arithmetic_result_type
This substantially clarifies the code for matching matrix types.  It
also eliminates some uses of glsl_type member data.
2010-03-25 13:06:58 -07:00
Ian Romanick
80b5ed6e63 Replace several glsl_type field comparisons with a single pointer comparison
This simplifies the process of matching function parameter types.
More simplifications are probably possible here, but arrays and
structures need to be implemented first.
2010-03-25 13:05:43 -07:00
Vinson Lee
80f5f7d17a glslcompiler: Fix build. 2010-03-25 12:58:36 -07:00
Ian Romanick
252127c379 Add queries to get the glsl_type of a row or column of a matrix 2010-03-25 11:42:45 -07:00
Kenneth Graunke
f25a5ad939 Widen num_components to handle vec4 correctly. 2010-03-25 11:22:42 -07:00
Jakob Bornecrantz
9eaadfeaa5 st/dri: Don't include sw vs drm dri headers 2010-03-25 18:28:31 +01:00
Kenneth Graunke
904872372e Typo fixes: de/re/ference. 2010-03-25 10:18:40 -07:00
Jakob Bornecrantz
8f47f5320f st/dri: Add dri2 prefix for all dri2.c functions 2010-03-25 17:55:59 +01:00
George Sapountzis
7b333298fc configure:ac add swrastg_dri 2010-03-25 17:01:54 +02:00
George Sapountzis
1570e30b48 st/dri: add TODO list for DRISW 2010-03-25 17:01:54 +02:00
George Sapountzis
bb289a8a70 swrastg_dri: hack for loader hardcoded stride 2010-03-25 17:01:54 +02:00
George Sapountzis
007e0e3ef9 swrastg_dri: add winsys and target 2010-03-25 17:01:54 +02:00
George Sapountzis
992e9572bd swrastg_dri: add state_tracker 2010-03-25 17:01:53 +02:00
George Sapountzis
5b75e12f91 st/dri: add drisw 2010-03-25 17:01:53 +02:00
George Sapountzis
1bed0eb98e st/dri: add dri_wrapper.h 2010-03-25 17:01:53 +02:00
George Sapountzis
4ce16e13ce st/dri: export DRI1 surface / pipe
They will be used by DRISW. Also, add destroy functions.
2010-03-25 17:01:53 +02:00
George Sapountzis
6a7bd8eb95 st/dri: split out DRI2 code 2010-03-25 17:01:53 +02:00
George Sapountzis
96c152b4b0 st/dri: make get_texture into validate_att
This is a wrapper around dri_st_framebuffer_validate for a single attachment.
Also, call validate through hook to make it more generic.
2010-03-25 17:01:52 +02:00
George Sapountzis
a21c30308d st/dri: flush_frontbuffer, allocate_textures for dri2
dri_st_framebuffer functions just forward to dri1/dri2 functions.
2010-03-25 17:01:52 +02:00
George Sapountzis
24056e7663 st/dri: flush_frontbuffer, allocate_textures for dri1
* ptex is get by flush_frontbuffer, similar to swap_buffers
* comment for allocate_textures
* texture_mask is managed at the st_fb level
2010-03-25 17:01:52 +02:00
George Sapountzis
03c4573eca st/dri: minor cosmetic for buffers 2010-03-25 17:01:52 +02:00
George Sapountzis
c049d58a22 st/dri: minor cosmetic for screen
- put extensions above init_screen
- split out destroy_option_cache
2010-03-25 17:01:52 +02:00
George Sapountzis
d7f78065ac st/dri: add inline for dri2 check done in multiple places 2010-03-25 17:01:51 +02:00
George Sapountzis
20755c5c4c drisw_util: add fields for gallium swrast_dri 2010-03-25 17:01:51 +02:00
Joakim Sindholt
204c88014b r300g/radeong: fix scons build 2010-03-25 15:51:23 +01:00
Jakob Bornecrantz
7d17de4b47 Merge branch 'gallium-targets' 2010-03-25 14:48:41 +01:00
Jakob Bornecrantz
0d0220fedc gallium: Fix libgl-xlib path to sw xlib winsys 2010-03-25 14:43:37 +01:00
Vinson Lee
8b12c58ce4 r300g: Remove unnecessary header. 2010-03-25 00:20:05 -07:00
Vinson Lee
3fcfd69fec progs/glsl: Fix vsraytrace GLSL compilation error.
Fixes the following GLSL error on Mac OS X.
'=' :  assigning non-constant to 'const 3-component vector of float'
2010-03-24 22:53:23 -07:00
Vinson Lee
3bccb5447b progs/glsl: Add raytracing demos to SCons build. 2010-03-24 22:36:49 -07:00
Brian Paul
9a52417582 llvmpipe: fix up some questionable fence code
Jose should probably review this since he wrote the original code.
2010-03-24 20:49:54 -06:00
Brian Paul
a9063cad0f llvmpipe: optimize the lp_setup_fence() function
Avoid emitting fences when not needed.
Speeds up glReadPixels quite a bit when reading image row by row.
2010-03-24 20:49:39 -06:00
Brian Paul
d7ddb589f4 llvmpipe: call lp_fence_signal() 2010-03-24 19:30:32 -06:00
Brian Paul
331729c8c8 llvmpipe: added lp_fence_signal() 2010-03-24 19:30:27 -06:00
Ian Romanick
664da2510a Replace several field comparisons with a single pointer comparison
The only way the specified type fields can match is if the types are the
same.  Previous tests (and assertions) have filtered away all other possible
cases.
2010-03-24 17:53:53 -07:00
Ian Romanick
532edd9bc4 Remove unused _mesa_glsl_get_vector_type
This function has been completely replaced by glsl_type::get_instance.
2010-03-24 17:47:20 -07:00
Ian Romanick
c4e2627045 Use glsl_type::get_instance instead of _mesa_glsl_get_vector_type 2010-03-24 17:46:39 -07:00
Ian Romanick
d2b6bc651a Use glsl_type::get_instance instead of symbol table look-up 2010-03-24 17:45:14 -07:00
Ian Romanick
e4fca97afd Add some matrix math tests 2010-03-24 17:42:59 -07:00
Ian Romanick
3209c4e369 Add glsl_type::get_instance method
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
2010-03-24 17:11:30 -07:00
Ian Romanick
60b54d977a Replace accesses to glsl_type data with query functions
In these particular cases, using the query functions makes it more obvious
what is happening.
2010-03-24 17:08:13 -07:00
Ian Romanick
9ff8f3777e Add class-private handles to matrix types in glsl_type 2010-03-24 17:05:09 -07:00
Jakob Bornecrantz
b4b4ac6681 i915g: Correct and add supperted texture formats 2010-03-25 00:45:31 +01:00
Jakob Bornecrantz
372011bc89 st/dri: Fix for X server 1.6.0 (DRI2 version 1) 2010-03-25 00:45:28 +01:00
Brian Paul
2ad8692aad llvmpipe: fix texture reference counting bug
We weren't saving the per-scene texture references at the right point.

Fixes piglit cubemap segfault.  The segfault resulted from referencing
texture memory which was prematurely freed because of a missed reference
count.

Fixes fd.o bug 27276.
2010-03-24 16:29:17 -06:00
Brian Paul
f0e04b0944 progs/demos: add other modes/patterns to dissolve demo 2010-03-24 16:29:17 -06:00
Ian Romanick
4d184a1d02 Fix typo in swizzle processing loop
One of the accesses to str in the loop used str[0] instead of str[i].

Reported-by: Kenneth Graunke
2010-03-24 15:27:50 -07:00
Ian Romanick
9e97ffb754 Trivial cleanups in generate_swizzle
Add 'const' and 'static const' in a couple of places.
2010-03-24 15:27:04 -07:00
Ian Romanick
afbe26fd61 Use ir_dereference::set_swizzle 2010-03-24 15:25:23 -07:00
Ian Romanick
2f4240fb02 Add method to set the swizzle of an ir_dereference 2010-03-24 15:12:21 -07:00
Ian Romanick
44bb1a62f9 Allow duplicate symbols at the same scope that are in different name spaces 2010-03-24 14:56:36 -07:00
Alex Deucher
d9a19d8649 r100/r200/r300/r600: enable accel for Copy/DrawPixels without kms
meta ops should work ok without kms.
2010-03-24 15:42:13 -04:00
Ian Romanick
d00b7958c0 Merge branch 'anholt' 2010-03-24 12:10:39 -07:00
Ian Romanick
7d9bce3551 Add (negative) test for constructing samplers 2010-03-24 12:08:46 -07:00
Maciej Cencora
fabc744999 r300: report correct state atom size
Spotted by Pauli Nieminen
2010-03-24 20:08:17 +01:00
Maciej Cencora
88f785935e r300: fix off by one
R300_PVS_MAX_CONST_ADDR field holds highest const addr, not
const count.

Fixes missing models and others rendering errors for vertex
program using 256 params.
2010-03-24 20:08:09 +01:00
Maciej Cencora
7a77effb0b r300: fix vertex programs with big number of params (>255) under KMS
UMS will probably require some kernel work
2010-03-24 20:08:00 +01:00
Maciej Cencora
bed7d88708 r300: fix wpos/fog handling
It may happen that the vertex attribute we were going to stuff
the wpos/fog attrs in was already written by vertex program.
In such cases we need to remove instruction accessing these
attributes, so they don't overwrite the wpos/fog related
instructions.

This fixes non-textured models in many wine games.
2010-03-24 20:07:44 +01:00
Maciej Cencora
70929f4505 r300: clean fog_attr/wpos_attr if code accessing these attributes has been removed FP during compilation 2010-03-24 20:07:37 +01:00
Jakob Bornecrantz
f5ae5b5396 gallium: Add warnings incase pipe drivers are not built in targets 2010-03-24 19:16:29 +01:00
Jakob Bornecrantz
738850e522 gallium: Make scons build dri/xorg drivers again 2010-03-24 18:42:35 +01:00
Eric Anholt
3695cdd606 i965: Handle the negate and abs swizzles on brw_wm_glsl.c immediate args.
Fixes piglit glsl-orangebook-ch06-bump, regressed with
4fc5732225
2010-03-24 10:27:30 -07:00
Jakob Bornecrantz
42a1bcc22f radeong: Fix scons build 2010-03-24 18:09:19 +01:00
Jakob Bornecrantz
c9f98673c5 gallium: Reorg winsys directories
Attached output from commit.
 delete mode 100644 src/gallium/winsys/drm/SConscript
 delete mode 100644 src/gallium/winsys/drm/i965/SConscript
 delete mode 100644 src/gallium/winsys/drm/intel/Makefile
 delete mode 100644 src/gallium/winsys/drm/intel/SConscript
 delete mode 100644 src/gallium/winsys/drm/nouveau/Makefile
 delete mode 100644 src/gallium/winsys/drm/radeon/Makefile
 delete mode 100644 src/gallium/winsys/drm/radeon/SConscript
 delete mode 100644 src/gallium/winsys/drm/vmware/Makefile
 delete mode 100644 src/gallium/winsys/drm/vmware/SConscript
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/Makefile (82%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_api.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_batchbuffer.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_buffer.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_fence.c (100%)
 rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_winsys.h (100%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/Makefile (78%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_api.c (98%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_buffer.c (100%)
 rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_winsys.h (100%)
 rename src/gallium/winsys/{drm => }/i965/xlib/Makefile (97%)
 rename src/gallium/winsys/{drm => }/i965/xlib/xlib_i965.c (100%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/Makefile (79%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_dri.h (100%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_drm_api.c (100%)
 rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_drm_api.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/Makefile (79%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_buffer.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm.c (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm_buffer.c (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_r300.c (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_r300.h (100%)
 rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_winsys.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/Makefile (63%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/SConscript (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_buffer.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_buffer.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_context.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_context.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_fence.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_fence.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_dri.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_ioctl.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_pools.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_svga.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_surface.c (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_surface.h (100%)
 rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmwgfx_drm.h (100%)
 rename src/gallium/winsys/{drm/i965 => sw}/Makefile (61%)
 copy src/gallium/winsys/{drm/sw => sw/drm}/Makefile (73%)
 rename src/gallium/winsys/{drm/sw => sw/drm}/sw_drm_api.c (98%)
 rename src/gallium/winsys/{drm/sw => sw/drm}/sw_drm_api.h (100%)
 rename src/gallium/winsys/{ => sw}/gdi/SConscript (100%)
 rename src/gallium/winsys/{ => sw}/gdi/gdi_sw_winsys.c (100%)
 rename src/gallium/winsys/{ => sw}/gdi/gdi_sw_winsys.h (100%)
 rename src/gallium/winsys/{ => sw}/null/Makefile (78%)
 rename src/gallium/winsys/{ => sw}/null/SConscript (100%)
 rename src/gallium/winsys/{ => sw}/null/null_sw_winsys.c (100%)
 rename src/gallium/winsys/{ => sw}/null/null_sw_winsys.h (100%)
 rename src/gallium/winsys/{drm/sw => sw/wrapper}/Makefile (65%)
 rename src/gallium/winsys/{drm/sw => sw/wrapper}/wrapper_sw_winsys.c (100%)
 rename src/gallium/winsys/{drm/sw => sw/wrapper}/wrapper_sw_winsys.h (100%)
 rename src/gallium/winsys/{ => sw}/xlib/Makefile (79%)
 rename src/gallium/winsys/{ => sw}/xlib/SConscript (100%)
 rename src/gallium/winsys/{ => sw}/xlib/xlib_sw_winsys.c (100%)
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
43218a45a4 gallium: Move xorg drivers to targets
Attached output from git commit:
 rename src/gallium/{winsys/drm/intel/xorg => targets/xorg-i915}/Makefile (95%)
 rename src/gallium/{winsys/drm/intel/xorg => targets/xorg-i915}/intel_xorg.c (98%)
 rename src/gallium/{winsys/drm/i965/xorg => targets/xorg-i965}/Makefile (78%)
 rename src/gallium/{winsys/drm/i965/xorg => targets/xorg-i965}/intel_xorg.c (98%)
 rename src/gallium/{winsys/drm/nouveau/xorg => targets/xorg-nouveau}/Makefile (96%)
 rename src/gallium/{winsys/drm/nouveau/xorg => targets/xorg-nouveau}/nouveau_xorg.c (98%)
 rename src/gallium/{winsys/drm/radeon/xorg => targets/xorg-radeon}/Makefile (73%)
 rename src/gallium/{winsys/drm/radeon/xorg => targets/xorg-radeon}/radeon_xorg.c (98%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/Makefile (97%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/SConscript (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_driver.h (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_hook.h (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_ioctl.c (99%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_screen.c (100%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_video.c (99%)
 rename src/gallium/{winsys/drm/vmware/xorg => targets/xorg-vmwgfx}/vmw_xorg.c (100%)
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
f5ba2cdeb9 gallium: Move egl drivers to targets
Atteched output from git commit:
 rename src/gallium/{winsys/drm => targets}/Makefile.egl (100%)
 rename src/gallium/{winsys/drm/intel/egl => targets/egl-i915}/Makefile (86%)
 rename src/gallium/{winsys/drm/i965/egl => targets/egl-i915}/dummy.c (100%)
 rename src/gallium/{winsys/drm/i965/egl => targets/egl-i965}/Makefile (86%)
 rename src/gallium/{winsys/drm/intel/egl => targets/egl-i965}/dummy.c (100%)
 rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/Makefile (88%)
 rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/dummy.c (100%)
 rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/Makefile (87%)
 rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/dummy.c (100%)
 create mode 100644 src/gallium/targets/egl-swrast/Makefile
 create mode 100644 src/gallium/targets/egl-swrast/swrast_glue.c
 rename src/gallium/{winsys/drm/vmware/egl => targets/egl-vmwgfx}/Makefile (86%)
 rename src/gallium/{winsys/drm/swrast/egl => targets/egl-vmwgfx}/dummy.c (100%)
 delete mode 100644 src/gallium/winsys/drm/swrast/Makefile
 delete mode 100644 src/gallium/winsys/drm/swrast/core/Makefile
 delete mode 100644 src/gallium/winsys/drm/swrast/core/swrast_drm_api.c
 delete mode 100644 src/gallium/winsys/drm/swrast/egl/Makefile
 delete mode 100644 src/gallium/winsys/drm/vmware/egl/dummy.c
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
be38b32531 gallium: Move dri drivers to targets
Attached output from git commit:
 rename src/gallium/{winsys/drm/Makefile.template => targets/Makefile.dri} (100%)
 rename src/gallium/{winsys/drm/intel/dri => targets/dri-i915}/Makefile (75%)
 rename src/gallium/{winsys/drm/intel/dri => targets/dri-i915}/SConscript (100%)
 rename src/gallium/{winsys/drm/i965/dri => targets/dri-i965}/Makefile (76%)
 rename src/gallium/{winsys/drm/i965/dri => targets/dri-i965}/SConscript (100%)
 rename src/gallium/{winsys/drm/nouveau/dri => targets/dri-nouveau}/Makefile (86%)
 rename src/gallium/{winsys/drm/radeon/dri => targets/dri-radeong}/Makefile (85%)
 rename src/gallium/{winsys/drm/radeon/dri => targets/dri-radeong}/SConscript (100%)
 rename src/gallium/{winsys/drm/vmware/dri => targets/dri-vmwgfx}/Makefile (85%)
 rename src/gallium/{winsys/drm/vmware/dri => targets/dri-vmwgfx}/SConscript (100%)
2010-03-24 17:02:17 +01:00
Jakob Bornecrantz
41d2ebf202 gallium: Remove GALLIUM_WINSYS_DRM_DIRS 2010-03-24 17:02:17 +01:00
Brian Paul
01f7acb700 progs/glsl: remove/replace //-style comments 2010-03-24 09:08:24 -06:00
Brian Paul
79394f0267 progs/glsl: silence warnings, remove debug code, adjust window size, etc 2010-03-24 09:04:17 -06:00
RALOVICH, Kristóf
4e328774d4 demos: import GLSL raytracing demos 2010-03-24 09:04:14 -06:00
Brian Paul
e71c1589d8 st/mesa: fix typo in prev commit 2010-03-24 09:04:10 -06:00
Brian Paul
2d6befd9d1 st/mesa: fix sampler_view destruction bug when texture is shared
Since texture's can be shared by many contexts, the texture's sampler
view's context pointer might be invalid by time we delete the texture.

Prevent crashes/etc by setting the sampler view's context to be the
calling context before deleting it.  This should be safe as long as
all contexts which share the texture are using the same gallium driver.
That's a reasonable assumption since pipe_texture objects aren't
compatible between different drivers anyway.
2010-03-24 08:34:37 -06:00
Brian Paul
ab93f8d067 st/mesa: code clean-ups, formatting fixes, comments, etc 2010-03-24 08:25:24 -06:00
Brian Paul
3374b26f52 st/mesa: rename st_clear() to st_Clear()
To be consistent with other Mesa driver functions.
2010-03-24 08:18:21 -06:00
Brian Paul
f66d70b930 st/mesa: return GL_TRUE/GL_FALSE if return type is GLboolean
Just to be consistent.
2010-03-24 08:16:27 -06:00
Chia-I Wu
99386921e7 progs/egl: Link xeglthreads to libpthread.
This should hopefully fix a build failure reported by Chris Ball when
binutils-gold is used.
2010-03-24 08:46:10 +08:00
Ian Romanick
882dad7540 ir_function constructor now takes the function name as a parameter 2010-03-23 17:42:04 -07:00
Ian Romanick
bb7e00a1cd Add glsl_type::get_base_type query
Retreives the glsl_type that corresponds to the base type of a numeric scalar /
vector / matrix type.  So vec4 returns float, etc.
2010-03-23 17:31:39 -07:00
Ian Romanick
7aeb6abda7 Add glsl_type::is_numeric and glsl_type::is_boolean queries 2010-03-23 17:31:03 -07:00
Brian Paul
2b5de09b3e swrast: improve depth texture mipmap selection
We still don't do proper min/mag filtering but this is better than just
sampling the base mipmap level all the time.

Fixes piglit depth-level-clamp test.  Fixes fd.o bug 27256.
2010-03-23 17:55:43 -06:00
Brian Paul
8ba47561dd st/glx: add support for multiple displays
This is a quick & dirty solution, but it works.  See comments in
the code for other ideas.

Fixes regressions/breakage seen in progs/xdemos/glxheads, etc. from commit
6632915e95.
2010-03-23 17:24:54 -06:00
Brian Paul
2d84d58975 glslcompiler: added option to do linking of vert/frag shaders 2010-03-23 16:20:02 -06:00
Ian Romanick
abef955764 Begin processing constructors
Right now, reject constructors for samplers because the are illegal.
2010-03-23 15:08:30 -07:00
Ian Romanick
cb7d066967 Add query to determine whether a type is a sampler 2010-03-23 15:03:46 -07:00
Luca Barbieri
3790199e04 dri: fix dri_test.c for non-TLS build
_glapi_Context and _glapi_Dispatch have different constness between
TLS and non-TLS builds.
2010-03-23 22:59:44 +01:00
Luca Barbieri
5f229547a5 dri: add _glthread_GetID to dri_test.c dummy glapi 2010-03-23 22:57:25 +01:00
Luca Barbieri
7e246e6aa6 dri: make unresolved symbol test link work even without a libGL.so
Currently the test link uses -lGL to define the glapi symbols.

This makes it impossible to build DRI drivers on systems without
Mesa installed and without building the libGL from the Mesa tree
first.

Some automated build systems trigger this problem.

This commit removes -lGL and instead adds a dummy implementation of
glapi to dri_test.c

This, along with Kristian's commit, should fix all known regressions
due to the addition of unresolved symbol checking.
2010-03-23 21:32:09 +01:00
Dan Nicholson
e725ef171b Change libX11 variables to not conflict with AC_PATH_XTRA
The variable X_LIBS from AC_PATH_XTRA contains only the -L searchdir
parameter and not the -lX11 to link to Xlib. Use X11 prefixed build vars
for linking with Xlib to avoid the conflict.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-23 13:26:50 -07:00
Ian Romanick
1e5cd2b05b Add test for invalid assignment of function return value 2010-03-23 13:23:53 -07:00
Ian Romanick
0bb1c3c153 Add *some* type checking for assignments 2010-03-23 13:23:31 -07:00
Ian Romanick
71d0bbfcb2 Disallow passing NULL for state to _mesa_glsl_error
The two places that were still passing NULL had a state pointer to
pass.  Not passing it in these places prevented termination of
compilation of erroneous programs.
2010-03-23 13:21:19 -07:00
Ian Romanick
f3f111eac4 Fix typographical errors of "FINISHME" 2010-03-23 13:04:19 -07:00
Eric Anholt
516334b7ff i965: Stop abusing ctx->NewState flags for storing driver internal changes.
We're still abusing the flags by putting them where our driver stores
ctx->NewState changes.  Making them into more restricted state change
flags would be a project for later.

Fixes a failure where calling intel_draw_buffer() too often would trip
up Mesa assertions about when Mesa state could get changed, when it hadn't.

Bug #27034.
2010-03-23 15:51:54 -04:00
Kristian Høgsberg
ba5a53edd1 dri: Add $(DRI_LIB_DEPS) when linking the test binary
This will make sure we pick up libdrm_$(chipset).so from the right place.
2010-03-23 15:50:23 -04:00
Eric Anholt
f41fc53728 Include other generated sources in BUILT_SOURCES.
Otherwise, having cleaned glsl_parser.h, we'd never regenerate it because
glsl_parser.cpp was already right where it needed to be.
2010-03-23 12:32:25 -07:00
Eric Anholt
e5ba18083b Use bash for the built file generation since builtin_types.sh requires it. 2010-03-23 12:32:25 -07:00
Eric Anholt
6985a43832 Clean the built sources with make clean. 2010-03-23 12:32:25 -07:00
Eric Anholt
3d99e990c0 i965: Stop abusing ctx->NewState flags for storing driver internal changes.
We're still abusing the flags by putting them where our driver stores
ctx->NewState changes.  Making them into more restricted state change
flags would be a project for later.

Fixes a failure where calling intel_draw_buffer() too often would trip
up Mesa assertions about when Mesa state could get changed, when it hadn't.

Bug #27034.
2010-03-23 15:29:54 -04:00
Kristian Høgsberg
57edf6b1fc mesa: Also print _NEW_STENCIL in _mesa_print_state() 2010-03-23 15:29:05 -04:00
Ian Romanick
cec65a6b76 Generate an error for variables declared with type void 2010-03-23 12:28:44 -07:00
Ian Romanick
8400bc4d35 Add is_error and is_void type queries 2010-03-23 12:28:28 -07:00
Ian Romanick
9e7c34b865 Set the type of a function call to be the return type of the callee 2010-03-23 12:21:18 -07:00
Ian Romanick
e39cc69fa3 Set, and require, a return type for function signatures 2010-03-23 12:19:13 -07:00
Ian Romanick
7563b50075 Add `void' type to table of available types
This will make void-01.glsl test fail, so I may regret this later.
However, this will make supporting functions that return void or
functions that have a void parameter list easier to handle.
2010-03-23 12:11:50 -07:00
Ian Romanick
693bb11b5f Rename test GLSL sources from .txt to .glsl 2010-03-23 11:57:24 -07:00
Ian Romanick
f8f1085e5e Add test for declaring variables of type void. 2010-03-23 11:54:03 -07:00
Luca Barbieri
3428a30515 nvfx: add NOUVEAU_VTXIDX_IN_VRAM variable to put vertex/index buffers in VRAM
On some systems, putting vertex and index buffers in VRAM instead of GART
memory eliminates massive graphics corruption which is otherwise present,
due to unclear causes.

This patch adds an environment variable that does that, along with helpful
messages.

It turns it on by default on G7x, as it is what I am seeing corruption
on and some other reports also seemed to pinpoint these cards.
2010-03-23 18:11:25 +01:00
Luca Barbieri
208f5bf3cd nvfx: delay allocation of buffers in GART/VRAM to validation time
Currently we allocate buffers in GART or VRAM at creation time.

However, when using swtnl, this results in reads from uncached
memory, which drastically impair performance.

So, for now, cause nouveau_screen.c to not pass any placement flags
to buffer creation, so that the buffers are moved later.

Previously libdrm itself did this, but was changed to not to do it.

This may introduce an extra copy in normal usage, but this currently
does not seem to introduce significant performance degradation.

This will be revisited when pipebuffer is integrated.

Note that for AGP systems, properly solving this may be complex
since currently there is no fast way of reading from GART/VRAM.

We will probably need to try mapping AGP as writethrough and, in
addition, make buffer creation more aware of future buffer usage.
2010-03-23 18:10:59 +01:00
Luca Barbieri
9f0e302cc7 st/mesa: make st_manager.c set have[Stencil|Depth]Buffer only if bits > 0
Fixes a segfault when clearing a non-existent stencil buffer.
2010-03-23 18:02:51 +01:00
Luca Barbieri
fff86eb0aa dri: use mv -f instead of mv to ensure no prompting occurs
Using just mv may cause prompts on some systems/configurations.
2010-03-23 17:57:59 +01:00
Brian Paul
ed29329b08 docs: update docs with 7.7.1 and 7.8 release info 2010-03-23 09:24:13 -06:00
Brian Paul
2689dd304c Merge branch '7.8'
Conflicts:

	Makefile
	src/gallium/state_trackers/glx/xlib/xm_api.c
	src/mesa/drivers/dri/intel/intel_blit.c
	src/mesa/drivers/dri/intel/intel_pixel_copy.c
	src/mesa/main/version.h
2010-03-23 09:14:17 -06:00
Brian Paul
ff54af530b softpipe: comments, re-formatting, etc 2010-03-23 09:08:35 -06:00
Brian Paul
fc1ba0423a softpipe: add special cases for all Z compare modes for 16-bit Z buffer
We had fast paths for PIPE_FUNC_LESS and LEQUAL before.  To satisfy
OpenGL invariance rules, all depth compare modes should produce the
same fragment Z values.

Fixes progs/demos/singlebuffer.c
2010-03-23 09:00:19 -06:00
Brian Paul
4ceeb1307a st/glx: better format selection in xmesa_choose_z_stencil_format()
This is a back-port of commit ef2664da6c
from master.
2010-03-23 08:58:12 -06:00
Luca Barbieri
83f4c444f4 nvfx: don't crash on empty fragment program 2010-03-23 15:41:10 +01:00
Luca Barbieri
e14d812e15 nvfx: fix coding style in nvfx_transfer.c 2010-03-23 15:41:04 +01:00
Luca Barbieri
a6cc9cf38d nvfx: stop incessantly spewing debug messages on the terminal
Currently we are continuously spewing messages about these variables
since we call debug_get_bool_option everytime we want to check their value.

This is annoying, slows things down due to terminal rerendering
and obscures useful messages.

This patch only calls debug_get_bool_option once and caches the result in a
static variable.
2010-03-23 15:40:41 +01:00
Luca Barbieri
c652ad907f nvfx: fix/workaround nv3x hwtnl issues
This patch re-emits the viewport state on framebuffer or rasterizer
change.

This seems to be necessary on nv3x, but the reason is not fully
understood.

It is quite likely that this isn't really the correct fix, but seems
to work, and makes nv3x much better.
2010-03-23 15:40:34 +01:00
Luca Barbieri
3e17a5b047 dri: test whether the built drivers have unresolved symbols
This is a different approach to solving this problem that the patch
I previously posted, and unlike that, should not cause any problems.

Right now undefined symbols in DRI drivers will still allow the
build to succeed.

As a result, people modifying drivers they cannot test risk creating
unloadable drivers with no easy way of automatically avoiding it.

For instance, the modifications to nv50 for context transfers caused
such an issue recently.

Unfortunately, just adding -Wl,--no-undefined doesn't work, because
the DRI drivers depend on glapi symbols, but do not depend on
libGL.so.1

Adding -lGL is not the correct solution since DRI drivers are not loaded
just by libGL, but also by X and possibly by other clients.

So, this patch simply tries to build an executable linked to the DRI
driver and to libGL.
If the DRI driver contains any undefined symbols not satisfied by its
dependencies or by libGL, this will fail.

This solution does not alter the built drivers, and does not significantly
slow down the build process.

All classic DRI drivers as well as all the Gallium drivers with configure
options compiled successfully with this change.

Thanks to Xavier Chantry <chantry.xavier@gmail.com> and
Michel Daenzer <michel@daenzer.net> for helping with this.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Acked-by: Brian Paul <brian.e.paul@gmail.com>
2010-03-23 15:28:59 +01:00
Marek Olšák
1f25eca311 radeong: fix build issue with libdrm < 2.4.19 2010-03-23 13:34:31 +01:00
Dave Airlie
2a3accbc00 r300g: fix glean occlusion query test 2010-03-23 19:12:33 +10:00
Chia-I Wu
2ded27b2f0 Add missing EGL files to the tarballs.
Add the Makefile of Gallium EGL drivers and demos using EGL to the
tarballs.
2010-03-23 14:46:03 +08:00
Kristian Høgsberg
094c6fbc45 glx: Suppress BadDrawable from DRI2CopyRegion
This can happen when an X window is destroyed behind our back.  We use
DRI2CopyRegion behind the scenes in many places (like flushing the fake
front to the real front) so we have to ignore X errors triggered in that
case.

The glean test cases trigger this consistently as they don't destroy the
GLX drawable nicely, they just destroy the X window.
2010-03-22 22:04:23 -04:00
Kristian Høgsberg
7a0bcba9f9 glx: Suppress BadDrawable from DRI2CopyRegion
This can happen when an X window is destroyed behind our back.  We use
DRI2CopyRegion behind the scenes in many places (like flushing the fake
front to the real front) so we have to ignore X errors triggered in that
case.

The glean test cases trigger this consistently as they don't destroy the
GLX drawable nicely, they just destroy the X window.
2010-03-22 22:03:38 -04:00
Corbin Simpson
d5b2cecb03 gallium/docs: Cleanup and clarify point ras info.
...This state's interdependent? Really? Needs moar cleanup.
2010-03-22 18:42:42 -07:00
Corbin Simpson
ed61faec7e radeong: Always initialize this variable.
May or may not be responsible for slight increases in ipers FPS.
2010-03-22 18:42:42 -07:00
Corbin Simpson
ca49a72a55 r300g: Cleanup a few old warnings.
Those paths aren't important anymore, and a debugging warning won't stop
a hardlock anyway.
2010-03-22 18:42:42 -07:00
Ian Romanick
4eead42550 mesa: set version string to 7.8-rc2 2010-03-22 18:09:15 -07:00
Jesse Barnes
8f4f2a0c36 GLX/OML: honor OML semantics even if target, divisor and remainder are 0
This change passes a remainder of 1 to the server with the
DRI2SwapBuffers request, causing it to honor the OML semantics for the
swap rather than falling through to glXSwapBuffers behavior.  The
remainder actually ends up ignored since the divisor is 0, but we need
to differentiate the OML and standard behavior somehow.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-22 16:41:17 -07:00
Eric Anholt
d9ea1af82c i965: Add disasm for SNB MATH opcode. 2010-03-22 15:04:47 -07:00
Eric Anholt
10069916c7 i965: Enable normal clipping on SNB.
Rejecting all doesn't seem to be helping get the pipeline lit up.
2010-03-22 15:04:47 -07:00
Eric Anholt
7319b19fc9 i965: Force single program flow in SNB GS, to match gen4 GS. 2010-03-22 15:04:46 -07:00
Eric Anholt
073f8d1c00 i965: Correct copy and wasted field shifts for SNB GS URB. 2010-03-22 15:04:46 -07:00
Eric Anholt
edc8a99d1d i965: Enable VS on SNB.
It appears that the thing that was killing VS threads was the
gratuitous NOP that replaced the gratuitous jump from OPCODE_END to
the nearby OPCODE_END implementation.  With that gone, we can move on
to the rest of the pipeline.
2010-03-22 15:04:46 -07:00
Eric Anholt
d163d5fac0 i965: Remove gratuitous jump or nop from OPCODE_END to vertex emit.
Just emit the URB write at END time.  Subroutine code that sits after
OPCODE_END won't be executed since we've ended the thread at the point
that the URB write is done.
2010-03-22 15:04:46 -07:00
Eric Anholt
a9acde6a72 i965: Ignore execution mask for the mov(m0, g0) of VS URB write header on SNB.
Otherwise, we may not get the FFTID set up which would break freeing
of resources.
2010-03-22 15:04:46 -07:00
Eric Anholt
4fc5732225 i965: Allow FS constants to be used as immediates instead of push/pull.
The hope is to later take advantage of the reduced constant usage to
free up regs.  This only covers the GLSL path at the moment, because
the brw_wm_emit path doesn't get the information as to whether a float
value is a constant or a uniform.
2010-03-22 15:04:46 -07:00
Eric Anholt
864f2bd61d i965: Add INTEL_DEBUG=glsl_force to force brw_wm_glsl.c.
I keep finding the desire to force this path to debug it instead of
cooking up goofy-looking testcases to do so.
2010-03-22 15:04:46 -07:00
Eric Anholt
8a998342c6 i965: Optimize OPCODE_CMP by using BRW_SEL to choose results.
Tested with piglit glsl-fs-sqrt-branch, fp-cmp.vpfp.
2010-03-22 15:04:46 -07:00
Brian Paul
ef2664da6c st/glx: fix depth/stencil format selection code
This fixes a pretty big performance regression caused by commit
3475e88442.

When the user does not request a stencil buffer it's important that we
don't use a depth/stencil format (or at least make it our last choice).
If the user calls glClear(GL_DEPTH_BUFFER_BIT) when we have a combined
depth/stencil buffer, that causes us to hit the clear_with_quad() path
which can be much, much slower than calling pipe_context::clear().

Also, try to use a shallower depth format before a deeper one.
2010-03-22 16:01:15 -06:00
Brian Paul
af0b0e1172 st/mesa: rename st_framebuffer() to st_ws_framebuffer()
Be clear that this function is not just a cast wrapper.
2010-03-22 16:01:15 -06:00
Kristian Høgsberg
62d54f0387 intel: Call intel_prepare_render() before looking up regions.
Fixes #27213.
2010-03-22 17:59:04 -04:00
Kristian Høgsberg
6422cf387b intel: Call intel_prepare_render() before looking up regions.
Fixes #27213.
2010-03-22 17:55:05 -04:00
Vinson Lee
262961ef69 st/mesa: Remove unnecessary headers. 2010-03-22 13:02:09 -07:00
Brian Paul
f42acbeebf glslcompiler: fix build again
Simply use the libglapi.a archive instead of individual .o files.
Fixes the non-debug build.
2010-03-22 13:36:30 -06:00
Vinson Lee
45d1dc2607 cso: Remove unnecessary header. 2010-03-22 11:34:18 -07:00
Karl Schultz
092ca30366 Fix potential compilation issue in visual studio project file
Add quotes around filespec in post-build event to allow paths
with embedded spaces.
2010-03-22 12:18:02 -06:00
Francisco Jerez
fc14fb9d1a dri/nouveau: Rectangle texture fixes. 2010-03-22 18:41:23 +01:00
Francisco Jerez
bfdea90f25 dri/nouveau: Some render to texture fixes. 2010-03-22 18:41:23 +01:00
Francisco Jerez
199fab25b7 dri/nouveau: Fix swrast fallbacks when the read and draw buffers aren't the same. 2010-03-22 18:41:23 +01:00
Francisco Jerez
fe7d0e6dc8 dri/nouveau: Expose EXT_framebuffer_blit. 2010-03-22 18:41:22 +01:00
Francisco Jerez
fc7890dc6c dri/nouveau: Plug in some mesa_meta functions instead of the swrast variants. 2010-03-22 18:41:22 +01:00
Francisco Jerez
c695e80017 dri/nouveau: Emit dirty states on nouveau_validate_framebuffer.
Fixes broken intermediate frames when a window is being resized
(regression caused by 878eef8c4).
2010-03-22 18:41:22 +01:00
Luca Barbieri
4e3b950c70 nvfx: fix sampler views support
The code was half converted, resulting in texturing being totally broken.
2010-03-22 18:36:16 +01:00
Brian Paul
98b4e7aee8 glslcompiler: fix build breakage 2010-03-22 09:08:09 -06:00
Brian Paul
182c42c8da Merge branch '7.8'
Conflicts:

	src/gallium/drivers/cell/ppu/cell_screen.c
	src/mesa/state_tracker/st_cb_drawpixels.c
2010-03-22 09:07:46 -06:00
Brian Paul
ca97f8b9ba glslcompiler: fix build breakage 2010-03-22 09:00:13 -06:00
Brian Paul
5cb4a3524b mesa: remove return, do as the comment says 2010-03-22 08:23:14 -06:00
Pauli Nieminen
361e8e9118 mesa: Add end of line to the end of a debug output. 2010-03-22 15:16:02 +02:00
Chia-I Wu
904d129322 docs: Update the path to build libgl-xlib. 2010-03-22 13:32:08 +08:00
Vinson Lee
fce72d5803 progs/tests: Add cva_huge to SCons build. 2010-03-21 19:21:11 -07:00
Vinson Lee
1e7d65bb5b progs/tests: Include stddef.h for ptrdiff_t on all platforms.
stddef.h is the standard C header that defines ptrdiff_t.

Fixes build of cva_huge on Mac OS X.
2010-03-21 19:09:54 -07:00
Pauli Nieminen
4ea694a26b r200: Fix emit size prediction to account elt splitting.
Emit sizes prediction didn't account for render splitting in
hwtnl path.
2010-03-21 23:39:55 +02:00
Pauli Nieminen
0900544fb5 r200: Don't flush when closing elts in KMS.
Flush in middle of rendering in KMS is not allowed because
buffers are discarded in flush.

Fixes crash when emiting split indices with RADEON_DEBUG=all.
2010-03-21 23:39:53 +02:00
Marek Olšák
9fc6c8b831 r300g: disable tiling for YUV formats 2010-03-21 22:17:14 +01:00
Marek Olšák
8bf9842fac r300g: fix scons build 2010-03-21 22:05:27 +01:00
Marek Olšák
7733bac66c r300g: accelerate blitting for all 64-bit texture formats 2010-03-21 21:54:07 +01:00
Marek Olšák
12dc497173 r300g: add and enable square microtiling
It requires DRM 2.1.0 (e.g. kernel 2.6.34) and is disabled on older ones.

Finally, the texture tiling implementation is now complete. Uff.
2010-03-21 21:54:07 +01:00
Marek Olšák
33d2349119 r300g: cleanup tiling flags propagation 2010-03-21 21:54:06 +01:00
Marek Olšák
d0d3abd360 r300g: put common defines into one file 2010-03-21 21:54:06 +01:00
Marek Olšák
bc5778e202 r300g: remove unused code 2010-03-21 21:54:02 +01:00
Pauli Nieminen
1968d8f31d r200: Fix swtnl fallback to flush pending rendering before transition.
Flush after transition would emit wrong state that could cause
wrong state emited for pending rendering operation.

Fixes wan once from extrement tuxracer that is using per vertex
materials.
2010-03-21 20:27:49 +02:00
Pauli Nieminen
44e3ec3c05 r200: Fix mixed indetion in r200TclFallback. 2010-03-21 20:27:44 +02:00
George Sapountzis
a0ce955764 Revert "drm/sw: does not need sw_winsys"
This reverts commit 97a694e221.
2010-03-21 19:36:28 +02:00
George Sapountzis
15c7fa460b Revert "gallium: add soft screen helper"
This reverts commit f87a5f6499.
2010-03-21 19:33:17 +02:00
George Sapountzis
f9c0cbd1ad Revert "drm/sw: just s/softpipe_create_screen/gallium_soft_create_screen/"
This reverts commit 5d524cce9c.
2010-03-21 19:33:09 +02:00
George Sapountzis
63aa8a39c4 Revert "fix scons build"
This reverts commit 29ec051648.
2010-03-21 19:32:40 +02:00
George Sapountzis
29ec051648 fix scons build 2010-03-21 19:20:15 +02:00
George Sapountzis
dd120776d1 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa 2010-03-21 15:37:40 +02:00
George Sapountzis
59629b413a Revert "Makefile.template: respect LIBRARY_DEFINES in mkdep"
This reverts commit 9ec29e3191.
2010-03-21 15:32:50 +02:00
Christoph Bumiller
f7273f2a27 nv50: report driver as GLSL capable
There's still no hint of optimization in the shaders, but
we support conditionals, loops and even integer opcodes so
it isn't that big a lie.
2010-03-21 14:11:59 +01:00
George Sapountzis
f2fa4a1888 Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/mesa 2010-03-21 15:05:21 +02:00
George Sapountzis
5d524cce9c drm/sw: just s/softpipe_create_screen/gallium_soft_create_screen/
This partially reverts commit f87a5f6499.
2010-03-21 15:03:13 +02:00
Christoph Bumiller
1afda5303d nv50: don't validate arrays on clear
The vertex elements and buffers might not be valid anymore.
2010-03-21 13:23:53 +01:00
Christoph Bumiller
272bbbffb0 nv50: get rid of the static_init stateobj
Relocations of per-screen buffers are now emitted directly,
and include the necessary method to get changes in constbuf
addresses committed to the hw.

It should also be a bit cheaper than the way stateobjs emit
relocation markers, use a little less pushbuf space.
2010-03-21 13:23:47 +01:00
George Sapountzis
f87a5f6499 gallium: add soft screen helper 2010-03-21 13:21:46 +02:00
George Sapountzis
c28f5f98d6 dri1_api: need not include drm.h 2010-03-21 13:21:46 +02:00
George Sapountzis
97a694e221 drm/sw: does not need sw_winsys 2010-03-21 13:21:46 +02:00
George Sapountzis
016c5c953f drm/sw: llvmpipe texture_from_handle
Not sure, but judging by softpipe, this hook was forgotten.
2010-03-21 13:21:46 +02:00
George Sapountzis
9ec29e3191 Makefile.template: respect LIBRARY_DEFINES in mkdep 2010-03-21 13:21:45 +02:00
George Sapountzis
a13bcf945f rename dri_sw to drisw_util for consistency 2010-03-21 13:21:45 +02:00
George Sapountzis
0b932284f2 dri_inteface: add define for checking presence of drm.h
__NOT_HAVE_DRM_H is a like a feature, defined by default on specific platforms
and allows to be defined externally as well.

__NOT_HAVE_DRM_H should only be used by xserver and mesa swrast_dri drivers
2010-03-21 13:21:45 +02:00
George Sapountzis
2b5a6e083c glx: minor cosmetic 2010-03-21 13:21:45 +02:00
George Sapountzis
2d1641b191 glx: swapBuffers prototype has changed 2010-03-21 13:21:45 +02:00
Pauli Nieminen
9a7acbccfb vbo: Fix vbo_split_copy to pass correct max_index to draw.
vbo_split_copy was passing one past the max_index to draw function
which caused _tnl_draw_prims function to read uninitialized values
from copied array.

Bug was spoted in valgrind report of progs/tests/cva_huge.
2010-03-21 13:18:36 +02:00
Pauli Nieminen
a81cd67a4f tests: Add test for huge client arrays that has to be split.
When running this test case in valgrind report includes read of unitialized
value in _tnl_draw_prims. The bug doesn't cause any vissible errors.

Bug is caused by vbo_split_copy that is calling draw function with max_index
one past the end instead of the end.
2010-03-21 13:17:52 +02:00
Francisco Jerez
c48226e81d dri/nouveau: Reemit the light model state when lighting goes on/off. 2010-03-21 11:49:46 +01:00
Francisco Jerez
7f1f4c14ec dri/nouveau: Random cleanups. 2010-03-21 11:49:20 +01:00
Dave Airlie
bb324182fc r300g: fix occlusion query hangs.
Okay need to revist the whole OQ stuff anyways, glean test asserts
which is never good.

I'm liking the cached bufmgr restrictions less and less, I think I'll
probably play with the fence and/or busy stuff ASAP and try and clean it up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 19:39:28 +10:00
Dave Airlie
ff1c7baad2 r300g: add bufmgr cached for vertex/index buffers.
This adds the cached bufmgr for vertex/index buffers on top of the kernel
manager.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 19:39:28 +10:00
Dave Airlie
0dab3189e1 gallium: cached bufmgr add map busy check
Suggested by Jose on the list, probably not perfect but will let me get
past this for now, testing with a fenced bufmgr on top of this, was slower,

Also this doesn't let you do the busy early exit optimisation either from
what I can see.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 19:38:41 +10:00
Chia-I Wu
12deb9e6ca Merge remote branch 'origin/gallium-st-api-dri' 2010-03-21 16:32:34 +08:00
Marek Olšák
162bc831c9 r300g: align misaligned ushort vertex indices 2010-03-21 05:42:50 +01:00
Marek Olšák
53ca4f8401 r300g: fix misaligned generated offset for ubyte vertex indices 2010-03-21 05:42:49 +01:00
Marek Olšák
04de5f4b8b r300g: split the vertex buffer alignment validation 2010-03-21 02:19:55 +01:00
Marek Olšák
951d89ae3a r300g: skip null vertex buffers 2010-03-21 02:19:55 +01:00
Marek Olšák
7b38f946a0 r300/compiler: fix assertion failure in the r500-fragprog emission path 2010-03-21 02:06:44 +01:00
Corbin Simpson
44cfc4ad74 r300g: Bump immediate limits.
Seems like a decent idea, especially since the big barrier now is
getting the VBOs back from the VRAM boundary.
2010-03-20 17:18:22 -07:00
Corbin Simpson
4711aa089e r300g: Correctly hax max_index on pipe_vertex_buffers.
Still not happy with this, but at least things seem to work.
2010-03-20 17:16:46 -07:00
Corbin Simpson
7c8221b460 radeong: Use TRUE and FALSE. 2010-03-20 16:16:11 -07:00
Corbin Simpson
20dedcca3c radeong: Test the BO ptr for NULL instead of using a bool.
Slight memory savings, but more importantly also avoids a potential NULL
dereference.
2010-03-20 16:16:11 -07:00
Dave Airlie
c2d17dce27 r300g: winsys fix tiling change flushes.
If we change the tiling on a buffer we need to flush it, the old
radeon_buffer.c code had this but it crossed streams when I ported to
radeon_drm_buffer.c and I missed it. Should fix some piglit regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 06:56:49 +10:00
Dave Airlie
03f1896304 r300g: add buffer/texture referenced checks.
I've no idea about the comments that were in there, just pass
this down to the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-21 06:56:49 +10:00
Brian Paul
449721a3d0 docs: note GL_EXT_packed_float, GL_EXT_shared_exponent extensions 2010-03-20 12:06:36 -06:00
Brian Paul
61753c4bf7 mesa: added GL3 query for GL_TEXTURE_SHARED_SIZE 2010-03-20 12:06:36 -06:00
Brian Paul
9fca5d2e39 mesa: added missing glGet query for GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 2010-03-20 12:06:36 -06:00
Brian Paul
d6a9f5b3da mesa: added new GL3 buffer object queries
And clean up the error checking code.
2010-03-20 12:06:35 -06:00
Brian Paul
8829e063aa mesa: added GL3 buffer attachment aliases 2010-03-20 12:06:35 -06:00
Brian Paul
00225af999 mesa: added GL3 ContextFlags field and query code 2010-03-20 12:06:35 -06:00
Marek Olšák
3d72c4ae78 r300/compiler: fix assertion failure in the r500-fragprog emission path 2010-03-20 18:54:55 +01:00
Brian Paul
f0491c945c docs: remove the 'Last updated date' 2010-03-20 10:33:10 -06:00
Chia-I Wu
6fed3a9fa0 glapi: Fix aliases to non-static functions.
The bug is triggered by 41a87a43e1.
glBlitFramebuffer, for example, is an alias to the non-static
glBlitFramebufferEXT.  We should define glBlitFramebuffer as an alias to
_dispatch_stub_NNN.
2010-03-21 00:05:01 +08:00
Chia-I Wu
41a87a43e1 glapi: Correctly generate static disatches for X86.
The entry point names, instead of the function name, should be used to
test if the entry point should be statically dispatched.
2010-03-20 13:02:05 +08:00
George Sapountzis
fe5f070ef9 st/dri: fix bug in make_current 2010-03-20 12:59:58 +08:00
George Sapountzis
92827cd451 st/dri: fix bug in allocate_textures 2010-03-20 12:59:58 +08:00
Ian Romanick
41ec6a47ab Track the function that is currently being defined
Later this will allow type checking for return statements.
2010-03-19 17:08:05 -07:00
Ian Romanick
16a246c049 Initial bits for converting AST return nodes to IR return instructions 2010-03-19 16:51:16 -07:00
Ian Romanick
9578c87ce2 Implement IR return instructions 2010-03-19 16:44:52 -07:00
Ian Romanick
3359e58eac Use glsl_symbol_table::name_declared_this_scope
Prevent most illegal name reuse.
2010-03-19 15:38:52 -07:00
Ian Romanick
ac4fdc255b Add query to determine whether a name was declared at this scope
This will be used to prevent a variable and a function with the same
name from being declared.  As a side effect, the calls to
add_{type,name,function} should never fail.
2010-03-19 15:37:01 -07:00
Ian Romanick
38395c1aad Use separate namespaces for types, variables, and functions
This will allow types and their constructors to be easily stored in
the same symbol table.  This does add a potential problem that a
shader could declare a variable and a function with the same name.
This appears to be forbidden by the GLSL spec.
2010-03-19 15:34:13 -07:00
Ian Romanick
95517faf69 Add function to determine the scope where a variable is declared 2010-03-19 15:32:57 -07:00
Ian Romanick
8bde4cec6b Use glsl_symbol_table instead of using _mesa_symbol_table directly 2010-03-19 11:57:24 -07:00
Ian Romanick
82de85e264 Add a GLSL-specific facade to _mesa_symbol_table
This adds some type saftey and will enable elimination of a bunch of
type casts and other ugly crap in the code.
2010-03-19 11:43:36 -07:00
Marek Olšák
7e6e049bb7 r300g: remove hacks from translate_vertex_data_swizzle
Fixing RGBA 4ub vertex colors.
2010-03-19 19:13:01 +01:00
Ian Romanick
b0bb781e1d Don't track new type names during pass-1 parsing
This implementation was wrong anyway because it did not respect
scoping rules.  This will need to be revisited soon.  The most likely
result is that the grammar is going to need some significant re-work
to be able to use a IDENTIFIER in all the places where a TYPE_NAME is
currently used.
2010-03-19 11:12:33 -07:00
Brian Paul
73060ec7eb drivers/x11: add PUBLIC qualifier to more API functions
Based on a patch from Tom Fogal.
2010-03-19 10:35:58 -06:00
Brian Paul
05c03c6a1b gallivm: simplify and clean-up Z/stencil bit mask/shift code
Refactor the code into two helper functions which compute the bit mask
and shift terms for Z and stencil.  Plus add a bunch of new comments to
explain everything.
2010-03-19 10:03:41 -06:00
Roland Scheidegger
3b9555094d cso: remove cso_set/save/restore_sampler_textures
no longer used after all statetrackers have been converted.
2010-03-19 16:30:47 +01:00
Roland Scheidegger
e5f0384ad0 st/vega: fix up vega state tracker to use cso changes
use cso fragment sampler views instead of sampler textures.
since we don't really change views, try to store sampler views instead
of the textures to avoid having to recreate views most of the time.
2010-03-19 16:29:22 +01:00
Brian Paul
8221a0e7f7 es: added -I$(TOP)/include path 2010-03-19 07:37:18 -06:00
Michal Krol
980da4aed2 gallium/docs: Clarify sampler view descriptions. 2010-03-19 09:08:33 +01:00
Corbin Simpson
8e1768cfd3 gallium/docs: Fix a couple ReST errors. 2010-03-19 00:07:55 -07:00
Marek Olšák
12a40dda39 r300g: lod min/max clamping should be relative to the base level 2010-03-19 04:46:15 +01:00
Marek Olšák
afae089194 r300g: fix breakage after the gallium-sampler-view merge 2010-03-19 04:09:07 +01:00
Ian Romanick
062a208814 intel: Use bit-wise not instead of logical not (i830 path)
The assertion is checking that the low-order bits of offset are not
set.  It does this by anding the inverted offset mask with the
offset.  This is clearly intended to be a bit-wise "invert".

Fixes bug #25984.
2010-03-18 17:30:15 -07:00
Ian Romanick
689e4b5541 intel: Correct value of S0_VB_OFFSET_MASK to match hardware docs. 2010-03-18 17:28:52 -07:00
Marek Olšák
f6e987ce78 r300g: add PIPE_FORMAT_B5G5R5X1_UNORM colorbuffer support, cleanups 2010-03-19 01:18:19 +01:00
Marek Olšák
0c81739528 r300g: mark SRGB colorbuffers as unsupported
I can't find the register bits for SRGB-aware blending and it's not even
exposed by fglrx so it's most probably not supported by hw.
2010-03-19 01:18:19 +01:00
Marek Olšák
cba6430524 r300g: add generating texture coordinates for point sprites (WIP) 2010-03-19 01:18:18 +01:00
Brian Paul
8df65e9899 gallivm: support PIPE_FORMAT_Z24S8_UNORM in depth/stencil code 2010-03-18 17:27:46 -06:00
Ian Romanick
fda5078324 Use bit-wise not instead of logical not.
The assertion is checking that the low-order bits of offset are not
set.  It does this by anding the inverted offset mask with the
offset.  This is clearly intended to be a bit-wise "invert".

Fixes bug #25984.
2010-03-18 15:35:05 -07:00
Brian Paul
c9c0baabdc progs/tests: also test stencil INCR_WRAP mode if supported 2010-03-18 15:04:39 -06:00
Brian Paul
66b6676d14 gallivm: fix broken INCR/DECR stencil modes
We were mistakenly using the wrong data type for stencil values before.
2010-03-18 15:02:15 -06:00
Brian Paul
705ed3326c progs/tests: comments and clean-ups 2010-03-18 14:53:43 -06:00
Brian Paul
22e6dc3870 gallivm/llvmpipe: added lp_rast_shader_inputs::facing and pass through
The triangle rasterizer sets this field to indicate front/back-facing.
It gets passed into the generated fragment code as another parameter.
Used now for stencil front/back selection but will also be used for
fragment shaders in general (see TGSI_SEMANTIC_FACE).

With this commit two-sided stenciling mostly works but there's
still a bug or two...
2010-03-18 13:06:32 -06:00
Brian Paul
d219b8a022 llvmpipe: defines for RAST_WHOLE, RAST_EDGE_TEST 2010-03-18 13:06:32 -06:00
Alan Hourihane
94abc4b51e Add format B5G5R5X1 2010-03-18 18:01:41 +00:00
Brian Paul
521c61ff01 gallivm/llvmpipe: simplify front/back stencil ref value handling
Instead of passing an array, just pass two scalar values.
2010-03-18 11:31:38 -06:00
Brian Paul
ecf85c7d75 gallivm: checkpoint WIP two-sided stencil test 2010-03-18 11:18:01 -06:00
Brian Paul
a1e7aeecc2 llvmpipe: set opaque = FALSE if stencil enabled
Fixes occasional bad tiles seen in some demos like progs/demos/reflect.c
2010-03-18 09:30:15 -06:00
Brian Paul
b7e8039132 st/mesa: s/unpack/pack/ to be more consistent 2010-03-18 09:17:11 -06:00
Francisco Jerez
3c0eab7148 dri/nouveau: Flush after texture validation.
Swizzling needs the destination surface in VRAM, but the subsequent
rendering operations making use of it are likely to not care. Fire the
ring after validation to leave the memory manager more room for
maneuvering.
2010-03-18 15:02:37 +01:00
Francisco Jerez
6193c41bcd dri/nouveau: Avoid pushbuf flushes in the middle of LMA setup. 2010-03-18 15:02:37 +01:00
Francisco Jerez
c944fb5ffe dri/nouveau: Implement texcoord generation. 2010-03-18 15:02:36 +01:00
Francisco Jerez
1a812ab57a dri/nouveau: Implement texture matrices. 2010-03-18 15:02:36 +01:00
Francisco Jerez
d475eae50b dri/nouveau: Some minor vertex submission fixes. 2010-03-18 15:02:35 +01:00
Xavier Chantry
50be9bc6ce dri/nouveau: only reallocate texture when needed
nouveau reallocated the mipmap tree on every MIN_FILTER call to account
for mipmap change. We only need to do this if the texture does not fit
in the existing mipmap tree. This gives a big performance boost for a
game like bzflag which changes MIN_FILTER all the time for its font
rendering.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-03-18 15:02:34 +01:00
Kristian Høgsberg
38bd7282f2 intel: Call _mesa_make_current() after getting initial buffers
The default viewport is the window rectangle, which is set up by
_mesa_make_current().  To be able to do that we need to get the
window dimension (and buffers) first, so we have to call
intel_prepare_render() before we can call into _mesa_make_current().

Fixes #26676 and #26678.
2010-03-18 09:53:41 -04:00
José Fonseca
9d48a621d2 llvmpipe: Fix crashes when there is no depth buffer bound. 2010-03-18 10:24:10 +00:00
Kristian Høgsberg
6de8e563ac intel: Call _mesa_make_current() after getting initial buffers
The default viewport is the window rectangle, which is set up by
_mesa_make_current().  To be able to do that we need to get the
window dimension (and buffers) first, so we have to call
intel_prepare_render() before we can call into _mesa_make_current().

Fixes #26676 and #26678.
2010-03-17 22:45:21 -04:00
Chia-I Wu
a0d615fd97 st/mesa: Set the pipe context of the texture object.
The field was added in b8030c6561.  This
fixes a NULL dereference in xdemos/texture_from_pixmap.
2010-03-18 09:43:23 +08:00
Chia-I Wu
bd1ce87472 st/dri: Switch from st_public.h to st_api.h.
This is tested with demos found in progs/demos.  However, only the DRI2
path is tested.
2010-03-18 09:43:22 +08:00
Chia-I Wu
5ff21634f3 st/dri: Implement st_api.h callbacks.
This commit adds dri_st_api.c that implements st_api.h callbacks.  A
following commit will switch st/dri from st_public.h to st_api.h.
2010-03-18 09:34:37 +08:00
Chia-I Wu
903b90926c st/dri: Headers and public symbols clean up.
Remove unused headers and stop marking driDriverAPI as PUBLIC.
2010-03-18 08:48:13 +08:00
Chia-I Wu
61631a89a3 st/dri: Move DRI1 bits in dri_context.c to dri1.c. 2010-03-18 08:48:13 +08:00
Chia-I Wu
a437bc50f2 st/dri: Move DRI1 bits in dri_drawable.c to dri1.c. 2010-03-18 08:48:13 +08:00
Chia-I Wu
ca69249f25 st/dri: Move DRI1 bits in dri_screen.c to dri1.c. 2010-03-18 08:48:12 +08:00
Brian Paul
05a980ac2a cell: return 1 for PIPE_CAP_BLEND_EQUATION_SEPARATE
With this feature, we get OpenGL version 2.0 and the progs/glsl/
demos run as-is.
2010-03-17 17:40:13 -06:00
Brian Paul
6dd4054ca5 cell: be more conservative in cell_is_format_supported()
This fixes a regression from commit a84575cdc0
which changed the depth/stencil format we were trying to use.
2010-03-17 16:35:29 -06:00
Brian Paul
0557d0a4b2 progs/trivial: added comments 2010-03-17 16:29:34 -06:00
Brian Paul
fecd4cde50 gallivm/llvmpipe: basic stencil testing works
Most stencil demos look OK (modulo some unrelated rendering glitches).
Only single-sided stencil test works at this point.
There are probably some bugs to be found...
2010-03-17 16:29:34 -06:00
Brian Paul
227824ac69 llvmpipe: remove incorrect depth test check 2010-03-17 16:29:34 -06:00
Brian Paul
2b8db4ce15 gallivm: added lp_build_andc() 2010-03-17 16:29:34 -06:00
Brian Paul
8dc8c3f5b1 llvmpipe: silence some pointer/casting warnings 2010-03-17 16:29:34 -06:00
Brian Paul
d1c9e59883 gallivm/llvmpipe: more asst changes for stencil testing 2010-03-17 16:29:34 -06:00
Brian Paul
67b82fc395 gallivm/llmvpipe: pass stencil refs state into z/stencil build code 2010-03-17 16:29:34 -06:00
Brian Paul
b8b1bb946f llvmpipe: use new LP_JIT_CTX_ enums for jit context field positions
Use the new enum values rather than integers in a few places.
2010-03-17 16:29:34 -06:00
Brian Paul
eee5114797 llvmpipe: added stencil ref values to jit context state 2010-03-17 16:29:34 -06:00
Brian Paul
6379e47ebd llvmpipe: break lines 2010-03-17 16:29:34 -06:00
Eric Anholt
362c1bf75e intel: Replace mt->pitch with mt->region->pitch.
The pitch is not really an inherent part of the miptree, since it's
not part of any of the layout calculations, and it's dictated by the
libdrm-allocated region pitch now.
2010-03-17 11:24:01 -07:00
Eric Anholt
30446f8a70 intel: Return false like other blit failure paths if out of aperture.
The primary consumer of this (miptree relayout) already has this code
for handling failure, and the other paths want to know if failure
actually occurs and do something appropriate, which may not include
memcpy.
2010-03-17 11:24:01 -07:00
Eric Anholt
e1e48ea15c intel: Respect src pitch in _mesa_copy_rect().
If a non-zero src_y was used, this would break piglit
depth-level-clamp.
2010-03-17 11:24:01 -07:00
Eric Anholt
da011faf48 intel: Rely on allocated region pitch for the miptree pitch.
Bug #26966: 945 miptree pitch disagreement with libdrm.
2010-03-17 11:23:43 -07:00
Eric Anholt
1a77f8af9b intel: Assert that the linear blits succeed.
We don't have any fallback code here, and we want to avoid this path
if failure would happen, so just assert.
2010-03-17 11:12:36 -07:00
Eric Anholt
0c51390e4b intel: Remove level_offset now that it's unused.
This is the last pitch-dependent part of miptree setup.
2010-03-17 11:12:36 -07:00
Eric Anholt
32f143b432 intel: Remove extra tiling setting after allocating a tiled region. 2010-03-17 11:12:36 -07:00
Eric Anholt
c479a20fce intel: Rename the z24_x8 depth spans to z24_s8 since they do stencil too. 2010-03-17 11:12:36 -07:00
Brian Paul
b22bb34533 llvmpipe: remove -m32 flag from linux-llvm config 2010-03-17 10:53:55 -06:00
Brian Paul
c11d582411 st/mesa: plug in default for pipe_context::surface_copy() if needed
This lets us avoid conditionals and duplicated code in several places.
2010-03-17 10:31:59 -06:00
Brian Paul
a196a5d330 progs/samples: improve copy.c demo
If the test image was larger than the window, nothing was drawn because
of invalid raster position.  Use glWindowPos instead of glRasterPos.
Also, use integer src/dst coordinates to avoid grabbing black pixels
outside of the src image region.
2010-03-17 10:17:06 -06:00
Brian Paul
ef92fe85de Merge branch '7.8'
Conflicts:

	src/mesa/state_tracker/st_cb_drawpixels.c
2010-03-17 10:13:51 -06:00
Brian Paul
bf1974b37d progs/samples: silence warnings 2010-03-17 10:11:09 -06:00
Brian Paul
1bfc314596 st/mesa: fix glCopyPixels bugs/crashes when src region need clipping
Use the _mesa_clip_readpixels() function to clip the src region against
the buffer's bounds.  Neatly, the resulting pixel unpack object's
SkipPixels/SkipRows fields can be used to determine the position of the
region in the destination texture.

Fixes crash in progs/samples/copy.c and probably other cases.
2010-03-17 10:06:27 -06:00
Brian Paul
c492227683 mesa: rename params in prototype to match implementation 2010-03-17 09:04:26 -06:00
Brian Paul
59e743b8d3 glapi: fix assorted warnings
And replace some instances of GLuint with unsigned int to avoid pulling in
GL/gl.h
2010-03-17 08:44:54 -06:00
Brian Paul
3828910d0e swrast: remove unused compute_coveragei() function 2010-03-17 08:42:59 -06:00
Corbin Simpson
90fe8c39f1 st/mesa: Fix build breakage.
Nearly certain this is what was intended; it compiles, but I'm not sure
this path is ever hit in my tests.
2010-03-17 04:35:14 -07:00
Pauli Nieminen
f0f04cd12d Merge branch '7.8' into master
Conflicts:
	Makefile
	src/mesa/main/version.h
2010-03-17 11:26:48 +02:00
Brian Paul
e1ee3eaf6d cell: build identity driver too 2010-03-16 16:47:02 -06:00
Brian Paul
a9a1b52f95 cell: add missing semicolon 2010-03-16 16:47:02 -06:00
Christoph Bumiller
e548babb1f nv50: support more formats in surface_copy,fill
Fixes corrupted fonts in bzFlag, where we've been silently
failing to copy I8 mipmaps to a new miptree.

Print an error message on unsupported format now, since we
can't return failure.
2010-03-16 22:47:24 +01:00
Eric Anholt
5782b2a968 i965: Fix readpixels from ReadBuffer != DrawBuffer.
Fixes piglit fbo-readdrawpix.
2010-03-16 13:23:35 -07:00
Eric Anholt
a589da14de i965: Fix inversion for glCopyPixels to/from FBOs.
fixes piglit fbo-copypix.
2010-03-16 13:18:54 -07:00
Eric Anholt
800a4b202f intel: Remove more code for x8z24 visuals, since we only do s8z24. 2010-03-16 13:18:54 -07:00
Eric Anholt
25becb8a7a Revert "i965: Do VS SGT, SLT, and friends using CMP, SEL instead of CMP, MOV, MOV."
This reverts commit 8ef3b1834a.  Fixes
piglit glsl-vs-if.
2010-03-16 13:18:54 -07:00
Eric Anholt
ba208604ea Revert "i965: Do FS SLT, SGT, and friends using CMP, SEL instead of CMP, MOV, MOV."
This reverts commit 46450c1f3f.  I was
wrong about null reg behavior -- it reads undefined, not 0.  And
they're not kidding.
2010-03-16 13:18:54 -07:00
Eric Anholt
7cbb7051f4 meta: Fix up restoration of state if _mesa_map_pbo_source() fails. 2010-03-16 13:18:54 -07:00
Eric Anholt
541c9c08e5 meta: Properly refcount our saved programs and texobjs.
Found while debugging bug #24119.
2010-03-16 13:18:53 -07:00
Brian Paul
7c45710859 gallium: add target-helpers/wrap_screen.c to C_SOURCES
Was commented out before.
2010-03-16 13:31:46 -06:00
Eric Anholt
a29c7948d9 i965: Fix ENDLOOP to only patch up this loop's BREAK and CONT.
Corresponds to d225a25e21a24508aea3b877c78beb35502e942d and fixes
piglit glsl-fs-loop-nested.  Bug #25173.
(cherry picked from commit a81836ee2f)
2010-03-16 12:15:18 -07:00
Eric Anholt
42e0e86866 i965: Unalias all GLSL source regs from the destination regs used.
We were doing it ad-hoc before, as instructions with potential
aliasing problems were identified.  But thanks to swizzling basically
anything can have aliasing, so just do it generally at source reg
setup time.  This is somewhat inefficient, because sometimes an
operation doesn't need unaliasing protection if the swizzling is safe,
but the unaliasing before didn't cover those cases either.

Fixes piglit glsl-fs-loop.
(cherry picked from commit 6b194dab6b)
2010-03-16 12:15:12 -07:00
Eric Anholt
d24f59d008 i965: Fix nested loops in the VS.
We were patching up all the break and continues between the start of
our loop and the end of our loop, even if they were breaks/continues
for an inner loop.  Avoiding patching already patched breaks/continues
fixes piglit glsl-vs-loop-nested.
(cherry picked from commit f6f547d87e)
2010-03-16 12:15:02 -07:00
Eric Anholt
009392f50d i965: Fix up VP constbuf leak on program delete.
(cherry picked from commit 7f6d2754d5)
2010-03-16 12:14:57 -07:00
Eric Anholt
1254d3d315 i965: Fix up the handling of point sprite coordinate replacement.
The code was walking over the regs of pairs of attributes and checking
whether the attribute with a given reg index had point sprite enabled.
So the point sprite setup code was rarely even getting executed.
Instead, we need to determine which channels of a reg need point
sprite coordinate replacement.  In addition, it was multiplying the
attribute by 1/w, when it's supposed to cover (0, 1) in each direction
regardless of w, and it wasn't filling in the Z and W components of
the texcoord as specified.

Fixes piglit point-sprite and the spriteblast demo.  Bug #24431, #22245.
(cherry picked from commit bc632d0437)
2010-03-16 12:14:48 -07:00
Eric Anholt
837f003eeb i965: Add support for the CMP opcode in the GLSL path.
This would be triggered by use of sqrt() along with control flow.
Fixes piglit-fs-sqrt-branch and a bug in Yo Frankie!.
(cherry picked from commit 48dca99feb)
2010-03-16 12:14:18 -07:00
Eric Anholt
7ee4db50b1 i965: Fix the response len of masked sampler messages for 8-wide dispatch.
The bad response length would hang the GPU with a masked sample in a
shader using control flow.  For 8-wide, the response length is always
4, and masked slots are just not written to.  brw_wm_glsl.c already
allocates registers in the right locations.

Fixes piglit glsl-fs-bug25902 (fd.o bug #25902).
(cherry picked from commit f6d210c284)
(cherry picked from commit dc8c035944)
2010-03-16 11:56:21 -07:00
Michal Krol
40c3861e1e st/mesa: Invalidate sampler view when texture object changes. 2010-03-16 19:40:15 +01:00
Ian Romanick
c1c9fad293 Remove nonexistant files from tarballs rule of Makefile
The Makefile should eventually be fixed to stop building tarballs if
one of the individual calls to tar fails.
2010-03-16 10:21:37 -07:00
Ian Romanick
f0c3262927 mesa: set version string to 7.8-rc1 2010-03-16 10:21:37 -07:00
Matthew W. S. Bell
d320152b47 Correct GL_EQUIV code in r67/7xx.
From 247e121106e8d3e389f2e5a6edf13ea70ac18df7 Mon Sep 17 00:00:00 2001

These seem to be documented in
<http://www.svgopen.org/2003/papers/RasterOperationsUsingFilterElements/index.html>.
2010-03-16 11:39:53 -04:00
Roland Scheidegger
ac8662c29d st/xorg: fix up xorg state tracker to use cso changes
use cso_set_fragment_sampler_views instead of cso_set_sampler_textures
2010-03-16 16:24:27 +01:00
Pauli Nieminen
e9c2c4a764 radeon: Fix buffer object unmap to be called only once for dma buffers.
If flush happens inside radeonRefillCurrentMaRegion the last dma buffer would
be unmapped twice. Unmapping buffer when moving buffer to wait list fixes the
mapping error.
2010-03-16 17:00:14 +02:00
Brian Paul
e1a4bb2370 regenerate gl_mangle.h to get new EGLImage functions 2010-03-16 07:56:56 -06:00
José Fonseca
759c1c287c libgl-xlib: Use a simple GALLIUM_DRIVER env var to select the pipe driver.
GALLIUM_DRIVER is being used in many other places, and it easier to
memorizing and understand than all the GALLIUM_NO_XXX.
2010-03-16 13:48:09 +00:00
José Fonseca
d731190ec3 gallium: Silence warning. 2010-03-16 13:46:10 +00:00
Roland Scheidegger
8f55a95178 gallium: change remaining util functions to use cso sampler views
changes arguments of util_blit_pixels_tex and util_gen_mipmap to
struct pipe_sampler_view * instead of struct pipe_texture *.
2010-03-16 11:25:12 +01:00
Michal Krol
e4b8a307b2 gallium/docs: Create a separate section for Sampler Views. 2010-03-16 10:58:33 +01:00
Keith Whitwell
8cdfd1219a Merge commit 'origin/master' into gallium-sampler-view
This branch already seems to have the nv50_tex.c fix.

Conflicts:
	src/gallium/drivers/nv50/nv50_tex.c
2010-03-16 09:02:38 +00:00
Chia-I Wu
e0ce4a4a09 i965g: Fix use of an uninitialized variable. 2010-03-16 15:51:17 +08:00
Chia-I Wu
9d3a873f42 Merge remote branch 'origin/gallium-st-api' 2010-03-16 15:12:46 +08:00
Ben Skeggs
95d43bccde nv50: fix texturing from >=4GiB mark 2010-03-16 13:18:39 +10:00
Jakob Bornecrantz
b586774016 llvmpipe: Fix rebase typo 2010-03-16 01:17:33 +00:00
Jakob Bornecrantz
8b63f9b497 winsys/sw: Add a software winsys layered on a pipe 2010-03-16 01:06:46 +00:00
Jakob Bornecrantz
eaee22ac88 i965g: Fix after context transfers 2010-03-16 01:06:46 +00:00
Brian Paul
cb1b0b4bec gallivm: checkpoint: stencil test code 2010-03-15 18:19:04 -06:00
Brian Paul
185be3a87a gallivm/llvmpipe: rename some constant building functions 2010-03-15 18:16:56 -06:00
Brian Paul
c86a499769 gallivm: fix up some #includes 2010-03-15 18:16:56 -06:00
Brian Paul
0d71ba46e6 gallivm/llvmpipe: rename os_llvm.h to lp_bld.h
The llvm wrapper wasn't really an OS thing.

Use lp_bld.h for now but we eventually should rename/re-prefix all the
files/functions in the gallivm/ directory.
2010-03-15 18:16:56 -06:00
Ian Romanick
e309a6051d Add multiple include protection to ir.h 2010-03-15 15:20:15 -07:00
Ian Romanick
5c2bd09888 Trivial clean-ups to ast_type_specifier(int) constructor 2010-03-15 14:31:48 -07:00
Ian Romanick
ed85a5dd4b Add new constructors for ast_type_specifier
Add a constructor that uses an ast_struct_specifier and one that uses
a type name.  This saves a (trivial) bit of code, but it also ensures
some of the class invariants (i.e., type_name != NULL) are met.
2010-03-15 14:28:17 -07:00
Ian Romanick
7f9d309743 Ensure that ast_type always has type_name set
For built-in types, type_name would be NULL.  This ensures that
type_name is set even for the built-in types.  This simplifies code in
a few places and centralizes the name setting code.
2010-03-15 14:18:32 -07:00
Ian Romanick
bbddcb3092 Factor ast_type_specifier code out to ast_type.cpp 2010-03-15 14:09:23 -07:00
José Fonseca
3eb4b7bbec libgl-xlib: Obey GALLIUM_SOFTPIPE define. 2010-03-15 21:04:58 +00:00
Dave Airlie
8e848d682e gallium: fix frontbuffer rendering with r300g
No idea if this is the correct fix, but it makes it work again at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-16 06:51:04 +10:00
Ian Romanick
f4749610ed Factor guts of function matching code out to match_function_by_name
This function will be used for matching some types of constructors as well.
2010-03-15 13:26:02 -07:00
Ian Romanick
548fa293a3 Move ast_function_expression::hir to ast_function.cpp 2010-03-15 13:04:13 -07:00
Ian Romanick
728330e3b2 Remove DOA hir_function.c file 2010-03-15 13:02:08 -07:00
Zack Rusin
275c4bd364 Merge remote branch 'origin/master' into gallium_draw_llvm 2010-03-15 15:24:38 -04:00
Brian Paul
d0b35352ed llvmpipe: updated status in README file 2010-03-15 11:46:41 -06:00
Brian Paul
aa3cdb712f progs/objviewer: remove debug code 2010-03-15 11:31:59 -06:00
Brian Paul
d25d3cc008 gallivm: fix typo/bug in lp_build_sgn()
We were never returning -1 as a result.  This fixes some inverted/flipped
faces with cube mapping.
2010-03-15 11:30:05 -06:00
Keith Whitwell
6420aca08b cso: Do not hold references to bound textures.
Sampler views already hold references to those.
2010-03-15 17:56:19 +01:00
Brian Paul
1d6d51413e gallivm: add min_lod==max_lod special-case code in lp_build_lod_selector()
When min_lod==max_lod we don't need to go through all the work of
computing the lod from partial derivatives.  This is hit by the mipmap
generation utility code.
2010-03-15 10:51:58 -06:00
Brian Paul
b9a81b626a gallivm: asst clean-ups, comments, etc. 2010-03-15 10:43:05 -06:00
Brian Paul
eecf9c85b0 gallivm: implement minification/magnification selection
Use the LOD value to determine whether to use the minification vs.
magnification filter.

All mipmap sampling modes work now.
2010-03-15 10:36:58 -06:00
Brian Paul
e0f7c3cbf0 gallivm: fix incorrect clamp in lp_build_linear_mip_levels() 2010-03-15 10:31:20 -06:00
Brian Paul
f9d753787e gallivm: fix incorrect floor(), itrunc()
LLVMBuildFPTrunc() should be used for double->float conversion, not
float->int conversion.

There should be a better way to compute floor(), ceil(), etc that doesn't
involve float->int->float conversion.
2010-03-15 10:29:10 -06:00
Michal Krol
3949388ca3 st/mesa: Fix a call to st_get_stobj_sampler_view(). 2010-03-15 15:04:12 +01:00
Michal Krol
6b60820fde st/mesa: Pass in correct sampler view object to blitter. 2010-03-15 15:03:44 +01:00
Michal Krol
df65fc8100 util: Fix nil pointer reference. 2010-03-15 14:42:44 +01:00
Luca Barbieri
50d96f741e nv40: remove leftover nv40_transfer.c from unification into nvfx 2010-03-15 08:47:03 -04:00
Michal Krol
f2bc089d14 gallium: util_blit_pixels() takes source sampler view as argument. 2010-03-15 13:22:40 +01:00
Michal Krol
dbf20a1f0f st/mesa: Cache FBO texture's sampler view object. 2010-03-15 13:22:40 +01:00
Chia-I Wu
a66d008104 st/mesa: Update the comments in st_manager.c. 2010-03-15 19:15:43 +08:00
Keith Whitwell
08189e6391 nvfx: fix up after merge 2010-03-15 10:27:25 +00:00
Keith Whitwell
506130fff5 r300g: fix up after merge 2010-03-15 10:24:55 +00:00
Keith Whitwell
42910ebe7b Merge commit 'origin/master' into gallium-sampler-view
Conflicts:
	src/gallium/drivers/nv30/nv30_context.h
	src/gallium/drivers/nv30/nv30_state.c
	src/gallium/drivers/nv40/nv40_context.h
	src/gallium/drivers/nv40/nv40_state.c
	src/gallium/drivers/r300/r300_emit.c
2010-03-15 09:44:52 +00:00
Dave Airlie
68e58a96e8 r300g: rebuild screen/winsys interface
This creates a cleaner winsys and drop the simple screen stuff.

It makes r300g use pb_bufmgr structs.

It also tries to avoid overheads from mapping too often.

v5: clean warnings

v6: break out of cache check on first buffer - since most likely
the first busy one implies all after it are busy.

v7: cleanup a bit

v8-merged: drop cman for now to just get all the interface changes in first.
rework to changes that happened upstream

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-15 18:36:47 +10:00
Ben Skeggs
a899c5a76e nv50: reset vbo_fifo before each validate 2010-03-15 16:53:46 +10:00
Luca Barbieri
9b3a908736 nvfx: remove src_native_swz, which was a no-op
src_native_swz was used to translate 0/1 swizzles back when Gallium
supported them.

That support was later removed from Gallium, and the function currently
always returns true.

Remove it.
2010-03-15 00:03:05 -04:00
Luca Barbieri
49f2a89956 nvfx: clean up shader header
Currently the behavior of shader.h depends on some constants that
are defined differently in vertex and fragment programs.

This patch cleans that up by splitting the relevant symbols in
vertex program and fragment program variants
2010-03-15 00:03:05 -04:00
Luca Barbieri
a174db480b nvfx: draw: make swtnl draw_elements actually work.
It was totally broken: the index buffer was passed as NULL!
2010-03-15 00:03:04 -04:00
Luca Barbieri
152dffd3e1 nvfx: draw: emit color as floating point
Don't lose precision by converting to u8.
2010-03-15 00:03:04 -04:00
Luca Barbieri
ac7ae8bc6a nvfx: draw: make perspective corrective texturing work
We must divide everything in the position by w, and emit position as
a 4-component vector.

Not sure why we must divide, but it works (see progs/redbook/checker).
2010-03-15 00:03:04 -04:00
Luca Barbieri
ad2d0c2639 nvfx: draw: create draw vp with ureg
This avoids duplicating the vertex program generation logic and
makes the same code work for both nv30 and nv40.
2010-03-15 00:03:04 -04:00
Luca Barbieri
d40a069206 nvfx: add NOUVEAU_SWTNL to force swtnl at runtime
Replace the FORCE_SWTNL macro with a NOUVEAU_SWTNL environment variable.
2010-03-15 00:03:04 -04:00
Luca Barbieri
dbe63ed3b6 nvfx: move nv04_surface_2d.c into nvfx directory
It is only used on pre-nv50 and nvfx is the only Gallium pre-nv50 driver.
2010-03-15 00:03:04 -04:00
Luca Barbieri
e1580ce4c9 nvfx: fix quads drawing
The primitive splitting code is totally broken and will be rewritten.

Fix the most important bug now though.
2010-03-15 00:03:04 -04:00
Luca Barbieri
0192a4a825 nvfx: fix viewport state after bypass removal for swtnl
The adjustment of nv30/nv40 after the removal of bypass incorrectly
removed the hardware viewport bypass code, which we still need for
swtnl and also forgot to remove NVFX_NEW_RAST from pipe.
2010-03-15 00:03:04 -04:00
Luca Barbieri
f9d09a2e78 nv30, nv40: move last files to nvfx/ and rm -rf nv30 nv40
This is the last nvfx unification patch.

nv[34]0_fragtex.c are moved to the common directory
nv[34]0_shader.h are renamed to nv[34]0_vertprog.h and moved to
the common directory

The separate nv30 and nv40 directories are removed from the build
system
2010-03-15 00:03:04 -04:00
Luca Barbieri
7d210fa05f nv30, nv40: partially non-trivially unify sampler state in nv[34]0_state.c
Many things, like texture wrap modes and min/mag filters are common.

Some others, like annisotropy and lod settings, are not.
2010-03-15 00:03:03 -04:00
Luca Barbieri
5bb68e5d17 nv30, nv40: partially non-trivially unify nv[34]0_fragtex.c
The bulk files cannot be unified, but the frontend can and allows to
share some code and simplify state_emit.c
2010-03-15 00:03:03 -04:00
Luca Barbieri
da5103c3b3 nv30, nv40: unify nv[34]0_context.c
They are now almost identical, except for nv30 vs nv40 fragtex
initialization.
2010-03-15 00:03:03 -04:00
Luca Barbieri
6992be5433 nv30, nv40: fully unify nv[34]0_context.h
Move the remaining content to the common header.
2010-03-15 00:03:03 -04:00
Luca Barbieri
10f464fc10 nv30, nv40: non-trivially unify nv[34]0_screen.c
The files have the same structure but are substantially different.

They are unified with appropriate conditionals.
2010-03-15 00:03:03 -04:00
Luca Barbieri
840c36f5e6 nv30, nv40: non-trivially unify nv[34]0_vertprog.c
vertprog.c is similar but has substantial differences:
1. nv40 supports clip planes
2. nv40 uses a more advanced register allocator
3. Some register setup is different
4. Constants with the same name have different values

This patch unifies the two files.
nv30 gains clip plane support and the nv40 register allocator.

A new NVFX_VP(x) macro is introduced that at runtime resolved to
either the nv30 or the nv40 constant value.

nv30 clip planes are not tested and might not work
2010-03-15 00:03:03 -04:00
Luca Barbieri
c65a8f3ed2 nv30, nv40: partially unify nv[34]0_state.c
state.c is identical except for:
1. Sampler state creation is different
2. nv40 swtnl support
3. Separate blend equations on nv40

This patch unifies nv[34]0_state.c, except the sampler state creation code.
2010-03-15 00:03:03 -04:00
Luca Barbieri
6e1d0fc5eb nv30, nv40: unify nv[34]0_vbo.c
The files are identical, except for swtnl support which is commented
out on nv30 and restart being initialized on nv30 to avoid a compiler
warning.
2010-03-15 00:03:03 -04:00
Luca Barbieri
f9eafeca29 nv30, nv40: non-trivially unify nv[34]0_draw.c
nv30_draw.c is a stub.

This patch makes both nv30 and nv40 use the nv40 swtnl path.

Note that this doesn't actually work on nv30 because the vertex program is
encoded in the nv40-only layout.

However, swtnl was unimplemented before on nv30, so this is not a regression.
Furthermore, a patch to fix this is available near the end of the patchset.
2010-03-15 00:03:03 -04:00
Luca Barbieri
bcb37411fc nv30, nv40: non-trivially unify nv[34]0_fragprog.c
The files are mostly the same except:
1. On NV40, some TGSI instructions are emulated with several hardware ones
2. Some instructions such as DDX/DDY, and STR were missing from nv30
3. NV40 has more sophisticated register management

nv30 now supports all instructions and uses the nv40 register management.
2010-03-15 00:03:02 -04:00
Luca Barbieri
d9e396ce4a nv30, nv40: non-trivially partially unify nv[34]0_shader.h
shader.h is similar, except for the following differences:
1. The instruction sets are not exactly the same, but mostly similar
2. Vertex program fields are in different bit positions

This patch unifies all parts of nv[34]0_shader.h except the vertex
program fields.

Vertex opcodes are also changed so that the constant names includes
SCA if it is a scalar opcode and VEC if it is a vector opcode.
2010-03-15 00:03:02 -04:00
Luca Barbieri
cd0d03adab nv30, nv40: non-trivially unify nv[34]0_state_fb.c
The files are significantly different due to:
1. nv30 support 2 render targets, nv40 4
2. z-buffer pitch is set differently
3. nv30 has a limitation of colour_bits >= zeta_bits. This may not
   actually exist in the driver though
4. nv30 points color0 at depth in the depth-only case
5. nv30 sets NV34TCL_VIEWPORT_TX_ORIGIN to 0. This is probably
   unnecessary

This patch attempts to unify the two files and preserve the existing
behavior.
2010-03-15 00:03:02 -04:00
Luca Barbieri
4d93ef1a01 nv30, nv40: unify nv[34]0_state_viewport.c
The files are identical, except for an extra comment in nv30.
2010-03-15 00:03:02 -04:00
Luca Barbieri
9937116c7b nv30, nv40: unify nv[34]0_query.c
The files are identical except formatting.
2010-03-15 00:03:02 -04:00
Luca Barbieri
8611a31bb4 nv30, nv40: unify nv[34]0_miptree.c
The only difference between nv30 and nv40 is that nv30 allowed swizzling
for more texture types.

This patch preserves the existing behavior, using conditional code.

Note however that this does not make sense, since all texture types can
be swizzled on nv40 and probably on nv30 too.

However, the handling of swizzled surfaces in the current 2D code is
partially broken, so it's best not to touch this.

A whole rewrite of the 2D code will be submitted, which will solve this
problem.
2010-03-15 00:03:02 -04:00
Luca Barbieri
e392e0b148 nv30, nv40: unify nv[34]0_state_stipple.c
The files are identical, except for the fact that the nv40 version
forgets to unreference the stateobj.

Unified to the correct nv30 version.
2010-03-15 00:03:02 -04:00
Luca Barbieri
64d882637d nv30, nv40: unify identical nv[34]0_state_zsa.c 2010-03-15 00:03:02 -04:00
Luca Barbieri
938c6905cf nv30, nv40: unify identical nv[34]0_state_scissor.c 2010-03-15 00:03:02 -04:00
Luca Barbieri
ada801222b nv30, nv40: unify identical nv[34]0_state_rasterizer.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
0b55e1cd17 nv30, nv40: unify identical nv[34]0_state_blend.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
778c64da97 nv30, nv40: non-trivially unify nv[34]0_state_emit.c
The files are the same except for swtnl support on nv40 and for
texture cache flushing on nv40.

Unify them, and use a macro to define 4 versions of render_states,
for all combinations of nvfx and hwtnl/swtnl.
2010-03-15 00:03:01 -04:00
Luca Barbieri
d084d189d0 nv30, nv40: unify identical nv[34]0_transfer.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
c5c7b69bda nv30, nv40: unify identical nv[34]0_clear.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
6321a18331 nvfx: add nvfx directory to build system
Will be used to hold source files unified between nv30 and nv40.

Eventually all nv30 and nv40 code will be moved there and the
nv30 and nv40 directories will be removed.
2010-03-15 00:03:01 -04:00
Luca Barbieri
6518a1c853 nv30, nv40: add is_nv4x member to context and screen structs
This will make it faster to check for nv40.
2010-03-15 00:03:01 -04:00
Luca Barbieri
b8e56d4cdd nv30, nv40: unify all structures and headers, except shaders
This patch unifies nv[34]0_screen.h, nv[34]0_context.h and
nv[34]0_state.h

The unified files are put in a new "nvfx" directory.

nv30_context.h and nv40_context.h still exist to hold the function
prototypes and include nvfx_context.h

nv[34]0_screen.h and nv[34]0_state.h are deleted, replaced by the
unified versions.

nv40 includes some extra fields for swtnl and user clip planes
support.

These fields will be unused on nv30 until that functionality gets
added to it too (by unification with nv40).
2010-03-15 00:03:01 -04:00
Luca Barbieri
d673c92810 nouveau: s/rankine/eng3d/g; s/curie/eng3d/g
Result of running:
perl -i -p -e 's/rankine/eng3d/g; s/curie/eng3d/g;' nv[34]0/*.[ch]

This will allow to more easily unify nv30 and nv40.
2010-03-15 00:03:01 -04:00
Luca Barbieri
1771d8f8f4 nv30: remove unused on_hw field and constant fp_reg_control field
This makes nv30_state.h equivalent to nv40_state.h
2010-03-15 00:03:00 -04:00
Luca Barbieri
5f71414fc9 nv40: use NV34TCL_ constants where available
It was decided to just use the NV34TCL_ constants for constants
common between nv30 and nv40, and deprecate the NV40TCL_ versions.

This patch changes the nv40 driver to use NV34TCL_ constants for
common functionality.

This reduces differences between nv30 and nv40 to ease further
unification.
2010-03-15 00:03:00 -04:00
Vinson Lee
883aa5974b r300g: Remove unnecessary headers. 2010-03-14 16:43:01 -07:00
George Sapountzis
631a1a9ac8 dri/common: mv __driUtilMessage to utils.c
allows to link with xmlconfig without dri_util, and has nothing drm-specific.
2010-03-15 01:17:18 +02:00
George Sapountzis
7a62c60ca9 dri/swrast: add comment in case it's not clear 2010-03-15 01:17:18 +02:00
George Sapountzis
e557c2e14f dri/swrast: drop mtypes.h from dri_sw 2010-03-15 01:17:18 +02:00
George Sapountzis
e60693efda dri/swrast: update copyright email 2010-03-15 01:17:17 +02:00
George Sapountzis
c1bde79359 dri/swrast: port to dri_sw (drawable) 2010-03-15 01:17:17 +02:00
George Sapountzis
cf8a1caa23 dri/swrast: port to dri_sw (context) 2010-03-15 01:17:17 +02:00
George Sapountzis
6e376485c1 dri/swrast: port to dri_sw 2010-03-15 01:17:17 +02:00
George Sapountzis
06ebc46e65 dri: add dri_sw.c helper
This is dri_util.c stripped from the drm-specific bits and will be used for
both classic and gallium swrast_dri.so
2010-03-15 01:17:16 +02:00
Vinson Lee
725d77a6b5 trace: Remove unnecessary headers. 2010-03-14 15:47:05 -07:00
Vinson Lee
08cddfe291 svga: Remove unnecessary header. 2010-03-14 15:38:04 -07:00
George Sapountzis
41eab95b3b glapi: exec_malloc for dispatch stubs 2010-03-14 22:24:27 +02:00
George Sapountzis
8fd7ee1815 glapi: this one should be by THREAD 2010-03-14 22:24:26 +02:00
George Sapountzis
9a649c8eaa glapi: more organize code by arch
It seems that x86-64 with tls will fail to compile or load due to a missining
gl_dispatch_functions_start symbol. Not changing though, since this is how it
used to be and cannot test.
2010-03-14 22:24:25 +02:00
George Sapountzis
0ed0114de9 glapi: organize arch-specific code by arch (2) 2010-03-14 22:24:25 +02:00
George Sapountzis
6c8e5151f1 glapi: organize arch-specific code by arch 2010-03-14 22:24:24 +02:00
Marek Olšák
6e4b05637f r300g: remove pipe_context from r300_screen 2010-03-14 14:40:38 +01:00
Chia-I Wu
23e9a25e1f st/glx: Fix glXCopySubBufferMESA.
Honor the (x, y) and (width, height) pairs.
2010-03-14 14:59:55 +08:00
Chia-I Wu
d6262bdcfb st/glx: Sync the back buffer to the front buffer.
Consider this rendering sequence

  * render to the back buffer
  * swap buffers
  * read from the front buffer

The front buffer is expected to have the contents of the back buffer.
2010-03-14 13:16:24 +08:00
Chia-I Wu
48bc3cca89 st/glx: Add support for GLX_MESA_copy_sub_buffer.
Create a per-display pipe_context as needed to copy the contents between
framebuffer attachments.  This allows us to support
GLX_MESA_copy_sub_buffer.
2010-03-14 13:16:21 +08:00
Chia-I Wu
6632915e95 st/glx: Add xmesa_display to hold per-display variables.
This basically adds a static xmesa_display to collect per-display static
variables in xm_api.c.  Multiple display support is still missing, but
this is a step forward.
2010-03-14 11:27:53 +08:00
Chia-I Wu
4a30330b26 st/mesa: Fix handling of FBO.
FBOs are created by st_new_framebuffer and cannot be casted to
st_framebuffer.
2010-03-14 10:23:51 +08:00
Vinson Lee
2615bba182 softpipe: Remove unnecessary header. 2010-03-13 18:05:39 -08:00
Dan Nicholson
de4ee20578 gallium: Respect user's CFLAGS for including X headers
This can break on systems that don't have a system X installation.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-13 11:56:59 -08:00
Jeff Smith
8d86d395dc Use X_LIBS from pkg-config, instead of libdir, for locating libX11
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-13 11:42:24 -08:00
José Fonseca
392d37609d llvmpipe: Switch to PIPE_TEX_MIPFILTER_NONE when texture has no mipmaps. 2010-03-13 19:11:33 +00:00
Marek Olšák
3996e49369 r300g: add high quality anisotropic filtering for R5xx (disabled by default)
Oh look, an undocumented feature. It's a nice tool for benchmarking
texturing.
2010-03-13 18:23:27 +01:00
Marek Olšák
d5749fb6fc r300g: fix anisotropic filtering, fix macrotiling
Two bug fixes at the same time. :)
2010-03-13 18:23:27 +01:00
Marek Olšák
bcec6d851c r300g: refrain from using immediate mode if it causes slowdown
E.g. when mapping buffers could flush CS or cause waiting
for a busy buffer.

The side effect of this is it also fixes progs/demos/arbocclude however
a separate fix should be proposed to address this issue in other cases
it might occur.
2010-03-13 18:23:27 +01:00
Marek Olšák
e31bca139f r300g: fix up function names 2010-03-13 18:23:26 +01:00
Maciej Cencora
abc847c20d radeon: add some debuging info for glCopyTex(Sub)Image 2010-03-13 17:33:48 +01:00
Maciej Cencora
18ecf41835 r300: blits for small dst pitch work just fine 2010-03-13 17:30:19 +01:00
Maciej Cencora
aba40bd434 radeon: fix gl format to mesa format mapping and add GL_BGRA formats 2010-03-13 17:30:19 +01:00
Maciej Cencora
1a8a230a61 radeon: fix glCopyTex(Sub)Image
Fallback to swrast for software renderbuffers
2010-03-13 17:30:19 +01:00
José Fonseca
bf40c34663 llvmpipe: Ensure the context is flushed before modifying textures. 2010-03-13 16:13:26 +00:00
José Fonseca
3abc7b985c llvmpipe: Don't use texture transfer internally.
Now that transfers are context objects their sideeffects must happen in
order when used by the state tracker, but that synchronization must be
bypassed when used inside the driver, or it would cause infinite
recursion.
2010-03-13 16:04:06 +00:00
Keith Whitwell
47bfbd452c Merge commit 'origin/master' into gallium-sampler-view
Conflicts:
	src/gallium/auxiliary/util/u_tile.c
	src/gallium/auxiliary/util/u_tile.h
	src/gallium/drivers/identity/id_context.c
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/llvmpipe/lp_setup.h
	src/gallium/drivers/softpipe/sp_tex_tile_cache.c
	src/gallium/include/pipe/p_context.h
	src/mesa/state_tracker/st_cb_bitmap.c
	src/mesa/state_tracker/st_cb_drawpixels.c
2010-03-13 15:06:35 +00:00
Chia-I Wu
8c210c1b3b st/mesa: Validate the state in st_readpixels.
The front renderbuffer of a framebuffer is usually added as needed when
glReadBuffer(GL_FRONT) is called.  When the call is followed by
glReadPixels, we should validate the state before reading from the
renderbuffer.
2010-03-13 20:34:45 +08:00
José Fonseca
a80e33f407 llvmpipe: Obey rasterization rules.
Replicates softpipe.
2010-03-13 11:23:52 +00:00
José Fonseca
3160cbabcc llvmpipe: setup_context -> lp_setup_context
Otherwise IDEs and debuggers have trouble distinguishing from softpipe's
setup_context.
2010-03-13 11:23:52 +00:00
Xavier Chantry
83fe7149ea nv50: fixup after gallium-context-transfers merge 2010-03-13 11:33:27 +01:00
José Fonseca
50a7786619 python: Temporarily disable python state tracker until transfers are done by contexts
It requires changes not ony to the state tracker but to the python
scripts too.
2010-03-13 10:26:28 +00:00
Chia-I Wu
66cd38f465 st/glx: Fix framebuffer validation.
When xmesa_st_framebuffer_validate was called twice with different sets
of attachments, the second call was ignored.  Add a texture_mask to
remember which textures have been requested to make sure the missing
ones get created.
2010-03-13 17:41:45 +08:00
Chia-I Wu
418b9ac299 st/glx: Correctly set buffer_mask of a visual.
Stupid typos again..
2010-03-13 17:40:05 +08:00
Chia-I Wu
f91d8c6885 st/mesa: Set revalidate in st_framebuffer_update_attachments.
There are two conditions that a validation is required.  One is when the
the framebuffer becomes invalid.  The other is when we request for
textures that we did not request before.
2010-03-13 17:01:27 +08:00
Chia-I Wu
813c58d77e st/glx: Make xmesa_create_st_api a callback of xm_driver.
Instead of guessing the API in st/glx, let the target decide how to
create st_api.
2010-03-13 16:05:09 +08:00
Chia-I Wu
fecb97aab4 st/egl: Fix eglCopyBuffers.
Use a (real) pipe context to copy between pipe surfaces.  Fix a NULL
dereference of the temporary native surface created for copying.
2010-03-13 15:14:56 +08:00
Chia-I Wu
495bfb0ad2 st/glx: Fix leaks in xmesa_st_framebuffer.
The textures and surface of a framebuffer should be unreferenced when
the framebuffer is destroyed.
2010-03-13 13:06:00 +08:00
Chia-I Wu
9222c09349 st/egl: Cache the pipe surface used in flush_frontbuffer.
It is very likely that the same surface will be flushed again and again.
Caching the surface should reduce the overhead of surface creation.
2010-03-13 13:05:21 +08:00
Alan Coopersmith
5d66fc6e3a mklib: Fix amd64 builds on Solaris when using Sun compilers
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-12 19:04:19 -08:00
Corbin Simpson
2764a5191f r300g: Forcibly sanitize max index.
Not perfect, but the kernel should shut up now.
2010-03-12 18:13:18 -08:00
Corbin Simpson
ecfcb1466a Revert "st/mesa: Always recalculate invalid index bounds."
This reverts commit 50876ddaaf.

Per ML discussion.
2010-03-12 17:58:59 -08:00
Brian Paul
3c80e52541 gallivm: cube map sampling works now 2010-03-12 16:55:28 -07:00
Brian Paul
e910c0ba9e gallivm: fix bugs in nested if/then/else codegen
Quite a bit a hair pulling was involved...
2010-03-12 16:55:28 -07:00
Brian Paul
a6196ce8be gallivm: support non-vector float in lp_build_sgn() 2010-03-12 16:55:28 -07:00
Eric Anholt
f1d6baee0b i965: Clarify the roles of emit_pixel_xy(), emit_delta_xy(), emit_wpos_xy(). 2010-03-12 15:12:02 -08:00
Eric Anholt
f4f2737e87 i965: Clarify that DELTAXY always occurs for both X and Y. 2010-03-12 15:12:02 -08:00
Eric Anholt
46450c1f3f i965: Do FS SLT, SGT, and friends using CMP, SEL instead of CMP, MOV, MOV. 2010-03-12 15:12:01 -08:00
Eric Anholt
8ef3b1834a i965: Do VS SGT, SLT, and friends using CMP, SEL instead of CMP, MOV, MOV. 2010-03-12 15:12:01 -08:00
Eric Anholt
512d8ca2f3 i965: Fix up VS DP4 sequences to avoid dependency control.
This is recommended by the B-Spec.  I wasn't able to measure any
difference in ETQW.
2010-03-12 15:12:01 -08:00
Eric Anholt
52cea5090c i965: When doing a swizzled kill pixel, don't do redundant channel compares.
This was obvious when looking at the compiled output of ETQW's
shaders.
2010-03-12 15:12:01 -08:00
Eric Anholt
ba541b0769 i965: Use the SEL instruction to implement MIN and MAX.
Saves an instruction over doing conditional moves.
2010-03-12 15:12:01 -08:00
Michel Dänzer
13a13fcb80 svga: Fix up for context transfers. 2010-03-12 19:52:24 +01:00
Michel Dänzer
59d6f3eb4a st/xorg: Remove flushes no longer necessary thanks to context transfers. 2010-03-12 19:52:24 +01:00
Alan Coopersmith
57c378a531 glx/single2.c: Don't call __builtin_expect on non-gnu compilers
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-12 10:28:13 -08:00
Michel Dänzer
b13e305ee1 Merge branch '7.8' 2010-03-12 19:00:47 +01:00
Alex Deucher
d1ca1599f0 r100/r200/r300/r300: only enable accelerated pixel ops with kms
fixes fdo bug 27043
2010-03-12 11:19:36 -05:00
Michal Krol
faa1481885 cso: Remove set/save/restore_vertex_sampler_textures(). 2010-03-12 14:43:11 +01:00
Michal Krol
b8030c6561 st/mesa: Associate a sampler view with an st texture object.
Lazily create a sampler view when the texture is being bound
for the first time.
2010-03-12 14:38:23 +01:00
Michal Krol
08f89988c8 cso: Add entry points for vertex/fragment sampler views. 2010-03-12 14:38:23 +01:00
Keith Whitwell
475ab3b5af st/xorg: context transfers 2010-03-12 12:15:09 +00:00
Marek Olšák
c16d04bd29 gallium: fix BGRA vertex color swizzles
The mapping for vertex_array_bgra:
(gl -> st -> translate)
GL_RGBA -> PIPE_FORMAT_R8G8B8A8 (RGBA) -> no swizzle (XYZW)
GL_BGRA -> PIPE_FORMAT_A8R8G8B8 (ARGB) -> ZYXW (BGRA again??)

Iẗ́'s pretty clear that PIPE_FORMAT_A8R8G8B8 here is wrong. This commit
fixes the pipe format and removes obvious workarounds in util/translate.

Tested with: softpipe, llvmpipe, r300g.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-03-12 12:00:27 +00:00
Corbin Simpson
50876ddaaf st/mesa: Always recalculate invalid index bounds.
These should always be sanitized before heading towards the pipe driver,
and if the calling function explicitly marked them as invalid, we need
to regenerate them.

Allows r300g to properly pass a bit more of Wine's d3d9 testing without
dropping stuff on the floor.
2010-03-12 02:54:10 -08:00
Corbin Simpson
a48e17ccb0 st/mesa: Update debug infos.
Still commented out, of course.
2010-03-12 02:54:10 -08:00
Corbin Simpson
e42b2f7685 r300g: Properly clamp index limits.
Make the kernel even less likely to barf on us.
2010-03-12 02:54:10 -08:00
Keith Whitwell
915b3529b9 Merge commit 'origin/gallium-context-transfers-2' 2010-03-12 09:08:40 +00:00
Keith Whitwell
51bff09f72 mesa: fix linux-dri and autogen builds since sw-api-2 merge 2010-03-12 09:05:59 +00:00
Chia-I Wu
9dae0e0ff8 st/glx: Add xm_st.c to SConscript. 2010-03-12 13:26:18 +08:00
Vinson Lee
e4d10dada0 llvmpipe: Remove unnecessary header. 2010-03-11 20:52:38 -08:00
Chia-I Wu
543a29f1a1 st/mesa: Check the format before adding depth/stencil buffers.
The format might have depth bits, stencil bits, or both.  Add the
renderbuffers as needed.
2010-03-12 11:30:46 +08:00
Chia-I Wu
3475e88442 st/glx: Return a better format in choose_depth_stencil_format.
Return a better format instead of an exact format in
choose_depth_stencil_format.  Also, prefer formats with stencil bits.
2010-03-12 11:20:57 +08:00
Chia-I Wu
72ed7eb15a st/glx: Fix an infinite recursion in flush_front.
It was a stupid typo by me when I refactored the code.
2010-03-12 10:05:39 +08:00
Chia-I Wu
576d9af505 st/glx: Use st_api.h instead of st_public.h. 2010-03-12 09:57:11 +08:00
Chia-I Wu
a924dd18c3 st/egl: Use st_api.h instead of st_public.h.
Switch from st_public.h to st_api.h.  The latter has intrinsic multiple
APIs support and allows various EGLImage extensions to be supported.
2010-03-12 09:57:07 +08:00
Chia-I Wu
3a3a31bf88 winsys/xlib, st/es: Advertise st_api.h support.
This is done by defining one of st_module_OpenGL_ES1,
st_module_OpenGL_ES2, and st_module_OpenGL.
2010-03-12 09:57:07 +08:00
Chia-I Wu
de8a879f5c st/mesa: Implement st_api.h.
There is currently no user of this new interface.  As the inteface can
coexist with st_public.h, everthing should work as before.

ST_TEXTURE_2D is both defined by st_public.h and st_api.h.  Reorder the
headers in st/dri to avoid conflicts.
2010-03-12 09:57:07 +08:00
Chia-I Wu
8bcd616a3f st/vega: Implement st_api.h.
There is currently no user of this new interface.  As the inteface can
coexist with st_public.h, everthing should work as before.
2010-03-12 09:57:03 +08:00
Chia-I Wu
d2083056d5 gallium: Add st_api.h.
This is a new interface to be implemented by st/mesa, st/vesa, and the
window system APIs such as EGL or GLX.
2010-03-12 09:49:55 +08:00
Ian Romanick
f13d4295f9 Change type of function_identifier to silence bison warning
When the implementation of function_call_header and
function_identifier were changed a few commits ago, the types of the
production changed.  This just updates the types specified for the
productions to match reality.
2010-03-11 16:12:25 -08:00
Ian Romanick
44eb13d0b5 Add parameters to function declarations in the correct order 2010-03-11 16:11:07 -08:00
Brian Paul
e574b79485 gallivm: checkpoint WIP cubemap code 2010-03-11 16:26:52 -07:00
Brian Paul
0b3bb6318e gallivm: added lp_build_sum_vector() 2010-03-11 16:26:12 -07:00
Brian Paul
c72a3b4f2f softpipe: further tighen up sample_cube()
The code can fairly easily be translated to llvm...
2010-03-11 16:23:37 -07:00
Ian Romanick
471471f834 Initial pass at resolving function calls
The code is still really rough and *REALLY* incomplete.  This at least
passes the first few trivially simple test cases.
2010-03-11 14:57:26 -08:00
Ian Romanick
cdb8d54b68 Default function parameters to 'in' instead of auto 2010-03-11 14:48:51 -08:00
Ian Romanick
7e3ed40200 Add a handful of simple tests for function calls in constructors 2010-03-11 14:46:19 -08:00
Brian Paul
9ffdc78d1a softpipe: tighten up the code in sample_cube() 2010-03-11 15:37:35 -07:00
Ian Romanick
ed45ec6a51 Add ir_call call to represent function calls. 2010-03-11 14:35:37 -08:00
Ian Romanick
d27ec2461b Fix broken constructor of ir_instruction base class
Make the constructor inline-able, and don't try to initialize it as a
simple_node.  It hasn't been derived from simple_node in a long time.
2010-03-11 14:23:41 -08:00
Ian Romanick
1f58518059 Track generation of errors and halt compilation appropriately 2010-03-11 14:08:33 -08:00
Brian Paul
26ae4aab6a gallivm: enable 3D texture sampling 2010-03-11 14:49:01 -07:00
Brian Paul
e9f654d2fb progs/demos: added 'f' key to toggle filtering mode in stex3d.c 2010-03-11 14:49:01 -07:00
Brian Paul
53efb634a0 gallivm/llvmpipe: replace 'int stride' with 'int row_stride[MAX_LEVELS]'
The stride depends on the mipmap level.  Rename to row_stride to
distinguish from img_stride for 3D textures.

Fixes incorrect texel addressing in small mipmap levels.
2010-03-11 14:49:01 -07:00
Brian Paul
272f399434 llvmpipe: fix comment typo 2010-03-11 14:49:00 -07:00
Brian Paul
489af2a3ba gallivm/llvmpipe: include os_llvm.h instead of llvm-c/Core.h 2010-03-11 14:49:00 -07:00
Brian Paul
4833b0f199 gallium/os: wrapper for llvm-c/Core.h and #define HAVE_LLVM if needed 2010-03-11 14:49:00 -07:00
Alex Deucher
644a05c6cb r200: support additional blit formats
swizzle in the pixel shader
2010-03-11 13:49:57 -05:00
Brian Paul
d645119098 gallivm: fix some bugs on the 1D texture paths 2010-03-11 11:17:37 -07:00
Roland Scheidegger
ed1c69710c st/mesa: don't enable extensions which aren't actually supported
don't enable APPLE_client_storage, TDFX_texture_compression_FXT1,
EXT_cull_vertex, NV_vertex_program, NV_vertex_program1_1 -
the latter two might work somewhat with some luck.
Also don't enable ARB_imaging.
2010-03-11 18:54:14 +01:00
Roland Scheidegger
dfeab49a96 cell: adapt to context texture transfers (untested) 2010-03-11 18:40:25 +01:00
Christoph Bumiller
a671a9eed0 nv50: take format from sampler view, not the referenced texture 2010-03-11 17:31:51 +01:00
Christoph Bumiller
9e9839bd04 nv50: put correct value into the TIC MAX_LEVEL field 2010-03-11 17:31:49 +01:00
Christoph Bumiller
4da5d369fb nv50: fix damage from merging master into sampler-view
Fixed the state array sizes at 3 (instead of PIPE_SHADER_TYPES)
because we'll never have domain and hull shaders on nv50; also
the numbering doesn't correspond to the hw numbering.
2010-03-11 17:27:12 +01:00
Keith Whitwell
d35ecca5ee gallium: remove pipe_context member from pipe_transfer
There was very little use for this beyond permitting the
pipe_context::tex_transfer_destroy() function to omit the pipe_context
argument.

This change adds the pipe_context argument into tex_transfer_destroy()
so that it looks like other pipe_context functions, and removes the
pipe_context pointer from pipe_transfer.
2010-03-11 16:18:50 +00:00
Karl Schultz
560d375006 windows: Add new file to project file. 2010-03-11 09:17:30 -07:00
Brian Paul
2410125d07 gallivm: include tgsi_dump.h to silence warning 2010-03-11 08:52:03 -07:00
Brian Paul
7b42379b71 gallivm: move declarations to silence unused var warnings 2010-03-11 08:51:44 -07:00
Brian Paul
0c92dfe7f3 gallium/util: use memset() to initialize vars to avoid warnings 2010-03-11 08:51:18 -07:00
Brian Paul
25ba04c891 svga: use memset() to initialize u to avoid warnings 2010-03-11 08:50:39 -07:00
José Fonseca
e24e5324ed gallivm: Use bitmasks for scalar masks.
We could use single 1 bit conditions for scalar masks, but a lot of code
expects masks. The compiler easily optimzes away masks
extensions/truncations so consistency is preferable.

We can revisit this when LLVM backends have more support for vector
conditions.
2010-03-11 15:42:41 +00:00
José Fonseca
99f11f6530 gallivm: Handle scalar types in lp_build_*_type. 2010-03-11 15:42:41 +00:00
Chia-I Wu
021cdd698b mesa/es: Validate the state in st_DrawTex.
Without the validation, the function might draw with outdated textures.
2010-03-11 23:31:18 +08:00
Chia-I Wu
9f5de23d0a mesa/es: Fix GL_OES_draw_texture support.
st_DrawTex calls util_draw_vertex_buffer.  Since
ac4abaecd5, the caller is expected to set
vertex elements before calling.
2010-03-11 23:31:11 +08:00
Keith Whitwell
b43c182f19 Squashed commit of gallium-context-transfers:
commit 7a2ee04629681e59ea147b440856c4f9a33ae9f8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 14:19:17 2010 +0000

    nv: convert to context transfers

commit 188a3f5331c8e5966729fd59d02975afb7324adc
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 14:11:10 2010 +0000

    nouveau: remove unused variable

commit 5c8e880ab4dc020358c08728b8adb1637d2dc5bc
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:31:21 2010 +0000

    mesa/st: fix compilation after merge

commit c552595333f860c2a4807e195596acdf5d6a5ef8
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:31:06 2010 +0000

    util: fix compilation after merge

commit e80836878a3617b0e350d2a8f92311832a1476cb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:30:47 2010 +0000

    r300g: fix compilation after merge

commit 0e4883e9511b9db4e75a4dbc78d7bb970badc15d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:18:45 2010 +0000

    i965g: fix incorrect merge

commit 17d74133d8168eebf93bf1390de79930fc8da231
Merge: cb81c79 aa311ae
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 11 12:08:32 2010 +0000

    Merge commit 'origin/master' into gallium-context-transfers

    Conflicts:
    	src/gallium/drivers/i965/brw_screen_texture.c
    	src/gallium/drivers/r300/r300_screen.c
    	src/gallium/drivers/softpipe/sp_texture.c
    	src/gallium/drivers/svga/svga_screen_texture.c
    	src/gallium/state_trackers/egl/x11/native_ximage.c

commit cb81c79098bc3a92a4d2a3dcc0edc972dfb407be
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 16:04:01 2010 +0000

    egl/x11: hack for context transfers

    There is a better approach to this in the winsys-handle branch, but
    for now avoid using transfers at all by always allocating our own
    backing store directly.

commit f44a24e1d4ad7563f3eedd6b3a5688f53a36265c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 16:03:16 2010 +0000

    llvmpipe: context transfers

commit 4d7475ef8104b3b478c7c6ce77cd3506c57e25d1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 16:02:50 2010 +0000

    llvmpipe: disable testprogs build

    Not working.

commit a9bf98c4d36bd92a76f81e83747eb9b8f0a0515f
Merge: ee0f97e 0c616da
Author: Keith Whitwell <keithw@vmware.com>
Date:   Tue Mar 2 15:28:25 2010 +0000

    Merge commit 'origin/master' into gallium-context-transfers

    Conflicts:
    	src/mesa/state_tracker/st_cb_accum.c
    	src/mesa/state_tracker/st_cb_bitmap.c

commit ee0f97e8d9fd5ef57211a8e1268f505c9829e246
Merge: a7f078e 828f545
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Feb 19 13:00:29 2010 +0000

    Merge commit 'origin/master' into gallium-context-transfers

    Conflicts:
    	src/gallium/auxiliary/util/u_debug.h
    	src/gallium/drivers/i915/i915_context.h
    	src/gallium/drivers/llvmpipe/lp_flush.c
    	src/gallium/drivers/nv30/nv30_screen.h
    	src/gallium/drivers/nv40/nv40_context.h
    	src/gallium/drivers/nv40/nv40_screen.h
    	src/gallium/drivers/nv50/nv50_context.h
    	src/gallium/drivers/r300/r300_screen.c
    	src/gallium/drivers/r300/r300_winsys.h
    	src/gallium/drivers/softpipe/sp_context.c
    	src/gallium/drivers/trace/tr_context.c
    	src/gallium/state_trackers/dri/dri_context.c
    	src/gallium/state_trackers/egl/common/egl_g3d.c
    	src/gallium/state_trackers/python/st_device.c
    	src/gallium/winsys/drm/radeon/core/radeon_drm.c

commit a7f078e16d851b53ef316066dcced46eb39ebe24
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Feb 5 14:16:11 2010 +0000

    gallium: move texture transfers to pipe_context

commit 7b2ffc2019d72e833afea7eebf3e80121187375d
Merge: 51e190e c036d13
Author: Keith Whitwell <keithw@vmware.com>
Date:   Fri Feb 5 09:55:02 2010 +0000

    Merge commit 'origin/master' into gallium-screen-context

    Conflicts:
    	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c

    This branch has got a pretty tortured history now, I expect
    a squash merge will be appropriate when it is done.

commit 51e190e95acf120f72768fafb29e9721e358df1b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 17:58:02 2010 +0000

    gallium: fix some build issues

commit f524bdaa723fb181637ad30c6ad708aeedabe25b
Merge: f906212 3aba0a2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 17:51:32 2010 +0000

    Merge commit 'origin/master' into gallium-screen-context

commit f9062126883199eabf045714c717cd35f4b7b313
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 17:17:12 2010 +0000

    gallium/docs: small description of screen::create_context

commit efcb37bd3d5ed37f06c6105bd2d750b374ec0927
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:42:42 2010 +0000

    drm/radeon: more dead create_context wrapper removal

commit 6badc0dd9e06cf2ec936940bcf12b9ef5324b301
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:42:30 2010 +0000

    drm/i965: more dead create_context wrapper removal

commit cf04ebd5a54b18b2d894cfdab2b0f2fd55626ffc
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:42:05 2010 +0000

    st/python: more dead create_context wrapper removal

commit 444f114c3516abf71c430e6e9d0d2ae3b80679d3
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:37:58 2010 +0000

    idenity: wrapped context creation

commit 5a6d09cb9e468d1ee6c8d54b887618819d8d94f2
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:28:47 2010 +0000

    ws/gdi: remove dead context_create wrapper

commit 132b55f4bec39386ac625f09aaa11f609664024c
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:27:52 2010 +0000

    ws/gdi: remove dead context_create wrapper

commit 56d2d21a0cdcb197a364049d354c2f15a4fc026a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:25:38 2010 +0000

    st/xorg: use screen::context_create

commit 838c5cfe56b2af6c644909bed3c5e7cdd64c336a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:23:20 2010 +0000

    glx/xlib: simplify creation of trace-wrapped contexts

    Trace screen knows how to properly wrap context creation in the
    wrapped screen, so nothing special to do here.

commit c99404c03ebaec4175f08a2f363e43c9085f2635
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:18:24 2010 +0000

    st/python: no need to special case context creation for trace

commit 193a527a682b6877bb1faecd8092df4dfd055a18
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:15:30 2010 +0000

    drm/radeon: remove dead create_context declaration

commit bb984eecc25cf23bc77e1c818b81165ba1a07c9a
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:14:58 2010 +0000

    nv/drm: remove dead create_context ref

commit e809313a44287dc4e16c28e9e74ef3b2b5271aa1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:12:51 2010 +0000

    st/egl: remove a layer of wrappers around screen::create_context

commit 39caa6672a04122f185c22e17aab86d1c40938bf
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:05:28 2010 +0000

    r300g: fill in screen::context_create

commit 407f12556d16ba0656774d8a1d9ebda22f82f473
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 16:04:04 2010 +0000

    cell: adapt for screen::create_context, untested

commit d02b0c6ce321a04c76fdabb09e0e4380ce1c1376
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:50:24 2010 +0000

    drm/nv: adapt for screen::create_context

    All contexts now created directly through the screen, so remove
    equivalent code here.

    Remove apparently un-needed array of contexts in the winsys.

commit 53eec5b1349aa1b6892a75a7bff7e7530957aeae
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:50:08 2010 +0000

    stw: adapt for screen::create_context, untested

commit c6a64de3eb381bc9a88e9fbdecbf87d77925aaf5
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:49:20 2010 +0000

    trace: expose the wrapped context's priv data

    If we are going to keep this priv idea, really want an accessor
    function for it so that trace and other drivers can wrap that.

commit 75d6104e11d86ec2b0749627ed58e35f856ee6eb
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:47:55 2010 +0000

    nv30: adapt to screen::context_create

commit 12f5deb6ed9723e9b5d34577052b8365813ca14e
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:44:47 2010 +0000

    nv40: adapt to screen::context_create

commit 14baccaa3b6bbb3b91056126f6521828e786dc62
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:35:27 2010 +0000

    nv50: adapt to screen::create_context

    Not build tested.  Need to figure out how to build nouveau.

commit a0e94505ccd2d7f3e604465a2ac302f1286b73b6
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:22:27 2010 +0000

    llvmpipe: update for screen::create_context, untested

commit 0eae17107c950346030e4f7e0ec232f868d3893d
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 15:16:57 2010 +0000

    xlib/llvmpipe: remove dead winsys context creation path

commit 2f69f9ffaa7e2a01d2483277246ed13051ae4ca3
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 14:58:27 2010 +0000

    gallium: convert most code to use screen::create_context

    I wish I could build all of gallium at once to find breakages.

commit d7b57f4061b82322cbcae176125913d9f0dea6c1
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 12:46:21 2010 +0000

    glx: permit building with older protocol headers

    I'd like to be able to build mesa on current distro releases without
    having to upgrade from the standard dri2proto and glproto headers.  With
    this change I'm able to build on ancient releases such as Ubuntu 9-10...

    In general, it would be nice to be able to build-test mesa to check for
    unintended breakages without having to follow the external dependencies
    of every group working on the codebase.

commit 57adedd6fb06c98572ed8d4aef19203df4c4eea2
Merge: da71847 e1906ae
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Feb 4 11:38:15 2010 +0000

    Merge commit 'origin/master' into gallium-screen-context

    Conflicts:
    	src/gallium/drivers/softpipe/sp_video_context.h
    	src/gallium/drivers/trace/tr_context.c
    	src/gallium/state_trackers/wgl/shared/stw_context.c
    	src/gallium/winsys/gdi/gdi_softpipe_winsys.c

commit da71847ea6414d7e352c6094f8963bb4eda344dc
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:57:39 2009 +0100

    wgl: Use pipe_screen::context_create.

commit 2595a188f93fd903600ef5d8517737ee0592035d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:56:47 2009 +0100

    trace: Implement pipe_screen::context_create.

commit f3640e4ae37a5260cbfba999d079f827de0a313a
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:56:17 2009 +0100

    softpipe: Implement pipe_screen::context_create.

commit 347266bddc8bd39c711bacb2193793759d0f3696
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat May 2 08:55:31 2009 +0100

    gallium: New pipe_screen::context_create callback.
2010-03-11 15:23:16 +00:00
Michal Krol
530b9910c2 gallium: Check for OOM condition when creating a sampler view. 2010-03-11 15:30:21 +01:00
Michal Krol
252dc5f897 gallium: Use last_level for pipe_sampler_view instead of num_levels.
It's more consistent with the rest of the interfaces.
2010-03-11 15:25:52 +01:00
José Fonseca
4c5c442f12 softpipe: Dummy fence functions. 2010-03-11 12:24:56 +00:00
Marek Olšák
a0ae2ca033 st/dri: move extension initilization to st/mesa completely
Extensions were enabled in both st/mesa and st/dri, with st/dri completely
overriding the decisions of st/mesa and exposing even the extensions claimed
to be unsupported by a pipe driver.

This commit moves the differences between the two to st/mesa and removes
the responsibilty of advertising extensions from st/dri.
2010-03-11 12:28:51 +01:00
Michel Dänzer
fc1dd5ce1d Merge remote branch 'origin/7.8' 2010-03-11 12:14:05 +01:00
Vinson Lee
aa311ae616 winsys/xlib: Fix memory leak.
Memory for xm_dt was allocated twice.
2010-03-11 00:18:09 -08:00
Vinson Lee
8f7e06ddf6 progs/fpglsl: Fix GLSL compilation failures on Mac OS X. 2010-03-11 00:10:26 -08:00
Marek Olšák
40adcd611f st/mesa: always advertise texture_rectangle 2010-03-11 02:32:08 +01:00
Brian Paul
67a2f98be7 gallivm: overhaul of texture sampling code
The new lp_build_sample_general() function will handle all sampling
modes for all texture types.  Still incomplete, but a few additional
sampling modes are now supported.

1D textures should work and most of the code for 3D textures is in place.
No support for cube maps yet.  No support for different min/mag filters.
2010-03-10 18:09:49 -07:00
Brian Paul
a599f552f2 gallivm: handle scalar floats in lp_build_floor() and lp_build_iround() 2010-03-10 18:09:49 -07:00
Brian Paul
22bb7ffd04 gallivm: constant building for scalar zero 2010-03-10 18:09:49 -07:00
Brian Paul
a75254dda9 gallivm: implement bilinear sampling with nearest mipmapping
Time to start consolidating some code...
2010-03-10 18:09:49 -07:00
Brian Paul
dd67103d86 gallivm: remove debug code. nearest minification works now. 2010-03-10 18:09:49 -07:00
Brian Paul
19371fb60d llvmpipe: fix loop over mipmap levels 2010-03-10 18:09:49 -07:00
Francisco Jerez
878eef8c40 dri/nouveau: Just reemit the BO state on pushbuf flush.
Reemitting dirty states on flush causes problems if the GL context
isn't fully consistent when we get to it. It didn't serve any specific
purpose, so, use nouveau_bo_state_emit instead.
2010-03-11 00:59:59 +01:00
Eric Anholt
56ff30a9f9 i965: Use the PLN instruction when possible in interpolation.
Saves an instruction in PINTERP, LINTERP, and PIXEL_W from
brw_wm_glsl.c For non-GLSL it isn't used yet because the deltas have
to be laid out differently.
2010-03-10 15:18:19 -08:00
Eric Anholt
dc8c035944 i965: Set up the execution size before relying on it.
Fixes hangs with texturing in the non-GLSL path since
f6d210c284
2010-03-10 15:17:47 -08:00
Jose Fonseca
d42229707a gallivm: simplify conditional branching
Instead of testing each component individually, we can test the entire
vector at once.
2010-03-10 17:22:30 -05:00
Ian Romanick
3821761e45 Differentiate in ast_function_expression between constructors and func. calls 2010-03-10 14:12:22 -08:00
Ian Romanick
986b8f7982 Tell emacs that C++ .h files are C++ 2010-03-10 13:58:12 -08:00
Zack Rusin
ac33e7752d gallivm: properly test the if condition and branch to the proper label
makes loops work
2010-03-10 16:56:42 -05:00
Zack Rusin
18d406e8a8 gallivm: implement loops 2010-03-10 16:56:42 -05:00
Karl Schultz
242893cce2 windows: Quiet warning by not defining YY_NO_UNISTD_H. 2010-03-10 14:40:32 -07:00
Brian Paul
c7be039fad progs/trivial: use -c option to use glCopyPixels()
Otherwise we use glRead/DrawPixels to copy the off-screen FBO image
into the window.

Looks like NVIDIA's broken when using -c (the image is upside down),
but OK with -c -t.
2010-03-10 14:37:05 -07:00
Brian Paul
d5ccbea63c progs/trivial: make clear-fbo-scissor.c work with other GL drivers
NVIDIA's driver requires that the texture that we're going to render into
be complete.  Need to set min/mag filters to non-mipmap modes.

Plus added other error/debug checks.
2010-03-10 14:37:05 -07:00
Maciej Cencora
3198cd4a65 radeon: fallback to sw ReadPixels if color logicop is enabled
Fixes glean/logicOp (regressed after introducing hw accelerated support for ReadPixels)
2010-03-10 22:33:40 +01:00
Maciej Cencora
addedd091e r300: enable depth test only if depth buffer is available
Fixes #23532 and piglit/fbo-nodepth-test piglit/fbo-nostencil-test
2010-03-10 22:33:29 +01:00
Maciej Cencora
a68e8a4eaa radeon: fix glCopyTex(Sub)Image if user FBO is bound
Fixes piglit/fbo-blit and wine d3d9 unit test.
2010-03-10 22:33:29 +01:00
Zack Rusin
a44f362567 fpglsl: a few more useful glsl tests 2010-03-10 16:32:07 -05:00
Ian Romanick
7cfddf1941 Make ast_function_expression subclass of ast_expression 2010-03-10 13:26:52 -08:00
Ian Romanick
d10fe19495 Simplified constructor for identifier expressions 2010-03-10 13:25:56 -08:00
José Fonseca
a75519cb43 llvmpipe: Finally found a way to do vector comparisons without using intrinsics.
Only works well with LLVM >= 2.7
2010-03-10 20:50:01 +00:00
Zack Rusin
1ad0a0fd8f fpglsl: set an integer uniform required by the loop example 2010-03-10 15:42:26 -05:00
Zack Rusin
5f80dad7fd fpglsl: add some for and while loops 2010-03-10 15:37:18 -05:00
Brian Paul
7069dff80f softpipe: fix memcpy params to avoid static analysis warnings
See fd.o bug 26970.  Also added sanity check assertions.
2010-03-10 13:09:03 -07:00
Brian Paul
3c48f40f61 progs/trivial: add -t (RTT) option for clear-fbo-scissor.c 2010-03-10 12:19:41 -07:00
Eric Anholt
48dca99feb i965: Add support for the CMP opcode in the GLSL path.
This would be triggered by use of sqrt() along with control flow.
Fixes piglit-fs-sqrt-branch and a bug in Yo Frankie!.
2010-03-10 11:18:21 -08:00
Eric Anholt
f77c1cd7df i965: Print the opcode name for unrecognized opcodes in the GLSL path. 2010-03-10 11:18:21 -08:00
Brian Paul
9a7ba79b2b progs/trivial: added clear-fbo-scissor.c to test scissored clear of FBO 2010-03-10 11:52:07 -07:00
Eric Anholt
f6d210c284 i965: Fix the response len of masked sampler messages for 8-wide dispatch.
The bad response length would hang the GPU with a masked sample in a
shader using control flow.  For 8-wide, the response length is always
4, and masked slots are just not written to.  brw_wm_glsl.c already
allocates registers in the right locations.

Fixes piglit glsl-fs-bug25902 (fd.o bug #25902).
2010-03-10 10:44:08 -08:00
Eric Anholt
c8ef7a0966 i965: Print the offset for IFF in disasm 2010-03-10 10:44:08 -08:00
Ian Romanick
adfb0cd740 IR variable: Initial work to support GLSL built-in variables 2010-03-10 10:43:54 -08:00
Ian Romanick
f52888fac0 Include cstdlib to be sure size_t is available 2010-03-10 10:42:37 -08:00
José Fonseca
ddb081e3ed Revert "scons: Refuse to use LLVM 2.7 for now."
This reverts commit 44703217f7.

http://www.llvm.org/bugs/show_bug.cgi?id=6429 has been fixed now. Things
appear to be working reasonably so far.
2010-03-10 18:09:33 +00:00
Brian Paul
daad54f6ce progs/tests: add additional FBO->window test paths (disabled)
Normally use glReadPixels + glDrawPixels.  Add debug/test paths for
glCopyPixels and glBlitFramebuffer.
2010-03-10 10:59:06 -07:00
Ian Romanick
d949a9afb0 Move top-level AST to HIR conversion to _mesa_ast_to_hir 2010-03-10 09:55:22 -08:00
Brian Paul
7a2e32d684 mesa: raise an error when trying to bind non-existant texture to FBO
If the user calls glRenderBufferTexture(texture=N) but texture N
doesn't name an existing texture, raise GL_INVALID_ENUM.

Plus, add a comment about some questionable error checking code in
framebuffer_texture().  Ian?
2010-03-10 10:54:29 -07:00
Brian Paul
b318039e9a mesa: added new function comments 2010-03-10 10:53:21 -07:00
Brian Paul
06c44e852f st/mesa: set strb->format field in st_render_texture()
This fixes a problem in glReadPixels when reading from an FBO's texture
attachment.  We have a better chance at hitting a fast path for
glReadPixels now.
2010-03-10 10:50:19 -07:00
Brian Paul
9543b0a1ea st/mesa: add some comments in glReadPixels code 2010-03-10 10:49:18 -07:00
Brian Paul
a2fe774e09 st/mesa: consolidate duplicated texture allocation code 2010-03-10 10:48:10 -07:00
Brian Paul
f60524938e Merge branch '7.8' 2010-03-10 10:44:12 -07:00
Michel Dänzer
a56da1005d Merge branch '7.8' 2010-03-10 18:33:17 +01:00
Ian Romanick
8e6cd3bf54 Require the shader target be specified to the driver program 2010-03-10 09:31:30 -08:00
Ian Romanick
1c4156ffac Use ir_print_visitor to dump IR tree 2010-03-10 09:27:03 -08:00
Alex Deucher
a840bf4146 r200: add additional blit formats 2010-03-10 11:58:07 -05:00
Alex Deucher
cc1464cce9 r100: add additional blit formats 2010-03-10 11:58:07 -05:00
Alex Deucher
e167403e58 radeon/r200/r600: enable HW accelerated gl(Read/Copy/Draw)Pixels 2010-03-10 11:58:07 -05:00
George Sapountzis
7cd8f0ef9d glapi: fix bug with tls and relocs
add_dispatch (driver) and maybe get_proc_address (client) may be called before
set_dispatch is called, which results in generate_entrypoint using an unreloced
function template.
2010-03-10 18:44:47 +02:00
George Sapountzis
bae3135515 glapi: these two should be ok for add_dispatch ...
- a function cannot be both static and extension, right ?

- we should be setting the offset only if not already set, right ?
2010-03-10 18:44:47 +02:00
George Sapountzis
0d1dde5b01 glapi: comments for _glapi_add_dispatch 2010-03-10 18:44:46 +02:00
George Sapountzis
c4b630efdb glapi: minor cosmetic for _glapi_add_dispatch 2010-03-10 18:44:46 +02:00
George Sapountzis
3833a76eef glapi: add function set_entry_info 2010-03-10 18:44:46 +02:00
George Sapountzis
cae4fdda8d glapi: parameter checking, failure paths, ... for add_function_name 2010-03-10 18:44:45 +02:00
George Sapountzis
ddabf0a151 glapi: cosmetic for _glapi_add_dispatch
- static vs. extension
- indent
- s/new_offset/static_offset/
- ...
2010-03-10 18:44:45 +02:00
George Sapountzis
f9cc6b3ee7 glapi: use get_extension_proc in _glapi_add_dispatch 2010-03-10 18:44:45 +02:00
George Sapountzis
f0c18da2cf glapi: cosmetic for functions for static table
make similar to functions for extensions table
2010-03-10 18:44:45 +02:00
George Sapountzis
5b2340c493 glapi: add function to find extension by name 2010-03-10 18:44:44 +02:00
George Sapountzis
58985c36be glapi: functions for extensions table similar to static table 2010-03-10 18:44:44 +02:00
Roland Scheidegger
8c34437ded cell: handle NULL cso vertex_elements state object on bind
drivers need to handle NULL cso vertex elements (and others) objects.
It is possible the cso code saves/restores NULL objects (if no normal
cso object was bound before this was invoked).
This led to segfaults (for example demos/cubemap) for apps which were using
things like creating mipmaps before drawing anything.
2010-03-10 16:53:07 +01:00
Michal Krol
5d4360d10c gallium: pipe_get_tile_swizzle() accepts format parameter.
Enables casting of texture data.
2010-03-10 16:32:34 +01:00
Chia-I Wu
c47c73293d i915g: Prevent NULL dereference.
bind_vertex_elements_state may be called with NULL velems.  Do nothing
if that is the case.
2010-03-10 23:00:09 +08:00
Michal Krol
3ce4375912 Merge branch 'master' into gallium-sampler-view
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/auxiliary/tgsi/tgsi_exec.c
	src/gallium/auxiliary/util/u_blitter.c
	src/gallium/drivers/i915/i915_context.h
	src/gallium/drivers/i965/brw_context.h
	src/gallium/drivers/llvmpipe/lp_context.h
	src/gallium/drivers/nv50/nv50_context.h
	src/gallium/drivers/nv50/nv50_state_validate.c
	src/gallium/drivers/nv50/nv50_tex.c
	src/gallium/drivers/r300/r300_blit.c
	src/gallium/drivers/r300/r300_context.h
	src/gallium/drivers/r300/r300_emit.c
	src/gallium/drivers/r300/r300_state.c
	src/gallium/drivers/softpipe/sp_context.h
	src/gallium/drivers/svga/svga_context.h
	src/gallium/drivers/svga/svga_pipe_sampler.c
2010-03-10 15:49:30 +01:00
Chia-I Wu
e4848d21e8 gallium: Do not mix winsys-drawable-handle and context-private.
update_buffer should be called with context-private, not
winsys-drawable-handle.
2010-03-10 22:21:08 +08:00
Michal Krol
9b348d0ed1 svga: Disable debug message. 2010-03-10 14:16:40 +01:00
Michal Krol
504ad3606d svga: Check if vertex elements has been bound before using it. 2010-03-10 14:16:40 +01:00
José Fonseca
c282c0b6e4 softpipe: Prevent NULL dereference. 2010-03-10 12:24:03 +00:00
José Fonseca
c4e0ae3907 docs: Update new opengl32.dll target location. 2010-03-10 12:09:16 +00:00
José Fonseca
986ce8f1c1 python: Remove broken link hack. 2010-03-10 12:05:10 +00:00
José Fonseca
7b8641bbba python: More build fixes. 2010-03-10 12:00:13 +00:00
José Fonseca
fc08d13fdc trace: Make tr_public.h c++ friendly. 2010-03-10 11:53:15 +00:00
Keith Whitwell
0731d14a43 target-helpers: remove swrast_xlib.c helper
This was a good idea, but ended up tying the build systems in knots.
We can revisit this later, in particular if we can put in place dummy
implementations of cell_create_screen(), llvmpipe_create_screen()
which just return NULL if the driver isn't available.

In the meantime, just duplicate this smallish function in the two
places it was being called.
2010-03-10 11:52:04 +00:00
Keith Whitwell
e47a619ea2 ws/xlib: remove dead lines 2010-03-10 11:52:03 +00:00
José Fonseca
e8d884eab9 scons: Fixup the libgl-gdi build. 2010-03-10 11:34:09 +00:00
José Fonseca
6b707667c8 python: Handle the possibility that no driver is selected. 2010-03-10 11:10:58 +00:00
Keith Whitwell
de27e272f4 gallium: remove trace module injection from various state trackers
Components such as state trackers, drivers, etc, should be free to be
recombined in arbtrary ways to build driver stacks.  They should not
be reaching out and trying to build the stack themselves - this is now
expected to be handled by the "target" abstraction.
2010-03-10 10:43:00 +00:00
Keith Whitwell
7e29bef7dc ws/gdi: add include 2010-03-10 10:39:37 +00:00
Keith Whitwell
431a2f99bc target-helpers: helper for injecting common debug layers
Add a helper gallium_wrap_screen() for injecting the commonly
used extra layers into a gallium stack.  Currently that's just the
trace module and identity layer, but there could be more in the
future, eg. a validation layer.
2010-03-10 10:37:57 +00:00
José Fonseca
601bfb5951 python: Fix up state tracker for sw api. 2010-03-10 10:34:29 +00:00
José Fonseca
5235c5aac7 Revert "r300-gallium: Skeleton for integrating into the python statetracker."
This reverts commit 2d56d0839e.

Never actually used.
2010-03-10 10:02:03 +00:00
Keith Whitwell
80f86d22b2 st/wgl: add missing paramter 2010-03-10 09:52:25 +00:00
Keith Whitwell
7ce6b31306 trace: include tr_public.h 2010-03-10 09:51:41 +00:00
Keith Whitwell
3e38dbe3d3 gallium: plumb winsys-drawable-handle through to state tracker
The state trackers need this value so that they can supply it
as the "void *" argument to flush_frontbuffer.

Fixes single-buffer rendering.
2010-03-10 09:22:02 +00:00
Ian Romanick
02ae68f496 Fix typeo in gl_FogParameters.scale (was scalre) 2010-03-10 00:52:39 -08:00
Keith Whitwell
155fbcb0ed Merge commit 'origin/master' into gallium-sw-api-2 2010-03-10 08:29:27 +00:00
Ian Romanick
0b67823462 AST to IR: Mark 'varying' in a vertex shader as 'out' 2010-03-10 00:28:59 -08:00
Ian Romanick
654c057257 ir_variable: Initialize all attribute bits to reasonable defaults
This prevents variables from randomly having their 'invariant' or
'read_only' bits set, for example.
2010-03-10 00:21:27 -08:00
José Fonseca
eeaa0861bf llvmpipe: Cope with null Vertex element cso.
CSO can often be null.

For example:
1. at initialization
2. using an util module (u_blit) right after initialization (it will push
   state and pop the previous null state)
3. at shutdown time (state shouldn't be bound when being destroyed)

Glean was hitting 2.
2010-03-10 07:23:29 +00:00
Ben Skeggs
ed7f73e161 nouveau: translate PIPE_BUFFER_USAGE_UNSYNCHRONIZED 2010-03-10 16:30:03 +10:00
Ben Skeggs
139062946d nv50: inline nv50_state_flush_notify()
It's (rightly) not called from anywhere else now
2010-03-10 16:30:03 +10:00
Ben Skeggs
7b7fcb0854 nv50: remove nv50_context.state.instbuf 2010-03-10 16:30:02 +10:00
Ben Skeggs
9b233ce7de nv50: remove unnecessary macro 2010-03-10 16:30:02 +10:00
Ben Skeggs
3f93fa6010 nv50: move nv50_prim() into a header file rather than duplicating 2010-03-10 16:30:01 +10:00
Ben Skeggs
4796986c98 nv50: add option to force immediate-mode submission, disable by default 2010-03-10 16:30:01 +10:00
Ben Skeggs
160bda24ed nv50: re-add immediate mode vertex submission paths 2010-03-10 16:30:00 +10:00
Ben Skeggs
0842829c18 nv50: when doing inline indices, split elt lists so they fit into pushbuf 2010-03-10 16:30:00 +10:00
Ben Skeggs
d8a415425e nv50: reimplement draw_elements_instance(), use for draw_elements() too
This makes draw_elements()/draw_elements_instanced() do the right thing
for the non-inline elements cases, and not require flush_notify().
2010-03-10 16:30:00 +10:00
Ben Skeggs
621c4609f8 nv50: reimplement draw_arrays_instanced(), do draw_arrays() in terms of it
This makes draw_arrays()/draw_arrays_instanced() do the right thing and
not require the (probably broken anyway) flush_notify() usage.

It also fixes a potential bug in the behaviour of reading InstanceID from
shaders, where 0 should be read for non-instanced drawing, previously it
was possible to read non-0 ids if mixing instanced/non-instanced.
2010-03-10 16:30:00 +10:00
Ben Skeggs
a527716e81 nv50: rip out inline push draw paths temporarily 2010-03-10 16:30:00 +10:00
Ben Skeggs
2b8c0cf169 nv50: make use of scissor enable/disable method 2010-03-10 16:29:59 +10:00
Ben Skeggs
885d2eceb1 nv50: move magic 0x142c stuff to after state emission 2010-03-10 16:29:59 +10:00
Ben Skeggs
0e6af1fcaa nv50: avoid unnecessary vp/gp/fp state changes 2010-03-10 16:29:59 +10:00
Ben Skeggs
2a84db24b3 nv50: remove pre_pipebuffer_map hack.... 2010-03-10 16:29:59 +10:00
Ben Skeggs
3f804b0f19 nv50: remove horrific abuse of nouveau_channel.flush_notify
Really though, using this at all is just not a good idea in the 3D driver.
I'm almost certain the hardware will not like a reloc appearing between
begin()/end().. Anyways, this is still better than before, more fixes
to come..
2010-03-10 16:29:59 +10:00
Ben Skeggs
c926ed0e76 nv50: always emit dummy relocs for all still-referenced buffers 2010-03-10 16:29:59 +10:00
Ben Skeggs
e1d015fe22 nv50: ensure enough room for state changes in current pushbuf
Also allows the nv50_state_validate() caller to request a minimum amount
of space that itself requires, not all callers accurately use this yet
but the simple cases are now accounted for.

Rendering will also be dropped on the floor if validate fails now.
2010-03-10 16:29:58 +10:00
Ben Skeggs
62ab89785b nv50: rework state emission 2010-03-10 16:29:58 +10:00
Ben Skeggs
ac2b35fd2d nv50: use relocs rather than re-uploading TIC all the time 2010-03-10 16:29:58 +10:00
Ian Romanick
fe10250355 IR print visitor: Add some support for printing types and constants 2010-03-09 21:44:34 -08:00
Corbin Simpson
007f25b3bd r300g: Reorder regs, save one dword.
Or, put another way, save 10% on rendering calls.
2010-03-09 21:37:49 -08:00
Chia-I Wu
9a8342ebcd winsys/drm: Handle circular dependencies in Makefile.egl.
The libraries have circular dependencies.  Use --start-group and
--end-group when producing the final shared libraries.
2010-03-10 10:14:17 +08:00
Chia-I Wu
1f92cf55e1 st/egl: Fix build errors in ximage backend after merge.
This fixes assorted merge conflicts when master is merged to
gallium-sw-api-2 in 0c96690a5b.
2010-03-10 09:50:19 +08:00
Ian Romanick
6044ae79a0 IR print visitor: Print assignments 2010-03-09 16:40:45 -08:00
Ian Romanick
6652af36fe Add assignment side-effect to the instruction stream
The actual assignment is a side-effect of the assignment expression.
Add it to the instruction stream and return the LHS of the assignment
as its rvalue.
2010-03-09 16:38:02 -08:00
Ian Romanick
78b51b0fdd IR visitor: Add initial version of ir_visitor classes
The ir_visitor class is the abstract base class for all visitors.
ir_print_visitor contains the beginnings of a concrete visitor class
that will print out an IR sequence in a Lisp / Scheme-like syntax.
2010-03-09 16:26:15 -08:00
Ian Romanick
fce1150156 Convert is_glsl_type_matrix to glsl_type::is_matrix 2010-03-09 15:58:52 -08:00
Ian Romanick
a2dd22fb19 Convert is_glsl_type_vector to glsl_type::is_vector 2010-03-09 15:55:16 -08:00
Ian Romanick
cb36f8aaee Convert is_glsl_type_scalar to glsl_type::is_scalar 2010-03-09 15:51:22 -08:00
Ian Romanick
eccf0bf5f2 Make glsl_type a class
Among other benefits, this cleans up a the hackery invovled in
initializing the union field in builtin_types.h.
2010-03-09 15:49:31 -08:00
Eric Anholt
a81836ee2f i965: Fix ENDLOOP to only patch up this loop's BREAK and CONT.
Corresponds to d225a25e21a24508aea3b877c78beb35502e942d and fixes
piglit glsl-fs-loop-nested.  Bug #25173.
2010-03-09 14:42:17 -08:00
Eric Anholt
6b194dab6b i965: Unalias all GLSL source regs from the destination regs used.
We were doing it ad-hoc before, as instructions with potential
aliasing problems were identified.  But thanks to swizzling basically
anything can have aliasing, so just do it generally at source reg
setup time.  This is somewhat inefficient, because sometimes an
operation doesn't need unaliasing protection if the swizzling is safe,
but the unaliasing before didn't cover those cases either.

Fixes piglit glsl-fs-loop.
2010-03-09 14:42:17 -08:00
Eric Anholt
280abdacf9 i965: Print the offsets for WHILE and BREAK in disasm. 2010-03-09 14:42:17 -08:00
Eric Anholt
f6f547d87e i965: Fix nested loops in the VS.
We were patching up all the break and continues between the start of
our loop and the end of our loop, even if they were breaks/continues
for an inner loop.  Avoiding patching already patched breaks/continues
fixes piglit glsl-vs-loop-nested.
2010-03-09 14:42:17 -08:00
Eric Anholt
7f6d2754d5 i965: Fix up VP constbuf leak on program delete. 2010-03-09 14:42:17 -08:00
Maciej Cencora
eeaf1e0519 r300: don't crash if there's no colorbuffer 2010-03-09 23:13:19 +01:00
Maciej Cencora
b70dcabafc radeon: mark framebuffer as incomplete if renderbuffer format isn't supported by hw 2010-03-09 21:50:59 +01:00
Maciej Cencora
fd05067c99 r300: add support for more rendering formats 2010-03-09 21:50:30 +01:00
Maciej Cencora
a17563c7dd radeon/r200/r300/r600: add is_format_renderable function 2010-03-09 21:50:20 +01:00
Maciej Cencora
bd2239e497 progs/tests: use first color attachement
Allows the tests to be run on drivers that supports only one color attachement.
2010-03-09 21:46:14 +01:00
Maciej Cencora
67108b5d12 r300: enable HW accelerated gl(Read/Copy/Draw)Pixels 2010-03-09 21:46:14 +01:00
Maciej Cencora
ac2b7835d5 radeon: add hw accelerated glReadPixel support (not enabled yet) 2010-03-09 21:46:14 +01:00
José Fonseca
3355ae1925 glapi: Fix scons build -- list new file. 2010-03-09 20:43:13 +00:00
George Sapountzis
20ed2445b3 glapi: allow for any mangle prefix 2010-03-09 22:04:51 +02:00
George Sapountzis
54ba95a4de glapi: split out arch-specific code for entrypoints 2010-03-09 22:04:51 +02:00
George Sapountzis
2c8b5ffed9 glapi: mv table functions to glapi_getproc.c and add local header 2010-03-09 22:04:51 +02:00
George Sapountzis
fe14868d96 drop stray XFree86Server, XGLServer 2010-03-09 22:04:50 +02:00
Keith Whitwell
dc1e4cf87f svga: Don't do culling while the software pipeline is active.
It does it for us, and additionally introduces potentially
back-facing triangles.
2010-03-09 20:49:05 +01:00
José Fonseca
02716cf7d1 null: Add a null software winsys.
One where framebuffer data will be read via texture transfers.

Useful for e.g., python state tracker.
2010-03-09 19:47:56 +00:00
Roland Scheidegger
a673dee455 mesa/st: initialize velements state properly
one variable is a bitfield where the rest is never written to, which caused
valgrind to complain. Might have caused cso to not recognize an already stored
state. Reported by Christoph Bumiller.
2010-03-09 20:33:21 +01:00
Roland Scheidegger
0d6b0b0d9d cso: don't forget to release vertex elements state 2010-03-09 20:33:21 +01:00
Keith Whitwell
9cdaadc92f target-helpers: missing files 2010-03-09 19:15:28 +00:00
Marek Olšák
bf50d40f1b r300g: kill pf_component_count 2010-03-09 20:12:52 +01:00
Keith Whitwell
3cadd983e8 ws/gdi: fix typo 2010-03-09 18:01:47 +00:00
Keith Whitwell
0df858a8d5 gallium: create target for gdi libgl 2010-03-09 17:58:40 +00:00
Keith Whitwell
25b9aafbd2 ws/xlib: no dependency on mesa state tracker 2010-03-09 17:55:19 +00:00
Keith Whitwell
5e72b89b89 egl/x11: use swrast-xlib helper 2010-03-09 17:32:10 +00:00
Keith Whitwell
d0aea65032 gallium: create helper for swrast+xlib combination
Several targets may want to reuse this code.  It's pretty simple, not
sure if this is really a win.
2010-03-09 17:32:10 +00:00
José Fonseca
c27ffc5215 scons: Fix the libg-xlib Sconscript. 2010-03-09 17:08:36 +00:00
José Fonseca
78d8e6c98a scons: Always build the identity driver. 2010-03-09 17:08:16 +00:00
Brian Paul
2ccae040a4 gallivm: checkpoint: nearest mipmap filtering
The LOD is computed from texcoord partial derivatives and used to
select a mipmap level.  Still some bugs in texel fetching.  Lots of
rough edges and unfinished parts but the basics are in place.

Lots of changes to the lp_bld_arit.c code to support non-vector/scalar
datatypes.
2010-03-09 09:40:41 -07:00
Roland Scheidegger
e0f10a6fca util: simplify util_format_get_nr_components helper
since the number of components is now stored in the pipe format description,
we obviously no longer need to figure this out ourselves.
2010-03-09 17:28:27 +01:00
José Fonseca
09a7c25e76 util: Use bitshift arithmetic for pack too. 2010-03-09 15:59:01 +00:00
Keith Whitwell
999932bf1f targets/libgl-xlib: add code to inject trace and identity layers
Finally we can inject layers for debug, trace and "other" with
relative ease between state-tracker and driver.
2010-03-09 15:58:45 +00:00
Keith Whitwell
3c57c01a44 ws/xlib: remove self-knowledge about users of xlib winsys
Several software rasterizers can make use of this winsys, but there
isn't any reason why the winsys itself should know about them.

This change moves that information into the libgl-xlib target.

Need to fix up other targets making use of this winsys.
2010-03-09 15:33:21 +00:00
Corbin Simpson
a73fd447d4 cso: Fix typo in assert. 2010-03-09 07:31:27 -08:00
Corbin Simpson
141c7cb0d6 r300g: Precalculate and CSO-bind PSC state. 2010-03-09 07:31:27 -08:00
Corbin Simpson
9c8cb12388 r300g: Cleanup old PSC code a bit. 2010-03-09 07:30:49 -08:00
Roland Scheidegger
4d02534628 identity: fix copy & paste error 2010-03-09 16:28:59 +01:00
Roland Scheidegger
22812421b5 r300g: fix gallium-vertexlementcso merge damage 2010-03-09 16:24:47 +01:00
Brian Paul
27a7f9454f cell: fix up assorted compilation problems
The driver is pretty much totally broken though.
2010-03-09 08:14:06 -07:00
José Fonseca
ff407a117c gdi: Fixup llvmpipe gdi winsys too. 2010-03-09 15:12:19 +00:00
José Fonseca
706eda3057 scons: Add new targets option.
This will likely change. Most probably we'll just add an alias to indvidual
targets and use the regular scons targets arguments.
2010-03-09 15:09:32 +00:00
Keith Whitwell
b694f32170 winsys/gdi: get softpipe version compiling 2010-03-09 15:02:21 +00:00
Roland Scheidegger
685340a53e Merge branch 'gallium-vertexelementcso'
Conflicts:
	src/gallium/auxiliary/cso_cache/cso_context.c
	src/gallium/auxiliary/util/u_blit.c
	src/gallium/auxiliary/util/u_gen_mipmap.c
	src/gallium/drivers/i915/i915_context.h
	src/gallium/drivers/i965/brw_draw_upload.c
	src/gallium/drivers/r300/r300_blit.c
	src/gallium/drivers/r300/r300_context.h
	src/gallium/drivers/r300/r300_render.c
	src/gallium/drivers/r300/r300_state_derived.c
	src/mesa/state_tracker/st_cb_bitmap.c
	src/mesa/state_tracker/st_cb_clear.c
2010-03-09 15:59:40 +01:00
Keith Whitwell
73d9400ad6 softpipe: silence warning 2010-03-09 14:50:16 +00:00
Keith Whitwell
3db9644a9e ws/gdi: missing file 2010-03-09 14:49:39 +00:00
Keith Whitwell
ce30b5bf2c ws/gdi: sketch of gdi changes 2010-03-09 14:32:44 +00:00
Roland Scheidegger
ae7b7bf1ed st/mesa: fix clear/drawpixels/bitmap for new cso vertex elements interface
somehow those got lost...
2010-03-09 15:09:01 +01:00
Keith Whitwell
65233674d3 cell: untwiddle surface contents in flush_frontbuffer()
Don't make the shared software winsys rely on internal knowledge about
the cell driver's texture twiddling.

This is just a sketch and hasn't even been compile tested.
2010-03-09 14:03:41 +00:00
Roland Scheidegger
e8983f70b4 gallium: don't use flexible array members in drivers for vertex elements cso
While this c99 feature should work with most compilers, valgrind doesn't
really like it, and this only really saves some memory, we don't do this
in similar occasions (like the blend state) neither.
2010-03-09 14:23:00 +01:00
Roland Scheidegger
fe9f8536f1 auxiliary: fix vertex elements cso
potentially could have got a match even though the cso was different
(in case of different count and first few elements the same).
2010-03-09 14:19:29 +01:00
David Heidelberger
e497a58fad nv30: fix typo
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2010-03-09 13:13:52 +00:00
Keith Whitwell
fe94a363e5 cell: attempt conversion to sw_winsys 2010-03-09 12:31:20 +00:00
Keith Whitwell
8ac10162f1 ws/xlib: remove USE_XSHM preprocessor macro 2010-03-09 11:48:57 +00:00
Keith Whitwell
d5bf9c0a5e ws/xlib: manage the GC internally
No need for the user of this winsys to supply/manage the x11 gc for
us.
2010-03-09 11:39:40 +00:00
Keith Whitwell
0c96690a5b Merge commit 'origin/master' into gallium-sw-api-2
Conflicts:
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/softpipe/sp_texture.c
	src/gallium/drivers/softpipe/sp_winsys.h
	src/gallium/state_trackers/egl/common/egl_g3d.c
	src/gallium/state_trackers/egl/x11/native_x11.c
	src/gallium/state_trackers/egl/x11/native_x11.h
	src/gallium/state_trackers/egl/x11/native_ximage.c
2010-03-09 11:02:37 +00:00
Keith Whitwell
6f4ce4a4fe Squashed commit of gallium-no-texture-blanket
commit f90b3f01af82b9522067b1824e21709a6fb2d3af
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:39:44 2010 +0000

    gallium: remove p_screen::surface_buffer_create

    This isn't very useful without texture_blanket(), which has also been
    removed.

    Note that this function hasn't been removed from the old pipe_winsys
    (u_simple_screen) still used internally by some drivers (eg softpipe).

commit 6c462de39a4b9980a5f034a95e580efdfcb8173b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:27:40 2010 +0000

    egl/x11: disable texture_blanket usage

commit b42da9160df9f47224e5b3291b972f41767aa6e5
Merge: 4be2436 3ca9336
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:27:24 2010 +0000

    Merge commit 'origin/master' into gallium-no-texture-blanket

    Conflicts:
    	src/gallium/drivers/svga/svga_screen_texture.c

commit 4be2436316929e3dfc55bc34d810920c06556b66
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 4 14:59:26 2010 +0000

    gallium: remove texture blanket call

    No longer needed, except for nouveau and egl/xll/native_ximage.c.

    Fix for nouveau is to keep the call, but move it to an internal
    function within nouveau.

    Fix for that egl/x11 relies on gallium-sw-api branch or its successor.

commit 69b6764330367d63c237d0bde9fb96435d0e0257
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 4 13:35:16 2010 +0000

    drm_api: wrap comment
2010-03-09 10:54:54 +00:00
Ian Romanick
3a9e989628 Remove unused function 2010-03-08 23:44:59 -08:00
Ian Romanick
0044e7edce Conver IR structures to use exec_list instead of simple_node 2010-03-08 23:44:54 -08:00
Ian Romanick
7e4ce71923 Add yet-another linked list type
The use of macros to access existing linked list type makes it
unsuitable for its current use as a base class.  Since this type and
the accompanying macros are used all over the place in Mesa, we can't
really change them.
2010-03-08 23:42:45 -08:00
Ian Romanick
61484ba188 Remove prototypes for *_to_hir functions that no longer exist 2010-03-08 23:06:48 -08:00
Chia-I Wu
95c5c69b50 st/egl: Use xlib_sw_winsys in ximage backend. 2010-03-09 12:56:47 +08:00
Chia-I Wu
da92f6db5b winsys/xlib: Fix a segfault when USE_XSHM is not defined. 2010-03-09 12:51:27 +08:00
Marek Olšák
821c830f11 r300g: remove hacks from translate_vertex_data_swizzle
The first part of the fix of BGRA vertex colors.
2010-03-09 04:56:11 +01:00
Marek Olšák
f3365bceb8 draw: quads never provoke the first vertex 2010-03-09 04:51:43 +01:00
Marek Olšák
558ce9964f softpipe: quads never provoke the first vertex 2010-03-09 04:51:43 +01:00
Marek Olšák
f2b8f14267 llvmpipe: quads never provoke the first vertex 2010-03-09 04:51:43 +01:00
Corbin Simpson
dd8f5c33f3 mesa/st: Gallium quads, by spec, never change provoking vertex.
Fixes glean/clipFlat for r300g.
2010-03-09 04:51:29 +01:00
Chia-I Wu
2b76e04a8c st/egl: Fix KMS build error after winsys handle change. 2010-03-09 11:34:37 +08:00
Brian Paul
4243ca1144 gallium: update some comments, remove others which are superfluous 2010-03-08 16:26:44 -07:00
Brian Paul
e799163dec vega: remove redundant DEFINES from .c.o rule 2010-03-08 16:26:44 -07:00
Brian Paul
f027d56129 llvmpipe/gallivm: checkpoint: array of pointers to mipmap levels
Change the texture data_ptr from just a single image pointer to an
array of image pointers, indexed by mipmap level.
We'll use this for mipmap filtering.
For now, the mipmap level is hard-coded to zero.
2010-03-08 16:26:44 -07:00
Brian Paul
891f7f4d52 nv: define NV30/40/50_MAX_TEXTURE_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
ac2e849111 r300g: define R300_MAX_TEXTURE_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
156585c12e svga: s/PIPE_MAX_TEXTURE_LEVELS/SVGA_MAX_TEXTURE_LEVELS/ 2010-03-08 16:26:44 -07:00
Brian Paul
e0d4f3202e i915g: define I915_MAX_TEXTURE_2D/3D_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
e836f35369 i965g: define BRW_MAX_TEXTURE_2D/3D_LEVELS 2010-03-08 16:26:44 -07:00
Brian Paul
44eec28023 softpipe: define SP_MAX_TEXTURE_2D/3D_LEVELS 2010-03-08 16:26:43 -07:00
Brian Paul
d73fadf211 llvmpipe: define max texture levels 2010-03-08 16:26:43 -07:00
Brian Paul
e3b6f7b800 llvmpipe: rewrap for 80 columns 2010-03-08 16:26:43 -07:00
Eric Anholt
bc632d0437 i965: Fix up the handling of point sprite coordinate replacement.
The code was walking over the regs of pairs of attributes and checking
whether the attribute with a given reg index had point sprite enabled.
So the point sprite setup code was rarely even getting executed.
Instead, we need to determine which channels of a reg need point
sprite coordinate replacement.  In addition, it was multiplying the
attribute by 1/w, when it's supposed to cover (0, 1) in each direction
regardless of w, and it wasn't filling in the Z and W components of
the texcoord as specified.

Fixes piglit point-sprite and the spriteblast demo.  Bug #24431, #22245.
2010-03-08 14:23:18 -08:00
Ian Romanick
1e2e58c1f6 Set C++ indent too. 2010-03-08 13:02:58 -08:00
Zack Rusin
1d84808dc0 gallivm: fix a crash by making sure we set the has_mask flag correctly 2010-03-08 15:04:04 -05:00
Jesse Barnes
f2a035e5d8 xdemos/omlsync: improve OML WaitMsc test
Use the divisor/remainder for the WaitForMscOML call if a wait_interval
is passed.  Allows for testing of the WaitMSC paths in the server & DDX.
2010-03-08 11:31:26 -08:00
Keith Whitwell
3ab8211be4 gallium: remove xlib_driver::display_surface
Just use flush_frontbuffer directly.  The flush_frontbuffer routine has
been somewhat devalued recently, but it is actually just the right
interface for our needs.

It is in pipe_screen, meaning that any wrapping (eg trace module)
will get properly unwrapped before we try and use the pipe_surface
argument for real.

If a particular co-state-tracker needs to implement this itself, it
should organize a way to allow the winsys to call back up to its
level, rather than hijacking the driver-supplied implementation.
2010-03-08 19:23:10 +00:00
Keith Whitwell
c867c58c73 gallium: make it work 2010-03-08 19:21:27 +00:00
Keith Whitwell
99f11d0e18 gallium: introduce target directory
Currently there are still at least two functions bundled up inside the
winsys concept:

a) that of a backend resource manager, sometimes capable of performing
   present() operations,

b) the initialization code/routine for the whole driver stack.

The inclusion of (b) makes it difficult to share implementations of
(a) between different drivers.  For instance, a clean xlib winsys
could be of use for software-rasterized VG, GLES, EGL, etc, stacks.
But that is only true as long as there is no dependency from the
winsys to higher level code, as would be the case when we include (b)
in this component.

This change creates a new gallium/targets subtree, specifically for
implementing the glue needed to build individual driver stacks, and
moves that code out of a single example winsys, namely xlib.

Other drivers continue to build unchanged, but hopefully can migrate
to this structure over time.
2010-03-08 19:11:35 +00:00
Brian Paul
e5923a1240 Merge branch '7.8' 2010-03-08 11:43:20 -07:00
Keith Whitwell
90b3baf9b3 ws/xlib: remove dead files 2010-03-08 16:48:45 +00:00
Keith Whitwell
4350e025cf ws/xlib: fixup softpipe build 2010-03-08 16:48:39 +00:00
Keith Whitwell
1675d05f91 winsys/xlib: remove dependency on glx/x11 state tracker
Introduce xlib_drawable struct, pass this down to winsys instead of
having it use the internal data structures from glx/x11
2010-03-08 16:35:49 +00:00
Keith Whitwell
7f9a3959b0 ws/xlib: remove redundant declarations 2010-03-08 16:35:43 +00:00
Keith Whitwell
9b7c332d5f winsys/xlib: sketch of cell support 2010-03-08 16:35:37 +00:00
Alex Deucher
39ab5ae30c radeon/r200/r600: allow src and dst BOs to be placed in GTT during blit 2010-03-08 10:13:49 -05:00
Alex Deucher
7959274858 radeon/r200/r600: reset bos when validating buffers during blit 2010-03-08 10:04:02 -05:00
Alex Deucher
cbe28cb892 r600: recalculate point size, if point min/max size changes 2010-03-08 10:00:59 -05:00
Alex Deucher
97d40edb07 r600: no need to flush on context init 2010-03-08 09:57:26 -05:00
Keith Whitwell
3ca933623c Merge commit 'origin/gallium-winsys-handle-rebased' 2010-03-08 12:03:46 +00:00
Marek Olšák
9860f652e2 r300g: fix updating the tiling flags for the framebuffer state 2010-03-08 04:43:51 +01:00
Marek Olšák
6abe6145fb r300g: remove unnecessary state emissions and clean up 2010-03-08 04:34:27 +01:00
Francisco Jerez
ea027bda8e dri/nouveau: Split big client buffers in the indexed case too. 2010-03-07 22:40:11 +01:00
Francisco Jerez
75f52d1e52 dri/nouveau: Fix nv[12]x color sum. 2010-03-07 22:40:11 +01:00
Andrew Randrianasulu
6a15edfed3 dri/nv04: GL_EXT_secondary_color
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-03-07 22:40:10 +01:00
Andrew Randrianasulu
e64680bc1e dri/nouveau: Trivially add GL_NV_blend_square
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-03-07 22:40:10 +01:00
Francisco Jerez
5befb6f810 dri/nouveau: Check _ColorDrawBuffers[0] before emitting fb state. 2010-03-07 22:40:09 +01:00
Maciej Cencora
ba196a8318 radeon: handle compressed sRGB texture formats 2010-03-07 22:13:44 +01:00
Marek Olšák
6b39abb63a r300g: fix DRM errors 2010-03-07 16:24:17 +01:00
Marek Olšák
57a1395ec3 r300g: disable macrotiling when the texture height is smaller than a macrotile
Otherwise incorrect rendering occurs (no idea why).
2010-03-07 16:24:09 +01:00
Marek Olšák
b37d633375 r300g: enable micro- and macrotiling for all textures and renderbuffers 2010-03-07 16:23:42 +01:00
Marek Olšák
6c7fac846e r300g: add ability to tile/detile textures using blit during transfers 2010-03-07 15:39:37 +01:00
Marek Olšák
4012219f1f r300g: move r300_transfer to separate files 2010-03-07 15:39:37 +01:00
Maciej Cencora
ccbe3f0314 radeon: move glGetTexImage handlers to seperate file 2010-03-07 12:22:09 +01:00
Maciej Cencora
2b801066a1 radeon: Some possible improvements that I spoted in radeon_tiled_texture branch. 2010-03-07 12:21:30 +01:00
Maciej Cencora
d0ca5c3100 radeon: properly calculate rowstride for tiled images 2010-03-07 12:21:30 +01:00
Maciej Cencora
0d3835475f radeon: minor refactoring of mipmap code 2010-03-07 12:21:30 +01:00
Maciej Cencora
b078a613be radeon: add texture helper function 2010-03-07 12:21:30 +01:00
Maciej Cencora
8014b5f068 radeon: add some debugging info to sw tiling/untiling functions 2010-03-07 12:21:29 +01:00
Maciej Cencora
5fefca5dba radeon: add software untiling functions 2010-03-07 12:07:45 +01:00
Maciej Cencora
65faa27aa6 radeon: add tile size getter 2010-03-07 12:07:36 +01:00
Maciej Cencora
88a99bb305 radeon: added tiling functions 2010-03-07 12:07:29 +01:00
Maciej Cencora
9c0c6c26de r300: don't enable EXT_packed_depth_stencil
R300 hw doesn't support sampling from Z24_S8 or S8_Z24 formats.
2010-03-07 12:07:06 +01:00
Maciej Cencora
78eb4a2ea5 radeon: no need to emit full state twice after flush 2010-03-07 12:05:38 +01:00
Maciej Cencora
ea3494b98c r300: allow src and dst BOs to be placed in GTT during blit
Fixes some relocation failures
2010-03-07 12:05:01 +01:00
Maciej Cencora
c0a0a1933d r300: reset bos when validating buffers during blit 2010-03-07 12:04:44 +01:00
Maciej Cencora
9543f7f05f radeon: fallback to software in glCopyTexImage if blit isn't available 2010-03-07 12:04:30 +01:00
Maciej Cencora
042779dc85 r300: VAP flush is needed only when vertex program or constants are changed 2010-03-07 12:02:28 +01:00
Maciej Cencora
89ea402237 r300: recalculate point size, if point min/max size changes
Fixes two wine d3d9 unit tests
2010-03-07 12:00:48 +01:00
Maciej Cencora
e2d96b2bf8 r300: no need to flush on context init 2010-03-07 12:00:40 +01:00
Maciej Cencora
bbab68ae2d r300: remove unnecessary code
_tnl_UpdateFixedFunctionProgram is already called in r300_draw.c
2010-03-07 12:00:26 +01:00
Marek Olšák
690ded32cd r300g: disable emitting the HWTCL-related state when SWTCL is in use
Now SWTCL renders at least "something", we're close...
2010-03-07 03:41:00 +01:00
Marek Olšák
81992f37da r300g: resurrect r300_emit_vertex_buffer for SWTCL
Taken over from c9928ac3ee.
2010-03-07 03:33:41 +01:00
Marek Olšák
b03b70f658 r300g: validate buffers when using SWTCL 2010-03-07 02:44:57 +01:00
Marek Olšák
4f541db80c r300g: share the VS-output-mapping state with SWTCL
And associated cleanups.
2010-03-07 02:44:20 +01:00
Marek Olšák
6f4a19ca56 r300g: abort if FS compilation fails on non-debug builds 2010-03-07 01:12:57 +01:00
Marek Olšák
09653d65e9 r300g: minor cleanups after the no-rhw merge 2010-03-06 23:29:17 +01:00
Marek Olšák
c37a20416d r300g: clamp vertex max index according to currently bound buffers 2010-03-06 21:27:02 +01:00
José Fonseca
45ae4434b5 util: Use bitshift arithmetic to unpack pixels.
All test cases pass now.
2010-03-06 14:36:51 +00:00
José Fonseca
b999e9c03d progs/gallium/unit: Remove the test cases. 2010-03-06 14:36:51 +00:00
José Fonseca
212e7433db util: Move the format tests cases here so that they can be easily shared. 2010-03-06 14:36:51 +00:00
George Sapountzis
323238864f include/GL: drop more deprecated headers 2010-03-06 15:18:51 +02:00
José Fonseca
0869f0edf1 util: Several fixes to clamping and test.
All tests pass here except util_format_b5g5r5a1_unorm_unpack_4ub, due to
apparently a gcc 4.4.3 bug.
2010-03-06 12:50:47 +00:00
José Fonseca
f342ceca38 util: Fix the maximum value computation for SSCALED channels. 2010-03-06 12:49:14 +00:00
José Fonseca
cfde6c50ae util: Add a new flag, for formats that can be described as a bitmask. 2010-03-06 12:48:39 +00:00
José Fonseca
6718f03258 progs/gallium/unit: Skip test cases which cannot be represented in 4ub. 2010-03-06 12:47:49 +00:00
José Fonseca
709dffcd12 progs/gallium/unit: Use the shortened name to reconstruct the function being tested. 2010-03-06 12:47:01 +00:00
José Fonseca
4afae877e6 util: Add the shortened format name to the description. 2010-03-06 12:46:29 +00:00
José Fonseca
f133861a93 progs/gallium/unit: Cleanup/fix PIPE_FORMAT_R8SG8SB8UX8U_NORM test cases. 2010-03-06 12:45:36 +00:00
José Fonseca
69602b4dd3 gallivm: Add some notes about sampler static state construction.
Recover some logic to make state canonical, although it is admittedly very
shy compared with what could be done.

We really need an helper module to make state canonical.
2010-03-06 10:23:07 +00:00
José Fonseca
89258652b6 gallivm: Answer question/comment.
This reverts commit 71c0568952.
2010-03-06 09:45:05 +00:00
José Fonseca
44703217f7 scons: Refuse to use LLVM 2.7 for now.
LLVM's trunk is totally broken, at least for x86_64.

See http://www.llvm.org/bugs/show_bug.cgi?id=6429
2010-03-06 09:34:31 +00:00
José Fonseca
19a633310f scons: Fix version comparisons. 2010-03-06 09:34:31 +00:00
José Fonseca
ccf57af93f gallivm: Add a placeholder for TGSI_FILE_PREDICATE registers. 2010-03-06 09:34:31 +00:00
José Fonseca
32631b69f5 gallivm: Integrate udis86 on scons builds. 2010-03-06 09:34:31 +00:00
José Fonseca
9af74a38c7 gallivm: Generate valid IR for LLVM 2.7.
The signatures for pack intrinsics were made more consistent in this
version.
2010-03-06 09:34:31 +00:00
José Fonseca
8edc6b0bfc scons: Detect and support LLVM 2.7. 2010-03-06 09:34:31 +00:00
George Sapountzis
419f0f9d04 dri: drop MINIGLX_SOURCES (2) 2010-03-06 06:44:39 +02:00
George Sapountzis
8953bfce0e dri: drop MINIGLX_SOURCES 2010-03-06 06:44:38 +02:00
George Sapountzis
9009a854d1 config: drop WINDOW_SYSTEM var 2010-03-06 06:44:36 +02:00
Brian Paul
67277a6d11 docs: skeleton for 7.9 release notes 2010-03-05 17:36:34 -07:00
Brian Paul
6ce4a85e0b mesa: bump version to 7.9
Now that the 7.8 branch has been created Mesa/master will be version 7.9
2010-03-05 17:35:10 -07:00
Jon TURNEY
96ab4d2b84 glx: Move initialization of ext_list_first_time to where it's storage is allocated
Move the initialization of ext_list_first_time from all of the DRI loader's
CreateScreen routines, to where the storage for the screen config is
allocated.

It needs to get set in the screen-config even if DRI is forced off
using LIBGL_ALWAYS_INDIRECT, so that psc->direct_support is initialized
correctly, otherwise __glXExtensionBitIsEnabled() always returns FALSE

Specifically, this causes a problem with an X server which advertises
GLX<=1.2, and the GLX_SGIX_fbconfig extension.
glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to
check if the GLX_SGIX_fbconfig extension is available, but that function
won't return correct information because that data has never been
initialized, because ext_list_first_time was never set...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-03-05 17:11:23 -07:00
Christoph Bumiller
5024a39d11 nouveau: s/TEXTURE_USAGE_PRIMARY/TEXTURE_USAGE_SCANOUT 2010-03-05 18:18:49 +01:00
Keith Whitwell
3b6a991728 softpipe: fix constant buffer tracking after rework 2010-03-04 16:50:22 +00:00
Keith Whitwell
c549593931 gallium: remove redundant includes 2010-03-04 16:34:59 +00:00
Keith Whitwell
23e951d0da gallium: fix llvmpipe after winsys move 2010-03-04 16:23:05 +00:00
Keith Whitwell
94ce4eb3c2 softpipe: rework to use the llvmpipe winsys
Promote the llvmpipe winsys more or less unchanged to
state_trackers/sw_winsys.h.

Some minor breakages:
  - softpipe::texture_blanket is broken, but scheduled for removal anyway.
  - haven't fixed up g3vdl yet.
2010-03-04 16:09:33 +00:00
Jakob Bornecrantz
caa8a365c5 svga: Forgot one bit in rebase 2010-03-04 14:57:44 +00:00
Jakob Bornecrantz
3bd622d64e nouveau: Conversion to winsys handle
Not the best conversion that could be done.
2010-03-04 14:37:29 +00:00
Keith Whitwell
86e146df97 softpipe: remove dead get_texture_buffer function 2010-03-04 13:22:37 +00:00
Keith Whitwell
4b61fd22a8 r300g: remove dead r300_get_texture_buffer function 2010-03-04 13:22:21 +00:00
Corbin Simpson
4240987cec r300g: Make velem CSO actually work.
glxgears runs again.
2010-03-02 18:40:03 -08:00
Michal Krol
f59f28093e softpipe: Implement sampler view swizzling. 2010-03-02 12:03:24 +01:00
Michal Krol
5587097b53 util: Add pipe_get_tile_swizzle(). 2010-03-02 12:02:31 +01:00
Ian Romanick
18238de6c3 Make AST->HIR conversion a method of ast_node, re-enable 2010-03-01 13:49:10 -08:00
Roland Scheidegger
ddccf77974 nv40: adapt to vertex element cso 2010-03-01 20:11:47 +01:00
Roland Scheidegger
5bf4ff7dab nv30: adapt to vertex element cso 2010-03-01 20:11:36 +01:00
Roland Scheidegger
881be30836 identity: adapt to new vertex element cso 2010-03-01 18:48:05 +01:00
Roland Scheidegger
2918edb46a failover: adapt to new vertex element cso 2010-03-01 18:47:54 +01:00
Roland Scheidegger
470dbb84b8 i965g: adapt to new vertex element cso 2010-03-01 18:47:28 +01:00
Roland Scheidegger
8e2df0dcb9 i915g: adapt to new vertex element cso 2010-03-01 18:47:17 +01:00
Roland Scheidegger
4dfe2df629 cell: adapt to new vertex element cso 2010-03-01 18:47:04 +01:00
Roland Scheidegger
e9441e1f88 r300g: adapt to new vertex element cso 2010-03-01 18:46:49 +01:00
Roland Scheidegger
f897303855 llvmpipe: adapt to new vertex element cso 2010-03-01 18:46:39 +01:00
Roland Scheidegger
057427dd3e softpipe: adapt to new vertex element cso 2010-03-01 18:46:29 +01:00
Roland Scheidegger
b1676a953e svga: adapt to new vertex element cso 2010-03-01 18:46:12 +01:00
Roland Scheidegger
618e7e0c88 trace: adapt to new vertex element cso 2010-03-01 18:45:57 +01:00
Roland Scheidegger
9abef5ebfa vega: adapt to new vertex element cso 2010-03-01 18:45:46 +01:00
Roland Scheidegger
1f57069c68 vega: adapt to new vertex element cso 2010-03-01 18:45:25 +01:00
Roland Scheidegger
711476be29 xorg: adapt to new vertex element cso 2010-03-01 18:43:58 +01:00
Roland Scheidegger
8397c80646 gallium/docs: document new vertex element cso interface 2010-03-01 18:42:47 +01:00
Roland Scheidegger
49d3f662b6 vl: adapt to new vertex element cso interface 2010-03-01 18:41:03 +01:00
Roland Scheidegger
ac4abaecd5 util: adapt blitter code to new vertex element cso
The interface of util_draw_vertex_buffer looks a bit odd (calling code has to
set vertex elements but not vertex buffers) but due to the way cso state
handling generally works (can't re-bind original vertex element state easily
there) I guess that's ok for now.
2010-03-01 18:40:22 +01:00
Roland Scheidegger
18603a2f07 st/mesa: fix mesa statetracker adaption to new vertex elements interface 2010-03-01 18:36:19 +01:00
Jakob Bornecrantz
d160eed005 r300g: Conversion to to winsys handle 2010-03-01 16:05:59 +00:00
Jakob Bornecrantz
3a2358b6c6 svga: Conversion to winsys handle 2010-03-01 16:05:58 +00:00
Jakob Bornecrantz
45089784e3 i965g: Conversion to winsys handle 2010-03-01 16:05:48 +00:00
Jakob Bornecrantz
0e1eb1b876 i915g: Conversion to winsys handle 2010-03-01 16:05:40 +00:00
Jakob Bornecrantz
3f37f23d17 gallium: Reorg texture usage flags
Introduce a new shared usage and rename primary to scanout.
The display target usage is more of a windows concept and
doesn't mean the same thing as shared. Display target means
that the surface should be presentable, for softpipe this
means that it should be backed by a hardware buffer.
2010-03-01 16:05:35 +00:00
Jakob Bornecrantz
b2e94d05c9 gallium: Expose a opaque winsys handle and functions on pipe_screen
Instead of having these functions on a side interface like on
drm_api create a opaque winsys_handle that is to be passed down
into the winsys.

Currently the only thing ported to this new interface is drm_api,
and of that only the components that builds by default is ported.
All the drivers and any extra state trackers needs to be ported
before this can go into master.
2010-03-01 16:05:24 +00:00
Christoph Bumiller
f2656c3e3c nv50: adapt to vertex elements cso 2010-02-26 14:19:52 +01:00
Ian Romanick
d59673c9de autoconf for the ... 2010-02-25 17:17:23 -08:00
Ian Romanick
e41a1cd4d5 Replace tacky wrapper macros with tacky in-line type-casts 2010-02-25 12:49:55 -08:00
Ian Romanick
168890ce1b Convert to new interfaces so that it will compile
Convert TRUE and FALSE to true and false.  Convert
_mesa_ast_get_location to ast_node::get_location.
2010-02-25 12:24:40 -08:00
Christoph Bumiller
a69fdb84df nv30: function is called nv30_set_fragment_sampler_views, plural 2010-02-25 16:43:01 +01:00
Christoph Bumiller
44570063bf nv50: update to handle new sampler view state 2010-02-25 16:39:58 +01:00
Brian Paul
013dd29cca gallium/util: rewrap comment to fit in 80 columns 2010-02-25 08:05:53 -07:00
Brian Paul
9960b3ed4b gallium: added util/u_sampler.c to Makefile 2010-02-25 08:04:29 -07:00
Michal Krol
e81caade02 docs: Document sampler view entry points. 2010-02-25 15:33:15 +01:00
Michal Krol
9aeb206e17 cell: Fix after sampler view changes.
Did not test build.
2010-02-25 15:16:18 +01:00
Michal Krol
6a8961a247 nv50: Fix after sampler view changes.
Did not test build.
2010-02-25 14:56:19 +01:00
Michal Krol
512d3e691e nv40: Fix after sampler view changes.
Did not test build.
2010-02-25 14:46:31 +01:00
Michal Krol
e3c2a053cf nv30: Fix after sampler view changes.
Did not test build.
2010-02-25 14:40:56 +01:00
Michal Krol
06f6345790 docs: Update after sampler view changes. 2010-02-25 14:27:34 +01:00
Michal Krol
3e0181f473 python: Fix typo. 2010-02-25 14:21:50 +01:00
Michal Krol
92a8c42baa python: Fix after sampler view changes. 2010-02-25 14:19:54 +01:00
Ian Romanick
88349b22ca Add ast_expression_bin subclass of ast_expression
The ast_expression_bin subclass is used for all binary expressions
such as addition, subtraction, and comparisons.  Several other
subclasses are soon to follow.
2010-02-22 19:10:25 -08:00
Ian Romanick
89227f6ce4 Ignore all build products 2010-02-22 19:09:45 -08:00
Zack Rusin
c5c5cd7132 gallium/draw: initial code to properly support llvm in the draw module
code generate big chunks of the vertex pipeline in order to speed up
software vertex processing.
2010-02-22 22:02:58 -05:00
Ian Romanick
d5f4f09e76 Rename .cc files to .cpp 2010-02-22 18:43:08 -08:00
Ian Romanick
53d2774ee3 Initialize the node structure embedded in the ast_node 2010-02-22 13:22:10 -08:00
Ian Romanick
a87ac255cf Initial commit. lol 2010-02-22 13:19:34 -08:00
Roland Scheidegger
51d139f038 gallium: use cso state handling for pipe_vertex_element state 2010-02-18 16:36:25 +01:00
Roland Scheidegger
464a72dd41 gallium: remove redundant nr_components field from pipe_vertex_element
This is a property of the associated src_format pipe format.
Hence use util_format_get_nr_components to query this when necessary instead.
2010-02-17 16:44:38 +01:00
Roland Scheidegger
c2ad9e3801 util: new util_format_get_nr_components helper 2010-02-17 16:41:30 +01:00
michal
3a7314a78d gallium: Silence compiler warnings. 2009-12-10 09:29:15 +01:00
michal
1fb440beb9 llvmpipe: Fix after sampler view changes. 2009-12-10 09:23:15 +01:00
michal
3710a6f6cc r300: Fix after sampler view changes. 2009-12-10 08:46:19 +01:00
michal
875f6d20b1 i965: Fix after sampler view changes. 2009-12-10 08:05:45 +01:00
michal
1f5285f997 i915: Fix for sampler view changes. 2009-12-10 07:52:45 +01:00
Michal Krol
92b781c2dd trace: Fix after sampler view changes. 2010-02-23 19:18:27 +01:00
Michal Krol
ad230a1fb1 svga: Fix after sampler view changes. 2010-02-23 17:03:56 +01:00
Michal Krol
eb9c9efedf softpipe: Fix after sampler view changes. 2010-02-23 16:37:42 +01:00
Michal Krol
14a146c499 identity: Fix after sampler view changes. 2010-02-23 16:09:40 +01:00
Michal Krol
9187b25a15 failover: Fix after sampler view changes. 2010-02-23 16:09:10 +01:00
Michal Krol
f610656608 gallium: WIP: Introduce sampler views. 2010-02-19 19:00:26 +01:00
Michal Krol
3d0bfc6a4b tgsi: Make more exec opcodes look pretty. 2010-02-18 12:07:18 +01:00
Michal Krol
348d236afc tgsi: Change prototypes of micro opcodes to explicitly indicates number of args. 2010-02-18 12:07:15 +01:00
Michal Krol
9f952cceb4 tgsi: Rewrite exec implementations of NRM and NRM4. 2010-02-18 12:07:11 +01:00
4097 changed files with 384523 additions and 1180480 deletions

1
.gitignore vendored
View File

@@ -25,3 +25,4 @@ cscope*
.scon*
config.py
build
.dir-locals.el

200
Makefile
View File

@@ -2,7 +2,7 @@
TOP = .
SUBDIRS = src progs
SUBDIRS = src
default: $(TOP)/configs/current
@@ -180,12 +180,17 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.8-devel
VERSION=7.9.2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
# This is part of MAIN_FILES
MAIN_ES_FILES = \
$(DIRECTORY)/src/mesa/main/*.xml \
$(DIRECTORY)/src/mesa/main/*.py \
$(DIRECTORY)/src/mesa/main/*.dtd
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/configure \
@@ -215,18 +220,18 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/mglmesa.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*/Makefile \
$(DIRECTORY)/src/glsl/*/*.[ch] \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/sources.mak \
@@ -234,19 +239,15 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/shader/*.[chly] \
$(DIRECTORY)/src/mesa/shader/Makefile \
$(DIRECTORY)/src/mesa/shader/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
$(DIRECTORY)/src/mesa/shader/slang/library/*.gc \
$(DIRECTORY)/src/mesa/shader/slang/library/Makefile \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/Makefile \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
@@ -275,8 +276,6 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/glslcompiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/glslcompiler/glslcompiler.c \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \
@@ -285,30 +284,35 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/progs/Makefile \
$(DIRECTORY)/progs/util/README \
$(DIRECTORY)/progs/util/*.[ch] \
$(DIRECTORY)/progs/util/sampleMakefile \
$(DIRECTORY)/windows/VC8/
ES_FILES = \
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
$(DIRECTORY)/include/GLES2/*.h \
$(DIRECTORY)/src/mesa/glapi/gen/*.xml \
$(DIRECTORY)/src/mesa/glapi/gen/*.py \
$(DIRECTORY)/src/mesa/glapi/gen/*.dtd \
$(DIRECTORY)/src/mesa/es/glapi/Makefile \
$(DIRECTORY)/src/mesa/es/glapi/*.xml \
$(DIRECTORY)/src/mesa/es/glapi/*.py \
$(DIRECTORY)/src/mesa/es/state_tracker/*.[ch] \
$(DIRECTORY)/src/mesa/es/main/*.[ch] \
$(DIRECTORY)/src/mesa/es/main/*.xml \
$(DIRECTORY)/src/mesa/es/main/*.py \
$(DIRECTORY)/src/mesa/es/main/*.dtd \
$(DIRECTORY)/src/mesa/es/Makefile \
$(DIRECTORY)/src/mesa/es/sources.mak \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/src/mapi/es?api/Makefile \
$(DIRECTORY)/src/mapi/es?api/*.pc.in \
$(DIRECTORY)/src/mapi/glapi/gen/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen/*.py \
$(DIRECTORY)/src/mapi/glapi/gen/*.dtd \
$(DIRECTORY)/src/mapi/glapi/gen-es/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.py \
$(DIRECTORY)/src/mapi/glapi/Makefile \
$(DIRECTORY)/src/mapi/glapi/SConscript \
$(DIRECTORY)/src/mapi/glapi/sources.mak \
$(DIRECTORY)/src/mapi/glapi/*.[chS] \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in \
$(DIRECTORY)/src/mapi/vgapi/*.h
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/include/EGL/*.h \
$(DIRECTORY)/src/egl/Makefile \
$(DIRECTORY)/src/egl/*/Makefile \
@@ -316,46 +320,58 @@ EGL_FILES = \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/Makefile.template \
$(DIRECTORY)/src/gallium/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/auxiliary/gallivm/*.cpp \
$(DIRECTORY)/src/gallium/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*.csv \
$(DIRECTORY)/src/gallium/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch] \
$(DIRECTORY)/src/glx/apple/*.tcl \
$(DIRECTORY)/src/glx/apple/apple_exports.list \
$(DIRECTORY)/src/glx/apple/GL_aliases \
$(DIRECTORY)/src/glx/apple/GL_extensions \
$(DIRECTORY)/src/glx/apple/GL_noop \
$(DIRECTORY)/src/glx/apple/GL_promoted \
$(DIRECTORY)/src/glx/apple/specs/*.spec \
$(DIRECTORY)/src/glx/apple/specs/*.tm
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
@@ -380,15 +396,6 @@ SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
MESA_GLU_FILES = \
$(DIRECTORY)/src/glu/mesa/README[12] \
$(DIRECTORY)/src/glu/mesa/Makefile* \
$(DIRECTORY)/src/glu/mesa/descrip.mms \
$(DIRECTORY)/src/glu/mesa/mms_depend \
$(DIRECTORY)/src/glu/mesa/*.def \
$(DIRECTORY)/src/glu/mesa/depend \
$(DIRECTORY)/src/glu/mesa/*.[ch]
GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
@@ -396,51 +403,6 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
GLEW_FILES = \
$(DIRECTORY)/include/GL/glew.h \
$(DIRECTORY)/include/GL/glxew.h \
$(DIRECTORY)/include/GL/wglew.h \
$(DIRECTORY)/src/glew/*.c \
$(DIRECTORY)/src/glew/Makefile \
$(DIRECTORY)/src/glew/SConscript \
$(DIRECTORY)/src/glew/LICENSE.txt
DEMO_FILES = \
$(GLEW_FILES) \
$(DIRECTORY)/progs/beos/*.cpp \
$(DIRECTORY)/progs/beos/Makefile \
$(DIRECTORY)/progs/images/*.rgb \
$(DIRECTORY)/progs/images/*.rgba \
$(DIRECTORY)/progs/demos/Makefile* \
$(DIRECTORY)/progs/demos/descrip.mms \
$(DIRECTORY)/progs/demos/*.[ch] \
$(DIRECTORY)/progs/demos/*.cxx \
$(DIRECTORY)/progs/demos/*.dat \
$(DIRECTORY)/progs/demos/README \
$(DIRECTORY)/progs/fbdev/Makefile \
$(DIRECTORY)/progs/fbdev/glfbdevtest.c \
$(DIRECTORY)/progs/objviewer/*.[ch] \
$(DIRECTORY)/progs/objviewer/*.obj \
$(DIRECTORY)/progs/objviewer/*.mtl \
$(DIRECTORY)/progs/objviewer/*.rgb \
$(DIRECTORY)/progs/objviewer/Makefile \
$(DIRECTORY)/progs/objviewer/README.txt \
$(DIRECTORY)/progs/osdemos/Makefile \
$(DIRECTORY)/progs/osdemos/*.c \
$(DIRECTORY)/progs/xdemos/Makefile* \
$(DIRECTORY)/progs/xdemos/*.[chf] \
$(DIRECTORY)/progs/redbook/Makefile* \
$(DIRECTORY)/progs/redbook/README \
$(DIRECTORY)/progs/redbook/*.[ch] \
$(DIRECTORY)/progs/samples/Makefile* \
$(DIRECTORY)/progs/samples/README \
$(DIRECTORY)/progs/samples/*.c \
$(DIRECTORY)/progs/glsl/Makefile* \
$(DIRECTORY)/progs/glsl/*.c \
$(DIRECTORY)/progs/glsl/*.frag \
$(DIRECTORY)/progs/glsl/*.vert \
$(DIRECTORY)/progs/glsl/*.shtest
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
@@ -451,11 +413,7 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile \
$(DIRECTORY)/src/glut/fbdev/Makefile \
$(DIRECTORY)/src/glut/fbdev/*[ch] \
$(DIRECTORY)/src/glut/mini/*[ch] \
$(DIRECTORY)/src/glut/mini/glut.pc.in \
$(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
@@ -467,6 +425,7 @@ DEPEND_FILES = \
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GALLIUM_FILES) \
@@ -476,8 +435,8 @@ LIB_FILES = \
# Everything for new a Mesa release:
tarballs: rm_depend configure aclocal.m4 lib_gz demo_gz glut_gz \
lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5
tarballs: rm_depend configure aclocal.m4 lib_gz glut_gz \
lib_bz2 glut_bz2 lib_zip glut_zip md5
# Helper for autoconf builds
@@ -506,12 +465,6 @@ lib_gz: rm_config
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
demo_gz:
cd .. ; \
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
gzip $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
glut_gz:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
@@ -524,12 +477,6 @@ lib_bz2: rm_config
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
demo_bz2:
cd .. ; \
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
bzip2 $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
glut_bz2:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
@@ -542,12 +489,6 @@ lib_zip: rm_config
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
demo_zip:
rm -f $(DEMO_NAME).zip ; \
cd .. ; \
zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \
mv $(DEMO_NAME).zip $(DIRECTORY)
glut_zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
@@ -558,14 +499,11 @@ md5:
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@-md5sum $(DEMO_NAME).tar.gz
@-md5sum $(DEMO_NAME).tar.bz2
@-md5sum $(DEMO_NAME).zip
@-md5sum $(GLUT_NAME).tar.gz
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz demo_gz glut_gz \
lib_bz2 demo_bz2 glut_bz2 \
lib_zip demo_zip glut_zip
lib_gz glut_gz \
lib_bz2 glut_bz2 \
lib_zip glut_zip

View File

@@ -31,9 +31,10 @@ import common
# Configuration options
default_statetrackers = 'mesa'
default_targets = 'graw-null'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_drivers = 'softpipe,failover,svga,i915,i965,trace,identity,llvmpipe'
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'
@@ -48,11 +49,34 @@ else:
opts = Variables('config.py')
common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg']))
['mesa', 'python', 'xorg', 'egl']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'identity', 'llvmpipe']))
['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', 'intel', 'i965', 'gdi', 'radeon']))
['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')))
@@ -81,13 +105,6 @@ debug = env['debug']
dri = env['dri']
machine = env['machine']
platform = env['platform']
drawllvm = 'llvmpipe' in env['drivers']
# LLVM support in the Draw module
if drawllvm:
env.Tool('llvm')
if not env.has_key('LLVM_VERSION'):
drawllvm = False
# derived options
x86 = machine == 'x86'
@@ -100,7 +117,6 @@ Export([
'x86',
'ppc',
'dri',
'drawllvm',
'platform',
'gcc',
'msvc',
@@ -110,16 +126,31 @@ Export([
#######################################################################
# Environment setup
# Always build trace driver
# 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.Append(CPPPATH = [
env.Prepend(CPPPATH = [
'#/include',
])
env.Append(CPPPATH = [
'#/src/gallium/include',
'#/src/gallium/auxiliary',
'#/src/gallium/drivers',
'#/src/gallium/winsys',
])
if env['msvc']:
@@ -150,45 +181,19 @@ if platform in ('posix', 'linux', 'freebsd', 'darwin'):
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if gcc:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if platform == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(CPPPATH = ['/usr/X11R6/include'])
env.Append(LIBPATH = ['/usr/X11R6/lib'])
env.Append(LIBS = [
'm',
'pthread',
'expat',
'dl',
])
# DRI
if dri:
env.ParseConfig('pkg-config --cflags --libs libdrm')
env.Append(CPPDEFINES = [
('USE_EXTERNAL_DXTN_LIB', '1'),
'IN_DRI_DRIVER',
'GLX_DIRECT_RENDERING',
'GLX_INDIRECT_RENDERING',
])
# LLVM support in the Draw module
if drawllvm:
env.Append(CPPDEFINES = ['DRAW_LLVM'])
# libGL
if platform in ('linux', 'freebsd', 'darwin'):
env.Append(LIBS = [
'X11',
'Xext',
'Xxf86vm',
'Xdamage',
'Xfixes',
])
# for debugging
#print env.Dump()
@@ -201,28 +206,6 @@ Export('env')
# TODO: Build several variants at the same time?
# http://www.scons.org/wiki/SimultaneousVariantBuilds
if env['platform'] != common.default_platform:
# GLSL code has to be built twice -- one for the host OS, another for the target OS...
host_env = Environment(
# options are ignored
# default tool is used
tools = ['default', 'custom'],
toolpath = ['#scons'],
ENV = os.environ,
)
host_env['platform'] = common.default_platform
host_env['machine'] = common.default_machine
host_env['debug'] = env['debug']
SConscript(
'src/glsl/SConscript',
variant_dir = os.path.join(env['build'], 'host'),
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
exports={'env':host_env},
)
SConscript(
'src/SConscript',
variant_dir = env['build'],
@@ -231,8 +214,3 @@ SConscript(
env.Default('src')
SConscript(
'progs/SConscript',
variant_dir = os.path.join('progs', env['build']),
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)

View File

@@ -31,7 +31,7 @@ if [ $# -ge 2 ] ; then
# Last cmd line arg is the dest dir
for FILE in $@ ; do
DEST="$FILE"
DESTDIR="$FILE"
done
# Loop over args, moving them to DEST directory
@@ -42,6 +42,25 @@ if [ $# -ge 2 ] ; then
exit 0
fi
DEST=$DESTDIR
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
# they are installed in the executable path. Stub libraries used
# only for linking are installed in the library path
case `uname` in
CYGWIN*)
case $FILE in
*.dll)
DEST="$DEST/../bin"
;;
*)
;;
esac
;;
*)
;;
esac
PWDSAVE=`pwd`
# determine file's type

View File

@@ -494,13 +494,16 @@ case $ARCH in
OPTS="${OPTS} -Wl,-Mmapfile.scope"
fi
# Check if objects are SPARC v9
# Check if objects are 64-bit
# file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
set ${OBJECTS}
if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
SPARCV9=`file $1 | grep SPARCV9`
if [ "${SPARCV9}" ] ; then
OPTS="${OPTS} -xarch=v9"
ABI64=`file $1 | grep "ELF 64-bit"`
if [ "${ABI64}" ] ; then
case `uname -p` in
sparc) OPTS="${OPTS} -xarch=v9" ;;
i386) OPTS="${OPTS} -xarch=amd64" ;;
esac
fi
fi
if [ "${ALTOPTS}" ] ; then
@@ -927,6 +930,16 @@ case $ARCH in
CYGWIN*)
# GCC-based environment
if [ "x$LINK" = "x" ] ; then
# -linker was not specified so set default link command now
if [ $CPLUSPLUS = 1 ] ; then
LINK=g++
else
LINK=gcc
fi
fi
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
@@ -935,7 +948,7 @@ case $ARCH in
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} || exit $?
FINAL_LIBS=${LIBNAME}
else
CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
@@ -943,7 +956,7 @@ case $ARCH in
if [ $STATIC = 1 ] ; then
LIBNAME=${LIBNAME}.a
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
echo "mklib: Making CYGWIN static library: " ${LIBNAME}
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
@@ -961,13 +974,7 @@ case $ARCH in
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
else
LINK="gcc"
fi
echo "mklib: Making CYGWIN shared library: " ${CYGNAME}-${MAJOR}.dll
# rm any old libs
rm -f ${CYGNAME}-${MAJOR}.dll
@@ -976,12 +983,7 @@ case $ARCH in
rm -f ${LIBNAME}.a
# make lib
${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS}
# make build fail if link failed
es=$?
if [ "$es" -ne "0" ]; then
exit $es
fi
${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} || exit $?
# make usual symlinks
ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a
# finish up
@@ -1021,4 +1023,9 @@ if [ ${INSTALLDIR} != "." ] ; then
echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
mv ${FINAL_LIBS} ${INSTALLDIR}/
if [ "x${FINAL_BINS}" != "x" ] ; then
echo "mklib: Installing" ${FINAL_BINS} "in" ${INSTALLDIR}
mv ${FINAL_BINS} ${INSTALLDIR}/
fi
fi

View File

@@ -3,6 +3,8 @@
import os
import os.path
import re
import subprocess
import sys
import platform as _platform
@@ -27,12 +29,38 @@ _machine_map = {
'ppc' : 'ppc',
'x86_64': 'x86_64',
}
# find default_machine value
if 'PROCESSOR_ARCHITECTURE' in os.environ:
default_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
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 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'):
@@ -53,14 +81,13 @@ def AddOptions(opts):
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
except ImportError:
from SCons.Options.EnumOption import EnumOption
opts.Add(BoolOption('debug', 'debug build', 'no'))
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', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded')))
opts.Add(EnumOption('toolchain', 'compiler toolchain', 'default',
allowed_values=('default', 'crossmingw', 'winsdk', 'winddk')))
opts.Add(BoolOption('llvm', 'use LLVM', 'no'))
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('dri', 'build DRI drivers', default_dri))

View File

@@ -14,6 +14,8 @@ ARCH_FLAGS = @ARCH_FLAGS@
ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
GLES_OVERLAY = @GLES_OVERLAY@
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
@@ -24,8 +26,18 @@ RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
# Assembler
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
@@ -38,7 +50,7 @@ MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
# Python and flags (generally only needed by the developers)
PYTHON2 = python
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Library names (base name)
@@ -47,6 +59,9 @@ GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -55,6 +70,9 @@ GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
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@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -63,6 +81,9 @@ GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
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@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -73,18 +94,15 @@ EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = @PROGRAM_DIRS@
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
WINDOW_SYSTEM = @WINDOW_SYSTEM@
EGL_DISPLAYS = @EGL_DISPLAYS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
@@ -105,6 +123,9 @@ GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
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@
# DRI dependencies
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
@@ -153,6 +174,23 @@ GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
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@
EGL_DRI2_CFLAGS = @EGL_DRI2_CFLAGS@
EGL_DRI2_LIBS = @EGL_DRI2_LIBS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
ifneq ($(LLVM_VERSION),)
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
endif
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@

View File

@@ -90,10 +90,9 @@ else
endif
# Directories
SRC_DIRS = gallium mesa glu glut/beos glew
SRC_DIRS = gallium mesa glu glut/beos
GLU_DIRS = sgi
DRIVER_DIRS = beos
PROGRAM_DIRS = beos samples redbook demos tests
# Library/program dependencies
GL_LIB_DEPS =

View File

@@ -24,7 +24,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -20,7 +20,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -23,7 +23,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -13,7 +13,10 @@ CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
-DGLX_ALIAS_UNSUPPORTED \
-DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL
# -DGLX_INDIRECT_RENDERING \
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx
@@ -28,30 +31,33 @@ 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
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl glx mesa gallium glu glut/glx glew
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu glut/glx
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
PROGRAM_DIRS = xdemos
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=8
MESA_MINOR=9
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
@@ -52,20 +52,24 @@ INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLEW_LIB = GLEW
GLW_LIB = GLw
OSMESA_LIB = OSMesa
EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
GLU_LIB_NAME = lib$(GLU_LIB).so
GLUT_LIB_NAME = lib$(GLUT_LIB).so
GLEW_LIB_NAME = lib$(GLEW_LIB).a
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
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
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -74,6 +78,9 @@ GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
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)*
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -86,11 +93,10 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu glut/glx glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
@@ -98,14 +104,15 @@ 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 failover svga i915 i965 r300 trace identity
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 = drm xlib
GALLIUM_WINSYS_DRM_DIRS = swrast
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
GALLIUM_STATE_TRACKERS_DIRS = glx vega
# native displays EGL should support
EGL_DISPLAYS = x11
# native platforms EGL should support
EGL_PLATFORMS = x11
EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
@@ -116,10 +123,15 @@ GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
X11_LIBS = -lX11
DLOPEN_LIBS = -ldl
# Installation directories (for make install)
INSTALL_DIR = /usr/local
@@ -153,3 +165,12 @@ GLW_PC_LIB_PRIV =
GLW_PC_CFLAGS =
OSMESA_PC_REQ =
OSMESA_PC_LIB_PRIV =
GLESv1_CM_PC_REQ_PRIV =
GLESv1_CM_PC_LIB_PRIV =
GLESv1_CM_PC_CFLAGS =
GLESv2_PC_REQ_PRIV =
GLESv2_PC_LIB_PRIV =
GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =

View File

@@ -41,10 +41,8 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu glut/glx glew glw
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
DRM_SOURCE_PATH=$(TOP)/../drm

View File

@@ -6,7 +6,7 @@ CONFIG_NAME = linux-cell
# Omiting other gallium drivers:
GALLIUM_DRIVERS_DIRS = cell softpipe trace
GALLIUM_DRIVERS_DIRS = cell softpipe trace rbug identity
# Compiler and flags
@@ -37,7 +37,8 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS)
# Omitting glw here:
SRC_DIRS = glsl mesa gallium gallium/winsys glu glut/glx glew
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium gallium/winsys gallium/targets glu glut/glx
# Build no traditional Mesa drivers:
DRIVER_DIRS =

View File

@@ -5,5 +5,5 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g
CFLAGS += -pedantic
#CFLAGS += -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -52,15 +52,13 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
# Directories
SRC_DIRS := glx egl $(SRC_DIRS)
PROGRAM_DIRS := egl $(PROGRAM_DIRS)
# EGL directories
EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
GALLIUM_WINSYS_DIRS = drm
GALLIUM_WINSYS_DRM_DIRS = vmware intel i965
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS = egl-swrast
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \

View File

@@ -47,11 +47,8 @@ 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)
SRC_DIRS = glx gallium mesa glu glut/glx glew glw
PROGRAM_DIRS = xdemos
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
WINDOW_SYSTEM=dri
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome

View File

@@ -47,11 +47,10 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
# Directories
SRC_DIRS = gallium mesa gallium/winsys glu egl
PROGRAM_DIRS = egl
SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
GALLIUM_WINSYS_DIRS = egl_drm
GALLIUM_TARGET_DIRS =
DRI_DIRS = intel

View File

@@ -4,14 +4,13 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-fbdev
CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER
CFLAGS += -DUSE_GLFBDEV_DRIVER
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
SRC_DIRS = gallium mesa glu glut/fbdev glew
SRC_DIRS += glut/fbdev
DRIVER_DIRS = fbdev osmesa
PROGRAM_DIRS = fbdev demos redbook samples
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread

View File

@@ -6,3 +6,4 @@ CONFIG_NAME = linux-i965
GALLIUM_DRIVER_DIRS = i965
GALLIUM_WINSYS_DIRS = drm/i965/xlib
GALLIUM_TARGET_DIRS =

View File

@@ -47,7 +47,5 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx glu glut/glx glew glw
SRC_DIRS = glx glu glut/glx glw
DRIVER_DIRS =
PROGRAM_DIRS =
WINDOW_SYSTEM=dri

View File

@@ -10,12 +10,12 @@ CONFIG_NAME = linux-llvm
GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -m32 -mmmx -msse -msse2 -mstackrealign
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DDRAW_LLVM -DHAVE_UDIS86
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)
@@ -24,6 +24,8 @@ ifeq ($(LLVM_VERSION),)
MESA_LLVM=0
else
MESA_LLVM=1
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
# $(info Using LLVM version: $(LLVM_VERSION))
endif

View File

@@ -6,8 +6,8 @@ CONFIG_NAME = linux-opengl-es
# Directories to build
LIB_DIR = lib
SRC_DIRS = egl glsl mesa/es gallium gallium/winsys
PROGRAM_DIRS = es1/screen es1/xegl es2/xegl
SRC_DIRS = egl glsl mapi/es1api mapi/es2api mesa/es \
gallium gallium/winsys gallium/targets
# egl st needs this
DEFINES += -DGLX_DIRECT_RENDERING
@@ -22,7 +22,7 @@ GALLIUM_DRIVERS_DIRS = softpipe
GALLIUM_STATE_TRACKERS_DIRS = es
# build egl_x11_{swrast,i915}.so
GALLIUM_DRIVERS_DIRS += trace i915
GALLIUM_DRIVERS_DIRS += trace rbug i915
GALLIUM_STATE_TRACKERS_DIRS += egl
GALLIUM_WINSYS_DIRS += drm
GALLIUM_WINSYS_DRM_DIRS += intel swrast
GALLIUM_WINSYS_DIRS += drm/intel
GALLIUM_TARGET_DIRS += egl-swrast egl-i915

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CFLAGS = -g -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
@@ -17,12 +17,11 @@ CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -24,7 +24,6 @@ OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies

View File

@@ -20,9 +20,8 @@ OSMESA_LIB_NAME = libOSMesa16.so
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
# Dependencies

View File

@@ -24,7 +24,6 @@ OSMESA_LIB_NAME = libOSMesa16.a
# Directories
SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
# Dependencies

View File

@@ -20,9 +20,8 @@ OSMESA_LIB_NAME = libOSMesa32.so
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
# Dependencies

View File

@@ -4,7 +4,7 @@ AC_PREREQ([2.59])
dnl Versioning - scrape the version from configs/default
m4_define([mesa_version],
[m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
[m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr -d '\r'])])
m4_ifval(mesa_version,,
[m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
@@ -30,6 +30,7 @@ AC_PROG_CPP
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROGS([MAKE], [gmake make])
AC_CHECK_PROGS([PYTHON2], [python2 python])
AC_PATH_PROG([MKDEP], [makedepend])
AC_PATH_PROG([SED], [sed])
@@ -48,9 +49,23 @@ solaris*)
;;
esac
dnl clang is mostly GCC-compatible, but its version is much lower,
dnl so we have to check for it.
AC_MSG_CHECKING([if compiling with clang])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#ifndef __clang__
not clang
#endif
]])],
[CLANG=yes], [CLANG=no])
AC_MSG_RESULT([$CLANG])
dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
dnl versions are explictly not supported.
if test "x$GCC" = xyes; then
if test "x$GCC" = xyes -a "x$CLANG" = xno; then
AC_MSG_CHECKING([whether gcc version is sufficient])
major=0
minor=0
@@ -123,7 +138,10 @@ esac
dnl Add flags for gcc and g++
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
if test "x$CLANG" = "xno"; then
CFLAGS="$CFLAGS -ffast-math"
fi
# Enable -fvisibility=hidden if using a gcc that supports it
save_CFLAGS="$CFLAGS"
@@ -138,6 +156,13 @@ fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -Wall"
# Enable -fvisibility=hidden if using a gcc that supports it
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[CXXFLAGS="$save_CXXFLAGS" ; AC_MSG_RESULT([no])]);
# Work around aliasing bugs - developers should comment this out
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi
@@ -258,6 +283,8 @@ fi
dnl
dnl library names
dnl
LIB_PREFIX_GLOB='lib'
LIB_VERSION_SEPARATOR='.'
if test "$enable_static" = yes; then
LIB_EXTENSION='a'
else
@@ -265,6 +292,9 @@ else
darwin* )
LIB_EXTENSION='dylib' ;;
cygwin* )
dnl prefix can be 'cyg' or 'lib'
LIB_PREFIX_GLOB='???'
LIB_VERSION_SEPARATOR='-'
LIB_EXTENSION='dll' ;;
aix* )
LIB_EXTENSION='a' ;;
@@ -279,13 +309,20 @@ GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
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}
GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
EGL_LIB_GLOB='lib$(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}'*'
GLUT_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLUT_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLW_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLW_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
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}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
@@ -293,6 +330,9 @@ AC_SUBST([GLUT_LIB_NAME])
AC_SUBST([GLW_LIB_NAME])
AC_SUBST([OSMESA_LIB_NAME])
AC_SUBST([EGL_LIB_NAME])
AC_SUBST([GLESv1_CM_LIB_NAME])
AC_SUBST([GLESv2_LIB_NAME])
AC_SUBST([VG_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
@@ -300,6 +340,9 @@ AC_SUBST([GLUT_LIB_GLOB])
AC_SUBST([GLW_LIB_GLOB])
AC_SUBST([OSMESA_LIB_GLOB])
AC_SUBST([EGL_LIB_GLOB])
AC_SUBST([GLESv1_CM_LIB_GLOB])
AC_SUBST([GLESv2_LIB_GLOB])
AC_SUBST([VG_LIB_GLOB])
dnl
dnl Arch/platform-specific settings
@@ -398,6 +441,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
[AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
AC_SUBST([DLOPEN_LIBS])
dnl See if posix_memalign is available
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
@@ -455,27 +499,26 @@ dnl Driver specific build directories
dnl
dnl this variable will be prepended to SRC_DIRS and is not exported
CORE_DIRS="glsl mesa"
CORE_DIRS="mapi/glapi glsl mesa"
SRC_DIRS="glew"
SRC_DIRS=""
GLU_DIRS="sgi"
WINDOW_SYSTEM=""
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_WINSYS_DIRS=""
GALLIUM_WINSYS_DRM_DIRS=""
GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
GALLIUM_TARGET_DIRS=""
GALLIUM_WINSYS_DIRS="sw"
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity"
GALLIUM_STATE_TRACKERS_DIRS=""
case "$mesa_driver" in
xlib)
DRIVER_DIRS="x11"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
;;
dri)
SRC_DIRS="$SRC_DIRS glx"
DRIVER_DIRS="dri"
WINDOW_SYSTEM="dri"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri"
;;
osmesa)
DRIVER_DIRS="osmesa"
@@ -484,51 +527,12 @@ esac
AC_SUBST([SRC_DIRS])
AC_SUBST([GLU_DIRS])
AC_SUBST([DRIVER_DIRS])
AC_SUBST([WINDOW_SYSTEM])
AC_SUBST([GALLIUM_DIRS])
AC_SUBST([GALLIUM_TARGET_DIRS])
AC_SUBST([GALLIUM_WINSYS_DIRS])
AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
AC_SUBST([GALLIUM_DRIVERS_DIRS])
AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
dnl
dnl User supplied program configuration
dnl
if test -d "$srcdir/progs/demos"; then
default_demos=yes
else
default_demos=no
fi
AC_ARG_WITH([demos],
[AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
[optional comma delimited demo directories to build
@<:@default=auto if source available@:>@])],
[with_demos="$withval"],
[with_demos="$default_demos"])
if test "x$with_demos" = x; then
with_demos=no
fi
dnl If $with_demos is yes, directories will be added as libs available
PROGRAM_DIRS=""
case "$with_demos" in
no) ;;
yes)
# If the driver isn't osmesa, we have libGL and can build xdemos
if test "$mesa_driver" != osmesa; then
PROGRAM_DIRS="xdemos"
fi
;;
*)
# verify the requested demos directories exist
demos=`IFS=,; echo $with_demos`
for demo in $demos; do
test -d "$srcdir/progs/$demo" || \
AC_MSG_ERROR([Program directory '$demo' doesn't exist])
done
PROGRAM_DIRS="$demos"
;;
esac
AC_SUBST([MESA_LLVM])
dnl
dnl Find out if X is available. The variable have_x is set if libX11 is
@@ -547,8 +551,14 @@ else
x11_pkgconfig=no
fi
dnl Use the autoconf macro if no pkg-config files
if test "$x11_pkgconfig" = no; then
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([X11], [x11])
else
AC_PATH_XTRA
test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
AC_SUBST([X11_CFLAGS])
AC_SUBST([X11_LIBS])
fi
dnl Try to tell the user that the --x-* options are only used when
@@ -620,8 +630,15 @@ dri)
# find the DRI deps for libGL
if test "$x11_pkgconfig" = yes; then
dri_modules="x11 xext xdamage xfixes"
# add xf86vidmode if available
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
if test "$HAVE_XF86VIDMODE" = yes ; then
dri_modules="$dri_modules xxf86vm"
fi
# add xcb modules if necessary
dri_modules="x11 xext xxf86vm xdamage xfixes"
if test "$enable_xcb" = yes; then
dri_modules="$dri_modules x11-xcb xcb-glx"
fi
@@ -649,6 +666,10 @@ dri)
# need DRM libs, -lpthread, etc.
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
;;
osmesa)
# No libGL for osmesa
@@ -660,6 +681,18 @@ AC_SUBST([GL_PC_REQ_PRIV])
AC_SUBST([GL_PC_LIB_PRIV])
AC_SUBST([GL_PC_CFLAGS])
AC_SUBST([DRI_PC_REQ_PRIV])
AC_SUBST([GLESv1_CM_LIB_DEPS])
AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
AC_SUBST([GLESv2_LIB_DEPS])
AC_SUBST([GLESv2_PC_LIB_PRIV])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
dnl
dnl More X11 setup
@@ -693,7 +726,7 @@ 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 for DRI @<:@default=enabled@:>@])],
[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
@@ -707,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=""
@@ -828,18 +906,13 @@ AC_SUBST([DRI_LIB_DEPS])
case $DRI_DIRS in
*i915*|*i965*)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.19])
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.21])
;;
esac
case $DRI_DIRS in
*radeon*|*r200*|*r300*|*r600*)
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
if test "$HAVE_LIBDRM_RADEON" = yes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
fi
@@ -859,7 +932,7 @@ else
fi
AC_ARG_ENABLE([gl-osmesa],
[AS_HELP_STRING([--enable-gl-osmesa],
[enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
[enable OSMesa with libGL @<:@default=enabled for xlib driver@:>@])],
[gl_osmesa="$enableval"],
[gl_osmesa="$default_gl_osmesa"])
if test "x$gl_osmesa" = xyes; then
@@ -894,8 +967,8 @@ x16|x32)
esac
AC_SUBST([OSMESA_LIB])
case "$mesa_driver" in
osmesa)
case "$DRIVER_DIRS" in
*osmesa*)
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
@@ -905,19 +978,7 @@ osmesa)
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
;;
*)
# Link OSMesa to libGL otherwise
OSMESA_LIB_DEPS=""
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_MESA_DEPS='-l$(GL_LIB)'
else
OSMESA_MESA_DEPS=""
fi
OSMESA_PC_REQ="gl"
;;
esac
OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
AC_SUBST([OSMESA_LIB_DEPS])
AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ])
@@ -941,16 +1002,23 @@ if test "x$enable_egl" = xyes; then
EGL_DRIVERS_DIRS="glx"
fi
# build egl_dri2 when xcb-dri2 is available
PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm],
[have_xcb_dri2=yes],[have_xcb_dri2=no])
if test "$have_xcb_dri2" = yes; then
EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
fi
fi
if test "$mesa_driver" = dri; then
# build egl_dri2 when xcb-dri2 is available
PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
[have_xcb_dri2=yes],[have_xcb_dri2=no])
PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
[have_libudev=yes],[have_libudev=no])
if test "$have_xcb_dri2" = yes; then
EGL_DRIVER_DRI2=dri2
DEFINES="$DEFINES -DHAVE_XCB_DRI2"
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
fi
fi
if test "$with_demos" = yes; then
PROGRAM_DIRS="$PROGRAM_DIRS egl"
EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2"
fi
fi
AC_SUBST([EGL_LIB_DEPS])
@@ -969,12 +1037,6 @@ if test "x$enable_glu" = xyes; then
case "$mesa_driver" in
osmesa)
# If GLU is available and we have libOSMesa (not 16 or 32),
# we can build the osdemos
if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
fi
# Link libGLU to libOSMesa instead of libGL
GLU_LIB_DEPS=""
GLU_PC_REQ="osmesa"
@@ -1108,10 +1170,6 @@ fi
if test "x$enable_glut" = xyes; then
SRC_DIRS="$SRC_DIRS glut/glx"
GLUT_CFLAGS=""
if test "x$GCC" = xyes; then
GLUT_CFLAGS="-fexceptions"
fi
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
GLUT_PC_REQ_PRIV="x11 xmu xi"
@@ -1122,14 +1180,12 @@ if test "x$enable_glut" = xyes; then
GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
GLUT_PC_CFLAGS="$X11_INCLUDES"
fi
if test "x$GCC" = xyes; then
GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions"
fi
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
# If glut is available, we can build most programs
if test "$with_demos" = yes; then
PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
fi
# If static, empty GLUT_LIB_DEPS and add libs for programs to link
if test "$enable_static" = no; then
GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
@@ -1176,7 +1232,21 @@ AC_ARG_ENABLE([gallium],
[enable_gallium="$enableval"],
[enable_gallium=yes])
if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
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
AC_SUBST([LLVM_CFLAGS])
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
@@ -1201,62 +1271,111 @@ 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_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_XORG="no")
HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_ST_XORG="no")
;;
esac
;;
*)
# verify the requested state tracker exist
state_trackers=`IFS=', '; echo $with_state_trackers`
for tracker in $state_trackers; do
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
state_trackers=""
_state_trackers=`IFS=', '; echo $with_state_trackers`
for tracker in $_state_trackers; do
case "$tracker" in
dri)
if test "x$mesa_driver" != xdri; then
AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
fi
HAVE_ST_DRI="yes"
;;
egl)
if test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
HAVE_ST_EGL="yes"
;;
xorg)
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
HAVE_XORG="yes"
HAVE_ST_XORG="yes"
;;
es)
# mesa/es is required to build es state tracker
CORE_DIRS="$CORE_DIRS mesa/es"
AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
if test "x$enable_gles_overlay" != xyes; then
if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
fi
GLES_OVERLAY=1
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
tracker=""
;;
vega)
CORE_DIRS="$CORE_DIRS mapi/vgapi"
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
;;
esac
if test -n "$tracker"; then
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
if test -n "$state_trackers"; then
state_trackers="$state_trackers $tracker"
else
state_trackers="$tracker"
fi
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
;;
esac
if test "x$HAVE_XORG" = xyes; then
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
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
fi
AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g.
"x11,drm" @<:@default=auto@:>@])],
[with_egl_platforms="$withval"],
[with_egl_platforms=yes])
AC_ARG_WITH([egl-displays],
[AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
[comma delimited native displays libEGL supports, e.g.
"x11,kms" @<:@default=auto@:>@])],
[with_egl_displays="$withval"],
[with_egl_displays=yes])
[DEPRECATED. Use --with-egl-platforms instead])],
[with_egl_platforms="$withval"])
EGL_DISPLAYS=""
case "$with_egl_displays" in
EGL_PLATFORMS=""
case "$with_egl_platforms" in
yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
EGL_DISPLAYS="x11"
EGL_PLATFORMS="x11"
if test "$mesa_driver" = dri; then
EGL_PLATFORMS="$EGL_PLATFORMS drm"
fi
fi
;;
*)
@@ -1264,15 +1383,18 @@ yes)
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
# verify the requested driver directories exist
egl_displays=`IFS=', '; echo $with_egl_displays`
for dpy in $egl_displays; do
test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \
AC_MSG_ERROR([EGL display '$dpy' does't exist])
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' does't exist])
if test "$plat" = "fbdev"; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
fi
done
EGL_DISPLAYS="$egl_displays"
EGL_PLATFORMS="$egl_platforms"
;;
esac
AC_SUBST([EGL_DISPLAYS])
AC_SUBST([EGL_PLATFORMS])
AC_ARG_WITH([egl-driver-dir],
[AS_HELP_STRING([--with-egl-driver-dir=DIR],
@@ -1303,6 +1425,51 @@ AC_ARG_WITH([max-height],
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
)
dnl
dnl Gallium LLVM
dnl
AC_ARG_ENABLE([gallium-llvm],
[AS_HELP_STRING([--enable-gallium-llvm],
[build gallium LLVM support @<:@default=disabled@:>@])],
[enable_gallium_llvm="$enableval"],
[enable_gallium_llvm=auto])
if test "x$enable_gallium_llvm" = xyes; then
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cflags`
LLVM_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"
MESA_LLVM=1
else
MESA_LLVM=0
fi
else
MESA_LLVM=0
fi
dnl
dnl Gallium helper functions
dnl
gallium_check_st() {
if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
fi
if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
fi
if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
fi
}
dnl
dnl Gallium SVGA configuration
dnl
@@ -1312,40 +1479,84 @@ AC_ARG_ENABLE([gallium-svga],
[enable_gallium_svga="$enableval"],
[enable_gallium_svga=auto])
if test "x$enable_gallium_svga" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
elif test "x$enable_gallium_svga" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
fi
dnl
dnl Gallium Intel configuration
dnl Gallium i915 configuration
dnl
AC_ARG_ENABLE([gallium-intel],
[AS_HELP_STRING([--enable-gallium-intel],
[build gallium intel @<:@default=disabled@:>@])],
[enable_gallium_intel="$enableval"],
[enable_gallium_intel=auto])
if test "x$enable_gallium_intel" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel i965"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
elif test "x$enable_gallium_intel" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
AC_ARG_ENABLE([gallium-i915],
[AS_HELP_STRING([--enable-gallium-i915],
[build gallium i915 @<:@default=disabled@:>@])],
[enable_gallium_i915="$enableval"],
[enable_gallium_i915=auto])
if test "x$enable_gallium_i915" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
elif test "x$enable_gallium_i915" = xauto; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
fi
dnl
dnl Gallium Radeon configuration
dnl Gallium i965 configuration
dnl
AC_ARG_ENABLE([gallium-i965],
[AS_HELP_STRING([--enable-gallium-i965],
[build gallium i965 @<:@default=disabled@:>@])],
[enable_gallium_i965="$enableval"],
[enable_gallium_i965=auto])
if test "x$enable_gallium_i965" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
elif test "x$enable_gallium_i965" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
fi
dnl
dnl Gallium Radeon r300g configuration
dnl
AC_ARG_ENABLE([gallium-radeon],
[AS_HELP_STRING([--enable-gallium-radeon],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_radeon="$enableval"],
[enable_gallium_radeon=auto])
if test "x$enable_gallium_radeon" = xauto; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
else
AC_MSG_WARN([libdrm_radeon is missing, not building gallium-radeon (r300)])
fi
fi
if test "x$enable_gallium_radeon" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
elif test "x$enable_gallium_radeon" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-radeon (r300)])
fi
fi
dnl
dnl Gallium Radeon r600g configuration
dnl
AC_ARG_ENABLE([gallium-r600],
[AS_HELP_STRING([--enable-gallium-r600],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
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
@@ -1357,8 +1568,8 @@ AC_ARG_ENABLE([gallium-nouveau],
[enable_gallium_nouveau="$enableval"],
[enable_gallium_nouveau=no])
if test "x$enable_gallium_nouveau" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv40 nv50"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
fi
dnl
@@ -1366,11 +1577,13 @@ dnl Gallium swrast configuration
dnl
AC_ARG_ENABLE([gallium-swrast],
[AS_HELP_STRING([--enable-gallium-swrast],
[build gallium swrast @<:@default=disabled@:>@])],
[build gallium swrast @<:@default=auto@:>@])],
[enable_gallium_swrast="$enableval"],
[enable_gallium_swrast=auto])
if test "x$enable_gallium_swrast" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS swrast"
if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
if test "x$HAVE_ST_DRI" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
fi
fi
dnl prepend CORE_DIRS to SRC_DIRS
@@ -1422,14 +1635,26 @@ fi
fi
echo " Use XCB: $enable_xcb"
echo ""
if test "x$MESA_LLVM" = x1; then
echo " llvm: yes"
echo " llvm-config: $LLVM_CONFIG"
echo " llvm-version: $LLVM_VERSION"
else
echo " llvm: no"
fi
echo ""
if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
echo " Gallium: yes"
echo " Gallium dirs: $GALLIUM_DIRS"
echo " Target dirs: $GALLIUM_TARGET_DIRS"
echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_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
@@ -1440,6 +1665,7 @@ 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
@@ -1447,15 +1673,6 @@ echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl Programs
# cleanup the programs var for display
program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
if test "x$program_dirs" = x; then
echo " Demos: no"
else
echo " Demos: $program_dirs"
fi
dnl Compiler options
# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
@@ -1467,6 +1684,8 @@ echo ""
echo " CFLAGS: $cflags"
echo " CXXFLAGS: $cxxflags"
echo " Macros: $defines"
echo ""
echo " PYTHON2: $PYTHON2"
echo ""
echo " Run '${MAKE-make}' to build Mesa"

View File

@@ -14,8 +14,9 @@ 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_APPLE_flush_buffer_range) not started
Map buffer subranges (GL_ARB_map_buffer_range) DONE
Float textures, renderbuffers some infrastructure done
(incl. GL_EXT_packed_float, GL_EXT_shared_exponent)
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float some infrastructure done
Multisample blit DONE
@@ -25,28 +26,28 @@ Packed depth/stencil formats DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
GL_EXT_texture_compression_rgtc not started
Red and red/green texture formats Ian?
Transform feedback (GL_EXT_transform_feedback) not started
Transform feedback (GL_EXT_transform_feedback) ~50% done
glBindFragDataLocation, glGetFragDataLocation,
glBindBufferRange, glBindBufferBase commands
Vertex array objects (GL_APPLE_vertex_array_object) DONE
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started
glClearBuffer commands DONE, except for dispatch
glGetStringi command DONE, except for dispatch
glTexParameterI, glGetTexParameterI commands DONE, except for dispatch
glVertexAttribI commands not started
glBindFragDataLocation, glGetFragDataLocation cmds not started
glBindBufferRange, glBindBufferBase commands not started
GL 3.1:
GLSL 1.30 and 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) not started
Instanced drawing (GL_ARB_draw_instanced) ~50% done
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) not started
16 vertex texture image units 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 texture formats not started
Signed normalized texture formats ~50% done
GL 3.2:
@@ -56,7 +57,7 @@ GLSL 1.50 not started
Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
Frag shader coord (GL_ARB_fragment_coord_conventions) not started
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
Provoking vertex (GL_ARB_provoking_vertex) DONE
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE, mostly?
Multisample textures (GL_ARB_texture_multisample) not started
@@ -64,6 +65,37 @@ Frag depth clamp (GL_ARB_depth_clamp) DONE
Fence objects (GL_ARB_sync) DONE
GL 3.3:
GLSL 3.30 not started
GL_ARB_blend_func_extended not started
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 not started
GL_ARB_vertex_type_2_10_10_10_rev not started
GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod not started
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
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
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
More info about these features and the work involved can be found at
http://dri.freedesktop.org/wiki/MissingFunctionality

149
docs/MESA_drm_image.spec Normal file
View File

@@ -0,0 +1,149 @@
Name
MESA_drm_image
Name Strings
EGL_MESA_drm_image
Contact
Kristian Høgsberg <krh@bitplanet.net>
Status
Proposal
Version
Version 2, August 25, 2010
Number
EGL Extension #not assigned
Dependencies
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.
Overview
This extension provides entry points for integrating EGLImage with the
Linux DRM mode setting and memory management drivers. The extension
lets applications create EGLImages without a client API resource and
lets the application get the DRM buffer handles.
IP Status
Open-source; freely implementable.
New Procedures and Functions
EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
const EGLint *attrib_list);
EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
EGLImageKHR image,
EGLint *name,
EGLint *handle,
EGLint *stride);
New Tokens
Accepted in the <attrib_list> parameter of eglCreateDRMImageMESA:
EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
EGL_DRM_BUFFER_USE_MESA 0x31D1
Accepted as values for the EGL_IMAGE_FORMAT_MESA attribute:
EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
Bits accepted in EGL_DRM_BUFFER_USE_MESA:
EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
Accepted in the <target> parameter of eglCreateImageKHR:
EGL_DRM_BUFFER_MESA 0x31D3
Use when importing drm buffer:
EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
Additions to the EGL 1.4 Specification:
To create a DRM EGLImage, call
EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
const EGLint *attrib_list);
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
is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
then red, then green, then blue. The bit values accepted by
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA and
EGL_DRM_BUFFER_USE_SHARE_MESA. EGL_DRM_BUFFER_USE_SCANOUT_MESA
requests that the created EGLImage should be usable as a scanout
buffer with the DRM kernel modesetting API. The
EGL_DRM_BUFFER_USE_SHARE_MESA bit requests that the EGLImage can
be shared with other processes by passing the underlying DRM
buffer name.
To create a process local handle or a global DRM name for a
buffer, call
EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
EGLImageKHR image,
EGLint *name,
EGLint *handle,
EGLint *stride);
If <name> is non-NULL, a global name is assigned to the image and
written to <name>, the handle (local to the DRM file descriptor,
for use with DRM kernel modesetting API) is written to <handle> if
non-NULL and the stride (in bytes) is written to <stride>, if
non-NULL.
Import a shared buffer by calling eglCreateImageKHR with
EGL_DRM_BUFFER_MESA as the target, using EGL_WIDTH, EGL_HEIGHT,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_STRIDE_MESA
in the attrib list.
Issues
1. Why don't we use eglCreateImageKHR with a target that
indicates that we want to create an EGLImage from scratch?
RESOLVED: The eglCreateImageKHR entry point is reserved for
creating an EGLImage from an already existing client API
resource. This is fine when we're creating the EGLImage from
an existing DRM buffer name, it doesn't seem right to overload
the function to also allocate the underlying resource.
2. Why don't we use an eglQueryImageMESA type functions for
querying the DRM EGLImage attributes (name, handle, and stride)?
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 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,
so we use a new EGL extension entry point instead.
Revision History
Version 1, June 3, 2010
Initial draft (Kristian Høgsberg)
Version 2, August 25, 2010
Flesh out the extension a bit, add final EGL tokens, capture
some of the original discussion in the issues section.

View File

@@ -69,7 +69,6 @@ a:visited {
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
<li><a href="sourcetree.html" target="MainFrame">Source Code Tree</a>
<li><a href="memory.html" target="MainFrame">DRI Memory Management</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
<li><a href="utilities.html" target="MainFrame">Utilities</a>
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>

View File

@@ -12,12 +12,14 @@
Both professional and volunteer developers contribute to Mesa.
</p>
<p>
<a href="http://www.tungstengraphics.com/" target="_parent">Tungsten Graphics</a>
<a href="http://www.vmware.com/" target="_parent">VMware</a>
employs several of the main Mesa developers including Brian Paul
and Keith Whitwell.
Much of the on-going work in Mesa is done through Tungsten Graphics engineering
contracts.
Prominent examples of this work includes:
</p>
<p>
In the past, Tungsten Graphics contracts implemented many Mesa features
including:
</p>
<ul>
<li>DRI drivers for Intel i965, i945, i915 and other chips
@@ -29,7 +31,13 @@ Prominent examples of this work includes:
<p>
Other companies including
<a href="http://www.intellinuxgraphics.org/index.html" target="_parent">Intel</a>
and IBM also actively contribute to the project.
and RedHat also actively contribute to the project.
Intel has recently contributed the new GLSL compiler in Mesa 7.9.
</p>
<p>
<a href="http://www.lunarg.com/" target="_parent">LunarG</a> can be contacted
for custom Mesa / 3D graphics development.
</p>
<p>
@@ -37,15 +45,5 @@ Volunteers have made significant contributions to all parts of Mesa, including
complete device drivers.
</p>
<H1>Custom Development</H1>
<p>
Contact <a href="http://www.tungstengraphics.com/" target="_parent">
Tungsten Graphics</a>
for information about custom development in Mesa, OpenGL, X and other
graphics technologies.
</p>
</body>
</html>

View File

@@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
Update docs/news.html.
</p>
<p>
@@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
<p>
Make an announcement on the mailing lists:
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
and
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
</p>

View File

@@ -32,13 +32,13 @@ cards.</p>
the Gallium driver for your hardware. For example</p>
<pre>
$ ./configure --with-state-trackers=egl,es,vega --enable-gallium-{swrast,intel}
$ ./configure --enable-gles-overlay --with-state-trackers=egl,vega --enable-gallium-intel
</pre>
<p>The main library will be enabled by default. The <code>egl</code> state
<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="opengles.html">es state tracker</a> provides OpenGL ES 1.x
and 2.x and the <a href="openvg.html">vega state tracker</a> provides OpenVG
later. The <a href="openvg.html">vega state tracker</a> provides OpenVG
1.x.</p>
</li>
@@ -46,8 +46,8 @@ and 2.x and the <a href="openvg.html">vega state tracker</a> provides OpenVG
</ol>
<p>In the given example, it will build and install <code>libEGL</code>,
<code>libGLESv1_CM</code>, <code>libGLESv2</code>, <code>libOpenVG</code>, and
one or more EGL drivers.</p>
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>,
<code>libOpenVG</code>, and one or more EGL drivers.</p>
<h3>Configure Options</h3>
@@ -69,56 +69,53 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
</li>
<li><code>--with-egl-displays</code>
<li><code>--with-egl-platforms</code>
<p>List the window system(s) to support. It is by default <code>x11</code>,
which supports the X Window System. Its argument is a comma separated string
like, for example, <code>--with-egl-displays=x11,kms</code>. Because an EGL
driver decides which window system to support, this example will enable two
(sets of) EGL drivers. One supports the X window system and the other supports
bare KMS (kernel modesetting).</p>
<p>List the platforms (window systems) to support. Its argument is a comma
seprated string such as <code>--with-egl-platforms=x11,drm</code>. It decides
the platforms a driver may support. The first listed platform is also used by
the main library to decide the native platform: the platform the EGL native
types such as <code>EGLNativeDisplayType</code> or
<code>EGLNativeWindowType</code> defined for.</p>
<p>The available platforms are <code>x11</code>, <code>drm</code>,
<code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> platform can
only be built with SCons.</p>
</li>
<li><code>--with-state-trackers</code>
<p>The argument is a comma separated string. It is usually used to specify the
rendering APIs, like OpenGL ES or OpenVG, to build. But it should be noted
that a number of EGL drivers depend on the <code>egl</code> state tracker.
They will <em>not</em> be built without the <code>egl</code> state tracker.</p>
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-gallium-swrast</code>
<li><code>--enable-gles-overlay</code>
<p>This option is not specific to EGL. But if there is no driver for your
hardware, or you are experiencing problems with the hardware driver, you can
enable the swrast DRM driver. It is a dummy driver and EGL will fallback to
software rendering automatically.</p>
<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>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>
</ul>
<h3>OpenGL</h3>
<p>The OpenGL state tracker is not built in the above example. It should be
noted that the classic <code>libGL</code> is not a state tracker and cannot be
used with EGL (unless the EGL driver in use is <code>egl_glx</code>). To build
the OpenGL state tracker, one may append <code>glx</code> to
<code>--with-state-trackers</code> and manually build
<code>src/gallium/winsys/xlib/</code>.</p>
<h2>Use EGL</h2>
<p> The demos for OpenGL ES and OpenVG can be found in <code>progs/es1/</code>,
<code>progs/es2/</code> and <code>progs/openvg/</code>. You can use them to
test your build. For example,</p>
<h3>Demos</h3>
<pre>
$ cd progs/es1/xegl
$ make
$ ./torus
</pre>
<p>There are demos for the client APIs supported by EGL. They can be found in
mesa/demos repository.</p>
<h3>Environment Variables</h3>
@@ -142,16 +139,18 @@ binaries.</p>
specified EGL driver to be loaded. It comes in handy when one wants to test a
specific driver. This variable is ignored for setuid/setgid binaries.</p>
<p><code>egl_gallium</code> dynamically loads hardware drivers and client API
modules found in <code>EGL_DRIVERS_PATH</code>. Thus, specifying this variable
alone is not sufficient for <code>egl_gallium</code> for uninstalled build.</p>
</li>
<li><code>EGL_DISPLAY</code>
<li><code>EGL_PLATFORM</code>
<p>When <code>EGL_DRIVER</code> is not set, the main library loads <em>all</em>
EGL drivers that support a certain window system. <code>EGL_DISPLAY</code> can
be used to specify the window system and the valid values are, for example,
<code>x11</code> or <code>kms</code>. When the variable is not set, the main
library defaults the value to the first window system listed in
<code>--with-egl-displays</code> at configuration time.
<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>
</li>
@@ -173,31 +172,15 @@ variable to true forces the use of software rendering.</p>
<h2>EGL Drivers</h2>
<p>There are two categories of EGL drivers: Gallium and classic.</p>
<p>Gallium EGL drivers supports all rendering APIs specified in EGL 1.4. The
support for optional EGL functions and EGL extensions is usually more complete
than the classic ones. These drivers depend on the <code>egl</code> state
tracker to build. The available drivers are</p>
<ul>
<li><code>egl_&lt;dpy&gt;_i915</code></li>
<li><code>egl_&lt;dpy&gt;_i965</code></li>
<li><code>egl_&lt;dpy&gt;_radeon</code></li>
<li><code>egl_&lt;dpy&gt;_nouveau</code></li>
<li><code>egl_&lt;dpy&gt;_swrast</code></li>
<li><code>egl_&lt;dpy&gt;_vmwgfx</code></li>
</ul>
<li><code>egl_gallium</code>
<p><code>&lt;dpy&gt;</code> is given by <code>--with-egl-displays</code> at
configuration time. There will be one EGL driver for each combination of the
displays listed and the hardware drivers enabled.</p>
<p>This driver is based on Gallium3D. It supports all rendering APIs and
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
The supported platforms are X11, KMS, FBDEV, and GDI.</p>
<p>Classic EGL drivers, on the other hand, supports only OpenGL as its
rendering API. They can be found under <code>src/egl/drivers/</code>. There
are 3 of them</p>
</li>
<ul>
<li><code>egl_glx</code>
<p>This driver provides a wrapper to GLX. It uses exclusively GLX to implement
@@ -224,9 +207,6 @@ are phasing out, it might eventually be replaced by <code>egl_dri2</code>.</p>
</li>
</ul>
<p>To use the classic drivers, one must manually set <code>EGL_DRIVER</code> at
runtime.</p>
<h2>Developers</h2>
<p>The sources of the main library and the classic drivers can be found at
@@ -315,8 +295,12 @@ should as well lock the display before using it.
<ul>
<li>Pass the conformance tests</li>
<li>Better automatic driver selection: <code>EGL_DISPLAY</code> loads all
drivers and might eat too much memory.</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
when, say, an application is linked to <code>libGLESv2.so</code> and
<code>libcairo</code>, which is linked to <code>libGL.so</code> instead.</li>
</ul>

View File

@@ -9,16 +9,38 @@
<H1>Environment Variables</H1>
<p>
Mesa supports the following environment variables:
Normally, no environment variables need to be set. Most of the environment
variables used by Mesa/Gallium are for debugging purposes, but they can
sometimes be useful for debugging end-user issues.
</p>
<H2>LibGL environment variables</H2>
<ul>
<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
If set to 'verbose' additional information will be printed.
<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
</ul>
<H2>Core Mesa environment variables</H2>
<ul>
<li>MESA_NO_ASM - if set, disables all assembly language optimizations
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr.
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
generate exceptions.
<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
if the application generates a GL_INVALID_ENUM error, a corresponding error
message indicating where the error occured, and possibly why, will be
printed to stderr.<br>
If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
generate exceptions.
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
fragment programs (intended for developers only)
@@ -28,11 +50,14 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
</ul>
<H2>Mesa Xlib driver environment variables</H2>
<p>
The following are only applicable to the Xlib software driver.
The following are only applicable to the Mesa Xlib software driver.
See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</p>
<ul>
@@ -51,9 +76,8 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</ul>
<p>
These environment variables are for the Intel i945/i965 drivers:
</p>
<h2>i945/i965 driver environment variables (non-Gallium)</h2>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
@@ -62,17 +86,71 @@ These environment variables are for the Intel i945/i965 drivers:
</ul>
<p>
These environment variables are for the Radeon R300 driver:
</p>
<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
<ul>
<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
</ul>
<h2>EGL environment variables</h2>
<p>
Mesa EGL supports different sets of environment variables. See the
<a href="egl.html">Mesa EGL</a> page for the details.
</p>
<h2>Gallium environment variables</h2>
<ul>
<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
variables which are used, and their current values.
<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
shader execution
<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
shader execution
<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
print any errors to stderr.
<LI>DRAW_FSE - ???
<LI>DRAW_NO_FSE - ???
<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
shaders, vertex fetch, etc.
</ul>
<h3>Softpipe driver environment variables</h3>
<ul>
<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
to stderr
<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
to stderr
<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
</ul>
<h3>LLVMpipe driver environment variables</h3>
<ul>
<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
source code for details.
<li>LP_PERF - a comma-separated list of options to selectively no-op various
parts of the driver. See the source code for details.
<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
Zero turns of threading completely. The default value is the number of CPU
cores present.
</ul>
<p>
Other Gallium drivers have their own environment variables. These may change
frequently so the source code should be consulted for details.
</p>
<br>
<br>
</BODY>
</HTML>

View File

@@ -9,6 +9,9 @@
<center><h1>Mesa fbdev/DRI Drivers</h1></center>
<br>
<h1><center>NOTE: this information is obsolete and will be removed at
a future date</center></h1>
<h1>1. Introduction</h1>
<p>
@@ -22,7 +25,7 @@ Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
<p>
Applications in the fbdev/DRI environment use
the <a href="http://www.nabble.com/file/p15480666/MiniGXL.html"> MiniGLX</a> interface to choose pixel
the MiniGLX interface to choose pixel
formats, create rendering contexts, etc. It's a subset of the GLX and
Xlib interfaces allowing some degree of application portability between
the X and X-less environments.
@@ -315,8 +318,7 @@ It means that the sample_server process is not running.
<h1>5.0 Programming Information</h1>
<p>
OpenGL/Mesa is interfaced to fbdev via the <a href="http://www.nabble.com/file/p15480666/MiniGLX.html">MiniGLX</a>
interface.
OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface.
MiniGLX is a subset of Xlib and GLX API functions which provides just
enough functionality to setup OpenGL rendering and respond to simple
input events.
@@ -332,7 +334,7 @@ This allows some degree of flexibility for software development and testing.
However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
Some of the structures are different and some macros/functions work
differently.
See the <code>GL/miniglx.h</code> header file for details.
See the GL/miniglx.h header file for details.
</p>

View File

@@ -361,7 +361,7 @@ To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler tool
This will create:
</p>
<ul>
<li>build/windows-x86-debug/gallium/winsys/gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
<li>build/windows-x86-debug/glut/glx/glut32.dll
<li>progs/build/windows-x86-debug/wgl/wglinfo.exe
<li>progs/build/windows-x86-debug/trivial/tri.exe

View File

@@ -111,11 +111,9 @@ It implements the OpenGL 1.3 specification.
<p>
November 2001: I cofound <a href="http://www.tungstengraphics.com" target="_parent">
Tungsten Graphics, Inc.</a> with Keith Whitwell, Jens Owen, David Dawes and
Frank LaMonica.
I continue to develop Mesa as part of my resposibilities with Tungsten
Graphics and as a spare-time project.
November 2001: I cofounded Tungsten Graphics, Inc. with Keith Whitwell,
Jens Owen, David Dawes and Frank LaMonica.
Tungsten Graphics was acquired by VMware in December 2008.
</p>
<p>

View File

@@ -13,14 +13,14 @@
</p>
<ul>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users"
target="_parent">mesa3d-users</a> - intended for end-users of Mesa and DRI
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-users"
target="_parent">mesa-users</a> - intended for end-users of Mesa and DRI
drivers. Newbie questions are OK, but please try the general OpenGL
resources and Mesa/DRI documentation first.
</li>
<br>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev"
target="_parent">mesa3d-dev</a> - for Mesa, Gallium and DRI development
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev"
target="_parent">mesa-dev</a> - for Mesa, Gallium and DRI development
discussion. Not for beginners.
</li>
<br>
@@ -30,8 +30,8 @@ target="_parent">mesa-commit</a> - relays git check-in messages
In general, people should not post to this list.
</li>
<br>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-announce"
target="_parent">mesa3d-announce</a> - announcements of new Mesa
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-announce"
target="_parent">mesa-announce</a> - announcements of new Mesa
versions are sent to this list. Very low traffic.
</li>
</ul>
@@ -40,6 +40,15 @@ versions are sent to this list. Very low traffic.
Follow the links above for list archives.
</p>
<p>
The old Mesa lists hosted at SourceForge are no longer in use.
The archives are still available, however:
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-announce" target="_parent">mesa3d-announce</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-users" target="_parent">mesa3d-users</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-dev" target="_parent">mesa3d-dev</a>.
</p>
<p>For mailing lists about Direct Rendering Modules (drm) in Linux/BSD
kernels, see the
<a href="http://dri.freedesktop.org/wiki/MailingLists" target="_parent">

View File

@@ -10,6 +10,51 @@
<H1>News</H1>
<h2>October 4, 2010</h2>
<p>
<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
development release.
</p>
<h2>September 27, 2010</h2>
<p>
<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
release candidate for the 7.9 development release.
</p>
<h2>June 16, 2010</h2>
<p>
<a href="relnotes-7.8.2.html">Mesa 7.8.2</a> is released. This is a bug-fix
release collecting fixes since the 7.8.1 release.
</p>
<h2>April 5, 2010</h2>
<p>
<a href="relnotes-7.8.1.html">Mesa 7.8.1</a> is released. This is a bug-fix
release for a few critical issues in the 7.8 release.
</p>
<h2>March 28, 2010</h2>
<p>
<a href="relnotes-7.7.1.html">Mesa 7.7.1</a> is released. This is a bug-fix
release fixing issues found in the 7.7 release.
</p>
<p>
Also, <a href="relnotes-7.8.html">Mesa 7.8</a> is released. This is a new
development release.
</p>
<h2>December 21, 2009</h2>
<p>
<a href="relnotes-7.6.1.html">Mesa 7.6.1</a> is released. This is a bug-fix
@@ -136,9 +181,6 @@ Added a new page describing the <a href="cell.html">Mesa Cell driver</a>.
<p>
Gallium3D is the codename for the new Mesa device driver architecture
which is currently under development.
A <a href="http://wiki.freedesktop.org/wiki/Software/gallium"
target="_parent"> summary</a> of the architecture can be found on the
Tungsten Graphics website.
</p>
<p>
Gallium3D development is taking place on the <em>gallium-0.1</em> branch
@@ -189,11 +231,8 @@ shading language and built-in functions.
<h2>April 2007</h2>
<p>
Thomas Hellstr&ouml;m of
<a href="http://www.tungstengraphics.com" target="_parent">
Tungsten Graphics</a> has written a whitepaper describing the new
<a href="http://www.tungstengraphics.com/mm.pdf">DRI memory management
system</a>.
Thomas Hellstr&ouml;m of Tungsten Graphics has written a whitepaper
describing the new DRI memory management system</a>.
</p>
<h2>December 5, 2006</h2>
@@ -1254,7 +1293,6 @@ grateful.
<p>
</p><h2>March 18, 1999</h2>
<p>The new webpages are now online. Enjoy, and let me know if you find any errors.
For an eye-candy free version you can use <a href="http://www.mesa3d.org/txt/">http://www.mesa3d.org/txt/</a>.</p>
<p>
</p><h2>February 16, 1999</h2>
<p><a href="http://www.sgi.com/">SGI</a> releases its <a href="http://www.sgi.com/software/opensource/glx/">GLX

View File

@@ -1,68 +1,69 @@
<html>
<title>OpenGL ES State Trackers</title>
<title>OpenGL ES</title>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<body>
<h1>OpenGL ES State Trackers</h1>
<h1>OpenGL ES</h1>
<p>The current version of the OpenGL ES state trackers implement OpenGL ES 1.1 and OpenGL ES 2.0.
More informations about OpenGL ES can be found at
<a href="http://www.khronos.org/opengles/" target="_parent">
http://www.khronos.org/opengles/</a>.</p>
<p>The OpenGL ES state trackers depends on the Gallium architecture and a
working EGL implementation. Please refer to <a href="egl.html">Mesa EGL</a>
for more information about EGL.</p>
<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More informations about
OpenGL ES can be found at <a href="http://www.khronos.org/opengles/"
target="_parent"> http://www.khronos.org/opengles/</a>.</p>
<p>OpenGL ES depends on a working EGL implementation. Please refer to
<a href="egl.html">Mesa EGL</a> for more information about EGL.</p>
<h2>Build the Libraries</h2>
<ol>
<li>Run <code>configure</code> with <code>--with-state-trackers=egl,es</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>
<p>It will install libGLESv1_CM, libGLESv2, libEGL, and one or more EGL drivers for your hardware.</p>
Alternatively, if XCB-DRI2 is installed on the system, one can use
<code>egl_dri2</code> EGL driver with OpenGL|ES-enabled DRI drivers
<ol>
<li>Run <code>configure</code> with <code>--enable-gles1 --enable-gles2</code>.</li>
<li>Build and install Mesa as usual.</li>
</ol>
<p>Both methods will install libGLESv1_CM, libGLESv2, libEGL, and one or more
EGL drivers for your hardware.</p>
<h2>Run the Demos</h2>
<p>There are some demos in <code>progs/es1/</code> and <code>progs/es2/</code>. You can use them to test your build. For example,</p>
<p>There are some demos in <code>progs/egl/</code>. You can use them to test
your build. For example,</p>
<pre>
$ cd progs/es1/xegl
$ cd progs/egl/eglut
$ make
$ ./torus
$ cd ../opengles1
$ make
$ ./torus_x11
</pre>
<h2>Developers</h2>
<p>The core of OpenGL ES state trackers is the ES overlay. It is located in
<code>src/mesa/es/</code>.</p>
<h3>Internal Libraries</h3>
<h3>Structure</h3>
<p>The ES overlay uses as much code as possible from Mesa. It has its own glapi XMLs to describe the APIs of OpenGL ES. The ES overlay can be built parallelly with Mesa, and they will give</p>
<table border="1">
<tr><td>Library Name</td><td>Usage</td><td>Source</td></tr>
<tr><td>libmesagallium.a</td><td>OpenGL state tracker</td><td>Mesa</td></tr>
<tr><td>libes1gallium.a</td><td>OpenGL ES 1.x state tracker</td><td>ES overlay</td></tr>
<tr><td>libes2gallium.a</td><td>OpenGL ES 2.x state tracker</td><td>ES overlay</td></tr>
<tr><td>libglapi.a</td><td>OpenGL API</td><td>Mesa</td></tr>
<tr><td>libes1api.a</td><td>OpenGL ES 1.x API</td><td>ES overlay</td></tr>
<tr><td>libes2api.a</td><td>OpenGL ES 2.x API</td><td>ES overlay</td></tr>
<table border="1" style="text-align: center;">
<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>
<p>The OpenGL ES state trackers and APIs are then used by <code>src/gallium/state_trackers/es/</code> to create the final libraries.</p>
<h3>Dispatch Table</h3>
<p>The ES overlay uses an additional indirection when dispatching fucntions</p>
<p>OpenGL ES has an additional indirection when dispatching fucntions</p>
<pre>
Mesa: glFoo() --&gt; _mesa_Foo()
ES overlay: glFoo() --&gt; _es_Foo() --&gt; _mesa_Foo()
OpenGL ES: glFoo() --&gt; _es_Foo() --&gt; _mesa_Foo()
</pre>
<p>The indirection serves several purposes</p>
@@ -73,7 +74,7 @@ for more information about EGL.</p>
<li>When a function is not available in Mesa, or accepts arguments that are not available in OpenGL, it provides its own implementation.</li>
</ul>
<p>Other than the last case, the ES overlay uses <code>APIspec.xml</code> to generate functions to check and/or converts the arguments.</p>
<p>Other than the last case, OpenGL ES uses <code>APIspec.xml</code> to generate functions to check and/or converts the arguments.</p>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.7.1 Release Notes / date tbd</H1>
<H1>Mesa 7.7.1 Release Notes / March 28, 2010</H1>
<p>
Mesa 7.7.1 is a bug-fix release.
@@ -26,16 +26,18 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
3ab0638cfa7ce8157337a229cf0db2c4 MesaLib-7.7.1.tar.gz
46664d99e03f1e3ac078a7fea02af115 MesaLib-7.7.1.tar.bz2
4e73ba8abb59aff79485eb95d7cefff7 MesaLib-7.7.1.zip
bf1b108983995f7a712cf3343df1c918 MesaDemos-7.7.1.tar.gz
aeb39645d80d656e0adebaa09e5bcd03 MesaDemos-7.7.1.tar.bz2
01c49b7454fd292244eaf8bdc6ed8cf0 MesaDemos-7.7.1.zip
37ec6386693dcb6dc770d1efd63a7a93 MesaGLUT-7.7.1.tar.gz
1e16c85282f843791a21f7bc7b6a1ca8 MesaGLUT-7.7.1.tar.bz2
d352c9e36a8e4d1059f4abc017b131e0 MesaGLUT-7.7.1.zip
</pre>
<h2>New features</h2>
<ul>
<li>tbd
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Assorted fixes to VMware SVGA gallium driver.
@@ -45,6 +47,12 @@ tbd
<li>Gallium SSE codegen for XPD didn't always work.
<li>Fixed Windows build.
<li>Fixed broken glMultiDrawElements().
<li>Silence bogus GL errors generated in glxinfo.
<li>Fixed several render to texture bugs.
<li>Assorted bug fixes in Mesa/Gallium state tracker including
glCopy/DrawPixels() to FBOs.
<li>Assorted fixes to Gallium drivers.
<li>Fixed broken glPush/PopClientAttrib() for vertex arrays in GLX code.
</ul>

62
docs/relnotes-7.8.1.html Normal file
View File

@@ -0,0 +1,62 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.1 Release Notes / April, 5, 2010</H1>
<p>
Mesa 7.8.1 fixes a couple critical bugs in the recent Mesa 7.8 release. Even
though this is a bug fix release, given its proximity to the 7.8 release, a
new development release, it should also be considered new development release.
People who are concerned with stability and reliability should stick
with a previous release, such as 7.7.1, or wait for Mesa 7.8.2.
</p>
<p>
Mesa 7.8.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>
62e8e47cbd63741b4bbe634dcdc8a56a MesaLib-7.8.1.tar.gz
25ec15f8e41fde6d206118cc786dbac4 MesaLib-7.8.1.tar.bz2
22b1153010ffdf513836ea9931159e80 MesaLib-7.8.1.zip
c9c0a830923d3820807a08c09d521b3e MesaDemos-7.8.1.tar.gz
9ef47f911869657c6bf2f43ebce86b61 MesaDemos-7.8.1.tar.bz2
93720605eb3f784f9bcc289a4dd2ff52 MesaDemos-7.8.1.zip
ed1d0b1e960afe6a3768eab747cbdbd3 MesaGLUT-7.8.1.tar.gz
6bae516a44c6d26ff3152c960ab648e7 MesaGLUT-7.8.1.tar.bz2
ba306f603ea73c30ee0e7efa14dc5581 MesaGLUT-7.8.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<ul>
<li>Fix incorrect enums for GLX_INTEL_swap_event by updating glxext.h to
version 27 from OpenGL.org.</li>
<li>Fix compilation errors on non-GLX_DIRECT_RENDERING builds.</li>
<li>Various fixes for building Mesa on OS X.</li>
<li>Pass GLX drawable ID to dri2InvalidateBuffers. Fixes bug #27190.</li>
</ul>
<h2>Changes</h2>
<p>None.</p>
</body>
</html>

146
docs/relnotes-7.8.2.html Normal file
View File

@@ -0,0 +1,146 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.2 Release Notes / (date tbd)</H1>
<p>
Mesa 7.8.2 is a bug fix release which fixes bugs found since the 7.8.1 release.
</p>
<p>
Mesa 7.8.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>
c89b63d253605ed40e8ac370d25a833c MesaLib-7.8.2.tar.gz
6be2d343a0089bfd395ce02aaf8adb57 MesaLib-7.8.2.tar.bz2
a04ad3b06ac5ff3969a003fa7bbf7d5b MesaLib-7.8.2.zip
7c213f92efeb471f0331670d5079d4c0 MesaDemos-7.8.2.tar.gz
757d9e2e06f48b1a52848be9b0307ced MesaDemos-7.8.2.tar.bz2
8d0e5cfe68b8ebf90265d350ae2c48b1 MesaDemos-7.8.2.zip
b74482e3f44f35ed395c4aada4fd8240 MesaGLUT-7.8.2.tar.gz
a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
9f190268c42be582ef66e47365ee61e3 MesaGLUT-7.8.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Changes</h2>
<ul>
<li>Upgraded glext.h to version 61, and upgraded glxext.h
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
<li>Fixed Gallium Cell driver to buildable, runable state
<li>Fixed bad error checking for glFramebufferRenderbuffer(attachment=GL_DEPTH_STENCIL_ATTACHMENT).
<li>Fixed incorrect Z coordinate handling in "meta" glDraw/CopyPixels.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">Bug
#23670</a>.</li>
<li>Assorted i965 driver fixes.
Including but not limited to:
<ul>
<li>Fix scissoring when width or height is
0. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27643">Bug
#27643</a>.
<li>Fix bit allocation for number of color regions for
ARB_draw_buffers.</li>
<li>Set the correct provoking vertex for clipped first-mode
trifans. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24470">Bug
#24470</a>.</li>
<li>Use <code>R16G16B16A16_FLOAT</code> for 3-component half-float.</li>
<li>Fix assertion for surface tile offset usage on Ironlake.</li>
<li>Fix cube map layouts on Ironlake.</li>
<li>When an RB gets a new region, clear the old from the state
cache. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24119">Bug
#24119</a>.</li>
<li>Reject shaders with uninlined function calls instead of hanging.</li>
</ul>
</li>
<li>Assorted i915 driver fixes. Including but not limited to:
<ul>
<li>Fixed texture LOD clamping in i915 driver.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=24846">Bug
#24846</a>.</li>
<li>Fix off-by-one for drawing rectangle.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27408">Bug
#27408</a>.</li>
</ul>
</li>
<li>Fixed hangs in etracer on 830 and 845
chipsets. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26557">Bug
#26557</a>.</li>
<li>Fixed tiling of small textures on all Intel drivers.</li>
<li>Fixed crash in Savage driver when using <code>_mesa_CopyTexImage2D</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27652">Bug
#27652</a>.</li>
<li>Assorted GLX fixes. Including but not limited to:
<ul>
<li>Fixed <code>__glXInitializeVisualConfigFromTags</code>'s handling of
unrecognized fbconfig tags.</li>
<li>Fixed regression with <code>GLX_USE_GL</code>.
<li>Fixed config chooser logic for 'mask' matching.</li>
<li>Report swap events correctly in direct rendered case (DRI2)</li>
<li>Fixed build with dri2proto which doesn't define
<code>X_DRI2SwapInterval</code>.</li>
<li>Get <code>GLX_SCREEN</code> first in <code>__glXQueryContextInfo</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=14245">Bug
#14245</a>.</li>
</ul>
</li>
<li>Assorted GLSL fixes. Including but not limited to:
<ul>
<li>Change variable declared assertion into conditional in GLSL
compiler. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27921">Bug
#27921</a>.</li>
<li>Fix instruction indexing
bugs. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27566">Bug
#27566</a>.</li>
<li>Updated uniform location / offset encoding to be more like
other implementations.</li>
<li>Don't overwrite a driver's shader infolog with generic failure
message.</li>
</ul>
</li>
<li>Fixed OSMesa build for 16 and 32-bit color channel depth.
<li>Fixed OSMesa build with hidden symbol visibility. libOSMesa no longer links to libGL.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28305">Bug
#28305</a>.
<li>Fixed handling of multiple render targets in fixed-function
texture envrionmnent programs.</li>
<li>Fixed conversion errors in <code>signed_rgba8888[rev]</code> texel
fetch.</li>
<li>Don't set srcLevel on <code>GL_TEXTURE_RECTANGLE_ARB</code> targets.</li>
<li>Various build fixes for OpenBSD.</li>
<li>Various build fixes for OS X.</li>
<li>Various build fixes for GCC 3.3.</li>
</ul>
</body>
</html>

89
docs/relnotes-7.8.3.html Normal file
View File

@@ -0,0 +1,89 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.3 Release Notes / (date tbd)</H1>
<p>
Mesa 7.8.3 is a bug fix release which fixes bugs found since the 7.8.2 release.
</p>
<p>
Mesa 7.8.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
x MesaLib-7.8.3.tar.gz
x MesaLib-7.8.3.tar.bz2
x MesaLib-7.8.3.zip
x MesaDemos-7.8.3.tar.gz
x MesaDemos-7.8.3.tar.bz2
x MesaDemos-7.8.3.zip
x MesaGLUT-7.8.3.tar.gz
x MesaGLUT-7.8.3.tar.bz2
x MesaGLUT-7.8.3.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Changes</h2>
<ul>
<li>The radeon driver should use less memory when searching for a valid mip
image.</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fix unsupported FB with D24S8 (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">29116</a>)</li>
<li>Fix ReadPixels crash when reading depth/stencil from an FBO</li>
<li>Fixed a bug rendering to 16-bit buffers using swrast.</li>
<li>Fixed a state tracker/TGSI bug that caused crashes when using Windows'
memory debugging features.</li>
<li>Fixed an issue rendering to 32-bit channels with swrast (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29487">29487</a>)</li>
<li>GLSL: fix indirect <TT>gl_TextureMatrix</TT> addressing (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">28967</a>)</li>
<li>GLSL: fix for bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">27216</a></li>
<li>GLSL: fix zw fragcoord entries in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29183">29183</a>)</li>
<li>Fix texture env generation in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28169">28169</a>)</li>
<li>osmesa: a fix for calling <TT>OSMesaMakeCurrent</TT> twice was applied (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=10966">10966</a></li>
<li>A bug was fixed which could cause Mesa to ignore the
<TT>MESA_EXTENSION_OVERRIDE</TT> environment variable.</li>
<li>A bug related to specular highlights on backfaces was fixed.</li>
<li>A radeon-specific issue with <TT>glCopyTex(Sub)Image</TT> was
corrected.</li>
<li>radeon/wine: flush command stream in more cases, fixing wine d3d9
tests.</li>
<li>r600: fix sin+cos normalization.</li>
<li>r600: (properly) ignore <TT>GL_COORD_REPLACE</TT> when point sprites are
disabled.</li>
<li>radeon: avoid flushing when the context is not current.</li>
<li>r300c: a bug affecting unaligned BOs was fixed.</li>
<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
</ul>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.8 Release Notes / date TBD</H1>
<H1>Mesa 7.8 Release Notes / March 28, 2010</H1>
<p>
Mesa 7.8 is a new development release.
@@ -28,7 +28,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
5fcfde5383eccb3e9fd665f08a0ea59b MesaLib-7.8.tar.gz
85cb891eecb89aae4fdd3499cccd934b MesaLib-7.8.tar.bz2
754f39593006effc1c8ec3c27c2f1296 MesaLib-7.8.zip
c3869c29fa6c3dbdd763f7428d271e12 MesaDemos-7.8.tar.gz
9fe8ec184c7f78691e43c4c0a7f97d56 MesaDemos-7.8.tar.bz2
063a96947f7b83d4ad789c6cf291b184 MesaDemos-7.8.zip
5f4246756b7daaddb4fb3f970cad1e28 MesaGLUT-7.8.tar.gz
ca7048a4aa7a437dcc84cc2c7d731336 MesaGLUT-7.8.tar.bz2
b54581aeb79b585b158d6a32f94feff2 MesaGLUT-7.8.zip
</pre>

406
docs/relnotes-7.9.1.html Normal file
View File

@@ -0,0 +1,406 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.1 Release Notes / January 7, 2011</H1>
<p>
Mesa 7.9.1 is a bug fix release which fixes bugs found since the 7.9 release.
</p>
<p>
Mesa 7.9.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
78422843ea875ad4eac35b9b8584032b MesaLib-7.9.1.tar.gz
07dc6cfb5928840b8b9df5bd1b3ae434 MesaLib-7.9.1.tar.bz2
c8eaea5b3c3d6dee784bd8c2db91c80f MesaLib-7.9.1.zip
ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
41fc477d524e7dc5c84da8ef22422bea MesaGLUT-7.9.1.tar.bz2
90b287229afdf19317aa989d19462e7a MesaGLUT-7.9.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28800">Bug 28800</a> - [r300c, r300g] Texture corruption with World of Warcraft</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29420">Bug 29420</a> - Amnesia / HPL2 RendererFeatTest - not rendering correctly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29946">Bug 29946</a> - [swrast] piglit valgrind glsl-array-bounds-04 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30261">Bug 30261</a> - [GLSL 1.20] allowing inconsistent invariant declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30632">Bug 30632</a> - [softpipe] state_tracker/st_manager.c:489: st_context_notify_invalid_framebuffer: Assertion `stfb &amp;&amp; stfb-&gt;iface == stfbi' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30694">Bug 30694</a> - wincopy will crash on Gallium drivers when going to front buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30787">Bug 30787</a> - Invalid asm shader does not generate draw-time error when used with GLSL shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30993">Bug 30993</a> - getFramebufferAttachmentParameteriv wrongly generates error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31101">Bug 31101</a> - [glsl2] abort() in ir_validate::visit_enter(ir_assignment *ir)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31193">Bug 31193</a> - [regression] aa43176e break water reflections</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31194">Bug 31194</a> - The mesa meta save/restore code doesn't ref the current GLSL program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31371">Bug 31371</a> - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type &gt;= 0) &amp;&amp; (type->base_type &lt;= 3)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31439">Bug 31439</a> - Crash in glBufferSubData() with size == 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31495">Bug 31495</a> - [i965 gles2c bisected] OpenGL ES 2.0 conformance GL2Tests_GetBIFD_input.run regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31514">Bug 31514</a> - isBuffer returns true for unbound buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31560">Bug 31560</a> - [tdfx] tdfx_tex.c:702: error: const struct gl_color_table has no member named Format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31617">Bug 31617</a> - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31648">Bug 31648</a> - [GLSL] array-struct-array gets assertion: `(size &gt;= 1) && (size &lt;= 4)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31650">Bug 31650</a> - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31673">Bug 31673</a> - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31690">Bug 31690</a> - i915 shader compiler fails to flatten if in Aquarium webgl demo.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31832">Bug 31832</a> - [i915] Bad renderbuffer format: 21</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31841">Bug 31841</a> - [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31894">Bug 31894</a> - Writing to gl_PointSize with GLES2 corrupts other varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31909">Bug 31909</a> - [i965] brw_fs.cpp:1461: void fs_visitor::emit_bool_to_cond_code(ir_rvalue*): Assertion `expr-&gt;operands[i]-&gt;type-&gt;is_scalar()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31934">Bug 31934</a> - [gallium] Mapping empty buffer object causes SIGSEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31983">Bug 31983</a> - [i915 gles2] "if (expression with builtin/varying variables) discard" breaks linkage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31985">Bug 31985</a> - [GLSL 1.20] initialized uniform array considered as "unsized"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31987">Bug 31987</a> - [gles2] if input a wrong pname(GL_NONE) to glGetBoolean, it will not case GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32035">Bug 32035</a> - [GLSL bisected] comparing unsized array gets segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32070">Bug 32070</a> - llvmpipe renders stencil demo incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32273">Bug 32273</a> - assertion fails when starting vdrift 2010 release with shaders enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32287">Bug 32287</a> - [bisected GLSL] float-int failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32311">Bug 32311</a> - [965 bisected] Array look-ups broken on GM45</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32520">Bug 32520</a> - [gles2] glBlendFunc(GL_ZERO, GL_DST_COLOR) will result in GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32825">Bug 32825</a> - egl_glx driver completely broken in 7.9 branch [fix in master]</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9..mesa-7.9.1
</pre>
<p>Alex Deucher (5):
<ul>
<li>r100: revalidate after radeon_update_renderbuffers</li>
<li>r600c: add missing radeon_prepare_render() call on evergreen</li>
<li>r600c: properly align mipmaps to group size</li>
<li>gallium/egl: fix r300 vs r600 loading</li>
<li>r600c: fix some opcodes on evergreen</li>
</ul></p>
<p>Aras Pranckevicius (2):
<ul>
<li>glsl: fix crash in loop analysis when some controls can't be determined</li>
<li>glsl: fix matrix type check in ir_algebraic</li>
</ul></p>
<p>Brian Paul (27):
<ul>
<li>swrast: fix choose_depth_texture_level() to respect mipmap filtering state</li>
<li>st/mesa: replace assertion w/ conditional in framebuffer invalidation</li>
<li>egl/i965: include inline_wrapper_sw_helper.h</li>
<li>mesa: Add missing else in do_row_3D</li>
<li>mesa: add missing formats in _mesa_format_to_type_and_comps()</li>
<li>mesa: handle more pixel types in mipmap generation code</li>
<li>mesa: make glIsBuffer() return false for never bound buffers</li>
<li>mesa: fix glDeleteBuffers() regression</li>
<li>swrast: init alpha value to 1.0 in opt_sample_rgb_2d()</li>
<li>meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear</li>
<li>st/mesa: fix mapping of zero-sized buffer objects</li>
<li>mesa: check for posix_memalign() errors</li>
<li>llvmpipe: fix broken stencil writemask</li>
<li>mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query</li>
<li>mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type</li>
<li>mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM</li>
<li>mesa: test for cube map completeness in glGenerateMipmap()</li>
<li>tnl: Initialize gl_program_machine memory in run_vp.</li>
<li>tnl: a better way to initialize the gl_program_machine memory</li>
<li>mesa, st/mesa: disable GL_ARB_geometry_shader4</li>
<li>glsl: fix off by one in register index assertion</li>
<li>st/mesa: fix mipmap generation bug</li>
<li>glsl: new glsl_strtod() wrapper to fix decimal point interpretation</li>
<li>mesa: no-op glBufferSubData() on size==0</li>
<li>tdfx: s/Format/_BaseFormat/</li>
<li>st/mesa: fix renderbuffer pointer check in st_Clear()</li>
<li>mesa: Bump the number of bits in the register index.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Fix lexer rule for ^=</li>
<li>glsl: Fix ast-to-hir for ARB_fragment_coord_conventions</li>
<li>glsl: Fix ir_expression::constant_expression_value()</li>
<li>glsl: Fix erroneous cast in ast_jump_statement::hir()</li>
<li>glsl: Fix linker bug in cross_validate_globals()</li>
</ul></p>
<p>Chia-I Wu (10):
<ul>
<li>targets/egl: Fix linking with libdrm.</li>
<li>st/vega: Fix version check in context creation.</li>
<li>st/egl: Do not finish a fence that is NULL.</li>
<li>egl: Fix a false negative check in _eglCheckMakeCurrent.</li>
<li>st/mesa: Unreference the sampler view in st_bind_surface.</li>
<li>egl_dri2: Fix __DRI_DRI2 version 1 support.</li>
<li>st/vega: Do not wait NULL fences.</li>
<li>mesa: Do not advertise GL_OES_texture_3D.</li>
<li>egl_glx: Fix borken driver.</li>
<li>egl: Check extensions.</li>
</ul></p>
<p>Daniel Lichtenberger (1):
<ul>
<li>radeon: fix potential segfault in renderbuffer update</li>
</ul></p>
<p>Daniel Vetter (1):
<ul>
<li>r200: revalidate after radeon_update_renderbuffers</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r300g: fixup rs690 tiling stride alignment calculations.</li>
</ul></p>
<p>Eric Anholt (13):
<ul>
<li>intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.</li>
<li>glsl: Free the loop state context when we free the loop state.</li>
<li>i965: Allow OPCODE_SWZ to put immediates in the first arg.</li>
<li>i965: Add support for rendering to SARGB8 FBOs.</li>
<li>glsl: Add a helper constructor for expressions that works out result type.</li>
<li>glsl: Fix structure and array comparisions.</li>
<li>glsl: Quiet unreachable no-return-from-function warning.</li>
<li>glsl: Mark the array access for whole-array comparisons.</li>
<li>glsl: Fix flipped return of has_value() for array constants.</li>
<li>mesa: Add getters for the rest of the supported draw buffers.</li>
<li>mesa: Add getters for ARB_copy_buffer's attachment points.</li>
<li>i965: Correct the dp_read message descriptor setup on g4x.</li>
<li>glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>glsl: fix lowering conditional returns in subroutines</li>
</ul></p>
<p>Francisco Jerez (3):
<ul>
<li>meta: Don't leak alpha function/reference value changes.</li>
<li>meta: Fix incorrect rendering of the bitmap alpha component.</li>
<li>meta: Don't try to disable cube maps if the driver doesn't expose the extension.</li>
</ul></p>
<p>Henri Verbeet (2):
<ul>
<li>r600: Evergreen has two extra frac_bits for the sampler LOD state.</li>
<li>st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().</li>
</ul></p>
<p>Ian Romanick (33):
<ul>
<li>Add 7.9 md5sums</li>
<li>docs: Import 7.8.x release notes from 7.8 branch.</li>
<li>docs: download.html does not need to be updated for each release</li>
<li>docs: Update mailing lines from sf.net to freedesktop.org</li>
<li>docs: added news item for 7.9 release</li>
<li>mesa: Validate assembly shaders when GLSL shaders are used</li>
<li>linker: Reject shaders that have unresolved function calls</li>
<li>mesa: Refactor validation of shader targets</li>
<li>glsl: Slightly change the semantic of _LinkedShaders</li>
<li>linker: Improve handling of unread/unwritten shader inputs/outputs</li>
<li>glsl: Commit lexer files changed by previous cherry picking</li>
<li>mesa: Make metaops use program refcounts instead of names.</li>
<li>glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow</li>
<li>mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample</li>
<li>glsl: better handling of linker failures</li>
<li>mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.</li>
<li>i915: Disallow alpha, red, RG, and sRGB as render targets</li>
<li>glsl/linker: Free any IR discarded by optimization passes.</li>
<li>glsl: Add an optimization pass to simplify discards.</li>
<li>glsl: Add a lowering pass to move discards out of if-statements.</li>
<li>i915: Correctly generate unconditional KIL instructions</li>
<li>glsl: Add unary ir_expression constructor</li>
<li>glsl: Ensure that equality comparisons don't return a NULL IR tree</li>
<li>glcpp: Commit changes in generated files cause by previous commit</li>
<li>glsl: Inherrit type of declared variable from initializer</li>
<li>glsl: Inherrit type of declared variable from initializer after processing assignment</li>
<li>linker: Ensure that unsized arrays have a size after linking</li>
<li>linker: Fix regressions caused by previous commit</li>
<li>linker: Allow built-in arrays to have different sizes between shader stages</li>
<li>ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors</li>
<li>Refresh autogenerated file builtin_function.cpp.</li>
<li>docs: Initial set of release notes for 7.9.1</li>
<li>mesa: set version string to 7.9.1</li>
</ul></p>
<p>Julien Cristau (1):
<ul>
<li>Makefile: don't include the same files twice in the tarball</li>
</ul></p>
<p>Kenneth Graunke (19):
<ul>
<li>glcpp: Return NEWLINE token for newlines inside multi-line comments.</li>
<li>generate_builtins.py: Output large strings as arrays of characters.</li>
<li>glsl: Fix constant component count in vector constructor emitting.</li>
<li>ir_dead_functions: Actually free dead functions and signatures.</li>
<li>glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version &gt;= 1.30.</li>
<li>glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.</li>
<li>glsl: Fix constant expression handling for &lt, &gt;, &lt=, &gt;= on vectors.</li>
<li>glsl: Use do_common_optimization in the standalone compiler.</li>
<li>glsl: Don't inline function prototypes.</li>
<li>glsl: Add a virtual as_discard() method.</li>
<li>glsl: Remove "discard" support from lower_jumps.</li>
<li>glsl: Refactor get_num_operands.</li>
<li>glcpp: Don't emit SPACE tokens in conditional_tokens production.</li>
<li>glsl: Clean up code by adding a new is_break() function.</li>
<li>glsl: Consider the "else" branch when looking for loop breaks.</li>
<li>Remove OES_compressed_paletted_texture from the ES2 extension list.</li>
<li>glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).</li>
<li>Fix build on systems where "python" is python 3.</li>
<li>i965: Internally enable GL_NV_blend_square on ES2.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>i965: Don't write mrf assignment for pointsize output</li>
</ul></p>
<p>Luca Barbieri (1):
<ul>
<li>glsl: Unroll loops with conditional breaks anywhere (not just the end)</li>
</ul></p>
<p>Marek Olšák (17):
<ul>
<li>r300g: fix microtiling for 16-bits-per-channel formats</li>
<li>r300g: fix texture border for 16-bits-per-channel formats</li>
<li>r300g: add a default channel ordering of texture border for unhandled formats</li>
<li>r300g: fix texture border color for all texture formats</li>
<li>r300g: fix rendering with no vertex elements</li>
<li>r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction</li>
<li>r300g: fix texture border color once again</li>
<li>r300g: fix texture swizzling with compressed textures on r400-r500</li>
<li>r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only</li>
<li>mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium</li>
<li>st/mesa: initialize key in st_vp_varient</li>
<li>r300/compiler: fix swizzle lowering with a presubtract source operand</li>
<li>r300g: fix rendering with a vertex attrib having a zero stride</li>
<li>ir_to_mesa: Add support for conditional discards.</li>
<li>r300g: finally fix the texture corruption on r3xx-r4xx</li>
<li>mesa: fix texel store functions for some float formats</li>
<li>r300/compiler: disable the rename_regs pass for loops</li>
</ul></p>
<p>Mario Kleiner (1):
<ul>
<li>mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.</li>
</ul></p>
<p>Peter Clifton (1):
<ul>
<li>intel: Fix emit_linear_blit to use DWORD aligned width blits</li>
</ul></p>
<p>Robert Hooker (2):
<ul>
<li>intel: Add a new B43 pci id.</li>
<li>egl_dri2: Add missing intel chip ids.</li>
</ul></p>
<p>Roland Scheidegger (1):
<ul>
<li>r200: fix r200 large points</li>
</ul></p>
<p>Thomas Hellstrom (17):
<ul>
<li>st/xorg: Don't try to use option values before processing options</li>
<li>xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers</li>
<li>st/xorg: Add a customizer option to get rid of annoying cursor update flicker</li>
<li>xorg/vmwgfx: Don't hide HW cursors when updating them</li>
<li>st/xorg: Don't try to remove invalid fbs</li>
<li>st/xorg: Fix typo</li>
<li>st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments</li>
<li>st/xorg: Fix compilation errors for Xservers compiled without Composite</li>
<li>st/xorg: Don't use deprecated x*alloc / xfree functions</li>
<li>xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions</li>
<li>st/xorg: Fix compilation for Xservers &gt;= 1.10</li>
<li>mesa: Make sure we have the talloc cflags when using the talloc headers</li>
<li>egl: Add an include for size_t</li>
<li>mesa: Add talloc includes for gles</li>
<li>st/egl: Fix build for include files in nonstandard places</li>
<li>svga/drm: Optionally resolve calls to powf during link-time</li>
<li>gallium/targets: Trivial crosscompiling fix</li>
</ul></p>
<p>Tom Stellard (7):
<ul>
<li>r300/compiler: Make sure presubtract sources use supported swizzles</li>
<li>r300/compiler: Fix register allocator's handling of loops</li>
<li>r300/compiler: Fix instruction scheduling within IF blocks</li>
<li>r300/compiler: Use zero as the register index for unused sources</li>
<li>r300/compiler: Ignore alpha dest register when replicating the result</li>
<li>r300/compiler: Use correct swizzles for all presubtract sources</li>
<li>r300/compiler: Don't allow presubtract sources to be remapped twice</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>glsl: Fix 'control reaches end of non-void function' warning.</li>
</ul></p>
<p>richard (1):
<ul>
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul></p>
</body>
</html>

336
docs/relnotes-7.9.2.html Normal file
View File

@@ -0,0 +1,336 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.2 Release Notes / March 2, 2011</H1>
<p>
Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9.1 release.
</p>
<p>
Mesa 7.9.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
eb4ab8c1a03386def3ea34b1358e9cda MesaLib-7.9.2.tar.gz
8f6d1474912787ce13bd35f3bae9938a MesaLib-7.9.2.tar.bz2
427a81dd43ac97603768dc5c6af3df26 MesaLib-7.9.2.zip
aacb8f4db997e346db40c6066942140a MesaGLUT-7.9.2.tar.gz
18abe6cff4fad8ad4752c7b7ab548e5d MesaGLUT-7.9.2.tar.bz2
3189e5732d636c71baf3d8bc23ce7b11 MesaGLUT-7.9.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 GPU hang in GLSL shaders that contain an unconditional <tt>discard</tt> statement.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9.1..mesa-7.9.2
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add links to 7.9.1 and 7.9.2 release notes</li>
<li>mesa: include compiler.h for ASSERT macro</li>
<li>glsl: add ir_shader case in switch stmt to silence warning</li>
<li>glsl2: fix signed/unsigned comparison warning</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (14):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>intel: Check for unsupported texture when finishing using as a render target</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (2):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (11):
<ul>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.9.1 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial set of release notes for 7.9.2</li>
<li>mesa: bump version to 7.9.2-devel</li>
<li>docs: Update 7.9.2 release notes</li>
<li>i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>mesa: Remove unsupported OES extensions</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glcpp: Regenerate files from recent cherry picks</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.9.2 release notes for recent cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.9.2 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
</ul></p>
<p>Marek Olšák (3):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

137
docs/relnotes-7.9.html Normal file
View File

@@ -0,0 +1,137 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9 Release Notes / October 4, 2010</H1>
<p>
Mesa 7.9 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 7.9.1.
</p>
<p>
Mesa 7.9 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>
ed65ab425b25895c7f473d0a5e6e64f8 MesaLib-7.9.tar.gz
82c740c49d572baa6da2b1a1eee90bca MesaLib-7.9.tar.bz2
cd2b6ecec759b0457475e94bbb38fedb MesaLib-7.9.zip
7b54af9fb9b1f6a1a65db2520f50848f MesaGLUT-7.9.tar.gz
20d07419d1929f833fdb36bced290ad5 MesaGLUT-7.9.tar.bz2
62a7edecd7c92675cd6029b05217eb0a MesaGLUT-7.9.zip
</pre>
<h2>New features</h2>
<ul>
<li>New, improved GLSL compiler written by Intel.
See the <a href="shading.html"> Shading Language</a> page for
more information.
<li>New, very experimental Gallium driver for R600-R700 Radeons.
<li>Support for AMD Evergreen-based Radeons (HD 5xxx)
<li>GL_EXT_timer_query extension (i965 driver and softpipe only)
<li>GL_EXT_framebuffer_multisample extension (intel drivers, MAX_SAMPLES = 1)
<li>GL_ARB_texture_swizzle extension (alias of GL_EXT_texture_swizzle)
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow,
GL_ARB_window_pos, GL_EXT_gpu_program_parameters,
GL_ATI_texture_env_combine3, GL_MESA_pack_invert, and GL_OES_EGL_image
extensions in Gallium drivers
<li>GL_ARB_depth_clamp and GL_NV_depth_clamp extensions (in nv50 and r600
Gallium drivers)
<li>GL_ARB_half_float_vertex extension (in nvfx, r300, r600, softpipe,
and llvmpipe Gallium drivers)
<li>GL_EXT_draw_buffers2 (in nv50, r600, softpipe, and llvmpipe Gallium
drivers)
<li>GL_EXT_texture_swizzle (in nvfx, r300, r600, softpipe, and llvmpipe
Gallium drivers)
<li>GL_ATI_texture_mirror_once (in nvfx, nv50, r300, r600, softpipe, and
llvmpipe Gallium drivers)
<li>GL_NV_conditional_render (in r300 Gallium driver)
<li>Initial "signs of life" support for Sandybridge hardware in i965 DRI
driver.
</ul>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Massive improvements to the Gallium driver for R300-R500 Radeons; this
driver is now considered stable for use as a DRI (OpenGL) driver.
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=10908">Bug 10908</a> - GLSL: gl_FogParamaters gl_Fog built-in uniform not functioning</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=13753">Bug 13753</a> - Numerous bugs in GLSL uniform handling</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16854">Bug 16854</a> - GLSL function call at global scope causes SEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16856">Bug 16856</a> - GLSL indexing of unsized array results in assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=18659">Bug 18659</a> - Crash in shader/slang/slang_codegen.c _slang_gen_function_call_name()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=19089">Bug 19089</a> - [GLSL] glsl1/shadow2D() cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=22622">Bug 22622</a> - [GM965 GLSL] noise*() cause GPU lockup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=23743">Bug 23743</a> - For loop from 0 to 0 not optimized out</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=24553">Bug 24553</a> - shader compilation times explode when using more () pairs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25664">Bug 25664</a> - [GLSL] re-declaring an empty array fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25769">Bug 25769</a> - [GLSL] "float" can be implicitly converted to "int"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25808">Bug 25808</a> - [GLSL] const variable is modified successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25826">Bug 25826</a> - [GLSL] declaring an unsized array then re-declaring with a size fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25827">Bug 25827</a> - [GLSL] vector constructor accepts too many arguments successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25829">Bug 25829</a> - [GLSL] allowing non-void function without returning value</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25830">Bug 25830</a> - [GLSL] allowing non-constant-expression as const declaration initializer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25877">Bug 25877</a> - [GLSL 1.10] implicit conversion from "int" to "float" should not be allowed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25878">Bug 25878</a> - [GLSL] sampler is converted to int successfully</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25994">Bug 25994</a> - [GM45][GLSL] 'return' statement in vertex shader unsupported</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25999">Bug 25999</a> - [GLSL] embedded structure constructor fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26000">Bug 26000</a> - [GLSL] allowing different parameter qualifier between the function definition and declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26001">Bug 26001</a> - [GLSL 1.10] constructing matrix from matrix succeeds</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26224">Bug 26224</a> - [GLSL] Cannot get location of a uniform struct member</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26990">Bug 26990</a> - [GLSL] variable declaration in "while" fails to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27004">Bug 27004</a> - [GLSL] allowing macro redefinition</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27060">Bug 27060</a> - [965] piglit glsl-fs-raytrace failure due to lack of function calls.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">Bug 27216</a> - Assignment with a function call in an if statement causes an assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27261">Bug 27261</a> - GLSL Compiler fails on the following vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27265">Bug 27265</a> - GLSL Compiler doesnt link the attached vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27388">Bug 27388</a> - [i965] piglit glsl-vs-arrays failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27403">Bug 27403</a> - GLSL struct causing "Invalid src register file ..." error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27914">Bug 27914</a> - GLSL compiler uses MUL+ADD where it could use MAD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28055">Bug 28055</a> - glsl-texcoord-array fails GLSL compilation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28374">Bug 28374</a> - SIGSEGV shader/slang/slang_typeinfo.c:534</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28748">Bug 28748</a> - [i965] uninlined function calls support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28833">Bug 28833</a> - piglit/shaders/glsl-texcoord-array fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28834">Bug 28834</a> - Add support for system fpclassify to GL_OES_query_matrix function for OpenBSD / NetBSD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28837">Bug 28837</a> - varying vec4 index support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28845">Bug 28845</a> - The GLU tesselator code has some warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28889">Bug 28889</a> - [regression] wine game crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28894">Bug 28894</a> - slang build fails if absolute path contains spaces</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28913">Bug 28913</a> - [GLSL] allowing two version statements</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28931">Bug 28931</a> - Floating Point Exception in Warzone2100 Trunk version</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28966">Bug 28966</a> - [r300g] Dynamic branching 3 demo does not run</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">Bug 28967</a> - slang/slang_emit.c:350: storage_to_src_reg: Assertion `index &gt;= 0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29013">Bug 29013</a> - [r300g] translate_rgb_op: unknown opcode ILLEGAL OPCODE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29020">Bug 29020</a> - [r300g] Wine d3d9 tests hardlock</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29910">Bug 29910</a> - Mesa advertises bogus GL_ARB_shading_language_120</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30196">Bug 30196</a> - [GLSL] gl_TextureMatrix{Inverse,Transpose,InverseTranspose} unsupported</li>
</ul>
<h2>Changes</h2>
<ul>
<li>The Mesa demo/test programs have been moved into a separate git
repository.
<li>GL/glext.h file upgraded to version 64
<li>GL/glxext.h file upgraded to version 32
<li>GL/wglext.h file upgraded to version 22
</ul>
</body>
</html>

View File

@@ -13,6 +13,12 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
<LI><A HREF="relnotes-7.7.1.html">7.7.1 release notes</A>
<LI><A HREF="relnotes-7.7.html">7.7 release notes</A>

View File

@@ -27,7 +27,9 @@ You may access the repository either as an
<p>
You may also
<a href="http://gitweb.freedesktop.org/?p=mesa/mesa.git"
target="_parent">browse the git repository</a>.
target="_parent">browse the main Mesa git repository</a> and the
<a href="http://cgit.freedesktop.org/mesa/demos"
target="_parent">Mesa demos and tests git repository</a>.
</p>
@@ -48,6 +50,10 @@ To get the Mesa sources anonymously (read-only):
<pre>
git pull origin
</pre>
<li>If you also want the Mesa demos/tests repository:
<pre>
git clone git://anongit.freedesktop.org/git/mesa/demos
</pre>
</ol>
@@ -79,6 +85,10 @@ Once your account is established:
<pre>
git pull origin
</pre>
<li>If you also want the Mesa demos/tests repository:
<pre>
git clone git+ssh://username@git.freedesktop.org/git/mesa/demos
</pre>
</ol>

View File

@@ -14,10 +14,6 @@ This page describes the features and status of Mesa's support for the
OpenGL Shading Language</a>.
</p>
<p>
Last updated on 15 December 2008.
</p>
<p>
Contents
</p>
@@ -43,19 +39,19 @@ list of keywords to control some aspects of the GLSL compiler and shader
execution. These are generally used for debugging.
</p>
<ul>
<li>dump - print GLSL shader code to stdout at link time
<li>log - log all GLSL shaders to files.
<li><b>dump</b> - print GLSL shader code to stdout at link time
<li><b>log</b> - log all GLSL shaders to files.
The filenames will be "shader_X.vert" or "shader_X.frag" where X
the shader ID.
<li>nopt - disable compiler optimizations
<li>opt - force compiler optimizations
<li>uniform - print message to stdout when glUniform is called
<li>nopvert - force vertex shaders to be a simple shader that just transforms
<li><b>nopt</b> - disable compiler optimizations
<li><b>opt</b> - force compiler optimizations
<li><b>uniform</b> - print message to stdout when glUniform is called
<li><b>nopvert</b> - force vertex shaders to be a simple shader that just transforms
the vertex position with ftransform() and passes through the color and
texcoord[0] attributes.
<li>nopfrag - force fragment shader to be a simple shader that passes
<li><b>nopfrag</b> - force fragment shader to be a simple shader that passes
through the color attribute.
<li>useprog - log glUseProgram calls to stderr
<li><b>useprog</b> - log glUseProgram calls to stderr
</ul>
<p>
Example: export MESA_GLSL=dump,nopt
@@ -63,30 +59,28 @@ Example: export MESA_GLSL=dump,nopt
<a name="120">
<h2>GLSL 1.20 support</h2>
<h2>GLSL Version</h2>
<p>
GLSL version 1.20 is supported in Mesa 7.3 and later.
Among the features/differences of GLSL 1.20 are:
<ul>
<li><code>mat2x3, mat2x4</code>, etc. types and functions
<li><code>transpose(), outerProduct(), matrixCompMult()</code> functions
(but untested)
<li>precision qualifiers (lowp, mediump, highp)
<li><code>invariant</code> qualifier
<li><code>array.length()</code> method
<li><code>float[5] a;</code> array syntax
<li><code>centroid</code> qualifier
<li>unsized array constructors
<li>initializers for uniforms
<li>const initializers calling built-in functions
</ul>
The GLSL compiler currently supports version 1.20 of the shading language.
</p>
<p>
Several GLSL extensions are also supported:
</p>
<ul>
<li>GL_ARB_draw_buffers
<li>GL_ARB_texture_rectangle
<li>GL_ARB_fragment_coord_conventions
<li>GL_EXT_texture_array
</ul>
<a name="unsup">
<h2>Unsupported Features</h2>
<p>XXX update this section</p>
<p>
The following features of the shading language are not yet fully supported
in Mesa:
@@ -134,39 +128,6 @@ These issues will be addressed/resolved in the future.
<h2>Programming Hints</h2>
<ul>
<li>Declare <em>in</em> function parameters as <em>const</em> whenever possible.
This improves the efficiency of function inlining.
</li>
<br>
<li>To reduce register usage, declare variables within smaller scopes.
For example, the following code:
<pre>
void main()
{
vec4 a1, a2, b1, b2;
gl_Position = expression using a1, a2.
gl_Color = expression using b1, b2;
}
</pre>
Can be rewritten as follows to use half as many registers:
<pre>
void main()
{
{
vec4 a1, a2;
gl_Position = expression using a1, a2.
}
{
vec4 b1, b2;
gl_Color = expression using b1, b2;
}
}
</pre>
Alternately, rather than using several float variables, use
a vec4 instead. Use swizzling and writemasks to access the
components of the vec4 as floats.
</li>
<br>
<li>Use the built-in library functions whenever possible.
For example, instead of writing this:
<pre>
@@ -176,8 +137,6 @@ These issues will be addressed/resolved in the future.
<pre>
float x = inversesqrt(y);
</pre>
<li>
Use ++i when possible as it's more efficient than i++
</li>
</ul>
@@ -186,13 +145,8 @@ These issues will be addressed/resolved in the future.
<h2>Stand-alone GLSL Compiler</h2>
<p>
A unique stand-alone GLSL compiler driver has been added to Mesa.
<p>
<p>
The stand-alone compiler (like a conventional command-line compiler)
is a tool that accepts Shading Language programs and emits low-level
GPU programs.
The stand-alone GLSL compiler program can be used to compile GLSL shaders
into low-level GPU code.
</p>
<p>
@@ -205,59 +159,25 @@ This tool is useful for:
</ul>
<p>
After building Mesa, the glslcompiler can be built by manually running:
After building Mesa, the compiler can be found at src/glsl/glsl_compiler
</p>
<pre>
make realclean
make linux
cd src/mesa/drivers/glslcompiler
make
</pre>
<p>
Here's an example of using the compiler to compile a vertex shader and
emit GL_ARB_vertex_program-style instructions:
</p>
<pre>
bin/glslcompiler --debug --numbers --fs progs/glsl/CH06-brick.frag.txt
</pre>
<p>
results in:
</p>
<pre>
# Fragment Program/Shader
0: RCP TEMP[4].x, UNIFORM[2].xxxx;
1: RCP TEMP[4].y, UNIFORM[2].yyyy;
2: MUL TEMP[3].xy, VARYING[0], TEMP[4];
3: MOV TEMP[1], TEMP[3];
4: MUL TEMP[0].w, TEMP[1].yyyy, CONST[4].xxxx;
5: FRC TEMP[1].z, TEMP[0].wwww;
6: SGT.C TEMP[0].w, TEMP[1].zzzz, CONST[4].xxxx;
7: IF (NE.wwww); # (if false, goto 9);
8: ADD TEMP[1].x, TEMP[1].xxxx, CONST[4].xxxx;
9: ENDIF;
10: FRC TEMP[1].xy, TEMP[1];
11: SGT TEMP[2].xy, UNIFORM[3], TEMP[1];
12: MUL TEMP[1].z, TEMP[2].xxxx, TEMP[2].yyyy;
13: LRP TEMP[0], TEMP[1].zzzz, UNIFORM[0], UNIFORM[1];
14: MUL TEMP[0].xyz, TEMP[0], VARYING[1].xxxx;
15: MOV OUTPUT[0].xyz, TEMP[0];
16: MOV OUTPUT[0].w, CONST[4].yyyy;
17: END
src/glsl/glsl_compiler --dump-ast myshader.vert
</pre>
<p>
Note that some shading language constructs (such as uniform and varying
variables) aren't expressible in ARB or NV-style programs.
Therefore, the resulting output is not always legal by definition of
those program languages.
</p>
<p>
Also note that this compiler driver is still under development.
Over time, the correctness of the GPU programs, with respect to the ARB
and NV languagues, should improve.
</p>
Options include
<ul>
<li><b>--dump-ast</b> - dump GPU code
<li><b>--dump-hir</b> - dump high-level IR code
<li><b>--dump-lir</b> - dump low-level IR code
<li><b>--link</b> - ???
</ul>
@@ -266,38 +186,12 @@ and NV languagues, should improve.
<p>
The source code for Mesa's shading language compiler is in the
<code>src/mesa/shader/slang/</code> directory.
<code>src/glsl/</code> directory.
</p>
<p>
The compiler follows a fairly standard design and basically works as follows:
XXX provide some info about the compiler....
</p>
<ul>
<li>The input string is tokenized (see grammar.c) and parsed
(see slang_compiler_*.c) to produce an Abstract Syntax Tree (AST).
The nodes in this tree are slang_operation structures
(see slang_compile_operation.h).
The nodes are decorated with symbol table, scoping and datatype information.
<li>The AST is converted into an Intermediate representation (IR) tree
(see the slang_codegen.c file).
The IR nodes represent basic GPU instructions, like add, dot product,
move, etc.
The IR tree is mostly a binary tree, but a few nodes have three or four
children.
In principle, the IR tree could be executed by doing an in-order traversal.
<li>The IR tree is traversed in-order to emit code (see slang_emit.c).
This is also when registers are allocated to store variables and temps.
<li>In the future, a pattern-matching code generator-generator may be
used for code generation.
Programs such as L-BURG (Bottom-Up Rewrite Generator) and Twig look for
patterns in IR trees, compute weights for subtrees and use the weights
to select the best instructions to represent the sub-tree.
<li>The emitted GPU instructions (see prog_instruction.h) are stored in a
gl_program object (see mtypes.h).
<li>When a fragment shader and vertex shader are linked (see slang_link.c)
the varying vars are matched up, uniforms are merged, and vertex
attributes are resolved (rewriting instructions as needed).
</ul>
<p>
The final vertex and fragment programs may be interpreted in software
@@ -355,20 +249,20 @@ Extra NOP instructions will also be inserted.
<h2>Compiler Validation</h2>
<p>
A <a href="http://glean.sf.net" target="_parent">Glean</a> test has
been create to exercise the GLSL compiler.
</p>
<p>
The <em>glsl1</em> test runs over 170 sub-tests to check that the language
features and built-in functions work properly.
This test should be run frequently while working on the compiler to catch
Developers working on the GLSL compiler should test frequently to avoid
regressions.
</p>
<p>
The test coverage is reasonably broad and complete but additional tests
should be added.
The <a href="http://people.freedesktop.org/~nh/piglit/">Piglit</a> project
has many GLSL tests and the
<a href="http://glean.sf.net" target="_parent">Glean</a> glsl1 test
tests GLSL features.
</p>
<p>
The Mesa demos repository also has some good GLSL tests.
</p>
</BODY>
</HTML>

View File

@@ -23,6 +23,7 @@ each directory.
<ul>
<li><b>docs</b> - EGL documentation
<li><b>drivers</b> - EGL drivers
<li><b>glsl</b> - the GLSL compiler
<li><b>main</b> - main EGL library implementation. This is where all
the EGL API functions are implemented, like eglCreateContext().
</ul>

View File

@@ -16,8 +16,7 @@
</h3>
</center>
</h2>
<p> Copyright &copy; 2002-2003 by <a
href="http://www.tungstengraphics.com/">Tungsten Graphics, Inc.</a>,
<p> Copyright &copy; 2002-2003 by Tungsten Graphics, Inc.,
Cedar Park, Texas. All Rights Reserved. <br>
<br>
Permission is granted to make and distribute verbatim copies of this

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
** Copyright (c) 2007-2010 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
@@ -34,8 +34,8 @@ extern "C" {
/* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */
/* $Revision: 10185 $ on $Date: 2010-01-22 11:38:01 -0800 (Fri, 22 Jan 2010) $ */
#define EGL_EGLEXT_VERSION 5
/* $Revision: 12124 $ on $Date: 2010-07-27 20:12:35 -0700 (Tue, 27 Jul 2010) $ */
#define EGL_EGLEXT_VERSION 7
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
@@ -120,6 +120,30 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
#endif
#ifndef EGL_MESA_drm_image
#define EGL_MESA_drm_image 1
#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* eglCreateImageKHR attribute */
#define EGL_DRM_BUFFER_USE_MESA 0x31D1
/* EGL_DRM_BUFFER_FORMAT_MESA tokens */
#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
/* EGL_DRM_BUFFER_USE_MESA bits */
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESA) (EGLDisplay dpy, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESA) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1
@@ -149,6 +173,7 @@ typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSy
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif
#endif
/* EGL_MESA_screen extension >>> PRELIMINARY <<< */
#ifndef EGL_MESA_screen_surface
@@ -165,8 +190,8 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
#define EGL_INTERLACED_MESA 0x4008
#define EGL_SCREEN_BIT_MESA 0x08
typedef uint32_t EGLScreenMESA;
typedef uint32_t EGLModeMESA;
typedef khronos_uint32_t EGLScreenMESA;
typedef khronos_uint32_t EGLModeMESA;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
@@ -208,6 +233,17 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLCont
#endif /* EGL_MESA_copy_context */
#ifndef EGL_MESA_drm_display
#define EGL_MESA_drm_display 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLDisplay EGLAPIENTRY eglGetDRMDisplayMESA(int fd);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
#endif /* EGL_MESA_drm_display */
#ifndef EGL_KHR_image_base
#define EGL_KHR_image_base 1
/* Most interfaces defined by EGL_KHR_image_pixmap above */
@@ -227,6 +263,120 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLCont
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
#endif
#ifndef EGL_KHR_lock_surface2
#define EGL_KHR_lock_surface2 1
#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
#endif
#ifndef EGL_NV_coverage_sample
#define EGL_NV_coverage_sample 1
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
#endif
#ifndef EGL_NV_depth_nonlinear
#define EGL_NV_depth_nonlinear 1
#define EGL_DEPTH_ENCODING_NV 0x30E2
#define EGL_DEPTH_ENCODING_NONE_NV 0
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
#ifndef EGL_NV_sync
#define EGL_NV_sync 1
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
#define EGL_SYNC_STATUS_NV 0x30E7
#define EGL_SIGNALED_NV 0x30E8
#define EGL_UNSIGNALED_NV 0x30E9
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
#define EGL_ALREADY_SIGNALED_NV 0x30EA
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
#define EGL_CONDITION_SATISFIED_NV 0x30EC
#define EGL_SYNC_TYPE_NV 0x30ED
#define EGL_SYNC_CONDITION_NV 0x30EE
#define EGL_SYNC_FENCE_NV 0x30EF
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
typedef void* EGLSyncNV;
typedef khronos_utime_nanoseconds_t EGLTimeNV;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
EGLBoolean eglFenceNV (EGLSyncNV sync);
EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif
#endif
#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
#ifndef EGL_KHR_fence_sync
#define EGL_KHR_fence_sync 1
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
#define EGL_SYNC_CONDITION_KHR 0x30F8
#define EGL_SYNC_FENCE_KHR 0x30F9
#endif
#endif
#ifndef EGL_HI_clientpixmap
#define EGL_HI_clientpixmap 1
/* Surface Attribute */
#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
/*
* Structure representing a client pixmap
* (pixmap's data is in client-space memory).
*/
struct EGLClientPixmapHI
{
void* pData;
EGLint iWidth;
EGLint iHeight;
EGLint iStride;
};
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
#endif /* EGL_HI_clientpixmap */
#ifndef EGL_HI_colorformats
#define EGL_HI_colorformats 1
/* Config Attribute */
#define EGL_COLOR_FORMAT_HI 0x8F70
/* Color Formats */
#define EGL_COLOR_RGB_HI 0x8F71
#define EGL_COLOR_RGBA_HI 0x8F72
#define EGL_COLOR_ARGB_HI 0x8F73
#endif /* EGL_HI_colorformats */
#ifndef EGL_NOK_swap_region
#define EGL_NOK_swap_region 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
#endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
#endif
#ifndef EGL_NOK_texture_from_pixmap
#define EGL_NOK_texture_from_pixmap 1
#define EGL_Y_INVERTED_NOK 0x307F
#endif /* EGL_NOK_texture_from_pixmap */
#ifdef __cplusplus
}
#endif

View File

@@ -80,6 +80,14 @@ typedef void *EGLNativePixmapType;
#elif defined(__unix__) || defined(__unix)
#ifdef MESA_EGL_NO_X11_HEADERS
typedef void *EGLNativeDisplayType;
typedef khronos_uint32_t EGLNativePixmapType;
typedef khronos_uint32_t EGLNativeWindowType;
#else
/* X11 (tentative) */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -88,6 +96,8 @@ typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
#endif /* MESA_EGL_NO_X11_HEADERS */
#else
#error "Platform not recognized"
#endif

View File

@@ -393,6 +393,8 @@
#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
#define glEdgeFlagPointer MANGLE(EdgeFlagPointer)
#define glEdgeFlagv MANGLE(EdgeFlagv)
#define glEGLImageTargetRenderbufferStorageOES MANGLE(EGLImageTargetRenderbufferStorageOES)
#define glEGLImageTargetTexture2DOES MANGLE(EGLImageTargetTexture2DOES)
#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
#define glElementPointerATI MANGLE(ElementPointerATI)
#define glEnableClientStateIndexedEXT MANGLE(EnableClientStateIndexedEXT)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -27,6 +27,9 @@
#define GLFBDEV_H
/* for size_t */
#include <stdlib.h>
/* avoid including linux/fb.h */
struct fb_fix_screeninfo;
struct fb_var_screeninfo;

View File

@@ -1,340 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* This header file is based on the REAL glut.h by Mark J. Kilgard.
*
* The DJGPP/ALLEGRO (DJA) GLUT implementation was written by
* Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose
* of compiling all the sample programs (which use GLUT). Therefore,
* is NOT AT ALL a complete version of GLUT!
*/
#ifndef __AGLUT_H__
#define __AGLUT_H__
#include <GL/gl.h>
#include <GL/glu.h>
#define GLUTCALLBACK
#define APIENTRY
#define GLUTAPI extern
#define GLUT_RGB 0
#define GLUT_RGBA GLUT_RGB
#define GLUT_INDEX 1
#define GLUT_SINGLE 0
#define GLUT_DOUBLE 2
#define GLUT_ACCUM 4
#define GLUT_ALPHA 8
#define GLUT_DEPTH 16
#define GLUT_STENCIL 32
/* Mouse buttons. */
#define GLUT_LEFT_BUTTON 0
#define GLUT_MIDDLE_BUTTON 1
#define GLUT_RIGHT_BUTTON 2
/* Mouse button state. */
#define GLUT_DOWN 0
#define GLUT_UP 1
/* function keys */
#define GLUT_KEY_F1 1
#define GLUT_KEY_F2 2
#define GLUT_KEY_F3 3
#define GLUT_KEY_F4 4
#define GLUT_KEY_F5 5
#define GLUT_KEY_F6 6
#define GLUT_KEY_F7 7
#define GLUT_KEY_F8 8
#define GLUT_KEY_F9 9
#define GLUT_KEY_F10 10
#define GLUT_KEY_F11 11
#define GLUT_KEY_F12 12
/* directional keys */
#define GLUT_KEY_LEFT 100
#define GLUT_KEY_UP 101
#define GLUT_KEY_RIGHT 102
#define GLUT_KEY_DOWN 103
#define GLUT_KEY_PAGE_UP 104
#define GLUT_KEY_PAGE_DOWN 105
#define GLUT_KEY_HOME 106
#define GLUT_KEY_END 107
#define GLUT_KEY_INSERT 108
/* Entry/exit state. */
#define GLUT_LEFT 0
#define GLUT_ENTERED 1
/* Visibility state. */
#define GLUT_NOT_VISIBLE 0
#define GLUT_VISIBLE 1
/* Color index component selection values. */
#define GLUT_RED 0
#define GLUT_GREEN 1
#define GLUT_BLUE 2
/* Layers for use. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN ((void*)0)
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15 ((void*)2)
#define GLUT_BITMAP_8_BY_13 ((void*)3)
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
/* glutGet parameters. */
#define GLUT_WINDOW_X 100
#define GLUT_WINDOW_Y 101
#define GLUT_WINDOW_WIDTH 102
#define GLUT_WINDOW_HEIGHT 103
#define GLUT_WINDOW_BUFFER_SIZE 104
#define GLUT_WINDOW_STENCIL_SIZE 105
#define GLUT_WINDOW_DEPTH_SIZE 106
#define GLUT_WINDOW_RED_SIZE 107
#define GLUT_WINDOW_GREEN_SIZE 108
#define GLUT_WINDOW_BLUE_SIZE 109
#define GLUT_WINDOW_ALPHA_SIZE 110
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
#define GLUT_WINDOW_DOUBLEBUFFER 115
#define GLUT_WINDOW_RGBA 116
#define GLUT_WINDOW_PARENT 117
#define GLUT_WINDOW_NUM_CHILDREN 118
#define GLUT_WINDOW_COLORMAP_SIZE 119
#define GLUT_WINDOW_NUM_SAMPLES 120
#define GLUT_WINDOW_STEREO 121
#define GLUT_WINDOW_CURSOR 122
#define GLUT_SCREEN_WIDTH 200
#define GLUT_SCREEN_HEIGHT 201
#define GLUT_SCREEN_WIDTH_MM 202
#define GLUT_SCREEN_HEIGHT_MM 203
#define GLUT_MENU_NUM_ITEMS 300
#define GLUT_DISPLAY_MODE_POSSIBLE 400
#define GLUT_INIT_WINDOW_X 500
#define GLUT_INIT_WINDOW_Y 501
#define GLUT_INIT_WINDOW_WIDTH 502
#define GLUT_INIT_WINDOW_HEIGHT 503
#define GLUT_INIT_DISPLAY_MODE 504
#define GLUT_ELAPSED_TIME 700
#define GLUT_WINDOW_FORMAT_ID 123
/* glutDeviceGet parameters. */
#define GLUT_HAS_KEYBOARD 600
#define GLUT_HAS_MOUSE 601
#define GLUT_HAS_SPACEBALL 602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
#define GLUT_HAS_TABLET 604
#define GLUT_NUM_MOUSE_BUTTONS 605
#define GLUT_NUM_SPACEBALL_BUTTONS 606
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
#define GLUT_NUM_DIALS 608
#define GLUT_NUM_TABLET_BUTTONS 609
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
#define GLUT_DEVICE_KEY_REPEAT 611
#define GLUT_HAS_JOYSTICK 612
#define GLUT_OWNS_JOYSTICK 613
#define GLUT_JOYSTICK_BUTTONS 614
#define GLUT_JOYSTICK_AXES 615
#define GLUT_JOYSTICK_POLL_RATE 616
/* glutLayerGet parameters. */
#define GLUT_OVERLAY_POSSIBLE 800
#define GLUT_LAYER_IN_USE 801
#define GLUT_HAS_OVERLAY 802
#define GLUT_TRANSPARENT_INDEX 803
#define GLUT_NORMAL_DAMAGED 804
#define GLUT_OVERLAY_DAMAGED 805
/* glutVideoResizeGet parameters. */
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
#define GLUT_VIDEO_RESIZE_IN_USE 901
#define GLUT_VIDEO_RESIZE_X_DELTA 902
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
#define GLUT_VIDEO_RESIZE_X 906
#define GLUT_VIDEO_RESIZE_Y 907
#define GLUT_VIDEO_RESIZE_WIDTH 908
#define GLUT_VIDEO_RESIZE_HEIGHT 909
/* glutUseLayer parameters. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
/* glutGetModifiers return mask. */
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
/* glutSetCursor parameters. */
/* Basic arrows. */
#define GLUT_CURSOR_RIGHT_ARROW 0
#define GLUT_CURSOR_LEFT_ARROW 1
/* Symbolic cursor shapes. */
#define GLUT_CURSOR_INFO 2
#define GLUT_CURSOR_DESTROY 3
#define GLUT_CURSOR_HELP 4
#define GLUT_CURSOR_CYCLE 5
#define GLUT_CURSOR_SPRAY 6
#define GLUT_CURSOR_WAIT 7
#define GLUT_CURSOR_TEXT 8
#define GLUT_CURSOR_CROSSHAIR 9
/* Directional cursors. */
#define GLUT_CURSOR_UP_DOWN 10
#define GLUT_CURSOR_LEFT_RIGHT 11
/* Sizing cursors. */
#define GLUT_CURSOR_TOP_SIDE 12
#define GLUT_CURSOR_BOTTOM_SIDE 13
#define GLUT_CURSOR_LEFT_SIDE 14
#define GLUT_CURSOR_RIGHT_SIDE 15
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
/* Inherit from parent window. */
#define GLUT_CURSOR_INHERIT 100
/* Blank cursor. */
#define GLUT_CURSOR_NONE 101
/* Fullscreen crosshair (if available). */
#define GLUT_CURSOR_FULL_CROSSHAIR 102
/* GLUT initialization sub-API. */
GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
GLUTAPI void APIENTRY glutMainLoop(void);
/* GLUT window sub-API. */
GLUTAPI int APIENTRY glutCreateWindow(const char *title);
GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
GLUTAPI void APIENTRY glutDestroyWindow(int win);
GLUTAPI void APIENTRY glutPostRedisplay(void);
GLUTAPI void APIENTRY glutSwapBuffers(void);
GLUTAPI int APIENTRY glutGetWindow(void);
GLUTAPI void APIENTRY glutSetWindow(int win);
GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
GLUTAPI void APIENTRY glutPopWindow(void);
GLUTAPI void APIENTRY glutPushWindow(void);
GLUTAPI void APIENTRY glutIconifyWindow(void);
GLUTAPI void APIENTRY glutShowWindow(void);
GLUTAPI void APIENTRY glutHideWindow(void);
/* GLUT overlay sub-API. */
GLUTAPI void APIENTRY glutEstablishOverlay(void);
GLUTAPI void APIENTRY glutRemoveOverlay(void);
GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
GLUTAPI void APIENTRY glutShowOverlay(void);
GLUTAPI void APIENTRY glutHideOverlay(void);
/* GLUT menu sub-API. */
GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int));
GLUTAPI void APIENTRY glutDestroyMenu(int menu);
GLUTAPI int APIENTRY glutGetMenu(void);
GLUTAPI void APIENTRY glutSetMenu(int menu);
GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
GLUTAPI void APIENTRY glutAttachMenu(int button);
GLUTAPI void APIENTRY glutDetachMenu(int button);
/* GLUT window callback sub-API. */
GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void));
GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height));
GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state));
GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state));
GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void));
GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value);
GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state));
GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state));
GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state));
GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value));
GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y));
GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void));
GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state));
/* GLUT color index sub-API. */
GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
GLUTAPI void APIENTRY glutCopyColormap(int win);
/* GLUT state retrieval sub-API. */
GLUTAPI int APIENTRY glutGet(GLenum type);
GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
/* GLUT font sub-API */
GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
/* GLUT pre-built models sub-API */
GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutWireCube(GLdouble size);
GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void APIENTRY glutWireDodecahedron(void);
GLUTAPI void APIENTRY glutSolidDodecahedron(void);
GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
GLUTAPI void APIENTRY glutWireOctahedron(void);
GLUTAPI void APIENTRY glutSolidOctahedron(void);
GLUTAPI void APIENTRY glutWireTetrahedron(void);
GLUTAPI void APIENTRY glutSolidTetrahedron(void);
GLUTAPI void APIENTRY glutWireIcosahedron(void);
GLUTAPI void APIENTRY glutSolidIcosahedron(void);
#endif /* __AGLUT_H__ */

View File

@@ -367,22 +367,6 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
#endif /* GLX_NV_vertex_array_range */
/*
* ???. GLX_MESA_allocate_memory
*/
#ifndef GLX_MESA_allocate_memory
#define GLX_MESA_allocate_memory 1
extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
#endif /* GLX_MESA_allocate_memory */
/*
* ARB ?. GLX_ARB_render_texture
* XXX This was never finalized!

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
** Copyright (c) 2007-2010 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
@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2009/10/08 */
/* glxext.h last updated 2010/08/06 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 25
#define GLX_GLXEXT_VERSION 32
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -124,11 +124,19 @@ extern "C" {
#define GLX_SAMPLES_ARB 100001
#endif
#ifndef GLX_ARB_vertex_buffer_object
#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
#endif
#ifndef GLX_ARB_fbconfig_float
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
#endif
#ifndef GLX_ARB_framebuffer_sRGB
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
#endif
#ifndef GLX_ARB_create_context
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
@@ -143,6 +151,13 @@ extern "C" {
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
#endif
#ifndef GLX_ARB_create_context_robustness
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
#endif
#ifndef GLX_SGIS_multisample
#define GLX_SAMPLE_BUFFERS_SGIS 100000
#define GLX_SAMPLES_SGIS 100001
@@ -396,6 +411,35 @@ extern "C" {
#ifndef GLX_NV_copy_image
#endif
#ifndef GLX_INTEL_swap_event
#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
#define GLX_COPY_COMPLETE_INTEL 0x8181
#define GLX_FLIP_COMPLETE_INTEL 0x8182
#endif
#ifndef GLX_NV_multisample_coverage
#define GLX_COVERAGE_SAMPLES_NV 100001
#define GLX_COLOR_SAMPLES_NV 0x20B3
#endif
#ifndef GLX_AMD_gpu_association
#define GLX_GPU_VENDOR_AMD 0x1F00
#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
#define GLX_GPU_RAM_AMD 0x21A3
#define GLX_GPU_CLOCK_AMD 0x21A4
#define GLX_GPU_NUM_PIPES_AMD 0x21A5
#define GLX_GPU_NUM_SIMD_AMD 0x21A6
#define GLX_GPU_NUM_RB_AMD 0x21A7
#define GLX_GPU_NUM_SPI_AMD 0x21A8
#endif
#ifndef GLX_EXT_create_context_es2_profile
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#endif
/*************************************************************/
@@ -477,24 +521,24 @@ typedef unsigned __int64 uint64_t;
#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
extern void glXDestroyWindow (Display *, GLXWindow);
extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
extern void glXDestroyPixmap (Display *, GLXPixmap);
extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
extern void glXDestroyPbuffer (Display *, GLXPbuffer);
extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
extern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements);
extern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
extern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
extern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
extern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
extern void glXDestroyWindow (Display *dpy, GLXWindow win);
extern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
extern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
extern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
extern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
extern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
extern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
extern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
extern GLXDrawable glXGetCurrentReadDrawable (void);
extern Display * glXGetCurrentDisplay (void);
extern int glXQueryContext (Display *, GLXContext, int, int *);
extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
extern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
extern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
extern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
@@ -519,7 +563,7 @@ typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, un
#ifndef GLX_VERSION_1_4
#define GLX_VERSION_1_4 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
#endif
@@ -527,7 +571,7 @@ typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
#ifndef GLX_ARB_get_proc_address
#define GLX_ARB_get_proc_address 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
#endif
@@ -540,10 +584,14 @@ typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procNam
#define GLX_ARB_fbconfig_float 1
#endif
#ifndef GLX_ARB_framebuffer_sRGB
#define GLX_ARB_framebuffer_sRGB 1
#endif
#ifndef GLX_ARB_create_context
#define GLX_ARB_create_context 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *);
extern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
#endif
@@ -552,6 +600,10 @@ typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBCo
#define GLX_ARB_create_context_profile 1
#endif
#ifndef GLX_ARB_create_context_robustness
#define GLX_ARB_create_context_robustness 1
#endif
#ifndef GLX_SGIS_multisample
#define GLX_SGIS_multisample 1
#endif
@@ -563,7 +615,7 @@ typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBCo
#ifndef GLX_SGI_swap_control
#define GLX_SGI_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalSGI (int);
extern int glXSwapIntervalSGI (int interval);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
#endif
@@ -571,8 +623,8 @@ typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
#ifndef GLX_SGI_video_sync
#define GLX_SGI_video_sync 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetVideoSyncSGI (unsigned int *);
extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
extern int glXGetVideoSyncSGI (unsigned int *count);
extern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
@@ -581,7 +633,7 @@ typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigne
#ifndef GLX_SGI_make_current_read
#define GLX_SGI_make_current_read 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
extern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
@@ -592,8 +644,8 @@ typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
#define GLX_SGIX_video_source 1
#ifdef _VL_H
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
extern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
@@ -608,10 +660,10 @@ typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSou
#define GLX_EXT_import_context 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Display * glXGetCurrentDisplayEXT (void);
extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
extern GLXContextID glXGetContextIDEXT (const GLXContext);
extern GLXContext glXImportContextEXT (Display *, GLXContextID);
extern void glXFreeContextEXT (Display *, GLXContext);
extern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
extern GLXContextID glXGetContextIDEXT (const GLXContext context);
extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
extern void glXFreeContextEXT (Display *dpy, GLXContext context);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
@@ -623,12 +675,12 @@ typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
#ifndef GLX_SGIX_fbconfig
#define GLX_SGIX_fbconfig 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
extern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
@@ -641,11 +693,11 @@ typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy,
#ifndef GLX_SGIX_pbuffer
#define GLX_SGIX_pbuffer 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
extern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
extern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
extern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
extern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
@@ -657,7 +709,7 @@ typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable draw
#ifndef GLX_SGI_cushion
#define GLX_SGI_cushion 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCushionSGI (Display *, Window, float);
extern void glXCushionSGI (Display *dpy, Window window, float cushion);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
#endif
@@ -665,11 +717,11 @@ typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushi
#ifndef GLX_SGIX_video_resize
#define GLX_SGIX_video_resize 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
extern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
extern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
extern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
extern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
extern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
@@ -682,7 +734,7 @@ typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, in
#define GLX_SGIX_dmbuffer 1
#ifdef _DM_BUFFER_H_
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
extern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
#endif /* _DM_BUFFER_H_ */
@@ -691,24 +743,16 @@ typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX
#ifndef GLX_SGIX_swap_group
#define GLX_SGIX_swap_group 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
extern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
#endif
#ifndef GLX_INTEL_swap_event
#define GLX_INTEL_swap_event
#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x10000000
#define GLX_EXCHANGE_COMPLETE_INTEL 0x8024
#define GLX_BLIT_COMPLETE_INTEL 0x8025
#define GLX_FLIP_COMPLETE_INTEL 0x8026
#endif
#ifndef GLX_SGIX_swap_barrier
#define GLX_SGIX_swap_barrier 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
extern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
extern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
@@ -717,7 +761,7 @@ typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen,
#ifndef GLX_SUN_get_transparent_index
#define GLX_SUN_get_transparent_index 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
extern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#endif
@@ -725,7 +769,7 @@ typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overl
#ifndef GLX_MESA_copy_sub_buffer
#define GLX_MESA_copy_sub_buffer 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
extern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
#endif
@@ -733,7 +777,7 @@ typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawabl
#ifndef GLX_MESA_pixmap_colormap
#define GLX_MESA_pixmap_colormap 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
extern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
#endif
@@ -741,7 +785,7 @@ typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo
#ifndef GLX_MESA_release_buffers
#define GLX_MESA_release_buffers 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
extern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
#endif
@@ -749,7 +793,7 @@ typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawab
#ifndef GLX_MESA_set_3dfx_mode
#define GLX_MESA_set_3dfx_mode 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXSet3DfxModeMESA (int);
extern Bool glXSet3DfxModeMESA (int mode);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#endif
@@ -765,11 +809,11 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
extern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
extern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
extern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
extern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
extern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
@@ -810,14 +854,14 @@ typedef struct {
} GLXPipeRectLimits;
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
extern int glXBindHyperpipeSGIX (Display *, int);
extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
extern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
extern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
extern int glXBindHyperpipeSGIX (Display *dpy, int hpId);
extern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
extern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
extern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
@@ -832,7 +876,7 @@ typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice
#ifndef GLX_MESA_agp_offset
#define GLX_MESA_agp_offset 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern unsigned int glXGetAGPOffsetMESA (const void *);
extern unsigned int glXGetAGPOffsetMESA (const void *pointer);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
#endif
@@ -848,8 +892,8 @@ typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_EXT_texture_from_pixmap 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *);
extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int);
extern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
extern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
@@ -858,8 +902,8 @@ typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawab
#ifndef GLX_NV_present_video
#define GLX_NV_present_video 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern unsigned int * glXEnumerateVideoDevicesNV (Display *, int, int *);
extern int glXBindVideoDeviceNV (Display *, unsigned int, unsigned int, const int *);
extern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
extern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
@@ -868,12 +912,12 @@ typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_s
#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetVideoDeviceNV (Display *, int, int, GLXVideoDeviceNV *);
extern int glXReleaseVideoDeviceNV (Display *, int, GLXVideoDeviceNV);
extern int glXBindVideoImageNV (Display *, GLXVideoDeviceNV, GLXPbuffer, int);
extern int glXReleaseVideoImageNV (Display *, GLXPbuffer);
extern int glXSendPbufferToVideoNV (Display *, GLXPbuffer, int, unsigned long *, GLboolean);
extern int glXGetVideoInfoNV (Display *, int, GLXVideoDeviceNV, unsigned long *, unsigned long *);
extern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
extern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
extern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
extern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
extern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
extern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
@@ -886,12 +930,12 @@ typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDev
#ifndef GLX_NV_swap_group
#define GLX_NV_swap_group 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXJoinSwapGroupNV (Display *, GLXDrawable, GLuint);
extern Bool glXBindSwapBarrierNV (Display *, GLuint, GLuint);
extern Bool glXQuerySwapGroupNV (Display *, GLXDrawable, GLuint *, GLuint *);
extern Bool glXQueryMaxSwapGroupsNV (Display *, int, GLuint *, GLuint *);
extern Bool glXQueryFrameCountNV (Display *, int, GLuint *);
extern Bool glXResetFrameCountNV (Display *, int);
extern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
extern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
extern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
extern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
extern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
extern Bool glXResetFrameCountNV (Display *dpy, int screen);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
@@ -904,11 +948,11 @@ typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
#ifndef GLX_NV_video_capture
#define GLX_NV_video_capture 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXBindVideoCaptureDeviceNV (Display *, unsigned int, GLXVideoCaptureDeviceNV);
extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *, int, int *);
extern void glXLockVideoCaptureDeviceNV (Display *, GLXVideoCaptureDeviceNV);
extern int glXQueryVideoCaptureDeviceNV (Display *, GLXVideoCaptureDeviceNV, int, int *);
extern void glXReleaseVideoCaptureDeviceNV (Display *, GLXVideoCaptureDeviceNV);
extern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
extern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
extern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
extern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
@@ -920,7 +964,7 @@ typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoC
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalEXT (Display *, GLXDrawable, int);
extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
#endif
@@ -928,11 +972,19 @@ typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable,
#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCopyImageSubDataNV (Display *, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef GLX_INTEL_swap_event
#define GLX_INTEL_swap_event 1
#endif
#ifndef GLX_NV_multisample_coverage
#define GLX_NV_multisample_coverage 1
#endif
#ifdef __cplusplus
}

View File

@@ -41,7 +41,13 @@
#define DRI_INTERFACE_H
/* For archs with no drm.h */
#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__)
#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
#ifndef __NOT_HAVE_DRM_H
#define __NOT_HAVE_DRM_H
#endif
#endif
#ifndef __NOT_HAVE_DRM_H
#include <drm.h>
#else
typedef unsigned int drm_context_t;
@@ -68,7 +74,6 @@ typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
typedef struct __DRIextensionRec __DRIextension;
typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
typedef struct __DRIallocateExtensionRec __DRIallocateExtension;
typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
@@ -143,23 +148,6 @@ struct __DRIswapControlExtensionRec {
unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
};
/**
* Used by drivers that implement the GLX_MESA_allocate_memory.
*/
#define __DRI_ALLOCATE "DRI_Allocate"
#define __DRI_ALLOCATE_VERSION 1
struct __DRIallocateExtensionRec {
__DRIextension base;
void *(*allocateMemory)(__DRIscreen *screen, GLsizei size,
GLfloat readfreq, GLfloat writefreq,
GLfloat priority);
void (*freeMemory)(__DRIscreen *screen, GLvoid *pointer);
GLuint (*memoryOffset)(__DRIscreen *screen, const GLvoid *pointer);
};
/**
* Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
*/
@@ -410,15 +398,35 @@ struct __DRIswrastLoaderExtensionRec {
* Put image to drawable
*/
void (*putImage)(__DRIdrawable *drawable, int op,
int x, int y, int width, int height, char *data,
void *loaderPrivate);
int x, int y, int width, int height,
char *data, void *loaderPrivate);
/**
* Get image from drawable
* Get image from readable
*/
void (*getImage)(__DRIdrawable *drawable,
int x, int y, int width, int height, char *data,
void *loaderPrivate);
void (*getImage)(__DRIdrawable *readable,
int x, int y, int width, int height,
char *data, void *loaderPrivate);
};
/**
* Invalidate loader extension. The presence of this extension
* indicates to the DRI driver that the loader will call invalidate in
* the __DRI2_FLUSH extension, whenever the needs to query for new
* buffers. This means that the DRI driver can drop the polling in
* glViewport().
*
* The extension doesn't provide any functionality, it's only use to
* indicate to the driver that it can use the new semantics. A DRI
* driver can use this to switch between the different semantics or
* just refuse to initialize if this extension isn't present.
*/
#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
#define __DRI_USE_INVALIDATE_VERSION 1
typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
struct __DRIuseInvalidateExtensionRec {
__DRIextension base;
};
/**
@@ -730,7 +738,11 @@ struct __DRIdri2LoaderExtensionRec {
* constructors for DRI2.
*/
#define __DRI_DRI2 "DRI_DRI2"
#define __DRI_DRI2_VERSION 1
#define __DRI_DRI2_VERSION 2
#define __DRI_API_OPENGL 0
#define __DRI_API_GLES 1
#define __DRI_API_GLES2 2
struct __DRIdri2ExtensionRec {
__DRIextension base;
@@ -749,6 +761,14 @@ struct __DRIdri2ExtensionRec {
__DRIcontext *shared,
void *loaderPrivate);
/* Since version 2 */
unsigned int (*getAPIMask)(__DRIscreen *screen);
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
};
@@ -769,12 +789,23 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
/**
* queryImage attributes
*/
#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
#define __DRI_IMAGE_ATTRIB_NAME 0x2002
typedef struct __DRIimageRec __DRIimage;
typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
__DRIextension base;
__DRIimage *(*createImageFromName)(__DRIcontext *context,
__DRIimage *(*createImageFromName)(__DRIscreen *screen,
int width, int height, int format,
int name, int pitch,
void *loaderPrivate);
@@ -784,8 +815,16 @@ struct __DRIimageExtensionRec {
void *loaderPrivate);
void (*destroyImage)(__DRIimage *image);
__DRIimage *(*createImage)(__DRIscreen *screen,
int width, int height, int format,
unsigned int use,
void *loaderPrivate);
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
};
/**
* This extension must be implemented by the loader and passed to the
* driver at screen creation time. The EGLImage entry points in the
@@ -802,8 +841,22 @@ typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
struct __DRIimageLookupExtensionRec {
__DRIextension base;
__DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image,
__DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
void *loaderPrivate);
};
/**
* This extension allows for common DRI2 options
*/
#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
#define __DRI2_CONFIG_QUERY_VERSION 1
typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
struct __DRI2configQueryExtensionRec {
__DRIextension base;
int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
};
#endif

View File

@@ -1,79 +0,0 @@
/****************************************************************************
*
* Mesa bindings for SciTech MGL
*
* Copyright (C) 1996 SciTech Software.
* All rights reserved.
*
* Filename: mglmesa.h
* Version: Revision: 1.1.1.1
*
* Language: ANSI C
* Environment: Any
*
* Description: Header file for the Mesa/OpenGL interface bindings for the
* SciTech MGL graphics library. Uses the MGL internal
* device context structures to get direct access to the
* high performance MGL rasterization functions for maximum
* performance. Utilizes the VESA VBE/AF Accelerator Functions
* via the MGL's accelerated device driver functions, as well
* as basic DirectDraw accelerated functions provided by the
* MGL.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
****************************************************************************/
#ifndef __MGLMESA_H
#define __MGLMESA_H
#include "mgraph.h"
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" { /* Use "C" linkage when in C++ mode */
#endif
#ifndef __WINDOWS__
#define GLAPIENTRY
#endif
#ifdef __WINDOWS__
bool GLAPIENTRY MGLMesaInitDLL(MGLCallbacks *cb,char *version);
#endif
void GLAPIENTRY MGLMesaChooseVisual(MGLDC *dc,MGLVisual *visual);
bool GLAPIENTRY MGLMesaSetVisual(MGLDC *dc,MGLVisual *visual);
bool GLAPIENTRY MGLMesaCreateContext(MGLDC *dc,bool forceMemDC);
void GLAPIENTRY MGLMesaDestroyContext(MGLDC *dc);
void GLAPIENTRY MGLMesaMakeCurrent(MGLDC *dc);
void GLAPIENTRY MGLMesaSwapBuffers(MGLDC *dc,bool waitVRT);
/* Palette manipulation support. The reason we provide palette manipulation
* routines is so that when rendering in double buffered modes with a
* software backbuffer, the palette for the backbuffer is kept consistent
* with the hardware front buffer.
*/
void GLAPIENTRY MGLMesaSetPaletteEntry(MGLDC *dc,int entry,uchar red,uchar green,uchar blue);
void GLAPIENTRY MGLMesaSetPalette(MGLDC *dc,palette_t *pal,int numColors,int startIndex);
void GLAPIENTRY MGLMesaRealizePalette(MGLDC *dc,int numColors,int startIndex,int waitVRT);
#ifdef __cplusplus
} /* End of "C" linkage for C++ */
#endif /* __cplusplus */
#endif /* __MGLMESA_H */

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
** Copyright (c) 2007-2010 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
@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number */
/* wglext.h last updated 2009/09/16 */
/* wglext.h last updated 2010/08/06 */
/* Current version at http://www.opengl.org/registry/ */
#define WGL_WGLEXT_VERSION 17
#define WGL_WGLEXT_VERSION 22
#ifndef WGL_ARB_buffer_region
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
@@ -175,6 +175,10 @@ extern "C" {
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
#endif
#ifndef WGL_ARB_framebuffer_sRGB
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
#endif
#ifndef WGL_ARB_create_context
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
@@ -192,6 +196,13 @@ extern "C" {
#define ERROR_INVALID_PROFILE_ARB 0x2096
#endif
#ifndef WGL_ARB_create_context_robustness
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
#endif
#ifndef WGL_EXT_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
#endif
@@ -388,12 +399,21 @@ extern "C" {
#define WGL_GPU_NUM_SPI_AMD 0x21A8
#endif
#ifndef NV_video_capture
#ifndef WGL_NV_video_capture
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef NV_copy_image
#ifndef WGL_NV_copy_image
#endif
#ifndef WGL_NV_multisample_coverage
#define WGL_COVERAGE_SAMPLES_NV 0x2042
#define WGL_COLOR_SAMPLES_NV 0x20B9
#endif
#ifndef WGL_EXT_create_context_es2_profile
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#endif
@@ -430,10 +450,10 @@ DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
@@ -448,7 +468,7 @@ typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x,
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#endif
@@ -456,9 +476,9 @@ typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#ifndef WGL_ARB_pixel_format
#define WGL_ARB_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
@@ -468,7 +488,7 @@ typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAt
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
extern HDC WINAPI wglGetCurrentReadDCARB (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
@@ -478,11 +498,11 @@ typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
@@ -494,9 +514,9 @@ typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAt
#ifndef WGL_ARB_render_texture
#define WGL_ARB_render_texture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
@@ -507,10 +527,14 @@ typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, con
#define WGL_ARB_pixel_format_float 1
#endif
#ifndef WGL_ARB_framebuffer_sRGB
#define WGL_ARB_framebuffer_sRGB 1
#endif
#ifndef WGL_ARB_create_context
#define WGL_ARB_create_context 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC, HGLRC, const int *);
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
#endif
@@ -519,13 +543,17 @@ typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShar
#define WGL_ARB_create_context_profile 1
#endif
#ifndef WGL_ARB_create_context_robustness
#define WGL_ARB_create_context_robustness 1
#endif
#ifndef WGL_EXT_display_color_table
#define WGL_EXT_display_color_table 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
@@ -544,7 +572,7 @@ typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
@@ -554,11 +582,11 @@ typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
#ifndef WGL_EXT_pbuffer
#define WGL_EXT_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
@@ -570,9 +598,9 @@ typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAt
#ifndef WGL_EXT_pixel_format
#define WGL_EXT_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
@@ -582,7 +610,7 @@ typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAt
#ifndef WGL_EXT_swap_control
#define WGL_EXT_swap_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglSwapIntervalEXT (int);
extern BOOL WINAPI wglSwapIntervalEXT (int interval);
extern int WINAPI wglGetSwapIntervalEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
@@ -596,8 +624,8 @@ typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
#ifndef WGL_NV_vertex_array_range
#define WGL_NV_vertex_array_range 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
extern void WINAPI wglFreeMemoryNV (void *);
extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
extern void WINAPI wglFreeMemoryNV (void *pointer);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
@@ -614,12 +642,12 @@ typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#ifndef WGL_OML_sync_control
#define WGL_OML_sync_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
@@ -632,8 +660,8 @@ typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT6
#ifndef WGL_I3D_digital_video_control
#define WGL_I3D_digital_video_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
@@ -642,10 +670,10 @@ typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAt
#ifndef WGL_I3D_gamma
#define WGL_I3D_gamma 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
@@ -656,18 +684,18 @@ typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const
#ifndef WGL_I3D_genlock
#define WGL_I3D_genlock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
@@ -686,10 +714,10 @@ typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *
#ifndef WGL_I3D_image_buffer
#define WGL_I3D_image_buffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
@@ -702,8 +730,8 @@ typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LP
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableFrameLockI3D (void);
extern BOOL WINAPI wglDisableFrameLockI3D (void);
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
@@ -714,10 +742,10 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
#ifndef WGL_I3D_swap_frame_usage
#define WGL_I3D_swap_frame_usage 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
@@ -736,7 +764,7 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWO
#ifndef WGL_3DL_stereo_control
#define WGL_3DL_stereo_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC, UINT);
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
#endif
@@ -752,9 +780,9 @@ typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState
#ifndef WGL_NV_present_video
#define WGL_NV_present_video 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern int WINAPI wglEnumerateVideoDevicesNV (HDC, HVIDEOOUTPUTDEVICENV *);
extern BOOL WINAPI wglBindVideoDeviceNV (HDC, unsigned int, HVIDEOOUTPUTDEVICENV, const int *);
extern BOOL WINAPI wglQueryCurrentContextNV (int, int *);
extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
@@ -764,12 +792,12 @@ typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *pi
#ifndef WGL_NV_video_output
#define WGL_NV_video_output 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetVideoDeviceNV (HDC, int, HPVIDEODEV *);
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV);
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV, HPBUFFERARB, int);
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB, int);
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB, int, unsigned long *, BOOL);
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV, unsigned long *, unsigned long *);
extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
@@ -782,12 +810,12 @@ typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsi
#ifndef WGL_NV_swap_group
#define WGL_NV_swap_group 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglJoinSwapGroupNV (HDC, GLuint);
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint, GLuint);
extern BOOL WINAPI wglQuerySwapGroupNV (HDC, GLuint *, GLuint *);
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC, GLuint *, GLuint *);
extern BOOL WINAPI wglQueryFrameCountNV (HDC, GLuint *);
extern BOOL WINAPI wglResetFrameCountNV (HDC);
extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
@@ -800,11 +828,11 @@ typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
#ifndef WGL_NV_gpu_affinity
#define WGL_NV_gpu_affinity 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnumGpusNV (UINT, HGPUNV *);
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV, UINT, PGPU_DEVICE);
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *);
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC, UINT, HGPUNV *);
extern BOOL WINAPI wglDeleteDCNV (HDC);
extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
@@ -816,15 +844,15 @@ typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
#ifndef WGL_AMD_gpu_association
#define WGL_AMD_gpu_association 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern UINT WINAPI wglGetGPUIDsAMD (UINT, UINT *);
extern INT WINAPI wglGetGPUInfoAMD (UINT, int, GLenum, UINT, void *);
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC);
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT);
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT, HGLRC, const int *);
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC);
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC);
extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
@@ -840,11 +868,11 @@ typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint
#ifndef WGL_NV_video_capture
#define WGL_NV_video_capture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT, HVIDEOINPUTDEVICENV);
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC, HVIDEOINPUTDEVICENV *);
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC, HVIDEOINPUTDEVICENV);
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC, HVIDEOINPUTDEVICENV, int, int *);
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC, HVIDEOINPUTDEVICENV);
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
@@ -856,11 +884,15 @@ typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOIN
#ifndef WGL_NV_copy_image
#define WGL_NV_copy_image 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC, GLuint, GLenum, GLint, GLint, GLint, GLint, HGLRC, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef WGL_NV_multisample_coverage
#define WGL_NV_multisample_coverage 1
#endif
#ifdef __cplusplus
}

View File

@@ -1,6 +1,15 @@
/* For compatibility with early OpenGL ES 1.0 implementations that
* included gl.h in egl.h (and apps that only included egl.h)
* See: http://www.khronos.org/registry/implementers_guide.html
/*
* Skeleton egl.h to provide compatibility for early GLES 1.0
* applications. Several early implementations included gl.h
* in egl.h leading applications to include only egl.h
*
* $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$
*/
#ifndef __legacy_egl_h_
#define __legacy_egl_h_
#include <EGL/egl.h>
#include <GLES/gl.h>
#endif /* __legacy_egl_h_ */

View File

@@ -1,45 +0,0 @@
/*
** egltypes.h for Mesa
**
** ONLY egl.h SHOULD INCLUDE THIS FILE!
**
** See comments about egltypes.h in the standard egl.h file.
*/
#include <sys/types.h>
/*
** These opaque EGL types are implemented as unsigned 32-bit integers:
*/
typedef uint32_t EGLDisplay;
typedef uint32_t EGLConfig;
typedef uint32_t EGLSurface;
typedef uint32_t EGLContext;
/* EGL_MESA_screen_surface */
typedef uint32_t EGLModeMESA;
typedef uint32_t EGLScreenMESA;
/*
** Other basic EGL types:
*/
typedef uint8_t EGLBoolean;
typedef int32_t EGLint;
typedef void * NativeDisplayType;
typedef int NativePixmapType;
typedef int NativeWindowType;
/*
** EGL and native handle null values:
*/
#define EGL_DEFAULT_DISPLAY ((NativeDisplayType) 0)
#define EGL_NO_CONTEXT ((EGLContext) 0)
#define EGL_NO_DISPLAY ((EGLDisplay) 0)
#define EGL_NO_SURFACE ((EGLSurface) 0)
/* EGL_MESA_screen_surface */
#define EGL_NO_MODE_MESA ((EGLModeMESA) 0)

View File

@@ -1,6 +1,7 @@
#ifndef __gl_h_
#define __gl_h_
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
#include <GLES/glplatform.h>
@@ -9,66 +10,38 @@ extern "C" {
#endif
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef signed char GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef float GLfloat;
typedef float GLclampf;
typedef void GLvoid;
typedef int GLfixed;
typedef int GLclampx;
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef khronos_int32_t GLclampx;
typedef int GLintptr;
typedef int GLsizeiptr;
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/*************************************************************/
/* OpenGL ES core versions */
#define GL_VERSION_ES_CM_1_0 1
#define GL_VERSION_ES_CL_1_0 1
#define GL_VERSION_ES_CM_1_1 1
#define GL_VERSION_ES_CL_1_1 1
#define GL_VERSION_ES_CM_1_0 1
#define GL_VERSION_ES_CL_1_0 1
#define GL_VERSION_ES_CM_1_1 1
#define GL_VERSION_ES_CL_1_1 1
/* ClearBufferMask */
#define GL_DEPTH_BUFFER_BIT 0x00000100
@@ -706,7 +679,7 @@ GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params);
GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);

View File

@@ -1,44 +1,16 @@
#ifndef __glext_h_
#define __glext_h_
/* $Revision: 10965 $ on $Date:: 2010-04-09 02:11:29 -0700 #$ */
#ifdef __cplusplus
extern "C" {
#endif
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
#ifndef GL_APIENTRYP
# define GL_APIENTRYP GL_APIENTRY*
@@ -76,17 +48,37 @@ extern "C" {
#define GL_ETC1_RGB8_OES 0x8D64
#endif
/* OES_draw_texture */
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_DEPTH_COMPONENT24_OES 0x81A6
#endif
/* GL_OES_depth32 */
#ifndef GL_OES_depth32
#define GL_DEPTH_COMPONENT32_OES 0x81A7
#endif
/* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture
#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
#endif
/* OES_fixed_point */
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_UNSIGNED_INT 0x1405
#endif
/* GL_OES_fixed_point */
#ifndef GL_OES_fixed_point
#define GL_FIXED_OES 0x140C
#endif
/* OES_framebuffer_object */
/* GL_OES_framebuffer_object */
#ifndef GL_OES_framebuffer_object
#define GL_NONE_OES 0
#define GL_FRAMEBUFFER_OES 0x8D40
@@ -123,14 +115,22 @@ extern "C" {
#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506
#endif
/* OES_matrix_get */
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_ACCESS_OES 0x88BB
#define GL_BUFFER_MAPPED_OES 0x88BC
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
#endif
/* GL_OES_matrix_get */
#ifndef GL_OES_matrix_get
#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
#endif
/* OES_matrix_palette */
/* GL_OES_matrix_palette */
#ifndef GL_OES_matrix_palette
#define GL_MAX_VERTEX_UNITS_OES 0x86A4
#define GL_MAX_PALETTE_MATRICES_OES 0x8842
@@ -150,6 +150,34 @@ extern "C" {
#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E
#endif
/* GL_OES_packed_depth_stencil */
#ifndef GL_OES_packed_depth_stencil
#define GL_DEPTH_STENCIL_OES 0x84F9
#define GL_UNSIGNED_INT_24_8_OES 0x84FA
#define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051
#define GL_RGBA8_OES 0x8058
#endif
/* GL_OES_stencil1 */
#ifndef GL_OES_stencil1
#define GL_STENCIL_INDEX1_OES 0x8D46
#endif
/* GL_OES_stencil4 */
#ifndef GL_OES_stencil4
#define GL_STENCIL_INDEX4_OES 0x8D47
#endif
/* GL_OES_stencil8 */
#ifndef GL_OES_stencil8
#define GL_STENCIL_INDEX8_OES 0x8D48
#endif
/* GL_OES_stencil_wrap */
#ifndef GL_OES_stencil_wrap
#define GL_INCR_WRAP_OES 0x8507
@@ -178,49 +206,14 @@ extern "C" {
#define GL_MIRRORED_REPEAT_OES 0x8370
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_DEPTH_COMPONENT24_OES 0x81A6
#endif
/* GL_OES_depth32 */
#ifndef GL_OES_depth32
#define GL_DEPTH_COMPONENT32_OES 0x81A7
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_ACCESS_OES 0x88BB
#define GL_BUFFER_MAPPED_OES 0x88BC
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051
#define GL_RGBA8_OES 0x8058
#endif
/* GL_OES_stencil1 */
#ifndef GL_OES_stencil1
#define GL_STENCIL_INDEX1_OES 0x8D46
#endif
/* GL_OES_stencil4 */
#ifndef GL_OES_stencil4
#define GL_STENCIL_INDEX4_OES 0x8D47
#endif
/* GL_OES_stencil8 */
#ifndef GL_OES_stencil8
#define GL_STENCIL_INDEX8_OES 0x8D48
#endif
/*------------------------------------------------------------------------*
* AMD extension tokens
*------------------------------------------------------------------------*/
/* GL_AMD_compressed_3DC_texture */
#ifndef GL_AMD_compressed_3DC_texture
@@ -235,12 +228,192 @@ typedef void* GLeglImageOES;
#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
#endif
/*------------------------------------------------------------------------*
* APPLE extension tokens
*------------------------------------------------------------------------*/
/* GL_APPLE_texture_2D_limited_npot */
/* No new tokens introduced by this extension. */
/*------------------------------------------------------------------------*
* EXT extension tokens
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
#ifndef GL_EXT_blend_minmax
#define GL_MIN_EXT 0x8007
#define GL_MAX_EXT 0x8008
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_COLOR_EXT 0x1800
#define GL_DEPTH_EXT 0x1801
#define GL_STENCIL_EXT 0x1802
#endif
/* GL_EXT_multi_draw_arrays */
/* No new tokens introduced by this extension. */
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_BGRA_EXT 0x80E1
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif
/* GL_EXT_texture_format_BGRA8888 */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_BGRA_EXT 0x80E1
#endif
/* GL_EXT_texture_lod_bias */
#ifndef GL_EXT_texture_lod_bias
#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
#endif
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
/* GL_IMG_read_format */
#ifndef GL_IMG_read_format
#define GL_BGRA_IMG 0x80E1
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
/* GL_IMG_texture_env_enhanced_fixed_function */
#ifndef GL_IMG_texture_env_enhanced_fixed_function
#define GL_MODULATE_COLOR_IMG 0x8C04
#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05
#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06
#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07
#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08
#define GL_ADD_BLEND_IMG 0x8C09
#define GL_DOT3_RGBA_IMG 0x86AF
#endif
/* GL_IMG_user_clip_plane */
#ifndef GL_IMG_user_clip_plane
#define GL_CLIP_PLANE0_IMG 0x3000
#define GL_CLIP_PLANE1_IMG 0x3001
#define GL_CLIP_PLANE2_IMG 0x3002
#define GL_CLIP_PLANE3_IMG 0x3003
#define GL_CLIP_PLANE4_IMG 0x3004
#define GL_CLIP_PLANE5_IMG 0x3005
#define GL_MAX_CLIP_PLANES_IMG 0x0D32
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
#define GL_MAX_SAMPLES_IMG 0x9135
#define GL_TEXTURE_SAMPLES_IMG 0x9136
#endif
/*------------------------------------------------------------------------*
* NV extension tokens
*------------------------------------------------------------------------*/
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_ALL_COMPLETED_NV 0x84F2
#define GL_FENCE_STATUS_NV 0x84F3
#define GL_FENCE_CONDITION_NV 0x84F4
#endif
/*------------------------------------------------------------------------*
* QCOM extension tokens
*------------------------------------------------------------------------*/
/* GL_QCOM_driver_control */
/* No new tokens introduced by this extension. */
/* GL_QCOM_extended_get */
#ifndef GL_QCOM_extended_get
#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
#define GL_TEXTURE_TYPE_QCOM 0x8BD7
#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
#define GL_TEXTURE_TARGET_QCOM 0x8BDA
#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
#define GL_STATE_RESTORE 0x8BDC
#endif
/* GL_QCOM_extended_get2 */
/* No new tokens introduced by this extension. */
/* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
#endif
/* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_writeonly_rendering
#define GL_WRITEONLY_RENDERING_QCOM 0x8823
#endif
/* GL_QCOM_tiled_rendering */
#ifndef GL_QCOM_tiled_rendering
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
#endif
/*------------------------------------------------------------------------*
* End of extension tokens, start of corresponding extension functions
*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*
* OES extension functions
*------------------------------------------------------------------------*/
@@ -282,6 +455,16 @@ typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
#define GL_OES_compressed_ETC1_RGB8_texture 1
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_OES_depth24 1
#endif
/* GL_OES_depth32 */
#ifndef GL_OES_depth32
#define GL_OES_depth32 1
#endif
/* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture
#define GL_OES_draw_texture 1
@@ -305,11 +488,32 @@ typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat
typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_OES_element_index_uint 1
#endif
/* GL_OES_extended_matrix_palette */
#ifndef GL_OES_extended_matrix_palette
#define GL_OES_extended_matrix_palette 1
#endif
/* GL_OES_fbo_render_mipmap */
#ifndef GL_OES_fbo_render_mipmap
#define GL_OES_fbo_render_mipmap 1
#endif
/* GL_OES_fixed_point */
#ifndef GL_OES_fixed_point
#define GL_OES_fixed_point 1
@@ -432,6 +636,19 @@ typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLe
typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_OES_mapbuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid ** params);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid ** params);
#endif
/* GL_OES_matrix_get */
#ifndef GL_OES_matrix_get
#define GL_OES_matrix_get 1
@@ -452,6 +669,11 @@ typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum t
typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
/* GL_OES_packed_depth_stencil */
#ifndef GL_OES_packed_depth_stencil
#define GL_OES_packed_depth_stencil 1
#endif
/* GL_OES_query_matrix */
#ifndef GL_OES_query_matrix
#define GL_OES_query_matrix 1
@@ -461,6 +683,11 @@ GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exp
typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]);
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_OES_rgb8_rgba8 1
#endif
/* GL_OES_single_precision */
#ifndef GL_OES_single_precision
#define GL_OES_single_precision 1
@@ -480,6 +707,21 @@ typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn
typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
#endif
/* GL_OES_stencil1 */
#ifndef GL_OES_stencil1
#define GL_OES_stencil1 1
#endif
/* GL_OES_stencil4 */
#ifndef GL_OES_stencil4
#define GL_OES_stencil4 1
#endif
/* GL_OES_stencil8 */
#ifndef GL_OES_stencil8
#define GL_OES_stencil8 1
#endif
/* GL_OES_stencil_wrap */
#ifndef GL_OES_stencil_wrap
#define GL_OES_stencil_wrap 1
@@ -520,69 +762,24 @@ typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname,
#define GL_OES_texture_mirrored_repeat 1
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_OES_vertex_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array);
GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
#endif
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_OES_depth24 1
#endif
/* GL_OES_depth32 */
#ifndef GL_OES_depth32
#define GL_OES_depth32 1
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_OES_element_index_uint 1
#endif
/* GL_OES_fbo_render_mipmap */
#ifndef GL_OES_fbo_render_mipmap
#define GL_OES_fbo_render_mipmap 1
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_OES_mapbuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params);
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_OES_rgb8_rgba8 1
#endif
/* GL_OES_stencil1 */
#ifndef GL_OES_stencil1
#define GL_OES_stencil1 1
#endif
/* GL_OES_stencil4 */
#ifndef GL_OES_stencil4
#define GL_OES_stencil4 1
#endif
/* GL_OES_stencil8 */
#ifndef GL_OES_stencil8
#define GL_OES_stencil8 1
#endif
/*------------------------------------------------------------------------*
* AMD extension functions
*------------------------------------------------------------------------*/
/* GL_AMD_compressed_3DC_texture */
#ifndef GL_AMD_compressed_3DC_texture
@@ -594,11 +791,208 @@ typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum
#define GL_AMD_compressed_ATC_texture 1
#endif
/*------------------------------------------------------------------------*
* APPLE extension functions
*------------------------------------------------------------------------*/
/* GL_APPLE_texture_2D_limited_npot */
#ifndef GL_APPLE_texture_2D_limited_npot
#define GL_APPLE_texture_2D_limited_npot 1
#endif
/*------------------------------------------------------------------------*
* EXT extension functions
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
#ifndef GL_EXT_blend_minmax
#define GL_EXT_blend_minmax 1
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_EXT_discard_framebuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
/* GL_EXT_multi_draw_arrays */
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_EXT_read_format_bgra 1
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
#endif
/* GL_EXT_texture_format_BGRA8888 */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_EXT_texture_format_BGRA8888 1
#endif
/* GL_EXT_texture_lod_bias */
#ifndef GL_EXT_texture_lod_bias
#define GL_EXT_texture_lod_bias 1
#endif
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
/* GL_IMG_read_format */
#ifndef GL_IMG_read_format
#define GL_IMG_read_format 1
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_IMG_texture_compression_pvrtc 1
#endif
/* GL_IMG_texture_env_enhanced_fixed_function */
#ifndef GL_IMG_texture_env_enhanced_fixed_function
#define GL_IMG_texture_env_enhanced_fixed_function 1
#endif
/* GL_IMG_user_clip_plane */
#ifndef GL_IMG_user_clip_plane
#define GL_IMG_user_clip_plane 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glClipPlanefIMG (GLenum, const GLfloat *);
GL_API void GL_APIENTRY glClipPlanexIMG (GLenum, const GLfixed *);
#endif
typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn);
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn);
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_IMG_multisampled_render_to_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
/*------------------------------------------------------------------------*
* NV extension functions
*------------------------------------------------------------------------*/
/* NV_fence */
#ifndef GL_NV_fence
#define GL_NV_fence 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
GL_API void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint);
GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint);
GL_API void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
GL_API void GL_APIENTRY glFinishFenceNV (GLuint);
GL_API void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
#endif
typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
/*------------------------------------------------------------------------*
* QCOM extension functions
*------------------------------------------------------------------------*/
/* GL_QCOM_driver_control */
#ifndef GL_QCOM_driver_control
#define GL_QCOM_driver_control 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
#endif
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
#endif
/* GL_QCOM_extended_get */
#ifndef GL_QCOM_extended_get
#define GL_QCOM_extended_get 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
#endif
typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
#endif
/* GL_QCOM_extended_get2 */
#ifndef GL_QCOM_extended_get2
#define GL_QCOM_extended_get2 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
#endif
typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
#endif
/* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_QCOM_perfmon_global_mode 1
#endif
/* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_writeonly_rendering
#define GL_QCOM_writeonly_rendering 1
#endif
/* GL_QCOM_tiled_rendering */
#ifndef GL_QCOM_tiled_rendering
#define GL_QCOM_tiled_rendering 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
#endif
typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -1,76 +1,30 @@
#ifndef __glplatform_h_
#define __glplatform_h_
#ifdef __cplusplus
extern "C" {
#endif
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/*-------------------------------------------------------------------------
* Definition of GL_API and GL_APIENTRY
*-----------------------------------------------------------------------*/
/* Platform-specific types and definitions for OpenGL ES 1.X gl.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
#ifdef _WIN32
# ifdef __GL_EXPORTS
# define GL_API __declspec(dllexport)
# else
# define GL_API __declspec(dllimport)
# endif
# ifdef UNDER_CE
# define GL_APIENTRY
# else
# define GL_APIENTRY __stdcall
# endif
#else
# ifdef __GL_EXPORTS
# define GL_API
# else
# define GL_API extern
# endif
# define GL_APIENTRY
#include <KHR/khrplatform.h>
#ifndef GL_API
#define GL_API KHRONOS_APICALL
#endif
#ifndef APIENTRY
# define APIENTRY GL_APIENTRY
#endif
#ifdef __cplusplus
}
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __glplatform_h_ */

View File

@@ -1,6 +1,7 @@
#ifndef __gl2_h_
#define __gl2_h_
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
#include <GLES2/gl2platform.h>
@@ -9,62 +10,33 @@ extern "C" {
#endif
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/*-------------------------------------------------------------------------
* Data type definitions
*-----------------------------------------------------------------------*/
typedef void GLvoid;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef signed char GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef float GLfloat;
typedef float GLclampf;
typedef int GLfixed;
typedef int GLclampx;
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
/* GL types for handling large vertex buffer objects */
typedef int GLintptr;
typedef int GLsizeiptr;
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/* OpenGL ES core versions */
#define GL_ES_VERSION_2_0 1
@@ -78,9 +50,6 @@ typedef int GLsizeiptr;
#define GL_FALSE 0
#define GL_TRUE 1
/* \todo check that this should be in core. */
#define GL_NONE 0
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
@@ -443,7 +412,6 @@ typedef int GLsizeiptr;
#define GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GL_PLATFORM_BINARY 0x8D63
#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
@@ -485,11 +453,12 @@ typedef int GLsizeiptr;
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_NONE 0
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 0x8CDA
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_BINDING 0x8CA6
@@ -504,18 +473,18 @@ typedef int GLsizeiptr;
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glBlendEquation( GLenum mode );
GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
@@ -523,8 +492,8 @@ GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
@@ -543,7 +512,7 @@ GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shade
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
@@ -556,10 +525,10 @@ GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const char* name);
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
@@ -567,21 +536,21 @@ GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const char* name);
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
@@ -594,25 +563,25 @@ GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
@@ -642,7 +611,7 @@ GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GL
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#ifdef __cplusplus

View File

@@ -1,44 +1,16 @@
#ifndef __gl2ext_h_
#define __gl2ext_h_
/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */
#ifdef __cplusplus
extern "C" {
#endif
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
#ifndef GL_APIENTRYP
# define GL_APIENTRYP GL_APIENTRY*
@@ -67,11 +39,6 @@ extern "C" {
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_DEPTH_COMPONENT24_OES 0x81A6
@@ -85,9 +52,25 @@ typedef void* GLeglImageOES;
/* GL_OES_depth_texture */
/* No new tokens introduced by this extension. */
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_UNSIGNED_INT 0x1405
#endif
/* GL_OES_get_program_binary */
#ifndef GL_OES_get_program_binary
#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
/* GL_READ_ONLY and GL_READ_WRITE not supported */
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_ACCESS_OES 0x88BB
#define GL_BUFFER_MAPPED_OES 0x88BC
@@ -122,8 +105,8 @@ typedef void* GLeglImageOES;
#define GL_STENCIL_INDEX4_OES 0x8D47
#endif
/* GL_OES_texture3D */
#ifndef GL_OES_texture3D
/* GL_OES_texture_3D */
#ifndef GL_OES_texture_3D
#define GL_TEXTURE_WRAP_R_OES 0x8072
#define GL_TEXTURE_3D_OES 0x806F
#define GL_TEXTURE_BINDING_3D_OES 0x806A
@@ -132,11 +115,28 @@ typedef void* GLeglImageOES;
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
#endif
/* GL_OES_texture_float */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_float_linear */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_half_float */
#ifndef GL_OES_texture_half_float
#define GL_HALF_FLOAT_OES 0x8D61
#endif
/* GL_OES_texture_half_float_linear */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_npot */
/* No new tokens introduced by this extension. */
/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
#endif
/* GL_OES_vertex_half_float */
/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
@@ -146,18 +146,6 @@ typedef void* GLeglImageOES;
#define GL_INT_10_10_10_2_OES 0x8DF7
#endif
/* GL_OES_get_program_binary */
#ifndef GL_OES_get_program_binary
#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
#endif
/* GL_AMD_program_binary_Z400 */
#ifndef GL_AMD_program_binary_Z400
#define GL_Z400_BINARY_AMD 0x8740
#endif
/*------------------------------------------------------------------------*
* AMD extension tokens
*------------------------------------------------------------------------*/
@@ -175,21 +163,211 @@ typedef void* GLeglImageOES;
#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
#endif
/* GL_AMD_performance_monitor */
#ifndef GL_AMD_performance_monitor
#define GL_COUNTER_TYPE_AMD 0x8BC0
#define GL_COUNTER_RANGE_AMD 0x8BC1
#define GL_UNSIGNED_INT64_AMD 0x8BC2
#define GL_PERCENTAGE_AMD 0x8BC3
#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
#define GL_PERFMON_RESULT_AMD 0x8BC6
#endif
/* GL_AMD_program_binary_Z400 */
#ifndef GL_AMD_program_binary_Z400
#define GL_Z400_BINARY_AMD 0x8740
#endif
/*------------------------------------------------------------------------*
* EXT extension tokens
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
#ifndef GL_EXT_blend_minmax
#define GL_MIN_EXT 0x8007
#define GL_MAX_EXT 0x8008
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_COLOR_EXT 0x1800
#define GL_DEPTH_EXT 0x1801
#define GL_STENCIL_EXT 0x1802
#endif
/* GL_EXT_multi_draw_arrays */
/* No new tokens introduced by this extension. */
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_BGRA_EXT 0x80E1
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif
/* GL_EXT_texture_format_BGRA8888 */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_BGRA_EXT 0x80E1
#endif
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
/* GL_IMG_program_binary */
#ifndef GL_IMG_program_binary
#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
#endif
/* GL_IMG_read_format */
#ifndef GL_IMG_read_format
#define GL_BGRA_IMG 0x80E1
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
#endif
/* GL_IMG_shader_binary */
#ifndef GL_IMG_shader_binary
#define GL_SGX_BINARY_IMG 0x8C0A
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
#define GL_MAX_SAMPLES_IMG 0x9135
#define GL_TEXTURE_SAMPLES_IMG 0x9136
#endif
/*------------------------------------------------------------------------*
* NV extension tokens
*------------------------------------------------------------------------*/
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_ALL_COMPLETED_NV 0x84F2
#define GL_FENCE_STATUS_NV 0x84F3
#define GL_FENCE_CONDITION_NV 0x84F4
#endif
/* GL_NV_coverage_sample */
#ifndef GL_NV_coverage_sample
#define GL_COVERAGE_COMPONENT_NV 0x8ED0
#define GL_COVERAGE_COMPONENT4_NV 0x8ED1
#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
#define GL_COVERAGE_BUFFERS_NV 0x8ED3
#define GL_COVERAGE_SAMPLES_NV 0x8ED4
#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
#endif
/* GL_NV_depth_nonlinear */
#ifndef GL_NV_depth_nonlinear
#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
#endif
/*------------------------------------------------------------------------*
* QCOM extension tokens
*------------------------------------------------------------------------*/
/* GL_QCOM_driver_control */
/* No new tokens introduced by this extension. */
/* GL_QCOM_extended_get */
#ifndef GL_QCOM_extended_get
#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
#define GL_TEXTURE_TYPE_QCOM 0x8BD7
#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
#define GL_TEXTURE_TARGET_QCOM 0x8BDA
#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
#define GL_STATE_RESTORE 0x8BDC
#endif
/* GL_QCOM_extended_get2 */
/* No new tokens introduced by this extension. */
/* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
#endif
/* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_writeonly_rendering
#define GL_WRITEONLY_RENDERING_QCOM 0x8823
#endif
/* GL_QCOM_tiled_rendering */
#ifndef GL_QCOM_tiled_rendering
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
#endif
/*------------------------------------------------------------------------*
* End of extension tokens, start of corresponding extension functions
*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*
* OES extension functions
*------------------------------------------------------------------------*/
@@ -204,17 +382,6 @@ typedef void* GLeglImageOES;
#define GL_OES_compressed_paletted_texture 1
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_OES_depth24 1
@@ -230,6 +397,17 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenu
#define GL_OES_depth_texture 1
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_OES_element_index_uint 1
@@ -245,17 +423,28 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenu
#define GL_OES_fragment_precision_high 1
#endif
/* GL_OES_get_program_binary */
#ifndef GL_OES_get_program_binary
#define GL_OES_get_program_binary 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
#endif
typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_OES_mapbuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params);
GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params);
#endif
/* GL_OES_packed_depth_stencil */
@@ -287,46 +476,61 @@ typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum
#ifndef GL_OES_texture_3D
#define GL_OES_texture_3D 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
#endif
typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
#endif
/* GL_OES_texture_float_linear */
#ifndef GL_OES_texture_float_linear
#define GL_OES_texture_float_linear 1
#endif
/* GL_OES_texture_half_float_linear */
#ifndef GL_OES_texture_half_float_linear
#define GL_OES_texture_half_float_linear 1
#endif
/* GL_OES_texture_float */
#ifndef GL_OES_texture_float
#define GL_OES_texture_float 1
#endif
/* GL_OES_texture_float_linear */
#ifndef GL_OES_texture_float_linear
#define GL_OES_texture_float_linear 1
#endif
/* GL_OES_texture_half_float */
#ifndef GL_OES_texture_half_float
#define GL_OES_texture_half_float 1
#endif
/* GL_OES_texture_half_float_linear */
#ifndef GL_OES_texture_half_float_linear
#define GL_OES_texture_half_float_linear 1
#endif
/* GL_OES_texture_npot */
#ifndef GL_OES_texture_npot
#define GL_OES_texture_npot 1
#endif
/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_OES_vertex_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
#endif
typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
#endif
/* GL_OES_vertex_half_float */
#ifndef GL_OES_vertex_half_float
#define GL_OES_vertex_half_float 1
@@ -337,17 +541,6 @@ typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum
#define GL_OES_vertex_type_10_10_10_2 1
#endif
/* GL_OES_get_program_binary */
#ifndef GL_OES_get_program_binary
#define GL_OES_get_program_binary 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
#endif
typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
#endif
/*------------------------------------------------------------------------*
* AMD extension functions
*------------------------------------------------------------------------*/
@@ -362,6 +555,35 @@ typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum bi
#define GL_AMD_compressed_ATC_texture 1
#endif
/* AMD_performance_monitor */
#ifndef GL_AMD_performance_monitor
#define GL_AMD_performance_monitor 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
#endif
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
#endif
/* GL_AMD_program_binary_Z400 */
#ifndef GL_AMD_program_binary_Z400
#define GL_AMD_program_binary_Z400 1
@@ -371,16 +593,209 @@ typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum bi
* EXT extension functions
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
#ifndef GL_EXT_blend_minmax
#define GL_EXT_blend_minmax 1
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_EXT_discard_framebuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_EXT_read_format_bgra 1
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
#endif
/* GL_EXT_texture_format_BGRA8888 */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_EXT_texture_format_BGRA8888 1
#endif
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_EXT_texture_type_2_10_10_10_REV 1
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_EXT_texture_compression_dxt1 1
#endif
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
/* GL_IMG_program_binary */
#ifndef GL_IMG_program_binary
#define GL_IMG_program_binary 1
#endif
/* GL_IMG_read_format */
#ifndef GL_IMG_read_format
#define GL_IMG_read_format 1
#endif
/* GL_IMG_shader_binary */
#ifndef GL_IMG_shader_binary
#define GL_IMG_shader_binary 1
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_IMG_texture_compression_pvrtc 1
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_IMG_multisampled_render_to_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
/*------------------------------------------------------------------------*
* NV extension functions
*------------------------------------------------------------------------*/
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_NV_fence 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint);
GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint);
GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint);
GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
#endif
typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
/* GL_NV_coverage_sample */
#ifndef GL_NV_coverage_sample
#define GL_NV_coverage_sample 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
#endif
typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
#endif
/* GL_NV_depth_nonlinear */
#ifndef GL_NV_depth_nonlinear
#define GL_NV_depth_nonlinear 1
#endif
/*------------------------------------------------------------------------*
* QCOM extension functions
*------------------------------------------------------------------------*/
/* GL_QCOM_driver_control */
#ifndef GL_QCOM_driver_control
#define GL_QCOM_driver_control 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
#endif
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
#endif
/* GL_QCOM_extended_get */
#ifndef GL_QCOM_extended_get
#define GL_QCOM_extended_get 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
#endif
typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
#endif
/* GL_QCOM_extended_get2 */
#ifndef GL_QCOM_extended_get2
#define GL_QCOM_extended_get2 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
#endif
typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
#endif
/* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_QCOM_perfmon_global_mode 1
#endif
/* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_writeonly_rendering
#define GL_QCOM_writeonly_rendering 1
#endif
/* GL_QCOM_tiled_rendering */
#ifndef GL_QCOM_tiled_rendering
#define GL_QCOM_tiled_rendering 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
#endif
typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -1,72 +1,30 @@
#ifndef __gl2platform_h_
#define __gl2platform_h_
#ifdef __cplusplus
extern "C" {
#endif
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.0 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/*-------------------------------------------------------------------------
* Definition of GL_APICALL and GL_APIENTRY
*-----------------------------------------------------------------------*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
#ifdef _WIN32
# ifdef __GL_EXPORTS
# define GL_APICALL __declspec(dllexport)
# else
# define GL_APICALL __declspec(dllimport)
# endif
# ifdef UNDER_CE
# define GL_APIENTRY
# else
# define GL_APIENTRY __stdcall
# endif
#else
# ifdef __GL_EXPORTS
# define GL_APICALL
# else
# define GL_APICALL extern
# endif
# define GL_APIENTRY
#include <KHR/khrplatform.h>
#ifndef GL_APICALL
#define GL_APICALL KHRONOS_APICALL
#endif
#ifdef __cplusplus
}
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __gl2platform_h_ */

View File

@@ -98,7 +98,11 @@
* This precedes the return type of the function in the function prototype.
*/
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
# define KHRONOS_APICALL __declspec(dllimport)
# if defined(KHRONOS_DLL_EXPORTS)
# define KHRONOS_APICALL __declspec(dllexport)
# else
# define KHRONOS_APICALL __declspec(dllimport)
# endif
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \

View File

@@ -34,28 +34,17 @@
#ifndef _VGPLATFORM_H
#define _VGPLATFORM_H
#include <KHR/khrplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
# define VG_API_CALL __attribute__((visibility("default")))
# define VGU_API_CALL __attribute__((visibility("default")))
#endif
#ifndef VG_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VG_API_CALL
#else
# if defined(_WIN32) || defined(__VC32__) /* Win32 */
# if defined (OPENVG_DLL_EXPORTS)
# define VG_API_CALL __declspec(dllexport)
# else
# define VG_API_CALL __declspec(dllimport)
# endif
# else
# define VG_API_CALL extern
# endif /* defined(_WIN32) ||... */
# define VG_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VG_API_CALL */
@@ -63,15 +52,7 @@ extern "C" {
#if defined(OPENVG_STATIC_LIBRARY)
# define VGU_API_CALL
#else
# if defined(_WIN32) || defined(__VC32__) /* Win32 */
# if defined (OPENVG_DLL_EXPORTS)
# define VGU_API_CALL __declspec(dllexport)
# else
# define VGU_API_CALL __declspec(dllimport)
# endif
# else
# define VGU_API_CALL extern
# endif /* defined(_WIN32) ||... */
# define VGU_API_CALL KHRONOS_APICALL
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VGU_API_CALL */

305
include/c99/inttypes.h Normal file
View File

@@ -0,0 +1,305 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_INTTYPES_H_ // [
#define _MSC_INTTYPES_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "stdint.h"
// 7.8 Format conversion of integer types
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
// The fprintf macros for signed integers are:
#define PRId8 "d"
#define PRIi8 "i"
#define PRIdLEAST8 "d"
#define PRIiLEAST8 "i"
#define PRIdFAST8 "d"
#define PRIiFAST8 "i"
#define PRId16 "hd"
#define PRIi16 "hi"
#define PRIdLEAST16 "hd"
#define PRIiLEAST16 "hi"
#define PRIdFAST16 "hd"
#define PRIiFAST16 "hi"
#define PRId32 "I32d"
#define PRIi32 "I32i"
#define PRIdLEAST32 "I32d"
#define PRIiLEAST32 "I32i"
#define PRIdFAST32 "I32d"
#define PRIiFAST32 "I32i"
#define PRId64 "I64d"
#define PRIi64 "I64i"
#define PRIdLEAST64 "I64d"
#define PRIiLEAST64 "I64i"
#define PRIdFAST64 "I64d"
#define PRIiFAST64 "I64i"
#define PRIdMAX "I64d"
#define PRIiMAX "I64i"
#define PRIdPTR "Id"
#define PRIiPTR "Ii"
// The fprintf macros for unsigned integers are:
#define PRIo8 "o"
#define PRIu8 "u"
#define PRIx8 "x"
#define PRIX8 "X"
#define PRIoLEAST8 "o"
#define PRIuLEAST8 "u"
#define PRIxLEAST8 "x"
#define PRIXLEAST8 "X"
#define PRIoFAST8 "o"
#define PRIuFAST8 "u"
#define PRIxFAST8 "x"
#define PRIXFAST8 "X"
#define PRIo16 "ho"
#define PRIu16 "hu"
#define PRIx16 "hx"
#define PRIX16 "hX"
#define PRIoLEAST16 "ho"
#define PRIuLEAST16 "hu"
#define PRIxLEAST16 "hx"
#define PRIXLEAST16 "hX"
#define PRIoFAST16 "ho"
#define PRIuFAST16 "hu"
#define PRIxFAST16 "hx"
#define PRIXFAST16 "hX"
#define PRIo32 "I32o"
#define PRIu32 "I32u"
#define PRIx32 "I32x"
#define PRIX32 "I32X"
#define PRIoLEAST32 "I32o"
#define PRIuLEAST32 "I32u"
#define PRIxLEAST32 "I32x"
#define PRIXLEAST32 "I32X"
#define PRIoFAST32 "I32o"
#define PRIuFAST32 "I32u"
#define PRIxFAST32 "I32x"
#define PRIXFAST32 "I32X"
#define PRIo64 "I64o"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
#define PRIX64 "I64X"
#define PRIoLEAST64 "I64o"
#define PRIuLEAST64 "I64u"
#define PRIxLEAST64 "I64x"
#define PRIXLEAST64 "I64X"
#define PRIoFAST64 "I64o"
#define PRIuFAST64 "I64u"
#define PRIxFAST64 "I64x"
#define PRIXFAST64 "I64X"
#define PRIoMAX "I64o"
#define PRIuMAX "I64u"
#define PRIxMAX "I64x"
#define PRIXMAX "I64X"
#define PRIoPTR "Io"
#define PRIuPTR "Iu"
#define PRIxPTR "Ix"
#define PRIXPTR "IX"
// The fscanf macros for signed integers are:
#define SCNd8 "d"
#define SCNi8 "i"
#define SCNdLEAST8 "d"
#define SCNiLEAST8 "i"
#define SCNdFAST8 "d"
#define SCNiFAST8 "i"
#define SCNd16 "hd"
#define SCNi16 "hi"
#define SCNdLEAST16 "hd"
#define SCNiLEAST16 "hi"
#define SCNdFAST16 "hd"
#define SCNiFAST16 "hi"
#define SCNd32 "ld"
#define SCNi32 "li"
#define SCNdLEAST32 "ld"
#define SCNiLEAST32 "li"
#define SCNdFAST32 "ld"
#define SCNiFAST32 "li"
#define SCNd64 "I64d"
#define SCNi64 "I64i"
#define SCNdLEAST64 "I64d"
#define SCNiLEAST64 "I64i"
#define SCNdFAST64 "I64d"
#define SCNiFAST64 "I64i"
#define SCNdMAX "I64d"
#define SCNiMAX "I64i"
#ifdef _WIN64 // [
# define SCNdPTR "I64d"
# define SCNiPTR "I64i"
#else // _WIN64 ][
# define SCNdPTR "ld"
# define SCNiPTR "li"
#endif // _WIN64 ]
// The fscanf macros for unsigned integers are:
#define SCNo8 "o"
#define SCNu8 "u"
#define SCNx8 "x"
#define SCNX8 "X"
#define SCNoLEAST8 "o"
#define SCNuLEAST8 "u"
#define SCNxLEAST8 "x"
#define SCNXLEAST8 "X"
#define SCNoFAST8 "o"
#define SCNuFAST8 "u"
#define SCNxFAST8 "x"
#define SCNXFAST8 "X"
#define SCNo16 "ho"
#define SCNu16 "hu"
#define SCNx16 "hx"
#define SCNX16 "hX"
#define SCNoLEAST16 "ho"
#define SCNuLEAST16 "hu"
#define SCNxLEAST16 "hx"
#define SCNXLEAST16 "hX"
#define SCNoFAST16 "ho"
#define SCNuFAST16 "hu"
#define SCNxFAST16 "hx"
#define SCNXFAST16 "hX"
#define SCNo32 "lo"
#define SCNu32 "lu"
#define SCNx32 "lx"
#define SCNX32 "lX"
#define SCNoLEAST32 "lo"
#define SCNuLEAST32 "lu"
#define SCNxLEAST32 "lx"
#define SCNXLEAST32 "lX"
#define SCNoFAST32 "lo"
#define SCNuFAST32 "lu"
#define SCNxFAST32 "lx"
#define SCNXFAST32 "lX"
#define SCNo64 "I64o"
#define SCNu64 "I64u"
#define SCNx64 "I64x"
#define SCNX64 "I64X"
#define SCNoLEAST64 "I64o"
#define SCNuLEAST64 "I64u"
#define SCNxLEAST64 "I64x"
#define SCNXLEAST64 "I64X"
#define SCNoFAST64 "I64o"
#define SCNuFAST64 "I64u"
#define SCNxFAST64 "I64x"
#define SCNXFAST64 "I64X"
#define SCNoMAX "I64o"
#define SCNuMAX "I64u"
#define SCNxMAX "I64x"
#define SCNXMAX "I64X"
#ifdef _WIN64 // [
# define SCNoPTR "I64o"
# define SCNuPTR "I64u"
# define SCNxPTR "I64x"
# define SCNXPTR "I64X"
#else // _WIN64 ][
# define SCNoPTR "lo"
# define SCNuPTR "lu"
# define SCNxPTR "lx"
# define SCNXPTR "lX"
#endif // _WIN64 ]
#endif // __STDC_FORMAT_MACROS ]
// 7.8.2 Functions for greatest-width integer types
// 7.8.2.1 The imaxabs function
#define imaxabs _abs64
// 7.8.2.2 The imaxdiv function
// This is modified version of div() function from Microsoft's div.c found
// in %MSVC.NET%\crt\src\div.c
#ifdef STATIC_IMAXDIV // [
static
#else // STATIC_IMAXDIV ][
_inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
imaxdiv_t result;
result.quot = numer / denom;
result.rem = numer % denom;
if (numer < 0 && result.rem > 0) {
// did division wrong; must fix up
++result.quot;
result.rem -= denom;
}
return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
#define strtoimax _strtoi64
#define strtoumax _strtoui64
// 7.8.2.4 The wcstoimax and wcstoumax functions
#define wcstoimax _wcstoi64
#define wcstoumax _wcstoui64
#endif // _MSC_INTTYPES_H_ ]

View File

@@ -1,119 +1,247 @@
/**************************************************************************
*
* Copyright 2007-2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* THE 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
* THE COPYRIGHT HOLDERS, AUTHORS 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.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
**************************************************************************/
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006-2008 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
/*
* stdint.h --
*
* Portable subset of C99's stdint.h.
*
* At the moment it only supports MSVC, given all other mainstream compilers
* already support C99. If this is necessary for other compilers then it
* might be worth to replace this with
* http://www.azillionmonkeys.com/qed/pstdint.h.
*/
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _STDINT_H_
#define _STDINT_H_
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#ifndef INT8_MAX
#define INT8_MAX 127
#endif
#ifndef INT8_MIN
#define INT8_MIN -128
#endif
#ifndef UINT8_MAX
#define UINT8_MAX 255
#endif
#ifndef INT16_MAX
#define INT16_MAX 32767
#endif
#ifndef INT16_MIN
#define INT16_MIN -32768
#endif
#ifndef UINT16_MAX
#define UINT16_MAX 65535
#endif
#ifndef INT32_MAX
#define INT32_MAX 2147483647
#endif
#ifndef INT32_MIN
#define INT32_MIN -2147483648
#endif
#ifndef UINT32_MAX
#define UINT32_MAX 4294967295U
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef INT8_C
#define INT8_C(__val) __val
#include <limits.h>
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#ifdef __cplusplus
extern "C" {
#endif
#ifndef UINT8_C
#define UINT8_C(__val) __val
# include <wchar.h>
#ifdef __cplusplus
}
#endif
#ifndef INT16_C
#define INT16_C(__val) __val
#endif
#ifndef UINT16_C
#define UINT16_C(__val) __val
#endif
#ifndef INT32_C
#define INT32_C(__val) __val
#endif
#ifndef UINT32_C
#define UINT32_C(__val) __val##U
// Define _W64 macros to mark types changing their size, like intptr_t.
#ifndef _W64
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
# endif
#endif
#if defined(_MSC_VER)
// 7.18.1 Integer types
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
#ifndef __eglplatform_h_
typedef __int32 int32_t;
#endif
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.1 Exact-width integer types
#if defined(_WIN64)
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
// realize that, e.g. char has the same size as __int8
// so we give up on __intX for them.
#if (_MSC_VER < 1300)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef __int32 intptr_t;
typedef unsigned __int32 uintptr_t;
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define INT64_C(__val) __val##i64
#define UINT64_C(__val) __val##ui64
#else
#error "Unsupported compiler"
#endif
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
#endif /* _STDINT_H_ */
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef _W64 signed int intptr_t;
typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_STDINT_H_ ]

1
progs/.gitignore vendored
View File

@@ -1 +0,0 @@
*.dSYM

View File

@@ -1,32 +0,0 @@
# progs/Makefile
TOP = ..
include $(TOP)/configs/current
SUBDIRS = $(PROGRAM_DIRS)
default: message subdirs
message:
@echo "Making programs for" $(CONFIG_NAME)
subdirs:
@list='$(SUBDIRS)'; for dir in $$list ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
# Dummy install target
install:
clean:
@list='$(SUBDIRS)'; for dir in $$list tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done

View File

@@ -1,59 +0,0 @@
Import('*')
if env['platform'] == 'embedded':
Return()
SConscript([
'util/SConscript',
])
Import('util')
progs_env = env.Clone()
if progs_env['platform'] == 'windows':
progs_env.Append(CPPDEFINES = ['NOMINMAX'])
progs_env.Prepend(LIBS = [
'winmm',
'kernel32',
'user32',
'gdi32',
])
# OpenGL
if progs_env['platform'] == 'windows':
progs_env.Prepend(LIBS = ['glu32', 'opengl32'])
else:
progs_env.Prepend(LIBS = ['GLU', 'GL'])
# Glut
progs_env.Prepend(LIBPATH = [glut.dir])
progs_env.Prepend(LIBS = [glut.name])
# GLEW
progs_env.Prepend(LIBS = [glew])
progs_env.Prepend(CPPPATH = [
'#progs/util',
])
progs_env.Prepend(LIBS = [
util,
])
Export('progs_env')
SConscript([
'demos/SConscript',
'glsl/SConscript',
'redbook/SConscript',
'samples/SConscript',
'tests/SConscript',
'trivial/SConscript',
'vp/SConscript',
'vpglsl/SConscript',
'fp/SConscript',
'wgl/SConscript',
'perf/SConscript',
'gallium/unit/SConscript',
])

View File

@@ -1,3 +0,0 @@
demo
GLInfo
sample

View File

@@ -1,151 +0,0 @@
// Small app to display GL infos
#include <stdio.h>
#include <string.h>
#include <Application.h>
#include <Window.h>
#include <OutlineListView.h>
#include <ScrollView.h>
#include <GLView.h>
#include <String.h>
#include <GL/gl.h>
#include <GL/glu.h>
#define GLUT_INFO 1
#ifdef GLUT_INFO
#include <GL/glut.h>
#endif
class GLInfoWindow : public BWindow
{
public:
GLInfoWindow(BRect frame);
virtual bool QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return true; }
private:
BGLView *gl;
BOutlineListView *list;
BScrollView *scroller;
};
class GLInfoApp : public BApplication
{
public:
GLInfoApp();
private:
GLInfoWindow *window;
};
GLInfoApp::GLInfoApp()
: BApplication("application/x-vnd.OBOS-GLInfo")
{
window = new GLInfoWindow(BRect(50, 50, 350, 350));
}
GLInfoWindow::GLInfoWindow(BRect frame)
: BWindow(frame, "OpenGL Info", B_TITLED_WINDOW, 0)
{
BRect r = Bounds();
char *s;
BString l;
// Add a outline list view
r.right -= B_V_SCROLL_BAR_WIDTH;
list = new BOutlineListView(r, "GLInfoList", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES);
scroller = new BScrollView("GLInfoListScroller", list, B_FOLLOW_ALL_SIDES,
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
gl = new BGLView(r, "opengl", B_FOLLOW_ALL_SIDES, 0, BGL_RGB | BGL_DOUBLE);
gl->Hide();
AddChild(gl);
AddChild(scroller);
Show();
LockLooper();
// gl->LockGL();
list->AddItem(new BStringItem("OpenGL", 0));
s = (char *) glGetString(GL_VENDOR);
if (s) {
l = ""; l << "Vendor Name: " << s;
list->AddItem(new BStringItem(l.String(), 1));
}
s = (char *) glGetString(GL_VERSION);
if (s) {
l = ""; l << "Version: " << s;
list->AddItem(new BStringItem(l.String(), 1));
}
s = (char *) glGetString(GL_RENDERER);
if (s) {
l = ""; l << "Renderer Name: " << s;
list->AddItem(new BStringItem(l.String(), 1));
}
s = (char *) glGetString(GL_EXTENSIONS);
if (s) {
list->AddItem(new BStringItem("Extensions", 1));
while (*s) {
char extname[255];
int n = strcspn(s, " ");
strncpy(extname, s, n);
extname[n] = 0;
list->AddItem(new BStringItem(extname, 2));
if (! s[n])
break;
s += (n + 1); // next !
}
}
list->AddItem(new BStringItem("GLU", 0));
s = (char *) gluGetString(GLU_VERSION);
if (s) {
l = ""; l << "Version: " << s;
list->AddItem(new BStringItem(l.String(), 1));
}
s = (char *) gluGetString(GLU_EXTENSIONS);
if (s) {
list->AddItem(new BStringItem("Extensions", 1));
while (*s) {
char extname[255];
int n = strcspn(s, " ");
strncpy(extname, s, n);
extname[n] = 0;
list->AddItem(new BStringItem(extname, 2));
if (! s[n])
break;
s += (n + 1); // next !
}
}
#ifdef GLUT_INFO
list->AddItem(new BStringItem("GLUT", 0));
l = "API version: "; l << GLUT_API_VERSION;
list->AddItem(new BStringItem(l.String(), 1));
#endif
// gl->UnlockGL();
UnlockLooper();
}
int main(int argc, char *argv[])
{
GLInfoApp *app = new GLInfoApp;
app->Run();
delete app;
return 0;
}

View File

@@ -1,35 +0,0 @@
# progs/beos/Makefile
TOP = ../..
include $(TOP)/configs/current
# Makefile for BeOS demos
# Written by Brian Paul
# This file is in the public domain.
#
# Modified by Philippe Houdoin
LDFLAGS += -soname=_APP_
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
INCLUDES = -I. -I- -I../../include
default: demo sample GLInfo
clean:
-rm -f demo sample GLInfo
-rm -f *.o
demo: demo.o
$(LD) demo.o $(LDFLAGS) $(LIBS) -o $@
sample: sample.o
$(LD) sample.o $(LDFLAGS) $(LIBS) -o $@
GTLInfo: GLInfo.o
$(LD) GLInfo.o $(INCLUDES) $(LDFLAGS) $(LIBS) -o $@
.cpp.o:
$(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@

View File

@@ -1,146 +0,0 @@
// Simple BeOS GLView demo
// Written by Brian Paul
// Changes by Philippe Houdoin
// This file is in the public domain.
#include <stdio.h>
#include <Application.h>
#include <Window.h>
#include <GLView.h>
class MyGL : public BGLView
{
public:
MyGL(BRect rect, char *name, ulong options);
virtual void AttachedToWindow();
virtual void Pulse();
virtual void FrameResized(float w, float h);
private:
void Render();
void Reshape(float w, float h);
float mAngle;
};
class MyWindow : public BWindow
{
public:
MyWindow(BRect frame);
virtual bool QuitRequested();
};
MyWindow::MyWindow(BRect frame)
: BWindow(frame, "demo", B_TITLED_WINDOW, B_NOT_ZOOMABLE)
{
// Make OpenGL view and put it in the window
BRect r = Bounds();
r.InsetBy(5, 5);
MyGL *gl = new MyGL(r, "GL", BGL_RGB | BGL_DOUBLE);
AddChild(gl);
SetPulseRate(1000000 / 30);
}
bool MyWindow::QuitRequested()
{
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}
MyGL::MyGL(BRect rect, char *name, ulong options)
: BGLView(rect, name, B_FOLLOW_ALL_SIDES, B_PULSE_NEEDED, options)
{
mAngle = 0.0;
}
void MyGL::AttachedToWindow()
{
BGLView::AttachedToWindow();
LockGL();
glClearColor(0.7, 0.7, 0, 0);
Reshape(Bounds().Width(), Bounds().Height());
UnlockGL();
}
void MyGL::FrameResized(float w, float h)
{
BGLView::FrameResized(w, h);
LockGL();
Reshape(w, h);
UnlockGL();
Render();
}
void MyGL::Pulse()
{
mAngle += 1.0;
Render();
}
void MyGL::Render()
{
LockGL();
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glRotated(mAngle, 0, 0, 1);
glColor3f(0, 0, 1);
glBegin(GL_POLYGON);
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glPopMatrix();
SwapBuffers();
UnlockGL();
}
void MyGL::Reshape(float w, float h)
{
glViewport(0, 0, (int) (w + 1), (int) (h + 1));
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1, 1, -1, 1, 10, 30);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, -18);
}
int main(int argc, char *argv[])
{
BApplication *app = new BApplication("application/demo");
// make top-level window
MyWindow *win = new MyWindow(BRect(100, 100, 500, 500));
win->Show();
app->Run();
delete app;
return 0;
}

View File

@@ -1,225 +0,0 @@
// sample BGLView app from the Be Book
#include <stdio.h>
#include <Application.h>
#include <Window.h>
#include <GLView.h>
class SampleGLView : public BGLView
{
public:
SampleGLView(BRect frame, uint32 type);
virtual void AttachedToWindow(void);
virtual void FrameResized(float newWidth, float newHeight);
virtual void ErrorCallback(GLenum which);
void Render(void);
private:
void gInit(void);
void gDraw(void);
void gReshape(int width, int height);
float width;
float height;
};
class SampleGLWindow : public BWindow
{
public:
SampleGLWindow(BRect frame, uint32 type);
virtual bool QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return true; }
private:
SampleGLView *theView;
};
class SampleGLApp : public BApplication
{
public:
SampleGLApp();
private:
SampleGLWindow *theWindow;
};
SampleGLApp::SampleGLApp()
: BApplication("application/x-vnd.sample")
{
BRect windowRect;
uint32 type = BGL_RGB|BGL_DOUBLE;
windowRect.Set(50, 50, 350, 350);
theWindow = new SampleGLWindow(windowRect, type);
}
SampleGLWindow::SampleGLWindow(BRect frame, uint32 type)
: BWindow(frame, "OpenGL Test", B_TITLED_WINDOW, 0)
{
theView = new SampleGLView(Bounds(), type);
AddChild(theView);
Show();
theView->Render();
}
SampleGLView::SampleGLView(BRect frame, uint32 type)
: BGLView(frame, "SampleGLView", B_FOLLOW_ALL_SIDES, 0, type)
{
width = frame.right-frame.left;
height = frame.bottom-frame.top;
}
void SampleGLView::AttachedToWindow(void)
{
LockGL();
BGLView::AttachedToWindow();
gInit();
gReshape(width, height);
UnlockGL();
}
void SampleGLView::FrameResized(float newWidth, float newHeight)
{
BGLView::FrameResized(newWidth, newHeight);
LockGL();
width = newWidth;
height = newHeight;
gReshape(width,height);
UnlockGL();
Render();
}
void SampleGLView::ErrorCallback(GLenum whichError)
{
// fprintf(stderr, "Unexpected error occured (%d):\\n", whichError);
// fprintf(stderr, " %s\\n", gluErrorString(whichError));
}
// globals
GLenum use_stipple_mode; // GL_TRUE to use dashed lines
GLenum use_smooth_mode; // GL_TRUE to use anti-aliased lines
GLint linesize; // Line width
GLint pointsize; // Point diameter
float pntA[3] = {
-160.0, 0.0, 0.0
};
float pntB[3] = {
-130.0, 0.0, 0.0
};
void SampleGLView::gInit(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glLineStipple(1, 0xF0E0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
use_stipple_mode = GL_FALSE;
use_smooth_mode = GL_TRUE;
linesize = 2;
pointsize = 6;
}
void SampleGLView::gDraw(void)
{
GLint i;
glClear(GL_COLOR_BUFFER_BIT);
glLineWidth(linesize);
/*
if (use_stipple_mode) {
glEnable(GL_LINE_STIPPLE);
} else {
glDisable(GL_LINE_STIPPLE);
}
*/
glDisable(GL_POINT_SMOOTH);
glPushMatrix();
glPointSize(pointsize); // Set size for point
for (i = 0; i < 360; i += 5) {
glRotatef(5.0, 0,0,1); // Rotate right 5 degrees
if (use_smooth_mode) {
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
} else {
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
}
glColor3f(1.0, 1.0, 0.0); // Set color for line
glBegin(GL_LINE_STRIP); // And create the line
glVertex3fv(pntA);
glVertex3fv(pntB);
glEnd();
glDisable(GL_POINT_SMOOTH);
glDisable(GL_BLEND);
glColor3f(0.0, 1.0, 0.0); // Set color for point
glBegin(GL_POINTS);
glVertex3fv(pntA); // Draw point at one end
glVertex3fv(pntB); // Draw point at other end
glEnd();
}
glPopMatrix(); // Done with matrix
}
void SampleGLView::gReshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-175, 175, -175, 175, -1, 1);
glMatrixMode(GL_MODELVIEW);
}
void SampleGLView::Render(void)
{
LockGL();
gDraw();
SwapBuffers();
UnlockGL();
}
int main(int argc, char *argv[])
{
SampleGLApp *app = new SampleGLApp;
app->Run();
delete app;
return 0;
}

View File

@@ -1,68 +0,0 @@
arbfplight
arbfslight
arbocclude
arbocclude2
bounce
clearspd
copypix
cubemap
dinoshade
dissolve
drawpix
engine
extfuncs.h
fbo_firecube
fbotexture
fire
fogcoord
fplight
fslight
gamma
gearbox
gears
geartrain
glinfo
gloss
glslnoise
gltestperf
glutfx
ipers
isosurf
lodbias
morph3d
multiarb
paltex
pointblast
projtex
rain
ray
readpix
readtex.c
readtex.h
reflect
renormal
shadowtex
showbuffer.c
showbuffer.h
singlebuffer
spectex
spriteblast
stex3d
streaming_rect
teapot
terrain
tessdemo
texcyl
texdown
texenv
texobj
textures
trackball.c
trackball.h
trispd
tunnel
tunnel2
vao_demo
Windows
winpos
*.rgb

View File

@@ -1,173 +0,0 @@
# progs/demos/Makefile
TOP = ../..
include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
$(APP_LIB_DEPS)
PROGS = \
arbfplight \
arbfslight \
arbocclude \
arbocclude2 \
bounce \
clearspd \
copypix \
cubemap \
dinoshade \
dissolve \
drawpix \
engine \
fbo_firecube \
fbotexture \
fire \
fogcoord \
fplight \
fslight \
gamma \
gearbox \
gears \
geartrain \
glinfo \
gloss \
gltestperf \
isosurf \
ipers \
lodbias \
morph3d \
multiarb \
paltex \
pointblast \
projtex \
rain \
ray \
readpix \
reflect \
renormal \
shadowtex \
singlebuffer \
spectex \
spriteblast \
stex3d \
teapot \
terrain \
tessdemo \
texcyl \
texenv \
textures \
trispd \
tunnel \
tunnel2 \
vao_demo \
winpos
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.SUFFIXES: .cxx
# make executable from .c file:
.c: $(LIB_DEP) readtex.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(LIBS) -o $@
##### TARGETS #####
default: $(PROGS)
$(PROGS): readtex.o
readtex.c: $(TOP)/progs/util/readtex.c
cp $< .
readtex.h: $(TOP)/progs/util/readtex.h
cp $< .
readtex.o: readtex.c readtex.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
showbuffer.c: $(TOP)/progs/util/showbuffer.c
cp $< .
showbuffer.h: $(TOP)/progs/util/showbuffer.h
cp $< .
showbuffer.o: showbuffer.c showbuffer.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c
trackball.c: $(TOP)/progs/util/trackball.c
cp $< .
trackball.h: $(TOP)/progs/util/trackball.h
cp $< .
trackball.o: trackball.c trackball.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) trackball.c
extfuncs.h: $(TOP)/progs/util/extfuncs.h
cp $< .
reflect: reflect.o showbuffer.o readtex.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
reflect.o: reflect.c showbuffer.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
gloss: gloss.o trackball.o readtex.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
gloss.o: gloss.c trackball.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
engine: engine.o trackball.o readtex.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
engine.o: engine.c trackball.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) engine.c
fbotexture: fbotexture.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) fbotexture.o $(LIBS) -o $@
fbotexture.o: fbotexture.c extfuncs.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fbotexture.c
fslight: fslight.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
fslight.o: fslight.c extfuncs.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
rain: particles.o rain.o readtex.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
rain.o: rain.cxx readtex.h
$(CXX) -c -I$(INCDIR) $(CXXFLAGS) $<
particles.o: particles.cxx
$(CXX) -c -I$(INCDIR) $(CXXFLAGS) $<
viewdds: viewdds.c
$(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(LIBS) -L. -lgltc -o $@
clean:
-rm -f $(PROGS)
-rm -f *.o *~
-rm -f readtex.[ch] showbuffer.[ch]

View File

@@ -1,87 +0,0 @@
# Mesa 3-D graphics library
# Version: 3.3
# Copyright (C) 1995-2000 Brian Paul
# Makefile for demo programs for cygnus
# Stephane Rehel (rehel@worldnet.fr) April 13 1997
##### MACROS #####
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lMesaGLU -lMesaGL -lm $(WLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
PROGS = bounce \
clearspd \
cubemap \
drawpix \
fire \
gamma \
gears \
geartrain \
glinfo \
gloss \
gltestperf \
glutfx \
isosurf \
ipers \
lodbias \
morph3d \
multiarb \
occlude \
osdemo \
paltex \
pixeltex \
pointblast \
ray \
readpix \
reflect \
renormal \
spectex \
stex3d \
teapot \
terrain \
tessdemo \
texcyl \
texdown \
texenv \
texobj \
trispd \
tunnel \
tunnel2 \
winpos
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c: $(LIB_DEP)
$(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@
##### TARGETS #####
default:
@echo "Specify a target configuration"
clean:
-rm *.o *~
realclean:
-rm $(PROGS:=.exe)
-rm *.o *~
targets: $(PROGS)
include ../Make-config

View File

@@ -1,131 +0,0 @@
# Mesa 3-D graphics library
# Version: 6.5
# Copyright (C) 1995-2006 Brian Paul
# Makefile for GLUT-based demo programs for Windows
# Build the Mesa and GLUT libraries by using the Visual Studio
# Workspaces in this distribution before running this Makefile.
# Invocation: nmake -f Makefile.win
NODEBUG=1
!include <win32.mak>
##### MACROS #####
TOP = ..\..
INCDIR = ..\..\include
LIBDIR = ..\..\lib
LIBS = GLUT32.LIB OPENGL32.LIB
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
readtex.h readtex.c showbuffer.h showbuffer.c \
extfuncs.h trackball.h trackball.c \
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
clearspd.exe cubemap.exe drawpix.exe engine.exe \
fire.exe fogcoord.exe \
fplight.exe fslight.exe gamma.exe gearbox.exe \
gears.exe geartrain.exe gloss.exe \
glinfo.exe glslnoise.exe \
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
morph3d.exe multiarb.exe occlude.exe paltex.exe pointblast.exe \
ray.exe readpix.exe reflect.exe renormal.exe \
shadowtex.exe singlebuffer.exe spectex.exe spriteblast.exe \
stex3d.exe teapot.exe terrain.exe tessdemo.exe texcyl.exe \
texdown.exe texenv.exe texobj.exe trispd.exe tunnel.exe tunnel2.exe \
winpos.exe
arbfplight.exe: arbfplight.obj
arbfslight.exe: arbfslight.obj
arbocclude.exe: arbocclude.obj
bounce.exe: bounce.obj
clearspd.exe: clearspd.obj
cubemap.exe: cubemap.obj readtex.obj
drawpix.exe: drawpix.obj readtex.obj
engine.exe: engine.obj readtex.obj trackball.obj
fire.exe: fire.obj readtex.obj
fogcoord.exe: fogcoord.obj readtex.obj
fplight.exe: fplight.obj
fslight.exe: fslight.obj
gamma.exe: gamma.obj
gearbox.exe: gearbox.obj
gears.exe: gears.obj
geartrain.exe: geartrain.obj
gloss.exe: gloss.obj readtex.obj trackball.obj
glinfo.exe: glinfo.obj
glslnoise.exe: glslnoise.obj
gltestperf.exe: gltestperf.obj
glutfx.exe: glutfx.obj
ipers.exe: ipers.obj readtex.obj
isosurf.exe: isosurf.obj readtex.obj
lodbias.exe: lodbias.obj readtex.obj
morph3d.exe: morph3d.obj
multiarb.exe: multiarb.obj readtex.obj
occlude.exe: occlude.obj
paltex.exe: paltex.obj
pointblast.exe: pointblast.obj
ray.exe: ray.obj
readpix.exe: readpix.obj readtex.obj
reflect.exe: reflect.obj readtex.obj showbuffer.obj
renormal.exe: renormal.obj
shadowtex.exe: shadowtex.obj showbuffer.obj
singlebuffer.exe: singlebuffer.obj
spectex.exe: spectex.obj
spriteblast.exe: spriteblast.obj
stex3d.exe: stex3d.obj
teapot.exe: teapot.obj readtex.obj
terrain.exe: terrain.obj
tessdemo.exe: tessdemo.obj
texcyl.exe: texcyl.obj readtex.obj
texdown.exe: texdown.obj
texenv.exe: texenv.obj
texobj.exe: texobj.obj
trispd.exe: trispd.obj
tunnel.exe: tunnel.obj readtex.obj
tunnel2.exe: tunnel2.obj readtex.obj
winpos.exe: winpos.obj readtex.obj
OPENGL32.DLL: $(LIBDIR)\OPENGL32.DLL
copy $? .
GLU32.DLL: $(LIBDIR)\GLU32.DLL
copy $? .
GLUT32.DLL: $(LIBDIR)\GLUT32.DLL
copy $? .
readtex.c: $(TOP)\progs\util\readtex.c
copy $** .
readtex.h: $(TOP)\progs\util\readtex.h
copy $** .
showbuffer.c: $(TOP)\progs\util\showbuffer.c
copy $** .
showbuffer.h: $(TOP)\progs\util\showbuffer.h
copy $** .
trackball.c: $(TOP)\progs\util\trackball.c
copy $** .
trackball.h: $(TOP)\progs\util\trackball.h
copy $** .
extfuncs.h: $(TOP)\progs\util\extfuncs.h
copy $** .
.obj.exe:
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
.c.obj:
$(cc) $(cdebug) $(cflags) $(cvars) -D_USE_MATH_DEFINES /I$(INCDIR) $*.c
clean::
del *.obj *.exe readtex.* showbuffer.* trackball.*
clobber::

View File

@@ -1,230 +0,0 @@
INTRODUCTION
------------
This directory is usually included in the Mesa demos distribution or
in the GLUT distribution.
I have written the demos included in this directory mainly for showing
the capabilities of the Mesa library when using the Voodoo driver.
However all the demos are written using the GLUT and OpenGL so they
work with any GLUT/OpenGL platform (tested: Linux+Mesa+Voodoo driver,
Linux+Mesa+X11 driver, Win95+Mesa+Voodoo driver and SGI Onyx IR thanks
to Mark Kilgard).
All the demos make an heavy use of texture mapping, blending, etc. so
you _need_ some kind of hardware support for the OpenGL otherwise they
will run at ~1fps. You need also a OpenGL 1.1 compliant library.
You can find some screenshot of these demos at
http://www-hmw.caribel.pisa.it/fxmesa/fxdemos.hmtl
Write me if you find some bug in the demos.
David Bucciarelli (tech.hmw@plus.it)
Humanware s.r.l.
Via XXIV Maggio 62
Pisa, Italy
Tel./Fax +39-50-554108
email: info.hmw@plus.it
www: www-hmw.caribel.pisa.it
A BRIEF DESCRIPTION OF THE DEMOS
--------------------------------
IPERS
-----
Sources: ipers.c image.c
A nice spinning fractal object.
RAY
---
Sources: ray.c
I'm using ray tracing to dynamically generate texture maps with
specular, diffuse, shadows, and mirror colors. Each frame the texture
maps of the plane and of the sphere are partially updated. With this
technique you can obtain true mirrors, shadows, specular highlights,
bump mapping, etc. in realtime. This demo is really CPU intensive
(~25fps on a PentiumII@300MHz with a Pure3D). Support on-the-fly
switching between fullscreen and in-window rendering under Linux/Mesa
(start your X server in 16 bpp mode and press the spacebar).
TUNNEL
------
Sources: tunnel.c image.c sources.c
Data: bw.rgb tile.rgb
The model was designed and prelighted with Alias|Wavefront
PowerAnimator V8. Triangle strips were built with a tool written by me
and then statically included in the sources. This demo doesn't
require the ZBuffer and use antialiased polygons. Support on-the-fly
switching between fullscreen and in-window rendering under Linux/Mesa
(start your X server in 16 bpp mode and press the spacebar).
TUNNEL2
------
Sources: tunnel2.c image.c sources.c
Data: bw.rgb tile.rgb
The some tunnel demo but with two output channels. A nice
example of the Mesa/Voodoo support for multiple boards in
the some PC.
TEAPOT
------
Sources: teapot.c image.c dteapot.c shadow.c
Data: bw.rgb tile.rgb
The shadow is drawn projecting the teapot geometry over the plane. All
other light effects are drawn using the standard OpenGL capabilities.
Support on-the-fly switching between fullscreen and in-window
rendering under Linux/Mesa (start your X server in 16 bpp mode and
press the spacebar).
FIRE
----
Sources: fire.c image.c
Data: s128.rgb tree2.rgb
The demo use a small particle system to draw some nice visual effect.
You can interactively change many parameters of the particle system
and you can choose the number of particles at the startup ('fire
4000'). This demo should be called fountain. Support on-the-fly
switching between fullscreen and in-window rendering under Linux/Mesa
(start your X server in 16 bpp mode and press the spacebar).
TERRAIN
-------
Sources: mesaland.c
This demo is base on another demo written by Mikael SkiZoWalker. I
have added the capabilities to freely fly around, view culling and
some nice color. Support on-the-fly switching between fullscreen and
in-window rendering under Linux/Mesa (start your X server in 16 bpp
mode and press the spacebar).
GLTEST
------
Sources: gltest.c
This is a simple benchmark suite that I'm using in the development of
the Mesa/Voodoo driver. Type 'gltest >my.res' and you will get some
data about the performances of your OpenGL. Follow the results with my
PC (Linux+Mesa-2.6+PentiumII@300MHz+Pure3D):
Simple Points
587900.080674 Pnts/sec
Smooth Lines
SIZE=480 => 39007.426183 Lins/sec
SIZE=250 => 74575.016485 Lins/sec
SIZE=100 => 179734.882409 Lins/sec
SIZE=050 => 183987.795297 Lins/sec
SIZE=025 => 183820.086309 Lins/sec
ZSmooth Triangles
SIZE=480 => 784.954997 Tris/sec
SIZE=250 => 2862.325889 Tris/sec
SIZE=100 => 17779.492938 Tris/sec
SIZE=050 => 159339.829844 Tris/sec
SIZE=025 => 428602.984008 Tris/sec
ZSmooth Tex Blend Triangles
SIZE=480 => 784.473931 Tris/sec
SIZE=250 => 2853.781513 Tris/sec
SIZE=100 => 17598.252146 Tris/sec
SIZE=050 => 152632.578337 Tris/sec
SIZE=025 => 377584.760048 Tris/sec
ZSmooth Tex Blend TMesh Triangles
SIZE=400 => 563.900695 Tris/sec, MPixel Fill/sec: 45.112056
SIZE=250 => 1449.777225 Tris/sec, MPixel Fill/sec: 45.305538
SIZE=100 => 8702.869121 Tris/sec, MPixel Fill/sec: 43.514346
SIZE=050 => 31896.867466 Tris/sec, MPixel Fill/sec: 39.871084
SIZE=025 => 114037.262894 Tris/sec, MPixel Fill/sec: 35.636645
SIZE=010 => 220494.235839 Tris/sec, MPixel Fill/sec: 11.024712
SIZE=005 => 225615.506651 Tris/sec, MPixel Fill/sec: 2.820194
SIZE=002 => 225607.681439 Tris/sec, MPixel Fill/sec: 0.451215
Color/Depth Buffer Clears
295.042474 Clrs/sec, MPixel Fill/sec: 90.553256
Follow the results with my
PC (Linux+Mesa-3.0beta5+PentiumII@300MHz+Voodoo2):
Simple Points
1620113.525130 Pnts/sec
Smooth Lines
SIZE=480 => 73841.166065 Lins/sec
SIZE=250 => 140794.035316 Lins/sec
SIZE=100 => 344185.242157 Lins/sec
SIZE=050 => 420399.008289 Lins/sec
SIZE=025 => 420261.389773 Lins/sec
ZSmooth Triangles
SIZE=480 => 1434.668506 Tris/sec
SIZE=250 => 5228.449614 Tris/sec
SIZE=100 => 46603.815842 Tris/sec
SIZE=050 => 325757.045961 Tris/sec
SIZE=025 => 589022.403336 Tris/sec
ZSmooth Tex Blend Triangles
SIZE=480 => 1414.900041 Tris/sec
SIZE=250 => 5006.055235 Tris/sec
SIZE=100 => 43602.252031 Tris/sec
SIZE=050 => 303497.092692 Tris/sec
SIZE=025 => 517087.428669 Tris/sec
ZSmooth Tex Blend TMesh Triangles
SIZE=400 => 1023.273112 Tris/sec, MPixel Fill/sec: 81.861849
SIZE=250 => 2595.692121 Tris/sec, MPixel Fill/sec: 81.115379
SIZE=100 => 15788.198912 Tris/sec, MPixel Fill/sec: 78.940995
SIZE=050 => 58784.121300 Tris/sec, MPixel Fill/sec: 73.480152
SIZE=025 => 244233.873481 Tris/sec, MPixel Fill/sec: 76.323085
SIZE=010 => 474995.004191 Tris/sec, MPixel Fill/sec: 23.749750
SIZE=005 => 475124.354163 Tris/sec, MPixel Fill/sec: 5.939054
SIZE=002 => 474959.089503 Tris/sec, MPixel Fill/sec: 0.949918
Color/Depth Buffer Clears
478.654830 Clrs/sec, MPixel Fill/sec: 146.906826
PALTEX and GLBPALTX
-------------------
Sources: paltex.c and glbpaltx.c
The PALTEX example was written by Brian Paul and it shows the
capabilities of the GL_EXT_paletted_texture extension. I have written
the other example in order to show the capabilities of the
gl3DfxSetPaletteEXT() (it used only by GLQuake and Quake2).

View File

@@ -1,71 +0,0 @@
Import('*')
progs = [
'arbfplight',
'arbfslight',
'arbocclude',
'arbocclude2',
'bounce',
'clearspd',
'copypix',
'cubemap',
'dinoshade',
'dissolve',
'drawpix',
'engine',
'fbo_firecube',
'fbotexture',
'fire',
'fogcoord',
'fplight',
'fslight',
'gamma',
'gearbox',
'gears',
'geartrain',
'glinfo',
'gloss',
'gltestperf',
'ipers',
'isosurf',
'lodbias',
'morph3d',
'multiarb',
'paltex',
'pointblast',
'projtex',
'ray',
'readpix',
'reflect',
'renormal',
'shadowtex',
'singlebuffer',
'spectex',
'spriteblast',
'stex3d',
'teapot',
'terrain',
'tessdemo',
'texcyl',
'texenv',
'textures',
'trispd',
'tunnel',
'tunnel2',
'vao_demo',
'winpos',
]
for prog in progs:
progs_env.Program(
target = prog,
source = prog + '.c',
)
progs_env.Program(
target = 'rain',
source = [
'rain.cxx',
'particles.cxx',
]
)

View File

@@ -1,101 +0,0 @@
# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=all - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "all.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "all - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "all - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "all - Win32 Release"
# Name "all - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,112 +0,0 @@
# Microsoft Developer Studio Project File - Name="bounce" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=bounce - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "bounce.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "bounce.mak" CFG="bounce - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "bounce - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "bounce - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "bounce - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../bounce.exe"
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy DLLs
PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
# End Special Build Tool
!ELSEIF "$(CFG)" == "bounce - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../bounce.exe" /pdbtype:sept
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy DLLs
PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
# End Special Build Tool
!ENDIF
# Begin Target
# Name "bounce - Win32 Release"
# Name "bounce - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\bounce.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,112 +0,0 @@
# Microsoft Developer Studio Project File - Name="clearspd" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=clearspd - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "clearspd.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "clearspd.mak" CFG="clearspd - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "clearspd - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "clearspd - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "clearspd - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../clearspd.exe"
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy DLLs
PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
# End Special Build Tool
!ELSEIF "$(CFG)" == "clearspd - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../clearspd.exe" /pdbtype:sept
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy DLLs
PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
# End Special Build Tool
!ENDIF
# Begin Target
# Name "clearspd - Win32 Release"
# Name "clearspd - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\clearspd.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,112 +0,0 @@
# Microsoft Developer Studio Project File - Name="cubemap" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=cubemap - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "cubemap.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "cubemap.mak" CFG="cubemap - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "cubemap - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "cubemap - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "cubemap - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../cubemap.exe"
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy DLLs
PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
# End Special Build Tool
!ELSEIF "$(CFG)" == "cubemap - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../cubemap.exe" /pdbtype:sept
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy DLLs
PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
# End Special Build Tool
!ENDIF
# Begin Target
# Name "cubemap - Win32 Release"
# Name "cubemap - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\cubemap.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

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